From 988bec521f0c59ae440f024de2019e79d83aa38b Mon Sep 17 00:00:00 2001 From: sickprodigy Date: Sat, 8 Nov 2025 16:12:59 -0500 Subject: [PATCH] fix: Update watchdog timer configuration and enable garbage collection --- main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 3060f6c..ce38014 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,12 @@ -from machine import Pin, WDT +from machine import Pin, WDT # type: ignore import time import network import json import gc # ADD THIS - for garbage collection # Enable watchdog (8 seconds timeout - auto-reboot if frozen) -wdt = WDT(timeout=60000) -print("Watchdog enabled (60s timeout)") +# wdt = WDT(timeout=8000) # Maximum is 8388ms, use 8000ms (8 seconds) +# print("Watchdog enabled (8s timeout)") # Initialize pins (LED light onboard) led = Pin("LED", Pin.OUT) @@ -317,6 +317,5 @@ while True: print("NTP retry {} failed: {}".format(retry_ntp_attempts, e)) gc.collect() - wdt.feed() # Reset watchdog timer (prevent auto-reboot) time.sleep(0.1) # ===== END: Main Loop ===== \ No newline at end of file