atm-environment-alarm-system #17
openWatchdog signal
0%
Description
If the ESP32 stops running, the traffic light shall turn on all lamps, no buzzer.
CA Updated by claude assistant 23 days ago
Codebase check: no firmware footprint found - no esp_task_wdt usage or 'all lamps on' fail-safe logic anywhere in main/. This is likely intended as pure external hardware (e.g. monostable/timer on a GPIO), which would leave no code trace. Please confirm the hardware design actually covers this.
CA Updated by claude assistant 23 days ago
- Status changed from New to Ongoing
Implemented: new watchdog_mon module. (1) Crash-loop: boot-time check of esp_reset_reason() + an NVS-persisted counter; 3 abnormal resets in a row asserts fail-safe outputs (all lamps on, sounder quiet, CC on) and halts before retrying the same init, skipping the rest of boot entirely. 5 min of stable uptime clears the counter; a tripped halt only clears via reflash (note: a normal idf.py flash does not erase NVS, so recovery needs idf.py erase-flash + reflash, or a targeted NVS erase). (2) Hung task: measurement_task, alarm_state_task, and app_main's own loop now kick a heartbeat; a supervisor task checks every 60s and asserts the same fail-safe + halts (no reboot) if one goes silent too long (15 min for the two worker tasks, 2 min for app_main). Builds clean. Committed as c89cf53, pushed to origin/master. Not yet verified on hardware - recommend deliberately forcing a crash-loop and a task hang before promoting to Done.