khoih-prog / ESP_WiFiManager

This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson
MIT License
371 stars 97 forks source link

ESP_wifiManager.WiFi_SSID() and ESP_wifiManager.WiFi_Pass(); never returns a value and if set by other programs never get cleared #82

Closed albert8413 closed 2 years ago

albert8413 commented 2 years ago

Describe the bug

Using a ESP8266 12F Board the function ESP_wifiManager.WiFi_SSID() and ESP_wifiManager.WiFi_Pass(); always return "". A value is not stored even after setting and connect to SSID in AP mode in the flash. The command Serial.println("ESP Self-Stored: SSID = " + Router_SSID + ", Pass = " + Router_Pass); gives the result: ESP Self-Stored: SSID = , Pass =

Steps to Reproduce

Using any of the included examples and watch the return value

Expected behavior

Set to the last connected SSID

Actual behavior

Always empty

Debug and AT-command log (if applicable)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Information

Please ensure to specify the following:

[env:esp12e] platform = espressif8266 board = esp12e framework = arduino lib_deps = bblanchon/ArduinoJson@^6.19.4 khoih-prog/ESP_WifiManager@^1.10.2 board_build.ldscript = eagle.flash.4m3m.ld monitor_speed = 74880 ; monitor speed changed in examples to Serial.begin(74880) to read reboot messages from Arduino board in terminal session board_build.filesystem = littlefs

Just run any of the examples and have a look on the value printed by Serial.println("ESP Self-Stored: SSID = " + Router_SSID + ", Pass = " + Router_Pass); The variables are set by Router_SSID = ESP_wifiManager.WiFi_SSID(); Router_Pass = ESP_wifiManager.WiFi_Pass(); The routines ESP_wifiManager.WiFi_SSID(); and ESP_wifiManager.WiFi_Pass(); are note working at least on an ESP8266. I will test on an ESP32 next wek

khoih-prog commented 2 years ago

The library only supports ESP8266 with the correct firmware / board type as in NodeMCU 1.0, etc.

Try a simple program to use WiFi.SSID() and WiFi.psk() to see if OK before wasting more time on ESP12F (desgined for AT commands, etc.)

The WiFi_SSID() and WiFi_Pass() are simply defined to use WiFi.SSID() and WiFi.psk() as in

https://github.com/khoih-prog/ESP_WiFiManager/blob/69ec6b3e686485f04364277c6172e4a29ea64dce/src/ESP_WiFiManager.hpp#L486-L502

I'm closing the issue as this is not a bug of the library.