You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When programming the ESP8266 over a serial link it will request an IP address via DHCP even if successfully given a static IP address with WiFi.config.
It will replace the static IP address with the DHCP supplied address when it receives the DHCP Offer packet. It responds to the static one before between the time of setting the static address and receiving the DHCP Offer. Once the DHCP Offer has been received and the address has been changed to that it is possible to call WiFi.config again and change the IP back again. It will continue to periodically request or renew the DHCP address after this but it appears not to make use of it.
This behaviour continues after a reset or reboot but removal of power and restarting the ESP8266 corrects the behaviour.
Below is a packet capture of a request following serial programming and immediately following WiFi.config(local_ip, gateway, subnet, dns1, dns2); Between the first and third packet it will respond to the static local_ip given.
My ESP8266 uses static IP, but I've noticed that a couple of times it started using DHCP IP address again after some time (10-20 hours) without any reboots.
It happens not often, and it hard to reproduce. Don't know if it is related.
P.S. I use 2.4.0 and lwip2
Platform
Settings in IDE
Problem Description
When programming the ESP8266 over a serial link it will request an IP address via DHCP even if successfully given a static IP address with
WiFi.config
.It will replace the static IP address with the DHCP supplied address when it receives the DHCP Offer packet. It responds to the static one before between the time of setting the static address and receiving the DHCP Offer. Once the DHCP Offer has been received and the address has been changed to that it is possible to call
WiFi.config
again and change the IP back again. It will continue to periodically request or renew the DHCP address after this but it appears not to make use of it.This behaviour continues after a reset or reboot but removal of power and restarting the ESP8266 corrects the behaviour.
Below is a packet capture of a request following serial programming and immediately following
WiFi.config(local_ip, gateway, subnet, dns1, dns2);
Between the first and third packet it will respond to the staticlocal_ip
given.MCVE Sketch
The following is extracted from the full program here: https://github.com/andrewradke/ESP8266-Homie-sensors
The text was updated successfully, but these errors were encountered: