#72 lost wifi config
This commit is contained in:
parent
ced4c9f8fc
commit
403ed1d350
19
src/wifi.cpp
19
src/wifi.cpp
@ -279,16 +279,19 @@ bool WifiConnection::connect() {
|
|||||||
if (!waitForConnection(timeout)) {
|
if (!waitForConnection(timeout)) {
|
||||||
Log.warning(F("WIFI: Failed to connect to first SSID %s." CR),
|
Log.warning(F("WIFI: Failed to connect to first SSID %s." CR),
|
||||||
myConfig.getWifiSSID(0));
|
myConfig.getWifiSSID(0));
|
||||||
connectAsync(1);
|
|
||||||
|
|
||||||
if (waitForConnection(timeout)) {
|
if (strlen(myConfig.getWifiSSID(1))) {
|
||||||
Log.notice(
|
connectAsync(1);
|
||||||
F("WIFI: Connected to second SSID %s, making secondary default." CR),
|
|
||||||
myConfig.getWifiSSID(1));
|
|
||||||
|
|
||||||
myConfig.swapPrimaryWifi();
|
if (waitForConnection(timeout)) {
|
||||||
myConfig.saveFile();
|
Log.notice(
|
||||||
return true;
|
F("WIFI: Connected to second SSID %s, making secondary default." CR),
|
||||||
|
myConfig.getWifiSSID(1));
|
||||||
|
|
||||||
|
myConfig.swapPrimaryWifi();
|
||||||
|
myConfig.saveFile();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.warning(F("WIFI: Failed to connect to any SSID." CR));
|
Log.warning(F("WIFI: Failed to connect to any SSID." CR));
|
||||||
|
Loading…
Reference in New Issue
Block a user