From 89a2a493fb08f1e2ca75fa2c615db2a9386a6731 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:11:24 -0400 Subject: [PATCH] docs: phase 1b bench-checked on UM20147 -- events by serial for both series Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 10 +++++++++- README.md | 2 ++ docs/micromate_protocol_reference.md | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8676eb9..131a49c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -103,7 +103,13 @@ Read this first when picking the project back up. shared shape for both series through `sfm/device_access/`. Micromate lines are held open (one call-up, keep-alive 60 s, idle hang-up 5 min, released on RADIO RING); MiniMates still reconnect per request. Without `serial` the - legacy Series-3 path is unchanged. Next: 1b (events), 1c (webapp). + legacy Series-3 path is unchanged. + āœ… **Phase 1b (2026-10-21) lists and downloads events by serial for both + series** -- the MiniMate list comes from headers only (no 5A), and a download + is checked and stored in SFM's DB (`db_event_id`). Bench-checked on UM20147: + 5 events, a waveform that verified, a histogram, one call-up for the whole + sequence. ⚠ The MiniMate header walk is **unproven on a unit; a MiniMate + bench check is owed before the branch merges.** Next: 1c (webapp). - **šŸ”‘ ACH / call-home, captured end to end (2026-10-14).** A Micromate signals `RADIO RING`; **two paths exist and timing decides which**: if anything already holds the modem's single TCP session the ring rides that connection, @@ -1406,6 +1412,8 @@ for 0x10 records). GET /device/info?port=COM5 ← serial GET /device/info?host=1.2.3.4&tcp_port=9034 ← cellular GET /device/events?host=1.2.3.4&tcp_port=9034&baud=38400 +GET /device/events?serial=UM20147&host=...&tcp_port=... ← list with event_id, either series (no 5A on a MiniMate) +POST /device/events/download?serial=UM20147&event_id=...&host=... ← download, check, store; returns db_event_id GET /device/event?host=1.2.3.4&tcp_port=9034&index=0 GET /device/monitor/status?host=1.2.3.4&tcp_port=9034 ← battery, memory, mode POST /device/monitor/start?host=1.2.3.4&tcp_port=9034 ← start recording diff --git a/README.md b/README.md index 1f76fc8..51638c8 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,8 @@ via a thread-safe `_LiveCache` (plain Python dict + `threading.Lock`): | `POST` | `/device/call_home` | Reads, patches specified fields, writes back to device | | `GET` | `/device/settings` | Recording settings in the shared model, either series; serial required; never cached | | `POST` | `/device/hangup` | Releases a held Series-4 line now; `{"hung_up": bool}` | +| `GET` | `/device/events?serial=` | Lists a unit's events, either series, each with an opaque `event_id` (`serial:key:timestamp`). A MiniMate list reads headers only (no bulk download) | +| `POST` | `/device/events/download?serial=&event_id=` | Downloads one event, checks it, and stores it in SFM's database; returns `db_event_id` (file at `GET /db/events/{db_event_id}/blastware_file`). A stale `event_id` (unit erased or wrapped since the list) or one from another unit gets **409**, with no download. Re-downloading refreshes the stored row (same `db_event_id`, `inserted: false`). The unit is busy for the whole download; other requests to it get 423 | **Cache bypass** — All cached endpoints accept `?force=true` to skip the cache and force a fresh read from the device. diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 39d7ccb..b7e23e4 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2527,6 +2527,15 @@ POLL 0x15 0x49 POLL 0x1C 0x15 0x49 0x06 0x93 0x06 0x93 0x1E 0x0AƗ9 ← re-walk the list ``` +**2026-10-21 -- direct-by-key download equals the interleaved download (measured, one unit over USB, 5 events listed, 1 waveform compared).** +On UM20147 (`/dev/ttyACM0`), with `list_events()` having walked the cursor to the +end of the chain, `download_event(ref, chunk_size=1024)` of `055d4a82` returned +30,230 B, byte-identical to the same event fetched inside `iter_events()` at the +cursor, and to the file SFM stored through the server (30,230 B). +So `0x5A` does not need the cursor parked at the event, at least on this unit +and event; not tried on a BD unit, over cellular, or on a histogram. +`s4_download_event` was not changed. + **`SUB 0x93` → ack `0x6C`** is sent before every event, with empty params and an all-zero ack. It is the Series IV analogue of Series III's `1E(token=0xFE)` arm step, and it is simpler: no token, no params.