From 4ac555224095f43e4a0e6c53d6e89bbfa00e0386 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 22:17:37 +0000 Subject: [PATCH 1/2] Initial plan From 15bd2f7006976554ec0461609e0e3ff18dd0043a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 22:23:15 +0000 Subject: [PATCH 2/2] Fix hardware watchdog by removing rate limiting in feedWatchDog() Co-authored-by: rvdbreemen <8645876+rvdbreemen@users.noreply.github.com> --- OTGW-Core.ino | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/OTGW-Core.ino b/OTGW-Core.ino index 9589334..d1a3071 100644 --- a/OTGW-Core.ino +++ b/OTGW-Core.ino @@ -276,18 +276,21 @@ void WatchDogEnabled(byte stateWatchdog){ Wire.endTransmission(); //That's all there is... } -//===[ Feed the WatchDog before it bites! (1x per second) ]=== +//===[ Feed the WatchDog before it bites! ]=== void feedWatchDog() { - //make sure to do this at least once a second + //Feed the watchdog every time this function is called to prevent hardware watchdog resets + //during blocking operations (e.g., serial waits, MQTT operations, file I/O) //==== feed the WD over I2C ==== // Address: 0x26 - // I2C Watchdog feed - DECLARE_TIMER_MS(timerWD, 1000, SKIP_MISSED_TICKS); - if DUE(timerWD) + // I2C Watchdog feed - always execute + Wire.beginTransmission(EXT_WD_I2C_ADDRESS); //Nodoshop design uses the hardware WD on I2C, address 0x26 + Wire.write(0xA5); //Feed the dog, before it bites. + Wire.endTransmission(); //That's all there is... + + //Blink LED at most once per second to provide visual feedback without excessive toggling + DECLARE_TIMER_MS(timerLEDBlink, 1000, SKIP_MISSED_TICKS); + if DUE(timerLEDBlink) { - Wire.beginTransmission(EXT_WD_I2C_ADDRESS); //Nodoshop design uses the hardware WD on I2C, address 0x26 - Wire.write(0xA5); //Feed the dog, before it bites. - Wire.endTransmission(); //That's all there is... blinkLEDnow(LED1); } //yield();