configure watchdog before mqtt setup

This commit is contained in:
Fusselkater 2022-08-23 15:57:52 +02:00
parent 95603b02c5
commit b2897829cc

View file

@ -97,6 +97,9 @@ for minute in range(0, 59):
time.sleep(0.05) time.sleep(0.05)
set_time(0, 0) set_time(0, 0)
# Configure Watchdog
wdt = WDT(timeout=5000)
if not check_wifi_connection(): if not check_wifi_connection():
machine.reset() machine.reset()
@ -107,9 +110,6 @@ mqtt_client.connect()
mqtt_client.subscribe(config.MQTT_TOPIC + "/brightness/set") mqtt_client.subscribe(config.MQTT_TOPIC + "/brightness/set")
mqtt_client.subscribe(config.MQTT_TOPIC + "/switch/set") mqtt_client.subscribe(config.MQTT_TOPIC + "/switch/set")
# Configure Watchdog
wdt = WDT(timeout=5000)
# Main Loop # Main Loop
while True: while True: