-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WiFi.status() always not connected. #2593
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
Comments
No idea what's wrong, it works just fine on my ESPs. |
Please, see issue 2186. Maybe it can help you. https://github.com/esp8266/Arduino/issues/2186 |
Hi, am still having this issue, with AT commands module connects, but if I want to do this, status != WL_CONNECTED - the statement always return true |
Same issue here. WiFi.status() returns 255. But still able to connect using AT command. |
I have same issue. my hardware is esp-wroom-02. |
A workaround is to replace |
@fabiosoft is this issue still valid with latest git? |
I just tested with the latest, and it still does the same for me. Sometimes (~30%) works, but usually returns WL_DISCONNECTED indefinitely. |
Did anyone find the solution. I have the same problem always Wifi.status() is not connected and when I tried to print the Wifi.status() it returns value 0 for five times and a 6 once. I am wondering how this will by any chance give a String value of WL_CONNECTED :( |
@muthu29 the workaround by @max5555 is good. To answer your question about return value, WL_CONNECTED is an enum value that equates to 3. It's defined in wl_definitions.h:
|
This should be addressed in latest master. |
For me it was a Typo in the SSID Password. It is working when I corrected it. |
Closing due to recent lwip glue fixes and WiFi::status() testing. |
How can it be, that it's still not fixed, even with 2.4.2 ... It's been more than 3 years. I had to use the workaround to fix it.. |
I tried the workaround, and it failed. So, I printed "WiFi.localIP().toString()" to the console, and to my amazement, it did not contain "0.0.0.0", but "(IP unset)", so I replaced the "0.0.0.0" with "(IP unset)" in the while statement, and it still didn't connect. Then I decided to check the router connections, and found that the IP had been issued, and the ESP was connected to the router. At that point, I thought maybe the router was taking a bit longer to get everything done before the "while" timeout, so I added 15 seconds, and also decided to change the "while" statement to: while (WiFi.localIP().toString() != IP) { Where "IP" was set as a global char* constant, as I had set the IP address for the ESP MAC in the router. Both were tested, and work. I am using a Netgear WNDR3000-2, which takes its sweet time connecting. Since I need my ESP addresses to be fixed, I used the router to save the addresses rather than try to get the ESP's to request a fixed IP. Now that this stumbling block is passed, I can finally move on to productive parts of my project. |
Please try and replace
by
Checking against a string is always worse when there are other means. |
That works very well, Thanks! You are quite right about checking against strings, as it takes more program memory, as well as more time than checking for bool. |
for me, none of the above worked!!! some usable links: |
Please, try with another SSID and Password, could be a problem with your router. Use Hotspot in your smartphone and try. |
come delete my comments "contributor" or maybe tell me to check up on my power cord. that will surely make a huge difference, i feel engulfed with your support. <3 |
@mazorvanunu |
Basic Infos
Hardware
Hardware: ESP-01
Core Version: 2.3.0
Description
WiFi.status()
always not connected. WL_CONNECTED is never set with version 2.3.0, instead with version 2.0.0 everything works ok.It outputs a
not connected state
...while surfing web!! How is it possible?Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 512k
CPU Frequency: 80Mhz
Flash Mode: dio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
The text was updated successfully, but these errors were encountered: