2025年1月8日 星期三

[EnthernetENC] Failed to reacquire a new IP address from the DHCP server

MCU Board               : Raspberry Pi Pico

Ethernet Network Module : ENC28J60 

Firmware                : Arduino

EthernetENC Version     : 2.0.5


Issue: 

After switching to a different network, it fails to reacquire a new IP address from the DHCP server using `Ethernet.begin(mac)` function.


Solution: 

Modify the void UIPEthernetClass::end() function in EthernetENC/src/Ethernet.cpp.

*****

Change: 

    configure(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);

To:

    configure(INADDR_ANY, INADDR_ANY, INADDR_ANY, INADDR_ANY);

*****


***** 以上方法是試出來的,有沒有 side effect 不知道 😛 *****

沒有留言:

張貼留言