Waveshare Net/Serial adapter issues

This is just a short post to alert users of my SPE Expert Controller App that the Waveshare network / serial adapter, specifically model “RS232/485/422 To RJ45 Ethernet Module, TCP/IP To Serial, with POE Function”, firmware V1.452 appears to have what I consider a defect in its DHCP implementation. I wanted to make those who have this device or who are thinking about purchasing this device aware.

Firstly let me give a brief overview of DHCP. When a client using DHCP starts it broadcasts a DHCP Discover message to identify DHCP servers. A server receiving this will Offer an IP address plus other network config information to the client. With this information the client will Request the IP addressing information it wishes to use (as several servers could have responded) and the corresponding server will send an Acknowledgement.

The IP address information Offered has a lease time, a validity time if you like. Once the lease expires the client should no longer use that address information. What a client should do is renew the lease prior to its expiry, often at a period equating to half the lease duration.

OK, with that knowledge I can now say that my Waveshare adapter correctly obtains its IP information on power-on. But it does not appear to respect the lease time so simply continues to use the IP information beyond its lease period / validity period. It does not attempt to renew the lease either.

So what’s the impact of this? Well, two things spring to mind, neither good. As the DHCP server never sees a renewal it expires the IP address and is then within its rights to offer the same address to another client. This results in two devices with the same IP address! That’s going to cause problems. Secondly, its common to configure DHCP servers to push name information to DNS when they allocate an address and to remove that information from DNS when a lease expires. As the Waveshare adapter doesn’t renew the lease my DNS server removes its name from DNS when the lease expires. So name resolution no longer works!

This is not the first time I’ve observed this sort of behavior but its been a few years and that device was another cheap and cheerful Chinese piece of IoT kit.

So, if you have your Waveshare adapter configured to use DHCP and are seeing some hard-to-explain issues, check whether there are two devices using the same IP. If DNS lookups of the Waveshare device are failling after a while (after the lease time) then this is likely the cause.

Andy