From cfe2619069b411a5a5363d454e82f8a7da47e11b Mon Sep 17 00:00:00 2001 From: Shawn A <807787+tablatronix@users.noreply.github.com> Date: Sat, 22 Jan 2022 10:15:58 -0600 Subject: [PATCH] add debugging --- WiFiManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index f53e389..255844d 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -3405,11 +3405,16 @@ bool WiFiManager::WiFi_enableSTA(bool enable,bool persistent) { return ret; #endif } + bool WiFiManager::WiFi_enableSTA(bool enable) { return WiFi_enableSTA(enable,false); } bool WiFiManager::WiFi_eraseConfig() { + #ifdef WM_DEBUG_LEVEL + DEBUG_WM(DEBUG_DEV,F("WiFi_eraseConfig")); + #endif + #ifdef ESP8266 #ifndef WM_FIXERASECONFIG return ESP.eraseConfig(); @@ -3427,10 +3432,12 @@ bool WiFiManager::WiFi_eraseConfig() { return true; #endif #elif defined(ESP32) + bool ret; WiFi.mode(WIFI_AP_STA); // cannot erase if not in STA mode ! WiFi.persistent(true); ret = WiFi.disconnect(true,true); + delay(500); WiFi.persistent(false); return ret; #endif