From e1d068c89929edf393a0209ba0058c503077740a Mon Sep 17 00:00:00 2001 From: ladyada Date: Tue, 15 Sep 2026 22:30:00 -0400 Subject: [PATCH] Report fresh GNSS fixes independently of GGA quality Co-authored-by: Limor Fried --- extras/hw_tests/gnss_receive/README.md | 7 +++++-- extras/hw_tests/gnss_receive/gnss_receive.ino | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/extras/hw_tests/gnss_receive/README.md b/extras/hw_tests/gnss_receive/README.md index 762b0f2..24412c1 100644 --- a/extras/hw_tests/gnss_receive/README.md +++ b/extras/hw_tests/gnss_receive/README.md @@ -6,8 +6,11 @@ format-error, and parsed-sentence counts every two seconds. Unsupported sentence types count as valid frames but do not increase the parsed count. No receiver commands are sent. A position fix is reported when available and -is not required to establish communication. Coordinates are printed only with -a recent fix. Keep raw captures private if they contain location information. +is not required to establish communication. `fix` is true only when the latest +fix status is valid and less than five seconds old; coordinates use that same +check, including for RMC/GLL-only output. `ggaQuality` reports the last GGA fix +quality separately and may be stale when GGA sentences stop arriving. Keep raw +captures private if they contain location information. | Fixture | Build selection | Receive wiring | | --- | --- | --- | diff --git a/extras/hw_tests/gnss_receive/gnss_receive.ino b/extras/hw_tests/gnss_receive/gnss_receive.ino index 24966c2..5ea217a 100644 --- a/extras/hw_tests/gnss_receive/gnss_receive.ino +++ b/extras/hw_tests/gnss_receive/gnss_receive.ino @@ -126,9 +126,12 @@ void reportGPS(Adafruit_GPS &gps, ReceiveCounts &counts, Serial.print(counts.formatErrors); Serial.print(F(" parsed=")); Serial.print(counts.parsed); + bool freshFix = gps.fix && gps.secondsSinceFix() < 5; Serial.print(F(" fix=")); + Serial.print(freshFix); + Serial.print(F(" ggaQuality=")); Serial.print(gps.fixquality); - if (gps.fix && gps.fixquality && gps.secondsSinceFix() < 5) { + if (freshFix) { Serial.print(F(" latitudeE7=")); Serial.print(gps.latitude_fixed); Serial.print(F(" longitudeE7="));