Added sleep during MQTT connection failures to prevent a bug where reconnection attempts overwhelm the broker.
This commit is contained in:
1
main.py
1
main.py
@@ -158,6 +158,7 @@ def main():
|
|||||||
if DEBUG:
|
if DEBUG:
|
||||||
print("Trouble to connecting to MQTT: {}".format(e))
|
print("Trouble to connecting to MQTT: {}".format(e))
|
||||||
led_error_code(led, 2)
|
led_error_code(led, 2)
|
||||||
|
time.sleep(5)
|
||||||
continue # Start back at the top of the While Loop
|
continue # Start back at the top of the While Loop
|
||||||
|
|
||||||
# DHT22 Reading.
|
# DHT22 Reading.
|
||||||
|
|||||||
Reference in New Issue
Block a user