-
Notifications
You must be signed in to change notification settings - Fork 2k
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
getWiFiIsSaved returning wrong value #1439
Comments
Same problem here. Please fix it :) |
This was removed already from the code |
but it not working before autoconnect. i need to check this flag in the beginning of the code. |
ahh yeah its not working at the moment I need to add wifiinit code, I was testing how to do it without causing delays in boot connect.. The easiest way is to just init wifi yourself in your code add a WiFi.mode(WIFI_STA); at the beginning. Another option is maybe we could read it directly from flash, but that changes now and then and would be a pita esp32 IDF changed how this all works and its annoying |
Hi! Is there any alternative way I can check if the drive is going to try to connect using the existing wifi config or if it will enter AP mode? Or is there a way to know that we are going to enter (or entered) AP mode? Trying to show some info on the display of my device. Thanks! |
Still thinking of how to fix this, now that the fatal wifi connect bugs in ESP seem to be fixed I can test wifiinit and try to optimize any connection delays from any change I make |
Basic Infos
Hardware
WiFimanager Branch / Release: v2.0.11-beta
Esp8266 / Esp32: ESP32
Hardware: M5 Stack Core 1
Core Version: 2.4.0, staging
Description
When the WiFi has not been completly initalized needs some time
WiFi_SSID
has some trash data inconf.sta.ssid
, which then gets converted into a String meaning the String isn't empty. CausinggetWiFiIsSaved
to return true because the ssid isn't empty even tough there isn't any data saved.Underlying Problem
I debugged some more and the problem seems to be that the
esp_wifi_get_config()
method always returnsESP_ERR_WIFI_NOT_INIT
(WiFi driver was not installed by esp_wifi_init).This seems to be the problem becuase the autoConnect only initalizes the WiFiManager if the isWiFiSaved() method returns true. This method can't return true tough until WiFi has been initalized.
I tried to call
WiFi.begin();
before attempting to reconnect. This will fix the issue because the esp has now initalized the wifi configuration.Serial log
Attempts to connect to the WiFi with saved credentials even tough there are none.
Simple fix
Instead of always returning the data converted into a string, which might cause issues see current code below:
WiFiManager.cpp / 3602
The library should instead check if getting the configuration was successfull in the first place and if not return an empty string. Similar to how it returns the value if the boolean flag
persistent
isn't true.WiFiManager.cpp / 3602
The text was updated successfully, but these errors were encountered: