From c351ce3e04a08f52e581feeffb59e6bf388b9c3f Mon Sep 17 00:00:00 2001 From: MrScothh <167884257+MrScothh@users.noreply.github.com> Date: Sat, 19 Sep 2026 19:32:52 +0200 Subject: [PATCH] gps: give the receiver the time the protocol asks for gpsSetProtocolTimeout() stores the timeout it is given, but the check in gpsUpdate() never read it: it compared against GPS_TIMEOUT until 2022 and against baseTimeoutMs since, one second for every protocol but NMEA. The longer waits the u-blox driver asks for, three seconds while it detects the receiver and the full sweep during autobaud, were cut to that second. Detection fits in a second only when every poll is answered at once. A receiver that does not answer UBX-MON-GNSS uses up the second on two of the three polls, times out, and starts over from autobaud, so it is never configured at all: against an emulated M10 that stays silent on MON-GNSS, INAV sent MON-VER six times and MON-GNSS eleven times in twelve seconds and no configuration. The check now uses the timeout that was asked for, but never less than the base one. The configuration steps ask for GPS_SHORT_TIMEOUT, half a second, and have always had a second in practice; tightening them now could restart receivers that configure fine today, so they keep it. With the change the silent receiver is detected once and configured like any other. --- src/main/io/gps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/io/gps.c b/src/main/io/gps.c index 3d2afe754b4..2c0cb6d55db 100755 --- a/src/main/io/gps.c +++ b/src/main/io/gps.c @@ -600,8 +600,9 @@ bool gpsUpdate(void) // Call GPS protocol thread gpsProviders[gpsState.gpsConfig->provider].protocol(); - // Check for GPS timeout - if ((millis() - gpsState.lastMessageMs) > gpsState.baseTimeoutMs) { + // Check for GPS timeout. The protocol may ask for longer while it sets the + // receiver up, during autobaud or detection, but never gets less than the base + if ((millis() - gpsState.lastMessageMs) > MAX(gpsState.timeoutMs, gpsState.baseTimeoutMs)) { sensorsClear(SENSOR_GPS); DISABLE_STATE(GPS_FIX); gpsSol.fixType = GPS_NO_FIX;