Skip to content

Commit ef24b66

Browse files
committed
Add printing of NTRIP Server during error reporting
1 parent ea0e4ff commit ef24b66

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Firmware/RTK_Everywhere/NtripServer.ino

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,8 @@ void ntripServerUpdate(int serverIndex)
663663
// Assume service not available
664664
if (ntripServerConnectLimitReached(serverIndex)) // Update ntripServer->connectionAttemptTimeout
665665
systemPrintf(
666-
"NTRIP Server %d failed to connect! Do you have your caster address and port correct?\r\n",
667-
serverIndex);
666+
"NTRIP Server %d - %s failed to connect! Do you have your caster address and port correct?\r\n",
667+
serverIndex, settings.ntripServer_CasterHost[serverIndex]);
668668
}
669669
else
670670
{
@@ -690,8 +690,8 @@ void ntripServerUpdate(int serverIndex)
690690
if (millis() - ntripServer->timer > 10000)
691691
{
692692
if (ntripServerConnectLimitReached(serverIndex))
693-
systemPrintf("Caster %d failed to respond. Do you have your caster address and port correct?\r\n",
694-
serverIndex);
693+
systemPrintf("Caster %d - %s failed to respond. Do you have your caster address and port correct?\r\n",
694+
serverIndex, settings.ntripServer_CasterHost[serverIndex]);
695695
}
696696
}
697697
else
@@ -701,26 +701,26 @@ void ntripServerUpdate(int serverIndex)
701701
ntripServerResponse(serverIndex, response, sizeof(response));
702702

703703
if (settings.debugNtripServerState)
704-
systemPrintf("Server %d Response: %s\r\n", serverIndex, response);
704+
systemPrintf("Server %d - %s Response: %s\r\n", serverIndex, settings.ntripServer_CasterHost[serverIndex], response);
705705
else
706-
log_d("Server %d Response: %s", serverIndex, response);
706+
log_d("Server %d - %s Response: %s", serverIndex, settings.ntripServer_CasterHost[serverIndex], response);
707707

708708
// Look for various responses
709709
if (strstr(response, "200") != nullptr) //'200' found
710710
{
711711
// We got a response, now check it for possible errors
712712
if (strcasestr(response, "banned") != nullptr)
713713
{
714-
systemPrintf("NTRIP Server %d connected to caster but caster responded with banned error: %s\r\n",
715-
serverIndex, response);
714+
systemPrintf("NTRIP Server %d connected to %s but caster responded with banned error: %s\r\n",
715+
serverIndex, settings.ntripServer_CasterHost[serverIndex], response);
716716

717717
// Stop NTRIP Server operations
718718
ntripServerShutdown(serverIndex);
719719
}
720720
else if (strcasestr(response, "sandbox") != nullptr)
721721
{
722-
systemPrintf("NTRIP Server %d connected to caster but caster responded with sandbox error: %s\r\n",
723-
serverIndex, response);
722+
systemPrintf("NTRIP Server %d connected to %s but caster responded with sandbox error: %s\r\n",
723+
serverIndex, settings.ntripServer_CasterHost[serverIndex], response);
724724

725725
// Stop NTRIP Server operations
726726
ntripServerShutdown(serverIndex);
@@ -754,8 +754,8 @@ void ntripServerUpdate(int serverIndex)
754754
// Other errors returned by the caster
755755
else
756756
{
757-
systemPrintf("NTRIP Server %d connected but caster responded with problem: %s\r\n", serverIndex,
758-
response);
757+
systemPrintf("NTRIP Server %d connected but %s responded with problem: %s\r\n", serverIndex,
758+
settings.ntripServer_CasterHost[serverIndex], response);
759759

760760
// Check for connection limit
761761
if (ntripServerConnectLimitReached(serverIndex))
@@ -770,20 +770,20 @@ void ntripServerUpdate(int serverIndex)
770770
case NTRIP_SERVER_CASTING:
771771
// Determine if the network has failed
772772
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
773-
// Failed to connect to to the network, attempt to restart the network
773+
// Failed to connect to the network, attempt to restart the network
774774
ntripServerRestart(serverIndex);
775775

776776
// Check for a broken connection
777777
else if (!ntripServer->networkClient->connected())
778778
{
779779
// Broken connection, retry the NTRIP connection
780-
systemPrintf("Connection to NTRIP Caster %d was lost\r\n", serverIndex);
780+
systemPrintf("Connection to NTRIP Caster %d - %s was lost\r\n", serverIndex, settings.ntripServer_CasterHost[serverIndex]);
781781
ntripServerRestart(serverIndex);
782782
}
783783
else if ((millis() - ntripServer->timer) > (10 * 1000))
784784
{
785785
// GNSS stopped sending RTCM correction data
786-
systemPrintf("NTRIP Server %d breaking connection to caster due to lack of RTCM data!\r\n", serverIndex);
786+
systemPrintf("NTRIP Server %d breaking connection to %s due to lack of RTCM data!\r\n", serverIndex, settings.ntripServer_CasterHost[serverIndex]);
787787
ntripServerRestart(serverIndex);
788788
}
789789
else
@@ -801,7 +801,7 @@ void ntripServerUpdate(int serverIndex)
801801
ntripServer->connectionAttempts = 0;
802802
ntripServer->connectionAttemptTimeout = 0;
803803
if (settings.debugNtripServerState)
804-
systemPrintf("NTRIP Server %d resetting connection attempt counter and timeout\r\n", serverIndex);
804+
systemPrintf("NTRIP Server %d - %s resetting connection attempt counter and timeout\r\n", serverIndex, settings.ntripServer_CasterHost[serverIndex]);
805805
}
806806
}
807807
break;

0 commit comments

Comments
 (0)