WiFiManager: wifiManager.getWiFiPass() returns an empty string
Using ESP32 version 1.0.4 on development branch.
After successful config, calling wifiManager.getWiFiPass(true) consistently returns an empty string.
POST SERIAL OUTPUT !
Code:
preferences.putString(ATTR_WIFI_SSID, wifiManager.getWiFiSSID(true /*persistent*/));
preferences.putString(ATTR_WIFI_PASS, wifiManager.getWiFiPass(true /*persistent*/));
Serial.printf("wifiManager id: %s value: %s\n", ATTR_WIFI_SSID, preferences.getString(ATTR_WIFI_SSID).c_str());
Serial.printf("**BUG** wifiManager id: %s value: %s\n", ATTR_WIFI_PASS, preferences.getString(ATTR_WIFI_PASS).c_str());
Serial.printf("**BUG** wifiManager id: %s value: %s\n", ATTR_WIFI_PASS, wifiManager.getWiFiPass(true).c_str());
Serial.printf("**BUG** wifiManager id: %s value: %s\n", ATTR_WIFI_PASS, wifiManager.getWiFiPass(false).c_str());
Output:
07:07:26.627 -> wifiManager id: wifi_ssid value: exampleSSID
07:07:26.627 -> **BUG** wifiManager id: wifi_pass value:
07:07:26.627 -> **BUG** wifiManager id: wifi_pass value:
07:07:26.627 -> **BUG** wifiManager id: wifi_pass value:
07:07:26.627 -> id: wifi_pass value: SuperSecret valueLen: 40 label: ssid password (to be saved)
07:07:26.627 -> wifiManager parameters saved as preferences
if you have a stack dump decode it: N/A
----------------------------- Remove above -----------------------------
Basic Infos
Hardware
WiFimanager Branch/Release:
- Master
- Development
Esp8266/Esp32:
- ESP8266
- ESP32
Hardware: ESP-12e, esp01, esp25
- ESP01
- ESP12 E/F/S (nodemcu, wemos, feather) – https://learn.adafruit.com/adafruit-huzzah32-esp32-feather
- Other
ESP Core Version: 2.4.0, staging
- ESP32 version 1.0.4
Description
wifiManager.getWiFiPass(true); OR wifiManager.getWiFiPass(false); are not returning the SSID password configured.
Settings in IDE
N/A
Additional libraries: N/A
Sketch
Debug Messages
N/A
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 19 (6 by maintainers)
Commits related to this issue
- wifiManager.getWiFiPass() returns an empty string Use this commit and the readme on this repo to reproduce issue: Serial.printf("**BUG** wifiManager id: %s value: %s\n", ATTR_WIFI_PASS, preferences.... — committed to flavio-fernandes/persistWifiSetting by flavio-fernandes 4 years ago
- hackForIssue1004 Trying out change proposed by gauix4 on https://github.com/tzapu/WiFiManager/issues/1004#issuecomment-583530881 It worked as expected! Meaning, Open wifiManager.getWiFiPass() shoul... — committed to flavio-fernandes/WiFiManager by flavio-fernandes 4 years ago
- hackForIssue1004 Trying out change proposed by gauix4 on https://github.com/tzapu/WiFiManager/issues/1004#issuecomment-583530881 It worked as expected! So, this may mean that wifiManager.getWiFiPass... — committed to flavio-fernandes/WiFiManager by flavio-fernandes 4 years ago
- hackForIssue1004 Trying out change proposed by gauix4 on https://github.com/tzapu/WiFiManager/issues/1004#issuecomment-583530881 — committed to flavio-fernandes/persistWifiSetting by flavio-fernandes 4 years ago
hello @gauix4 . My code is here:
https://github.com/flavio-fernandes/persistWifiSetting
You can look at branch issueWifiPass for how I reproduce it.
I am good dealing with this issue now, thanks to your help and @tablatronix .
Much appreciated.
@flavio-fernandes can you drop your code here i take a look and test
wifimanager restores the wifi mode that it was at in your sketch, Your mode is WIFI_OFF
if you call autoconnect we change this automatically, you are not calling it. You will need to set a mode in your sketch in setup, as esp32 does not automatically do this like esp8266. Also as in wm v.0 as it was buggy and clobbered your settings. development now works properly with persistent and will let you go back to your previous “current” wifi settings(non persistent)
Now there might still be a bug, have you tried restarting and then starting wifi or just starting wifi after saving ? and see if it was stored, if its persistent it should then work, unless there is a bug causing saves to not be persistent, but there is not that I know of
@flavio-fernandes @tablatronix
add to wifimanager.ccp
here you have the return of ssid and password