You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F-23: WiThrottle heartbeat (JMRI dead-man stop) never armed #26
Severity: HIGH · Effort: Small · Batch: 2 · Status: Code done in #21 (68452a5), awaiting bench verification
Found in the second full review of the firmware. Recorded with the rest of the pass (F-19…F-44) in docs/REVIEW_REMEDIATION_PLAN_2.md, which is where its status is kept.
Description
WiThrottleClient::connect() never sends *+, and nothing sends a periodic *. The repo's own
protocol notes call the heartbeat "CRITICAL". Without it, JMRI never e-stops this device's locos
when the device crashes, reboots, or goes half-open on WiFi — the dead-man switch is simply
off. The device also sends HESP32-S3, where the protocol expects HU<unique-id>.
Plan
Send HU<MAC> (a stable per-device id) and N<name> on connect.
Parse the server's *<seconds> announcement; if non-zero, send *+ and then * at half
that interval. Sent from the receive task, which wakes at least once a second anyway, so
the heartbeat needs no task of its own and ends with the session.
Files:WiThrottleClient.h/.cpp
Acceptance Criteria
*+ is sent once per session when the server announces a non-zero interval.
* is sent at half the announced interval for the life of the session, from the
receive task (which now wakes every second).
HU<station MAC> replaces the malformed HESP32-S3.
Unit tests test_withrottle_heartbeat_announcement_arms_monitoring and test_withrottle_malformed_heartbeat_is_ignored pass on the board (they compile).
Bench: pull the ESP's power with a loco running; JMRI e-stops it within the interval.
Activity