Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions Firmware/RTK_Surveyor/NtripServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ bool ntripServerConnectLimitReached()
if (ntripServerConnectionAttempts == 1)
ntripServerConnectionAttemptTimeout = 15 * 1000L; // Wait 15s
else if (ntripServerConnectionAttempts == 2)
ntripServerConnectionAttemptTimeout = 30 * 1000L; // Wait 30s
ntripServerConnectionAttemptTimeout = 30 * 1000L; // Wait 30s
else if (ntripServerConnectionAttempts == 3)
ntripServerConnectionAttemptTimeout = 1 * 60 * 1000L; // Wait 1 minute
else if (ntripServerConnectionAttempts == 4)
ntripServerConnectionAttemptTimeout = 2 * 60 * 1000L; // Wait 2 minutes
else
ntripServerConnectionAttemptTimeout = 2 * 60 * 1000L; // Wait 2 minutes
else
ntripServerConnectionAttemptTimeout =
(ntripServerConnectionAttempts - 4) * 5 * 60 * 1000L; // Wait 5, 10, 15, etc minutes between attempts

Expand Down Expand Up @@ -464,10 +464,8 @@ void ntripServerUpdate()
{
// Assume service not available
if (ntripServerConnectLimitReached()) // Update ntripServerConnectionAttemptTimeout
{
systemPrintln("NTRIP Server failed to connect! Do you have your caster address and port correct?");
}
else
else
{
if (ntripServerConnectionAttemptTimeout / 1000 < 120)
systemPrintf("NTRIP Server failed to connect to caster. Trying again in %d seconds.\r\n",
Expand Down Expand Up @@ -495,12 +493,7 @@ void ntripServerUpdate()
if (millis() - ntripServerTimer > 10000)
{
if (ntripServerConnectLimitReached())
{
systemPrintln("Caster failed to respond. Do you have your caster address and port correct?");

// Give up - Shutdown NTRIP server, no further retries
ntripServerStop(true);
}
else
{
if (ntripServerConnectionAttemptTimeout / 1000 < 120)
Expand Down Expand Up @@ -563,13 +556,8 @@ void ntripServerUpdate()

// Check for connection limit
if (ntripServerConnectLimitReached())
{
systemPrintln("NTRIP Server retry limit reached; do you have your caster address and port correct?");

// Give up - Shutdown NTRIP server, no further retries
ntripServerStop(true);
}

// Attempt to reconnect after throttle controlled timeout
else
{
Expand All @@ -579,9 +567,6 @@ void ntripServerUpdate()
else
systemPrintf("NTRIP Server attempting connection in %d minutes.\r\n",
ntripServerConnectionAttemptTimeout / 1000 / 60);

// Restart network operation after delay
ntripServerStop(false);
}
}
}
Expand Down