Browse Source

Disconnect without blanking SSID and password (#58)

* Disconnect without blanking SSID and password

* Bump version number (#58)
Germán Martín 5 years ago
parent
commit
bf342327f2
3 changed files with 10 additions and 3 deletions
  1. 8 1
      ESPAsyncWiFiManager.cpp
  2. 1 1
      library.json
  3. 1 1
      library.properties

+ 8 - 1
ESPAsyncWiFiManager.cpp

@@ -487,7 +487,14 @@ boolean  AsyncWiFiManager::startConfigPortal(char const *apName, char const *apP
     {
       DEBUG_WM(F("About to scan()"));
       shouldscan=true;  // since we are modal, we can scan every time
-      WiFi.disconnect(); // we might still be connecting, so that has to stop for scanning
+    #if defined(ESP8266)
+      // we might still be connecting, so that has to stop for scanning
+      ETS_UART_INTR_DISABLE ();
+      wifi_station_disconnect ();
+      ETS_UART_INTR_ENABLE ();
+    #else
+      WiFi.disconnect (false);
+    #endif
       scan();
       if(_tryConnectDuringConfigPortal) WiFi.begin(); // try to reconnect to AP
       scannow= millis() ;

+ 1 - 1
library.json

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

+ 1 - 1
library.properties

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