From 6589da445b3596fbcad5ce2ed9ffbb97d3d2bd8a Mon Sep 17 00:00:00 2001 From: serversdown Date: Sat, 19 Sep 2026 22:05:55 +0000 Subject: [PATCH] feat(webapp): cheap connect, opt-in event walk, and a Diagnostics tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Connecting to a unit fired /device/events automatically, which walks the whole event chain — every event header over a cellular link. On BE12599 that took minutes and then 500'd outright, because its buffer has wrapped past 0xFFFF and the uint16 offset arithmetic goes negative. Wanting to know whether ACH was on should not require reading every event the unit has stored. Connect now uses only cheap probes: /device/info (which already carries the compliance config the event walk was re-reading) plus /device/events/storage_ range. The chain walk moves behind a "Load events" button in the Events toolbar, and the Device tab gains an Event Chain card showing the first/last keys. Adds a Diagnostics tab for the endpoints that previously existed only as curl: storage_range and events/index alongside monitor/status, then stop monitoring, disable ACH (rescue?erase=false, so events survive), and erase. The wedged-unit ladder — slow drip and blind stop — sits under its own heading pointing at the runbook, with the reminder that slow_drip's success signal is bytes_received>0 and not a clean duration. Erase is guarded by typing the unit's serial. Auth answers who, not whether you meant it, and Swagger's try-it-out button on /device/events/erase is live on :8200/docs — the realistic risk here is an accident. Lifetime events is displayed but labelled unreliable: SUB 0x08 reports 0 on units with years of history, which is a decode bug we have not chased yet. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Qcu9ByJfuKBQxmrWb8rSrN --- sfm/sfm_webapp.html | 315 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 295 insertions(+), 20 deletions(-) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index d03070e..aa5c555 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -108,6 +108,12 @@ color: var(--text); } .btn-ghost:hover { border-color: var(--blue-lt); color: var(--blue-lt); } + .btn-danger { background: var(--red); color: #fff; } + .btn-danger:hover:not(:disabled) { filter: brightness(1.15); } + .diag-result { display:block; margin-top:6px; font-size:12px; opacity:.85; + white-space:pre-wrap; word-break:break-word; } + .diag-result.ok { color: var(--green); } + .diag-result.error { color: var(--red); } .btn:disabled { background: var(--surface2) !important; color: var(--text-mute) !important; cursor: not-allowed; border-color: var(--border2) !important; } /* #connect-btn styles moved to #live-connect-bar block */ @@ -910,6 +916,7 @@ + + +
+ +
+ +
+
Device State
+
+ Fast probes — POLL plus one read each, about 2 s. None of these walk the event chain. +
+
+
+ + +
+
+ +
+
Actions
+ +
+ + +
Halts recording. On a unit triggering continuously, this is what breaks the call-home loop.
+ +
+ +
+ + +
Stored events are left untouched (rescue?erase=false). The unit stops dialing out until ACH is re-enabled.
+ +
+ +
+ + + +
⚠ Permanent, and resets the event chain to key 0x01110000. Download anything worth keeping first.
+ +
+
+ +
+
Unresponsive Unit
+
+ The escalation ladder from docs/runbooks/wedged_unit_recovery.md, for a unit too busy + to answer normal request/response. Prefer Method A — point the modem at an + ach_server and answer its call — before racing it with these. +
+ +
+ + +
Success is bytes_received > 0. A full duration with send_error: null is not success on its own.
+ +
+ +
+ + + +
+
+ +
+
+