tsathishkumar / MySController-rs

Controller for MySensors, exposes WoT APIs for the sensors. It supports OTA firmware updates, and also acts as proxy for all requests.
GNU Affero General Public License v3.0
20 stars 9 forks source link

Ensure connection to gateway exists by checking periodically. #17

Closed ashokgowtham closed 6 years ago

ashokgowtham commented 6 years ago

If the connection to gateway from myscontroller-rs breaks abruptly (like pulling the ethernet cable off), then myscontroller-rs doesn't try to reconnect. Home Assistant handles this scenario by sending I_VERSION(2) INTERNAL(3) messages once every 10 seconds and expects a response back with a timeout of 10 seconds. If the response doesn't come back within timeout, then it disconnects the connection and attempts reconnect and sends the I_VERSION message again.

ashokgowtham commented 6 years ago

heartbeat check: "0;255;3;0;2;\n" expected response: "0;255;3;0;2;2.2.0\n" • homeassistant does this check once every 30 second.