Skip to content

Commit 68ec63a

Browse files
committed
NTRIP Server retries if authorized, but returns error.
NTRIP Server stops if 'banned' is detected.
1 parent 956076f commit 68ec63a

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

Firmware/RTK_Surveyor/NtripClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void ntripClientUpdate()
435435
if (strstr(response, "401") != NULL)
436436
{
437437
//Look for '401 Unauthorized'
438-
Serial.printf("NTRIP Client caster responded with bad news: %s. Are you sure your caster credentials are correct?\n\r", response);
438+
Serial.printf("NTRIP Caster responded with bad news: %s. Are you sure your caster credentials are correct?\n\r", response);
439439

440440
//Stop WiFi operations
441441
ntripClientStop(true); //Do not allocate new wifiClient

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void ntripServerUpdate()
352352
if (strlen(settings.ntripServer_wifiSSID) == 0)
353353
{
354354
Serial.println("Error: Please enter SSID before starting NTRIP Server");
355-
ntripClientSetState(NTRIP_SERVER_OFF);
355+
ntripServerSetState(NTRIP_SERVER_OFF);
356356
}
357357
else
358358
{
@@ -467,15 +467,36 @@ void ntripServerUpdate()
467467
char response[512];
468468
ntripServerResponse(response, sizeof(response));
469469

470-
//Look for '200 OK'
471-
if (strstr(response, "200") == NULL)
470+
//Look for various responses
471+
if (strstr(response, "401") != NULL)
472472
{
473473
//Look for '401 Unauthorized'
474474
Serial.printf("NTRIP Caster responded with bad news: %s. Are you sure your caster credentials are correct?\n\r", response);
475475

476-
ntripServerStop(true); //Don't allocate new wifiClient
476+
//Stop WiFi operations
477+
ntripServerStop(true); //Do not allocate new wifiClient
477478
}
478-
else
479+
else if (strstr(response, "banned") != NULL) //'Banned' found
480+
{
481+
//Look for 'HTTP/1.1 200 OK' and banned IP information
482+
Serial.printf("NTRIP Server connected to caster but caster reponded with problem: %s", response);
483+
484+
//Stop WiFi operations
485+
ntripServerStop(true); //Do not allocate new wifiClient
486+
}
487+
else if (strstr(response, "200") == NULL) //'200' not found
488+
{
489+
//Look for 'ERROR - Mountpoint taken' from Emlid.
490+
Serial.printf("NTRIP Server connected but caster reponded with problem: %s", response);
491+
492+
//Attempt to reconnect after throttle controlled timeout
493+
if (ntripServerConnectLimitReached())
494+
{
495+
Serial.println("Caster failed to respond. Do you have your caster address and port correct?");
496+
}
497+
}
498+
else if (strstr(response, "200") != NULL) //'200' found
499+
479500
{
480501
Serial.printf("NTRIP Server connected to %s:%d %s\r\n",
481502
settings.ntripServer_CasterHost,

0 commit comments

Comments
 (0)