We’ve used MBed5 for some years and brought up out Ethernet connection with DHCP. Basically the below code. I’ve removed the error handling to keep it short.
EthInterface * eth = EthInterface::get_default_instance();
eth->set_dhcp( true );
eth->connect();
On MBed5 this worked ok and we always got the IP address data. DHCP renewals also seemed to work ok. Now we’ve finally migrated to MBed6 and while the DHCP code always gets the interface up and running it doesn’t seem to renew correctly. It took ages for us to notice as the lease time was two weeks at the office where devices were tested. After the lease has expired network operations seem to give NSAPI_ERROR_NO_CONNECTION
errors.
Are we supposed to manually handle the DHCP renewals with MBed6? Or should renewals work automatically? According to the standards a DHCP client should try to renew after half the lease time has passed, so there has been ample time to renew. I don’t really see any way to check the DHCP data nor manually do the renewing, unless we want to drop down to the low level LWIP code and do an own Ethernet interface.