Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont save ssid and pass #102

Open
BDskii opened this issue Dec 5, 2021 · 1 comment
Open

dont save ssid and pass #102

BDskii opened this issue Dec 5, 2021 · 1 comment

Comments

@BDskii
Copy link

BDskii commented Dec 5, 2021

for save wifi config must call wifi_station_set_config but in ESP8266WiFiSTA.cpp :
if(WiFi._persistent) { wifi_station_set_config(&conf); } else { wifi_station_set_config_current(&conf); }
and default _persistent == false

fo fix it need add WiFi.persistent(true); before if (connectWifi(_ssid, _pass) == WL_CONNECTED)
and WiFi.persistent(false); after

@ThomasH-W
Copy link

ThomasH-W commented Dec 30, 2021

@BDskii thank you for providing the solution. Let me restate the issue and solution.
Same problem like issue #83 https://github.com/alanswx/ESPAsyncWiFiManager/issues/83
Problem:
When a connection to the WiFi network can't be established the captive portal will be displayed.
After selecting a WiFi network and providing the correct password, the device is connecting to the network but the credentials are not saved. After reboot, the captive portal will start again as the credentials are missing.
Solution:
Update file ESPAsyncWiFiManager.cpp,
line 646 in function "boolean AsyncWiFiManager::startConfigPortal(char const *apName, char const *apPassword)"

// using user-provided _ssid, _pass in place of system-stored ssid and pass WiFi.persistent(true); // update according to BDskii - see last line as well if (connectWifi(_ssid, _pass) == WL_CONNECTED) { // connected WiFi.mode(WIFI_STA); // notify that configuration has changed and any optional parameters should be saved if (_savecallback != NULL) { // TODO: check if any custom parameters actually exist, and check if they really changed maybe _savecallback(); } break; } else { DEBUG_WM(F("Failed to connect")); } WiFi.persistent(false); // update according to BDskii

alanswx pushed a commit that referenced this issue Jan 22, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants