enable Watchdog
This commit is contained in:
parent
e113d86a71
commit
95603b02c5
1 changed files with 6 additions and 0 deletions
6
main.py
6
main.py
|
@ -4,6 +4,7 @@ import config
|
|||
import ntptime
|
||||
import time
|
||||
from umqtt.simple import MQTTClient
|
||||
from machine import WDT
|
||||
|
||||
hour_color = config.HOUR_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 + "/switch/set")
|
||||
|
||||
# Configure Watchdog
|
||||
wdt = WDT(timeout=5000)
|
||||
|
||||
# Main Loop
|
||||
while True:
|
||||
|
||||
wdt.feed()
|
||||
|
||||
if not check_wifi_connection():
|
||||
machine.reset()
|
||||
|
||||
|
|
Loading…
Reference in a new issue