OS: Windows 10 / Linux Mint
I am using an ESP32-EVB exclusively with an Ethernet cable. I have a webserver on the device so I will need it's IP to access it. In order to do that I boot up the ESP and I look for it's IP into my AP's DHCP list. I find it and I type it in my browser. And it doesn't work. I then open up a Serial Monitor and reboot the thing only to see that ETH.begin() gets a DHCP IP and then ETH.config() changes that IP to a previously stored IP.
Code: Select all
ETH Connected
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 25 - MAX
[D][WiFiGeneric.cpp:417] _eventCallback(): ETH IP: 192.168.1.194, MASK: 255.255.255.0, GW: 192.168.1.1
24:0A:C4:24:9F:A7, IPv4: 192.168.1.194, FULL_DUPLEX, 100Mbps
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 25 - MAX
[D][WiFiGeneric.cpp:417] _eventCallback(): ETH IP: 192.168.1.150, MASK: 255.255.255.0, GW: 192.168.1.1
, IPv4: 192.168.1.150, FULL_DUPLEX, 100Mbps
192.168.1.150 is obtained from a config file stored inside the ESP32 and as such it doesn't appear in the DHCP List.
I don't want the ESP to get a DHCP lease, because it is confusing for any user. It even managed to confuse me. I would like for it to never get a DHCP lease if it was previously configured with a Static IP, like in this case.
A logical answer would be to switch ETH.begin() and ETH.config() around, but from what I remember this can't be done, right ? Or am I wrong and this is just a parasite thought ?
Thank you.