Skip to content

Commit

Permalink
Fix SSID and Pass not being saved after configPortal (#104)
Browse files Browse the repository at this point in the history
* Fix SSID and Pass now being saved after configPortal

Adding WiFi.persistent(true) and WiFi.persistent(false) as suggested by @BDskii in #102

* version bump to 0.31
  • Loading branch information
pedrosousabarreto authored Jan 22, 2022
1 parent 0a0cedc commit 3b9a58a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
},
"frameworks": "arduino",
"platforms": ["espressif8266", "espressif32"],
"version": "0.30"
"version": "0.31"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP Async WiFi Manager
version=0.30
version=0.31
author=alanswx
maintainer=alanswx
sentence=ESP8266 and ESP32 Async WiFi Connection manager with fallback web configuration portal
Expand Down
2 changes: 2 additions & 0 deletions src/ESPAsyncWiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,10 @@ boolean AsyncWiFiManager::startConfigPortal(char const *apName, char const *apPa
DEBUG_WM(F("Connecting to new AP"));

// using user-provided _ssid, _pass in place of system-stored ssid and pass
WiFi.persistent(true);
if (_tryConnectDuringConfigPortal and connectWifi(_ssid, _pass) == WL_CONNECTED)
{
WiFi.persistent(false);
// connected
WiFi.mode(WIFI_STA);
// notify that configuration has changed and any optional parameters should be saved
Expand Down

0 comments on commit 3b9a58a

Please sign in to comment.