From 0b734828ba3d6097206d1c337d1ebf4a32f84322 Mon Sep 17 00:00:00 2001 From: tablatronix <807787+tablatronix@users.noreply.github.com> Date: Sat, 16 Dec 2023 22:16:20 -0600 Subject: [PATCH] restore getWiFiIsSaved adds lowlevelinit --- WiFiManager.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index efeb83e..764b583 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -280,7 +280,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { DEBUG_WM(F("AutoConnect")); #endif - // bool wifiIsSaved = getWiFiIsSaved(); + bool wifiIsSaved = getWiFiIsSaved(); #ifdef ESP32 setupHostname(true); @@ -300,7 +300,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { // check if wifi is saved, (has autoconnect) to speed up cp start // NOT wifi init safe - // if(wifiIsSaved){ + if(wifiIsSaved){ _startconn = millis(); _begin(); @@ -367,12 +367,12 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { #ifdef WM_DEBUG_LEVEL DEBUG_WM(F("AutoConnect: FAILED for "),(String)((millis()-_startconn)) + " ms"); #endif - // } - // else { - // #ifdef WM_DEBUG_LEVEL - // DEBUG_WM(F("No Credentials are Saved, skipping connect")); - // #endif - // } + } + else { + #ifdef WM_DEBUG_LEVEL + DEBUG_WM(F("No Credentials are Saved, skipping connect")); + #endif + } // possibly skip the config portal if (!_enableConfigPortal) { @@ -3755,6 +3755,7 @@ String WiFiManager::WiFi_SSID(bool persistent) const{ return String(reinterpret_cast(tmp)); #elif defined(ESP32) + wifiLowLevelInit(persistent); if(persistent){ wifi_config_t conf; esp_wifi_get_config(WIFI_IF_STA, &conf);