deiger / Alarm

Code to connect and control alarms by PIMA.
GNU General Public License v3.0
16 stars 11 forks source link

Retry to connect to MQTT broker on OSError #7

Closed maorcc closed 4 years ago

maorcc commented 4 years ago

After a power outage, when the network router is not yet up and running, connecting to the MQTT broker may fail with timeouts combined with OSError exceptions. In such cases I have seen the following errors in the log: OSError: [Errno 113] No route to host In such a case, we need to retry connecting to MQTT, just like we do for a timeout. Fixes deiger/Alarm#3

deiger commented 4 years ago

Thanks!