Skip to content

Add generic GPS UART and NMEA diagnostics - #3200

Open
F4FPR wants to merge 3 commits into
meshcore-dev:devfrom
F4FPR:gps-diag-command
Open

Add generic GPS UART and NMEA diagnostics#3200
F4FPR wants to merge 3 commits into
meshcore-dev:devfrom
F4FPR:gps-diag-command

Conversation

@F4FPR

@F4FPR F4FPR commented Aug 13, 2026

Copy link
Copy Markdown

What

Adds a compact, observation-only gps diag command available through the normal CLI
reply path.

The generic LocationProvider fallback reports enable state, satellites and fix state.
MicroNMEALocationProvider additionally reports:

  • UART byte count and last-byte age;
  • checksum-valid and checksum-invalid NMEA sentence counts;
  • age of the last checksum-valid NMEA sentence;
  • age of the last newly parsed valid-fix GGA/RMC sentence;
  • begin() and stop() call counts.

The command also reports the requested GPS setting separately from the provider enable
state. The output is compact enough for the existing 160-byte CLI reply buffer.

Why

During field testing, a ThinkNode M6 with an L76K went from a valid 18/20 satellite fix
to persistent on, active, no fix, 0 sats without a node reboot. A gps off/gps on
cycle did not recover it. The existing gps command cannot distinguish a silent
module/UART from a live receiver that is still sending valid NMEA but sees no satellites.

These diagnostics make that distinction without streaming raw NMEA and are useful for
all serial GNSS receivers using MicroNMEALocationProvider, not only the M6.

Implementation notes

MicroNMEA 2.0.6 states that process() returning true means a complete non-empty
sentence was processed, but that sentence may be invalid. This change therefore uses
MicroNMEA::testChecksum() for the ok/bad counters. The fix age is updated only
after a newly parsed, checksum-valid GGA or RMC sentence reports a valid fix, so unrelated
NMEA traffic cannot make an old fix appear fresh.

Scope

  • no GPS power, timing, reset or constellation changes;
  • no raw NMEA output;
  • no automatic recovery;
  • other location providers use the generic fallback diagnostics.

Related to #2862 and #2863.

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