Change
Instead of trying to check whenever the device is reachable with InetAddress::isReachable(),
which sends PING-s, we just trigger communication with the device over UDP.
E.g. Broadlink RM2, may enter into a state where it stops responding to pings,
but still remains operational and being able to handled commands.
In such state device responds with:
java.net.ProtocolException: Response from device is not valid. (0x22=0xF9,0x23=0xFF,0x24=0x00)
however after ignoring packets 0x22-23 check, looks like binding is able to
read tempearature from the device successful.
Testing
I've checked this with RM2 device that i use and works OK for 1 and half week with this fix.
Why? This is an fix for issue reported and described here: https://github.com/RobPope/BroadlinkOH3/issues/1
Change Instead of trying to check whenever the device is reachable with InetAddress::isReachable(), which sends PING-s, we just trigger communication with the device over UDP. E.g. Broadlink RM2, may enter into a state where it stops responding to pings, but still remains operational and being able to handled commands.
In such state device responds with:
Testing I've checked this with RM2 device that i use and works OK for 1 and half week with this fix.