Skip to content

Commit f191b76

Browse files
committed
Move connection timeout countdowns to printfs
1 parent c6f9eb1 commit f191b76

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static int ntripServerConnectionAttempts;
7373
//Throttle the time between connection attempts
7474
static int ntripServerConnectionAttemptTimeout = 0;
7575
static uint32_t ntripServerLastConnectionAttempt = 0;
76+
static uint32_t ntripServerTimeoutPrint = 0;
7677

7778
//Last time the NTRIP server state was displayed
7879
static uint32_t ntripServerStateLastDisplayed = 0;
@@ -351,10 +352,10 @@ void ntripServerUpdate()
351352
}
352353
else
353354
{
354-
if (millis() - startTime > 1000)
355+
if (millis() - ntripServerTimeoutPrint > 1000)
355356
{
356-
startTime = millis();
357-
log_d("NTRIP Server connection timeout wait: %d of %d \n\r",
357+
ntripServerTimeoutPrint = millis();
358+
Serial.printf("NTRIP Server connection timeout wait: %d of %d seconds \n\r",
358359
(millis() - ntripServerLastConnectionAttempt) / 1000,
359360
ntripServerConnectionAttemptTimeout / 1000
360361
);
@@ -479,7 +480,7 @@ void ntripServerUpdate()
479480
if (!ntripServer->connected())
480481
{
481482
//Broken connection, retry the NTRIP server connection
482-
Serial.println("NTRIP Server connection dropped");
483+
Serial.println("Connection to NTRIP Server was closed");
483484
ntripServerStop(false); //Allocate new wifiClient
484485
}
485486
else if ((millis() - ntripServerTimer) > (3 * 1000))

0 commit comments

Comments
 (0)