-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WiFi.config(fixedIP, fixedGateway, fixedNetmask) disconnects ESP on 2.5.0 (regression from 2.4.2) #5839
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
Hmm. I think I can second this finding. Platform Settings in IDE I simply used BasicHTTPClient example, with and without
after
With Static IP Settings, I get
With DHCP ( ie , Static IP settings commented out) I get
......... and the rest of the html . Both cases work well with 2.4.2 |
However:
So we must fix documentation, and maybe fix this should-not-be-documented regression. |
Thanks for confirming and testing with lwip-v1.4. I can confirm it works with lwip-v1.4 on 2.5.0, so I have a way forward, which is great! Simply adding WiFi.begin(); after WiFi.config(fixedIP, fixedGateway, fixedNetmask); does not work, I need to do a WiFi.disconnect() in between. But IMHO, there is a use case for on-the-fly IP reconfiguration without reconnecting to the WiFi AP (and it does work the other way round, switching over to DHCP, as I just tested). Like on my system: A couple of ESP-clients run with DHCP addresses, but when I want to change the configuration of one of them, I go there, push a button, let the ESP replace the last octet of the IP address with a fixed one so I can connect to a webserver running on the ESP. It is a pain to have the device reconnect to the WiFi every time. Anyway, if that's what I have to do, that's what I have to do ;) Heiko |
Yes, confirming 1.4 working. As to the order of wifi.config and wifi.begin, I have been using config after begin for a long time :) I suppose that though it makes sense that the correct order is config before begin, it still works? |
I also have problem with WiFi.config(). But it appears time to time. Some time all working great. I implement new function and softAP doesn't start with WiFi.config(). Comment this line - all works great. Wrote one more function's (it doesn't work with wifi) and softAP again doesn't start. When I uncomment - all ok. And so on. |
@d-a-v Just a follow up comment. Going back to v1.4 resolves the static IP issue. But the v1.4 has the issue of "LmacRxBlk:1" being thrown in the terminal. I see that you added a 'bug' label added to this issue. I hope the static IP issue on v2 will be resolved soon. |
For some reason, ip address is not propagated in a visible way for lwip2 when switching to static address (wifi.config()) *after* wifi.begin(). This patch calls lwip-v1.4's netif_set_addr() with the new ip address to set all things up, just like it is done and right when wifi.begin() is called after wifi.config(). Also tested when IPv6 is enabled. fixes esp8266#5839 fixes esp8266#6024
Tell me about it. It was the primary reason of lwip2 existence.
Nothing prevents to move |
fix switching to static address with lwip2 For some reason, ip address is not propagated in a visible way for lwip2 when switching to static address (wifi.config()) *after* wifi.begin(). This patch calls lwip-v1.4's netif_set_addr() with the new ip address to set all things up, just like it is done and right when wifi.begin() is called after wifi.config(). Also tested when IPv6 is enabled. fix documentation: It is more natural to set an IP address before starting WiFi (.. and not after dhcp has started) fixes #5839 fixes #6024
Basic Infos
Platform
Settings in IDE
Problem Description
When changing the IP address configuration with WiFi.config after connecting, 2.5.0 just releases the DHCP lease and returns the IP address but does not enable the fixed IP address. This works on 2.4.2.
After a disconnect->reconnect cycle, 2.5.0 activates the fixed IP address. (Side note: This seems shaky on 2.4.2 - does not work every time)
I checked the github web interface but could not make out any relevant changes to the ESP8266WiFi tree since 2.5.0, so I hope it's OK that I did not check latest-git.
If you need any more info, just go ahead and ask :)
Heiko
May be related to #5757 ?
MCVE Sketch
Debug Messages on 2.5.0
Debug Messages on 2.4.2
The text was updated successfully, but these errors were encountered: