Skip to content

Commit b16c37e

Browse files
committed
Fall back to AP mode for Config if local WiFi unavailable
Fix for issue #611
1 parent 87b3465 commit b16c37e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Firmware/RTK_Surveyor/WiFi.ino

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,12 @@ void wifiSetState(byte newState)
214214
// We can also start as a WiFi station and attempt to connect to local WiFi for config
215215
bool wifiStartAP()
216216
{
217-
if (settings.wifiConfigOverAP == true)
217+
return(wifiStartAP(false)); //Don't force AP mode
218+
}
219+
220+
bool wifiStartAP(bool forceAP)
221+
{
222+
if (settings.wifiConfigOverAP == true || forceAP)
218223
{
219224
// Stop any current WiFi activity
220225
wifiStop();
@@ -275,11 +280,7 @@ bool wifiStartAP()
275280
if (x == maxTries)
276281
{
277282
displayNoWiFi(2000);
278-
if (productVariant == REFERENCE_STATION)
279-
requestChangeState(STATE_BASE_NOT_STARTED); // If WiFi failed, return to Base mode.
280-
else
281-
requestChangeState(STATE_ROVER_NOT_STARTED); // If WiFi failed, return to Rover mode.
282-
return (false);
283+
return(wifiStartAP(true)); // Because there is no local WiFi available, force AP mode so user can still get access/configure it
283284
}
284285
}
285286

0 commit comments

Comments
 (0)