Skip to content

Commit 5074c60

Browse files
committed
L-Band Keys: Limit WiFi connection attempts when no WiFi available
Fix for issue #454
1 parent fc7283c commit 5074c60

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Firmware/RTK_Surveyor/States.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,11 @@ void updateSystemState()
740740
else if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectNextKey) == 0)
741741
{
742742
log_d("L_Band Keys starting WiFi");
743+
744+
//Temporarily limit WiFi connection attempts
745+
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
746+
wifiMaxConnectionAttempts = 0; //Override setting during key retrieval. Give up after single failure.
747+
743748
wifiStart();
744749
changeState(STATE_KEYS_PROVISION_WIFI_STARTED);
745750
}
@@ -775,6 +780,11 @@ void updateSystemState()
775780
if (online.rtc == false)
776781
{
777782
log_d("Keys Needed RTC off starting WiFi");
783+
784+
//Temporarily limit WiFi connection attempts
785+
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
786+
wifiMaxConnectionAttempts = 0; //Override setting during key retrieval. Give up after single failure.
787+
778788
wifiStart();
779789
changeState(STATE_KEYS_WIFI_STARTED); //If we can't check the RTC, continue
780790
}

0 commit comments

Comments
 (0)