Repository navigation
Conversation
Builds compiled without ENV_INCLUDE_GPS (e.g. Xiao_nrf52) compiled out the 'gps advert' command, the only way to view or change the advert location policy. A node whose stored policy was 'none' (or 'share') could therefore never advertise the lat/lon set via 'set lat'/'set lon'. - 'gps advert [none|prefs]' is now available in all builds; 'share' is rejected without GPS support. - buildAdvertData() only honours ADVERT_LOC_SHARE when GPS is compiled in, so a stale 'share' falls back to the configured lat/lon instead of advertising 0,0 (supersedes meshcore-dev#3391). - Docs: move the policy command out of the GPS-only section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Thanks for pointing the issue, it's necessary to fix that But I think the problem is not with the gps command not being accessible when there is no gps. The problem is that this should not be a gps command ;) So I've introduced |
Author
Fully agreed, that makes more sense. Thank you! |
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.
Fixes #3642 (also reported in #3647).
Problem
Builds without
ENV_INCLUDE_GPS(Xiao nRF52/S3/C3, ProMicro, ikoka, some RAK4631 and LilyGo T-LoRa builds, …) compile out everygps …CLI command, includinggps advert, the only command that can read or changeadvert_loc_policy. If the stored policy isnone, the node never advertises the position set withset lat/set lon, and nothing can be done about it from the CLI.This was confirmed on a Xiao nRF52840 + Wio-SX1262 repeater running v1.18.0: lat/lon were set and readable with
get lat/lon, but adverts carried no location. With this patch,gps advertreported> none, and aftergps advert prefsthe location appeared in adverts.Changes
gps advert/gps advert none|prefsis now available in all builds.gps advert sharerepliesError, no GPS supportwhen GPS isn't compiled in. The other GPS commands are unchanged and still gated.buildAdvertData()only honoursADVERT_LOC_SHAREwhen GPS is compiled in, so a stalesharein a no-GPS build falls back to the configured lat/lon instead of advertising 0,0. This is the "just guard the SHARE branch" shape suggested in the review of Honour advert location policy in builds without GPS #3391, which this supersedes. As f3sty noted there, Honour advert location policy in builds without GPS #3391 alone can't help a node stuck atnone.cli_commands.md.The default (
prefsfor repeater/room server/sensor) and privacy behaviour are unchanged: setting lat/lon still doesn't turn location sharing on by itself.Testing
pio runpasses forXiao_nrf52_repeater,Xiao_nrf52_room_server,RAK_4631_repeater(no GPS) andHeltec_v3_repeater(GPS).pio test -e native: 64/64 pass.repeater-v1.18.0):gps advert→> none;gps advert prefs; the location is then present in adverts.🤖 Generated with Claude Code