Skip to content

Commit ffa047c

Browse files
author
Lee Leahy
committed
NTRIP Server: Force backoff when the caster link breaks
1 parent 0fbdaf8 commit ffa047c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,12 @@ bool ntripServerConnectLimitReached()
262262
bool limitReached = (ntripServerConnectionAttempts >= MAX_NTRIP_SERVER_CONNECTION_ATTEMPTS);
263263

264264
// Shutdown the NTRIP server
265-
ntripServerStop(limitReached);
265+
ntripServerStop(limitReached || (!settings.enableNtripServer));
266266

267267
ntripServerConnectionAttempts++;
268268
ntripServerConnectionAttemptsTotal++;
269+
if (settings.debugNtripServerState)
270+
ntripServerPrintStatus();
269271

270272
if (limitReached == false)
271273
{
@@ -282,7 +284,7 @@ bool ntripServerConnectLimitReached()
282284
(ntripServerConnectionAttempts - 4) * 5 * 60 * 1000L; // Wait 5, 10, 15, etc minutes between attempts
283285

284286
// Display the delay before starting the NTRIP server
285-
if (ntripServerConnectionAttemptTimeout)
287+
if (settings.debugNtripServerState && ntripServerConnectionAttemptTimeout)
286288
{
287289
seconds = ntripServerConnectionAttemptTimeout / 1000;
288290
if (seconds < 120)
@@ -451,7 +453,7 @@ void ntripServerRestart()
451453
// Save the previous uptime value
452454
if (ntripServerState == NTRIP_SERVER_CASTING)
453455
ntripServerStartTime = ntripServerTimer - ntripServerStartTime;
454-
ntripServerStop(!settings.enableNtripServer);
456+
ntripServerConnectLimitReached();
455457
}
456458

457459
// Update the state of the NTRIP server state machine

0 commit comments

Comments
 (0)