This commit is contained in:
tablatronix
2021-04-22 17:16:34 -05:00
parent bcf1dd69ff
commit 8448d66ea7
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -785,15 +785,20 @@ uint8_t WiFiManager::processConfigPortal(){
if (connectWifi(_ssid, _pass, _connectonsave) == WL_CONNECTED) {
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(F("Connect to new AP [SUCCESS]"));
DEBUG_WM(F("Got IP Address:"));
DEBUG_WM(WiFi.localIP());
if(_connectonsave){
DEBUG_WM(F("SAVED with no connect to new AP"));
} else {
DEBUG_WM(F("Connect to new AP [SUCCESS]"));
DEBUG_WM(F("Got IP Address:"));
DEBUG_WM(WiFi.localIP());
}
#endif
if ( _savewificallback != NULL) {
_savewificallback();
}
shutdownConfigPortal();
if(_connectonsave) return WL_IDLE_STATUS;
return WL_CONNECTED; // CONNECT SUCCESS
}
#ifdef WM_DEBUG_LEVEL
@@ -920,7 +925,7 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass, bool connect) {
wifiConnectNew(ssid,pass,connect);
if(_saveTimeout > 0){
connRes = waitForConnectResult(_saveTimeout); // use default save timeout for saves to prevent bugs in esp->waitforconnectresult loop
}
}
else {
connRes = waitForConnectResult(0);
}
+1 -1
View File
@@ -432,7 +432,7 @@ class WiFiManager
unsigned long _startscan = 0; // ms for timing wifi scans
int _cpclosedelay = 2000; // delay before wifisave, prevents captive portal from closing to fast.
bool _cleanConnect = false; // disconnect before connect in connectwifi, increases stability on connects
bool _connectOnsave = true; // connect to wifi when saving creds
bool _connectonsave = true; // connect to wifi when saving creds
bool _disableSTA = false; // disable sta when starting ap, always
bool _disableSTAConn = true; // disable sta when starting ap, if sta is not connected ( stability )
bool _channelSync = false; // use same wifi sta channel when starting ap