-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WiFi static IP configuration doesn't work after networking refactoring #9435
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
@JAndrassy please try #9445 |
second
|
enable verbose debug please. Not sure what I am looking at, but here I ran a constant loop of connect, wait 10 seconds, disconnect, wait 5 seconds, repeat. Static IP was kept the same and was able to reconnect to the same AP just fine. Anyway, your IP is there just fine. |
there is nothing in verbose log for the second |
sorry. I can't replicate it. then it happened on the first and second try. now it works. In many attempts it sometimes doesn't connect to AP in different parts of the test, but that could be a problem of my AP. so the PR is OK and the problem is solved |
Description
WiFi doesn't use static IP configuration after the networking refactoring. Settings are not applied in NetworkInterface.config because esp_netif is NULL. In
begin
then DHCP is used.arduino-esp32/libraries/Network/src/NetworkInterface.cpp
Line 330 in 7b29bac
Sketch
WiFiClientStaticIP example
If I first
begin
with DHCP then setting static IP works for nextbegin
. But followingbegin
again uses DHCP. This is not right. Already configured static IP configuration has to be used. Static IP should be only cleared withconfig(INADDR_NONE)
(orend()
). All WiFi libraries have it that way including the esp8266 WiFi.The static IP configuration is cleared because
ESP_NETIF_HAS_IP_BIT
is cleared soconfig()
with default parameters in invoked.arduino-esp32/libraries/WiFi/src/STA.cpp
Line 354 in 7b29bac
The text was updated successfully, but these errors were encountered: