From fd45c2219bd01b4bd55a6e831f696a55d0365bff Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:48:58 +0200 Subject: [PATCH] fix(gps): power saving put the receiver back to sleep before a new fix MicroNMEA's valid flag survives a power cycle, so the duty cycle saw the old fix right after waking the receiver and stopped it again a tick later: with GPS power saving on the position never updated. begin() now clears the parser. Co-Authored-By: Claude Opus 5.5 --- src/helpers/sensors/MicroNMEALocationProvider.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers/sensors/MicroNMEALocationProvider.h b/src/helpers/sensors/MicroNMEALocationProvider.h index 588b21af..be593559 100644 --- a/src/helpers/sensors/MicroNMEALocationProvider.h +++ b/src/helpers/sensors/MicroNMEALocationProvider.h @@ -86,6 +86,10 @@ public : #ifdef GPS_SKYVIEW _sky.reset(); // restarts the time-to-first-fix clock #endif + // MicroNMEA's valid flag is sticky: without this the fix from before the + // last stop() still reads valid, and the GPS duty cycle put the receiver + // back to sleep a tick after waking it, before any new position came in. + nmea.clear(); claim(); if (_pin_en != -1) { digitalWrite(_pin_en, GPS_EN_ACTIVE);