Moderator: Mmiscool
The two units are an IR receiver and a transmitter a couple of rooms away. Basically to control 3 media devices in the lounge from a remote control in the bedroom.
I am already using udp from the master to the slave and the master expects a udpreply to acknowledge every button press. I could possibly set a timer to send a dummy press every 10 seconds but without a ping function there is no way of telling which unit has lost its place so both would have to re-connect.
I would not normally want to reboot because of the time it takes.
Both units have a web page available so that I can reboot either from a browser on a mobile phone - provided they are still on the network.
Thanks for the suggestion.
@Electroguard: Yes, this is intended to be generic code. I was thinking about simply using REBOOT but I don't always know that I'll have autorun turned on. I test some nodes on one router before they go out in the field with a different router and IP settings, so I wanted the reconnect routine to function automatically, discerning when the alternate WIFI.CONNECT() syntax was necessary too.
I am intrigued by the use of UDP for a couple reasons: It is one way that I can develop logic to ascertain whether a server connection attempt failed due to server or internet connection issues versus router disconnection. Also, it gives me a way to slip a packet to another node that might connect to a router when the first one can't. I've toyed with this a little but I end up with a lot of code because it involves direct node to node connections that I have to manage somewhat intelligently. One more go-around and I'll either simplify it or have a functioning mesh network. Not sure which....