Skip to content

Conversation

Copy link

Copilot AI commented Nov 16, 2025

Hardware watchdog was triggering frequent resets (>60 in 6 hours) because feedWatchDog() rate-limited I2C communication to once per second, causing timeouts during blocking operations like WiFi connection attempts, serial waits, and MQTT operations.

Changes

OTGW-Core.ino

  • Removed rate-limiting timer from watchdog I2C feed path - now feeds on every call
  • Moved LED blink logic to separate 1-second timer to prevent excessive toggling
// Before: Only fed watchdog once per second regardless of call frequency
void feedWatchDog() {
  DECLARE_TIMER_MS(timerWD, 1000, SKIP_MISSED_TICKS);
  if DUE(timerWD) {
    Wire.beginTransmission(EXT_WD_I2C_ADDRESS);
    Wire.write(0xA5);
    Wire.endTransmission();
    blinkLEDnow(LED1);
  }
}

// After: Feeds watchdog on every call, LED blink separate
void feedWatchDog() {
  Wire.beginTransmission(EXT_WD_I2C_ADDRESS);
  Wire.write(0xA5);
  Wire.endTransmission();
  
  DECLARE_TIMER_MS(timerLEDBlink, 1000, SKIP_MISSED_TICKS);
  if DUE(timerLEDBlink) {
    blinkLEDnow(LED1);
  }
}

This ensures the TinyI2CWatchdog at 0x26 receives feed commands during tight loops that previously triggered timeouts (e.g., while(!Serial.available()) with 100ms delays).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.arduino.cc
    • Triggering command: curl --silent --show-error --write-out %{http_code} --location REDACTED -o /tmp/arduino-cli_1.3.1_Linux_64bit.tar.gz (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Hardware watchdog triggered >60times in 6h</issue_title>
<issue_description>Hi,

I am using the latest version of the gateway image on a OpenTherm Gateway Wifi board I bought from nodo.
OTGW (192.168.aaa.bbb)0.10.3+e334c42

Today I was seeing reboot loop
2025-05-01 07:34:23 - reboot cause: Software/System restart (4)
2025-05-01 06:12:28 - reboot cause: Hardware Watchdog (1)
ESP register contents: epc1=0x401008a6, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
2025-04-17 12:13:07 - reboot cause: Hardware Watchdog (1)
ESP register contents: epc1=0x401008e6, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
2025-04-17 12:12:52 - reboot cause: Hardware Watchdog (1)
ESP register contents: epc1=0x401008ff, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
2025-04-17 12:12:16 - reboot cause: Hardware Watchdog (1)
ESP register contents: epc1=0x4010097f, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
2025-04-17 12:11:33 - reboot cause: Hardware Watchdog (1)
ESP register contents: epc1=0x401008c5, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
2025-04-17 12:10:11 - reboot cause: Hardware Watchdog (1)

The strange thing is that this never happened before (on the other hand, I own the board only for 2 months now)

Is there a way to debug the reason for the errors?

kind regards,
friedel</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix hardware watchdog triggered multiple times Fix hardware watchdog resets by removing rate limiting from feedWatchDog() Nov 16, 2025
Copilot AI requested a review from rvdbreemen November 16, 2025 22:27
Copilot finished work on behalf of rvdbreemen November 16, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardware watchdog triggered >60times in 6h

2 participants