Closed denniedegroot closed 8 years ago
Good point, will add that, thanks!
Thank you for this great app!
You're welcome. Let me know if you find other issues or in case of feature requests.
It should automatically re-connect in version 0.5.0. Can you check? I have difficulty testing the situation.
Unfortunately it is not fixed. I tested it by powering off my wifi router. I looked at the code and see you introduced a "reconnectTimer" variable which is cleared when there is a connection but then is never checked again? So when the connection drops how does it re-connect?
When the clients stops, there is a 'close' event. This calls a new openComm. At the stat of that function there the interval timer is set (reconnectTimer), which will check every 3 seconds.
When I try here (cable connection) by unplugging the Ethernet cable, the client stays active. So when I plug it in again, the code just continues. I've made a special test case that closes the client connection and then the re-connect works.
In your case, when powering off the router, I guess more happens - as Homey will also lose connection. Does it come back with the same IP address.
Otherwise can you set the variable 'debugOn' to true and provide me the log output?
Ok I did some more testing and found out that the client.close is not called when I disconnect the OTGW. So that's why it is not trying to reconnect.
Edit: I can't test the behavior of Homey because then I won't be able to see the logging.
Ok, I'll add a timeout for 1 minute.
Thanks! It works perfect :)
I noticed that Homey stopped logging OTGW data to insights and found out that the socket connection to the OTGW was dropped. When clicking on "Save network settings" the connection was re-established and Homey started logging again. Until now it only happend once but is it possible to maybe implement some kind of reconnect on connection timeout? I think more users will experience this when for example they have a bad wifi network.