From 17caf174639d4e777a0a83e02281c7bdd5e9d0d2 Mon Sep 17 00:00:00 2001 From: Shaun Setlock Date: Thu, 24 Nov 2022 21:44:26 -0500 Subject: [PATCH] Added sleep during MQTT connection failures to prevent a bug where reconnection attempts overwhelm the broker. --- main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main.py b/main.py index 9b5636a..6475c8f 100644 --- a/main.py +++ b/main.py @@ -158,6 +158,7 @@ def main(): if DEBUG: print("Trouble to connecting to MQTT: {}".format(e)) led_error_code(led, 2) + time.sleep(5) continue # Start back at the top of the While Loop # DHT22 Reading.