ソースを参照

Persistent removal of WIFI credentials in STA mode (#84)

* Update ESPAsyncWiFiManager.cpp

persistent removal of Wifi credentials

* Update library.json

increase version number

* Update library.properties

increase version number
Clemens Arth 3 年 前
コミット
870d5f28cc
3 ファイル変更8 行追加3 行削除
  1. 6 1
      ESPAsyncWiFiManager.cpp
  2. 1 1
      library.json
  3. 1 1
      library.properties

+ 6 - 1
ESPAsyncWiFiManager.cpp

@@ -687,7 +687,12 @@ String AsyncWiFiManager::getConfigPortalSSID() {
 void AsyncWiFiManager::resetSettings() {
   DEBUG_WM(F("settings invalidated"));
   DEBUG_WM(F("THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA."));
-  WiFi.disconnect(true);
+	
+  WiFi.mode(WIFI_AP_STA); // cannot erase if not in STA mode !
+  WiFi.persistent(true);
+  WiFi.disconnect(true,true);
+  WiFi.persistent(false);	
+	
   //delay(200);
 }
 void AsyncWiFiManager::setTimeout(unsigned long seconds) {

+ 1 - 1
library.json

@@ -9,5 +9,5 @@
   },
   "frameworks": "arduino",
   "platforms": ["espressif8266", "espressif32"],
-  "version": "0.24"
+  "version": "0.25"
 }

+ 1 - 1
library.properties

@@ -1,5 +1,5 @@
 name=ESP Async WiFi Manager
-version=0.24
+version=0.25
 author=alanswx
 maintainer=alanswx
 sentence=ESP8266 and ESP32 Async WiFi Connection manager with fallback web configuration portal