mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-13 14:51:21 +10:00
fixes #1297
This commit is contained in:
+9
-5
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user