enable Watchdog

This commit is contained in:
Fusselkater 2022-08-23 00:51:36 +02:00
parent e113d86a71
commit 95603b02c5

View file

@ -4,6 +4,7 @@ import config
import ntptime import ntptime
import time import time
from umqtt.simple import MQTTClient from umqtt.simple import MQTTClient
from machine import WDT
hour_color = config.HOUR_COLOR hour_color = config.HOUR_COLOR
minute_color = config.MINUTE_COLOR minute_color = config.MINUTE_COLOR
@ -106,9 +107,14 @@ 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:
wdt.feed()
if not check_wifi_connection(): if not check_wifi_connection():
machine.reset() machine.reset()