-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
WiFi.localIP() reports 0.0.0.0 after succesfull connect - Arduino Core 3.0.7 #10580
Comments
I do agree it may sound confusing, but I am not sure this really is a bug. Not sure what "Arduino" claims how 'connected' should be interpreted. |
@TD-er Maybe not all, but most example sketches for esp32 use this construct to connect to WiFi. while (!WiFi.isConnected())
delay(10); I don't claim it is a bug, but it surprised me. And my assumptions about code behaviour might be wrong. |
Yep, that's why I also wonder what "the Arduino" expected interpretation should be. |
@me-no-dev - FYI. Issue report confirmed. This behaviour started with Arduino Core 3.0.0. Arduino WiFi Library (upstream) has no Possible Status are: typedef enum {
WL_NO_SHIELD = 255,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL,
WL_SCAN_COMPLETED,
WL_CONNECTED,
WL_CONNECT_FAILED,
WL_CONNECTION_LOST,
WL_DISCONNECTED
} wl_status_t; The WiFi Arduino API may consider implicitly that as soon as status is The current behaviour may be acceptable or not. We will discuss it internally. |
Decision: We will change |
@CelliesProjects - Thank you for the report and quick fix. We will apply it! |
Board
esp32-s3
Device Description
Just a plain old esp32-s3
Hardware Configuration
Nothing of consequence
Version
v3.0.7
IDE Name
PlatformIO
Operating System
Mint Linux
Flash frequency
80
PSRAM enabled
yes
Upload speed
921600
Description
WiFi.localIP()
should report the IP address. Instead it displays0.0.0.0
after a succesfull connection. After a while it does show the correct IP.Fix
A quick fix here was to change
isConnected()
inWiFiSTA.cpp
to the snippet below.This change gives the expected behaviour.
Sketch
Debug Message
Other Steps to Reproduce
I did not try any other hw.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: