This commit is contained in:
tablatronix
2021-09-29 13:46:21 -05:00
parent 654d692025
commit deeff9fa89
2 changed files with 13 additions and 6 deletions
+9 -5
View File
@@ -332,11 +332,6 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
return true; // connected success
}
// possibly skip the config portal
if (!_enableConfigPortal) {
return false; // not connected and not cp
}
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(F("AutoConnect: FAILED"));
#endif
@@ -347,6 +342,15 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
#endif
}
// possibly skip the config portal
if (!_enableConfigPortal) {
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(DEBUG_VERBOSE,F("enableConfigPortal: FALSE, skipping "));
#endif
return false; // not connected and not cp
}
// not connected start configportal
bool res = startConfigPortal(apName, apPassword);
return res;
@@ -191,7 +191,10 @@ void setup() {
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
// use autoconnect, but prevent configportal from auto starting
wm.setEnableConfigPortal(false);
wifiInfo();
if(!wm.autoConnect("WM_AutoConnectAP","12345678")) {