Repository navigation
feat(gps): turn the GPS on by default on the SenseCAP Solar - #23
Merged
Elektr0Vodka merged 1 commit intoOct 19, 2026
Merged
Elektr0Vodka merged 1 commit into
Elektr0Vodka merged 1 commit into
Conversation
The SenseCAP Solar P1-Pro carries a GNSS module (AT6558R, L76K-compatible), but every role ships with gps_enabled = 0. Until someone runs "gps on", the node never syncs its clock: a factory unit on v1.14.1 reported 15/5/2024 UTC on 18 October 2026. A new build flag GPS_DEFAULT_ON makes the first boot turn the GPS on. A new prefs field gps.dflt_on records that this happened. Prefs saved by older firmware lack the field, so nodes updated over the air get the GPS turned on once as well. A later "gps off" is kept across reboots, because the marker stays set. Without the flag nothing changes. The logic is in src/helpers/GpsDefault.h and runs after the prefs load, in CommonCLI::loadPrefs (repeater, room server, sensor) and in the companion MyMesh::begin. Only variants/sensecap_solar sets the flag. Verified on a SenseCAP Solar P1-Pro over USB: - old build with "gps off", then this build flashed: gps reports on - "gps off", 2 reboots: stays off - "gps on", reboot: on - outdoors with 6 satellites the clock was set to 18/10/2026 UTC pio test -e native: 250/250 passed, 4 of them new in test_gps_default. Built SenseCap_Solar repeater, room server, companion_radio_ble and RAK_4631_repeater (no flag). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SenseCAP Solar P1-Pro has a GNSS module, but every role ships with the GPS off. Its clock stays wrong until someone runs
gps on. This PR turns the GPS on once on that board, also on nodes updated over the air. A latergps offstays in place.Situation
10:53 - 15/5/2024 UTCon 18 October 2026, withgpsreportingoff._prefs.gps_enabled = 0(examples/simple_repeater/MyMesh.cpp:924, and the same in the room server, sensor and companion).dmc-dev. With NMEA debug on, the module identifies asIC=AT6558R,SW=URANUS5,V5.3.0.0, and sends NMEA at 9600 baud. Boot logsGPS detected, thanks to the 5 s detection window from GPS: poll up to 5s for cold-start detection instead of a single 1s check meshcore-dev/MeshCore#2838.My changes in this PR
GPS_DEFAULT_ON, set only invariants/sensecap_solar/platformio.ini. Without it nothing changes.gps.dflt_on(gps_default_applied) insrc/helpers/CommonCLI.handexamples/companion_radio/NodePrefs.h.src/helpers/GpsDefault.h:applyGpsDefaultOn()setsgps_enabled = 1and the marker when the marker is 0, and reports whether to save.CommonCLI::loadPrefs(repeater, room server, sensor) and in the companionMyMesh::begin.gps offsurvives reboots.docs/cli_commands.md: the GPS default documented.AGENTS.md: the touched shared files listed.Verification
On a SenseCAP Solar P1-Pro over USB:
gpsreplygps offoffon, active, no fix, 0 satsgps off, 2 rebootsoffgps on, rebooton, active, no fix, 0 satsOutdoors the same node reached
on, active, fix, 6 sats, andclockread11:40 - 18/10/2026 UTC. That ran ondmc-devwithout this change, because the clock sync code is not touched here.pio test -e native: 250/250 passed, 4 of them new intest/test_gps_default. The tests cover the helper, and a prefs JSON load and save round trip on the companionNodePrefs.pio test -e native_kiss_modemerrors locally with exit code 0xC0000139 on this change and on cleandmc-devalike. That is a Windows toolchain DLL error, so CI is the check for that suite.SenseCap_Solar_repeater,SenseCap_Solar_room_server,SenseCap_Solar_companion_radio_ble,RAK_4631_repeater(no flag).Not in this PR
devcomes as a separate step.🤖 Generated with Claude Code