Skip to content

Limit the first periodic GPS acquisition after boot - #3823

Open
AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/gps-first-fix-timeout
Open

AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/gps-first-fix-timeout

Conversation

@AlexandrTyshchenko

Copy link
Copy Markdown

Before the first fix since boot, a periodic acquisition has no timeout ("cold start can be long"). If no fix is ever accepted — no sky view, a disconnected antenna, or GPS_GUARD rejecting spoofed fixes — the receiver stays on until a fix is accepted. On a solar node that's tens of mA for as long as the condition lasts, and the fix-stats never report a miss.

This gives that window its own limit, GPS_FIRST_FIX_TIMEOUT_MS: 15 min by default (a full almanac download takes 12.5 min, so a cold start without backup power still fits). When it expires, the window counts as a miss and the next acquisition starts after the configured period. 0 keeps the current behaviour. Windows after the first fix still use GPS_PERIODIC_ACQUISITION_TIMEOUT_MS (5 min).

Tested on a Faketec (nRF52840, u-blox MAX-M10S, GPS_GUARD), built with GPS_FIRST_FIX_TIMEOUT_MS=60000 and a 2 min period:

  • boot without antenna: receiver powered off after ~60 s, gps fix_stats → miss:1; next window the same (miss:2)
  • antenna connected during GPS spoofing (all fixes rejected as rej region): every window stopped at the limit, miss:3 … miss:9 over ~25 min
  • after the spoofing ended: fix accepted, ttf:7s ok:1 miss:0

Also builds for RAK_4631_repeater, with and without GPS_GUARD / GPS_FIRST_FIX_TIMEOUT_MS=0.

Before the first fix since boot, a periodic acquisition had no timeout. If no
fix is accepted (no sky view, no antenna, or a guard rejecting spoofed fixes),
the receiver then stayed on until a fix was accepted.

Give that window its own limit, GPS_FIRST_FIX_TIMEOUT_MS (15 min by default,
enough for a full almanac; 0 keeps the old behaviour). It counts as a miss and
the next acquisition starts after the configured period.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant