From 1c6aa04687ddef929eadea103de6413c23a69361 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 17:41:00 -0400 Subject: [PATCH 001/223] docs(spec): SFM Series-4 parity and a device safety layer -- design for review Parity of jobs with Series 3 for regular comms and settings (identify, status, settings, events, download, monitor log, start/stop, call-home enable/disable, setup push); Series-4 emergency tools deferred. A single device-access layer: series from the serial prefix, identity confirmed before any write, a per-unit lock, an 0xA2 opcode guard, read-back verification of every change, distinct error codes, and an audit table. Series-4 sessions ("stay on the line") now; Series-3 sessions after a bench test of MiniMate hangup/DCD behaviour. Includes the fix list found in the 2026-10-19 inventory, the to-be-added table, and the RX55 container idea as a parking-lot item. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md new file mode 100644 index 0000000..0cbf114 --- /dev/null +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -0,0 +1,343 @@ +# SFM: Series-4 parity and a device safety layer — design + +**Date:** 2026-10-20 · **Branch:** `feat/series4-sfm-parity` · **Status:** draft for review +**Decided with:** Brian, in conversation 2026-10-19/20. + +## In plain terms + +SFM can already *read* a Micromate almost as well as it reads a MiniMate, but +only through the Python library and bench scripts. SFM's web endpoints still +only speak Series 3. This design does three things: + +1. Gives Series 4 the same everyday jobs in SFM that Series 3 has: identify a + unit, check its status, read its settings, list and download events, + start/stop monitoring, and change its settings. +2. Adds a **safety layer** every device request goes through. It makes sure a + command only reaches the unit it was meant for, logs every change, and + checks every change by reading the unit back. +3. Lets SFM **stay on the line** with a Micromate. It calls up once, confirms + the serial, and keeps the connection open for later commands instead of + reconnecting each time. + +It does **not** cover the emergency tools (runaway-unit stops, rescue, erase), +the call-home receiver, or anything async. Those come later, as features +shared by both series. + +**Production reach, stated honestly:** while THOR is set to stay connected to +production Micromates, a modem's single connection is taken. SFM can't reach +those units until THOR lets go or SFM takes over call-home. In this phase, +Series-4 SFM is for the bench and for units THOR is not holding. + +--- + +## Decisions + +| decision | why | who | +|---|---|---| +| Match **jobs**, not endpoints | some Series-3 endpoints only exist to work around Series-3 quirks | agreed | +| **No Series-4 emergency tools** yet (runaway stop, rescue, erase) | Micromates rarely need them | Brian | +| The series comes from the **serial prefix**: `UM` = Micromate, `BE` = MiniMate Plus, `BA` = Blastmate | the prefixes are definitive, so there is no probing | Brian | +| Before any **write**, confirm the unit that answered is the one named | SFM addresses units by IP; a moved modem or stale IP means a different unit answers | agreed | +| **Synchronous** endpoints for now; async later, for both series together | parity first, then shared features | agreed | +| **No PC-side setup library** | a name is the only link between Thor's two copies, and nothing checks they match | Brian | +| **Sessions for Series 4 now; Series 3 only after a bench test** | THOR holds Micromate lines daily without harm; a MiniMate's hangup/DCD behaviour is untested | Brian | +| Audit log in **SFM's database** (new table) | Terra-View can show it; it fits the existing `CREATE TABLE IF NOT EXISTS` pattern | proposed | + +--- + +## Scope: the parity table + +Rows 8 and 11 of the original inventory (runaway stops, rescue/erase) are out +of scope by decision. + +| # | job | Series 3 in SFM today | Series 4: protocol status | Series 4 in this phase | +|---|---|---|---|---| +| 1 | Identify a unit | `/device/info` (walks the whole chain, slow) | implemented: `connect()` | dispatch to the Micromate client | +| 2 | Quick status (monitoring, battery, memory, clock) | `monitor/status`, `storage_range`, `events/index` | implemented: `get_state()`; the `0x06` event count is decoded only in the bench tool | same endpoints; move the count decode into the client | +| 3 | Read settings | compliance in `/device/info`; `GET /device/call_home` | `get_setup()` implemented and verified on hardware; call-home: enable + dial string observed, rest unmapped | setup in full; call-home returns enable + dial string + raw | +| 4 | List events | `/device/events` (downloads every event to list them) | implemented, and cheap: the chain walk returns sizes | dispatch | +| 5 | Download an event | `/event/{i}`, `/waveform`, `/blastware_file` | implemented: streams the `.IDFW`/`.IDFH` itself, with a decode self-check | save through the existing `/db/import/idf_file` path | +| 6 | Monitor log | only via `ach_server` (broken, see the fix list) | `0x0A` read exists; no wrapper or decoder | client wrapper + partial decode | +| 7 | Start / stop monitoring | `monitor/start`, `monitor/stop` | mapped, identical to Series 3 (`0x96`/`0x97`, acks `0x69`/`0x68`); never sent | **first write.** Verify with `0x49` state | +| 9 | Change call-home settings | `POST /device/call_home` | write mapped (`0x2C` → `0x7E`/`0x7F`, same as Series 3); field map mostly unknown | enable/disable only; the rest waits for the THOR round | +| 10 | Change recording settings | `POST /device/config` | sequence mapped (`0xDA` → `0x68/73` → `0x82/83` → `0x71/72`); no encoder | read-modify-write, stop → push → restart, verify with `get_setup()` | + +--- + +## Architecture + +### One door for every device request + +A new module, `sfm/device_access.py`, sits between the `/device/*` handlers and +the two device libraries. No handler opens a transport or picks a library +itself any more. + +``` +/device/* handler + │ (serial, address, action, tier) + ▼ +device_access ── series from serial prefix ── session / per-unit lock + │ │ │ + │ ▼ ▼ + │ minimateplus (S3) or micromate (S4) audit table + ▼ +read-back verification (changes only) +``` + +- **Series selection.** `serial` picks the library: `UM` → `micromate`; `BE` + or `BA` → `minimateplus`; any other prefix → 422. With no `serial`, the + request is Series 3, so existing Series-3 callers are unchanged. + **Series-4 requests must include `serial`.** +- **Endpoints.** The same `/device/*` paths, plus a `serial` query parameter. + Responses gain `"series": 3 | 4`. Where the two series genuinely differ (the + setup fields, the event identity), the body is series-specific under a + documented shape rather than forced into Series 3's. +- **Work separate from HTTP.** Each operation is a plain function taking the + session. The handler is a thin wrapper, so making an operation an async job + later means changing the wrapper, not the operation. + +### The safety layer + +**Tiers.** Every operation declares one: + +| tier | examples | what the layer does | +|---|---|---| +| read | info, status, setup, events, download | runs; no identity check | +| change | start/stop, call-home, setup push | identity check → audit → send → **read back** → audit the result | +| destructive | delete, erase (none in this phase) | everything above + the caller must send the unit's serial as `confirm` | + +**Identity check (changes only).** Before the first change in a connection, +compare the serial the unit reports with the one requested; on a mismatch, +refuse (409) and send nothing. Series 4 already reads the serial in +`connect()`. A Series-3 change adds one serial read (`SUB 0x15`), about one +round trip. + +**Opcode guard.** A send-side check that refuses known cross-series +collisions. It starts with **`0xA2`**, which is CONFIRM ERASE on Series 3 and +"end call-home" on Series 4. This phase never sends `0xA2`; the guard makes +that impossible by accident. The table of colliding opcodes lives in one +place. + +**One connection per unit.** A per-unit lock keyed by address +(`tcp:host:port` / `serial:port`). A request for a busy unit waits up to +**20 s** (configurable; under Terra-View's 60 s proxy timeout), then gets +**423 "unit busy"** instead of opening a second connection. This applies to Series 3 as well. The webapp's Diagnostics +refresh currently fires three device requests at once against a modem that +allows one; under the lock they queue. + +**Read-back verification.** A zero-data ack has never been proof that a write +applied. Every change is followed by a read: +- start/stop → `0x49` state: start expects `0x02`, stop expects `0x00`. Record + the value either way; `0x03` is the in-call-home state +- call-home → re-read `0x2C` and compare the edited bytes +- setup push → `get_setup()` and compare every field that was set + +A mismatch is reported as a failed change (and audited as one), even if the +ack was clean. + +**Errors that say what happened.** Distinct responses for: +- 503: couldn't connect +- 504: connected but the unit didn't answer +- 423: unit busy +- 409: wrong unit +- 422: bad input +- 502: the reply was malformed + +Today 502 covers both of the first two. + +**Audit table.** New table `device_commands`, created on startup like the +others. It is additive, but still a schema change, so the changelog says so. +One row per change attempt: + +| column | content | +|---|---| +| `ts`, `serial`, `series`, `address` | who and where | +| `action`, `tier` | e.g. `monitor_stop`, `change` | +| `request` | parameters, plus hex of what was sent | +| `ack` | reply summary | +| `verified` | read-back result: `ok` / `mismatch` / `not_checked` | +| `outcome`, `error` | final result | +| `caller` | best-effort origin (`webapp`, `terra-view`, `script`) | + +Reads are not audited. + +### Sessions (Series 4) + +1. **Call up.** Connect, `connect()` (POLL / SERIAL / STATE), identity check + against the requested serial. +2. **On the line.** Requests for that unit run in turn on the same connection, + behind the per-unit lock. +3. **Keep-alive.** A POLL every 60 s while idle. The ACEmanager TCP idle + timeout is 2 min. +4. **Hang up.** On `POST /device/hangup`, after 5 idle minutes, or on any + transport error. A reconnect is a new session with a new identity check. +5. **Ring safety.** If `RADIO RING` arrives on an SFM session, log it and hang + up **immediately**. Until SFM is the call-home destination, the unit's + retry should reach THOR. 🔶 *Inferred:* the unit retries; its `0x2C` + retries field reads 3. + +Series 3 keeps today's connect-per-request behaviour until the bench test +under *Testing*. + +### Series-4 write path + +**Encoder.** Extend `micromate/framing.py`: +- a request builder that carries a data section +- the same escape set `{02,03,04,10}`, applied to data, params and checksum +- plain SUM8 of the destuffed payload (*not* Series 3's write format) + +Rules: `micromate_protocol_reference.md` → *The escape set — exactly four bytes*, +*Checksum — plain SUM8 of the de-stuffed payload*, *Write-frame destuffing*. + +**Dry run.** Every Series-4 write accepts `dry_run=true`. It returns the exact +frames it would send and sends nothing. The first live send of each write is +reviewed this way first. + +**Per operation:** + +| operation | frames | verify | open questions it settles | +|---|---|---|---| +| start / stop | `0x96` / `0x97`, offset `0xFFFF`, zero params | `0x49` | the ack when already in that state | +| call-home enable/disable | read `0x2C` → `0x7E` (126 B content, offset `0x007E`) → `0x7F` | re-read `0x2C` | none new; bit 0 of `write[5]` | +| setup push | read `0x08`, `0x2E`, `0x1A` → `0xDA` (name) → `0x68`/`0x73` → `0x82`/`0x83` → `0x71`/`0x72` | `get_setup()` | the offset rule; whether `0x68`/`0x82` are needed | + +**Setup push, details:** +- Read-modify-write of **all three** blocks, as THOR appears to do. + 🔶 *Inferred from two captures:* `0x68` = the preferences content with + `[0:3]` zeroed; `0x82` = the `0x2E` content with `[0:3]` and the CRC slot + zeroed; `0x71` = the `0x1A` content `[0:2090]` with the length echo zeroed. +- Offsets come from THOR's observed constants. 🔶 The hypothesis "offset = + the read block's length + 2" fits all four, but each has been seen at one + size only. +- The edited fields come from `MicromateSetup` and are written back at the + offsets `setup_block.py` already uses. Only fields graded **measured** may + be edited. +- Sequence: stop monitoring (if running) → push → restart (if it was running) + → verify. THOR's "must be idle" is policy, not the device, but stopping + first removes a variable from the first live write. +- ⚠ **Edit-buffer hazard.** `0x1A` reads the keypad's unsaved edits, so a + read-modify-write taken while someone is in the menu would commit them. + This can't be detected from the wire; it is documented in the endpoint and + audited. +- **Target file:** the active setup, overwritten in place, by default. A + named target is allowed, but overwriting a *non-active* setup or + `factory.MMB` is untested, so it is refused in this phase. + +--- + +## Testing + +**Offline (CI-capable):** +- **Frame reproduction.** The new encoder must reproduce THOR's captured write + frames byte for byte: `0x96`/`0x97`, `0x7E`/`0x7F`, and the full setup push, + from the 9-24 / 9-25 / 10-14 captures. This is the same method that proved + the reads (218/218). The needed frames are copied into force-added fixtures, + since `bridges/captures/` is gitignored. +- **Safety layer on fakes:** + - series by prefix + - identity mismatch → 409, nothing sent + - `0xA2` refused + - lock → 423 + - read-back mismatch → failed change + - audit row written for every change attempt + - RADIO RING → session ends +- **Endpoints** through FastAPI's `TestClient` against the scripted transport + already used in `tests/test_micromate_client.py`. + +**Bench (UM20147, with Brian):** each write's first live send follows the same +protocol: +1. Dry run. +2. Review the frames. +3. Send once, with a capture running. +4. Read back. +5. Write the result into the reference. + +Order: stop/start → call-home off/on → setup push of one field → setup push of +several fields. + +**Series-3 session test (before Series-3 sessions are built):** hold a call-up +session open to a MiniMate that is monitoring, for several minutes. Record: +- does it keep monitoring (does an event still record)? +- after hangup, is it monitoring? +- does it behave differently on an RV55 with the DCD issue? + +--- + +## Build phases + +Each safety piece arrives with its first real use, so nothing sits untested. + +1. **Series-4 reads in SFM.** `device_access.py`, series selection, the + per-unit lock (Series 3 too), the error mapping, and Series-4 sessions with + ring safety. Rows 1–6. **No writes.** +2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still + nothing sent. +3. **Start/stop monitoring** (row 7): the first live write, at the bench. + Brings the identity check, the audit table and the read-back framework. +4. **Call-home enable/disable** (row 9). +5. **Setup push** (row 10): one field first, then several. + +Each phase is its own implementation plan and its own merge. + +--- + +## Out of scope (this phase) + +- Series-4 emergency tools: runaway stops, rescue, per-event delete, erase. + (Erase-all is also unmapped.) +- Async jobs; auth (Terra-View as jump host); the call-home receiver. These + are shared features for later. +- Scheduler read/write/enable; clock set; remote sensor check; restart; + firmware. +- Series-3 sessions, pending the bench test. +- Mapping the rest of `0x2C` (the THOR round). + +## Fix list (found 2026-10-19, separate small changes) + +- `bridges/ach_server.py:524`: `seen_keys` is undefined. Series-3 call-home + monitor-log collection has failed every session since `9afa348` + (2026-05-07). +- `bridges/mm_ach_server.py:262`: `_cstring`/`_content` aren't imported, so + the ring-answer path would raise `NameError`. From `8f67608` (2026-10-14). +- Series-3 `5A` 64 KB page-boundary bug (known; surfaces as HTTP 500). +- `POST /device/config` writes a fixed 29-byte `0x82` blob from one 3-11-26 + capture, whatever the unit's trigger settings. +- `/device/events` runs a full 5A download per event just to list headers. +- `0x08` is named `read_event_index` in `micromate/`; it is the preferences + block. + +## Table 2: to be added later (both series) + +| area | item | +|---|---| +| infrastructure | async jobs; auth via Terra-View | +| THOR has it, SFM doesn't | clock set; remote sensor check; scheduler; one setup to many units; restart | +| call-home receiver | hold lines open (S4); "already downloaded" tracking; rules by serial prefix (copy events, monitor log, delete, set clock); detect "Monitor While Calling Home" blocking deletes (⚠ one unexplained 21 → 5 count drop in THOR's log); hand off to `/db/import/*` instead of the watchers | +| settings, the no-PC-files way | intended settings per deployment; drift report (intended vs actual); push then verify | +| notifications | email/SMS by event type and PPV (THOR does it; may belong in Terra-View) | +| emergency tools for S4 | if a Micromate ever needs them | + +## Parking lot + +**A modem-side agent on the RX55.** AirLink +OS on the RX55 has "Container Applications (Early Adopter)", and Brian already +runs `slmm-proxy` there. A small program owning the unit's serial port could: +- let THOR and SFM share the line +- dial out to SFM, avoiding the IP whitelist +- handle `RADIO RING` locally +- **Brian's hunch:** make RX55s work with Series 3 by driving DTR/DCD itself + +Open questions: +- Can a container open the RS-232 port? +- Can it set the control lines? +- How is it deployed to a fleet, and does it Autostart? +- Will a firmware update keep the beta feature? + +## Open questions this design leaves for the bench + +- The ack for start/stop when the unit is already in that state. +- The offset rule, and whether `0x68`/`0x82` are required, for the setup push. +- Whether the device ever refuses a write while monitoring. Only THOR's policy + has been seen. +- How a failed write is signalled. It has never been observed. +- MiniMate behaviour with a held session (above). -- 2.54.1 From 3215c17e3701e5600e66785d592a1395a574bec2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 18:33:48 -0400 Subject: [PATCH 002/223] docs(spec): one user experience for both series -- the guiding principle, applied Brian's principle: talking to a Series 3 or a Series 4 unit is identical for the user; only the serial prefix and each model's settings differ, and the adapters absorb the rest. Five places the draft broke it, now fixed: units are named the same way (serial + address, no-serial kept only as a legacy Series-3 path); one set of series-neutral response models with series-only fields under `detail`; one opaque event_id for both; a uniform 501 "not supported for Series N yet" instead of missing routes; and the webapp brought into scope with the same screens for both. Adds an adapter table, contract tests that keep the two adapters honest, and notes that existing Series-3 response shapes move to the shared models (the webapp updates with them; Terra-View does not call /device/*). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 91 +++++++++++++++---- 1 file changed, 75 insertions(+), 16 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 0cbf114..5d7bb20 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -19,6 +19,12 @@ only speak Series 3. This design does three things: the serial, and keeps the connection open for later commands instead of reconnecting each time. +**The guiding principle (Brian): talking to a Series 3 unit and talking to a +Series 4 unit is the same for the user.** It is the same screens, the same +endpoints, the same way of naming a unit, and the same shape of answer. The +only visible difference is the serial (`UM…` vs `BE…`) and the settings each +model has. The differences live underneath, in one adapter per series. + It does **not** cover the emergency tools (runaway-unit stops, rescue, erase), the call-home receiver, or anything async. Those come later, as features shared by both series. @@ -34,6 +40,7 @@ Series-4 SFM is for the bench and for units THOR is not holding. | decision | why | who | |---|---|---| +| **One user experience for both series** | the user's method is identical; only the serial prefix and each model's settings differ; adapters absorb the rest | Brian | | Match **jobs**, not endpoints | some Series-3 endpoints only exist to work around Series-3 quirks | agreed | | **No Series-4 emergency tools** yet (runaway stop, rescue, erase) | Micromates rarely need them | Brian | | The series comes from the **serial prefix**: `UM` = Micromate, `BE` = MiniMate Plus, `BA` = Blastmate | the prefixes are definitive, so there is no probing | Brian | @@ -55,8 +62,8 @@ of scope by decision. | 1 | Identify a unit | `/device/info` (walks the whole chain, slow) | implemented: `connect()` | dispatch to the Micromate client | | 2 | Quick status (monitoring, battery, memory, clock) | `monitor/status`, `storage_range`, `events/index` | implemented: `get_state()`; the `0x06` event count is decoded only in the bench tool | same endpoints; move the count decode into the client | | 3 | Read settings | compliance in `/device/info`; `GET /device/call_home` | `get_setup()` implemented and verified on hardware; call-home: enable + dial string observed, rest unmapped | setup in full; call-home returns enable + dial string + raw | -| 4 | List events | `/device/events` (downloads every event to list them) | implemented, and cheap: the chain walk returns sizes | dispatch | -| 5 | Download an event | `/event/{i}`, `/waveform`, `/blastware_file` | implemented: streams the `.IDFW`/`.IDFH` itself, with a decode self-check | save through the existing `/db/import/idf_file` path | +| 4 | List events | `/device/events` (downloads every event to list them) | implemented, and cheap: the chain walk returns sizes | the same event-list shape as Series 3, each event carrying an `event_id` | +| 5 | Download an event | `/event/{i}`, `/waveform`, `/blastware_file` | implemented: streams the `.IDFW`/`.IDFH` itself, with a decode self-check | the same download and save-to-DB actions as Series 3. Underneath, Series 4 saves through `/db/import/idf_file` | | 6 | Monitor log | only via `ach_server` (broken, see the fix list) | `0x0A` read exists; no wrapper or decoder | client wrapper + partial decode | | 7 | Start / stop monitoring | `monitor/start`, `monitor/stop` | mapped, identical to Series 3 (`0x96`/`0x97`, acks `0x69`/`0x68`); never sent | **first write.** Verify with `0x49` state | | 9 | Change call-home settings | `POST /device/call_home` | write mapped (`0x2C` → `0x7E`/`0x7F`, same as Series 3); field map mostly unknown | enable/disable only; the rest waits for the THOR round | @@ -84,18 +91,61 @@ device_access ── series from serial prefix ── session / per-unit lock read-back verification (changes only) ``` -- **Series selection.** `serial` picks the library: `UM` → `micromate`; `BE` - or `BA` → `minimateplus`; any other prefix → 422. With no `serial`, the - request is Series 3, so existing Series-3 callers are unchanged. - **Series-4 requests must include `serial`.** -- **Endpoints.** The same `/device/*` paths, plus a `serial` query parameter. - Responses gain `"series": 3 | 4`. Where the two series genuinely differ (the - setup fields, the event identity), the body is series-specific under a - documented shape rather than forced into Series 3's. +- **Naming a unit is the same for both: `serial` + address.** The prefix picks + the adapter: `UM` → Series 4 (`micromate`); `BE` or `BA` → Series 3 + (`minimateplus`); any other prefix → 422. A request with no `serial` is + treated as Series 3. That is a **legacy path** kept only so existing scripts + keep working; the webapp and every new caller always send `serial`. +- **One contract.** Same `/device/*` paths, same request parameters, and + **the same response models for both series**: + - `UnitInfo`, `UnitStatus`, `UnitSettings`, `EventRef`, `ChangeResult` + - Anything only one series has goes under a `detail` object inside the same + model, never as a different top-level shape. `"series": 3 | 4` is + informational. +- **Events have one identity.** An opaque `event_id` string from the event + list, passed back to download it. Underneath it is Series 3's position or + Series 4's device key, plus the serial; the user never handles either. +- **Not-yet-supported is uniform.** If one series can't do something yet, + the endpoint still exists and answers **501 "not supported for Series N + yet"**. It is never a missing route or a different call. - **Work separate from HTTP.** Each operation is a plain function taking the session. The handler is a thin wrapper, so making an operation an async job later means changing the wrapper, not the operation. +### Adapters + +Each series implements the same operation set behind `device_access`: + +| operation | Series 3 adapter | Series 4 adapter | +|---|---|---| +| `identify` | STARTUP + serial + config | `connect()` | +| `status` | `0x1C` (+ `0x06`) | `get_state()` + `0x06` count | +| `read_settings` | `0x1A` compliance decode | `get_setup()` | +| `list_events` | today's walk | chain walk (cheap) | +| `download_event` | 5A → Blastware file | 5A → `.IDFW`/`.IDFH` | +| `monitor_log` | 501 for now (`ach_server` path is broken) | `0x0A` wrapper | +| `start` / `stop` | `0x96` / `0x97` (exists) | `0x96` / `0x97` (new) | +| `read_call_home` / `set_call_home_enabled` | exists | `0x2C` / `0x7E`+`0x7F` | +| `push_settings` | `/device/config` path (exists) | setup push (new) | +| `call_up` / `hang_up` | connect-per-request underneath, until the bench test | held session | + +Each adapter maps its native data into the shared models. `UnitSettings` keeps +the fields both series have under the same names and units: record mode, +sample rate, record time, histogram interval, trigger levels, the notes as +label → value. Model-specific fields go under `detail`. + +**Existing Series-3 response shapes change to the shared models.** The webapp +is updated in the same phase; Terra-View does not call `/device/*`. The +emergency endpoints (`stop_monitoring_*`, `rescue`, `events/erase`) are not +touched and stay Series-3 only; a `UM` serial gets 501. + +### The webapp + +The same screens for both series. You name a unit by serial + address (today +it takes host/port only), and the series shows as a badge, nothing more. Read +panels for both series land in phase 1; each write button appears for Series 4 +in the phase that adds that write. + ### The safety layer **Tiers.** Every operation declares one: @@ -161,7 +211,7 @@ One row per change attempt: Reads are not audited. -### Sessions (Series 4) +### Sessions 1. **Call up.** Connect, `connect()` (POLL / SERIAL / STATE), identity check against the requested serial. @@ -176,8 +226,9 @@ Reads are not audited. retry should reach THOR. 🔶 *Inferred:* the unit retries; its `0x2C` retries field reads 3. -Series 3 keeps today's connect-per-request behaviour until the bench test -under *Testing*. +**Call up and hang up are the same for both series.** Underneath, the +Series-3 adapter keeps today's connect-per-request behaviour until the bench +test under *Testing*; the user sees the same actions either way. ### Series-4 write path @@ -243,6 +294,11 @@ reviewed this way first. - RADIO RING → session ends - **Endpoints** through FastAPI's `TestClient` against the scripted transport already used in `tests/test_micromate_client.py`. +- **Contract tests.** The same test, run against both adapters with fakes, + asserts that each job returns the same model with the same field names and + units. A field present for one series and absent for the other is a test + failure unless it lives under `detail`. This is the test that keeps the + guiding principle true as the code grows. **Bench (UM20147, with Brian):** each write's first live send follows the same protocol: @@ -267,9 +323,12 @@ session open to a MiniMate that is monitoring, for several minutes. Record: Each safety piece arrives with its first real use, so nothing sits untested. -1. **Series-4 reads in SFM.** `device_access.py`, series selection, the - per-unit lock (Series 3 too), the error mapping, and Series-4 sessions with - ring safety. Rows 1–6. **No writes.** +1. **One contract, reads only.** `device_access.py`, the two adapters, the + shared models, series selection, the per-unit lock, the error mapping, and + sessions with ring safety. Rows 1–6 for **both** series through the same + endpoints. **No writes.** + - 1b. **The webapp:** serial + address, and the same read panels for both + series. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. 3. **Start/stop monitoring** (row 7): the first live write, at the bench. -- 2.54.1 From 90171996d6b5a2e70aef63398d879e4111e6958c Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 18:38:56 -0400 Subject: [PATCH 003/223] docs(spec): say plainly what 'no PC-side setup library' means Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 5d7bb20..b59b778 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -46,7 +46,7 @@ Series-4 SFM is for the bench and for units THOR is not holding. | The series comes from the **serial prefix**: `UM` = Micromate, `BE` = MiniMate Plus, `BA` = Blastmate | the prefixes are definitive, so there is no probing | Brian | | Before any **write**, confirm the unit that answered is the one named | SFM addresses units by IP; a moved modem or stale IP means a different unit answers | agreed | | **Synchronous** endpoints for now; async later, for both series together | parity first, then shared features | agreed | -| **No PC-side setup library** | a name is the only link between Thor's two copies, and nothing checks they match | Brian | +| **No library of setup files on the PC** (unlike THOR). The unit's own settings are the truth: SFM reads them from the unit, and verifies every push by reading the unit back | THOR keeps one copy of each setup on the PC and another on the unit, linked only by file name. Nothing checks the contents match, so the PC's `test2` and the unit's `test2` can say different things | Brian | | **Sessions for Series 4 now; Series 3 only after a bench test** | THOR holds Micromate lines daily without harm; a MiniMate's hangup/DCD behaviour is untested | Brian | | Audit log in **SFM's database** (new table) | Terra-View can show it; it fits the existing `CREATE TABLE IF NOT EXISTS` pattern | proposed | -- 2.54.1 From 435c1978a0f9f523042b1f342ed4ba2481fb3d43 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 18:42:41 -0400 Subject: [PATCH 004/223] docs(spec): park setup files and schedules as one open question Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index b59b778..a121d49 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -378,6 +378,21 @@ Each phase is its own implementation plan and its own merge. ## Parking lot +**How SFM handles setup files and schedules.** This phase only reads and +pushes the unit's *active* setup, with no PC-side library (the `.mmb` +same-name/different-contents gotcha). Still to decide, as one question because +the two are coupled: +- The unit stores up to 25 named `.MMB` files. Should SFM manage them (list, + select, rename, delete, push to a named file), or only ever touch the active + one? +- **Schedules name setup files.** A schedule entry switches the unit to a + setup by name, so a schedule is only as reliable as the files it points to. + What if it points to a file that isn't there? That is untested. +- How "intended settings per deployment" (Table 2) fits with files and + schedules. +- Scheduler read/write is mostly mapped (file transfer + `0x47`); **disable has + never been captured**. + **A modem-side agent on the RX55.** AirLink OS on the RX55 has "Container Applications (Early Adopter)", and Brian already runs `slmm-proxy` there. A small program owning the unit's serial port could: -- 2.54.1 From 68cad4e2ab013bfac2304846e6eb3cb18f81759f Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 18:54:24 -0400 Subject: [PATCH 005/223] docs(spec): monitor logs are their own piece of work -- row 6 moves to the parking lot Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index a121d49..4de12c0 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -55,7 +55,8 @@ Series-4 SFM is for the bench and for units THOR is not holding. ## Scope: the parity table Rows 8 and 11 of the original inventory (runaway stops, rescue/erase) are out -of scope by decision. +of scope by decision. Row 6 (monitor log) moved to the parking lot: it is its +own piece of work, together with call-in monitor-log ingest. | # | job | Series 3 in SFM today | Series 4: protocol status | Series 4 in this phase | |---|---|---|---|---| @@ -64,7 +65,6 @@ of scope by decision. | 3 | Read settings | compliance in `/device/info`; `GET /device/call_home` | `get_setup()` implemented and verified on hardware; call-home: enable + dial string observed, rest unmapped | setup in full; call-home returns enable + dial string + raw | | 4 | List events | `/device/events` (downloads every event to list them) | implemented, and cheap: the chain walk returns sizes | the same event-list shape as Series 3, each event carrying an `event_id` | | 5 | Download an event | `/event/{i}`, `/waveform`, `/blastware_file` | implemented: streams the `.IDFW`/`.IDFH` itself, with a decode self-check | the same download and save-to-DB actions as Series 3. Underneath, Series 4 saves through `/db/import/idf_file` | -| 6 | Monitor log | only via `ach_server` (broken, see the fix list) | `0x0A` read exists; no wrapper or decoder | client wrapper + partial decode | | 7 | Start / stop monitoring | `monitor/start`, `monitor/stop` | mapped, identical to Series 3 (`0x96`/`0x97`, acks `0x69`/`0x68`); never sent | **first write.** Verify with `0x49` state | | 9 | Change call-home settings | `POST /device/call_home` | write mapped (`0x2C` → `0x7E`/`0x7F`, same as Series 3); field map mostly unknown | enable/disable only; the rest waits for the THOR round | | 10 | Change recording settings | `POST /device/config` | sequence mapped (`0xDA` → `0x68/73` → `0x82/83` → `0x71/72`); no encoder | read-modify-write, stop → push → restart, verify with `get_setup()` | @@ -123,7 +123,6 @@ Each series implements the same operation set behind `device_access`: | `read_settings` | `0x1A` compliance decode | `get_setup()` | | `list_events` | today's walk | chain walk (cheap) | | `download_event` | 5A → Blastware file | 5A → `.IDFW`/`.IDFH` | -| `monitor_log` | 501 for now (`ach_server` path is broken) | `0x0A` wrapper | | `start` / `stop` | `0x96` / `0x97` (exists) | `0x96` / `0x97` (new) | | `read_call_home` / `set_call_home_enabled` | exists | `0x2C` / `0x7E`+`0x7F` | | `push_settings` | `/device/config` path (exists) | setup push (new) | @@ -325,7 +324,7 @@ Each safety piece arrives with its first real use, so nothing sits untested. 1. **One contract, reads only.** `device_access.py`, the two adapters, the shared models, series selection, the per-unit lock, the error mapping, and - sessions with ring safety. Rows 1–6 for **both** series through the same + sessions with ring safety. Rows 1–5 for **both** series through the same endpoints. **No writes.** - 1b. **The webapp:** serial + address, and the same read panels for both series. @@ -378,6 +377,23 @@ Each phase is its own implementation plan and its own merge. ## Parking lot +**Monitor logs.** Its own piece of work, data side as much as device side. +A unit calls in at least once or twice a day. With no events (e.g. waveform +mode, no blast that day) it still delivers a **monitor log**: "monitoring from +X to Y". The watchers (one for BW-ACH / Series 3, one for THOR-ACH / Series 4) +use the newest file per unit, event or `.MLG`, as SFM's "last heard from" age. +They forward waveform and histogram files but **not** monitor logs. To decide: +- Ingest call-in monitor logs into SFM. SFM's DB **already has** a + `monitor_log` table (one row per interval, deduped by serial + start time), + and `minimateplus/blastware_file.py` already parses Series-3 `.MLG`. + Missing: anything that takes `.MLG` in from the watchers, and knowledge of + THOR's Series-4 monitor-log file format. +- A live monitor-log read over a connection (Series 4: `0x0A` exists, no + wrapper or decoder; Series 3 in SFM: none). +- What it is for: proof of coverage ("was it monitoring when they blasted?") + and visible gaps. +- Related fix-list item: `ach_server.py`'s `seen_keys`. + **How SFM handles setup files and schedules.** This phase only reads and pushes the unit's *active* setup, with no PC-side library (the `.mmb` same-name/different-contents gotcha). Still to decide, as one question because -- 2.54.1 From bbc6fe2a61c66bd1f0574ac872c942cd13ff469e Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 19:03:03 -0400 Subject: [PATCH 006/223] docs(spec): serial-less requests keep today's shapes; phase 1 splits into 1a/1b/1c Nothing breaks between phases: the shared models apply when a request names the unit by serial, and the legacy Series-3 path stays as it is until the webapp (1c) and watch_unit.sh move over. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 4de12c0..1c4bb69 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -133,8 +133,10 @@ the fields both series have under the same names and units: record mode, sample rate, record time, histogram interval, trigger levels, the notes as label → value. Model-specific fields go under `detail`. -**Existing Series-3 response shapes change to the shared models.** The webapp -is updated in the same phase; Terra-View does not call `/device/*`. The +**Requests that include `serial` get the shared models; requests without it +keep today's Series-3 shapes, unchanged.** Nothing breaks in between: the +webapp moves to `serial` in phase 1c, and the old path retires after that and +after `watch_unit.sh` moves. Terra-View does not call `/device/*`. The emergency endpoints (`stop_monitoring_*`, `rescue`, `events/erase`) are not touched and stay Series-3 only; a `UM` serial gets 501. @@ -325,8 +327,10 @@ Each safety piece arrives with its first real use, so nothing sits untested. 1. **One contract, reads only.** `device_access.py`, the two adapters, the shared models, series selection, the per-unit lock, the error mapping, and sessions with ring safety. Rows 1–5 for **both** series through the same - endpoints. **No writes.** - - 1b. **The webapp:** serial + address, and the same read panels for both + endpoints. **No writes.** Split into three plans: + - 1a. The foundation plus identify / status / settings for both series. + - 1b. Event list and download for both series (rows 4–5). + - 1c. **The webapp:** serial + address, and the same read panels for both series. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. -- 2.54.1 From 8eab5f9479ecc5b5685a01503fa137bac9f39a4d Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 20 Oct 2026 19:10:15 -0400 Subject: [PATCH 007/223] docs(plan): SFM device access phase 1a -- foundation plus identify/status/settings for both series Ten tasks, test-first: the is_open fix, two client reads, core types, the per-unit lock, both adapters, Series-4 sessions with ring safety, DeviceAccess with the reaper and the contract tests, the endpoints, and a read-only bench check on UM20147. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-device-access-phase1a.md | 2400 +++++++++++++++++ 1 file changed, 2400 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-20-sfm-device-access-phase1a.md diff --git a/docs/superpowers/plans/2026-10-20-sfm-device-access-phase1a.md b/docs/superpowers/plans/2026-10-20-sfm-device-access-phase1a.md new file mode 100644 index 0000000..1034724 --- /dev/null +++ b/docs/superpowers/plans/2026-10-20-sfm-device-access-phase1a.md @@ -0,0 +1,2400 @@ +# SFM device access, phase 1a — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** SFM can identify a unit, read its status and read its settings +through one series-neutral contract. The unit is named by serial + address +and works the same for a Series 3 (`BE…`/`BA…`) or Series 4 (`UM…`) unit. +Micromates get a held session ("stay on the line"). + +**Architecture:** A new package `sfm/device_access/` sits between the +`/device/*` handlers and the two device libraries: +- The serial prefix picks a series adapter. +- A per-unit lock gives one connection per unit. +- Series-4 sessions stay open, with keep-alive, idle hang-up and ring safety. +- Every library exception becomes one of a few typed errors with a fixed HTTP + status. + +Handlers take an optional `serial`. With it they return the shared models; +without it they run exactly as today. + +**Tech Stack:** Python ≥ 3.10, FastAPI 0.135 (already used), pyserial (already +a dependency), pytest. No new dependencies. + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`. +This plan is phase **1a**. Event list/download (1b) and the webapp (1c) are +separate plans. + +## Global Constraints + +- **Reads only.** The Series-4 path may call only `connect()`, `get_state()`, + `get_setup()`, `get_event_count()`, `read_unsolicited()` and + `protocol.poll()`. The Series-3 path may call only `connect()`, `poll()` and + `get_monitor_status()`. Nothing that changes a unit is sent in this phase. +- **Never put Series-3 bytes on a Micromate's wire.** Nothing under + `sfm/device_access/s4.py` may import `minimateplus.protocol`, + `minimateplus.framing` or `minimateplus.client`. `SESSION_RESET` (`41 03`) + has never been sent to a Micromate. Only `minimateplus.transport` is shared. +- **Requests without `serial` behave exactly as today.** The legacy Series-3 + code path in each handler is left untouched. +- Serial prefixes: `UM` → Series 4; `BE`, `BA` → Series 3; anything else → + 422. Serials are compared after `.strip().upper()`. +- Timings (spec): lock wait **20 s**, keep-alive **60 s**, idle hang-up + **300 s**, reaper tick **5 s**. +- Error statuses (spec): + + | status | when | + |---|---| + | 503 | could not connect / connection lost / unit started calling home | + | 504 | connected, the unit did not answer | + | 423 | unit busy | + | 409 | wrong unit | + | 422 | bad input | + | 502 | malformed reply | + | 501 | not supported yet | + +- Default serial baud when the caller gives none: Series 3 **38400**, Series 4 + **115200**. +- ⚠ **Handlers are called directly in tests.** Their FastAPI `Query(...)` + defaults are `FieldInfo` objects, not values, so every test call must pass + every parameter explicitly. The same applies to one handler calling + another. `httpx` is not installed, so `TestClient` tests are skipped + silently; do not use them. +- Feature branch: do **not** edit `CHANGELOG.md` (it is written on `dev` at + merge). +- Every commit message ends with: + ``` + Co-Authored-By: Claude Opus 5.5 + Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 + ``` +- Run tests with `.venv/bin/python -m pytest`. The full suite currently + reports **16 failed, 541 passed, 46 skipped**: the 16 failures are + pre-existing, in `test_bw_ascii_report.py` (15) and `test_event_file_io.py` + (1). That baseline must not change except by new passing tests. + +## Review Focus + +1. **A serial typed in lower case or with spaces** (`" um20147"`) is accepted + and treated as `UM20147`, never rejected → Task 3. +2. **Two requests for the same unit at once** (the webapp fires three): the + second waits, then gets 423. A second connection is never opened → Tasks 4 + and 8. +3. **The modem dropped an idle line** (2-minute TCP idle timeout): the next + request calls up again quietly instead of failing → Task 8. +4. **A different unit answers at the address** (moved modem, stale IP): 409, + the connection is closed, and nothing further is sent → Tasks 5 and 6. +5. **`RADIO RING` arrives mid-request or while idle**: the line is released at + once, the caller gets a clear 503, and the next request calls up fresh → + Tasks 6 and 8. + +--- + +## File Structure + +| path | responsibility | +|---|---| +| `micromate/client.py` (modify) | fix `is_open()`; add `get_event_count()` and `read_unsolicited()` | +| `sfm/device_access/__init__.py` | public exports | +| `sfm/device_access/errors.py` | typed errors with HTTP statuses; `translate()` | +| `sfm/device_access/series.py` | serial normalisation; prefix → series | +| `sfm/device_access/models.py` | `UnitAddress`, `UnitInfo`, `UnitStatus`, `UnitSettings` | +| `sfm/device_access/locks.py` | per-unit lock with timeout | +| `sfm/device_access/s3.py` | Series-3 adapter (connect-per-request) | +| `sfm/device_access/s4.py` | `RingWatchTransport`, `Series4Session`, Series-4 operations | +| `sfm/device_access/access.py` | `DeviceAccess`: dispatch, sessions, hang-up, reaper | +| `sfm/server.py` (modify) | `serial` on `/device/info`, `/device/connect`, `/device/monitor/status`; new `GET /device/settings`, `POST /device/hangup` | +| `tests/device_access_fakes.py` | test-only fakes of both clients | +| `tests/test_device_access_core.py` | errors, series, models, locks | +| `tests/test_device_access_s3.py` | Series-3 adapter | +| `tests/test_device_access_s4.py` | ring watch, session, Series-4 operations | +| `tests/test_device_access.py` | `DeviceAccess` + contract tests | +| `tests/test_server_device_access.py` | handlers | + +--- + +### Task 1: Fix `MicromateClient.is_open()` + +`is_connected` is a **property** on `BaseTransport` (`minimateplus/transport.py:59`). +`MicromateClient.is_open()` *calls* it, so on every real transport it raises +`TypeError: 'bool' object is not callable`. The test double in +`tests/test_micromate_client.py` defines `is_connected` as a **method**, +which is why no test caught it. Sessions depend on `is_open()`. + +**Files:** +- Modify: `micromate/client.py` (`is_open`, around line 130) +- Modify: `tests/test_micromate_client.py` (`ScriptedTransport`, around line 112; the test around line 406) + +**Interfaces:** +- Produces: `MicromateClient.is_open() -> bool`, now correct on real transports. + +- [ ] **Step 1: Make the test double match the real interface, and add a real-transport test** + +In `tests/test_micromate_client.py`, change `ScriptedTransport.is_connected` to a property: + +```python + @property + def is_connected(self) -> bool: + return self._connected +``` + +In `test_the_client_owns_the_transport` (around line 406), change +`t.is_connected()` to `t.is_connected`. + +Then run `grep -n "is_connected" tests/test_micromate_*.py` and convert any +other method-style `is_connected` in those test doubles the same way. + +Append this test: + +```python +def test_is_open_works_on_a_real_transport(): + """`is_connected` is a PROPERTY on BaseTransport. is_open() used to call + it, which raised TypeError on every real transport -- hidden because the + test double defined it as a method.""" + from minimateplus.transport import TcpTransport + + mm = MicromateClient(TcpTransport("127.0.0.1", port=9)) # never connected + assert mm.is_open() is False +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_micromate_client.py -q` +Expected: `test_is_open_works_on_a_real_transport` and +`test_the_client_owns_the_transport` FAIL with +`TypeError: 'bool' object is not callable`. + +- [ ] **Step 3: Fix `is_open`** + +In `micromate/client.py`: + +```python + def is_open(self) -> bool: + # `is_connected` is a PROPERTY on BaseTransport. Calling it raised + # TypeError on every real transport; only a test double that defined + # it as a method hid that. + return bool(self._transport.is_connected) +``` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_micromate_*.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add micromate/client.py tests/test_micromate_client.py +git commit -m "fix(micromate): is_open() called a property -- TypeError on every real transport" -m "Hidden because the test double defined is_connected as a method; it is now a property, matching BaseTransport." -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 2: Client additions for status and sessions + +Two reads move into the client: +- `get_event_count()`. `0x06` content[0:4] is the event count: 3/3 against + the chain walk, and THOR's own `ReadEventRecordCount` agrees. Until now it + was decoded only in `bridges/mm_client_check.py`. +- `read_unsolicited()`. It reads whatever the unit sent unprompted, **sending + nothing**. The session uses it to notice `RADIO RING` while idle. + +**Files:** +- Modify: `micromate/client.py` (constants near the other `_MS_*` constants; methods next to `get_state`) +- Test: `tests/test_micromate_client.py` + +**Interfaces:** +- Produces: + - `MicromateClient.get_event_count() -> int`; raises `ProtocolError` if the content is under 4 bytes. + - `MicromateClient.read_unsolicited() -> bytes`; one transport read, nothing written. + +- [ ] **Step 1: Capture a real `0x06` read from UM20147 (read-only)** + +The bench unit is on `/dev/ttyACM0`; `dialout` needs `sg`. This sends only +reads. + +```bash +cat > /tmp/mm_capture_0x06.py <<'EOF' +import sys +sys.path.insert(0, ".") +from minimateplus.transport import SerialTransport +from micromate.client import MicromateClient + +with MicromateClient(SerialTransport("/dev/ttyACM0", 115200)) as mm: + mm.connect() + data = mm.protocol.read_storage_range() + refs = mm.list_events(with_records=False) + print("DATA_HEX =", data.hex()) + print("CHAIN_WALK_COUNT =", len(refs)) +EOF +sg dialout -c ".venv/bin/python /tmp/mm_capture_0x06.py" +``` + +Record both printed values. The expected count in the test is +`CHAIN_WALK_COUNT`: the chain walk is an independent count, never this +method's own output. + +- [ ] **Step 2: Write the failing tests** + +Append to `tests/test_micromate_client.py`. Paste the captured hex and count +where marked; both are values from Step 1, not choices. + +```python +# ── get_event_count() / read_unsolicited() ──────────────────────────────────── + +# 0x06 response data captured from UM20147 (11.0BD) by Task 2, Step 1. The +# expected count is that session's independent chain-walk count. +SR_UM20147 = bytes.fromhex("PASTE DATA_HEX FROM STEP 1") +SR_UM20147_CHAIN_WALK_COUNT = 0 # replace 0 with CHAIN_WALK_COUNT from Step 1 + + +def test_event_count_is_content_0_4_and_matches_the_chain_walk(): + mm, t = client([frame(0xF9, SR_UM20147, flags=FLAGS_THOR)]) + assert mm.get_event_count() == SR_UM20147_CHAIN_WALK_COUNT + assert [w[5] for w in t.written] == [0x06] + + +def test_a_truncated_storage_range_raises(): + mm, _ = client([frame(0xF9, bytes(CONTENT) + b"\x00\x05", flags=FLAGS_THOR)]) + with pytest.raises(ProtocolError, match="storage range"): + mm.get_event_count() + + +def test_read_unsolicited_sends_nothing_and_returns_what_arrived(): + """Used to spot RADIO RING on an idle session. It must never write.""" + mm, t = client([b"\r\nRADIO RING\r\n"]) + assert mm.read_unsolicited() == b"\r\nRADIO RING\r\n" + assert t.written == [] +``` + +- [ ] **Step 3: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_micromate_client.py -q -k "event_count or storage_range or unsolicited"` +Expected: FAIL with `AttributeError: 'MicromateClient' object has no attribute 'get_event_count'` +(and the same for `read_unsolicited`). + +- [ ] **Step 4: Implement** + +In `micromate/client.py`, next to the `_MS_*` constants: + +```python +# 0x06 storage range. content[0:4] is the event count: 3/3 against the chain +# walk, and THOR's ReadEventRecordCount agrees. content[4:8] is very likely +# the monitor-log count -- graded a strong candidate, not settled, so not exposed. +_SR_EVENT_COUNT = slice(0, 4) +``` + +And these methods, after `get_state`: + +```python + def get_event_count(self) -> int: + """`SUB 0x06` -- events stored. One read; no chain walk.""" + c = _content(self._proto.read_storage_range()) + if len(c) < 4: + raise ProtocolError(f"storage range content is {len(c)} B, need at least 4") + return int.from_bytes(c[_SR_EVENT_COUNT], "big") + + def read_unsolicited(self) -> bytes: + """Whatever the unit sent unprompted. **Sends nothing.** + + One transport read. Bytes between commands are noise to the protocol + (every request resets the parser), so reading them here takes nothing + the protocol needs. A session calls this while idle to notice + RADIO RING without waiting for its next keep-alive. + """ + return self._transport.read(4096) +``` + +- [ ] **Step 5: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_micromate_*.py -q` +Expected: all pass. + +- [ ] **Step 6: Commit** + +```bash +git add micromate/client.py tests/test_micromate_client.py +git commit -m "feat(micromate): get_event_count() and read_unsolicited()" -m "0x06 content[0:4] moves from the bench tool into the client, tested against a real UM20147 read and its chain-walk count. read_unsolicited() reads without sending, for spotting RADIO RING on an idle session." -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 3: Core types — errors, series, models + +**Files:** +- Create: `sfm/device_access/__init__.py`, `sfm/device_access/errors.py`, `sfm/device_access/series.py`, `sfm/device_access/models.py` +- Test: `tests/test_device_access_core.py` + +**Interfaces:** +- Produces: + - `errors.py`: `DeviceError` (base, `.http_status`); subclasses `BadRequest` 422, `NotSupported` 501, `WrongUnit` 409, `UnitBusy` 423, `ConnectFailed` 503, `CallHomeInProgress` 503, `NoAnswer` 504, `MalformedReply` 502; and `translate(exc: BaseException, *, connecting: bool) -> DeviceError`. + - `series.py`: `normalise_serial(serial: str) -> str`; `series_for_serial(serial: str) -> int` (raises `BadRequest`). + - `models.py`: `UnitAddress(host: Optional[str], tcp_port: Optional[int], port: Optional[str], baud: Optional[int])` (frozen; `.key -> str`; raises `BadRequest` if neither host nor port); dataclasses `UnitInfo`, `UnitStatus`, `UnitSettings` (fields below). + +- [ ] **Step 1: Write the failing tests** + +Create `tests/test_device_access_core.py`: + +```python +"""Core types of sfm.device_access: errors, series selection, models.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +import minimateplus.protocol as mmp_proto # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + BadRequest, ConnectFailed, DeviceError, MalformedReply, NoAnswer, translate, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.series import normalise_serial, series_for_serial # noqa: E402 + + +# ── series ──────────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize( + "serial, series", + [("UM20147", 4), ("BE18193", 3), ("BA4521", 3), (" um20147 ", 4), ("be11529", 3)], +) +def test_the_prefix_picks_the_series(serial, series): + assert series_for_serial(serial) == series + + +def test_serials_are_normalised(): + assert normalise_serial(" um20147\n") == "UM20147" + + +@pytest.mark.parametrize("serial", ["", "UM", "XX12345", "12345", "MP1234"]) +def test_an_unknown_or_bare_prefix_is_a_bad_request(serial): + with pytest.raises(BadRequest, match="UM"): + series_for_serial(serial) + + +# ── errors ──────────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize( + "exc, connecting, cls, status", + [ + (mm_proto.TimeoutError("no frame"), False, NoAnswer, 504), + (mmp_proto.TimeoutError("no frame"), False, NoAnswer, 504), + (mm_proto.ChecksumError("bad"), False, MalformedReply, 502), + (mmp_proto.ProtocolError("bad"), False, MalformedReply, 502), + (ConnectionRefusedError("refused"), True, ConnectFailed, 503), + (OSError("reset"), False, ConnectFailed, 503), + ], +) +def test_library_exceptions_translate_to_typed_errors(exc, connecting, cls, status): + out = translate(exc, connecting=connecting) + assert isinstance(out, cls) + assert out.http_status == status + + +def test_connect_and_mid_session_failures_read_differently(): + assert "could not connect" in str(translate(OSError("x"), connecting=True)) + assert "connection lost" in str(translate(OSError("x"), connecting=False)) + + +def test_a_device_error_passes_through_unchanged(): + e = NoAnswer("quiet") + assert translate(e, connecting=False) is e + + +def test_anything_else_becomes_a_plain_device_error(): + out = translate(ValueError("boom"), connecting=False) + assert type(out) is DeviceError and out.http_status == 500 + + +# ── models ──────────────────────────────────────────────────────────────────── + +def test_an_address_needs_a_host_or_a_port(): + with pytest.raises(BadRequest): + UnitAddress(host=None, tcp_port=None, port=None, baud=None) + + +def test_the_lock_key_names_the_physical_link(): + assert UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None).key == "tcp:10.0.0.5:9034" + assert UnitAddress(host=None, tcp_port=None, port="/dev/ttyACM0", baud=115200).key == "serial:/dev/ttyACM0" +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access_core.py -q` +Expected: collection ERROR, `ModuleNotFoundError: No module named 'sfm.device_access'`. + +- [ ] **Step 3: Implement** + +`sfm/device_access/errors.py`: + +```python +"""Typed device errors, each with the HTTP status the endpoints return.""" +from __future__ import annotations + +import micromate.protocol as _mm_proto +import minimateplus.protocol as _mmp_proto + + +class DeviceError(Exception): + http_status = 500 + + +class BadRequest(DeviceError): + http_status = 422 + + +class NotSupported(DeviceError): + http_status = 501 + + +class WrongUnit(DeviceError): + http_status = 409 + + +class UnitBusy(DeviceError): + http_status = 423 + + +class ConnectFailed(DeviceError): + http_status = 503 + + +class CallHomeInProgress(DeviceError): + http_status = 503 + + +class NoAnswer(DeviceError): + http_status = 504 + + +class MalformedReply(DeviceError): + http_status = 502 + + +_TIMEOUTS = (_mm_proto.TimeoutError, _mmp_proto.TimeoutError) +_PROTOCOL = (_mm_proto.ProtocolError, _mmp_proto.ProtocolError) + + +def translate(exc: BaseException, *, connecting: bool) -> DeviceError: + """Map a library exception to a typed error. + + Order matters: each library's TimeoutError is a ProtocolError subclass, and + the builtin TimeoutError (a failed TCP connect) is an OSError. + """ + if isinstance(exc, DeviceError): + return exc + if isinstance(exc, _TIMEOUTS): + return NoAnswer(f"the unit did not answer: {exc}") + if isinstance(exc, _PROTOCOL): + return MalformedReply(f"bad reply from the unit: {exc}") + if isinstance(exc, OSError): + what = "could not connect" if connecting else "connection lost" + return ConnectFailed(f"{what}: {exc}") + return DeviceError(f"device error: {exc}") +``` + +`sfm/device_access/series.py`: + +```python +"""Which series a unit is, from its serial prefix (decided with Brian, 2026-10-20).""" +from __future__ import annotations + +from .errors import BadRequest + +SERIES_BY_PREFIX = {"UM": 4, "BE": 3, "BA": 3} + + +def normalise_serial(serial: str) -> str: + return (serial or "").strip().upper() + + +def series_for_serial(serial: str) -> int: + s = normalise_serial(serial) + for prefix, series in SERIES_BY_PREFIX.items(): + if s.startswith(prefix) and len(s) > len(prefix): + return series + raise BadRequest( + f"unknown serial {serial!r}: expected UM... (Series 4) or BE.../BA... (Series 3)" + ) +``` + +`sfm/device_access/models.py`: + +```python +"""Series-neutral models. Every operation returns the same shape for both +series; anything only one series has goes under `detail`.""" +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import Any, Dict, Optional + +from .errors import BadRequest + + +@dataclass(frozen=True) +class UnitAddress: + host: Optional[str] + tcp_port: Optional[int] + port: Optional[str] + baud: Optional[int] + + def __post_init__(self) -> None: + if not self.host and not self.port: + raise BadRequest( + "specify 'host' (TCP, e.g. ?host=10.0.0.5&tcp_port=9034) " + "or 'port' (serial, e.g. ?port=/dev/ttyACM0)" + ) + + @property + def key(self) -> str: + """One key per physical link -- what the per-unit lock is keyed on.""" + if self.host: + return f"tcp:{self.host}:{self.tcp_port}" + return f"serial:{self.port}" + + +@dataclass +class UnitInfo: + serial: str + series: int + model: Optional[str] + firmware: Optional[str] + monitoring: Optional[bool] + active_setup: Optional[str] + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class UnitStatus: + serial: str + series: int + monitoring: bool + battery_volts: Optional[float] + memory_total_bytes: Optional[int] + memory_free_bytes: Optional[int] + device_time: Optional[str] # ISO, the unit's own local time + event_count: Optional[int] # None where it is not cheap (Series 3) + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class UnitSettings: + serial: str + series: int + setup_name: Optional[str] + record_mode: Optional[str] # the unit's own name for its mode + sample_rate: Optional[int] + record_time_s: Optional[float] + histogram_interval_s: Optional[int] + geo_trigger_ips: Optional[float] + notes: Dict[str, str] = field(default_factory=dict) + detail: Dict[str, Any] = field(default_factory=dict) +``` + +`sfm/device_access/__init__.py`: + +```python +"""One door for every device request -- see the 2026-10-20 parity spec.""" +from .errors import ( + BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, MalformedReply, + NoAnswer, NotSupported, UnitBusy, WrongUnit, translate, +) +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .series import normalise_serial, series_for_serial +``` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access_core.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add sfm/device_access/ tests/test_device_access_core.py +git commit -m "feat(sfm): device_access core -- typed errors, series by serial prefix, shared models" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 4: One connection per unit — the per-unit lock + +**Files:** +- Create: `sfm/device_access/locks.py` +- Test: `tests/test_device_access_core.py` (append) + +**Interfaces:** +- Consumes: `UnitBusy` (Task 3). +- Produces: `UnitLocks(timeout: float = 20.0)` with + - `hold(key: str, timeout: Optional[float] = None)`, a context manager that raises `UnitBusy` on timeout; + - `try_hold(key: str)`, a non-blocking context manager that yields `bool`. + +- [ ] **Step 1: Write the failing tests** + +Append to `tests/test_device_access_core.py`: + +```python +# ── per-unit lock ───────────────────────────────────────────────────────────── + +import threading # noqa: E402 + +from sfm.device_access.errors import UnitBusy # noqa: E402 +from sfm.device_access.locks import UnitLocks # noqa: E402 + + +def test_a_second_request_for_a_busy_unit_gets_unit_busy(): + locks = UnitLocks(timeout=0.2) + entered = threading.Event() + release = threading.Event() + + def holder(): + with locks.hold("tcp:10.0.0.5:9034"): + entered.set() + release.wait(2) + + t = threading.Thread(target=holder) + t.start() + entered.wait(2) + try: + with pytest.raises(UnitBusy, match="busy"): + with locks.hold("tcp:10.0.0.5:9034"): + pass + finally: + release.set() + t.join() + + +def test_different_units_do_not_block_each_other(): + locks = UnitLocks(timeout=0.2) + with locks.hold("tcp:10.0.0.5:9034"): + with locks.hold("tcp:10.0.0.6:9034"): + pass + + +def test_try_hold_never_waits(): + locks = UnitLocks(timeout=5) + with locks.hold("k"): + with locks.try_hold("k") as got: + assert got is False + with locks.try_hold("k") as got: + assert got is True + + +def test_the_lock_is_released_after_an_exception(): + locks = UnitLocks(timeout=0.2) + with pytest.raises(RuntimeError): + with locks.hold("k"): + raise RuntimeError("boom") + with locks.hold("k"): + pass +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access_core.py -q` +Expected: collection ERROR, `ModuleNotFoundError: No module named 'sfm.device_access.locks'`. + +- [ ] **Step 3: Implement** `sfm/device_access/locks.py`: + +```python +"""One connection per unit. A modem allows a single TCP session, so two +requests must take turns instead of opening a second connection.""" +from __future__ import annotations + +import threading +from contextlib import contextmanager +from typing import Dict, Iterator, Optional + +from .errors import UnitBusy + + +class UnitLocks: + def __init__(self, timeout: float = 20.0) -> None: + self._timeout = timeout + self._guard = threading.Lock() + self._locks: Dict[str, threading.Lock] = {} + + def _lock_for(self, key: str) -> threading.Lock: + with self._guard: + return self._locks.setdefault(key, threading.Lock()) + + @contextmanager + def hold(self, key: str, timeout: Optional[float] = None) -> Iterator[None]: + lock = self._lock_for(key) + wait = self._timeout if timeout is None else timeout + if not lock.acquire(timeout=wait): + raise UnitBusy(f"the unit at {key} is busy with another request; try again shortly") + try: + yield + finally: + lock.release() + + @contextmanager + def try_hold(self, key: str) -> Iterator[bool]: + lock = self._lock_for(key) + got = lock.acquire(blocking=False) + try: + yield got + finally: + if got: + lock.release() +``` + +Add to `sfm/device_access/__init__.py`: `from .locks import UnitLocks` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access_core.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add sfm/device_access/locks.py sfm/device_access/__init__.py tests/test_device_access_core.py +git commit -m "feat(sfm): per-unit lock -- one connection per unit, 423 when busy" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 5: The Series-3 adapter + +Connect-per-request, as today. The TCP cold-boot retry-once from +`server._run_with_retry` is kept, but **narrowed to "no answer"**, the +cold-boot symptom. The legacy path retries any protocol error, which here +would also retry the adapter's own "no settings block" error. When the serial is already in +hand (`connect()` reads it), a mismatch is refused with 409. No extra round +trip is added just to check it. + +**Files:** +- Create: `sfm/device_access/s3.py`, `tests/device_access_fakes.py` +- Test: `tests/test_device_access_s3.py` + +**Interfaces:** +- Consumes: `UnitAddress`, `UnitInfo`, `UnitStatus`, `UnitSettings`, the errors and `translate` (Task 3). +- Produces: + - `Series3Adapter(client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory)` with `identify(address, serial) -> UnitInfo`, `status(address, serial) -> UnitStatus` and `settings(address, serial) -> UnitSettings`. `serial` is already normalised. + - `default_s3_client_factory(address, timeout=10.0) -> MiniMateClient`. + - `tests/device_access_fakes.py`: `FakeMiniMateClient`, `FakeMicromateClient` (the latter is used from Task 6). + +- [ ] **Step 1: Write the test fakes** + +Create `tests/device_access_fakes.py`. These are test utilities, never +imported by production code. They return the **real** model dataclasses, and +the Micromate fake's setup comes from a real fixture read: + +```python +"""Fakes of both device clients for sfm.device_access tests. + +They return the libraries' real dataclasses, and FakeMicromateClient's setup +is decoded from a real UM20147 read. `fail` is a queue of exceptions; each +call pops one, if any, and raises it. +""" +from __future__ import annotations + +import datetime +from pathlib import Path + +from micromate.models import MicromateDeviceInfo, MicromateState +from micromate.setup_block import decode_setup +from minimateplus.models import ComplianceConfig, DeviceInfo, MonitorStatus + +SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um20147_baseline.bin" + + +class _Base: + def __init__(self, fail=None, open_error=None): + self.fail = list(fail or []) + self.open_error = open_error + self.calls: list[str] = [] + self.opened = 0 + self.closed = 0 + self._open = False + + def _step(self, name): + self.calls.append(name) + if self.fail: + raise self.fail.pop(0) + + def open(self): + self.opened += 1 + if self.open_error is not None: + raise self.open_error + self._open = True + + def close(self): + self.closed += 1 + self._open = False + + +class FakeMiniMateClient(_Base): + def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", **kw): + super().__init__(**kw) + self.serial = serial + self.monitoring = monitoring + if compliance == "default": + compliance = ComplianceConfig( + recording_mode=0x01, sample_rate=1024, histogram_interval_sec=300, + record_time=3.0, trigger_level_geo=0.5, alarm_level_geo=1.0, geo_range=0, + setup_name="BRIDGE-A", project="Bridge job", client="Acme", + operator="BH", sensor_location="Loc 1", notes=None, + ) + self.compliance = compliance + + def connect(self) -> DeviceInfo: + self._step("connect") + return DeviceInfo( + serial=self.serial, firmware_minor=17, firmware_version="S338.17", + dsp_version="10.72", manufacturer="Instantel", model="MiniMate Plus", + compliance_config=self.compliance, + ) + + def poll(self) -> None: + self._step("poll") + + def get_monitor_status(self) -> MonitorStatus: + self._step("get_monitor_status") + return MonitorStatus( + is_monitoring=self.monitoring, battery_v=6.8, + memory_total=983026, memory_free=900000, + ) + + +class _FakeProtocol: + def __init__(self, owner): + self._owner = owner + + def poll(self): + self._owner._step("poll") + + +class FakeMicromateClient(_Base): + def __init__(self, serial="UM20147", *, monitoring=False, events=5, + unsolicited=b"", **kw): + super().__init__(**kw) + self.serial = serial + self.monitoring = monitoring + self.events = events + self.unsolicited = unsolicited + self.protocol = _FakeProtocol(self) + + def is_open(self) -> bool: + return self._open + + def connect(self) -> MicromateDeviceInfo: + self._step("connect") + return MicromateDeviceInfo( + serial=self.serial, manufacturer="Instantel", model="MM/ISEE/S", + firmware_line="thor", monitoring=self.monitoring, active_setup="test2.MMB", + ) + + def get_state(self) -> MicromateState: + self._step("get_state") + return MicromateState( + monitoring=self.monitoring, + device_time=datetime.datetime(2026, 10, 20, 18, 7, 58), + battery_volts=3.8, memory_total_bytes=15_000_000, memory_free_bytes=14_799_296, + ) + + def get_event_count(self) -> int: + self._step("get_event_count") + return self.events + + def get_setup(self): + self._step("get_setup") + return decode_setup(SETUP_FIXTURE.read_bytes()[11:]) + + def read_unsolicited(self) -> bytes: + self._step("read_unsolicited") + data, self.unsolicited = self.unsolicited, b"" + return data +``` + +- [ ] **Step 2: Write the failing tests** + +Create `tests/test_device_access_s3.py`: + +```python +"""The Series-3 adapter: connect-per-request, mapped into the shared models.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.protocol as mmp_proto # noqa: E402 +from device_access_fakes import FakeMiniMateClient # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + ConnectFailed, MalformedReply, NoAnswer, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s3 import Series3Adapter # noqa: E402 + +TCP = UnitAddress(host="10.0.0.5", tcp_port=12345, port=None, baud=None) +SERIAL_LINK = UnitAddress(host=None, tcp_port=None, port="/dev/ttyUSB0", baud=None) + + +def adapter(*clients): + queue = list(clients) + return Series3Adapter(client_factory=lambda address: queue.pop(0)) + + +def test_identify_maps_device_info(): + fake = FakeMiniMateClient() + info = adapter(fake).identify(TCP, "BE18193") + assert (info.serial, info.series, info.model, info.firmware) == ("BE18193", 3, "MiniMate Plus", "S338.17") + assert info.active_setup == "BRIDGE-A" + assert info.monitoring is None # connect() does not read it on Series 3 + assert fake.closed == 1 + + +def test_a_different_unit_answering_is_refused(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit, match="BE18193.*BE11529"): + adapter(fake).identify(TCP, "BE18193") + assert fake.closed == 1 + + +def test_status_maps_monitor_status(): + fake = FakeMiniMateClient(monitoring=True) + st = adapter(fake).status(TCP, "BE18193") + assert (st.series, st.monitoring, st.battery_volts) == (3, True, 6.8) + assert (st.memory_total_bytes, st.memory_free_bytes) == (983026, 900000) + assert st.event_count is None and st.device_time is None + assert fake.calls == ["poll", "get_monitor_status"] + + +def test_settings_maps_the_compliance_config(): + s = adapter(FakeMiniMateClient()).settings(TCP, "BE18193") + assert s.record_mode == "Continuous" + assert (s.sample_rate, s.record_time_s, s.histogram_interval_s) == (1024, 3.0, 300) + assert s.geo_trigger_ips == 0.5 + assert s.setup_name == "BRIDGE-A" + assert s.notes == {"Project": "Bridge job", "Client": "Acme", "User Name": "BH", "Seis Loc": "Loc 1"} + assert s.detail["record_mode_code"] == 0x01 + + +def test_settings_without_a_compliance_read_is_a_malformed_reply_and_not_retried(): + # One fake only: a retry would ask the factory for a second and fail. + with pytest.raises(MalformedReply, match="settings"): + adapter(FakeMiniMateClient(compliance=None)).settings(TCP, "BE18193") + + +def test_a_cold_unit_over_tcp_gets_one_retry(): + first = FakeMiniMateClient(fail=[mmp_proto.TimeoutError("cold")]) + second = FakeMiniMateClient() + info = adapter(first, second).identify(TCP, "BE18193") + assert info.serial == "BE18193" + assert first.closed == 1 and second.closed == 1 + + +def test_a_serial_link_is_not_retried(): + fake = FakeMiniMateClient(fail=[mmp_proto.TimeoutError("quiet")]) + with pytest.raises(NoAnswer): + adapter(fake).identify(SERIAL_LINK, "BE18193") + + +def test_a_failed_connect_is_connect_failed_and_not_retried(): + fake = FakeMiniMateClient(open_error=ConnectionRefusedError("refused")) + with pytest.raises(ConnectFailed, match="could not connect"): + adapter(fake).identify(TCP, "BE18193") +``` + +- [ ] **Step 3: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s3.py -q` +Expected: collection ERROR, `ModuleNotFoundError: No module named 'sfm.device_access.s3'`. + +- [ ] **Step 4: Implement** `sfm/device_access/s3.py`: + +```python +"""Series-3 adapter. Connect-per-request, as SFM has always done for +MiniMates -- a held session waits for the bench test in the spec.""" +from __future__ import annotations + +import logging +from typing import Any, Callable + +from minimateplus import MiniMateClient +from minimateplus.transport import TcpTransport + +from .errors import DeviceError, MalformedReply, NoAnswer, WrongUnit, translate +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus + +log = logging.getLogger("sfm.device_access") + +S3_DEFAULT_BAUD = 38400 +S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "Histogram + Continuous"} + + +def default_s3_client_factory(address: UnitAddress, timeout: float = 10.0) -> MiniMateClient: + if address.host: + return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), timeout=timeout) + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD) + + +def _close(client: Any) -> None: + try: + client.close() + except Exception: # noqa: BLE001 + log.debug("close failed", exc_info=True) + + +class Series3Adapter: + def __init__(self, client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory) -> None: + self._factory = client_factory + + def _run(self, address: UnitAddress, fn: Callable[[Any], Any]) -> Any: + def attempt() -> Any: + client = self._factory(address) + try: + client.open() + except BaseException as exc: + _close(client) + raise translate(exc, connecting=True) from exc + try: + return fn(client) + except DeviceError: + raise + except BaseException as exc: + raise translate(exc, connecting=False) from exc + finally: + _close(client) + + try: + return attempt() + except NoAnswer: + # A MiniMate that has just had its serial lines asserted can take + # 5-10 s to boot, and shows it as silence; one retry covers it. TCP + # only -- on a serial cable a silence is a real fault. Narrower than + # server._run_with_retry (any protocol error): retrying a + # MalformedReply would also retry "no settings block", which a + # reconnect cannot fix. + if not address.host: + raise + log.info("Series 3 at %s: no clean answer, retrying once (unit may be cold)", address.key) + return attempt() + + @staticmethod + def _check(serial_reported: str, serial: str, address: UnitAddress) -> None: + if (serial_reported or "").strip().upper() != serial: + raise WrongUnit(f"asked for {serial} but {serial_reported} answered at {address.key}") + + def identify(self, address: UnitAddress, serial: str) -> UnitInfo: + def op(client: Any) -> UnitInfo: + info = client.connect() + self._check(info.serial, serial, address) + cc = info.compliance_config + return UnitInfo( + serial=info.serial, series=3, model=info.model, firmware=info.firmware_version, + monitoring=None, active_setup=cc.setup_name if cc else None, + detail={"manufacturer": info.manufacturer, "dsp_version": info.dsp_version}, + ) + return self._run(address, op) + + def status(self, address: UnitAddress, serial: str) -> UnitStatus: + def op(client: Any) -> UnitStatus: + client.poll() + ms = client.get_monitor_status() + return UnitStatus( + serial=serial, series=3, monitoring=ms.is_monitoring, + battery_volts=round(ms.battery_v, 2) if ms.battery_v is not None else None, + memory_total_bytes=ms.memory_total, memory_free_bytes=ms.memory_free, + device_time=None, event_count=None, + ) + return self._run(address, op) + + def settings(self, address: UnitAddress, serial: str) -> UnitSettings: + def op(client: Any) -> UnitSettings: + info = client.connect() + self._check(info.serial, serial, address) + cc = info.compliance_config + if cc is None: + raise MalformedReply("could not read the unit's settings (SUB 0x1A)") + mode = None + if cc.recording_mode is not None: + mode = S3_MODES.get(cc.recording_mode, f"unknown (0x{cc.recording_mode:02x})") + notes = { + label: value for label, value in ( + ("Project", cc.project), ("Client", cc.client), ("User Name", cc.operator), + ("Seis Loc", cc.sensor_location), ("Extended Notes", cc.notes), + ) if value is not None + } + return UnitSettings( + serial=info.serial, series=3, setup_name=cc.setup_name, record_mode=mode, + sample_rate=cc.sample_rate, record_time_s=cc.record_time, + histogram_interval_s=cc.histogram_interval_sec, geo_trigger_ips=cc.trigger_level_geo, + notes=notes, + detail={"record_mode_code": cc.recording_mode, "alarm_level_geo": cc.alarm_level_geo, + "geo_range": cc.geo_range}, + ) + return self._run(address, op) +``` + +- [ ] **Step 5: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s3.py -q` +Expected: all pass. + +- [ ] **Step 6: Commit** + +```bash +git add sfm/device_access/s3.py tests/device_access_fakes.py tests/test_device_access_s3.py +git commit -m "feat(sfm): Series-3 adapter -- identify, status, settings into the shared models" -m "Connect-per-request with the TCP cold-boot retry kept; a different unit answering is refused (409) whenever the serial is already in hand." -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 6: Series-4 session — stay on the line, ring safety + +**Files:** +- Create: `sfm/device_access/s4.py` (session part) +- Test: `tests/test_device_access_s4.py` + +**Interfaces:** +- Consumes: errors and `translate`, `normalise_serial`, `UnitAddress` (Task 3); `MicromateClient.is_open()` (Task 1); `read_unsolicited()` (Task 2); `FakeMicromateClient` (Task 5). +- Produces: + - `RingDetected(Exception)`. + - `RingWatchTransport(inner: BaseTransport)`, a `BaseTransport` whose `read()` raises `RingDetected` on `b"RADIO RING"`, including when it is split across reads. + - `Series4Session(address, serial, client_factory, clock=time.monotonic)` with: + - `call_up() -> MicromateDeviceInfo` (raises `WrongUnit` and `CallHomeInProgress`); + - `run(op: Callable[[client], T]) -> T` (a user request; calls up first if needed); + - `keepalive()`, which is a POLL and does not count as use; + - `listen()`, which reads only and does not count as use; + - `hang_up()`; + - properties `is_open`, `last_used`, `last_traffic`. + - `default_s4_client_factory(address, recv_timeout=10.0) -> MicromateClient`, with its transport wrapped in `RingWatchTransport`. + +- [ ] **Step 1: Write the failing tests** + +Create `tests/test_device_access_s4.py`: + +```python +"""Series-4 sessions: one call-up, then stay on the line; ring safety.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from device_access_fakes import FakeMicromateClient # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + CallHomeInProgress, ConnectFailed, NoAnswer, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import ( # noqa: E402 + RingDetected, RingWatchTransport, Series4Session, +) + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class ScriptedInner: + """A minimal real-interface transport: is_connected is a PROPERTY.""" + + def __init__(self, chunks): + self.chunks = list(chunks) + self.written = [] + self._c = False + + def connect(self): + self._c = True + + def disconnect(self): + self._c = False + + @property + def is_connected(self): + return self._c + + def write(self, data): + self.written.append(data) + + def read(self, n): + return self.chunks.pop(0) if self.chunks else b"" + + +class Clock: + def __init__(self, t=1000.0): + self.t = t + + def __call__(self): + return self.t + + +def session(*clients, clock=None): + queue = list(clients) + return Series4Session(ADDR, "UM20147", lambda address: queue.pop(0), clock=clock or Clock()) + + +# ── RingWatchTransport ──────────────────────────────────────────────────────── + +def test_ordinary_bytes_pass_through(): + t = RingWatchTransport(ScriptedInner([b"\x02abc\x03"])) + assert t.read(4096) == b"\x02abc\x03" + + +def test_a_ring_raises(): + t = RingWatchTransport(ScriptedInner([b"\r\nRADIO RING\r\n"])) + with pytest.raises(RingDetected): + t.read(4096) + + +def test_a_ring_split_across_reads_still_raises(): + t = RingWatchTransport(ScriptedInner([b"\r\nRADIO R", b"ING\r\n"])) + assert t.read(4096) == b"\r\nRADIO R" + with pytest.raises(RingDetected): + t.read(4096) + + +def test_the_wrapper_keeps_is_connected_a_property(): + inner = ScriptedInner([]) + t = RingWatchTransport(inner) + t.connect() + assert t.is_connected is True + + +# ── call-up ─────────────────────────────────────────────────────────────────── + +def test_call_up_verifies_the_serial_once(): + fake = FakeMicromateClient() + s = session(fake) + s.run(lambda c: c.get_state()) + s.run(lambda c: c.get_event_count()) + assert fake.calls == ["connect", "get_state", "get_event_count"] + assert fake.opened == 1 + + +def test_a_different_unit_answering_is_refused_and_closed(): + fake = FakeMicromateClient(serial="UM12947") + s = session(fake) + with pytest.raises(WrongUnit, match="UM20147.*UM12947"): + s.run(lambda c: c.get_state()) + assert fake.closed == 1 and not s.is_open + assert fake.calls == ["connect"] # nothing after the identity check + + +def test_a_failed_connect_is_connect_failed(): + s = session(FakeMicromateClient(open_error=ConnectionRefusedError("no"))) + with pytest.raises(ConnectFailed, match="could not connect"): + s.run(lambda c: c.get_state()) + + +# ── ring safety ─────────────────────────────────────────────────────────────── + +def test_a_ring_during_a_request_releases_the_line(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress, match="calling home"): + s.run(lambda c: c.get_state()) + assert not s.is_open and fake.closed == 1 + + +def test_listen_while_idle_releases_the_line_on_a_ring_and_sends_nothing(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + s.listen() + assert not s.is_open + assert fake.calls == ["connect", "read_unsolicited"] + + +def test_the_next_request_after_a_ring_calls_up_fresh(): + first, second = FakeMicromateClient(), FakeMicromateClient() + s = session(first, second) + s.call_up() + first.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + s.run(lambda c: c.get_state()) + s.run(lambda c: c.get_state()) + assert second.calls == ["connect", "get_state"] + + +# ── what counts as use ──────────────────────────────────────────────────────── + +def test_keepalive_and_listen_do_not_count_as_use(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + s = session(fake, clock=clock) + s.call_up() + clock.t = 1060.0 + s.keepalive() + clock.t = 1065.0 + s.listen() + assert s.last_used == 1000.0 + assert s.last_traffic == 1060.0 + assert fake.calls == ["connect", "poll", "read_unsolicited"] + + +def test_a_request_counts_as_use(): + clock = Clock(1000.0) + s = session(FakeMicromateClient(), clock=clock) + s.call_up() + clock.t = 1100.0 + s.run(lambda c: c.get_state()) + assert s.last_used == 1100.0 and s.last_traffic == 1100.0 + + +def test_a_failure_mid_request_hangs_up(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [mm_proto.TimeoutError("quiet")] + with pytest.raises(NoAnswer): + s.run(lambda c: c.get_state()) + assert not s.is_open +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s4.py -q` +Expected: collection ERROR, `ModuleNotFoundError: No module named 'sfm.device_access.s4'`. + +- [ ] **Step 3: Implement** `sfm/device_access/s4.py` (session part): + +```python +"""Series-4 sessions: call up once, stay on the line, hang up when idle. + +⚠ Imports only minimateplus.transport from the Series-3 package. Nothing +here may build or send a Series-3 frame -- SESSION_RESET (41 03) has never +been sent to a Micromate. +""" +from __future__ import annotations + +import logging +import time +from typing import Any, Callable, Optional, TypeVar + +from micromate.client import MicromateClient +from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport + +from .errors import CallHomeInProgress, WrongUnit, translate +from .models import UnitAddress +from .series import normalise_serial + +log = logging.getLogger("sfm.device_access") + +T = TypeVar("T") +RING = b"RADIO RING" +S4_DEFAULT_BAUD = 115200 + + +class RingDetected(Exception): + """The unit sent RADIO RING: it is calling home up this connection.""" + + +class RingWatchTransport(BaseTransport): + """Passes bytes through; raises RingDetected the moment RADIO RING appears, + including when it is split across two reads.""" + + def __init__(self, inner: BaseTransport) -> None: + self._inner = inner + self._tail = b"" + + def connect(self) -> None: + self._inner.connect() + + def disconnect(self) -> None: + self._inner.disconnect() + + @property + def is_connected(self) -> bool: + return self._inner.is_connected + + def write(self, data: bytes) -> None: + self._inner.write(data) + + def read(self, n: int) -> bytes: + data = self._inner.read(n) + if data: + window = self._tail + data + if RING in window: + self._tail = b"" + raise RingDetected("RADIO RING") + self._tail = window[-(len(RING) - 1):] + return data + + +def default_s4_client_factory(address: UnitAddress, recv_timeout: float = 10.0) -> MicromateClient: + if address.host: + inner: BaseTransport = TcpTransport(address.host, port=address.tcp_port) + else: + inner = SerialTransport(address.port, address.baud or S4_DEFAULT_BAUD) + return MicromateClient(RingWatchTransport(inner), recv_timeout=recv_timeout) + + +def _close(client: Any) -> None: + try: + client.close() + except Exception: # noqa: BLE001 + log.debug("close failed", exc_info=True) + + +_RING_MESSAGE = ("the unit started calling home; SFM hung up so the call can " + "reach THOR -- try again in a few minutes") + + +class Series4Session: + """One held line to one Micromate. + + `last_used` is the last *user* request: the idle hang-up measures it. + `last_traffic` is any exchange, keep-alives included: the keep-alive + schedule measures it. If keep-alives counted as use, the line would never + go idle. + """ + + def __init__(self, address: UnitAddress, serial: str, + client_factory: Callable[[UnitAddress], Any], + clock: Callable[[], float] = time.monotonic) -> None: + self.address = address + self.serial = normalise_serial(serial) + self._factory = client_factory + self._clock = clock + self._client: Optional[Any] = None + self.info = None + self.last_used = clock() + self.last_traffic = self.last_used + + @property + def is_open(self) -> bool: + return self._client is not None and self._client.is_open() + + def call_up(self): + client = self._factory(self.address) + try: + client.open() + info = client.connect() + except RingDetected as exc: + _close(client) + log.warning("RADIO RING from %s during call-up -- released the line", self.address.key) + raise CallHomeInProgress(_RING_MESSAGE) from exc + except BaseException as exc: + _close(client) + raise translate(exc, connecting=True) from exc + if normalise_serial(info.serial) != self.serial: + _close(client) + raise WrongUnit(f"asked for {self.serial} but {info.serial} answered at {self.address.key}") + self._client, self.info = client, info + self.last_used = self.last_traffic = self._clock() + log.info("call-up: %s at %s, staying on the line", self.serial, self.address.key) + return info + + def _exchange(self, op: Callable[[Any], T]) -> T: + try: + return op(self._client) + except RingDetected as exc: + self.hang_up() + log.warning("RADIO RING from %s -- released the line so the call reaches THOR", + self.address.key) + raise CallHomeInProgress(_RING_MESSAGE) from exc + except BaseException as exc: + self.hang_up() + raise translate(exc, connecting=False) from exc + + def run(self, op: Callable[[Any], T]) -> T: + """A user request. Calls up first if the line is not open.""" + if not self.is_open: + self.call_up() + result = self._exchange(op) + self.last_used = self.last_traffic = self._clock() + return result + + def keepalive(self) -> None: + """A POLL so the modem's idle timer does not drop the line. Not use.""" + if not self.is_open: + return + self._exchange(lambda c: c.protocol.poll()) + self.last_traffic = self._clock() + + def listen(self) -> None: + """Read anything the unit sent unprompted; send nothing. Not use.""" + if not self.is_open: + return + self._exchange(lambda c: c.read_unsolicited()) + + def hang_up(self) -> None: + if self._client is not None: + _close(self._client) + self._client = None + log.info("hang-up: %s at %s", self.serial, self.address.key) +``` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s4.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add sfm/device_access/s4.py tests/test_device_access_s4.py +git commit -m "feat(sfm): Series-4 session -- call up once, stay on the line, release on RADIO RING" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 7: Series-4 operations — identify, status, settings + +**Files:** +- Modify: `sfm/device_access/s4.py` (append) +- Test: `tests/test_device_access_s4.py` (append) + +**Interfaces:** +- Consumes: `UnitInfo`, `UnitStatus`, `UnitSettings` (Task 3); client methods from Tasks 1 and 2 and `get_setup()`. +- Produces, each run inside `Series4Session.run`: + - `s4_identify(client, serial: str) -> UnitInfo` + - `s4_status(client, serial: str) -> UnitStatus` + - `s4_settings(client, serial: str) -> UnitSettings` + +- [ ] **Step 1: Write the failing tests** + +Append to `tests/test_device_access_s4.py`. The settings values are what the +operator read off UM20147's screen for `um20147_baseline` (see +`tests/test_micromate_setup.py`): + +```python +# ── operations ──────────────────────────────────────────────────────────────── + +from sfm.device_access.s4 import s4_identify, s4_settings, s4_status # noqa: E402 + + +def test_s4_identify(): + info = s4_identify(FakeMicromateClient(monitoring=True), "UM20147") + assert (info.serial, info.series, info.model, info.monitoring) == ("UM20147", 4, "MM/ISEE/S", True) + assert info.active_setup == "test2.MMB" + assert info.firmware is None and info.detail["firmware_line"] == "thor" + + +def test_s4_status_includes_the_cheap_event_count(): + st = s4_status(FakeMicromateClient(events=5), "UM20147") + assert (st.series, st.monitoring, st.battery_volts, st.event_count) == (4, False, 3.8, 5) + assert (st.memory_total_bytes, st.memory_free_bytes) == (15_000_000, 14_799_296) + assert st.device_time == "2026-10-20T18:07:58" + + +def test_s4_settings_maps_the_decoded_setup(): + s = s4_settings(FakeMicromateClient(), "UM20147") + assert (s.series, s.setup_name, s.record_mode) == (4, "test2.MMB", "Histogram Combo") + assert (s.sample_rate, s.record_time_s, s.histogram_interval_s) == (1024, 10.0, 2) + assert s.geo_trigger_ips == pytest.approx(0.5, abs=1e-6) + assert list(s.notes) == ["Location", "Client", "Company", "General Notes"] + assert s.detail["pretrigger_s"] == 1.0 + assert s.detail["mic_type"] == "linear" + assert s.detail["mic_trigger_db"] == pytest.approx(131.0, abs=0.01) + assert s.detail["geo_trigger_ips_per_channel"] == pytest.approx([0.5, 0.5, 0.5], abs=1e-6) +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s4.py -q` +Expected: collection ERROR, `ImportError: cannot import name 's4_identify'`. + +- [ ] **Step 3: Implement** + +Append to `sfm/device_access/s4.py`, and add `UnitInfo, UnitSettings, UnitStatus` +to its `.models` import: + +```python +# ── Operations (each runs inside Series4Session.run) ────────────────────────── + +def s4_identify(client: Any, serial: str) -> UnitInfo: + info = client.connect() + return UnitInfo( + serial=info.serial, series=4, model=info.model, + firmware=None, # the version string lives in 0x01, undecoded + monitoring=info.monitoring, active_setup=info.active_setup, + detail={"manufacturer": info.manufacturer, "firmware_line": info.firmware_line}, + ) + + +def s4_status(client: Any, serial: str) -> UnitStatus: + st = client.get_state() + count = client.get_event_count() + return UnitStatus( + serial=serial, series=4, monitoring=st.monitoring, battery_volts=st.battery_volts, + memory_total_bytes=st.memory_total_bytes, memory_free_bytes=st.memory_free_bytes, + device_time=st.device_time.isoformat() if st.device_time else None, + event_count=count, + ) + + +def s4_settings(client: Any, serial: str) -> UnitSettings: + s = client.get_setup() + return UnitSettings( + serial=serial, series=4, setup_name=s.name, record_mode=s.record_mode_name, + sample_rate=s.sample_rate, record_time_s=s.record_time_s, + histogram_interval_s=s.histogram_interval_s, + geo_trigger_ips=s.geo_trigger_ips[0], # the keypad writes all three the same + notes=dict(s.notes), + detail={ + "pretrigger_s": s.pretrigger_s, + "auto_record_stop": s.auto_record_stop, + "auto_stop_after_s": s.auto_stop_after_s, + "geophones_active": s.geophones_active, + "mic_active": s.mic_active, + "trigger_on_geophones": s.trigger_on_geophones, + "trigger_on_mic": s.trigger_on_mic, + "geo_trigger_ips_per_channel": list(s.geo_trigger_ips), + "mic_type": s.mic_type, + "mic_trigger_psi": s.mic_trigger_psi, + "mic_trigger_db": s.mic_trigger_db, + "job_number_enabled": s.job_number_enabled, + "job_number": s.job_number, + "scaled_distance_enabled": s.scaled_distance_enabled, + "distance_ft": s.distance_ft, + "charge_weight_lb": s.charge_weight_lb, + "scaled_distance": s.scaled_distance, + }, + ) +``` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access_s4.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add sfm/device_access/s4.py tests/test_device_access_s4.py +git commit -m "feat(sfm): Series-4 identify, status and settings into the shared models" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 8: `DeviceAccess` — one door, sessions, the reaper + +**Files:** +- Create: `sfm/device_access/access.py` +- Test: `tests/test_device_access.py` + +**Interfaces:** +- Consumes: everything from Tasks 3–7. +- Produces: `DeviceAccess(*, s3_client_factory=default_s3_client_factory, s4_client_factory=default_s4_client_factory, clock=time.monotonic, lock_timeout=20.0, keepalive_s=60.0, idle_hangup_s=300.0, reaper_interval_s=5.0, start_reaper=True)` with: + - `identify(address: UnitAddress, serial: str) -> UnitInfo` + - `status(address, serial) -> UnitStatus` + - `settings(address, serial) -> UnitSettings` + - `hang_up(address) -> bool`, True if a held line was closed + - `tick(now: Optional[float] = None) -> None`, for tests; the reaper thread calls it. + +- [ ] **Step 1: Write the failing tests** + +Create `tests/test_device_access.py`: + +```python +"""DeviceAccess: dispatch by serial, sessions, the lock, the reaper -- and the +contract that both series answer in the same shape.""" +from __future__ import annotations + +import dataclasses +import os +import sys +import threading + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import BadRequest, CallHomeInProgress, UnitBusy # noqa: E402 +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import RingDetected # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class Clock: + def __init__(self, t=1000.0): + self.t = t + + def __call__(self): + return self.t + + +def access(s3=(), s4=(), clock=None, lock_timeout=0.2): + s3q, s4q = list(s3), list(s4) + return DeviceAccess( + s3_client_factory=lambda a: s3q.pop(0), + s4_client_factory=lambda a: s4q.pop(0), + clock=clock or Clock(), lock_timeout=lock_timeout, start_reaper=False, + ) + + +def test_the_serial_prefix_picks_the_adapter(): + da = access(s3=[FakeMiniMateClient()], s4=[FakeMicromateClient()]) + assert da.identify(ADDR, "be18193").series == 3 + assert da.identify(ADDR, " um20147").series == 4 + + +def test_an_unknown_prefix_never_touches_a_unit(): + da = access() + with pytest.raises(BadRequest): + da.identify(ADDR, "XX123") + + +def test_a_micromate_stays_on_the_line_between_requests(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.identify(ADDR, "UM20147") + da.status(ADDR, "UM20147") + da.settings(ADDR, "UM20147") + assert fake.opened == 1 # one call-up, three requests + assert fake.calls[0] == "connect" + + +def test_a_minimate_reconnects_per_request(): + a, b = FakeMiniMateClient(), FakeMiniMateClient() + da = access(s3=[a, b]) + da.status(ADDR, "BE18193") + da.status(ADDR, "BE18193") + assert a.closed == 1 and b.closed == 1 + + +def test_a_dropped_line_is_called_up_again_quietly(): + first, second = FakeMicromateClient(), FakeMicromateClient() + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + first._open = False # the modem dropped the idle line + st = da.status(ADDR, "UM20147") + assert st.series == 4 and second.opened == 1 + + +def test_a_different_serial_at_the_same_address_hangs_up_the_old_line(): + first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947") + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + da.status(ADDR, "UM12947") + assert first.closed == 1 and second.opened == 1 + + +def test_a_busy_unit_answers_423_without_a_second_connection(): + fake = FakeMicromateClient() + da = access(s4=[fake], lock_timeout=0.2) + entered, release = threading.Event(), threading.Event() + + def slow_request(): + with da._locks.hold(ADDR.key): # simulate a request in flight + entered.set() + release.wait(2) + + t = threading.Thread(target=slow_request) + t.start() + entered.wait(2) + try: + with pytest.raises(UnitBusy): + da.status(ADDR, "UM20147") + assert fake.opened == 0 # no second connection was opened + finally: + release.set() + t.join() + + +def test_hang_up_closes_a_held_line(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.status(ADDR, "UM20147") + assert da.hang_up(ADDR) is True + assert fake.closed == 1 + assert da.hang_up(ADDR) is False # nothing left to hang up + + +# ── the reaper ──────────────────────────────────────────────────────────────── + +def test_tick_listens_then_keeps_alive_then_hangs_up_when_idle(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.calls.clear() + + clock.t = 1030.0 + da.tick() # quiet: listen only + assert fake.calls == ["read_unsolicited"] + + clock.t = 1061.0 + da.tick() # 60 s since traffic: keep-alive + assert fake.calls[-1] == "poll" + + clock.t = 1301.0 + da.tick() # 300 s since last USE: hang up + assert fake.closed == 1 + assert da.hang_up(ADDR) is False + + +def test_tick_releases_the_line_on_a_ring_while_idle(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.fail = [RingDetected("RADIO RING")] + clock.t = 1010.0 + da.tick() + assert fake.closed == 1 + + +def test_tick_skips_a_unit_that_is_busy(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.calls.clear() + clock.t = 1400.0 + with da._locks.hold(ADDR.key): + da.tick() # must not block or hang up mid-request + assert fake.calls == [] and fake.closed == 0 + + +def test_a_ring_mid_request_is_a_clear_error(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.status(ADDR, "UM20147") + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + da.status(ADDR, "UM20147") + + +# ── the contract: both series answer in the same shape ──────────────────────── + +@pytest.mark.parametrize("op", ["identify", "status", "settings"]) +def test_both_series_return_the_same_model_with_the_same_fields(op): + da = access(s3=[FakeMiniMateClient()], s4=[FakeMicromateClient()]) + s3 = getattr(da, op)(ADDR, "BE18193") + s4 = getattr(da, op)(ADDR, "UM20147") + assert type(s3) is type(s4) + assert [f.name for f in dataclasses.fields(s3)] == [f.name for f in dataclasses.fields(s4)] + assert (s3.series, s4.series) == (3, 4) + for name in (f.name for f in dataclasses.fields(s3)): + a, b = getattr(s3, name), getattr(s4, name) + if a is not None and b is not None and name != "detail": + assert type(a) is type(b) or {type(a), type(b)} <= {int, float}, name +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_device_access.py -q` +Expected: collection ERROR, `ModuleNotFoundError: No module named 'sfm.device_access.access'`. + +- [ ] **Step 3: Implement** `sfm/device_access/access.py`: + +```python +"""DeviceAccess -- the one door every device request passes through. + +The control surface does not care which series it is talking to; this does. +""" +from __future__ import annotations + +import logging +import threading +import time +from typing import Any, Callable, Dict, Optional + +from .errors import DeviceError +from .locks import UnitLocks +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .s3 import Series3Adapter, default_s3_client_factory +from .s4 import ( + Series4Session, default_s4_client_factory, s4_identify, s4_settings, s4_status, +) +from .series import normalise_serial, series_for_serial + +log = logging.getLogger("sfm.device_access") + + +class DeviceAccess: + def __init__( + self, *, + s3_client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory, + s4_client_factory: Callable[[UnitAddress], Any] = default_s4_client_factory, + clock: Callable[[], float] = time.monotonic, + lock_timeout: float = 20.0, + keepalive_s: float = 60.0, + idle_hangup_s: float = 300.0, + reaper_interval_s: float = 5.0, + start_reaper: bool = True, + ) -> None: + self._locks = UnitLocks(lock_timeout) + self._s3 = Series3Adapter(s3_client_factory) + self._s4_factory = s4_client_factory + self._clock = clock + self._keepalive_s = keepalive_s + self._idle_hangup_s = idle_hangup_s + self._reaper_interval_s = reaper_interval_s + self._start_reaper = start_reaper + self._reaper: Optional[threading.Thread] = None + self._sessions: Dict[str, Series4Session] = {} + self._sessions_guard = threading.Lock() + + # ── public operations ───────────────────────────────────────────────────── + + def identify(self, address: UnitAddress, serial: str) -> UnitInfo: + return self._dispatch(address, serial, self._s3.identify, s4_identify) + + def status(self, address: UnitAddress, serial: str) -> UnitStatus: + return self._dispatch(address, serial, self._s3.status, s4_status) + + def settings(self, address: UnitAddress, serial: str) -> UnitSettings: + return self._dispatch(address, serial, self._s3.settings, s4_settings) + + def hang_up(self, address: UnitAddress) -> bool: + with self._locks.hold(address.key): + with self._sessions_guard: + session = self._sessions.pop(address.key, None) + if session is None: + return False + was_open = session.is_open + session.hang_up() + return was_open + + # ── dispatch ────────────────────────────────────────────────────────────── + + def _dispatch(self, address: UnitAddress, serial: str, + s3_op: Callable[[UnitAddress, str], Any], + s4_op: Callable[[Any, str], Any]) -> Any: + serial = normalise_serial(serial) + series = series_for_serial(serial) # raises BadRequest before any I/O + with self._locks.hold(address.key): + if series == 3: + return s3_op(address, serial) + session = self._session_for(address, serial) + try: + return session.run(lambda client: s4_op(client, serial)) + except DeviceError: + if not session.is_open: + with self._sessions_guard: + if self._sessions.get(address.key) is session: + del self._sessions[address.key] + raise + + def _session_for(self, address: UnitAddress, serial: str) -> Series4Session: + with self._sessions_guard: + session = self._sessions.get(address.key) + if session is not None and session.serial != serial: + session.hang_up() + session = None + if session is None: + session = Series4Session(address, serial, self._s4_factory, clock=self._clock) + self._sessions[address.key] = session + self._ensure_reaper() + return session + + # ── the reaper ──────────────────────────────────────────────────────────── + + def tick(self, now: Optional[float] = None) -> None: + """Per held line: hang up if idle, else keep alive, else listen for a ring.""" + now = self._clock() if now is None else now + with self._sessions_guard: + items = list(self._sessions.items()) + for key, session in items: + with self._locks.try_hold(key) as held: + if not held: + continue # mid-request: not idle + if not session.is_open: + self._drop(key, session) + continue + try: + if now - session.last_used >= self._idle_hangup_s: + session.hang_up() + self._drop(key, session) + elif now - session.last_traffic >= self._keepalive_s: + session.keepalive() + else: + session.listen() + except DeviceError as exc: + log.warning("held line %s closed: %s", key, exc) + self._drop(key, session) + + def _drop(self, key: str, session: Series4Session) -> None: + with self._sessions_guard: + if self._sessions.get(key) is session: + del self._sessions[key] + + def _ensure_reaper(self) -> None: + if not self._start_reaper or self._reaper is not None: + return + self._reaper = threading.Thread(target=self._reaper_loop, name="sfm-held-lines", daemon=True) + self._reaper.start() + + def _reaper_loop(self) -> None: + while True: + time.sleep(self._reaper_interval_s) + try: + self.tick() + except Exception: # noqa: BLE001 + log.exception("held-line reaper tick failed") +``` + +Add to `sfm/device_access/__init__.py`: `from .access import DeviceAccess` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_device_access*.py -q` +Expected: all pass. + +- [ ] **Step 5: Commit** + +```bash +git add sfm/device_access/access.py sfm/device_access/__init__.py tests/test_device_access.py +git commit -m "feat(sfm): DeviceAccess -- one door, held Series-4 lines, a reaper, and the same answer shape for both series" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 9: The endpoints + +`serial` routes a request through `DeviceAccess`. Without it, every handler +runs exactly as today. + +**Files:** +- Modify: `sfm/server.py`: + - imports; + - module docstring; + - `device_info` (~line 405), `device_connect` (~line 460) and `device_monitor_status` (~line 1100); + - two new handlers after `device_monitor_status`. +- Test: `tests/test_server_device_access.py` + +**Interfaces:** +- Consumes: `DeviceAccess`, `UnitAddress`, `DeviceError` (Tasks 3, 8). +- Produces: + - query parameter `serial` on `GET /device/info`, `POST /device/connect` and `GET /device/monitor/status`; + - `GET /device/settings` (`serial` required); + - `POST /device/hangup`; + - module-level `_device_access() -> DeviceAccess` and the `_device_access_instance` singleton, so tests can monkeypatch them. + +- [ ] **Step 1: Write the failing tests** + +Create `tests/test_server_device_access.py`: + +```python +"""Handlers called directly -- every parameter passed explicitly, because +FastAPI Query() defaults are FieldInfo objects, not values.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from fastapi import HTTPException # noqa: E402 + +import sfm.server as srv # noqa: E402 +from device_access_fakes import FakeMiniMateClient, FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + BadRequest, CallHomeInProgress, ConnectFailed, MalformedReply, NoAnswer, + NotSupported, UnitBusy, WrongUnit, +) + +TCP = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034) + + +@pytest.fixture +def da(monkeypatch): + s3q = [FakeMiniMateClient() for _ in range(5)] + s4q = [FakeMicromateClient() for _ in range(5)] + access = DeviceAccess(s3_client_factory=lambda a: s3q.pop(0), + s4_client_factory=lambda a: s4q.pop(0), start_reaper=False) + monkeypatch.setattr(srv, "_device_access_instance", access) + return access + + +def test_info_with_a_serial_returns_the_shared_model(da): + out = srv.device_info(force=False, serial="UM20147", **TCP) + assert out["series"] == 4 and out["serial"] == "UM20147" + assert set(out) == {"serial", "series", "model", "firmware", "monitoring", "active_setup", "detail"} + + +def test_connect_passes_the_serial_through(da): + out = srv.device_connect(serial="BE18193", **TCP) + assert out["series"] == 3 + + +def test_status_and_settings_with_a_serial(da): + assert srv.device_monitor_status(force=False, serial="UM20147", **TCP)["event_count"] == 5 + assert srv.device_settings(serial="UM20147", **TCP)["record_mode"] == "Histogram Combo" + + +def test_hangup(da): + srv.device_monitor_status(force=False, serial="UM20147", **TCP) + assert srv.device_hangup(**TCP) == {"hung_up": True} + + +@pytest.mark.parametrize( + "exc, status", + [(BadRequest("x"), 422), (NotSupported("x"), 501), (WrongUnit("x"), 409), + (UnitBusy("x"), 423), (ConnectFailed("x"), 503), (CallHomeInProgress("x"), 503), + (NoAnswer("x"), 504), (MalformedReply("x"), 502)], +) +def test_typed_errors_become_their_http_status(monkeypatch, exc, status): + class Raising: + def identify(self, address, serial): + raise exc + monkeypatch.setattr(srv, "_device_access_instance", Raising()) + with pytest.raises(HTTPException) as ei: + srv.device_info(force=False, serial="UM20147", **TCP) + assert ei.value.status_code == status + + +def test_a_missing_address_is_a_422(da): + with pytest.raises(HTTPException) as ei: + srv.device_settings(serial="UM20147", port=None, baud=None, host=None, tcp_port=9034) + assert ei.value.status_code == 422 + + +def test_without_a_serial_the_legacy_path_runs_unchanged(monkeypatch): + """No serial: today's Series-3 code path, today's response shape. + DeviceAccess must not be touched.""" + class Untouchable: + def __getattr__(self, name): + raise AssertionError("DeviceAccess used on the legacy path") + + class Cache: + def get_device_info(self, key): + return {"serial": "BE18193", "firmware_version": "S338.17"} + + monkeypatch.setattr(srv, "_device_access_instance", Untouchable()) + monkeypatch.setattr(srv, "get_cache", lambda: Cache()) + out = srv.device_info(force=False, serial=None, **TCP) + assert out == {"serial": "BE18193", "firmware_version": "S338.17", "_cached": True} +``` + +- [ ] **Step 2: Run the tests and watch them fail** + +Run: `.venv/bin/python -m pytest tests/test_server_device_access.py -q` +Expected: FAIL. `device_info() got an unexpected keyword argument 'serial'`, +and `module 'sfm.server' has no attribute 'device_settings'`. + +- [ ] **Step 3: Implement** + +In `sfm/server.py`, after the existing `from sfm import db_snapshot` import: + +```python +import dataclasses +from sfm.device_access import DeviceAccess, DeviceError, UnitAddress +``` + +After `_run_with_retry` (the "Transport factory" section): + +```python +# ── Device access (serial-named requests) ───────────────────────────────────── +# A request that names the unit by `serial` goes through sfm.device_access: +# same contract for Series 3 and 4. Without `serial`, handlers run their +# legacy Series-3 path unchanged (spec 2026-10-20). + +_device_access_instance: Optional[DeviceAccess] = None + + +def _device_access() -> DeviceAccess: + global _device_access_instance + if _device_access_instance is None: + _device_access_instance = DeviceAccess() + return _device_access_instance + + +def _unit_address(port: Optional[str], baud: Optional[int], host: Optional[str], + tcp_port: int) -> UnitAddress: + return UnitAddress(host=host, tcp_port=tcp_port if host else None, + port=None if host else port, baud=baud) + + +def _via_device_access(fn) -> dict: + try: + result = fn() + except DeviceError as exc: + raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc + return dataclasses.asdict(result) if dataclasses.is_dataclass(result) else result + + +_SERIAL_DOC = "Unit serial -- UM... (Series 4) or BE.../BA... (Series 3). Returns the shared model." +``` + +`device_info`: +- change `baud: int = Query(38400, ...)` to + `baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)")`; +- add `serial: Optional[str] = Query(None, description=_SERIAL_DOC)` as the last parameter; +- make these the first lines of the body, before the existing `log.info`: + +```python + if serial: + return _via_device_access( + lambda: _device_access().identify(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud +``` + +`device_connect`: the same `baud` change, add the same `serial` parameter, and +replace its body with: + +```python + # force=True PRESERVES today's behaviour: the old call omitted `force`, so it + # received FastAPI's Query(False) object, which is truthy -- /device/connect + # has always bypassed the cache. Passing False here would quietly change that. + return device_info(port=port, baud=baud, host=host, tcp_port=tcp_port, + force=True, serial=serial) +``` + +`device_monitor_status`: the same `baud` change, add `serial` as the last +parameter, and make these the first lines of the body: + +```python + if serial: + return _via_device_access( + lambda: _device_access().status(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud +``` + +Add after `device_monitor_status`: + +```python +@app.get("/device/settings") +def device_settings( + serial: str = Query(..., description=_SERIAL_DOC), + port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"), + baud: Optional[int] = Query(None, description="Serial baud (default by series)"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """The unit's recording settings, in the shared shape for either series.""" + return _via_device_access( + lambda: _device_access().settings(_unit_address(port, baud, host, tcp_port), serial)) + + +@app.post("/device/hangup") +def device_hangup( + port: Optional[str] = Query(None, description="Serial port"), + baud: Optional[int] = Query(None, description="Serial baud"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """Hang up a held line now instead of waiting for the idle timeout. + `hung_up` is false if nothing was being held.""" + return _via_device_access( + lambda: {"hung_up": _device_access().hang_up(_unit_address(port, baud, host, tcp_port))}) +``` + +In the module docstring's endpoint list, add: + +``` +GET /device/settings Recording settings (requires serial) +POST /device/hangup Hang up a held Series-4 line + +`serial` on /device/info, /device/connect, /device/monitor/status and +/device/settings names the unit (UM... = Series 4, BE.../BA... = Series 3) and +returns the shared model. Without it, the legacy Series-3 behaviour is +unchanged. Series-4 lines are held open between requests and hung up after +5 idle minutes, on POST /device/hangup, or the moment the unit calls home. +``` + +- [ ] **Step 4: Run the tests and watch them pass** + +Run: `.venv/bin/python -m pytest tests/test_server_device_access.py -q` +Expected: all pass. + +- [ ] **Step 5: Run the full suite** + +Run: `.venv/bin/python -m pytest tests -q` +Expected: the baseline plus the new tests. Still exactly **16 failed**, the +same two files (`test_bw_ascii_report.py` 15, `test_event_file_io.py` 1). +More passed. + +- [ ] **Step 6: Commit** + +```bash +git add sfm/server.py tests/test_server_device_access.py +git commit -m "feat(sfm): serial-named /device/info, /status, /settings and /hangup for both series" -m "With serial: one contract for Series 3 and 4 through sfm.device_access. Without it: the legacy Series-3 path, unchanged." -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` + +--- + +### Task 10: Bench check on UM20147, and the record + +Read-only, on the real unit, through the real server. + +**Files:** +- Modify: `CLAUDE.md` (the Series-4 config bullet in "Where things stand") + +- [ ] **Step 1: Start SFM with access to the unit's port** + +```bash +sg dialout -c ".venv/bin/python -m uvicorn sfm.server:app --port 8299" & +sleep 3 +``` + +- [ ] **Step 2: Identify, status, settings by serial, then hang up** + +```bash +Q="port=/dev/ttyACM0&serial=UM20147" +curl -s "localhost:8299/device/info?$Q" | python3 -m json.tool +curl -s "localhost:8299/device/monitor/status?$Q" | python3 -m json.tool +curl -s "localhost:8299/device/settings?$Q" | python3 -m json.tool +curl -s -X POST "localhost:8299/device/hangup?port=/dev/ttyACM0" ; echo +``` + +Expected: +- `series: 4`, `serial: "UM20147"`. +- The settings match `bridges/mm_client_check.py`'s output and the unit's + screen. On 2026-10-20: Histogram Combo, 2048 sps, record time 11 s, + pre-trigger 0.25 s, geophone trigger 0.6 in/s, mic 140 dB, job number 1234 + (off), Location BENCH01. +- `event_count` equals the chain-walk count from Task 2. +- The server log shows **one** call-up for the three requests, then a + hang-up. +- The hang-up response is `{"hung_up": true}`. + +- [ ] **Step 3: Ask for the wrong serial** + +```bash +curl -s -w "\n%{http_code}\n" "localhost:8299/device/info?port=/dev/ttyACM0&serial=UM12947" +``` + +Expected: `409`, with "asked for UM12947 but UM20147 answered". + +- [ ] **Step 4: Stop the server** + +```bash +kill %1 +``` + +- [ ] **Step 5: Record it in CLAUDE.md** + +In "Where things stand", in the Series-4 config bullet, add this after the +`get_setup()` line: + +``` + ✅ **SFM speaks Series 4 by serial (phase 1a, 2026-10-20):** `/device/info`, + `/device/monitor/status` and `/device/settings` take `serial` and return one + 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). +``` + +- [ ] **Step 6: Commit** + +```bash +git add CLAUDE.md +git commit -m "docs(claude): SFM speaks Series 4 by serial -- phase 1a done, bench-checked on UM20147" -m "Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44" +``` -- 2.54.1 From 31181f64e662917f02332b9387276e9b9f07bc09 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:02:32 -0400 Subject: [PATCH 008/223] fix(micromate): is_open() called a property -- TypeError on every real transport Hidden because the test double defined is_connected as a method; it is now a property, matching BaseTransport. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/client.py | 5 ++++- tests/test_micromate_client.py | 17 ++++++++++++++--- tests/test_micromate_protocol.py | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/micromate/client.py b/micromate/client.py index 1eca521..f52e50a 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -128,7 +128,10 @@ class MicromateClient: self._transport.disconnect() def is_open(self) -> bool: - return self._transport.is_connected() + # `is_connected` is a PROPERTY on BaseTransport. Calling it raised + # TypeError on every real transport; only a test double that defined + # it as a method hid that. + return bool(self._transport.is_connected) def __enter__(self) -> "MicromateClient": self.open() diff --git a/tests/test_micromate_client.py b/tests/test_micromate_client.py index b87635d..2d9d7bf 100644 --- a/tests/test_micromate_client.py +++ b/tests/test_micromate_client.py @@ -121,6 +121,7 @@ class ScriptedTransport: def disconnect(self) -> None: self._connected = False + @property def is_connected(self) -> bool: return self._connected @@ -408,7 +409,7 @@ def test_the_client_owns_the_transport(): mm, t = client([]) assert not mm.is_open() mm.open() - assert mm.is_open() and t.is_connected() + assert mm.is_open() and t.is_connected mm.close() assert not mm.is_open() @@ -417,9 +418,9 @@ def test_context_manager_opens_and_closes(): t = ScriptedTransport([frame(0xA4, POLL), frame(0xEA, SERIAL), frame(0xB6, STATE_IDLE), frame(0xBE, setup_response("x.mmb"))]) with MicromateClient(t, recv_timeout=0.5) as mm: - assert t.is_connected() + assert t.is_connected assert mm.connect().serial == "UM12947" - assert not t.is_connected() + assert not t.is_connected # ── The Thor firmware line, on real bytes ───────────────────────────────────── @@ -536,3 +537,13 @@ def test_get_setup_verify_false_returns_the_corrupt_read(): data[CONTENT + 5] = 0x05 mm, _ = client([frame(0xE5, bytes(data))]) assert mm.get_setup(verify=False).record_mode == 0x05 + + +def test_is_open_works_on_a_real_transport(): + """`is_connected` is a PROPERTY on BaseTransport. is_open() used to call + it, which raised TypeError on every real transport -- hidden because the + test double defined it as a method.""" + from minimateplus.transport import TcpTransport + + mm = MicromateClient(TcpTransport("127.0.0.1", port=9)) # never connected + assert mm.is_open() is False diff --git a/tests/test_micromate_protocol.py b/tests/test_micromate_protocol.py index 0e652e7..8b63fb9 100644 --- a/tests/test_micromate_protocol.py +++ b/tests/test_micromate_protocol.py @@ -52,6 +52,7 @@ class ScriptedTransport: def disconnect(self) -> None: self._connected = False + @property def is_connected(self) -> bool: return self._connected -- 2.54.1 From fa032567c2a5460bc5ad9b570520036e2cc1c8c2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:04:35 -0400 Subject: [PATCH 009/223] feat(micromate): get_event_count() and read_unsolicited() 0x06 content[0:4] moves from the bench tool into the client, tested against a real UM20147 read and its chain-walk count. read_unsolicited() reads without sending, for spotting RADIO RING on an idle session. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/client.py | 22 ++++++++++++++++++++++ tests/test_micromate_client.py | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/micromate/client.py b/micromate/client.py index f52e50a..b73f2f5 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -53,6 +53,11 @@ CONTENT = 11 # two of them disagree with docs/micromate_protocol_reference.md. _STATE_FLAG = 0 # 0x49: 0x00 idle, 0x02 monitoring +# 0x06 storage range. content[0:4] is the event count: 3/3 against the chain +# walk, and THOR's ReadEventRecordCount agrees. content[4:8] is very likely +# the monitor-log count -- graded a strong candidate, not settled, so not exposed. +_SR_EVENT_COUNT = slice(0, 4) + _MS_FLAG = 1 # 0x1C: monitoring flag — test NON-ZERO _MS_DAY, _MS_MONTH, _MS_YEAR = 2, 3, slice(4, 6) _MS_UNKNOWN_6 = 6 # ⚠ sub-second tick (~4020/s, step 4, 64 ms wrap) — NOT the hour @@ -264,6 +269,23 @@ class MicromateClient: raw=data, ) + def get_event_count(self) -> int: + """`SUB 0x06` -- events stored. One read; no chain walk.""" + c = _content(self._proto.read_storage_range()) + if len(c) < 4: + raise ProtocolError(f"storage range content is {len(c)} B, need at least 4") + return int.from_bytes(c[_SR_EVENT_COUNT], "big") + + def read_unsolicited(self) -> bytes: + """Whatever the unit sent unprompted. **Sends nothing.** + + One transport read. Bytes between commands are noise to the protocol + (every request resets the parser), so reading them here takes nothing + the protocol needs. A session calls this while idle to notice + RADIO RING without waiting for its next keep-alive. + """ + return self._transport.read(4096) + @staticmethod def _parse_clock(c: bytes) -> Optional[datetime.datetime]: """The unit's own clock, in its own local time. diff --git a/tests/test_micromate_client.py b/tests/test_micromate_client.py index 2d9d7bf..22f0ce0 100644 --- a/tests/test_micromate_client.py +++ b/tests/test_micromate_client.py @@ -547,3 +547,30 @@ def test_is_open_works_on_a_real_transport(): mm = MicromateClient(TcpTransport("127.0.0.1", port=9)) # never connected assert mm.is_open() is False + + +# ── get_event_count() / read_unsolicited() ──────────────────────────────────── + +# 0x06 response data captured from UM20147 (11.0BD) by Task 2, Step 1. The +# expected count is that session's independent chain-walk count. +SR_UM20147 = bytes.fromhex("2400000000000000000000000000050000000900000000000000000000000600000000000000000000000000000000") +SR_UM20147_CHAIN_WALK_COUNT = 5 + + +def test_event_count_is_content_0_4_and_matches_the_chain_walk(): + mm, t = client([frame(0xF9, SR_UM20147, flags=FLAGS_THOR)]) + assert mm.get_event_count() == SR_UM20147_CHAIN_WALK_COUNT + assert [w[5] for w in t.written] == [0x06] + + +def test_a_truncated_storage_range_raises(): + mm, _ = client([frame(0xF9, bytes(CONTENT) + b"\x00\x05", flags=FLAGS_THOR)]) + with pytest.raises(ProtocolError, match="storage range"): + mm.get_event_count() + + +def test_read_unsolicited_sends_nothing_and_returns_what_arrived(): + """Used to spot RADIO RING on an idle session. It must never write.""" + mm, t = client([b"\r\nRADIO RING\r\n"]) + assert mm.read_unsolicited() == b"\r\nRADIO RING\r\n" + assert t.written == [] -- 2.54.1 From 034529f4980a7cceef4752a493cfc781f7cc743f Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:06:20 -0400 Subject: [PATCH 010/223] feat(sfm): device_access core -- typed errors, series by serial prefix, shared models Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 7 +++ sfm/device_access/errors.py | 63 ++++++++++++++++++++++++ sfm/device_access/models.py | 68 ++++++++++++++++++++++++++ sfm/device_access/series.py | 20 ++++++++ tests/test_device_access_core.py | 83 ++++++++++++++++++++++++++++++++ 5 files changed, 241 insertions(+) create mode 100644 sfm/device_access/__init__.py create mode 100644 sfm/device_access/errors.py create mode 100644 sfm/device_access/models.py create mode 100644 sfm/device_access/series.py create mode 100644 tests/test_device_access_core.py diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py new file mode 100644 index 0000000..cfc3535 --- /dev/null +++ b/sfm/device_access/__init__.py @@ -0,0 +1,7 @@ +"""One door for every device request -- see the 2026-10-20 parity spec.""" +from .errors import ( + BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, MalformedReply, + NoAnswer, NotSupported, UnitBusy, WrongUnit, translate, +) +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .series import normalise_serial, series_for_serial diff --git a/sfm/device_access/errors.py b/sfm/device_access/errors.py new file mode 100644 index 0000000..b0ab7ad --- /dev/null +++ b/sfm/device_access/errors.py @@ -0,0 +1,63 @@ +"""Typed device errors, each with the HTTP status the endpoints return.""" +from __future__ import annotations + +import micromate.protocol as _mm_proto +import minimateplus.protocol as _mmp_proto + + +class DeviceError(Exception): + http_status = 500 + + +class BadRequest(DeviceError): + http_status = 422 + + +class NotSupported(DeviceError): + http_status = 501 + + +class WrongUnit(DeviceError): + http_status = 409 + + +class UnitBusy(DeviceError): + http_status = 423 + + +class ConnectFailed(DeviceError): + http_status = 503 + + +class CallHomeInProgress(DeviceError): + http_status = 503 + + +class NoAnswer(DeviceError): + http_status = 504 + + +class MalformedReply(DeviceError): + http_status = 502 + + +_TIMEOUTS = (_mm_proto.TimeoutError, _mmp_proto.TimeoutError) +_PROTOCOL = (_mm_proto.ProtocolError, _mmp_proto.ProtocolError) + + +def translate(exc: BaseException, *, connecting: bool) -> DeviceError: + """Map a library exception to a typed error. + + Order matters: each library's TimeoutError is a ProtocolError subclass, and + the builtin TimeoutError (a failed TCP connect) is an OSError. + """ + if isinstance(exc, DeviceError): + return exc + if isinstance(exc, _TIMEOUTS): + return NoAnswer(f"the unit did not answer: {exc}") + if isinstance(exc, _PROTOCOL): + return MalformedReply(f"bad reply from the unit: {exc}") + if isinstance(exc, OSError): + what = "could not connect" if connecting else "connection lost" + return ConnectFailed(f"{what}: {exc}") + return DeviceError(f"device error: {exc}") diff --git a/sfm/device_access/models.py b/sfm/device_access/models.py new file mode 100644 index 0000000..5f18b01 --- /dev/null +++ b/sfm/device_access/models.py @@ -0,0 +1,68 @@ +"""Series-neutral models. Every operation returns the same shape for both +series; anything only one series has goes under `detail`.""" +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import Any, Dict, Optional + +from .errors import BadRequest + + +@dataclass(frozen=True) +class UnitAddress: + host: Optional[str] + tcp_port: Optional[int] + port: Optional[str] + baud: Optional[int] + + def __post_init__(self) -> None: + if not self.host and not self.port: + raise BadRequest( + "specify 'host' (TCP, e.g. ?host=10.0.0.5&tcp_port=9034) " + "or 'port' (serial, e.g. ?port=/dev/ttyACM0)" + ) + + @property + def key(self) -> str: + """One key per physical link -- what the per-unit lock is keyed on.""" + if self.host: + return f"tcp:{self.host}:{self.tcp_port}" + return f"serial:{self.port}" + + +@dataclass +class UnitInfo: + serial: str + series: int + model: Optional[str] + firmware: Optional[str] + monitoring: Optional[bool] + active_setup: Optional[str] + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class UnitStatus: + serial: str + series: int + monitoring: bool + battery_volts: Optional[float] + memory_total_bytes: Optional[int] + memory_free_bytes: Optional[int] + device_time: Optional[str] # ISO, the unit's own local time + event_count: Optional[int] # None where it is not cheap (Series 3) + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class UnitSettings: + serial: str + series: int + setup_name: Optional[str] + record_mode: Optional[str] # the unit's own name for its mode + sample_rate: Optional[int] + record_time_s: Optional[float] + histogram_interval_s: Optional[int] + geo_trigger_ips: Optional[float] + notes: Dict[str, str] = field(default_factory=dict) + detail: Dict[str, Any] = field(default_factory=dict) diff --git a/sfm/device_access/series.py b/sfm/device_access/series.py new file mode 100644 index 0000000..aafca9e --- /dev/null +++ b/sfm/device_access/series.py @@ -0,0 +1,20 @@ +"""Which series a unit is, from its serial prefix (decided with Brian, 2026-10-20).""" +from __future__ import annotations + +from .errors import BadRequest + +SERIES_BY_PREFIX = {"UM": 4, "BE": 3, "BA": 3} + + +def normalise_serial(serial: str) -> str: + return (serial or "").strip().upper() + + +def series_for_serial(serial: str) -> int: + s = normalise_serial(serial) + for prefix, series in SERIES_BY_PREFIX.items(): + if s.startswith(prefix) and len(s) > len(prefix): + return series + raise BadRequest( + f"unknown serial {serial!r}: expected UM... (Series 4) or BE.../BA... (Series 3)" + ) diff --git a/tests/test_device_access_core.py b/tests/test_device_access_core.py new file mode 100644 index 0000000..6615d67 --- /dev/null +++ b/tests/test_device_access_core.py @@ -0,0 +1,83 @@ +"""Core types of sfm.device_access: errors, series selection, models.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +import minimateplus.protocol as mmp_proto # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + BadRequest, ConnectFailed, DeviceError, MalformedReply, NoAnswer, translate, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.series import normalise_serial, series_for_serial # noqa: E402 + + +# ── series ──────────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize( + "serial, series", + [("UM20147", 4), ("BE18193", 3), ("BA4521", 3), (" um20147 ", 4), ("be11529", 3)], +) +def test_the_prefix_picks_the_series(serial, series): + assert series_for_serial(serial) == series + + +def test_serials_are_normalised(): + assert normalise_serial(" um20147\n") == "UM20147" + + +@pytest.mark.parametrize("serial", ["", "UM", "XX12345", "12345", "MP1234"]) +def test_an_unknown_or_bare_prefix_is_a_bad_request(serial): + with pytest.raises(BadRequest, match="UM"): + series_for_serial(serial) + + +# ── errors ──────────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize( + "exc, connecting, cls, status", + [ + (mm_proto.TimeoutError("no frame"), False, NoAnswer, 504), + (mmp_proto.TimeoutError("no frame"), False, NoAnswer, 504), + (mm_proto.ChecksumError("bad"), False, MalformedReply, 502), + (mmp_proto.ProtocolError("bad"), False, MalformedReply, 502), + (ConnectionRefusedError("refused"), True, ConnectFailed, 503), + (OSError("reset"), False, ConnectFailed, 503), + ], +) +def test_library_exceptions_translate_to_typed_errors(exc, connecting, cls, status): + out = translate(exc, connecting=connecting) + assert isinstance(out, cls) + assert out.http_status == status + + +def test_connect_and_mid_session_failures_read_differently(): + assert "could not connect" in str(translate(OSError("x"), connecting=True)) + assert "connection lost" in str(translate(OSError("x"), connecting=False)) + + +def test_a_device_error_passes_through_unchanged(): + e = NoAnswer("quiet") + assert translate(e, connecting=False) is e + + +def test_anything_else_becomes_a_plain_device_error(): + out = translate(ValueError("boom"), connecting=False) + assert type(out) is DeviceError and out.http_status == 500 + + +# ── models ──────────────────────────────────────────────────────────────────── + +def test_an_address_needs_a_host_or_a_port(): + with pytest.raises(BadRequest): + UnitAddress(host=None, tcp_port=None, port=None, baud=None) + + +def test_the_lock_key_names_the_physical_link(): + assert UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None).key == "tcp:10.0.0.5:9034" + assert UnitAddress(host=None, tcp_port=None, port="/dev/ttyACM0", baud=115200).key == "serial:/dev/ttyACM0" -- 2.54.1 From bb4b26835b9f45e4a0536b993ac37f4959f2649b Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:08:10 -0400 Subject: [PATCH 011/223] feat(sfm): per-unit lock -- one connection per unit, 423 when busy Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 1 + sfm/device_access/locks.py | 41 ++++++++++++++++++++++++ tests/test_device_access_core.py | 55 ++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 sfm/device_access/locks.py diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index cfc3535..b5502ec 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -5,3 +5,4 @@ from .errors import ( ) from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial, series_for_serial +from .locks import UnitLocks diff --git a/sfm/device_access/locks.py b/sfm/device_access/locks.py new file mode 100644 index 0000000..0e2b757 --- /dev/null +++ b/sfm/device_access/locks.py @@ -0,0 +1,41 @@ +"""One connection per unit. A modem allows a single TCP session, so two +requests must take turns instead of opening a second connection.""" +from __future__ import annotations + +import threading +from contextlib import contextmanager +from typing import Dict, Iterator, Optional + +from .errors import UnitBusy + + +class UnitLocks: + def __init__(self, timeout: float = 20.0) -> None: + self._timeout = timeout + self._guard = threading.Lock() + self._locks: Dict[str, threading.Lock] = {} + + def _lock_for(self, key: str) -> threading.Lock: + with self._guard: + return self._locks.setdefault(key, threading.Lock()) + + @contextmanager + def hold(self, key: str, timeout: Optional[float] = None) -> Iterator[None]: + lock = self._lock_for(key) + wait = self._timeout if timeout is None else timeout + if not lock.acquire(timeout=wait): + raise UnitBusy(f"the unit at {key} is busy with another request; try again shortly") + try: + yield + finally: + lock.release() + + @contextmanager + def try_hold(self, key: str) -> Iterator[bool]: + lock = self._lock_for(key) + got = lock.acquire(blocking=False) + try: + yield got + finally: + if got: + lock.release() diff --git a/tests/test_device_access_core.py b/tests/test_device_access_core.py index 6615d67..b96a015 100644 --- a/tests/test_device_access_core.py +++ b/tests/test_device_access_core.py @@ -81,3 +81,58 @@ def test_an_address_needs_a_host_or_a_port(): def test_the_lock_key_names_the_physical_link(): assert UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None).key == "tcp:10.0.0.5:9034" assert UnitAddress(host=None, tcp_port=None, port="/dev/ttyACM0", baud=115200).key == "serial:/dev/ttyACM0" + + +# ── per-unit lock ───────────────────────────────────────────────────────────── + +import threading # noqa: E402 + +from sfm.device_access.errors import UnitBusy # noqa: E402 +from sfm.device_access.locks import UnitLocks # noqa: E402 + + +def test_a_second_request_for_a_busy_unit_gets_unit_busy(): + locks = UnitLocks(timeout=0.2) + entered = threading.Event() + release = threading.Event() + + def holder(): + with locks.hold("tcp:10.0.0.5:9034"): + entered.set() + release.wait(2) + + t = threading.Thread(target=holder) + t.start() + entered.wait(2) + try: + with pytest.raises(UnitBusy, match="busy"): + with locks.hold("tcp:10.0.0.5:9034"): + pass + finally: + release.set() + t.join() + + +def test_different_units_do_not_block_each_other(): + locks = UnitLocks(timeout=0.2) + with locks.hold("tcp:10.0.0.5:9034"): + with locks.hold("tcp:10.0.0.6:9034"): + pass + + +def test_try_hold_never_waits(): + locks = UnitLocks(timeout=5) + with locks.hold("k"): + with locks.try_hold("k") as got: + assert got is False + with locks.try_hold("k") as got: + assert got is True + + +def test_the_lock_is_released_after_an_exception(): + locks = UnitLocks(timeout=0.2) + with pytest.raises(RuntimeError): + with locks.hold("k"): + raise RuntimeError("boom") + with locks.hold("k"): + pass -- 2.54.1 From 5c6ca049c84db48fbecb0bb01c4b5e620b058a4d Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:10:23 -0400 Subject: [PATCH 012/223] feat(sfm): Series-3 adapter -- identify, status, settings into the shared models Connect-per-request with the TCP cold-boot retry kept; a different unit answering is refused (409) whenever the serial is already in hand. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 121 ++++++++++++++++++++++++++++++++ tests/device_access_fakes.py | 124 +++++++++++++++++++++++++++++++++ tests/test_device_access_s3.py | 86 +++++++++++++++++++++++ 3 files changed, 331 insertions(+) create mode 100644 sfm/device_access/s3.py create mode 100644 tests/device_access_fakes.py create mode 100644 tests/test_device_access_s3.py diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py new file mode 100644 index 0000000..b12a2a8 --- /dev/null +++ b/sfm/device_access/s3.py @@ -0,0 +1,121 @@ +"""Series-3 adapter. Connect-per-request, as SFM has always done for +MiniMates -- a held session waits for the bench test in the spec.""" +from __future__ import annotations + +import logging +from typing import Any, Callable + +from minimateplus import MiniMateClient +from minimateplus.transport import TcpTransport + +from .errors import DeviceError, MalformedReply, NoAnswer, WrongUnit, translate +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus + +log = logging.getLogger("sfm.device_access") + +S3_DEFAULT_BAUD = 38400 +S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "Histogram + Continuous"} + + +def default_s3_client_factory(address: UnitAddress, timeout: float = 10.0) -> MiniMateClient: + if address.host: + return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), timeout=timeout) + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD) + + +def _close(client: Any) -> None: + try: + client.close() + except Exception: # noqa: BLE001 + log.debug("close failed", exc_info=True) + + +class Series3Adapter: + def __init__(self, client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory) -> None: + self._factory = client_factory + + def _run(self, address: UnitAddress, fn: Callable[[Any], Any]) -> Any: + def attempt() -> Any: + client = self._factory(address) + try: + client.open() + except Exception as exc: + _close(client) + raise translate(exc, connecting=True) from exc + try: + return fn(client) + except DeviceError: + raise + except Exception as exc: + raise translate(exc, connecting=False) from exc + finally: + _close(client) + + try: + return attempt() + except NoAnswer: + # A MiniMate that has just had its serial lines asserted can take + # 5-10 s to boot, and shows it as silence; one retry covers it. TCP + # only -- on a serial cable a silence is a real fault. Narrower than + # server._run_with_retry (any protocol error): retrying a + # MalformedReply would also retry "no settings block", which a + # reconnect cannot fix. + if not address.host: + raise + log.info("Series 3 at %s: no clean answer, retrying once (unit may be cold)", address.key) + return attempt() + + @staticmethod + def _check(serial_reported: str, serial: str, address: UnitAddress) -> None: + if (serial_reported or "").strip().upper() != serial: + raise WrongUnit(f"asked for {serial} but {serial_reported} answered at {address.key}") + + def identify(self, address: UnitAddress, serial: str) -> UnitInfo: + def op(client: Any) -> UnitInfo: + info = client.connect() + self._check(info.serial, serial, address) + cc = info.compliance_config + return UnitInfo( + serial=info.serial, series=3, model=info.model, firmware=info.firmware_version, + monitoring=None, active_setup=cc.setup_name if cc else None, + detail={"manufacturer": info.manufacturer, "dsp_version": info.dsp_version}, + ) + return self._run(address, op) + + def status(self, address: UnitAddress, serial: str) -> UnitStatus: + def op(client: Any) -> UnitStatus: + client.poll() + ms = client.get_monitor_status() + return UnitStatus( + serial=serial, series=3, monitoring=ms.is_monitoring, + battery_volts=round(ms.battery_v, 2) if ms.battery_v is not None else None, + memory_total_bytes=ms.memory_total, memory_free_bytes=ms.memory_free, + device_time=None, event_count=None, + ) + return self._run(address, op) + + def settings(self, address: UnitAddress, serial: str) -> UnitSettings: + def op(client: Any) -> UnitSettings: + info = client.connect() + self._check(info.serial, serial, address) + cc = info.compliance_config + if cc is None: + raise MalformedReply("could not read the unit's settings (SUB 0x1A)") + mode = None + if cc.recording_mode is not None: + mode = S3_MODES.get(cc.recording_mode, f"unknown (0x{cc.recording_mode:02x})") + notes = { + label: value for label, value in ( + ("Project", cc.project), ("Client", cc.client), ("User Name", cc.operator), + ("Seis Loc", cc.sensor_location), ("Extended Notes", cc.notes), + ) if value is not None + } + return UnitSettings( + serial=info.serial, series=3, setup_name=cc.setup_name, record_mode=mode, + sample_rate=cc.sample_rate, record_time_s=cc.record_time, + histogram_interval_s=cc.histogram_interval_sec, geo_trigger_ips=cc.trigger_level_geo, + notes=notes, + detail={"record_mode_code": cc.recording_mode, "alarm_level_geo": cc.alarm_level_geo, + "geo_range": cc.geo_range}, + ) + return self._run(address, op) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py new file mode 100644 index 0000000..3866085 --- /dev/null +++ b/tests/device_access_fakes.py @@ -0,0 +1,124 @@ +"""Fakes of both device clients for sfm.device_access tests. + +They return the libraries' real dataclasses, and FakeMicromateClient's setup +is decoded from a real UM20147 read. `fail` is a queue of exceptions; each +call pops one, if any, and raises it. +""" +from __future__ import annotations + +import datetime +from pathlib import Path + +from micromate.models import MicromateDeviceInfo, MicromateState +from micromate.setup_block import decode_setup +from minimateplus.models import ComplianceConfig, DeviceInfo, MonitorStatus + +SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um20147_baseline.bin" + + +class _Base: + def __init__(self, fail=None, open_error=None): + self.fail = list(fail or []) + self.open_error = open_error + self.calls: list[str] = [] + self.opened = 0 + self.closed = 0 + self._open = False + + def _step(self, name): + self.calls.append(name) + if self.fail: + raise self.fail.pop(0) + + def open(self): + self.opened += 1 + if self.open_error is not None: + raise self.open_error + self._open = True + + def close(self): + self.closed += 1 + self._open = False + + +class FakeMiniMateClient(_Base): + def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", **kw): + super().__init__(**kw) + self.serial = serial + self.monitoring = monitoring + if compliance == "default": + compliance = ComplianceConfig( + recording_mode=0x01, sample_rate=1024, histogram_interval_sec=300, + record_time=3.0, trigger_level_geo=0.5, alarm_level_geo=1.0, geo_range=0, + setup_name="BRIDGE-A", project="Bridge job", client="Acme", + operator="BH", sensor_location="Loc 1", notes=None, + ) + self.compliance = compliance + + def connect(self) -> DeviceInfo: + self._step("connect") + return DeviceInfo( + serial=self.serial, firmware_minor=17, firmware_version="S338.17", + dsp_version="10.72", manufacturer="Instantel", model="MiniMate Plus", + compliance_config=self.compliance, + ) + + def poll(self) -> None: + self._step("poll") + + def get_monitor_status(self) -> MonitorStatus: + self._step("get_monitor_status") + return MonitorStatus( + is_monitoring=self.monitoring, battery_v=6.8, + memory_total=983026, memory_free=900000, + ) + + +class _FakeProtocol: + def __init__(self, owner): + self._owner = owner + + def poll(self): + self._owner._step("poll") + + +class FakeMicromateClient(_Base): + def __init__(self, serial="UM20147", *, monitoring=False, events=5, + unsolicited=b"", **kw): + super().__init__(**kw) + self.serial = serial + self.monitoring = monitoring + self.events = events + self.unsolicited = unsolicited + self.protocol = _FakeProtocol(self) + + def is_open(self) -> bool: + return self._open + + def connect(self) -> MicromateDeviceInfo: + self._step("connect") + return MicromateDeviceInfo( + serial=self.serial, manufacturer="Instantel", model="MM/ISEE/S", + firmware_line="thor", monitoring=self.monitoring, active_setup="test2.MMB", + ) + + def get_state(self) -> MicromateState: + self._step("get_state") + return MicromateState( + monitoring=self.monitoring, + device_time=datetime.datetime(2026, 10, 20, 18, 7, 58), + battery_volts=3.8, memory_total_bytes=15_000_000, memory_free_bytes=14_799_296, + ) + + def get_event_count(self) -> int: + self._step("get_event_count") + return self.events + + def get_setup(self): + self._step("get_setup") + return decode_setup(SETUP_FIXTURE.read_bytes()[11:]) + + def read_unsolicited(self) -> bytes: + self._step("read_unsolicited") + data, self.unsolicited = self.unsolicited, b"" + return data diff --git a/tests/test_device_access_s3.py b/tests/test_device_access_s3.py new file mode 100644 index 0000000..d798785 --- /dev/null +++ b/tests/test_device_access_s3.py @@ -0,0 +1,86 @@ +"""The Series-3 adapter: connect-per-request, mapped into the shared models.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.protocol as mmp_proto # noqa: E402 +from device_access_fakes import FakeMiniMateClient # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + ConnectFailed, MalformedReply, NoAnswer, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s3 import Series3Adapter # noqa: E402 + +TCP = UnitAddress(host="10.0.0.5", tcp_port=12345, port=None, baud=None) +SERIAL_LINK = UnitAddress(host=None, tcp_port=None, port="/dev/ttyUSB0", baud=None) + + +def adapter(*clients): + queue = list(clients) + return Series3Adapter(client_factory=lambda address: queue.pop(0)) + + +def test_identify_maps_device_info(): + fake = FakeMiniMateClient() + info = adapter(fake).identify(TCP, "BE18193") + assert (info.serial, info.series, info.model, info.firmware) == ("BE18193", 3, "MiniMate Plus", "S338.17") + assert info.active_setup == "BRIDGE-A" + assert info.monitoring is None # connect() does not read it on Series 3 + assert fake.closed == 1 + + +def test_a_different_unit_answering_is_refused(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit, match="BE18193.*BE11529"): + adapter(fake).identify(TCP, "BE18193") + assert fake.closed == 1 + + +def test_status_maps_monitor_status(): + fake = FakeMiniMateClient(monitoring=True) + st = adapter(fake).status(TCP, "BE18193") + assert (st.series, st.monitoring, st.battery_volts) == (3, True, 6.8) + assert (st.memory_total_bytes, st.memory_free_bytes) == (983026, 900000) + assert st.event_count is None and st.device_time is None + assert fake.calls == ["poll", "get_monitor_status"] + + +def test_settings_maps_the_compliance_config(): + s = adapter(FakeMiniMateClient()).settings(TCP, "BE18193") + assert s.record_mode == "Continuous" + assert (s.sample_rate, s.record_time_s, s.histogram_interval_s) == (1024, 3.0, 300) + assert s.geo_trigger_ips == 0.5 + assert s.setup_name == "BRIDGE-A" + assert s.notes == {"Project": "Bridge job", "Client": "Acme", "User Name": "BH", "Seis Loc": "Loc 1"} + assert s.detail["record_mode_code"] == 0x01 + + +def test_settings_without_a_compliance_read_is_a_malformed_reply_and_not_retried(): + # One fake only: a retry would ask the factory for a second and fail. + with pytest.raises(MalformedReply, match="settings"): + adapter(FakeMiniMateClient(compliance=None)).settings(TCP, "BE18193") + + +def test_a_cold_unit_over_tcp_gets_one_retry(): + first = FakeMiniMateClient(fail=[mmp_proto.TimeoutError("cold")]) + second = FakeMiniMateClient() + info = adapter(first, second).identify(TCP, "BE18193") + assert info.serial == "BE18193" + assert first.closed == 1 and second.closed == 1 + + +def test_a_serial_link_is_not_retried(): + fake = FakeMiniMateClient(fail=[mmp_proto.TimeoutError("quiet")]) + with pytest.raises(NoAnswer): + adapter(fake).identify(SERIAL_LINK, "BE18193") + + +def test_a_failed_connect_is_connect_failed_and_not_retried(): + fake = FakeMiniMateClient(open_error=ConnectionRefusedError("refused")) + with pytest.raises(ConnectFailed, match="could not connect"): + adapter(fake).identify(TCP, "BE18193") -- 2.54.1 From d39f8ef360669551a80251ff735220eb92e84173 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:12:17 -0400 Subject: [PATCH 013/223] fix(sfm): Series-3 status says its serial is unverified Series 3 status reads no serial, so the serial shown is the requested one, not one the unit reported. detail now carries serial_verified=False. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 2 ++ tests/test_device_access_s3.py | 1 + 2 files changed, 3 insertions(+) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index b12a2a8..7d96e27 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -91,6 +91,8 @@ class Series3Adapter: battery_volts=round(ms.battery_v, 2) if ms.battery_v is not None else None, memory_total_bytes=ms.memory_total, memory_free_bytes=ms.memory_free, device_time=None, event_count=None, + # Series 3 status reads no serial, so the serial shown is the one requested, not one the unit reported. + detail={"serial_verified": False}, ) return self._run(address, op) diff --git a/tests/test_device_access_s3.py b/tests/test_device_access_s3.py index d798785..720b24f 100644 --- a/tests/test_device_access_s3.py +++ b/tests/test_device_access_s3.py @@ -47,6 +47,7 @@ def test_status_maps_monitor_status(): assert (st.series, st.monitoring, st.battery_volts) == (3, True, 6.8) assert (st.memory_total_bytes, st.memory_free_bytes) == (983026, 900000) assert st.event_count is None and st.device_time is None + assert st.detail == {"serial_verified": False} assert fake.calls == ["poll", "get_monitor_status"] -- 2.54.1 From 8e7333b899810f434306ebb62260b37ab7db56a5 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:13:34 -0400 Subject: [PATCH 014/223] feat(sfm): Series-4 session -- call up once, stay on the line, release on RADIO RING Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s4.py | 164 +++++++++++++++++++++++++++++ tests/test_device_access_s4.py | 181 +++++++++++++++++++++++++++++++++ 2 files changed, 345 insertions(+) create mode 100644 sfm/device_access/s4.py create mode 100644 tests/test_device_access_s4.py diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py new file mode 100644 index 0000000..3c320bf --- /dev/null +++ b/sfm/device_access/s4.py @@ -0,0 +1,164 @@ +"""Series-4 sessions: call up once, stay on the line, hang up when idle. + +⚠ Imports only minimateplus.transport from the Series-3 package. Nothing +here may build or send a Series-3 frame -- SESSION_RESET (41 03) has never +been sent to a Micromate. +""" +from __future__ import annotations + +import logging +import time +from typing import Any, Callable, Optional, TypeVar + +from micromate.client import MicromateClient +from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport + +from .errors import CallHomeInProgress, WrongUnit, translate +from .models import UnitAddress +from .series import normalise_serial + +log = logging.getLogger("sfm.device_access") + +T = TypeVar("T") +RING = b"RADIO RING" +S4_DEFAULT_BAUD = 115200 + + +class RingDetected(Exception): + """The unit sent RADIO RING: it is calling home up this connection.""" + + +class RingWatchTransport(BaseTransport): + """Passes bytes through; raises RingDetected the moment RADIO RING appears, + including when it is split across two reads.""" + + def __init__(self, inner: BaseTransport) -> None: + self._inner = inner + self._tail = b"" + + def connect(self) -> None: + self._inner.connect() + + def disconnect(self) -> None: + self._inner.disconnect() + + @property + def is_connected(self) -> bool: + return self._inner.is_connected + + def write(self, data: bytes) -> None: + self._inner.write(data) + + def read(self, n: int) -> bytes: + data = self._inner.read(n) + if data: + window = self._tail + data + if RING in window: + self._tail = b"" + raise RingDetected("RADIO RING") + self._tail = window[-(len(RING) - 1):] + return data + + +def default_s4_client_factory(address: UnitAddress, recv_timeout: float = 10.0) -> MicromateClient: + if address.host: + inner: BaseTransport = TcpTransport(address.host, port=address.tcp_port) + else: + inner = SerialTransport(address.port, address.baud or S4_DEFAULT_BAUD) + return MicromateClient(RingWatchTransport(inner), recv_timeout=recv_timeout) + + +def _close(client: Any) -> None: + try: + client.close() + except Exception: # noqa: BLE001 + log.debug("close failed", exc_info=True) + + +_RING_MESSAGE = ("the unit started calling home; SFM hung up so the call can " + "reach THOR -- try again in a few minutes") + + +class Series4Session: + """One held line to one Micromate. + + `last_used` is the last *user* request: the idle hang-up measures it. + `last_traffic` is any exchange, keep-alives included: the keep-alive + schedule measures it. If keep-alives counted as use, the line would never + go idle. + """ + + def __init__(self, address: UnitAddress, serial: str, + client_factory: Callable[[UnitAddress], Any], + clock: Callable[[], float] = time.monotonic) -> None: + self.address = address + self.serial = normalise_serial(serial) + self._factory = client_factory + self._clock = clock + self._client: Optional[Any] = None + self.info = None + self.last_used = clock() + self.last_traffic = self.last_used + + @property + def is_open(self) -> bool: + return self._client is not None and self._client.is_open() + + def call_up(self): + client = self._factory(self.address) + try: + client.open() + info = client.connect() + except RingDetected as exc: + _close(client) + log.warning("RADIO RING from %s during call-up -- released the line", self.address.key) + raise CallHomeInProgress(_RING_MESSAGE) from exc + except Exception as exc: + _close(client) + raise translate(exc, connecting=True) from exc + if normalise_serial(info.serial) != self.serial: + _close(client) + raise WrongUnit(f"asked for {self.serial} but {info.serial} answered at {self.address.key}") + self._client, self.info = client, info + self.last_used = self.last_traffic = self._clock() + log.info("call-up: %s at %s, staying on the line", self.serial, self.address.key) + return info + + def _exchange(self, op: Callable[[Any], T]) -> T: + try: + return op(self._client) + except RingDetected as exc: + self.hang_up() + log.warning("RADIO RING from %s -- released the line so the call reaches THOR", + self.address.key) + raise CallHomeInProgress(_RING_MESSAGE) from exc + except Exception as exc: + self.hang_up() + raise translate(exc, connecting=False) from exc + + def run(self, op: Callable[[Any], T]) -> T: + """A user request. Calls up first if the line is not open.""" + if not self.is_open: + self.call_up() + result = self._exchange(op) + self.last_used = self.last_traffic = self._clock() + return result + + def keepalive(self) -> None: + """A POLL so the modem's idle timer does not drop the line. Not use.""" + if not self.is_open: + return + self._exchange(lambda c: c.protocol.poll()) + self.last_traffic = self._clock() + + def listen(self) -> None: + """Read anything the unit sent unprompted; send nothing. Not use.""" + if not self.is_open: + return + self._exchange(lambda c: c.read_unsolicited()) + + def hang_up(self) -> None: + if self._client is not None: + _close(self._client) + self._client = None + log.info("hang-up: %s at %s", self.serial, self.address.key) diff --git a/tests/test_device_access_s4.py b/tests/test_device_access_s4.py new file mode 100644 index 0000000..31b7f59 --- /dev/null +++ b/tests/test_device_access_s4.py @@ -0,0 +1,181 @@ +"""Series-4 sessions: one call-up, then stay on the line; ring safety.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from device_access_fakes import FakeMicromateClient # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + CallHomeInProgress, ConnectFailed, NoAnswer, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import ( # noqa: E402 + RingDetected, RingWatchTransport, Series4Session, +) + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class ScriptedInner: + """A minimal real-interface transport: is_connected is a PROPERTY.""" + + def __init__(self, chunks): + self.chunks = list(chunks) + self.written = [] + self._c = False + + def connect(self): + self._c = True + + def disconnect(self): + self._c = False + + @property + def is_connected(self): + return self._c + + def write(self, data): + self.written.append(data) + + def read(self, n): + return self.chunks.pop(0) if self.chunks else b"" + + +class Clock: + def __init__(self, t=1000.0): + self.t = t + + def __call__(self): + return self.t + + +def session(*clients, clock=None): + queue = list(clients) + return Series4Session(ADDR, "UM20147", lambda address: queue.pop(0), clock=clock or Clock()) + + +# ── RingWatchTransport ──────────────────────────────────────────────────────── + +def test_ordinary_bytes_pass_through(): + t = RingWatchTransport(ScriptedInner([b"\x02abc\x03"])) + assert t.read(4096) == b"\x02abc\x03" + + +def test_a_ring_raises(): + t = RingWatchTransport(ScriptedInner([b"\r\nRADIO RING\r\n"])) + with pytest.raises(RingDetected): + t.read(4096) + + +def test_a_ring_split_across_reads_still_raises(): + t = RingWatchTransport(ScriptedInner([b"\r\nRADIO R", b"ING\r\n"])) + assert t.read(4096) == b"\r\nRADIO R" + with pytest.raises(RingDetected): + t.read(4096) + + +def test_the_wrapper_keeps_is_connected_a_property(): + inner = ScriptedInner([]) + t = RingWatchTransport(inner) + t.connect() + assert t.is_connected is True + + +# ── call-up ─────────────────────────────────────────────────────────────────── + +def test_call_up_verifies_the_serial_once(): + fake = FakeMicromateClient() + s = session(fake) + s.run(lambda c: c.get_state()) + s.run(lambda c: c.get_event_count()) + assert fake.calls == ["connect", "get_state", "get_event_count"] + assert fake.opened == 1 + + +def test_a_different_unit_answering_is_refused_and_closed(): + fake = FakeMicromateClient(serial="UM12947") + s = session(fake) + with pytest.raises(WrongUnit, match="UM20147.*UM12947"): + s.run(lambda c: c.get_state()) + assert fake.closed == 1 and not s.is_open + assert fake.calls == ["connect"] # nothing after the identity check + + +def test_a_failed_connect_is_connect_failed(): + s = session(FakeMicromateClient(open_error=ConnectionRefusedError("no"))) + with pytest.raises(ConnectFailed, match="could not connect"): + s.run(lambda c: c.get_state()) + + +# ── ring safety ─────────────────────────────────────────────────────────────── + +def test_a_ring_during_a_request_releases_the_line(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress, match="calling home"): + s.run(lambda c: c.get_state()) + assert not s.is_open and fake.closed == 1 + + +def test_listen_while_idle_releases_the_line_on_a_ring_and_sends_nothing(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + s.listen() + assert not s.is_open + assert fake.calls == ["connect", "read_unsolicited"] + + +def test_the_next_request_after_a_ring_calls_up_fresh(): + first, second = FakeMicromateClient(), FakeMicromateClient() + s = session(first, second) + s.call_up() + first.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + s.run(lambda c: c.get_state()) + s.run(lambda c: c.get_state()) + assert second.calls == ["connect", "get_state"] + + +# ── what counts as use ──────────────────────────────────────────────────────── + +def test_keepalive_and_listen_do_not_count_as_use(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + s = session(fake, clock=clock) + s.call_up() + clock.t = 1060.0 + s.keepalive() + clock.t = 1065.0 + s.listen() + assert s.last_used == 1000.0 + assert s.last_traffic == 1060.0 + assert fake.calls == ["connect", "poll", "read_unsolicited"] + + +def test_a_request_counts_as_use(): + clock = Clock(1000.0) + s = session(FakeMicromateClient(), clock=clock) + s.call_up() + clock.t = 1100.0 + s.run(lambda c: c.get_state()) + assert s.last_used == 1100.0 and s.last_traffic == 1100.0 + + +def test_a_failure_mid_request_hangs_up(): + fake = FakeMicromateClient() + s = session(fake) + s.call_up() + fake.fail = [mm_proto.TimeoutError("quiet")] + with pytest.raises(NoAnswer): + s.run(lambda c: c.get_state()) + assert not s.is_open -- 2.54.1 From ece9ec79e3690be8510138164fbb39153c40c62e Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:15:43 -0400 Subject: [PATCH 015/223] feat(sfm): Series-4 identify, status and settings into the shared models Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s4.py | 55 +++++++++++++++++++++++++++++++++- tests/test_device_access_s4.py | 31 +++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 3c320bf..a099733 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -14,7 +14,7 @@ from micromate.client import MicromateClient from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import CallHomeInProgress, WrongUnit, translate -from .models import UnitAddress +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial log = logging.getLogger("sfm.device_access") @@ -162,3 +162,56 @@ class Series4Session: _close(self._client) self._client = None log.info("hang-up: %s at %s", self.serial, self.address.key) + + +# ── Operations (each runs inside Series4Session.run) ────────────────────────── + +def s4_identify(client: Any, serial: str) -> UnitInfo: + info = client.connect() + return UnitInfo( + serial=info.serial, series=4, model=info.model, + firmware=None, # the version string lives in 0x01, undecoded + monitoring=info.monitoring, active_setup=info.active_setup, + detail={"manufacturer": info.manufacturer, "firmware_line": info.firmware_line}, + ) + + +def s4_status(client: Any, serial: str) -> UnitStatus: + st = client.get_state() + count = client.get_event_count() + return UnitStatus( + serial=serial, series=4, monitoring=st.monitoring, battery_volts=st.battery_volts, + memory_total_bytes=st.memory_total_bytes, memory_free_bytes=st.memory_free_bytes, + device_time=st.device_time.isoformat() if st.device_time else None, + event_count=count, + ) + + +def s4_settings(client: Any, serial: str) -> UnitSettings: + s = client.get_setup() + return UnitSettings( + serial=serial, series=4, setup_name=s.name, record_mode=s.record_mode_name, + sample_rate=s.sample_rate, record_time_s=s.record_time_s, + histogram_interval_s=s.histogram_interval_s, + geo_trigger_ips=s.geo_trigger_ips[0], # the keypad writes all three the same + notes=dict(s.notes), + detail={ + "pretrigger_s": s.pretrigger_s, + "auto_record_stop": s.auto_record_stop, + "auto_stop_after_s": s.auto_stop_after_s, + "geophones_active": s.geophones_active, + "mic_active": s.mic_active, + "trigger_on_geophones": s.trigger_on_geophones, + "trigger_on_mic": s.trigger_on_mic, + "geo_trigger_ips_per_channel": list(s.geo_trigger_ips), + "mic_type": s.mic_type, + "mic_trigger_psi": s.mic_trigger_psi, + "mic_trigger_db": s.mic_trigger_db, + "job_number_enabled": s.job_number_enabled, + "job_number": s.job_number, + "scaled_distance_enabled": s.scaled_distance_enabled, + "distance_ft": s.distance_ft, + "charge_weight_lb": s.charge_weight_lb, + "scaled_distance": s.scaled_distance, + }, + ) diff --git a/tests/test_device_access_s4.py b/tests/test_device_access_s4.py index 31b7f59..5617e5a 100644 --- a/tests/test_device_access_s4.py +++ b/tests/test_device_access_s4.py @@ -179,3 +179,34 @@ def test_a_failure_mid_request_hangs_up(): with pytest.raises(NoAnswer): s.run(lambda c: c.get_state()) assert not s.is_open + + +# ── operations ──────────────────────────────────────────────────────────────── + +from sfm.device_access.s4 import s4_identify, s4_settings, s4_status # noqa: E402 + + +def test_s4_identify(): + info = s4_identify(FakeMicromateClient(monitoring=True), "UM20147") + assert (info.serial, info.series, info.model, info.monitoring) == ("UM20147", 4, "MM/ISEE/S", True) + assert info.active_setup == "test2.MMB" + assert info.firmware is None and info.detail["firmware_line"] == "thor" + + +def test_s4_status_includes_the_cheap_event_count(): + st = s4_status(FakeMicromateClient(events=5), "UM20147") + assert (st.series, st.monitoring, st.battery_volts, st.event_count) == (4, False, 3.8, 5) + assert (st.memory_total_bytes, st.memory_free_bytes) == (15_000_000, 14_799_296) + assert st.device_time == "2026-10-20T18:07:58" + + +def test_s4_settings_maps_the_decoded_setup(): + s = s4_settings(FakeMicromateClient(), "UM20147") + assert (s.series, s.setup_name, s.record_mode) == (4, "test2.MMB", "Histogram Combo") + assert (s.sample_rate, s.record_time_s, s.histogram_interval_s) == (1024, 10.0, 2) + assert s.geo_trigger_ips == pytest.approx(0.5, abs=1e-6) + assert list(s.notes) == ["Location", "Client", "Company", "General Notes"] + assert s.detail["pretrigger_s"] == 1.0 + assert s.detail["mic_type"] == "linear" + assert s.detail["mic_trigger_db"] == pytest.approx(131.0, abs=0.01) + assert s.detail["geo_trigger_ips_per_channel"] == pytest.approx([0.5, 0.5, 0.5], abs=1e-6) -- 2.54.1 From 96c7b31f4ecf65ad719568c032610c417c7fd874 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:17:39 -0400 Subject: [PATCH 016/223] feat(sfm): DeviceAccess -- one door, held Series-4 lines, a reaper, and the same answer shape for both series Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 1 + sfm/device_access/access.py | 144 ++++++++++++++++++++++++++ tests/test_device_access.py | 186 ++++++++++++++++++++++++++++++++++ 3 files changed, 331 insertions(+) create mode 100644 sfm/device_access/access.py create mode 100644 tests/test_device_access.py diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index b5502ec..2093308 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -6,3 +6,4 @@ from .errors import ( from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial, series_for_serial from .locks import UnitLocks +from .access import DeviceAccess diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py new file mode 100644 index 0000000..a7c95eb --- /dev/null +++ b/sfm/device_access/access.py @@ -0,0 +1,144 @@ +"""DeviceAccess -- the one door every device request passes through. + +The control surface does not care which series it is talking to; this does. +""" +from __future__ import annotations + +import logging +import threading +import time +from typing import Any, Callable, Dict, Optional + +from .errors import DeviceError +from .locks import UnitLocks +from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .s3 import Series3Adapter, default_s3_client_factory +from .s4 import ( + Series4Session, default_s4_client_factory, s4_identify, s4_settings, s4_status, +) +from .series import normalise_serial, series_for_serial + +log = logging.getLogger("sfm.device_access") + + +class DeviceAccess: + def __init__( + self, *, + s3_client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory, + s4_client_factory: Callable[[UnitAddress], Any] = default_s4_client_factory, + clock: Callable[[], float] = time.monotonic, + lock_timeout: float = 20.0, + keepalive_s: float = 60.0, + idle_hangup_s: float = 300.0, + reaper_interval_s: float = 5.0, + start_reaper: bool = True, + ) -> None: + self._locks = UnitLocks(lock_timeout) + self._s3 = Series3Adapter(s3_client_factory) + self._s4_factory = s4_client_factory + self._clock = clock + self._keepalive_s = keepalive_s + self._idle_hangup_s = idle_hangup_s + self._reaper_interval_s = reaper_interval_s + self._start_reaper = start_reaper + self._reaper: Optional[threading.Thread] = None + self._sessions: Dict[str, Series4Session] = {} + self._sessions_guard = threading.Lock() + + # ── public operations ───────────────────────────────────────────────────── + + def identify(self, address: UnitAddress, serial: str) -> UnitInfo: + return self._dispatch(address, serial, self._s3.identify, s4_identify) + + def status(self, address: UnitAddress, serial: str) -> UnitStatus: + return self._dispatch(address, serial, self._s3.status, s4_status) + + def settings(self, address: UnitAddress, serial: str) -> UnitSettings: + return self._dispatch(address, serial, self._s3.settings, s4_settings) + + def hang_up(self, address: UnitAddress) -> bool: + with self._locks.hold(address.key): + with self._sessions_guard: + session = self._sessions.pop(address.key, None) + if session is None: + return False + was_open = session.is_open + session.hang_up() + return was_open + + # ── dispatch ────────────────────────────────────────────────────────────── + + def _dispatch(self, address: UnitAddress, serial: str, + s3_op: Callable[[UnitAddress, str], Any], + s4_op: Callable[[Any, str], Any]) -> Any: + serial = normalise_serial(serial) + series = series_for_serial(serial) # raises BadRequest before any I/O + with self._locks.hold(address.key): + if series == 3: + return s3_op(address, serial) + session = self._session_for(address, serial) + try: + return session.run(lambda client: s4_op(client, serial)) + except DeviceError: + if not session.is_open: + with self._sessions_guard: + if self._sessions.get(address.key) is session: + del self._sessions[address.key] + raise + + def _session_for(self, address: UnitAddress, serial: str) -> Series4Session: + with self._sessions_guard: + session = self._sessions.get(address.key) + if session is not None and session.serial != serial: + session.hang_up() + session = None + if session is None: + session = Series4Session(address, serial, self._s4_factory, clock=self._clock) + self._sessions[address.key] = session + self._ensure_reaper() + return session + + # ── the reaper ──────────────────────────────────────────────────────────── + + def tick(self, now: Optional[float] = None) -> None: + """Per held line: hang up if idle, else keep alive, else listen for a ring.""" + now = self._clock() if now is None else now + with self._sessions_guard: + items = list(self._sessions.items()) + for key, session in items: + with self._locks.try_hold(key) as held: + if not held: + continue # mid-request: not idle + if not session.is_open: + self._drop(key, session) + continue + try: + if now - session.last_used >= self._idle_hangup_s: + session.hang_up() + self._drop(key, session) + elif now - session.last_traffic >= self._keepalive_s: + session.keepalive() + else: + session.listen() + except DeviceError as exc: + log.warning("held line %s closed: %s", key, exc) + self._drop(key, session) + + def _drop(self, key: str, session: Series4Session) -> None: + with self._sessions_guard: + if self._sessions.get(key) is session: + del self._sessions[key] + + def _ensure_reaper(self) -> None: + if not self._start_reaper or self._reaper is not None: + return + self._reaper = threading.Thread(target=self._reaper_loop, name="sfm-held-lines", daemon=True) + self._reaper.start() + + def _reaper_loop(self) -> None: + while True: + time.sleep(self._reaper_interval_s) + try: + self.tick() + except Exception: # noqa: BLE001 + log.exception("held-line reaper tick failed") diff --git a/tests/test_device_access.py b/tests/test_device_access.py new file mode 100644 index 0000000..c11e9dc --- /dev/null +++ b/tests/test_device_access.py @@ -0,0 +1,186 @@ +"""DeviceAccess: dispatch by serial, sessions, the lock, the reaper -- and the +contract that both series answer in the same shape.""" +from __future__ import annotations + +import dataclasses +import os +import sys +import threading + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import BadRequest, CallHomeInProgress, UnitBusy # noqa: E402 +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import RingDetected # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class Clock: + def __init__(self, t=1000.0): + self.t = t + + def __call__(self): + return self.t + + +def access(s3=(), s4=(), clock=None, lock_timeout=0.2): + s3q, s4q = list(s3), list(s4) + return DeviceAccess( + s3_client_factory=lambda a: s3q.pop(0), + s4_client_factory=lambda a: s4q.pop(0), + clock=clock or Clock(), lock_timeout=lock_timeout, start_reaper=False, + ) + + +def test_the_serial_prefix_picks_the_adapter(): + da = access(s3=[FakeMiniMateClient()], s4=[FakeMicromateClient()]) + assert da.identify(ADDR, "be18193").series == 3 + assert da.identify(ADDR, " um20147").series == 4 + + +def test_an_unknown_prefix_never_touches_a_unit(): + da = access() + with pytest.raises(BadRequest): + da.identify(ADDR, "XX123") + + +def test_a_micromate_stays_on_the_line_between_requests(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.identify(ADDR, "UM20147") + da.status(ADDR, "UM20147") + da.settings(ADDR, "UM20147") + assert fake.opened == 1 # one call-up, three requests + assert fake.calls[0] == "connect" + + +def test_a_minimate_reconnects_per_request(): + a, b = FakeMiniMateClient(), FakeMiniMateClient() + da = access(s3=[a, b]) + da.status(ADDR, "BE18193") + da.status(ADDR, "BE18193") + assert a.closed == 1 and b.closed == 1 + + +def test_a_dropped_line_is_called_up_again_quietly(): + first, second = FakeMicromateClient(), FakeMicromateClient() + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + first._open = False # the modem dropped the idle line + st = da.status(ADDR, "UM20147") + assert st.series == 4 and second.opened == 1 + + +def test_a_different_serial_at_the_same_address_hangs_up_the_old_line(): + first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947") + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + da.status(ADDR, "UM12947") + assert first.closed == 1 and second.opened == 1 + + +def test_a_busy_unit_answers_423_without_a_second_connection(): + fake = FakeMicromateClient() + da = access(s4=[fake], lock_timeout=0.2) + entered, release = threading.Event(), threading.Event() + + def slow_request(): + with da._locks.hold(ADDR.key): # simulate a request in flight + entered.set() + release.wait(2) + + t = threading.Thread(target=slow_request) + t.start() + entered.wait(2) + try: + with pytest.raises(UnitBusy): + da.status(ADDR, "UM20147") + assert fake.opened == 0 # no second connection was opened + finally: + release.set() + t.join() + + +def test_hang_up_closes_a_held_line(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.status(ADDR, "UM20147") + assert da.hang_up(ADDR) is True + assert fake.closed == 1 + assert da.hang_up(ADDR) is False # nothing left to hang up + + +# ── the reaper ──────────────────────────────────────────────────────────────── + +def test_tick_listens_then_keeps_alive_then_hangs_up_when_idle(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.calls.clear() + + clock.t = 1030.0 + da.tick() # quiet: listen only + assert fake.calls == ["read_unsolicited"] + + clock.t = 1061.0 + da.tick() # 60 s since traffic: keep-alive + assert fake.calls[-1] == "poll" + + clock.t = 1301.0 + da.tick() # 300 s since last USE: hang up + assert fake.closed == 1 + assert da.hang_up(ADDR) is False + + +def test_tick_releases_the_line_on_a_ring_while_idle(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.fail = [RingDetected("RADIO RING")] + clock.t = 1010.0 + da.tick() + assert fake.closed == 1 + + +def test_tick_skips_a_unit_that_is_busy(): + clock = Clock(1000.0) + fake = FakeMicromateClient() + da = access(s4=[fake], clock=clock) + da.status(ADDR, "UM20147") + fake.calls.clear() + clock.t = 1400.0 + with da._locks.hold(ADDR.key): + da.tick() # must not block or hang up mid-request + assert fake.calls == [] and fake.closed == 0 + + +def test_a_ring_mid_request_is_a_clear_error(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + da.status(ADDR, "UM20147") + fake.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + da.status(ADDR, "UM20147") + + +# ── the contract: both series answer in the same shape ──────────────────────── + +@pytest.mark.parametrize("op", ["identify", "status", "settings"]) +def test_both_series_return_the_same_model_with_the_same_fields(op): + da = access(s3=[FakeMiniMateClient()], s4=[FakeMicromateClient()]) + s3 = getattr(da, op)(ADDR, "BE18193") + s4 = getattr(da, op)(ADDR, "UM20147") + assert type(s3) is type(s4) + assert [f.name for f in dataclasses.fields(s3)] == [f.name for f in dataclasses.fields(s4)] + assert (s3.series, s4.series) == (3, 4) + for name in (f.name for f in dataclasses.fields(s3)): + a, b = getattr(s3, name), getattr(s4, name) + if a is not None and b is not None and name != "detail": + assert type(a) is type(b) or {type(a), type(b)} <= {int, float}, name -- 2.54.1 From 73b60890123b0cbe505e5d385224be1af293559e Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:23:57 -0400 Subject: [PATCH 017/223] fix(sfm): retry once on a dropped held line; refuse Series-3 beside a held Series-4 line Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 35 +++++++++++++++++++++++++++------ tests/test_device_access.py | 39 ++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index a7c95eb..aaaf858 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -9,7 +9,7 @@ import threading import time from typing import Any, Callable, Dict, Optional -from .errors import DeviceError +from .errors import ConnectFailed, DeviceError, NoAnswer, WrongUnit from .locks import UnitLocks from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus from .s3 import Series3Adapter, default_s3_client_factory @@ -75,17 +75,40 @@ class DeviceAccess: series = series_for_serial(serial) # raises BadRequest before any I/O with self._locks.hold(address.key): if series == 3: + with self._sessions_guard: + held = self._sessions.get(address.key) + if held is not None and held.is_open: + raise WrongUnit( + f"a Series-4 line to {held.serial} is held at {address.key}; " + "a Series-3 unit cannot be there -- POST /device/hangup first " + "if the modem has moved") return s3_op(address, serial) session = self._session_for(address, serial) + was_held = session.is_open try: return session.run(lambda client: s4_op(client, serial)) - except DeviceError: - if not session.is_open: - with self._sessions_guard: - if self._sessions.get(address.key) is session: - del self._sessions[address.key] + except DeviceError as exc: + self._forget_if_closed(address, session) + # A held line the peer dropped still reads open (the transport only + # learns at EOF), so the first request on it times out or fails. + # Call up fresh and retry ONCE. Safe only because phase 1a + # operations are reads (idempotent); writes (phase 3) must NOT + # inherit this -- a write whose ack was lost must never be sent twice. + if was_held and isinstance(exc, (NoAnswer, ConnectFailed)): + self._drop(address.key, session) + session.hang_up() + session = self._session_for(address, serial) + try: + return session.run(lambda client: s4_op(client, serial)) + except DeviceError: + self._forget_if_closed(address, session) + raise raise + def _forget_if_closed(self, address: UnitAddress, session: Series4Session) -> None: + if not session.is_open: + self._drop(address.key, session) + def _session_for(self, address: UnitAddress, serial: str) -> Series4Session: with self._sessions_guard: session = self._sessions.get(address.key) diff --git a/tests/test_device_access.py b/tests/test_device_access.py index c11e9dc..8105c09 100644 --- a/tests/test_device_access.py +++ b/tests/test_device_access.py @@ -13,7 +13,10 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from device_access_fakes import FakeMiniMateClient, FakeMicromateClient # noqa: E402 from sfm.device_access.access import DeviceAccess # noqa: E402 -from sfm.device_access.errors import BadRequest, CallHomeInProgress, UnitBusy # noqa: E402 +import micromate.protocol as mm_proto # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + BadRequest, CallHomeInProgress, ConnectFailed, UnitBusy, WrongUnit, +) from sfm.device_access.models import UnitAddress # noqa: E402 from sfm.device_access.s4 import RingDetected # noqa: E402 @@ -115,6 +118,40 @@ def test_hang_up_closes_a_held_line(): assert da.hang_up(ADDR) is False # nothing left to hang up +def test_a_peer_dropped_line_that_still_reads_open_is_retried_once(): + first, second = FakeMicromateClient(), FakeMicromateClient() + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + first.fail = [mm_proto.TimeoutError("quiet")] # _open untouched: looks open + st = da.status(ADDR, "UM20147") + assert st.series == 4 and first.closed == 1 and second.opened == 1 + + +def test_a_failed_fresh_call_up_is_not_retried(): + da = access(s4=[FakeMicromateClient(open_error=ConnectionRefusedError("no"))]) + with pytest.raises(ConnectFailed): + da.status(ADDR, "UM20147") # a 2nd attempt would pop an empty queue + + +def test_a_ring_on_a_held_line_is_not_retried(): + first, second = FakeMicromateClient(), FakeMicromateClient() + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + first.fail = [RingDetected("RADIO RING")] + with pytest.raises(CallHomeInProgress): + da.status(ADDR, "UM20147") + assert second.opened == 0 + + +def test_series3_beside_a_held_series4_line_is_refused_without_io(): + micro, mini = FakeMicromateClient(), FakeMiniMateClient() + da = access(s3=[mini], s4=[micro]) + da.status(ADDR, "UM20147") + with pytest.raises(WrongUnit): + da.status(ADDR, "BE18193") + assert mini.opened == 0 and micro.closed == 0 and micro.is_open() + + # ── the reaper ──────────────────────────────────────────────────────────────── def test_tick_listens_then_keeps_alive_then_hangs_up_when_idle(): -- 2.54.1 From e7a5a3cce1ac9398e81870df0a51e51381ebeed5 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:26:16 -0400 Subject: [PATCH 018/223] feat(sfm): serial-named /device/info, /status, /settings and /hangup for both series With serial: one contract for Series 3 and 4 through sfm.device_access. Without it: the legacy Series-3 path, unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/server.py | 91 +++++++++++++++++++++++++++-- tests/test_server_device_access.py | 92 ++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 tests/test_server_device_access.py diff --git a/sfm/server.py b/sfm/server.py index eeeae73..d230aae 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -13,6 +13,14 @@ GET /device/info POLL + serial number + full config read GET /device/events Download all stored events (headers + peak values) POST /device/connect Explicit connect/identify (same as /device/info) GET /device/event/{idx} Single event by index (header + waveform record) +GET /device/settings Recording settings (requires serial) +POST /device/hangup Hang up a held Series-4 line + +`serial` on /device/info, /device/connect, /device/monitor/status and +/device/settings names the unit (UM... = Series 4, BE.../BA... = Series 3) and +returns the shared model. Without it, the legacy Series-3 behaviour is +unchanged. Series-4 lines are held open between requests and hung up after +5 idle minutes, on POST /device/hangup, or the moment the unit calls home. Transport query params (supply one set): Serial (direct RS-232 cable): @@ -74,6 +82,8 @@ from sfm.database import SeismoDb from sfm.live_cache import LiveCache as _LiveCache from sfm.waveform_store import WaveformStore from sfm import db_snapshot +import dataclasses +from sfm.device_access import DeviceAccess, DeviceError, UnitAddress logging.basicConfig( level=logging.INFO, @@ -340,6 +350,38 @@ def _run_with_retry(fn, *, is_tcp: bool): return fn() # let any second failure propagate normally +# ── Device access (serial-named requests) ───────────────────────────────────── +# A request that names the unit by `serial` goes through sfm.device_access: +# same contract for Series 3 and 4. Without `serial`, handlers run their +# legacy Series-3 path unchanged (spec 2026-10-20). + +_device_access_instance: Optional[DeviceAccess] = None + + +def _device_access() -> DeviceAccess: + global _device_access_instance + if _device_access_instance is None: + _device_access_instance = DeviceAccess() + return _device_access_instance + + +def _unit_address(port: Optional[str], baud: Optional[int], host: Optional[str], + tcp_port: int) -> UnitAddress: + return UnitAddress(host=host, tcp_port=tcp_port if host else None, + port=None if host else port, baud=baud) + + +def _via_device_access(fn) -> dict: + try: + result = fn() + except DeviceError as exc: + raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc + return dataclasses.asdict(result) if dataclasses.is_dataclass(result) else result + + +_SERIAL_DOC = "Unit serial -- UM... (Series 4) or BE.../BA... (Series 3). Returns the shared model." + + # ── Helpers ──────────────────────────────────────────────────────────────────── def _backfill_events(events: list, info: "DeviceInfo") -> None: @@ -404,10 +446,11 @@ def event_browser(): @app.get("/device/info") def device_info( port: Optional[str] = Query(None, description="Serial port (e.g. COM5, /dev/ttyUSB0)"), - baud: int = Query(38400, description="Serial baud rate (default 38400)"), + baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay (e.g. 203.0.113.5)"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), force: bool = Query(False, description="Bypass cache and re-read from device"), + serial: Optional[str] = Query(None, description=_SERIAL_DOC), ) -> dict: """ Connect to the device, perform the POLL startup handshake, and return @@ -421,6 +464,10 @@ def device_info( and re-read directly from the device (e.g. after a config push). The cache is also automatically invalidated after POST /device/config. """ + if serial: + return _via_device_access( + lambda: _device_access().identify(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud log.info("GET /device/info port=%s host=%s tcp_port=%d force=%s", port, host, tcp_port, force) cache = get_cache() @@ -459,15 +506,20 @@ def device_info( @app.post("/device/connect") def device_connect( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), - baud: int = Query(38400, description="Serial baud rate"), + baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), + serial: Optional[str] = Query(None, description=_SERIAL_DOC), ) -> dict: """ Connect to the device and return identity. POST variant for terra-view compatibility with the SLMM proxy pattern. """ - return device_info(port=port, baud=baud, host=host, tcp_port=tcp_port) + # force=True PRESERVES today's behaviour: the old call omitted `force`, so it + # received FastAPI's Query(False) object, which is truthy -- /device/connect + # has always bypassed the cache. Passing False here would quietly change that. + return device_info(port=port, baud=baud, host=host, tcp_port=tcp_port, + force=True, serial=serial) @app.get("/device/events") @@ -1099,10 +1151,11 @@ def device_config_project( @app.get("/device/monitor/status") def device_monitor_status( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), - baud: int = Query(38400, description="Serial baud rate"), + baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), force: bool = Query(False, description="Bypass cache and re-read from device"), + serial: Optional[str] = Query(None, description=_SERIAL_DOC), ) -> dict: """ Read monitoring status from the device. @@ -1118,6 +1171,10 @@ def device_monitor_status( **Caching**: status is cached for 30 seconds to reduce cellular polling overhead. Pass *force=true* to bypass the cache for an immediate fresh read. """ + if serial: + return _via_device_access( + lambda: _device_access().status(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud cache = get_cache() conn_key = SFMCache.make_conn_key(host, tcp_port, port, baud) @@ -1160,6 +1217,32 @@ def device_monitor_status( return result +@app.get("/device/settings") +def device_settings( + serial: str = Query(..., description=_SERIAL_DOC), + port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"), + baud: Optional[int] = Query(None, description="Serial baud (default by series)"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """The unit's recording settings, in the shared shape for either series.""" + return _via_device_access( + lambda: _device_access().settings(_unit_address(port, baud, host, tcp_port), serial)) + + +@app.post("/device/hangup") +def device_hangup( + port: Optional[str] = Query(None, description="Serial port"), + baud: Optional[int] = Query(None, description="Serial baud"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """Hang up a held line now instead of waiting for the idle timeout. + `hung_up` is false if nothing was being held.""" + return _via_device_access( + lambda: {"hung_up": _device_access().hang_up(_unit_address(port, baud, host, tcp_port))}) + + @app.get("/device/events/storage_range") def device_events_storage_range( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py new file mode 100644 index 0000000..22836c1 --- /dev/null +++ b/tests/test_server_device_access.py @@ -0,0 +1,92 @@ +"""Handlers called directly -- every parameter passed explicitly, because +FastAPI Query() defaults are FieldInfo objects, not values.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from fastapi import HTTPException # noqa: E402 + +import sfm.server as srv # noqa: E402 +from device_access_fakes import FakeMiniMateClient, FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + BadRequest, CallHomeInProgress, ConnectFailed, MalformedReply, NoAnswer, + NotSupported, UnitBusy, WrongUnit, +) + +TCP = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034) + + +@pytest.fixture +def da(monkeypatch): + s3q = [FakeMiniMateClient() for _ in range(5)] + s4q = [FakeMicromateClient() for _ in range(5)] + access = DeviceAccess(s3_client_factory=lambda a: s3q.pop(0), + s4_client_factory=lambda a: s4q.pop(0), start_reaper=False) + monkeypatch.setattr(srv, "_device_access_instance", access) + return access + + +def test_info_with_a_serial_returns_the_shared_model(da): + out = srv.device_info(force=False, serial="UM20147", **TCP) + assert out["series"] == 4 and out["serial"] == "UM20147" + assert set(out) == {"serial", "series", "model", "firmware", "monitoring", "active_setup", "detail"} + + +def test_connect_passes_the_serial_through(da): + out = srv.device_connect(serial="BE18193", **TCP) + assert out["series"] == 3 + + +def test_status_and_settings_with_a_serial(da): + assert srv.device_monitor_status(force=False, serial="UM20147", **TCP)["event_count"] == 5 + assert srv.device_settings(serial="UM20147", **TCP)["record_mode"] == "Histogram Combo" + + +def test_hangup(da): + srv.device_monitor_status(force=False, serial="UM20147", **TCP) + assert srv.device_hangup(**TCP) == {"hung_up": True} + + +@pytest.mark.parametrize( + "exc, status", + [(BadRequest("x"), 422), (NotSupported("x"), 501), (WrongUnit("x"), 409), + (UnitBusy("x"), 423), (ConnectFailed("x"), 503), (CallHomeInProgress("x"), 503), + (NoAnswer("x"), 504), (MalformedReply("x"), 502)], +) +def test_typed_errors_become_their_http_status(monkeypatch, exc, status): + class Raising: + def identify(self, address, serial): + raise exc + monkeypatch.setattr(srv, "_device_access_instance", Raising()) + with pytest.raises(HTTPException) as ei: + srv.device_info(force=False, serial="UM20147", **TCP) + assert ei.value.status_code == status + + +def test_a_missing_address_is_a_422(da): + with pytest.raises(HTTPException) as ei: + srv.device_settings(serial="UM20147", port=None, baud=None, host=None, tcp_port=9034) + assert ei.value.status_code == 422 + + +def test_without_a_serial_the_legacy_path_runs_unchanged(monkeypatch): + """No serial: today's Series-3 code path, today's response shape. + DeviceAccess must not be touched.""" + class Untouchable: + def __getattr__(self, name): + raise AssertionError("DeviceAccess used on the legacy path") + + class Cache: + def get_device_info(self, key): + return {"serial": "BE18193", "firmware_version": "S338.17"} + + monkeypatch.setattr(srv, "_device_access_instance", Untouchable()) + monkeypatch.setattr(srv, "get_cache", lambda: Cache()) + out = srv.device_info(force=False, serial=None, **TCP) + assert out == {"serial": "BE18193", "firmware_version": "S338.17", "_cached": True} -- 2.54.1 From 6dd34f8fd7db387a3c98359e8dd6ac4f458d487a Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:27:56 -0400 Subject: [PATCH 019/223] docs(claude): SFM speaks Series 4 by serial -- phase 1a done, bench-checked on UM20147 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d95e201..5295dd1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,8 +97,13 @@ Read this first when picking the project back up. — `micromate/setup_block.py`, measured fields only, checksum-verified, 69 tests on 15 real fixtures (`tests/fixtures/micromate-setup/`, force- added). `bridges/mm_client_check.py` prints it; Brian matched every line - against UM20147's screen. Not yet in SFM — nothing there uses the - Micromate client. + against UM20147's screen. + ✅ **SFM speaks Series 4 by serial (phase 1a, 2026-10-20):** `/device/info`, + `/device/monitor/status` and `/device/settings` take `serial` and return one + 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). - **🔑 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, -- 2.54.1 From 82b91835fb1fc4ab01257ef689ed56a28c71d464 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:44:35 -0400 Subject: [PATCH 020/223] fix(sfm): one guard in front of every /device route -- UM serials 501 off the serial-aware routes, held lines 409 serial-less requests Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 8 +++++ sfm/server.py | 47 +++++++++++++++++++++++++++++- tests/test_device_access.py | 10 +++++++ tests/test_server_device_access.py | 45 ++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 1 deletion(-) diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index aaaf858..0f3f39b 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -56,6 +56,14 @@ class DeviceAccess: def settings(self, address: UnitAddress, serial: str) -> UnitSettings: return self._dispatch(address, serial, self._s3.settings, s4_settings) + def held_serial(self, address: UnitAddress) -> Optional[str]: + """Serial of the OPEN held Series-4 line at this address, else None. No I/O.""" + with self._sessions_guard: + session = self._sessions.get(address.key) + if session is not None and session.is_open: + return session.serial + return None + def hang_up(self, address: UnitAddress) -> bool: with self._locks.hold(address.key): with self._sessions_guard: diff --git a/sfm/server.py b/sfm/server.py index d230aae..8c10b27 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -50,7 +50,7 @@ import tempfile import threading import time from pathlib import Path -from typing import Optional +from typing import Mapping, Optional # FastAPI / Pydantic try: @@ -84,6 +84,8 @@ from sfm.waveform_store import WaveformStore from sfm import db_snapshot import dataclasses from sfm.device_access import DeviceAccess, DeviceError, UnitAddress +from sfm.device_access.errors import BadRequest +from sfm.device_access.series import normalise_serial logging.basicConfig( level=logging.INFO, @@ -379,6 +381,49 @@ def _via_device_access(fn) -> dict: return dataclasses.asdict(result) if dataclasses.is_dataclass(result) else result +_SERIAL_AWARE_PATHS = frozenset({ + "/device/info", "/device/connect", "/device/monitor/status", "/device/settings", +}) + + +def _device_guard(path: str, query: Mapping[str, str]) -> Optional[tuple]: + """Refuse a /device/* request that would reach the wrong series' code. + + FastAPI drops query params a route does not declare, so `?serial=UM...` on + a Series-3 route would silently run Series-3 bytes against a Micromate + (0xA2 is CONFIRM ERASE there). Returns (status, detail) to refuse, or None. + /device/hangup is always allowed: it must always be able to release a line. + """ + if not path.startswith("/device/") or path == "/device/hangup": + return None + serial = normalise_serial(query.get("serial") or "") + if serial: + if serial.startswith("UM") and path not in _SERIAL_AWARE_PATHS: + return 501, f"not supported for Series 4 yet: {path}" + return None + if not (query.get("host") or query.get("port")): + return None + try: + tcp_port = int(query.get("tcp_port") or DEFAULT_TCP_PORT) + baud = int(query["baud"]) if query.get("baud") else None + addr = _unit_address(query.get("port") or None, baud, query.get("host") or None, tcp_port) + except (BadRequest, ValueError): + return None + held = _device_access().held_serial(addr) + if held is not None: + return 409, (f"a Series-4 line to {held} is held at {addr.key}; " + "POST /device/hangup first") + return None + + +@app.middleware("http") +async def _device_guard_middleware(request, call_next): + refusal = _device_guard(request.url.path, request.query_params) + if refusal is not None: + return JSONResponse(status_code=refusal[0], content={"detail": refusal[1]}) + return await call_next(request) + + _SERIAL_DOC = "Unit serial -- UM... (Series 4) or BE.../BA... (Series 3). Returns the shared model." diff --git a/tests/test_device_access.py b/tests/test_device_access.py index 8105c09..1e1c760 100644 --- a/tests/test_device_access.py +++ b/tests/test_device_access.py @@ -221,3 +221,13 @@ def test_both_series_return_the_same_model_with_the_same_fields(op): a, b = getattr(s3, name), getattr(s4, name) if a is not None and b is not None and name != "detail": assert type(a) is type(b) or {type(a), type(b)} <= {int, float}, name + + +def test_held_serial_reports_an_open_line_only(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + assert da.held_serial(ADDR) is None + da.status(ADDR, "UM20147") + assert da.held_serial(ADDR) == "UM20147" + da.hang_up(ADDR) + assert da.held_serial(ADDR) is None diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 22836c1..e7eb2e3 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -90,3 +90,48 @@ def test_without_a_serial_the_legacy_path_runs_unchanged(monkeypatch): monkeypatch.setattr(srv, "get_cache", lambda: Cache()) out = srv.device_info(force=False, serial=None, **TCP) assert out == {"serial": "BE18193", "firmware_version": "S338.17", "_cached": True} + + +# ── the /device/* guard ─────────────────────────────────────────────────────── + +from sfm.device_access.models import UnitAddress # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) +Q_TCP = {"host": "10.0.0.5", "tcp_port": "9034"} + + +@pytest.mark.parametrize("path", ["/device/events/erase", "/device/monitor/stop", "/device/config"]) +def test_guard_refuses_a_um_serial_on_unsupported_routes_with_501(path): + out = srv._device_guard(path, {"serial": "um20147", **Q_TCP}) + assert out is not None and out[0] == 501 and path in out[1] + + +def test_guard_lets_a_series3_serial_through_on_legacy_routes(): + assert srv._device_guard("/device/events/erase", {"serial": "BE18193", **Q_TCP}) is None + + +@pytest.mark.parametrize("path", ["/device/info", "/device/connect", + "/device/monitor/status", "/device/settings", + "/device/hangup"]) +def test_guard_allows_um_serial_on_serial_aware_routes_and_hangup(path): + assert srv._device_guard(path, {"serial": "UM20147", **Q_TCP}) is None + + +def test_guard_refuses_serialless_requests_at_a_held_address_with_409(da): + da.status(ADDR, "UM20147") + out = srv._device_guard("/device/monitor/stop", dict(Q_TCP)) + assert out is not None and out[0] == 409 + assert "UM20147" in out[1] and "tcp:10.0.0.5:9034" in out[1] and "hangup" in out[1] + + +def test_guard_allows_serialless_requests_at_an_unheld_address(da): + assert srv._device_guard("/device/monitor/stop", dict(Q_TCP)) is None + assert srv._device_guard("/device/monitor/stop", {"host": "10.9.9.9"}) is None + + +def test_guard_ignores_non_device_paths(da): + assert srv._device_guard("/db/events", {"serial": "UM20147", **Q_TCP}) is None + + +def test_guard_allows_an_unbuildable_address_through(da): + assert srv._device_guard("/device/monitor/stop", {}) is None -- 2.54.1 From 52ada0215c0480cf5dbe25849767b69f82a70cb0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:45:10 -0400 Subject: [PATCH 021/223] fix(sfm): RADIO RING detection ignores bytes inside frames Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s4.py | 33 +++++++++++--- tests/test_device_access_s4.py | 80 ++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 7 deletions(-) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index a099733..51c1f1e 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -29,12 +29,21 @@ class RingDetected(Exception): class RingWatchTransport(BaseTransport): - """Passes bytes through; raises RingDetected the moment RADIO RING appears, - including when it is split across two reads.""" + """Passes bytes through; raises RingDetected the moment RADIO RING appears + OUTSIDE a frame, including when it is split across two reads. + + Inside a frame the bytes are data: the 0x2C call-home config block's dial + string is literally "RADIO RING". A frame runs from STX to an unescaped + ETX; inside it DLE escapes the next byte. + """ + + _STX, _ETX, _DLE = 0x02, 0x03, 0x10 def __init__(self, inner: BaseTransport) -> None: self._inner = inner self._tail = b"" + self._in_frame = False + self._escaped = False def connect(self) -> None: self._inner.connect() @@ -51,12 +60,22 @@ class RingWatchTransport(BaseTransport): def read(self, n: int) -> bytes: data = self._inner.read(n) - if data: - window = self._tail + data - if RING in window: + for b in data: + if self._in_frame: + if self._escaped: + self._escaped = False + elif b == self._DLE: + self._escaped = True + elif b == self._ETX: + self._in_frame = False + elif b == self._STX: + self._in_frame = True self._tail = b"" - raise RingDetected("RADIO RING") - self._tail = window[-(len(RING) - 1):] + else: + self._tail = (self._tail + bytes([b]))[-len(RING):] + if self._tail == RING: + self._tail = b"" + raise RingDetected("RADIO RING") return data diff --git a/tests/test_device_access_s4.py b/tests/test_device_access_s4.py index 5617e5a..5b2b3ec 100644 --- a/tests/test_device_access_s4.py +++ b/tests/test_device_access_s4.py @@ -79,6 +79,86 @@ def test_a_ring_split_across_reads_still_raises(): t.read(4096) +def _real_frame(payload_data: bytes, sub: int = 0xA4) -> bytes: + from micromate.framing import ETX, STX, checksum, stuff + payload = bytes([0x00, 0xC5, sub, 0x00, 0x00]) + payload_data + return bytes([STX]) + stuff(payload + bytes([checksum(payload)])) + bytes([ETX]) + + +def test_a_ring_inside_a_frame_is_data_not_a_call_home(): + # The 0x2C call-home config block's dial string is literally "RADIO RING". + wire = _real_frame(b"\x00" * 6 + b"RADIO RING" + b"\x00" * 4) + t = RingWatchTransport(ScriptedInner([wire])) + assert t.read(4096) == wire + + +def test_a_ring_inside_a_frame_split_across_reads_is_still_data(): + wire = _real_frame(b"xxRADIO RINGyy") + cut = wire.index(b"RADIO R") + 7 + t = RingWatchTransport(ScriptedInner([wire[:cut], wire[cut:]])) + assert t.read(4096) == wire[:cut] + assert t.read(4096) == wire[cut:] + + +def test_a_ring_between_frames_still_raises(): + t = RingWatchTransport(ScriptedInner([_real_frame(b"abc") + b"\r\nRADIO RING\r\n"])) + with pytest.raises(RingDetected): + t.read(4096) + + +def test_a_ring_split_across_reads_after_a_frame_still_raises(): + t = RingWatchTransport(ScriptedInner([_real_frame(b"abc") + b"\r\nRADIO R", b"ING\r\n"])) + t.read(4096) + with pytest.raises(RingDetected): + t.read(4096) + + +def test_a_ring_arriving_right_after_a_frame_ends_still_raises(): + t = RingWatchTransport(ScriptedInner([_real_frame(b"abc"), b"RADIO RING"])) + t.read(4096) + with pytest.raises(RingDetected): + t.read(4096) + + +def test_an_escaped_etx_inside_a_frame_does_not_end_it(): + # DLE ETX inside the payload is literal data; the ring after it is still inside. + wire = b"\x02" + b"ab\x10\x03RADIO RINGcd" + b"\x03" + t = RingWatchTransport(ScriptedInner([wire])) + assert t.read(4096) == wire + + +def test_a_ring_that_follows_a_frame_with_an_escaped_etx_still_raises(): + wire = b"\x02" + b"ab\x10\x03cd" + b"\x03" + b"RADIO RING" + t = RingWatchTransport(ScriptedInner([wire])) + with pytest.raises(RingDetected): + t.read(4096) + + +def _real_chain_client(chunks): + from micromate.client import MicromateClient + inner = ScriptedInner(chunks) + return MicromateClient(RingWatchTransport(inner), recv_timeout=0.5), inner + + +def test_real_chain_a_response_carrying_a_ring_in_its_payload_succeeds(): + client, _ = _real_chain_client([_real_frame(b"\x30" + b"\x00" * 8 + b"RADIO RING")]) + client.open() + frame = client.protocol.poll() + assert b"RADIO RING" in frame.data + + +def test_real_chain_an_unsolicited_ring_before_the_response_hangs_up(): + from types import SimpleNamespace + + client, inner = _real_chain_client([b"\r\nRADIO RING\r\n", _real_frame(b"\x30" + b"\x00" * 8)]) + # Only the identity read is stubbed; open/close/protocol/transport are the real chain. + client.connect = lambda: SimpleNamespace(serial="UM20147") + s = Series4Session(ADDR, "UM20147", lambda address: client, clock=Clock()) + with pytest.raises(CallHomeInProgress): + s.run(lambda c: c.protocol.poll()) + assert not s.is_open and not inner.is_connected + + def test_the_wrapper_keeps_is_connected_a_property(): inner = ScriptedInner([]) t = RingWatchTransport(inner) -- 2.54.1 From aa79e996c5831eedf4ad4a24ee83389e82cdbfca Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:45:17 -0400 Subject: [PATCH 022/223] fix(sfm): construct the DeviceAccess singleton at import Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sfm/server.py b/sfm/server.py index 8c10b27..305d4a5 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -357,13 +357,11 @@ def _run_with_retry(fn, *, is_tcp: bool): # same contract for Series 3 and 4. Without `serial`, handlers run their # legacy Series-3 path unchanged (spec 2026-10-20). -_device_access_instance: Optional[DeviceAccess] = None +# Constructing it does no I/O and starts no thread until a Series-4 session exists. +_device_access_instance: DeviceAccess = DeviceAccess() def _device_access() -> DeviceAccess: - global _device_access_instance - if _device_access_instance is None: - _device_access_instance = DeviceAccess() return _device_access_instance -- 2.54.1 From d393a149f81ae104733f2d06c64c09ac48a1bb48 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:45:17 -0400 Subject: [PATCH 023/223] fix(sfm): a different UM serial at a held address is refused (409), not swapped Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 6 +++++- tests/test_device_access.py | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index 0f3f39b..4dcb3f0 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -121,7 +121,11 @@ class DeviceAccess: with self._sessions_guard: session = self._sessions.get(address.key) if session is not None and session.serial != serial: - session.hang_up() + if session.is_open: + raise WrongUnit( + f"a Series-4 line to {session.serial} is held at {address.key}; " + f"{serial} cannot be reached there -- POST /device/hangup first " + "if the modem has moved") session = None if session is None: session = Series4Session(address, serial, self._s4_factory, clock=self._clock) diff --git a/tests/test_device_access.py b/tests/test_device_access.py index 1e1c760..1a1de7a 100644 --- a/tests/test_device_access.py +++ b/tests/test_device_access.py @@ -79,12 +79,23 @@ def test_a_dropped_line_is_called_up_again_quietly(): assert st.series == 4 and second.opened == 1 -def test_a_different_serial_at_the_same_address_hangs_up_the_old_line(): +def test_a_different_serial_at_a_held_address_is_refused_without_io(): first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947") da = access(s4=[first, second]) da.status(ADDR, "UM20147") + with pytest.raises(WrongUnit, match="hangup"): + da.status(ADDR, "UM12947") + assert first.closed == 0 and second.opened == 0 + assert da.held_serial(ADDR) == "UM20147" + + +def test_a_different_serial_replaces_a_session_that_is_no_longer_open(): + first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947") + da = access(s4=[first, second]) + da.status(ADDR, "UM20147") + first.close() da.status(ADDR, "UM12947") - assert first.closed == 1 and second.opened == 1 + assert second.opened == 1 def test_a_busy_unit_answers_423_without_a_second_connection(): -- 2.54.1 From 080e8f47044050d38da264d912de6408d3c762a4 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:45:33 -0400 Subject: [PATCH 024/223] docs: serial parameter, settings/hangup endpoints, single-worker rule, cool-down prerequisite for 1c Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 7 +++++++ README.md | 12 ++++++++++++ .../specs/2026-10-20-sfm-series4-parity-design.md | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 5295dd1..29138f0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1410,8 +1410,15 @@ 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 POST /device/monitor/stop?host=1.2.3.4&tcp_port=9034 ← stop recording +GET /device/settings?serial=UM20147&host=1.2.3.4&tcp_port=9034 ← shared-model settings, either series +POST /device/hangup?host=1.2.3.4&tcp_port=9034 ← release a held Series-4 line ``` +`serial=` (UM = Series 4, BE/BA = Series 3) on `/device/info`, `/connect`, +`/monitor/status`, `/settings` returns the shared model, uncached. A `UM` serial on any +other `/device/*` route is 501; serial-less requests at a held Series-4 address are 409. +SFM must run a single uvicorn worker (locks and held lines are per process). + Server retries once on `ProtocolError` for TCP connections (handles cold-boot timing). ### DB read endpoints (query seismo_relay.db written by ach_server.py) diff --git a/README.md b/README.md index 83a897c..cbb56a1 100644 --- a/README.md +++ b/README.md @@ -177,10 +177,22 @@ via a thread-safe `_LiveCache` (plain Python dict + `threading.Lock`): | `POST` | `/device/monitor/start` | Sends SUB 0x96; immediately evicts status cache | | `POST` | `/device/monitor/stop` | Sends SUB 0x97; immediately evicts status cache | | `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}` | **Cache bypass** — All cached endpoints accept `?force=true` to skip the cache and force a fresh read from the device. +**Serial-named requests (Series 3 and 4)** — `/device/info`, `/device/connect`, +`/device/monitor/status` and `/device/settings` accept `serial` (`UM...` = Series 4 +Micromate, `BE...`/`BA...` = Series 3 MiniMate Plus) and return one shared model +for either series. Serial-named requests are **not cached** and ignore `force`. +Without `serial` the legacy Series-3 behaviour is unchanged. Any other `/device/*` +route given a `UM` serial answers **501** ("not supported for Series 4 yet"), and a +serial-less request at an address holding a Series-4 line answers **409** (use +`POST /device/hangup` first). Series-4 lines are held open between requests, so +SFM must run a **single uvicorn worker**: locks and held lines are per process. + **Cache stats** — `GET /cache/stats` returns hit/miss counts and TTL info; `DELETE /cache/device` clears the device cache immediately. diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 1c4bb69..0e74831 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -332,6 +332,12 @@ Each safety piece arrives with its first real use, so nothing sits untested. - 1b. Event list and download for both series (rows 4–5). - 1c. **The webapp:** serial + address, and the same read panels for both series. + - **HARD PREREQUISITE:** before any poller or webapp sends `serial`, add a + per-address cool-down after a RADIO RING: call-ups to that address answer + 503 + `Retry-After` until it expires, and `POST /device/hangup` clears it. + The length must come from the unit's measured call-home retry timing (a + bench test). Without it a poller can re-grab the modem's single TCP + session through every retry, and the call never reaches THOR. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. 3. **Start/stop monitoring** (row 7): the first live write, at the bench. -- 2.54.1 From 278921796a5f7adf032039980d903fc18e1d62f0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:58:57 -0400 Subject: [PATCH 025/223] fix(sfm): any request taking the legacy path is refused beside a held line The /device guard let every non-UM serial through before its held-line check. FastAPI drops an undeclared `serial`, so `?serial=BE18193` on a legacy route still ran Series-3 code at an address holding a Series-4 line -- the hole the guard exists to close. Serial-aware routes go straight to DeviceAccess, which refuses that case itself; everything else is checked. baud is no longer parsed (it is not in the address key, and pydantic's coercion made "38400.0" a second way past). Also, from the same review: - RingWatchTransport clears its frame state on every write, so a stray STX on an idle line cannot hide the ring that answers the next request. - Series4Session.is_open reads _client once; held_serial() calls it without the unit lock, and a concurrent hang-up between two reads was an AttributeError (a 500). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 3 ++- README.md | 7 ++++--- sfm/device_access/s4.py | 6 +++++- sfm/server.py | 14 ++++++++------ tests/test_device_access_s4.py | 30 ++++++++++++++++++++++++++++++ tests/test_server_device_access.py | 22 ++++++++++++++++++++++ 6 files changed, 71 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 29138f0..8676eb9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1416,7 +1416,8 @@ POST /device/hangup?host=1.2.3.4&tcp_port=9034 ← release a held Serie `serial=` (UM = Series 4, BE/BA = Series 3) on `/device/info`, `/connect`, `/monitor/status`, `/settings` returns the shared model, uncached. A `UM` serial on any -other `/device/*` route is 501; serial-less requests at a held Series-4 address are 409. +other `/device/*` route is 501; any request taking the legacy Series-3 path at a held +Series-4 address is 409. SFM must run a single uvicorn worker (locks and held lines are per process). Server retries once on `ProtocolError` for TCP connections (handles cold-boot timing). diff --git a/README.md b/README.md index cbb56a1..1f76fc8 100644 --- a/README.md +++ b/README.md @@ -188,9 +188,10 @@ force a fresh read from the device. Micromate, `BE...`/`BA...` = Series 3 MiniMate Plus) and return one shared model for either series. Serial-named requests are **not cached** and ignore `force`. Without `serial` the legacy Series-3 behaviour is unchanged. Any other `/device/*` -route given a `UM` serial answers **501** ("not supported for Series 4 yet"), and a -serial-less request at an address holding a Series-4 line answers **409** (use -`POST /device/hangup` first). Series-4 lines are held open between requests, so +route given a `UM` serial answers **501** ("not supported for Series 4 yet"), and any +request that takes the legacy Series-3 path (no `serial`, or a `BE`/`BA` serial on a +route that does not take one) at an address holding a Series-4 line answers **409** +(use `POST /device/hangup` first). Series-4 lines are held open between requests, so SFM must run a **single uvicorn worker**: locks and held lines are per process. **Cache stats** — `GET /cache/stats` returns hit/miss counts and TTL info; `DELETE /cache/device` diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 51c1f1e..018243f 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -56,6 +56,9 @@ class RingWatchTransport(BaseTransport): return self._inner.is_connected def write(self, data: bytes) -> None: + # A request starts a new exchange (MicromateProtocol resets its parser + # here too), so a stray STX on an idle line cannot hide the next ring. + self._in_frame = self._escaped = False self._inner.write(data) def read(self, n: int) -> bytes: @@ -121,7 +124,8 @@ class Series4Session: @property def is_open(self) -> bool: - return self._client is not None and self._client.is_open() + client = self._client # one read: held_serial() calls this without the unit lock + return client is not None and client.is_open() def call_up(self): client = self._factory(self.address) diff --git a/sfm/server.py b/sfm/server.py index 305d4a5..d2ebb01 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -395,16 +395,18 @@ def _device_guard(path: str, query: Mapping[str, str]) -> Optional[tuple]: if not path.startswith("/device/") or path == "/device/hangup": return None serial = normalise_serial(query.get("serial") or "") - if serial: - if serial.startswith("UM") and path not in _SERIAL_AWARE_PATHS: - return 501, f"not supported for Series 4 yet: {path}" - return None + if serial and path in _SERIAL_AWARE_PATHS: + return None # DeviceAccess routes by series and checks held lines itself + if serial.startswith("UM"): + return 501, f"not supported for Series 4 yet: {path}" + # Everything else runs the legacy Series-3 handler -- whatever serial it + # carried, FastAPI drops it -- so it must not reach a held Series-4 line. if not (query.get("host") or query.get("port")): return None try: tcp_port = int(query.get("tcp_port") or DEFAULT_TCP_PORT) - baud = int(query["baud"]) if query.get("baud") else None - addr = _unit_address(query.get("port") or None, baud, query.get("host") or None, tcp_port) + # baud is not part of the address key, so it is not parsed here. + addr = _unit_address(query.get("port") or None, None, query.get("host") or None, tcp_port) except (BadRequest, ValueError): return None held = _device_access().held_serial(addr) diff --git a/tests/test_device_access_s4.py b/tests/test_device_access_s4.py index 5b2b3ec..2116fc2 100644 --- a/tests/test_device_access_s4.py +++ b/tests/test_device_access_s4.py @@ -290,3 +290,33 @@ def test_s4_settings_maps_the_decoded_setup(): assert s.detail["mic_type"] == "linear" assert s.detail["mic_trigger_db"] == pytest.approx(131.0, abs=0.01) assert s.detail["geo_trigger_ips_per_channel"] == pytest.approx([0.5, 0.5, 0.5], abs=1e-6) + + +def test_a_new_request_clears_frame_state_left_by_a_stray_stx(): + # A stray STX on an idle line would otherwise hide the ring that answers the + # next request. MicromateProtocol resets its own parser at every request too. + t = RingWatchTransport(ScriptedInner([b"\x02stray", b"\r\nRADIO RING\r\n"])) + t.connect() + t.read(64) + t.write(b"x") + with pytest.raises(RingDetected): + t.read(64) + + +def test_is_open_survives_a_hang_up_between_its_two_reads(): + # held_serial() calls is_open without the unit lock; a concurrent hang-up can + # clear _client between the None check and the method call. + class Racy(Series4Session): + _reads = 0 + + @property + def _client(self): + Racy._reads += 1 + return object.__new__(type("C", (), {"is_open": lambda s: True})) if Racy._reads == 1 else None + + @_client.setter + def _client(self, value): + pass + + s = Racy(ADDR, "UM20147", client_factory=lambda a: None) + assert s.is_open in (True, False) diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index e7eb2e3..2f600a7 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -135,3 +135,25 @@ def test_guard_ignores_non_device_paths(da): def test_guard_allows_an_unbuildable_address_through(da): assert srv._device_guard("/device/monitor/stop", {}) is None + + +@pytest.mark.parametrize("serial", ["BE18193", "BA1", "nonsense"]) +def test_guard_refuses_any_non_um_serial_on_a_legacy_route_at_a_held_address(da, serial): + # FastAPI drops the undeclared serial, so the legacy Series-3 handler would run + # at the held Series-4 address -- the same hole as a serial-less request. + da.status(ADDR, "UM20147") + out = srv._device_guard("/device/events/erase", {"serial": serial, **Q_TCP}) + assert out is not None and out[0] == 409 and "UM20147" in out[1] + + +def test_guard_leaves_serial_aware_routes_to_device_access_at_a_held_address(da): + # DeviceAccess routes by series and refuses a Series-3 serial beside a held line itself. + da.status(ADDR, "UM20147") + assert srv._device_guard("/device/info", {"serial": "BE18193", **Q_TCP}) is None + + +def test_guard_ignores_an_unparseable_baud_when_checking_for_a_held_line(da): + # baud is not part of the address key; pydantic would coerce "38400.0" and run the handler. + da.status(ADDR, "UM20147") + out = srv._device_guard("/device/monitor/stop", {"baud": "38400.0", **Q_TCP}) + assert out is not None and out[0] == 409 -- 2.54.1 From e1af35e1d00b495681f15df337b7f6d2c6a3cfec Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 01:59:42 -0400 Subject: [PATCH 026/223] docs(spec): park the phase 1a review's minor findings in the spec They were recorded only in the plan's scratch ledger, which is deleted when the plan finishes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 0e74831..bfd5001 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -374,6 +374,40 @@ Each phase is its own implementation plan and its own merge. - `0x08` is named `read_event_index` in `micromate/`; it is the preferences block. +## Left open by the phase 1a review (2026-10-21) + +Minor findings from the whole-branch review, parked here so they outlive the +plan's scratch ledger. None blocks 1a; the phase each one matters to is named. + +- **CORS ordering (1c, if a browser calls SFM directly).** The `/device` guard + middleware is registered after CORS, so it sits outside it: its 409/501 + responses carry no `access-control-allow-origin`, and an OPTIONS preflight to + a guarded URL gets the guard's refusal instead of CORS's 200. Register CORS + last, or let OPTIONS through. Terra-View proxies server-side and is not + affected. +- **Legacy handlers take no unit lock (1c / phase 3).** The guard checks for a + held line and then lets the legacy handler run unlocked; a legacy request + admitted just before a Series-4 call-up at the same address can overlap it. +- **Address keys are not normalised.** `tcp::` is the raw string: + a hostname vs an IP, or `/dev/serial/by-id/...` vs `/dev/ttyACM0`, gets two + locks for one link. +- **A serial-less request to an UNHELD Micromate still runs Series-3 bytes.** + The guard only knows about lines SFM holds. This is the phase-2 opcode + guard's job. +- **`tcp_port` coercion mismatch.** The guard parses with `int()`, pydantic + coerces more loosely (`"9034.0"`), so such a request passes the guard + unchecked. Parse with pydantic's own int coercion, or fail closed. +- **Test gaps.** The middleware wrapper itself is untested (a raw ASGI call + works without httpx); the contract test compares field names of one shared + dataclass, which cannot fail, and does not enforce "a field absent for one + series lives under `detail`". +- **`_ensure_reaper` race.** Two first Series-4 requests at once can start two + reaper threads; harmless because `try_hold` keeps them off each other's units. +- **Held serial lines share `/dev/ttyACM0` silently.** pyserial's open is not + exclusive, so a bench script beside a held line interleaves bytes with the + keep-alive; it looks like a dead unit. Open with `exclusive=True`, or don't + hold serial links. + ## Table 2: to be added later (both series) | area | item | -- 2.54.1 From 89433c1fdb55eb1291b55a3e16fb2a99e65879e3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 15:35:26 -0400 Subject: [PATCH 027/223] docs(spec): every phase lands on this branch; one merge to dev at the end Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../superpowers/specs/2026-10-20-sfm-series4-parity-design.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index bfd5001..b2c8481 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -345,7 +345,9 @@ Each safety piece arrives with its first real use, so nothing sits untested. 4. **Call-home enable/disable** (row 9). 5. **Setup push** (row 10): one field first, then several. -Each phase is its own implementation plan and its own merge. +Each phase is its own implementation plan. **All phases land on +`feat/series4-sfm-parity` and merge to `dev` once, when everything here is +implemented** (Brian, 2026-10-21) — not one merge per phase. --- -- 2.54.1 From 6b4161ddfb99a75fb305c935be4fc595b582e051 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:40:31 -0400 Subject: [PATCH 028/223] docs(spec): phase 1b decisions -- header-only MiniMate list, download stores, event_id Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index b2c8481..0fd2aad 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -329,7 +329,26 @@ Each safety piece arrives with its first real use, so nothing sits untested. sessions with ring safety. Rows 1–5 for **both** series through the same endpoints. **No writes.** Split into three plans: - 1a. The foundation plus identify / status / settings for both series. - - 1b. Event list and download for both series (rows 4–5). + - 1b. Event list and download for both series (rows 4–5). Decided with + Brian 2026-10-21: + - **MiniMate events are listed from their headers** (`0A` + `1E` arm + + `0C` + `1F` browse, no `5A`) instead of downloading every event to list + it, and one event downloads without the ones before it. It reuses the + bypass `skip_waveform_for_events` already takes, so no new command + reaches the wire. 🔶 Unproven on a unit: **a MiniMate bench check is + owed before this branch merges.** The legacy serial-less + `/device/events` keeps its full-download walk. + - **Download = fetch, check, store** in SFM's database, the same as + Series 3's `blastware_file` route, and returns the stored row's id. The + file and waveform are then served by the existing `/db/events/{id}/…` + routes. The database matches on (serial, timestamp), so storing an + event already stored, including one THOR's watcher forwarded, refreshes + the row instead of duplicating it. + - **`event_id` = `::`.** Both series reuse + keys (after an erase, and across Micromates), so a download whose key + now holds a different event fails with 409 instead of fetching it. + - **Micromate downloads walk to the event first** (the only order captured + from THOR), with THOR's 1,024-byte chunks. - 1c. **The webapp:** serial + address, and the same read panels for both series. - **HARD PREREQUISITE:** before any poller or webapp sends `serial`, add a -- 2.54.1 From ff7188a034fd5308e83909fc26655edb1c50278b Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:45:50 -0400 Subject: [PATCH 029/223] docs(plan): SFM device access phase 1b -- events for both series Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-21-sfm-device-access-phase1b.md | 1879 +++++++++++++++++ 1 file changed, 1879 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-21-sfm-device-access-phase1b.md diff --git a/docs/superpowers/plans/2026-10-21-sfm-device-access-phase1b.md b/docs/superpowers/plans/2026-10-21-sfm-device-access-phase1b.md new file mode 100644 index 0000000..e9963a9 --- /dev/null +++ b/docs/superpowers/plans/2026-10-21-sfm-device-access-phase1b.md @@ -0,0 +1,1879 @@ +# SFM device access, phase 1b — events for both series — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** List a unit's events and download one, by serial, through the same contract for a MiniMate (Series 3) and a Micromate (Series 4). A download is stored in SFM's database. + +**Architecture:** Two device-side operations join `DeviceAccess`: `list_events` and `download_event`. Each runs through the existing dispatch: series by serial prefix, per-unit lock, the held Micromate line, typed errors. +- The device side (`sfm/device_access/`) returns a `DownloadedEvent` and stores nothing. +- A new SDM module, `sfm/event_ingest.py`, stores it through the same waveform-store and `insert_events` calls every other ingest path uses. +- MiniMate listing switches from "download every event" to a header-only walk, built from the bypass `get_events()` already has. +- An `event_id` carries serial, key and timestamp, so a stale id fails loudly. + +**Tech Stack:** Python 3, FastAPI, pytest. `minimateplus/` (Series 3), `micromate/` (Series 4), `sfm/` (server, store, DB). + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`: the parity rows 4–5, and the "1b" decisions under *Build phases*. + +## Global Constraints + +- **Read-only on every unit.** Listing and downloading only. No new command reaches the wire: the MiniMate header walk sends only `0A`, `1E`, `0C`, `1F` (already sent by `get_events()` on every event), and the Micromate path only what `iter_events()` / `download_event()` already send. +- **Never send Series-3 bytes to a Micromate.** `sfm/device_access/s4.py` imports nothing from `minimateplus` except `transport`. +- **Requests without `serial` behave exactly as today.** The legacy body of `GET /device/events` is untouched except that `baud` becomes `Optional[int] = Query(None)`, defaulted to 38400 at the top of the legacy path, as phase 1a did for the other handlers. +- **Tiers:** `sfm/device_access/` must not import `sfm.waveform_store`, `sfm.database` or `sfm.server`. Storing lives in `sfm/event_ingest.py`. +- **Error statuses:** 404 event not found; 409 wrong unit or stale event; 422 bad input; 423 unit busy; 502 malformed reply; 503 could not connect, connection lost or calling home; 504 no answer; 501 not supported. +- **Tests call handlers directly with every parameter explicit.** `httpx` is not installed, so `TestClient` tests are skipped. FastAPI `Query()` defaults are FieldInfo objects, not values. +- **The suite's 16 pre-existing failures** (test_bw_ascii_report.py 15, test_event_file_io.py 1, missing gitignored fixtures) stay exactly that set. Nothing else may fail. +- **Branch `feat/series4-sfm-parity`.** + - Never commit to `main` or `dev`. + - Do not edit `CHANGELOG.md`. + - **After each commit, `git push`.** +- **Hardware:** only Task 9 touches `/dev/ttyACM0` (UM20147), under `sg dialout -c "..."`. Port 8200 is in use by another SFM; never start a server there. +- **Every commit message ends with:** + ``` + Co-Authored-By: Claude Opus 5.5 + Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 + ``` + +## Review Focus + +The inputs the spec implies, most likely to bite first. Each has a test in the task named. + +1. **An erase or memory wrap between list and download.** The key now holds a different event, and the download must refuse with 409, never fetch it (Tasks 4, 5, 8). +2. **The same key on two Micromates** (UM12947 and UM20147 both have `055d4a81`). An `event_id` from one unit used against another must be refused before any I/O (Tasks 3, 6). +3. **A decode that disagrees with the unit's own peak.** It must never be stored: 502, and the store is untouched (Tasks 5, 8). +4. **Storing an event already stored**, by an earlier download or by THOR's watcher. The row is refreshed, never duplicated, and the same `db_event_id` comes back (Task 7). +5. **RADIO RING mid-download.** The line is released, the request answers 503, and nothing is stored (Tasks 6, 8). + +--- + +## File map + +| file | change | +|---|---| +| `minimateplus/client.py` | `get_events(headers_only=, only_key=)`; new `list_event_headers()`, `download_event_by_key()` | +| `micromate/client.py` | new `fetch_event()` returning `(bytes, result)`; `get_event()` delegates to it | +| `sfm/device_access/models.py` | `EventRef`, `EventList`, `EventDownload`, `DownloadedEvent` | +| `sfm/device_access/errors.py` | `EventNotFound` (404), `StaleEvent` (409) | +| `sfm/device_access/events.py` | **new**: `event_id` make/parse, timestamp helpers | +| `sfm/device_access/s3.py` | `list_events`, `download_event`; factory and `_run` take a timeout | +| `sfm/device_access/s4.py` | `s4_list_events`, `s4_download_event` | +| `sfm/device_access/access.py` | `DeviceAccess.list_events`, `.download_event` | +| `sfm/device_access/__init__.py` | exports | +| `sfm/event_ingest.py` | **new**: `persist_download`, `backfill_series3_event` | +| `sfm/server.py` | `serial` on `GET /device/events`; new `POST /device/events/download`; guard paths; the legacy `blastware_file` route calls `backfill_series3_event` | +| `tests/device_access_fakes.py` | event support in both fakes | +| tests | `test_minimate_event_headers.py`, `test_device_access_events.py`, `test_device_access_s3_events.py`, `test_device_access_s4_events.py`, `test_device_access_event_dispatch.py`, `test_event_ingest.py`; additions to `test_micromate_events.py` and `test_server_device_access.py` | +| docs | `CLAUDE.md`, `README.md`, `docs/micromate_protocol_reference.md` (Task 9) | + +--- + +### Task 1: MiniMate header-only walk + +**Files:** +- Modify: `minimateplus/client.py`: `get_events` (line 453), and two new methods inserted before `def download_waveform` (line 744) +- Test: `tests/test_minimate_event_headers.py` (new) + +**Interfaces:** +- Produces: + - `MiniMateClient.list_event_headers() -> list[Event]`: no `_a5_frames`. + - `MiniMateClient.download_event_by_key(key4: bytes) -> Optional[Event]`: with `_a5_frames`. + - `get_events(..., headers_only: bool = False, only_key: Optional[bytes] = None)`. + +- [ ] **Step 1: Write the failing tests** in `tests/test_minimate_event_headers.py`: + +```python +"""MiniMateClient's header-only walk: list without 5A, download one without the rest.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.client as mc # noqa: E402 +from minimateplus.client import MiniMateClient # noqa: E402 +from minimateplus.models import Timestamp # noqa: E402 + +END = b"\x00" * 8 +KEYS = [bytes.fromhex(k) for k in ("01110000", "0111245a", "01114290")] +STAMPS = { + KEYS[0]: (2026, 10, 1, 8, 0, 0), + KEYS[1]: (2026, 10, 2, 9, 30, 15), + KEYS[2]: (2026, 10, 3, 17, 45, 59), +} + + +class FakeProto: + """Records every call; serves a three-event chain the way the unit does.""" + + def __init__(self, keys=KEYS, partial=()): + self.keys = list(keys) + self.partial = set(partial) + self.calls: list[tuple] = [] + self._pos = 0 + + def _entry(self, i): + if i >= len(self.keys): + return b"\x00\x00\x00\x00", END + return self.keys[i], self.keys[i] + b"\x00\x00\x00\x46" + + def read_event_first(self, token=0): + self.calls.append(("1E", token)) + if token == 0: + self._pos = 0 + return self._entry(self._pos) + + def read_waveform_header(self, key4): + self.calls.append(("0A", key4)) + return b"", (0x2C if key4 in self.partial else 0x46) + + def read_waveform_record(self, key4): + self.calls.append(("0C", key4)) + return key4 # decoded by the patched decoder below + + def advance_event(self, browse=False): + self.calls.append(("1F", "browse" if browse else "arm")) + if browse: + self._pos += 1 + return self._entry(self._pos) + return self._entry(self._pos + 1) + + def poll(self): + self.calls.append(("POLL",)) + + def read_bulk_waveform_stream(self, key4, **kw): + self.calls.append(("5A", key4)) + return ["frame"] + + +@pytest.fixture +def client(monkeypatch): + def decode_record(record, ev): + y, mo, d, h, mi, s = STAMPS[record] + ev.timestamp = Timestamp(raw=b"", flag=0x10, year=y, unknown_byte=0, + month=mo, day=d, hour=h, minute=mi, second=s) + ev.record_type = "Waveform" + monkeypatch.setattr(mc, "_decode_waveform_record_into", decode_record) + monkeypatch.setattr(mc, "_decode_a5_metadata_into", lambda frames, ev: None) + monkeypatch.setattr(mc, "_decode_a5_waveform", lambda frames, ev: None) + + def make(proto): + c = MiniMateClient(port="/dev/null") + c._proto = proto + return c + return make + + +def _subs(proto): + return [c[0] for c in proto.calls] + + +def test_listing_headers_never_starts_a_5a(client): + proto = FakeProto() + events = client(proto).list_event_headers() + assert [e._waveform_key for e in events] == KEYS + assert "5A" not in _subs(proto) and "POLL" not in _subs(proto) + assert ("1F", "arm") not in proto.calls + assert all(e._a5_frames is None for e in events) + + +def test_listing_headers_sends_only_the_commands_get_events_already_sends(client): + proto = FakeProto() + client(proto).list_event_headers() + assert _subs(proto) == ["1E"] + ["0A", "1E", "0C", "1F"] * len(KEYS) + + +def test_listed_events_carry_their_timestamps(client): + events = client(FakeProto()).list_event_headers() + assert (events[1].timestamp.day, events[1].timestamp.second) == (2, 15) + + +def test_downloading_one_event_starts_exactly_one_5a(client): + proto = FakeProto() + ev = client(proto).download_event_by_key(KEYS[1]) + assert ev is not None and ev._waveform_key == KEYS[1] + assert [c for c in proto.calls if c[0] == "5A"] == [("5A", KEYS[1])] + assert ev._a5_frames == ["frame"] + + +def test_downloading_one_event_stops_once_it_has_it(client): + proto = FakeProto() + client(proto).download_event_by_key(KEYS[1]) + assert ("0A", KEYS[2]) not in proto.calls + + +def test_the_events_before_it_are_walked_without_their_5a(client): + proto = FakeProto() + client(proto).download_event_by_key(KEYS[2]) + assert [c[1] for c in proto.calls if c[0] == "5A"] == [KEYS[2]] + assert proto.calls.count(("1F", "arm")) == 1 + + +def test_a_key_that_is_not_stored_returns_none(client): + assert client(FakeProto()).download_event_by_key(bytes.fromhex("0111ffff")) is None + + +def test_a_partial_record_is_skipped_by_both(client): + events = client(FakeProto(partial={KEYS[1]})).list_event_headers() + assert [e._waveform_key for e in events] == [KEYS[0], KEYS[2]] + assert client(FakeProto(partial={KEYS[1]})).download_event_by_key(KEYS[1]) is None +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_minimate_event_headers.py -q` + Expected: FAIL with `AttributeError: 'MiniMateClient' object has no attribute 'list_event_headers'`. + +- [ ] **Step 3: Implement.** In `minimateplus/client.py`: + + (a) Extend the `get_events` signature. Replace the line + ` def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1) -> list[Event]:` + with + ` def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1, headers_only: bool = False, only_key: Optional[bytes] = None) -> list[Event]:` + + (b) Add to the end of its docstring, just before the closing `"""` (after the `Raises:` block): + +``` + headers_only: never start a 5A -- every event takes the bypass below. + only_key: download only the event with this key (in full, per + full_waveform); walk the others without their 5A, and stop once + that event is read. +``` + + (c) Replace + +```python + expected_ts = skip_evts.get(cur_key.hex(), "") + actual_ts = _event_timestamp_iso(ev) + skip_5a = bool(expected_ts and actual_ts and expected_ts == actual_ts) + if skip_5a: + log.info( + "get_events: key=%s (key, ts=%s) match — skipping 5A bulk download", + cur_key.hex(), actual_ts, + ) +``` + + with + +```python + expected_ts = skip_evts.get(cur_key.hex(), "") + actual_ts = _event_timestamp_iso(ev) + skip_5a = bool(expected_ts and actual_ts and expected_ts == actual_ts) + if skip_5a: + log.info( + "get_events: key=%s (key, ts=%s) match — skipping 5A bulk download", + cur_key.hex(), actual_ts, + ) + elif headers_only or (only_key is not None and cur_key != only_key): + # The same bypass as a (key, ts) match: 0A + 1E(arm) + 0C were + # read; 1F(arm) + POLL + 5A are not sent, and 1F(browse) below is + # safe because no 5A was ever started. + skip_5a = True +``` + + (d) Replace + +```python + events.append(ev) + idx += 1 + + # Early exit: if the caller only wants events up to a specific +``` + + with + +```python + events.append(ev) + idx += 1 + + if only_key is not None and cur_key == only_key: + log.info("get_events: read key=%s -- stopping", cur_key.hex()) + break + + # Early exit: if the caller only wants events up to a specific +``` + + (e) Insert immediately before ` def download_waveform(self, event: Event) -> None:`: + +```python + def list_event_headers(self) -> list[Event]: + """Every stored event's 0C record -- timestamp, type, peaks -- without its 5A. + + `get_events()` downloads every event in full even for metadata + (`stop_after_metadata` is a no-op), so listing that way costs one + complete download per event. This walks 0A + 1E(arm) + 0C + 1F(browse) + per event -- the bypass `skip_waveform_for_events` already takes -- and + never starts a 5A. The events carry no `_a5_frames`. + """ + return self.get_events(headers_only=True) + + def download_event_by_key(self, key4: bytes) -> Optional[Event]: + """Download ONE event in full; walk past the events before it without + their 5A. None if no full record has that key. + + `get_events(stop_after_index=N)` downloads events 0..N in full and keeps + one; this downloads only the one asked for. + """ + for ev in self.get_events(full_waveform=True, only_key=key4): + if ev._waveform_key == key4: + return ev + return None + +``` + +- [ ] **Step 4: Run the tests and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_minimate_event_headers.py -q` + Expected: 8 passed. + +- [ ] **Step 5: Commit and push.** + +```bash +git add minimateplus/client.py tests/test_minimate_event_headers.py +git commit -m "feat(minimateplus): list events from headers, download one without the rest + +" +git push +``` + +--- + +### Task 2: Micromate `fetch_event` (bytes + checked decode) + +**Files:** +- Modify: `micromate/client.py`: `get_event` (line 530) +- Test: `tests/test_micromate_events.py` (append) + +**Interfaces:** +- Produces: `MicromateClient.fetch_event(ref, *, verify=True, tolerance=0.01, chunk_size=None) -> tuple[bytes, IdfReadResult]`. It raises `DecodeMismatch` exactly as `get_event` does. `get_event` keeps its signature and behaviour. + +- [ ] **Step 1: Write the failing tests.** Append to `tests/test_micromate_events.py`: + +```python +# ── fetch_event: the bytes and the checked decode together ─────────────────── + +import math # noqa: E402 + +UM20147_W = Path(__file__).parent / "fixtures" / "thor-idf" / "UM20147_20250531135901.IDFW" + + +def _our_pvs(result): + from micromate.idf_file import geo_count_to_ips + ch = {k.lower(): v for k, v in result.samples.items()} + t, v, l = ch["tran"], ch["vert"], ch["long"] + return max(math.sqrt(geo_count_to_ips(t[i]) ** 2 + geo_count_to_ips(v[i]) ** 2 + + geo_count_to_ips(l[i]) ** 2) + for i in range(min(len(t), len(v), len(l)))) + + +def _fixture_client(monkeypatch, blob): + mm, _t = client([]) + monkeypatch.setattr(mm, "download_event", lambda ref, chunk_size=None: blob) + return mm + + +def _w_ref(pvs): + return MicromateEventRef( + index=0, key=bytes.fromhex("055d4a81"), size=UM20147_W.stat().st_size, + serial="UM20147", record_type="waveform", + timestamp=datetime.datetime(2025, 5, 31, 13, 59, 1), peak_vector_sum_ips=pvs) + + +def test_fetch_event_returns_the_downloaded_bytes_with_the_decode(monkeypatch): + blob = UM20147_W.read_bytes() + mm = _fixture_client(monkeypatch, blob) + probe = mm.fetch_event(_w_ref(None), verify=False)[1] + got, result = mm.fetch_event(_w_ref(_our_pvs(probe))) + assert got == blob and result.samples + + +def test_fetch_event_refuses_a_decode_that_disagrees_with_the_unit(monkeypatch): + mm = _fixture_client(monkeypatch, UM20147_W.read_bytes()) + probe = mm.fetch_event(_w_ref(None), verify=False)[1] + with pytest.raises(DecodeMismatch): + mm.fetch_event(_w_ref(_our_pvs(probe) * 1.05)) + + +def test_get_event_is_fetch_event_without_the_bytes(monkeypatch): + mm = _fixture_client(monkeypatch, UM20147_W.read_bytes()) + assert mm.get_event(_w_ref(None), verify=False).samples +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_events.py -q -k fetch_event` + Expected: FAIL with `AttributeError: ... 'fetch_event'`. + +- [ ] **Step 3: Implement.** In `micromate/client.py`, `get_event` keeps its docstring. Replace its body: everything from ` if not ref.record_type:` through the ` return result` that ends the method. + +```python + return self.fetch_event(ref, verify=verify, tolerance=tolerance, + chunk_size=chunk_size)[1] + + def fetch_event(self, ref: MicromateEventRef, *, verify: bool = True, + tolerance: float = 0.01, chunk_size: Optional[int] = None): + """`get_event()`, returning the raw bytes too: `(blob, result)`. + + For a caller that stores the file AND wants the self-check: the bytes go + to the waveform store unchanged, and a DecodeMismatch stops them being + stored at all. + """ + if not ref.record_type: + raise ValueError( + f"event {ref.key_hex}: record_type is unknown, so the codec " + f"cannot be dispatched. Use list_events(with_records=True)." + ) + blob = self.download_event(ref, chunk_size=chunk_size) + + import tempfile + from .idf_file import read_idf_file + + # read_idf_file dispatches on the suffix, so the bytes need a name. + with tempfile.NamedTemporaryFile(suffix=ref.suffix, delete=False) as f: + f.write(blob) + tmp = f.name + try: + result = read_idf_file(tmp) + finally: + os.unlink(tmp) + + if verify and not ref.is_histogram: + err = self.decode_error(ref, result) + if err is not None and abs(err) > tolerance: + raise DecodeMismatch( + f"event {ref.uid}: decoded peak vector sum differs from the " + f"device's own by {100 * err:+.3f}% (tolerance " + f"{100 * tolerance:.1f}%) — the decode is suspect, not the " + f"device. Stored {ref.peak_vector_sum_ips:.5f} in/s." + ) + if err is not None: + log.debug("event %s: PVS agrees to %+.4f%%", ref.uid, 100 * err) + return blob, result +``` + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_events.py -q` + Expected: all pass. The two replay tests may skip on a fresh clone; on the dev box they run and must still pass. + +- [ ] **Step 5: Commit and push.** Message: `feat(micromate): fetch_event returns the bytes with the checked decode`. + +--- + +### Task 3: Event models, errors and `event_id` + +**Files:** +- Modify: `sfm/device_access/models.py`, `sfm/device_access/errors.py`, `sfm/device_access/__init__.py` +- Create: `sfm/device_access/events.py` +- Test: `tests/test_device_access_events.py` (new) + +**Interfaces:** +- Produces: + - **Models:** `EventRef`, `EventList`, `EventDownload`, `DownloadedEvent` (fields below). + - **Errors:** `EventNotFound` (404), `StaleEvent` (409). + - **`events.py`:** + - `make_event_id(serial, key: bytes, stamp: Optional[str]) -> str` + - `parse_event_id(event_id, serial) -> tuple[bytes, Optional[str]]` + - `stamp_of(dt) -> Optional[str]` (`YYYYmmddHHMMSS`) + - `iso_of(dt) -> Optional[str]` + +- [ ] **Step 1: Write the failing tests** in `tests/test_device_access_events.py`: + +```python +"""Event identity: serial + key + timestamp, so a stale or foreign id fails loudly.""" +from __future__ import annotations + +import datetime +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from sfm.device_access.errors import BadRequest, EventNotFound, StaleEvent # noqa: E402 +from sfm.device_access.events import ( # noqa: E402 + iso_of, make_event_id, parse_event_id, stamp_of, +) + +KEY = bytes.fromhex("055d4a81") +WHEN = datetime.datetime(2025, 5, 31, 13, 59, 1) + + +def test_an_event_id_round_trips(): + eid = make_event_id("um20147", KEY, stamp_of(WHEN)) + assert eid == "UM20147:055d4a81:20250531135901" + assert parse_event_id(eid, "UM20147") == (KEY, "20250531135901") + + +def test_an_unknown_timestamp_round_trips_as_none(): + eid = make_event_id("BE18193", bytes.fromhex("01110000"), None) + assert eid == "BE18193:01110000:-" + assert parse_event_id(eid, "be18193") == (bytes.fromhex("01110000"), None) + + +def test_an_id_from_another_unit_is_refused(): + # UM12947 and UM20147 both have an event 055d4a81 + with pytest.raises(BadRequest, match="UM12947"): + parse_event_id("UM12947:055d4a81:20250531135901", "UM20147") + + +@pytest.mark.parametrize("bad", ["", "UM20147", "UM20147:055d4a81", + "UM20147:zz:20250531135901", "UM20147:055d4a:20250531135901", + "UM20147:055d4a81:2025"]) +def test_a_malformed_id_is_refused(bad): + with pytest.raises(BadRequest): + parse_event_id(bad, "UM20147") + + +def test_iso_and_stamp_of_none_are_none(): + assert iso_of(None) is None and stamp_of(None) is None + assert iso_of(WHEN) == "2025-05-31T13:59:01" + + +def test_the_new_errors_have_their_statuses(): + assert (EventNotFound.http_status, StaleEvent.http_status) == (404, 409) +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_device_access_events.py -q` + Expected: FAIL with `ImportError` (`EventNotFound`, `sfm.device_access.events`). + +- [ ] **Step 3: Implement.** + + `sfm/device_access/errors.py`: add after `class MalformedReply`: + +```python +class EventNotFound(DeviceError): + http_status = 404 + + +class StaleEvent(DeviceError): + """The event at that key is not the one listed -- the unit was erased, or + its memory wrapped, since the list was read.""" + http_status = 409 +``` + + `sfm/device_access/models.py`: change `from typing import Any, Dict, Optional` to `from typing import Any, Dict, List, Optional`, and append: + +```python +@dataclass +class EventRef: + """One stored event, as listed. `event_id` is opaque: pass it back to + download the event. `index` is its position in the list right now; an + erase renumbers it, so it is for display, never identity.""" + event_id: str + serial: str + series: int + index: int + timestamp: Optional[str] # ISO, the unit's own local time + record_type: Optional[str] # "waveform" | "histogram" + peak_vector_sum_ips: Optional[float] + peaks_ips: Dict[str, float] # geophones only: tran / vert / long + filename: Optional[str] # the name the vendor's software gives it + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class EventList: + serial: str + series: int + events: List[EventRef] + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class EventDownload: + """What a download stored. The file and waveform are then served at + /db/events/{db_event_id}/... .""" + event_id: str + serial: str + series: int + db_event_id: Optional[str] + stored_filename: str + filesize: int + sha256: Optional[str] + inserted: bool # False: already stored; the row was refreshed + verified: Optional[bool] # True: decode self-check passed; None: no check exists + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class DownloadedEvent: + """The device side's result, before SFM stores it. Not an HTTP shape: it + carries the payload -- a Series-3 Event + its 5A frames + the compliance + config, or a Series-4 file's bytes -- to sfm.event_ingest.""" + event_id: str + serial: str + series: int + filename: str + verified: Optional[bool] + idf_bytes: Optional[bytes] = field(default=None, repr=False) + event: Any = field(default=None, repr=False) + a5_frames: Optional[list] = field(default=None, repr=False) + compliance: Any = field(default=None, repr=False) + detail: Dict[str, Any] = field(default_factory=dict) +``` + + Create `sfm/device_access/events.py`: + +```python +"""Event identity. An `event_id` is `::`. + +The key alone is not enough: both series reuse keys (a MiniMate restarts at +01110000 after an erase; every Micromate's counter starts at the same value). +The timestamp turns a stale id into a loud StaleEvent instead of a download of +whatever now sits at that key. "-" stands in for an unknown timestamp. +""" +from __future__ import annotations + +import datetime +from typing import Optional, Tuple + +from .errors import BadRequest +from .series import normalise_serial + +_NO_STAMP = "-" +_STAMP_FMT = "%Y%m%d%H%M%S" + + +def stamp_of(dt: Optional[datetime.datetime]) -> Optional[str]: + return dt.strftime(_STAMP_FMT) if dt is not None else None + + +def iso_of(dt: Optional[datetime.datetime]) -> Optional[str]: + return dt.isoformat() if dt is not None else None + + +def make_event_id(serial: str, key: bytes, stamp: Optional[str]) -> str: + return f"{normalise_serial(serial)}:{key.hex()}:{stamp or _NO_STAMP}" + + +def parse_event_id(event_id: str, serial: str) -> Tuple[bytes, Optional[str]]: + """(key, stamp) for an id that belongs to `serial`; BadRequest otherwise.""" + parts = (event_id or "").strip().split(":") + if len(parts) != 3: + raise BadRequest(f"not an event_id: {event_id!r} -- take it from GET /device/events") + id_serial, key_hex, stamp = parts + if normalise_serial(id_serial) != normalise_serial(serial): + raise BadRequest(f"event_id {event_id!r} belongs to {id_serial}, not {serial}") + try: + key = bytes.fromhex(key_hex) + except ValueError: + key = b"" + if len(key) != 4: + raise BadRequest(f"event_id {event_id!r}: the key must be 8 hex digits") + if stamp != _NO_STAMP: + try: + datetime.datetime.strptime(stamp, _STAMP_FMT) + except ValueError: + raise BadRequest(f"event_id {event_id!r}: bad timestamp {stamp!r}") from None + return key, (None if stamp == _NO_STAMP else stamp) +``` + + `sfm/device_access/__init__.py`: add `EventNotFound, StaleEvent` to the errors import, and `EventDownload, EventList, EventRef, DownloadedEvent` to the models import. + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_device_access_events.py -q` + Expected: 11 passed. + +- [ ] **Step 5: Commit and push.** Message: `feat(sfm): event models and event_id -- serial, key and timestamp`. + +--- + +### Task 4: Series-3 adapter: list and download + +**Files:** +- Modify: `sfm/device_access/s3.py`, `tests/device_access_fakes.py` +- Test: `tests/test_device_access_s3_events.py` (new) + +**Interfaces:** +- Consumes: + - Task 1's `list_event_headers()` and `download_event_by_key()`. + - Task 3's models, errors and `events.py`. +- Produces: + - `Series3Adapter.list_events(address, serial) -> EventList` + - `Series3Adapter.download_event(address, serial, key: bytes, stamp: Optional[str]) -> DownloadedEvent` + - `default_s3_client_factory(address, timeout: Optional[float] = None)` + - `Series3Adapter._run(address, fn, timeout=None)`. With a timeout, the factory is called as `factory(address, timeout=...)`. + - `S3_EVENT_TIMEOUT = 120.0` + - In the fakes: `s3_event(...)`, `default_s3_events()`, and `FakeMiniMateClient(events=...)` with `list_event_headers` / `download_event_by_key`. + +- [ ] **Step 1: Extend the fakes.** In `tests/device_access_fakes.py`: + - Add `import copy` to the imports. + - Change the minimateplus import to `from minimateplus.models import ComplianceConfig, DeviceInfo, Event, MonitorStatus, PeakValues, Timestamp`. + - Add these module-level helpers before `class FakeMiniMateClient`: + +```python +def s3_event(index, key_hex, when, *, record_type="Waveform", pvs=0.12, frames=True): + ev = Event(index=index) + ev._waveform_key = bytes.fromhex(key_hex) + ev.timestamp = Timestamp(raw=b"", flag=0x10, year=when.year, unknown_byte=0, + month=when.month, day=when.day, hour=when.hour, + minute=when.minute, second=when.second) + ev.record_type = record_type + ev.peak_values = PeakValues(tran=0.05, vert=0.08, long=0.03, micl=0.0001, + peak_vector_sum=pvs) + if frames: + ev._a5_frames = ["frame"] + return ev + + +def default_s3_events(): + return [ + s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)), + s3_event(1, "0111245a", datetime.datetime(2026, 10, 2, 9, 30, 15), record_type="Histogram"), + ] +``` + + - Change the signature of `FakeMiniMateClient.__init__` to `def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, **kw):`, and add `self.events = default_s3_events() if events is None else events` at the end of `__init__`. + - Add these methods to `FakeMiniMateClient`: + +```python + def list_event_headers(self): + self._step("list_event_headers") + out = [] + for ev in self.events: + h = copy.copy(ev) + h._a5_frames = None + out.append(h) + return out + + def download_event_by_key(self, key4): + self._step("download_event_by_key") + for ev in self.events: + if ev._waveform_key == key4: + return ev + return None +``` + +- [ ] **Step 2: Write the failing tests** in `tests/test_device_access_s3_events.py`: + +```python +"""Series-3 events: listed from headers, one downloaded, mapped into the shared shape.""" +from __future__ import annotations + +import datetime +import os +import struct +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + EventNotFound, MalformedReply, StaleEvent, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s3 import Series3Adapter # noqa: E402 + +TCP = UnitAddress(host="10.0.0.5", tcp_port=12345, port=None, baud=None) +FIRST = bytes.fromhex("01110000") + + +def adapter(*clients): + queue = list(clients) + seen = [] + + def factory(address, **kw): + seen.append(kw) + return queue.pop(0) + a = Series3Adapter(client_factory=factory) + a.seen = seen + return a + + +def test_listing_maps_each_header_into_the_shared_shape(): + out = adapter(FakeMiniMateClient()).list_events(TCP, "BE18193") + assert (out.serial, out.series, len(out.events)) == ("BE18193", 3, 2) + e = out.events[1] + assert e.event_id == "BE18193:0111245a:20261002093015" + assert (e.index, e.timestamp, e.record_type) == (1, "2026-10-02T09:30:15", "histogram") + assert e.peaks_ips == {"tran": 0.05, "vert": 0.08, "long": 0.03} + assert e.peak_vector_sum_ips == 0.12 and e.detail["mic_psi"] == 0.0001 + assert e.filename and e.filename.startswith("T193") + + +def test_listing_uses_the_header_walk_and_the_long_timeout(): + fake = FakeMiniMateClient() + a = adapter(fake) + a.list_events(TCP, "BE18193") + assert "list_event_headers" in fake.calls and "download_event_by_key" not in fake.calls + assert a.seen == [{"timeout": 120.0}] + assert fake.closed == 1 + + +def test_listing_refuses_a_different_unit(): + with pytest.raises(WrongUnit): + adapter(FakeMiniMateClient(serial="BE11529")).list_events(TCP, "BE18193") + + +def test_download_returns_the_event_its_frames_and_the_settings(): + fake = FakeMiniMateClient() + dl = adapter(fake).download_event(TCP, "BE18193", FIRST, "20261001080000") + assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", None) + assert dl.event is fake.events[0] and dl.a5_frames == ["frame"] + assert dl.compliance is fake.compliance and dl.filename.startswith("T193") + + +def test_download_refuses_a_different_unit_before_downloading(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) + assert "download_event_by_key" not in fake.calls + + +def test_a_key_that_is_not_stored_is_404(): + with pytest.raises(EventNotFound): + adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", bytes.fromhex("0111ffff"), None) + + +def test_a_stale_id_is_refused_rather_than_downloading_another_event(): + with pytest.raises(StaleEvent, match="20261001080000"): + adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, "20250101000000") + + +def test_an_id_without_a_timestamp_skips_the_check(): + dl = adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, None) + assert dl.event_id == "BE18193:01110000:20261001080000" + + +def test_a_failed_5a_is_a_clear_error(): + fake = FakeMiniMateClient(events=[s3_event(0, "01110000", + datetime.datetime(2026, 10, 1, 8, 0, 0), frames=False)]) + with pytest.raises(MalformedReply, match="5A"): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) + + +def test_the_64k_page_bug_is_named_not_a_bare_500(): + fake = FakeMiniMateClient() + + def boom(key4): + raise struct.error("argument out of range") + fake.download_event_by_key = boom + with pytest.raises(MalformedReply, match="64 KB"): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) +``` + +- [ ] **Step 3: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_device_access_s3_events.py -q` + Expected: FAIL with `AttributeError: 'Series3Adapter' object has no attribute 'list_events'`. + +- [ ] **Step 4: Implement.** In `sfm/device_access/s3.py`: + + Imports: change `from typing import Any, Callable` to `from typing import Any, Callable, Optional`, and add: + +```python +import datetime +import struct + +from minimateplus.blastware_file import blastware_filename + +from .events import iso_of, make_event_id, stamp_of +from .models import DownloadedEvent, EventList, EventRef +``` + + Also extend the errors import with `EventNotFound, StaleEvent`. + + Replace `default_s3_client_factory` with: + +```python +S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use + + +def default_s3_client_factory(address: UnitAddress, timeout: Optional[float] = None) -> MiniMateClient: + if address.host: + return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), + timeout=10.0 if timeout is None else timeout) + if timeout is None: + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD) + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD, timeout=timeout) +``` + + In `Series3Adapter._run`: + - change the signature to `def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None) -> Any:`; + - change `client = self._factory(address)` to `client = self._factory(address) if timeout is None else self._factory(address, timeout=timeout)`. + + Add module-level helpers after `_close`: + +```python +def _s3_dt(ev: Any) -> Optional[datetime.datetime]: + ts = getattr(ev, "timestamp", None) + if ts is None or ts.hour is None: + return None + try: + return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) + except (TypeError, ValueError): + return None + + +def _s3_filename(ev: Any, serial: str) -> Optional[str]: + try: + return blastware_filename(ev, serial) + except Exception: # noqa: BLE001 + return None + + +def _s3_ref(ev: Any, serial: str) -> EventRef: + dt = _s3_dt(ev) + pv = ev.peak_values + peaks = {} + if pv is not None: + peaks = {k: v for k, v in (("tran", pv.tran), ("vert", pv.vert), ("long", pv.long)) + if v is not None} + return EventRef( + event_id=make_event_id(serial, ev._waveform_key, stamp_of(dt)), + serial=serial, series=3, index=ev.index, timestamp=iso_of(dt), + record_type=ev.record_type.lower() if ev.record_type else None, + peak_vector_sum_ips=pv.peak_vector_sum if pv is not None else None, + peaks_ips=peaks, filename=_s3_filename(ev, serial), + detail={"mic_psi": pv.micl if pv is not None else None}, + ) +``` + + Add the methods to `Series3Adapter`, after `settings`: + +```python + def list_events(self, address: UnitAddress, serial: str) -> EventList: + def op(client: Any) -> EventList: + info = client.connect() + self._check(info.serial, serial, address) + return EventList(serial=serial, series=3, + events=[_s3_ref(ev, serial) for ev in client.list_event_headers()]) + return self._run(address, op, timeout=S3_EVENT_TIMEOUT) + + def download_event(self, address: UnitAddress, serial: str, key: bytes, + stamp: Optional[str]) -> DownloadedEvent: + def op(client: Any) -> DownloadedEvent: + info = client.connect() + self._check(info.serial, serial, address) + try: + ev = client.download_event_by_key(key) + except struct.error as exc: + # 🔶 Inferred: the known 5A page bug. An event past the unit's + # first 64 KB drives TERM's offset negative, and struct.pack + # rejects it (CLAUDE.md, "KNOWN BUG"). + raise MalformedReply( + f"event {key.hex()}: its download could not be assembled ({exc}) -- most " + "likely the known bug with events past the unit's first 64 KB; not saved" + ) from exc + if ev is None: + raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") + found = stamp_of(_s3_dt(ev)) + if stamp is not None and found != stamp: + raise StaleEvent( + f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " + "the unit was erased or wrapped since the list was read; list again") + if not ev._a5_frames: + raise MalformedReply(f"event {key.hex()}: no waveform data received (the 5A download failed)") + filename = _s3_filename(ev, serial) + if filename is None: + raise MalformedReply(f"event {key.hex()} has no usable timestamp, so it cannot be named or stored") + return DownloadedEvent( + event_id=make_event_id(serial, key, found), serial=serial, series=3, + filename=filename, verified=None, event=ev, a5_frames=ev._a5_frames, + compliance=info.compliance_config, detail={"a5_frames": len(ev._a5_frames)}, + ) + return self._run(address, op, timeout=S3_EVENT_TIMEOUT) +``` + +- [ ] **Step 5: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_device_access_s3_events.py tests/test_device_access_s3.py -q` + Expected: all pass. The existing S3 tests use `lambda address:` factories, and those calls pass no timeout. + +- [ ] **Step 6: Commit and push.** Message: `feat(sfm): Series-3 events -- header list, one-event download, stale ids refused`. + +--- + +### Task 5: Series-4 operations: list and download + +**Files:** +- Modify: `sfm/device_access/s4.py`, `tests/device_access_fakes.py` +- Test: `tests/test_device_access_s4_events.py` (new) + +**Interfaces:** +- Consumes: + - Task 2's `fetch_event`. + - Task 3's models, errors and `events.py`. +- Produces: + - `s4_list_events(client, serial) -> EventList` + - `s4_download_event(client, serial, key: bytes, stamp: Optional[str]) -> DownloadedEvent` + - In the fakes: `s4_ref(...)`, `default_s4_refs()`, and `FakeMicromateClient(event_refs=...)` with `list_events`, `iter_events`, `fetch_event` and `decode_error`. + +- [ ] **Step 1: Extend the fakes.** In `tests/device_access_fakes.py`: + - Add `from micromate.models import MicromateEventRef` (extend the existing micromate import). + - Add `THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf"` after `SETUP_FIXTURE`. + - Add these module-level helpers before `class _FakeProtocol`: + +```python +def s4_ref(index, key_hex, when, record_type, *, pvs=0.2): + """Fixture-backed: the filename it produces names a real file in thor-idf/.""" + ref = MicromateEventRef(index=index, key=bytes.fromhex(key_hex), size=0, serial="UM20147", + record_type=record_type, timestamp=when, peak_vector_sum_ips=pvs, + peaks_ips={"Tran": 0.1, "Vert": 0.15, "Long": 0.05, "Mic": 0.0002}) + ref.size = (THOR_IDF / ref.filename).stat().st_size + return ref + + +def default_s4_refs(): + return [ + s4_ref(0, "055d4a81", datetime.datetime(2025, 5, 31, 13, 59, 1), "waveform"), + s4_ref(1, "055d4a83", datetime.datetime(2025, 3, 30, 7, 1, 10), "histogram"), + ] +``` + + - Change the signature of `FakeMicromateClient.__init__` to `def __init__(self, serial="UM20147", *, monitoring=False, events=5, unsolicited=b"", event_refs=None, **kw):`. + - Add to the end of `__init__`: + +```python + self.event_refs = default_s4_refs() if event_refs is None else event_refs + self.cursor = None + self.fetched: list = [] +``` + + - Add these methods to `FakeMicromateClient`: + +```python + def list_events(self, *, with_records=True): + self._step("list_events") + return list(self.event_refs) + + def iter_events(self, *, with_records=True): + self._step("iter_events") + for ref in self.event_refs: + self.cursor = ref.index + yield ref + + def fetch_event(self, ref, *, verify=True, tolerance=0.01, chunk_size=None): + self._step("fetch_event") + self.fetched.append((ref.key_hex, chunk_size)) + return (THOR_IDF / ref.filename).read_bytes(), object() + + @staticmethod + def decode_error(ref, result): + return None if ref.record_type == "histogram" else 0.0 +``` + +- [ ] **Step 2: Write the failing tests** in `tests/test_device_access_s4_events.py`: + +```python +"""Series-4 events: the chain walk mapped into the shared shape; download at the cursor.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import THOR_IDF, FakeMicromateClient # noqa: E402 +from micromate.protocol import THOR_CHUNK_SIZE # noqa: E402 +from sfm.device_access.errors import EventNotFound, StaleEvent # noqa: E402 +from sfm.device_access.s4 import s4_download_event, s4_list_events # noqa: E402 + +W_KEY, H_KEY = bytes.fromhex("055d4a81"), bytes.fromhex("055d4a83") + + +def test_listing_maps_each_ref_into_the_shared_shape(): + out = s4_list_events(FakeMicromateClient(), "UM20147") + assert (out.serial, out.series, len(out.events)) == ("UM20147", 4, 2) + e = out.events[0] + assert e.event_id == "UM20147:055d4a81:20250531135901" + assert (e.index, e.timestamp, e.record_type) == (0, "2025-05-31T13:59:01", "waveform") + assert e.peaks_ips == {"tran": 0.1, "vert": 0.15, "long": 0.05} + assert e.filename == "UM20147_20250531135901.IDFW" + assert e.detail["mic"] == 0.0002 and e.detail["size_bytes"] > 0 + + +def test_download_walks_to_the_event_and_uses_thors_chunk_size(): + fake = FakeMicromateClient() + dl = s4_download_event(fake, "UM20147", W_KEY, "20250531135901") + assert "iter_events" in fake.calls and "list_events" not in fake.calls + assert fake.fetched == [("055d4a81", THOR_CHUNK_SIZE)] + assert dl.idf_bytes == (THOR_IDF / "UM20147_20250531135901.IDFW").read_bytes() + assert (dl.series, dl.filename, dl.verified) == (4, "UM20147_20250531135901.IDFW", True) + + +def test_the_walk_stops_at_the_event_rather_than_reading_ahead(): + fake = FakeMicromateClient() + s4_download_event(fake, "UM20147", W_KEY, None) + assert fake.cursor == 0 + + +def test_a_histogram_has_no_self_check_so_verified_is_none(): + dl = s4_download_event(FakeMicromateClient(), "UM20147", H_KEY, None) + assert dl.verified is None and dl.filename.endswith(".IDFH") + + +def test_a_stale_id_is_refused_and_nothing_is_downloaded(): + fake = FakeMicromateClient() + with pytest.raises(StaleEvent, match="20250531135901"): + s4_download_event(fake, "UM20147", W_KEY, "20240101000000") + assert fake.fetched == [] + + +def test_a_key_that_is_not_stored_is_404(): + with pytest.raises(EventNotFound): + s4_download_event(FakeMicromateClient(), "UM20147", bytes.fromhex("deadbeef"), None) +``` + +- [ ] **Step 3: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_device_access_s4_events.py -q` + Expected: FAIL with `ImportError: cannot import name 's4_download_event'`. + +- [ ] **Step 4: Implement.** In `sfm/device_access/s4.py`, add these imports (`micromate.protocol` is Series 4's own package, so the module-header rule holds): + +```python +from micromate.protocol import THOR_CHUNK_SIZE + +from .errors import EventNotFound, MalformedReply, StaleEvent +from .events import iso_of, make_event_id, stamp_of +from .models import DownloadedEvent, EventList, EventRef +``` + + Merge these into the existing `.errors` and `.models` import lines. Then append at the end of the file: + +```python +def _s4_ref(ref: Any, serial: str) -> EventRef: + peaks = ref.peaks_ips or {} + return EventRef( + event_id=make_event_id(serial, ref.key, stamp_of(ref.timestamp)), + serial=serial, series=4, index=ref.index, timestamp=iso_of(ref.timestamp), + record_type=ref.record_type, peak_vector_sum_ips=ref.peak_vector_sum_ips, + peaks_ips={k.lower(): v for k, v in peaks.items() if k in ("Tran", "Vert", "Long")}, + filename=ref.filename, + detail={"size_bytes": ref.size, "mic": peaks.get("Mic"), "setup": ref.setup, + "sensor_location": ref.sensor_location}, + ) + + +def s4_list_events(client: Any, serial: str) -> EventList: + return EventList(serial=serial, series=4, + events=[_s4_ref(r, serial) for r in client.list_events(with_records=True)]) + + +def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str]) -> DownloadedEvent: + """Walk to the event and download it there -- the order THOR uses, the only + one captured. Downloading at a parked cursor has never been tried.""" + for ref in client.iter_events(with_records=True): + if ref.key != key: + continue + found = stamp_of(ref.timestamp) + if stamp is not None and found != stamp: + raise StaleEvent( + f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " + "the unit was erased or wrapped since the list was read; list again") + if ref.filename is None: + raise MalformedReply( + f"event {key.hex()}: its record gave no type or timestamp, so it cannot be named or stored") + # THOR's chunk size. A 16 KB chunk takes ~7 s on cellular against the + # 10 s receive deadline; 1 KB is what THOR itself sends. + blob, result = client.fetch_event(ref, chunk_size=THOR_CHUNK_SIZE) + err = client.decode_error(ref, result) + return DownloadedEvent( + event_id=make_event_id(serial, key, found), serial=serial, series=4, + filename=ref.filename, verified=True if err is not None else None, + idf_bytes=blob, detail={"size_bytes": ref.size, "pvs_error": err}, + ) + raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") +``` + +- [ ] **Step 5: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_device_access_s4_events.py tests/test_device_access_s4.py -q` + Expected: all pass. + +- [ ] **Step 6: Commit and push.** Message: `feat(sfm): Series-4 events -- chain-walk list, download at THOR's cursor`. + +--- + +### Task 6: `DeviceAccess.list_events` / `download_event` + +**Files:** +- Modify: `sfm/device_access/access.py`, and `sfm/device_access/s4.py` (`Series4Session._exchange`) +- Test: `tests/test_device_access_event_dispatch.py` (new) + +**Interfaces:** +- Consumes: Tasks 3–5. +- Produces: + - `DeviceAccess.list_events(address, serial) -> EventList` + - `DeviceAccess.download_event(address, serial, event_id) -> DownloadedEvent` + +- [ ] **Step 1: Write the failing tests** in `tests/test_device_access_event_dispatch.py`: + +```python +"""Events through the one door: same shape both series, the held line, ring safety.""" +from __future__ import annotations + +import dataclasses +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMicromateClient, FakeMiniMateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import BadRequest, CallHomeInProgress # noqa: E402 +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import RingDetected # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +def access(s3=(), s4=()): + s3q, s4q = list(s3), list(s4) + return DeviceAccess(s3_client_factory=lambda a, **kw: s3q.pop(0), + s4_client_factory=lambda a, **kw: s4q.pop(0), start_reaper=False) + + +def test_both_series_list_events_in_the_same_shape(): + s3 = access(s3=[FakeMiniMateClient()]).list_events(ADDR, "BE18193") + s4 = access(s4=[FakeMicromateClient()]).list_events(ADDR, "UM20147") + f3 = [set(dataclasses.asdict(e)) for e in s3.events] + f4 = [set(dataclasses.asdict(e)) for e in s4.events] + assert all(f == f3[0] for f in f3 + f4) + + +def test_no_shared_field_is_empty_for_either_series(): + # A field one series cannot fill belongs under `detail`, not at the top level. + for out in (access(s3=[FakeMiniMateClient()]).list_events(ADDR, "BE18193"), + access(s4=[FakeMicromateClient()]).list_events(ADDR, "UM20147")): + for e in out.events: + empty = {k for k, v in dataclasses.asdict(e).items() if v is None} + assert empty == set(), (out.series, empty) + + +def test_a_micromate_list_and_download_share_one_held_line(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + listed = da.list_events(ADDR, "UM20147") + dl = da.download_event(ADDR, "UM20147", listed.events[0].event_id) + assert fake.opened == 1 and dl.idf_bytes + assert da.held_serial(ADDR) == "UM20147" + + +def test_an_id_from_another_unit_is_refused_before_any_io(): + fake = FakeMicromateClient() + with pytest.raises(BadRequest): + access(s4=[fake]).download_event(ADDR, "UM20147", "UM12947:055d4a81:20250531135901") + assert fake.opened == 0 + + +def test_a_minimate_download_goes_through_the_series3_adapter(): + dl = access(s3=[FakeMiniMateClient()]).download_event(ADDR, "BE18193", "BE18193:01110000:-") + assert dl.series == 3 and dl.a5_frames == ["frame"] + + +def test_a_ring_mid_download_releases_the_line_and_downloads_nothing(): + fake = FakeMicromateClient() + + def ring(*a, **kw): + raise RingDetected("RADIO RING") + fake.fetch_event = ring + da = access(s4=[fake]) + with pytest.raises(CallHomeInProgress): + da.download_event(ADDR, "UM20147", "UM20147:055d4a81:20250531135901") + assert fake.closed == 1 and da.held_serial(ADDR) is None + + +def test_a_stale_or_missing_event_keeps_the_line(): + # The operation's own verdict (404/409) says nothing is wrong with the link; + # hanging up would cost a call-up for no reason. + from sfm.device_access.errors import EventNotFound, StaleEvent + fake = FakeMicromateClient() + da = access(s4=[fake]) + with pytest.raises(StaleEvent): + da.download_event(ADDR, "UM20147", "UM20147:055d4a81:20240101000000") + with pytest.raises(EventNotFound): + da.download_event(ADDR, "UM20147", "UM20147:deadbeef:-") + assert fake.opened == 1 and fake.closed == 0 + assert da.held_serial(ADDR) == "UM20147" +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_device_access_event_dispatch.py -q` + Expected: FAIL with `AttributeError: 'DeviceAccess' object has no attribute 'list_events'`. + +- [ ] **Step 3: Implement.** In `sfm/device_access/access.py`: + - Imports: add `DownloadedEvent, EventList` to the `.models` import, `s4_download_event, s4_list_events` to the `.s4` import, and `from .events import parse_event_id`. + - Add after `settings`: + +```python + def list_events(self, address: UnitAddress, serial: str) -> EventList: + return self._dispatch(address, serial, self._s3.list_events, s4_list_events) + + def download_event(self, address: UnitAddress, serial: str, event_id: str) -> DownloadedEvent: + """Read-only on the unit. Holds the unit for the whole download, so + other requests for it wait, then get 423.""" + key, stamp = parse_event_id(event_id, serial) # BadRequest before any I/O + return self._dispatch( + address, serial, + lambda a, s: self._s3.download_event(a, s, key, stamp), + lambda c, s: s4_download_event(c, s, key, stamp)) +``` + + - In `_dispatch`, replace the comment line `# Call up fresh and retry ONCE. Safe only because phase 1a` and the next line `# operations are reads (idempotent); writes (phase 3) must NOT` with: + +```python + # Call up fresh and retry ONCE. Safe only because every operation + # here is a read (identify, status, settings, list, download -- all + # idempotent); writes (phase 3) must NOT +``` + + Leave the comment's last line, `# inherit this -- a write whose ack was lost must never be sent twice.`, as it is. + + In `sfm/device_access/s4.py`, add `DeviceError` to the `.errors` import. In `Series4Session._exchange`, add a clause between the `except RingDetected` block and the `except Exception` block: + +```python + except DeviceError: + # The operation's own verdict (event not found, stale id): the line + # is healthy, so keep it. Library errors still hang up below. + raise +``` + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_device_access_event_dispatch.py tests/test_device_access.py -q` + Expected: all pass. + +- [ ] **Step 5: Commit and push.** Message: `feat(sfm): DeviceAccess lists and downloads events for both series`. + +--- + +### Task 7: SDM ingest: `sfm/event_ingest.py` + +**Files:** +- Create: `sfm/event_ingest.py` +- Modify: `sfm/server.py`. The legacy `device_event_blastware_file` calls `backfill_series3_event` instead of its inline copy; behaviour is identical. +- Test: `tests/test_event_ingest.py` (new) + +**Interfaces:** +- Consumes: + - Task 3's `DownloadedEvent` and `EventDownload`. + - `WaveformStore.save()` / `.save_imported_idf()`. + - `SeismoDb.insert_events()` / `.query_events()`. +- Produces: + - `persist_download(dl, *, store, db) -> EventDownload` + - `backfill_series3_event(ev, cc) -> None` + - `IngestError` + +- [ ] **Step 1: Write the failing tests** in `tests/test_event_ingest.py`: + +```python +"""Storing a downloaded event: the same store + DB writes every ingest path makes.""" +from __future__ import annotations + +import datetime +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 +from sfm.database import SeismoDb # noqa: E402 +from sfm.device_access.models import DownloadedEvent # noqa: E402 +from sfm.event_ingest import backfill_series3_event, persist_download # noqa: E402 +from sfm.waveform_store import WaveformStore # noqa: E402 + +THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" + + +@pytest.fixture +def sdm(tmp_path): + return WaveformStore(tmp_path / "waveforms"), SeismoDb(tmp_path / "seismo.db") + + +def s4_download(name, verified=True): + return DownloadedEvent(event_id=f"UM20147:055d4a81:{name[8:22]}", serial="UM20147", series=4, + filename=name, verified=verified, idf_bytes=(THOR_IDF / name).read_bytes()) + + +def test_a_series4_waveform_is_stored_and_findable(sdm): + store, db = sdm + out = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + assert out.stored_filename == "UM20147_20250531135901.IDFW" and out.inserted + assert (store.root / "UM20147" / out.stored_filename).exists() + row = db.get_event(out.db_event_id) + assert row["serial"] == "UM20147" and row["device_family"] == "series4" + assert out.verified is True and out.sha256 + + +def test_a_series4_histogram_is_stored(sdm): + store, db = sdm + out = persist_download(s4_download("UM20147_20250330070110.IDFH", verified=None), store=store, db=db) + assert out.inserted and out.db_event_id and out.verified is None + + +def test_storing_the_same_event_twice_refreshes_rather_than_duplicates(sdm): + store, db = sdm + first = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + again = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + assert (first.inserted, again.inserted) == (True, False) + assert again.db_event_id == first.db_event_id + assert len(db.query_events(serial="UM20147")) == 1 + + +class RecordingStore: + def __init__(self): + self.saved = [] + + def save(self, ev, serial, a5_frames, *, geo_range="normal", source_kind="sfm-live"): + self.saved.append((ev, serial, a5_frames, geo_range)) + return {"filename": "T193LQ9K.OE0", "filesize": 8708, "sha256": "ab" * 32} + + +def test_a_series3_event_is_backfilled_then_stored_as_series3(tmp_path): + db = SeismoDb(tmp_path / "seismo.db") + store = RecordingStore() + fake = FakeMiniMateClient() + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) + dl = DownloadedEvent(event_id="BE18193:01110000:20261001080000", serial="BE18193", series=3, + filename="T193LQ9K.OE0", verified=None, event=ev, a5_frames=["frame"], + compliance=fake.compliance) + out = persist_download(dl, store=store, db=db) + saved_ev, serial, frames, geo_range = store.saved[0] + assert (serial, frames, geo_range) == ("BE18193", ["frame"], 0) + assert saved_ev.sample_rate == 1024 and saved_ev.rectime_seconds == 3.0 + assert db.get_event(out.db_event_id)["device_family"] == "series3" + assert out.stored_filename == "T193LQ9K.OE0" + + +def test_backfill_derives_total_samples_only_when_the_decoded_one_is_implausible(): + cc = FakeMiniMateClient().compliance # 1024 sps, 3.0 s + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) + ev.total_samples = 40_000 + backfill_series3_event(ev, cc) + assert ev.total_samples == 3072 + ev.total_samples = 3000 + backfill_series3_event(ev, cc) + assert ev.total_samples == 3000 + + +def test_backfill_without_settings_changes_nothing(): + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) + backfill_series3_event(ev, None) + assert ev.sample_rate is None +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_event_ingest.py -q` + Expected: FAIL with `ModuleNotFoundError: No module named 'sfm.event_ingest'`. + +- [ ] **Step 3: Implement.** Create `sfm/event_ingest.py`: + +```python +"""Store an event SFM downloaded from a unit -- the SDM side of +POST /device/events/download. + +Both series end in the two writes every other ingest path makes: the waveform +store (file + sidecar + .h5) and SeismoDb.insert_events(). The database matches +rows on (serial, timestamp), so storing an event already there -- by an earlier +download, or by THOR's watcher -- refreshes the row instead of duplicating it. +""" +from __future__ import annotations + +import datetime +from pathlib import Path +from typing import Any, Optional + +from sfm.device_access.models import DownloadedEvent, EventDownload + + +class IngestError(Exception): + """Downloaded from the unit, but could not be stored.""" + + +def backfill_series3_event(ev: Any, cc: Any) -> None: + """Compliance-config values that supersede what the 5A stream decoded. + + Some STRT fields have ambiguous semantics (STRT[20] is rectime, but + STRT[8:10] / STRT[16:18] are device-specific scratch, not reliable sample or + pre-trigger counts). Shared with GET /device/event/{i}/blastware_file. + """ + if not cc: + return + if ev.sample_rate is None and cc.sample_rate: + ev.sample_rate = cc.sample_rate + if cc.record_time: + # Authoritative: the user-set value the unit followed when recording. + ev.rectime_seconds = cc.record_time + # Derive total_samples from sample_rate x rectime when we can; the + # STRT-derived value can land at a buffer offset rather than a count. + if ev.sample_rate and ev.rectime_seconds: + derived = int(round(ev.sample_rate * ev.rectime_seconds)) + if (ev.total_samples is None + or ev.total_samples > derived * 2 + or ev.total_samples < derived // 4): + ev.total_samples = derived + + +def _event_dt(ev: Any) -> Optional[datetime.datetime]: + ts = getattr(ev, "timestamp", None) + try: + return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) + except Exception: # noqa: BLE001 + return None + + +def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownload: + if dl.series == 4: + ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename), + serial_hint=dl.serial) + family = "series4" + else: + ev = dl.event + backfill_series3_event(ev, dl.compliance) + geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None + rec = store.save(ev, serial=dl.serial, a5_frames=dl.a5_frames, + geo_range=geo_range if geo_range is not None else "normal") + family = "series3" + if ev is None or ev._waveform_key is None: + raise IngestError(f"{dl.filename}: stored the file but could not build a database row") + inserted, _skipped = db.insert_events( + [ev], serial=dl.serial, + waveform_records={ev._waveform_key.hex(): rec}, device_family=family) + row_id = None + dt = _event_dt(ev) + if dt is not None: + rows = db.query_events(serial=dl.serial, from_dt=dt, to_dt=dt, limit=1) + row_id = rows[0]["id"] if rows else None + return EventDownload( + event_id=dl.event_id, serial=dl.serial, series=dl.series, db_event_id=row_id, + stored_filename=rec["filename"], filesize=rec["filesize"], sha256=rec.get("sha256"), + inserted=inserted > 0, verified=dl.verified, detail=dict(dl.detail), + ) +``` + + In `sfm/server.py`: + - Add `from sfm.event_ingest import backfill_series3_event, persist_download` after `from sfm import db_snapshot`. + - In `device_event_blastware_file`, replace this block: + +```python + cc = info.compliance_config + # Backfill authoritative compliance-config values onto the + # Event before persisting. These supersede whatever + # _decode_a5_waveform read from the STRT bytes (some of which + # have ambiguous semantics — e.g. STRT[20] is rectime but + # STRT[8:10] / STRT[16:18] are device-specific scratch fields + # that aren't reliable sample/pretrig counts). + if cc: + if ev.sample_rate is None and cc.sample_rate: + ev.sample_rate = cc.sample_rate + if cc.record_time: + # record_time from compliance is authoritative — the + # user-set value the device followed when recording. + ev.rectime_seconds = cc.record_time + # Derive total_samples from sample_rate × rectime when + # we can; the STRT-derived value can land at a buffer- + # offset rather than a sample count. + if ev.sample_rate and ev.rectime_seconds: + derived = int(round(ev.sample_rate * ev.rectime_seconds)) + if (ev.total_samples is None + or ev.total_samples > derived * 2 + or ev.total_samples < derived // 4): + ev.total_samples = derived +``` + + with + +```python + cc = info.compliance_config + backfill_series3_event(ev, cc) +``` + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_event_ingest.py -q` + Expected: 6 passed. + +- [ ] **Step 5: Commit and push.** Message: `feat(sfm): store a downloaded event -- one ingest for both series`. + +--- + +### Task 8: The endpoints + +**Files:** +- Modify: `sfm/server.py`: `_SERIAL_AWARE_PATHS`, `device_events`, new `device_events_download` +- Modify: `tests/test_server_device_access.py` + +**Interfaces:** +- Consumes: Tasks 6–7. +- Produces: + - `GET /device/events?serial=…` → `EventList` as JSON. + - `POST /device/events/download?serial=…&event_id=…` → `EventDownload` as JSON. + +- [ ] **Step 1: Write the failing tests.** In `tests/test_server_device_access.py`: + - Change the `da` fixture's factories to `lambda a, **kw: s3q.pop(0)` and `lambda a, **kw: s4q.pop(0)`. + - Add `"/device/events", "/device/events/download"` to the path list of `test_guard_allows_um_serial_on_serial_aware_routes_and_hangup`. + - Append: + +```python +# ── events ──────────────────────────────────────────────────────────────────── + +from sfm.database import SeismoDb # noqa: E402 +from sfm.waveform_store import WaveformStore # noqa: E402 + +W_ID = "UM20147:055d4a81:20250531135901" + + +@pytest.fixture +def sdm(tmp_path, monkeypatch): + db = SeismoDb(tmp_path / "seismo.db") + store = WaveformStore(tmp_path / "waveforms") + monkeypatch.setattr(srv, "_get_db", lambda: db) + monkeypatch.setattr(srv, "_get_store", lambda: store) + return store, db + + +EV = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034) + + +@pytest.mark.parametrize("serial,series", [("UM20147", 4), ("BE18193", 3)]) +def test_events_with_a_serial_return_the_shared_list(da, serial, series): + out = srv.device_events(debug=False, force=False, serial=serial, **EV) + assert (out["serial"], out["series"], len(out["events"])) == (serial, series, 2) + assert set(out["events"][0]) == {"event_id", "serial", "series", "index", "timestamp", + "record_type", "peak_vector_sum_ips", "peaks_ips", + "filename", "detail"} + + +def test_events_without_a_serial_run_the_legacy_path(monkeypatch): + class Legacy(Exception): + pass + + def untouchable(): + raise AssertionError("DeviceAccess must not be used without a serial") + + def legacy_cache(): + raise Legacy() + monkeypatch.setattr(srv, "_device_access", untouchable) + monkeypatch.setattr(srv, "get_cache", legacy_cache) + with pytest.raises(Legacy): + srv.device_events(debug=False, force=False, serial=None, **EV) + + +def test_download_stores_the_event_and_says_where(da, sdm): + out = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert out["inserted"] is True and out["verified"] is True + assert out["stored_filename"] == "UM20147_20250531135901.IDFW" + _store, db = sdm + assert db.get_event(out["db_event_id"])["serial"] == "UM20147" + + +def test_downloading_it_again_refreshes_the_same_row(da, sdm): + first = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + again = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert again["inserted"] is False and again["db_event_id"] == first["db_event_id"] + + +@pytest.mark.parametrize("event_id,status", [ + ("UM12947:055d4a81:20250531135901", 422), # another unit's event + ("garbage", 422), + ("UM20147:055d4a81:20240101000000", 409), # stale: erased since listed + ("UM20147:deadbeef:-", 404), +]) +def test_download_errors_have_their_statuses(da, sdm, event_id, status): + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=event_id, **EV) + assert ei.value.status_code == status + assert sdm[1].query_events(serial="UM20147") == [] + + +def test_a_decode_that_disagrees_is_502_and_nothing_is_stored(da, sdm, monkeypatch): + from micromate.client import DecodeMismatch + + def mismatch(*a, **kw): + raise DecodeMismatch("decoded PVS differs by +5%") + fake = FakeMicromateClient() + fake.fetch_event = mismatch + monkeypatch.setattr(da, "_s4_factory", lambda a, **kw: fake) + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert ei.value.status_code == 502 + assert sdm[1].query_events(serial="UM20147") == [] + + +def test_a_store_failure_is_500_and_names_what_was_downloaded(da, monkeypatch): + class BrokenStore: + def save_imported_idf(self, *a, **kw): + raise OSError("disk full") + monkeypatch.setattr(srv, "_get_store", lambda: BrokenStore()) + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert ei.value.status_code == 500 + assert "UM20147_20250531135901.IDFW" in ei.value.detail and "disk full" in ei.value.detail +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_server_device_access.py -q` + Expected: FAIL with `TypeError: device_events() got an unexpected keyword argument 'serial'`, and `AttributeError ... device_events_download`. + +- [ ] **Step 3: Implement.** In `sfm/server.py`: + + `_SERIAL_AWARE_PATHS` becomes: + +```python +_SERIAL_AWARE_PATHS = frozenset({ + "/device/info", "/device/connect", "/device/monitor/status", "/device/settings", + "/device/events", "/device/events/download", +}) +``` + + `device_events`: + - Change the `baud` line to ` baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"),`. + - Add ` serial: Optional[str] = Query(None, description=_SERIAL_DOC),` as the last parameter. + - Add this paragraph at the top of its docstring: + +``` + **With `serial`** (UM... or BE.../BA...): the unit's events in the shared + shape for either series, read from headers only -- no event is downloaded + to list it -- and not cached. Each carries an `event_id` for + POST /device/events/download. Without `serial`, the legacy Series-3 + behaviour below. +``` + + - Insert as the first statements after the docstring, before the `log.info(...)` line: + +```python + if serial: + return _via_device_access( + lambda: _device_access().list_events(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud +``` + + Add the new handler right after `device_settings`: + +```python +@app.post("/device/events/download") +def device_events_download( + serial: str = Query(..., description=_SERIAL_DOC), + event_id: str = Query(..., description="From GET /device/events?serial=..."), + port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"), + baud: Optional[int] = Query(None, description="Serial baud (default by series)"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """Download one event, check it, and store it in SFM's database. + + Read-only on the unit. The stored file and waveform are then at + /db/events/{db_event_id}/... . Storing an event that is already stored + refreshes its row (`inserted: false`). The unit is busy for the whole + download: other requests for it wait, then get 423. + """ + try: + dl = _device_access().download_event(_unit_address(port, baud, host, tcp_port), serial, event_id) + except DeviceError as exc: + raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc + try: + out = persist_download(dl, store=_get_store(), db=_get_db()) + except Exception as exc: + log.error("events/download: %s downloaded but not stored: %s", dl.event_id, exc, exc_info=True) + raise HTTPException( + status_code=500, + detail=f"downloaded {dl.filename} from the unit but could not store it: {exc}") from exc + return dataclasses.asdict(out) +``` + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_server_device_access.py -q` + Expected: all pass. + +- [ ] **Step 5: Run the full suite.** + Run: `.venv/bin/python -m pytest -q 2>&1 | tail -3` + Expected: exactly the 16 pre-existing failures; everything else passes. + +- [ ] **Step 6: Commit and push.** Message: `feat(sfm): list and download events by serial for both series`. + +--- + +### Task 9: Bench check on UM20147, and the record + +**Files:** +- Modify: `CLAUDE.md`, `README.md`, `docs/micromate_protocol_reference.md` +- Scratch (not committed): a launcher and a probe script in the session scratchpad + +Read-only throughout. UM20147 is on `/dev/ttyACM0`, which needs `sg dialout -c "..."`. The server runs on **port 8299** with a **scratch database**, never the dev DB and never port 8200. Start the server, query it and stop it **within one Bash command**: shell state does not persist between calls. + +- [ ] **Step 1: Write the launcher** at `/sfm_bench.py`: + +```python +import sys +from pathlib import Path + +sys.path.insert(0, "/home/serversdown/seismo-relay") +import uvicorn # noqa: E402 +import sfm.server as srv # noqa: E402 + +srv._DEFAULT_DB_PATH = Path(sys.argv[1]) # scratch DB, created on first use +uvicorn.run(srv.app, host="127.0.0.1", port=8299, log_level="info") +``` + +- [ ] **Step 2: One command.** It must: + - start the launcher under `sg dialout`, with the DB at `/bench1b/seismo.db` and the log at `/bench1b/server.log`; + - wait for `GET /health`; + - run the calls below; + - kill the server by PID (`pgrep -f sfm_bench.py`) and confirm it is gone. + +```bash +B="http://127.0.0.1:8299"; U="serial=UM20147&port=/dev/ttyACM0" +curl -s "$B/device/monitor/status?$U" # event_count +curl -s "$B/device/events?$U" > /bench1b/events.json # the list +# pick the first waveform's and the first histogram's event_id from events.json (python -c ...) +curl -s -X POST "$B/device/events/download?$U&event_id=" +curl -s -X POST "$B/device/events/download?$U&event_id=" # again: inserted false, same db_event_id +curl -s -X POST "$B/device/events/download?$U&event_id=" +curl -s -o /bench1b/w.bin "$B/db/events//blastware_file" +curl -s -o /dev/null -w "%{http_code}\n" -X POST "$B/device/events/download?$U&event_id=" # 409 +curl -s -X POST "$B/device/hangup?port=/dev/ttyACM0" +``` + + Check each of these, and report every one: + - the list's length equals status's `event_count`; + - every event has a non-null timestamp, record_type and filename; + - the waveform download has `verified: true`, and the histogram `verified: null`; + - the second download has `inserted: false` with the same `db_event_id`; + - the size of `w.bin` equals that event's `detail.size_bytes`; + - the altered id gives 409; + - the server log shows ONE call-up for the whole sequence, then a hang-up. + +- [ ] **Step 3: Measure direct-by-key download (a read; protocol finding).** With the server stopped, run a scratch script under `sg dialout`: + - `MicromateClient` over `SerialTransport("/dev/ttyACM0", 115200)`, then `open()` and `connect()`; + - `refs = list_events()`; + - for the same waveform, `direct = download_event(ref, chunk_size=1024)` with the cursor parked at the end of the chain; + - `walked = ` the same bytes via `iter_events()` at the cursor; + - compare `direct == walked` and both against `w.bin`. + + Record the result in `docs/micromate_protocol_reference.md`, in the section on event download (find "iter_events" or "cursor"). Use a dated (2026-10-21+) and **graded** line: *measured on one unit over USB, N events*. Do NOT change `s4_download_event`; switching paths is a later decision. + +- [ ] **Step 4: The record.** + - `CLAUDE.md`: in the "SFM speaks Series 4 by serial" bullet, add one sentence: phase 1b lists and downloads events by serial for both series (MiniMate list from headers only, no 5A), with downloads stored in SFM's DB. ⚠ The MiniMate header walk is **unproven on a unit; a MiniMate bench check is owed before the branch merges.** + - In the "SFM REST API" live-device list, add `GET /device/events?serial=` and `POST /device/events/download`. + - `README.md`: in the device endpoints section, document both, including: + - `event_id` and the 409-on-stale behaviour; + - that downloading stores the event and returns `db_event_id`; + - that a re-download refreshes the row; + - that the unit is busy for the whole download. + +- [ ] **Step 5: Commit and push.** Message: `docs: phase 1b bench-checked on UM20147 -- events by serial for both series`. + +--- + +## Self-review notes + +- **Spec rows 4–5:** + - Tasks 1/4: S3 list and download. + - Tasks 2/5: S4. + - Task 6: one door. + - Task 7: store. + - Task 8: endpoints. + - Task 9: hardware. + - The 1b decisions in the spec map to Tasks 1 (header walk), 7 (download stores), 3 (event_id) and 5 (walk-to-event, THOR chunk size). +- **The MiniMate bench check is deliberately not a task.** No MiniMate is on the bench. Task 9 records it as owed before merge, in CLAUDE.md as well as in the spec. +- **Not in 1b:** + - event delete; + - the 64 KB page fix (only named, in Task 4); + - a byte-level verification for Series 3 (`verified` is None for Series 3: there is no self-check to run); + - caching on the serial path. -- 2.54.1 From d5484d10c0fb28df46fec03c7316edf0162c65f6 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:50:26 -0400 Subject: [PATCH 030/223] feat(minimateplus): list events from headers, download one without the rest list_event_headers() walks every event's 0A/1E/0C/1F without starting a 5A. download_event_by_key() downloads one event in full and walks past the others without their 5A, stopping once it has it. Both ride two new keyword options on get_events() (headers_only, only_key); the default path is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 38 +++++++- tests/test_minimate_event_headers.py | 137 +++++++++++++++++++++++++++ 2 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 tests/test_minimate_event_headers.py diff --git a/minimateplus/client.py b/minimateplus/client.py index 49f3e83..9a40328 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -450,7 +450,7 @@ class MiniMateClient: proto.confirm_erase_all() log.info("delete_all_events: erase confirmed — device memory cleared") - def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1) -> list[Event]: + def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1, headers_only: bool = False, only_key: Optional[bytes] = None) -> list[Event]: """ Download all stored events from the device using the confirmed 1E → 0A → 0C → 5A → 1F event-iterator protocol. @@ -479,6 +479,10 @@ class MiniMateClient: Raises: ProtocolError: on unrecoverable communication failure. + headers_only: never start a 5A -- every event takes the bypass below. + only_key: download only the event with this key (in full, per + full_waveform); walk the others without their 5A, and stop once + that event is read. """ proto = self._require_proto() @@ -577,6 +581,11 @@ class MiniMateClient: "get_events: key=%s (key, ts=%s) match — skipping 5A bulk download", cur_key.hex(), actual_ts, ) + elif headers_only or (only_key is not None and cur_key != only_key): + # The same bypass as a (key, ts) match: 0A + 1E(arm) + 0C were + # read; 1F(arm) + POLL + 5A are not sent, and 1F(browse) below is + # safe because no 5A was ever started. + skip_5a = True arm_key4: Optional[bytes] = None a5_ok = False @@ -713,6 +722,10 @@ class MiniMateClient: events.append(ev) idx += 1 + if only_key is not None and cur_key == only_key: + log.info("get_events: read key=%s -- stopping", cur_key.hex()) + break + # Early exit: if the caller only wants events up to a specific # index, stop iterating once we've collected it. if stop_after_index is not None and idx > stop_after_index: @@ -741,6 +754,29 @@ class MiniMateClient: log.info("get_events: downloaded %d event(s)", len(events)) return events + def list_event_headers(self) -> list[Event]: + """Every stored event's 0C record -- timestamp, type, peaks -- without its 5A. + + `get_events()` downloads every event in full even for metadata + (`stop_after_metadata` is a no-op), so listing that way costs one + complete download per event. This walks 0A + 1E(arm) + 0C + 1F(browse) + per event -- the bypass `skip_waveform_for_events` already takes -- and + never starts a 5A. The events carry no `_a5_frames`. + """ + return self.get_events(headers_only=True) + + def download_event_by_key(self, key4: bytes) -> Optional[Event]: + """Download ONE event in full; walk past the events before it without + their 5A. None if no full record has that key. + + `get_events(stop_after_index=N)` downloads events 0..N in full and keeps + one; this downloads only the one asked for. + """ + for ev in self.get_events(full_waveform=True, only_key=key4): + if ev._waveform_key == key4: + return ev + return None + def download_waveform(self, event: Event) -> None: """ Download the full raw ADC waveform for a previously-retrieved event diff --git a/tests/test_minimate_event_headers.py b/tests/test_minimate_event_headers.py new file mode 100644 index 0000000..fee5322 --- /dev/null +++ b/tests/test_minimate_event_headers.py @@ -0,0 +1,137 @@ +"""MiniMateClient's header-only walk: list without 5A, download one without the rest.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.client as mc # noqa: E402 +from minimateplus.client import MiniMateClient # noqa: E402 +from minimateplus.models import Timestamp # noqa: E402 + +END = b"\x00" * 8 +KEYS = [bytes.fromhex(k) for k in ("01110000", "0111245a", "01114290")] +STAMPS = { + KEYS[0]: (2026, 10, 1, 8, 0, 0), + KEYS[1]: (2026, 10, 2, 9, 30, 15), + KEYS[2]: (2026, 10, 3, 17, 45, 59), +} + + +class FakeProto: + """Records every call; serves a three-event chain the way the unit does.""" + + def __init__(self, keys=KEYS, partial=()): + self.keys = list(keys) + self.partial = set(partial) + self.calls: list[tuple] = [] + self._pos = 0 + + def _entry(self, i): + if i >= len(self.keys): + return b"\x00\x00\x00\x00", END + return self.keys[i], self.keys[i] + b"\x00\x00\x00\x46" + + def read_event_first(self, token=0): + self.calls.append(("1E", token)) + if token == 0: + self._pos = 0 + return self._entry(self._pos) + + def read_waveform_header(self, key4): + self.calls.append(("0A", key4)) + return b"", (0x2C if key4 in self.partial else 0x46) + + def read_waveform_record(self, key4): + self.calls.append(("0C", key4)) + return key4 # decoded by the patched decoder below + + def advance_event(self, browse=False): + self.calls.append(("1F", "browse" if browse else "arm")) + if browse: + self._pos += 1 + return self._entry(self._pos) + return self._entry(self._pos + 1) + + def poll(self): + self.calls.append(("POLL",)) + + def read_bulk_waveform_stream(self, key4, **kw): + self.calls.append(("5A", key4)) + return ["frame"] + + +@pytest.fixture +def client(monkeypatch): + def decode_record(record, ev): + y, mo, d, h, mi, s = STAMPS[record] + ev.timestamp = Timestamp(raw=b"", flag=0x10, year=y, unknown_byte=0, + month=mo, day=d, hour=h, minute=mi, second=s) + ev.record_type = "Waveform" + monkeypatch.setattr(mc, "_decode_waveform_record_into", decode_record) + monkeypatch.setattr(mc, "_decode_a5_metadata_into", lambda frames, ev: None) + monkeypatch.setattr(mc, "_decode_a5_waveform", lambda frames, ev: None) + + def make(proto): + c = MiniMateClient(port="/dev/null") + c._proto = proto + return c + return make + + +def _subs(proto): + return [c[0] for c in proto.calls] + + +def test_listing_headers_never_starts_a_5a(client): + proto = FakeProto() + events = client(proto).list_event_headers() + assert [e._waveform_key for e in events] == KEYS + assert "5A" not in _subs(proto) and "POLL" not in _subs(proto) + assert ("1F", "arm") not in proto.calls + assert all(e._a5_frames is None for e in events) + + +def test_listing_headers_sends_only_the_commands_get_events_already_sends(client): + proto = FakeProto() + client(proto).list_event_headers() + assert _subs(proto) == ["1E"] + ["0A", "1E", "0C", "1F"] * len(KEYS) + + +def test_listed_events_carry_their_timestamps(client): + events = client(FakeProto()).list_event_headers() + assert (events[1].timestamp.day, events[1].timestamp.second) == (2, 15) + + +def test_downloading_one_event_starts_exactly_one_5a(client): + proto = FakeProto() + ev = client(proto).download_event_by_key(KEYS[1]) + assert ev is not None and ev._waveform_key == KEYS[1] + assert [c for c in proto.calls if c[0] == "5A"] == [("5A", KEYS[1])] + assert ev._a5_frames == ["frame"] + + +def test_downloading_one_event_stops_once_it_has_it(client): + proto = FakeProto() + client(proto).download_event_by_key(KEYS[1]) + assert ("0A", KEYS[2]) not in proto.calls + + +def test_the_events_before_it_are_walked_without_their_5a(client): + proto = FakeProto() + client(proto).download_event_by_key(KEYS[2]) + assert [c[1] for c in proto.calls if c[0] == "5A"] == [KEYS[2]] + assert proto.calls.count(("1F", "arm")) == 1 + + +def test_a_key_that_is_not_stored_returns_none(client): + assert client(FakeProto()).download_event_by_key(bytes.fromhex("0111ffff")) is None + + +def test_a_partial_record_is_skipped_by_both(client): + events = client(FakeProto(partial={KEYS[1]})).list_event_headers() + assert [e._waveform_key for e in events] == [KEYS[0], KEYS[2]] + assert client(FakeProto(partial={KEYS[1]})).download_event_by_key(KEYS[1]) is None -- 2.54.1 From 83d1a98c1c9954a018bfae10b10db4335775cea1 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:52:43 -0400 Subject: [PATCH 031/223] feat(micromate): fetch_event returns the bytes with the checked decode get_event() now delegates to fetch_event(), which returns (blob, result). The same peak-vector-sum self-check applies, so a DecodeMismatch still stops the bytes from being stored. get_event() keeps its signature and behaviour. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/client.py | 13 ++++++++- tests/test_micromate_events.py | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/micromate/client.py b/micromate/client.py index b73f2f5..c29efe2 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -550,6 +550,17 @@ class MicromateClient: Histograms are not verified: `samples` is empty for them. """ + return self.fetch_event(ref, verify=verify, tolerance=tolerance, + chunk_size=chunk_size)[1] + + def fetch_event(self, ref: MicromateEventRef, *, verify: bool = True, + tolerance: float = 0.01, chunk_size: Optional[int] = None): + """`get_event()`, returning the raw bytes too: `(blob, result)`. + + For a caller that stores the file AND wants the self-check: the bytes go + to the waveform store unchanged, and a DecodeMismatch stops them being + stored at all. + """ if not ref.record_type: raise ValueError( f"event {ref.key_hex}: record_type is unknown, so the codec " @@ -580,7 +591,7 @@ class MicromateClient: ) if err is not None: log.debug("event %s: PVS agrees to %+.4f%%", ref.uid, 100 * err) - return result + return blob, result @staticmethod def decode_error(ref: MicromateEventRef, result) -> Optional[float]: diff --git a/tests/test_micromate_events.py b/tests/test_micromate_events.py index 883ed26..550c411 100644 --- a/tests/test_micromate_events.py +++ b/tests/test_micromate_events.py @@ -343,3 +343,52 @@ def test_a_corrupted_stored_peak_is_caught_by_the_self_check(): mm.get_event(ref, chunk_size=1024) return pytest.fail("no waveform event found in the capture") + + +# ── fetch_event: the bytes and the checked decode together ─────────────────── + +import math # noqa: E402 + +UM20147_W = Path(__file__).parent / "fixtures" / "thor-idf" / "UM20147_20250531135901.IDFW" + + +def _our_pvs(result): + from micromate.idf_file import geo_count_to_ips + ch = {k.lower(): v for k, v in result.samples.items()} + t, v, l = ch["tran"], ch["vert"], ch["long"] + return max(math.sqrt(geo_count_to_ips(t[i]) ** 2 + geo_count_to_ips(v[i]) ** 2 + + geo_count_to_ips(l[i]) ** 2) + for i in range(min(len(t), len(v), len(l)))) + + +def _fixture_client(monkeypatch, blob): + mm, _t = client([]) + monkeypatch.setattr(mm, "download_event", lambda ref, chunk_size=None: blob) + return mm + + +def _w_ref(pvs): + return MicromateEventRef( + index=0, key=bytes.fromhex("055d4a81"), size=UM20147_W.stat().st_size, + serial="UM20147", record_type="waveform", + timestamp=datetime.datetime(2025, 5, 31, 13, 59, 1), peak_vector_sum_ips=pvs) + + +def test_fetch_event_returns_the_downloaded_bytes_with_the_decode(monkeypatch): + blob = UM20147_W.read_bytes() + mm = _fixture_client(monkeypatch, blob) + probe = mm.fetch_event(_w_ref(None), verify=False)[1] + got, result = mm.fetch_event(_w_ref(_our_pvs(probe))) + assert got == blob and result.samples + + +def test_fetch_event_refuses_a_decode_that_disagrees_with_the_unit(monkeypatch): + mm = _fixture_client(monkeypatch, UM20147_W.read_bytes()) + probe = mm.fetch_event(_w_ref(None), verify=False)[1] + with pytest.raises(DecodeMismatch): + mm.fetch_event(_w_ref(_our_pvs(probe) * 1.05)) + + +def test_get_event_is_fetch_event_without_the_bytes(monkeypatch): + mm = _fixture_client(monkeypatch, UM20147_W.read_bytes()) + assert mm.get_event(_w_ref(None), verify=False).samples -- 2.54.1 From c85244e0fec0c6c06ad1a601882f5e96db91a5d3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:54:53 -0400 Subject: [PATCH 032/223] feat(sfm): event models and event_id -- serial, key and timestamp Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 10 +++-- sfm/device_access/errors.py | 10 +++++ sfm/device_access/events.py | 51 +++++++++++++++++++++++++ sfm/device_access/models.py | 60 +++++++++++++++++++++++++++++- tests/test_device_access_events.py | 53 ++++++++++++++++++++++++++ 5 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 sfm/device_access/events.py create mode 100644 tests/test_device_access_events.py diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index 2093308..8c82123 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -1,9 +1,13 @@ """One door for every device request -- see the 2026-10-20 parity spec.""" from .errors import ( - BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, MalformedReply, - NoAnswer, NotSupported, UnitBusy, WrongUnit, translate, + BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, EventNotFound, + MalformedReply, NoAnswer, NotSupported, StaleEvent, UnitBusy, WrongUnit, + translate, +) +from .models import ( + DownloadedEvent, EventDownload, EventList, EventRef, UnitAddress, UnitInfo, + UnitSettings, UnitStatus, ) -from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial, series_for_serial from .locks import UnitLocks from .access import DeviceAccess diff --git a/sfm/device_access/errors.py b/sfm/device_access/errors.py index b0ab7ad..728ba35 100644 --- a/sfm/device_access/errors.py +++ b/sfm/device_access/errors.py @@ -41,6 +41,16 @@ class MalformedReply(DeviceError): http_status = 502 +class EventNotFound(DeviceError): + http_status = 404 + + +class StaleEvent(DeviceError): + """The event at that key is not the one listed -- the unit was erased, or + its memory wrapped, since the list was read.""" + http_status = 409 + + _TIMEOUTS = (_mm_proto.TimeoutError, _mmp_proto.TimeoutError) _PROTOCOL = (_mm_proto.ProtocolError, _mmp_proto.ProtocolError) diff --git a/sfm/device_access/events.py b/sfm/device_access/events.py new file mode 100644 index 0000000..980a583 --- /dev/null +++ b/sfm/device_access/events.py @@ -0,0 +1,51 @@ +"""Event identity. An `event_id` is `::`. + +The key alone is not enough: both series reuse keys (a MiniMate restarts at +01110000 after an erase; every Micromate's counter starts at the same value). +The timestamp turns a stale id into a loud StaleEvent instead of a download of +whatever now sits at that key. "-" stands in for an unknown timestamp. +""" +from __future__ import annotations + +import datetime +from typing import Optional, Tuple + +from .errors import BadRequest +from .series import normalise_serial + +_NO_STAMP = "-" +_STAMP_FMT = "%Y%m%d%H%M%S" + + +def stamp_of(dt: Optional[datetime.datetime]) -> Optional[str]: + return dt.strftime(_STAMP_FMT) if dt is not None else None + + +def iso_of(dt: Optional[datetime.datetime]) -> Optional[str]: + return dt.isoformat() if dt is not None else None + + +def make_event_id(serial: str, key: bytes, stamp: Optional[str]) -> str: + return f"{normalise_serial(serial)}:{key.hex()}:{stamp or _NO_STAMP}" + + +def parse_event_id(event_id: str, serial: str) -> Tuple[bytes, Optional[str]]: + """(key, stamp) for an id that belongs to `serial`; BadRequest otherwise.""" + parts = (event_id or "").strip().split(":") + if len(parts) != 3: + raise BadRequest(f"not an event_id: {event_id!r} -- take it from GET /device/events") + id_serial, key_hex, stamp = parts + if normalise_serial(id_serial) != normalise_serial(serial): + raise BadRequest(f"event_id {event_id!r} belongs to {id_serial}, not {serial}") + try: + key = bytes.fromhex(key_hex) + except ValueError: + key = b"" + if len(key) != 4: + raise BadRequest(f"event_id {event_id!r}: the key must be 8 hex digits") + if stamp != _NO_STAMP: + try: + datetime.datetime.strptime(stamp, _STAMP_FMT) + except ValueError: + raise BadRequest(f"event_id {event_id!r}: bad timestamp {stamp!r}") from None + return key, (None if stamp == _NO_STAMP else stamp) diff --git a/sfm/device_access/models.py b/sfm/device_access/models.py index 5f18b01..3f0aa19 100644 --- a/sfm/device_access/models.py +++ b/sfm/device_access/models.py @@ -3,7 +3,7 @@ series; anything only one series has goes under `detail`.""" from __future__ import annotations from dataclasses import dataclass, field -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from .errors import BadRequest @@ -66,3 +66,61 @@ class UnitSettings: geo_trigger_ips: Optional[float] notes: Dict[str, str] = field(default_factory=dict) detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class EventRef: + """One stored event, as listed. `event_id` is opaque: pass it back to + download the event. `index` is its position in the list right now; an + erase renumbers it, so it is for display, never identity.""" + event_id: str + serial: str + series: int + index: int + timestamp: Optional[str] # ISO, the unit's own local time + record_type: Optional[str] # "waveform" | "histogram" + peak_vector_sum_ips: Optional[float] + peaks_ips: Dict[str, float] # geophones only: tran / vert / long + filename: Optional[str] # the name the vendor's software gives it + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class EventList: + serial: str + series: int + events: List[EventRef] + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class EventDownload: + """What a download stored. The file and waveform are then served at + /db/events/{db_event_id}/... .""" + event_id: str + serial: str + series: int + db_event_id: Optional[str] + stored_filename: str + filesize: int + sha256: Optional[str] + inserted: bool # False: already stored; the row was refreshed + verified: Optional[bool] # True: decode self-check passed; None: no check exists + detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class DownloadedEvent: + """The device side's result, before SFM stores it. Not an HTTP shape: it + carries the payload -- a Series-3 Event + its 5A frames + the compliance + config, or a Series-4 file's bytes -- to sfm.event_ingest.""" + event_id: str + serial: str + series: int + filename: str + verified: Optional[bool] + idf_bytes: Optional[bytes] = field(default=None, repr=False) + event: Any = field(default=None, repr=False) + a5_frames: Optional[list] = field(default=None, repr=False) + compliance: Any = field(default=None, repr=False) + detail: Dict[str, Any] = field(default_factory=dict) diff --git a/tests/test_device_access_events.py b/tests/test_device_access_events.py new file mode 100644 index 0000000..cd51d4e --- /dev/null +++ b/tests/test_device_access_events.py @@ -0,0 +1,53 @@ +"""Event identity: serial + key + timestamp, so a stale or foreign id fails loudly.""" +from __future__ import annotations + +import datetime +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from sfm.device_access.errors import BadRequest, EventNotFound, StaleEvent # noqa: E402 +from sfm.device_access.events import ( # noqa: E402 + iso_of, make_event_id, parse_event_id, stamp_of, +) + +KEY = bytes.fromhex("055d4a81") +WHEN = datetime.datetime(2025, 5, 31, 13, 59, 1) + + +def test_an_event_id_round_trips(): + eid = make_event_id("um20147", KEY, stamp_of(WHEN)) + assert eid == "UM20147:055d4a81:20250531135901" + assert parse_event_id(eid, "UM20147") == (KEY, "20250531135901") + + +def test_an_unknown_timestamp_round_trips_as_none(): + eid = make_event_id("BE18193", bytes.fromhex("01110000"), None) + assert eid == "BE18193:01110000:-" + assert parse_event_id(eid, "be18193") == (bytes.fromhex("01110000"), None) + + +def test_an_id_from_another_unit_is_refused(): + # UM12947 and UM20147 both have an event 055d4a81 + with pytest.raises(BadRequest, match="UM12947"): + parse_event_id("UM12947:055d4a81:20250531135901", "UM20147") + + +@pytest.mark.parametrize("bad", ["", "UM20147", "UM20147:055d4a81", + "UM20147:zz:20250531135901", "UM20147:055d4a:20250531135901", + "UM20147:055d4a81:2025"]) +def test_a_malformed_id_is_refused(bad): + with pytest.raises(BadRequest): + parse_event_id(bad, "UM20147") + + +def test_iso_and_stamp_of_none_are_none(): + assert iso_of(None) is None and stamp_of(None) is None + assert iso_of(WHEN) == "2025-05-31T13:59:01" + + +def test_the_new_errors_have_their_statuses(): + assert (EventNotFound.http_status, StaleEvent.http_status) == (404, 409) -- 2.54.1 From b79309eb723efc6be433d8cc0c2f399d00cde403 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:57:26 -0400 Subject: [PATCH 033/223] feat(sfm): Series-3 events -- header list, one-event download, stale ids refused Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 104 ++++++++++++++++++++++--- tests/device_access_fakes.py | 44 ++++++++++- tests/test_device_access_s3_events.py | 105 ++++++++++++++++++++++++++ 3 files changed, 242 insertions(+), 11 deletions(-) create mode 100644 tests/test_device_access_s3_events.py diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 7d96e27..b513327 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -2,14 +2,18 @@ MiniMates -- a held session waits for the bench test in the spec.""" from __future__ import annotations +import datetime import logging -from typing import Any, Callable +import struct +from typing import Any, Callable, Optional from minimateplus import MiniMateClient +from minimateplus.blastware_file import blastware_filename from minimateplus.transport import TcpTransport -from .errors import DeviceError, MalformedReply, NoAnswer, WrongUnit, translate -from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, StaleEvent, WrongUnit, translate +from .events import iso_of, make_event_id, stamp_of +from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus log = logging.getLogger("sfm.device_access") @@ -17,10 +21,16 @@ S3_DEFAULT_BAUD = 38400 S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "Histogram + Continuous"} -def default_s3_client_factory(address: UnitAddress, timeout: float = 10.0) -> MiniMateClient: +S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use + + +def default_s3_client_factory(address: UnitAddress, timeout: Optional[float] = None) -> MiniMateClient: if address.host: - return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), timeout=timeout) - return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD) + return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), + timeout=10.0 if timeout is None else timeout) + if timeout is None: + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD) + return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD, timeout=timeout) def _close(client: Any) -> None: @@ -30,13 +40,47 @@ def _close(client: Any) -> None: log.debug("close failed", exc_info=True) +def _s3_dt(ev: Any) -> Optional[datetime.datetime]: + ts = getattr(ev, "timestamp", None) + if ts is None or ts.hour is None: + return None + try: + return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) + except (TypeError, ValueError): + return None + + +def _s3_filename(ev: Any, serial: str) -> Optional[str]: + try: + return blastware_filename(ev, serial) + except Exception: # noqa: BLE001 + return None + + +def _s3_ref(ev: Any, serial: str) -> EventRef: + dt = _s3_dt(ev) + pv = ev.peak_values + peaks = {} + if pv is not None: + peaks = {k: v for k, v in (("tran", pv.tran), ("vert", pv.vert), ("long", pv.long)) + if v is not None} + return EventRef( + event_id=make_event_id(serial, ev._waveform_key, stamp_of(dt)), + serial=serial, series=3, index=ev.index, timestamp=iso_of(dt), + record_type=ev.record_type.lower() if ev.record_type else None, + peak_vector_sum_ips=pv.peak_vector_sum if pv is not None else None, + peaks_ips=peaks, filename=_s3_filename(ev, serial), + detail={"mic_psi": pv.micl if pv is not None else None}, + ) + + class Series3Adapter: - def __init__(self, client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory) -> None: + def __init__(self, client_factory: Callable[..., Any] = default_s3_client_factory) -> None: self._factory = client_factory - def _run(self, address: UnitAddress, fn: Callable[[Any], Any]) -> Any: + def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None) -> Any: def attempt() -> Any: - client = self._factory(address) + client = self._factory(address) if timeout is None else self._factory(address, timeout=timeout) try: client.open() except Exception as exc: @@ -121,3 +165,45 @@ class Series3Adapter: "geo_range": cc.geo_range}, ) return self._run(address, op) + + def list_events(self, address: UnitAddress, serial: str) -> EventList: + def op(client: Any) -> EventList: + info = client.connect() + self._check(info.serial, serial, address) + return EventList(serial=serial, series=3, + events=[_s3_ref(ev, serial) for ev in client.list_event_headers()]) + return self._run(address, op, timeout=S3_EVENT_TIMEOUT) + + def download_event(self, address: UnitAddress, serial: str, key: bytes, + stamp: Optional[str]) -> DownloadedEvent: + def op(client: Any) -> DownloadedEvent: + info = client.connect() + self._check(info.serial, serial, address) + try: + ev = client.download_event_by_key(key) + except struct.error as exc: + # Inferred, not measured here: the known 5A page bug. An event past the unit's + # first 64 KB drives TERM's offset negative, and struct.pack rejects it + # (seismo-relay CLAUDE.md, "KNOWN BUG"). + raise MalformedReply( + f"event {key.hex()}: its download could not be assembled ({exc}) -- most " + "likely the known bug with events past the unit's first 64 KB; not saved" + ) from exc + if ev is None: + raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") + found = stamp_of(_s3_dt(ev)) + if stamp is not None and found != stamp: + raise StaleEvent( + f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " + "the unit was erased or wrapped since the list was read; list again") + if not ev._a5_frames: + raise MalformedReply(f"event {key.hex()}: no waveform data received (the 5A download failed)") + filename = _s3_filename(ev, serial) + if filename is None: + raise MalformedReply(f"event {key.hex()} has no usable timestamp, so it cannot be named or stored") + return DownloadedEvent( + event_id=make_event_id(serial, key, found), serial=serial, series=3, + filename=filename, verified=None, event=ev, a5_frames=ev._a5_frames, + compliance=info.compliance_config, detail={"a5_frames": len(ev._a5_frames)}, + ) + return self._run(address, op, timeout=S3_EVENT_TIMEOUT) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 3866085..5a498ba 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -6,12 +6,13 @@ call pops one, if any, and raises it. """ from __future__ import annotations +import copy import datetime from pathlib import Path from micromate.models import MicromateDeviceInfo, MicromateState from micromate.setup_block import decode_setup -from minimateplus.models import ComplianceConfig, DeviceInfo, MonitorStatus +from minimateplus.models import ComplianceConfig, DeviceInfo, Event, MonitorStatus, PeakValues, Timestamp SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um20147_baseline.bin" @@ -41,8 +42,29 @@ class _Base: self._open = False +def s3_event(index, key_hex, when, *, record_type="Waveform", pvs=0.12, frames=True): + ev = Event(index=index) + ev._waveform_key = bytes.fromhex(key_hex) + ev.timestamp = Timestamp(raw=b"", flag=0x10, year=when.year, unknown_byte=0, + month=when.month, day=when.day, hour=when.hour, + minute=when.minute, second=when.second) + ev.record_type = record_type + ev.peak_values = PeakValues(tran=0.05, vert=0.08, long=0.03, micl=0.0001, + peak_vector_sum=pvs) + if frames: + ev._a5_frames = ["frame"] + return ev + + +def default_s3_events(): + return [ + s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)), + s3_event(1, "0111245a", datetime.datetime(2026, 10, 2, 9, 30, 15), record_type="Histogram"), + ] + + class FakeMiniMateClient(_Base): - def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", **kw): + def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, **kw): super().__init__(**kw) self.serial = serial self.monitoring = monitoring @@ -54,6 +76,7 @@ class FakeMiniMateClient(_Base): operator="BH", sensor_location="Loc 1", notes=None, ) self.compliance = compliance + self.events = default_s3_events() if events is None else events def connect(self) -> DeviceInfo: self._step("connect") @@ -74,6 +97,23 @@ class FakeMiniMateClient(_Base): ) + def list_event_headers(self): + self._step("list_event_headers") + out = [] + for ev in self.events: + h = copy.copy(ev) + h._a5_frames = None + out.append(h) + return out + + def download_event_by_key(self, key4): + self._step("download_event_by_key") + for ev in self.events: + if ev._waveform_key == key4: + return ev + return None + + class _FakeProtocol: def __init__(self, owner): self._owner = owner diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py new file mode 100644 index 0000000..a4ba21a --- /dev/null +++ b/tests/test_device_access_s3_events.py @@ -0,0 +1,105 @@ +"""Series-3 events: listed from headers, one downloaded, mapped into the shared shape.""" +from __future__ import annotations + +import datetime +import os +import struct +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + EventNotFound, MalformedReply, StaleEvent, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s3 import Series3Adapter # noqa: E402 + +TCP = UnitAddress(host="10.0.0.5", tcp_port=12345, port=None, baud=None) +FIRST = bytes.fromhex("01110000") + + +def adapter(*clients): + queue = list(clients) + seen = [] + + def factory(address, **kw): + seen.append(kw) + return queue.pop(0) + a = Series3Adapter(client_factory=factory) + a.seen = seen + return a + + +def test_listing_maps_each_header_into_the_shared_shape(): + out = adapter(FakeMiniMateClient()).list_events(TCP, "BE18193") + assert (out.serial, out.series, len(out.events)) == ("BE18193", 3, 2) + e = out.events[1] + assert e.event_id == "BE18193:0111245a:20261002093015" + assert (e.index, e.timestamp, e.record_type) == (1, "2026-10-02T09:30:15", "histogram") + assert e.peaks_ips == {"tran": 0.05, "vert": 0.08, "long": 0.03} + assert e.peak_vector_sum_ips == 0.12 and e.detail["mic_psi"] == 0.0001 + assert e.filename and e.filename.startswith("T193") + + +def test_listing_uses_the_header_walk_and_the_long_timeout(): + fake = FakeMiniMateClient() + a = adapter(fake) + a.list_events(TCP, "BE18193") + assert "list_event_headers" in fake.calls and "download_event_by_key" not in fake.calls + assert a.seen == [{"timeout": 120.0}] + assert fake.closed == 1 + + +def test_listing_refuses_a_different_unit(): + with pytest.raises(WrongUnit): + adapter(FakeMiniMateClient(serial="BE11529")).list_events(TCP, "BE18193") + + +def test_download_returns_the_event_its_frames_and_the_settings(): + fake = FakeMiniMateClient() + dl = adapter(fake).download_event(TCP, "BE18193", FIRST, "20261001080000") + assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", None) + assert dl.event is fake.events[0] and dl.a5_frames == ["frame"] + assert dl.compliance is fake.compliance and dl.filename.startswith("T193") + + +def test_download_refuses_a_different_unit_before_downloading(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) + assert "download_event_by_key" not in fake.calls + + +def test_a_key_that_is_not_stored_is_404(): + with pytest.raises(EventNotFound): + adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", bytes.fromhex("0111ffff"), None) + + +def test_a_stale_id_is_refused_rather_than_downloading_another_event(): + with pytest.raises(StaleEvent, match="20261001080000"): + adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, "20250101000000") + + +def test_an_id_without_a_timestamp_skips_the_check(): + dl = adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, None) + assert dl.event_id == "BE18193:01110000:20261001080000" + + +def test_a_failed_5a_is_a_clear_error(): + fake = FakeMiniMateClient(events=[s3_event(0, "01110000", + datetime.datetime(2026, 10, 1, 8, 0, 0), frames=False)]) + with pytest.raises(MalformedReply, match="5A"): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) + + +def test_the_64k_page_bug_is_named_not_a_bare_500(): + fake = FakeMiniMateClient() + + def boom(key4): + raise struct.error("argument out of range") + fake.download_event_by_key = boom + with pytest.raises(MalformedReply, match="64 KB"): + adapter(fake).download_event(TCP, "BE18193", FIRST, None) -- 2.54.1 From 0a01a8d2db9d111000ba8f1333bfc3a9ee261798 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 16:59:55 -0400 Subject: [PATCH 034/223] feat(sfm): Series-4 events -- chain-walk list, download at THOR's cursor Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s4.py | 50 ++++++++++++++++++++++- tests/device_access_fakes.py | 43 ++++++++++++++++++- tests/test_device_access_s4_events.py | 59 +++++++++++++++++++++++++++ 3 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 tests/test_device_access_s4_events.py diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 018243f..99e2669 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -11,10 +11,12 @@ import time from typing import Any, Callable, Optional, TypeVar from micromate.client import MicromateClient +from micromate.protocol import THOR_CHUNK_SIZE from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport -from .errors import CallHomeInProgress, WrongUnit, translate -from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .errors import CallHomeInProgress, EventNotFound, MalformedReply, StaleEvent, WrongUnit, translate +from .events import iso_of, make_event_id, stamp_of +from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial log = logging.getLogger("sfm.device_access") @@ -238,3 +240,47 @@ def s4_settings(client: Any, serial: str) -> UnitSettings: "scaled_distance": s.scaled_distance, }, ) + + +def _s4_ref(ref: Any, serial: str) -> EventRef: + peaks = ref.peaks_ips or {} + return EventRef( + event_id=make_event_id(serial, ref.key, stamp_of(ref.timestamp)), + serial=serial, series=4, index=ref.index, timestamp=iso_of(ref.timestamp), + record_type=ref.record_type, peak_vector_sum_ips=ref.peak_vector_sum_ips, + peaks_ips={k.lower(): v for k, v in peaks.items() if k in ("Tran", "Vert", "Long")}, + filename=ref.filename, + detail={"size_bytes": ref.size, "mic": peaks.get("Mic"), "setup": ref.setup, + "sensor_location": ref.sensor_location}, + ) + + +def s4_list_events(client: Any, serial: str) -> EventList: + return EventList(serial=serial, series=4, + events=[_s4_ref(r, serial) for r in client.list_events(with_records=True)]) + + +def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str]) -> DownloadedEvent: + """Walk to the event and download it there -- the order THOR uses, the only + one captured. Downloading at a parked cursor has never been tried.""" + for ref in client.iter_events(with_records=True): + if ref.key != key: + continue + found = stamp_of(ref.timestamp) + if stamp is not None and found != stamp: + raise StaleEvent( + f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " + "the unit was erased or wrapped since the list was read; list again") + if ref.filename is None: + raise MalformedReply( + f"event {key.hex()}: its record gave no type or timestamp, so it cannot be named or stored") + # THOR's chunk size. A 16 KB chunk takes ~7 s on cellular against the + # 10 s receive deadline; 1 KB is what THOR itself sends. + blob, result = client.fetch_event(ref, chunk_size=THOR_CHUNK_SIZE) + err = client.decode_error(ref, result) + return DownloadedEvent( + event_id=make_event_id(serial, key, found), serial=serial, series=4, + filename=ref.filename, verified=True if err is not None else None, + idf_bytes=blob, detail={"size_bytes": ref.size, "pvs_error": err}, + ) + raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 5a498ba..5c87a2d 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -10,11 +10,12 @@ import copy import datetime from pathlib import Path -from micromate.models import MicromateDeviceInfo, MicromateState +from micromate.models import MicromateDeviceInfo, MicromateEventRef, MicromateState from micromate.setup_block import decode_setup from minimateplus.models import ComplianceConfig, DeviceInfo, Event, MonitorStatus, PeakValues, Timestamp SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um20147_baseline.bin" +THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" class _Base: @@ -114,6 +115,22 @@ class FakeMiniMateClient(_Base): return None +def s4_ref(index, key_hex, when, record_type, *, pvs=0.2): + """Fixture-backed: the filename it produces names a real file in thor-idf/.""" + ref = MicromateEventRef(index=index, key=bytes.fromhex(key_hex), size=0, serial="UM20147", + record_type=record_type, timestamp=when, peak_vector_sum_ips=pvs, + peaks_ips={"Tran": 0.1, "Vert": 0.15, "Long": 0.05, "Mic": 0.0002}) + ref.size = (THOR_IDF / ref.filename).stat().st_size + return ref + + +def default_s4_refs(): + return [ + s4_ref(0, "055d4a81", datetime.datetime(2025, 5, 31, 13, 59, 1), "waveform"), + s4_ref(1, "055d4a83", datetime.datetime(2025, 3, 30, 7, 1, 10), "histogram"), + ] + + class _FakeProtocol: def __init__(self, owner): self._owner = owner @@ -124,13 +141,16 @@ class _FakeProtocol: class FakeMicromateClient(_Base): def __init__(self, serial="UM20147", *, monitoring=False, events=5, - unsolicited=b"", **kw): + unsolicited=b"", event_refs=None, **kw): super().__init__(**kw) self.serial = serial self.monitoring = monitoring self.events = events self.unsolicited = unsolicited self.protocol = _FakeProtocol(self) + self.event_refs = default_s4_refs() if event_refs is None else event_refs + self.cursor = None + self.fetched: list = [] def is_open(self) -> bool: return self._open @@ -162,3 +182,22 @@ class FakeMicromateClient(_Base): self._step("read_unsolicited") data, self.unsolicited = self.unsolicited, b"" return data + + def list_events(self, *, with_records=True): + self._step("list_events") + return list(self.event_refs) + + def iter_events(self, *, with_records=True): + self._step("iter_events") + for ref in self.event_refs: + self.cursor = ref.index + yield ref + + def fetch_event(self, ref, *, verify=True, tolerance=0.01, chunk_size=None): + self._step("fetch_event") + self.fetched.append((ref.key_hex, chunk_size)) + return (THOR_IDF / ref.filename).read_bytes(), object() + + @staticmethod + def decode_error(ref, result): + return None if ref.record_type == "histogram" else 0.0 diff --git a/tests/test_device_access_s4_events.py b/tests/test_device_access_s4_events.py new file mode 100644 index 0000000..9f39398 --- /dev/null +++ b/tests/test_device_access_s4_events.py @@ -0,0 +1,59 @@ +"""Series-4 events: the chain walk mapped into the shared shape; download at the cursor.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import THOR_IDF, FakeMicromateClient # noqa: E402 +from micromate.protocol import THOR_CHUNK_SIZE # noqa: E402 +from sfm.device_access.errors import EventNotFound, StaleEvent # noqa: E402 +from sfm.device_access.s4 import s4_download_event, s4_list_events # noqa: E402 + +W_KEY, H_KEY = bytes.fromhex("055d4a81"), bytes.fromhex("055d4a83") + + +def test_listing_maps_each_ref_into_the_shared_shape(): + out = s4_list_events(FakeMicromateClient(), "UM20147") + assert (out.serial, out.series, len(out.events)) == ("UM20147", 4, 2) + e = out.events[0] + assert e.event_id == "UM20147:055d4a81:20250531135901" + assert (e.index, e.timestamp, e.record_type) == (0, "2025-05-31T13:59:01", "waveform") + assert e.peaks_ips == {"tran": 0.1, "vert": 0.15, "long": 0.05} + assert e.filename == "UM20147_20250531135901.IDFW" + assert e.detail["mic"] == 0.0002 and e.detail["size_bytes"] > 0 + + +def test_download_walks_to_the_event_and_uses_thors_chunk_size(): + fake = FakeMicromateClient() + dl = s4_download_event(fake, "UM20147", W_KEY, "20250531135901") + assert "iter_events" in fake.calls and "list_events" not in fake.calls + assert fake.fetched == [("055d4a81", THOR_CHUNK_SIZE)] + assert dl.idf_bytes == (THOR_IDF / "UM20147_20250531135901.IDFW").read_bytes() + assert (dl.series, dl.filename, dl.verified) == (4, "UM20147_20250531135901.IDFW", True) + + +def test_the_walk_stops_at_the_event_rather_than_reading_ahead(): + fake = FakeMicromateClient() + s4_download_event(fake, "UM20147", W_KEY, None) + assert fake.cursor == 0 + + +def test_a_histogram_has_no_self_check_so_verified_is_none(): + dl = s4_download_event(FakeMicromateClient(), "UM20147", H_KEY, None) + assert dl.verified is None and dl.filename.endswith(".IDFH") + + +def test_a_stale_id_is_refused_and_nothing_is_downloaded(): + fake = FakeMicromateClient() + with pytest.raises(StaleEvent, match="20250531135901"): + s4_download_event(fake, "UM20147", W_KEY, "20240101000000") + assert fake.fetched == [] + + +def test_a_key_that_is_not_stored_is_404(): + with pytest.raises(EventNotFound): + s4_download_event(FakeMicromateClient(), "UM20147", bytes.fromhex("deadbeef"), None) -- 2.54.1 From 9e2d8b62c3823aaea156429a80459bf2d0011891 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:02:19 -0400 Subject: [PATCH 035/223] feat(sfm): DeviceAccess lists and downloads events for both series Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 23 +++++- sfm/device_access/s4.py | 8 +- tests/test_device_access_event_dispatch.py | 88 ++++++++++++++++++++++ 3 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 tests/test_device_access_event_dispatch.py diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index 4dcb3f0..a22459e 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -10,11 +10,13 @@ import time from typing import Any, Callable, Dict, Optional from .errors import ConnectFailed, DeviceError, NoAnswer, WrongUnit +from .events import parse_event_id from .locks import UnitLocks -from .models import UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .models import DownloadedEvent, EventList, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .s3 import Series3Adapter, default_s3_client_factory from .s4 import ( - Series4Session, default_s4_client_factory, s4_identify, s4_settings, s4_status, + Series4Session, default_s4_client_factory, s4_download_event, s4_identify, s4_list_events, + s4_settings, s4_status, ) from .series import normalise_serial, series_for_serial @@ -56,6 +58,18 @@ class DeviceAccess: def settings(self, address: UnitAddress, serial: str) -> UnitSettings: return self._dispatch(address, serial, self._s3.settings, s4_settings) + def list_events(self, address: UnitAddress, serial: str) -> EventList: + return self._dispatch(address, serial, self._s3.list_events, s4_list_events) + + def download_event(self, address: UnitAddress, serial: str, event_id: str) -> DownloadedEvent: + """Read-only on the unit. Holds the unit for the whole download, so + other requests for it wait, then get 423.""" + key, stamp = parse_event_id(event_id, serial) # BadRequest before any I/O + return self._dispatch( + address, serial, + lambda a, s: self._s3.download_event(a, s, key, stamp), + lambda c, s: s4_download_event(c, s, key, stamp)) + def held_serial(self, address: UnitAddress) -> Optional[str]: """Serial of the OPEN held Series-4 line at this address, else None. No I/O.""" with self._sessions_guard: @@ -99,8 +113,9 @@ class DeviceAccess: self._forget_if_closed(address, session) # A held line the peer dropped still reads open (the transport only # learns at EOF), so the first request on it times out or fails. - # Call up fresh and retry ONCE. Safe only because phase 1a - # operations are reads (idempotent); writes (phase 3) must NOT + # Call up fresh and retry ONCE. Safe only because every operation + # here is a read (identify, status, settings, list, download -- all + # idempotent); writes (phase 3) must NOT # inherit this -- a write whose ack was lost must never be sent twice. if was_held and isinstance(exc, (NoAnswer, ConnectFailed)): self._drop(address.key, session) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 99e2669..4f49845 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -14,7 +14,9 @@ from micromate.client import MicromateClient from micromate.protocol import THOR_CHUNK_SIZE from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport -from .errors import CallHomeInProgress, EventNotFound, MalformedReply, StaleEvent, WrongUnit, translate +from .errors import ( + CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, StaleEvent, WrongUnit, translate, +) from .events import iso_of, make_event_id, stamp_of from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial @@ -157,6 +159,10 @@ class Series4Session: log.warning("RADIO RING from %s -- released the line so the call reaches THOR", self.address.key) raise CallHomeInProgress(_RING_MESSAGE) from exc + except DeviceError: + # The operation's own verdict (event not found, stale id): the line + # is healthy, so keep it. Library errors still hang up below. + raise except Exception as exc: self.hang_up() raise translate(exc, connecting=False) from exc diff --git a/tests/test_device_access_event_dispatch.py b/tests/test_device_access_event_dispatch.py new file mode 100644 index 0000000..bcda9fb --- /dev/null +++ b/tests/test_device_access_event_dispatch.py @@ -0,0 +1,88 @@ +"""Events through the one door: same shape both series, the held line, ring safety.""" +from __future__ import annotations + +import dataclasses +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMicromateClient, FakeMiniMateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import BadRequest, CallHomeInProgress # noqa: E402 +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s4 import RingDetected # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +def access(s3=(), s4=()): + s3q, s4q = list(s3), list(s4) + return DeviceAccess(s3_client_factory=lambda a, **kw: s3q.pop(0), + s4_client_factory=lambda a, **kw: s4q.pop(0), start_reaper=False) + + +def test_both_series_list_events_in_the_same_shape(): + s3 = access(s3=[FakeMiniMateClient()]).list_events(ADDR, "BE18193") + s4 = access(s4=[FakeMicromateClient()]).list_events(ADDR, "UM20147") + f3 = [set(dataclasses.asdict(e)) for e in s3.events] + f4 = [set(dataclasses.asdict(e)) for e in s4.events] + assert all(f == f3[0] for f in f3 + f4) + + +def test_no_shared_field_is_empty_for_either_series(): + # A field one series cannot fill belongs under `detail`, not at the top level. + for out in (access(s3=[FakeMiniMateClient()]).list_events(ADDR, "BE18193"), + access(s4=[FakeMicromateClient()]).list_events(ADDR, "UM20147")): + for e in out.events: + empty = {k for k, v in dataclasses.asdict(e).items() if v is None} + assert empty == set(), (out.series, empty) + + +def test_a_micromate_list_and_download_share_one_held_line(): + fake = FakeMicromateClient() + da = access(s4=[fake]) + listed = da.list_events(ADDR, "UM20147") + dl = da.download_event(ADDR, "UM20147", listed.events[0].event_id) + assert fake.opened == 1 and dl.idf_bytes + assert da.held_serial(ADDR) == "UM20147" + + +def test_an_id_from_another_unit_is_refused_before_any_io(): + fake = FakeMicromateClient() + with pytest.raises(BadRequest): + access(s4=[fake]).download_event(ADDR, "UM20147", "UM12947:055d4a81:20250531135901") + assert fake.opened == 0 + + +def test_a_minimate_download_goes_through_the_series3_adapter(): + dl = access(s3=[FakeMiniMateClient()]).download_event(ADDR, "BE18193", "BE18193:01110000:-") + assert dl.series == 3 and dl.a5_frames == ["frame"] + + +def test_a_ring_mid_download_releases_the_line_and_downloads_nothing(): + fake = FakeMicromateClient() + + def ring(*a, **kw): + raise RingDetected("RADIO RING") + fake.fetch_event = ring + da = access(s4=[fake]) + with pytest.raises(CallHomeInProgress): + da.download_event(ADDR, "UM20147", "UM20147:055d4a81:20250531135901") + assert fake.closed == 1 and da.held_serial(ADDR) is None + + +def test_a_stale_or_missing_event_keeps_the_line(): + # The operation's own verdict (404/409) says nothing is wrong with the link; + # hanging up would cost a call-up for no reason. + from sfm.device_access.errors import EventNotFound, StaleEvent + fake = FakeMicromateClient() + da = access(s4=[fake]) + with pytest.raises(StaleEvent): + da.download_event(ADDR, "UM20147", "UM20147:055d4a81:20240101000000") + with pytest.raises(EventNotFound): + da.download_event(ADDR, "UM20147", "UM20147:deadbeef:-") + assert fake.opened == 1 and fake.closed == 0 + assert da.held_serial(ADDR) == "UM20147" -- 2.54.1 From d84204f5332bac81d392135b67a07b1ced1aa1cc Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:04:44 -0400 Subject: [PATCH 036/223] feat(sfm): store a downloaded event -- one ingest for both series Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/event_ingest.py | 80 +++++++++++++++++++++++++++++++ sfm/server.py | 24 +--------- tests/test_event_ingest.py | 96 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 22 deletions(-) create mode 100644 sfm/event_ingest.py create mode 100644 tests/test_event_ingest.py diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py new file mode 100644 index 0000000..d07cb8d --- /dev/null +++ b/sfm/event_ingest.py @@ -0,0 +1,80 @@ +"""Store an event SFM downloaded from a unit -- the SDM side of +POST /device/events/download. + +Both series end in the two writes every other ingest path makes: the waveform +store (file + sidecar + .h5) and SeismoDb.insert_events(). The database matches +rows on (serial, timestamp), so storing an event already there -- by an earlier +download, or by THOR's watcher -- refreshes the row instead of duplicating it. +""" +from __future__ import annotations + +import datetime +from pathlib import Path +from typing import Any, Optional + +from sfm.device_access.models import DownloadedEvent, EventDownload + + +class IngestError(Exception): + """Downloaded from the unit, but could not be stored.""" + + +def backfill_series3_event(ev: Any, cc: Any) -> None: + """Compliance-config values that supersede what the 5A stream decoded. + + Some STRT fields have ambiguous semantics (STRT[20] is rectime, but + STRT[8:10] / STRT[16:18] are device-specific scratch, not reliable sample or + pre-trigger counts). Shared with GET /device/event/{i}/blastware_file. + """ + if not cc: + return + if ev.sample_rate is None and cc.sample_rate: + ev.sample_rate = cc.sample_rate + if cc.record_time: + # Authoritative: the user-set value the unit followed when recording. + ev.rectime_seconds = cc.record_time + # Derive total_samples from sample_rate x rectime when we can; the + # STRT-derived value can land at a buffer offset rather than a count. + if ev.sample_rate and ev.rectime_seconds: + derived = int(round(ev.sample_rate * ev.rectime_seconds)) + if (ev.total_samples is None + or ev.total_samples > derived * 2 + or ev.total_samples < derived // 4): + ev.total_samples = derived + + +def _event_dt(ev: Any) -> Optional[datetime.datetime]: + ts = getattr(ev, "timestamp", None) + try: + return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) + except Exception: # noqa: BLE001 + return None + + +def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownload: + if dl.series == 4: + ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename), + serial_hint=dl.serial) + family = "series4" + else: + ev = dl.event + backfill_series3_event(ev, dl.compliance) + geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None + rec = store.save(ev, serial=dl.serial, a5_frames=dl.a5_frames, + geo_range=geo_range if geo_range is not None else "normal") + family = "series3" + if ev is None or ev._waveform_key is None: + raise IngestError(f"{dl.filename}: stored the file but could not build a database row") + inserted, _skipped = db.insert_events( + [ev], serial=dl.serial, + waveform_records={ev._waveform_key.hex(): rec}, device_family=family) + row_id = None + dt = _event_dt(ev) + if dt is not None: + rows = db.query_events(serial=dl.serial, from_dt=dt, to_dt=dt, limit=1) + row_id = rows[0]["id"] if rows else None + return EventDownload( + event_id=dl.event_id, serial=dl.serial, series=dl.series, db_event_id=row_id, + stored_filename=rec["filename"], filesize=rec["filesize"], sha256=rec.get("sha256"), + inserted=inserted > 0, verified=dl.verified, detail=dict(dl.detail), + ) diff --git a/sfm/server.py b/sfm/server.py index d2ebb01..33f01b5 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -82,6 +82,7 @@ from sfm.database import SeismoDb from sfm.live_cache import LiveCache as _LiveCache from sfm.waveform_store import WaveformStore from sfm import db_snapshot +from sfm.event_ingest import backfill_series3_event, persist_download import dataclasses from sfm.device_access import DeviceAccess, DeviceError, UnitAddress from sfm.device_access.errors import BadRequest @@ -1000,28 +1001,7 @@ def device_event_blastware_file( if serial != "UNKNOWN" and ev._waveform_key is not None: try: cc = info.compliance_config - # Backfill authoritative compliance-config values onto the - # Event before persisting. These supersede whatever - # _decode_a5_waveform read from the STRT bytes (some of which - # have ambiguous semantics — e.g. STRT[20] is rectime but - # STRT[8:10] / STRT[16:18] are device-specific scratch fields - # that aren't reliable sample/pretrig counts). - if cc: - if ev.sample_rate is None and cc.sample_rate: - ev.sample_rate = cc.sample_rate - if cc.record_time: - # record_time from compliance is authoritative — the - # user-set value the device followed when recording. - ev.rectime_seconds = cc.record_time - # Derive total_samples from sample_rate × rectime when - # we can; the STRT-derived value can land at a buffer- - # offset rather than a sample count. - if ev.sample_rate and ev.rectime_seconds: - derived = int(round(ev.sample_rate * ev.rectime_seconds)) - if (ev.total_samples is None - or ev.total_samples > derived * 2 - or ev.total_samples < derived // 4): - ev.total_samples = derived + backfill_series3_event(ev, cc) geo_range = getattr(cc, "geo_range", None) if cc else None rec = _get_store().save( ev, serial=serial, a5_frames=a5_frames, diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py new file mode 100644 index 0000000..5563c3a --- /dev/null +++ b/tests/test_event_ingest.py @@ -0,0 +1,96 @@ +"""Storing a downloaded event: the same store + DB writes every ingest path makes.""" +from __future__ import annotations + +import datetime +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 +from sfm.database import SeismoDb # noqa: E402 +from sfm.device_access.models import DownloadedEvent # noqa: E402 +from sfm.event_ingest import backfill_series3_event, persist_download # noqa: E402 +from sfm.waveform_store import WaveformStore # noqa: E402 + +THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" + + +@pytest.fixture +def sdm(tmp_path): + return WaveformStore(tmp_path / "waveforms"), SeismoDb(tmp_path / "seismo.db") + + +def s4_download(name, verified=True): + return DownloadedEvent(event_id=f"UM20147:055d4a81:{name[8:22]}", serial="UM20147", series=4, + filename=name, verified=verified, idf_bytes=(THOR_IDF / name).read_bytes()) + + +def test_a_series4_waveform_is_stored_and_findable(sdm): + store, db = sdm + out = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + assert out.stored_filename == "UM20147_20250531135901.IDFW" and out.inserted + assert (store.root / "UM20147" / out.stored_filename).exists() + row = db.get_event(out.db_event_id) + assert row["serial"] == "UM20147" and row["device_family"] == "series4" + assert out.verified is True and out.sha256 + + +def test_a_series4_histogram_is_stored(sdm): + store, db = sdm + out = persist_download(s4_download("UM20147_20250330070110.IDFH", verified=None), store=store, db=db) + assert out.inserted and out.db_event_id and out.verified is None + + +def test_storing_the_same_event_twice_refreshes_rather_than_duplicates(sdm): + store, db = sdm + first = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + again = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + assert (first.inserted, again.inserted) == (True, False) + assert again.db_event_id == first.db_event_id + assert len(db.query_events(serial="UM20147")) == 1 + + +class RecordingStore: + def __init__(self): + self.saved = [] + + def save(self, ev, serial, a5_frames, *, geo_range="normal", source_kind="sfm-live"): + self.saved.append((ev, serial, a5_frames, geo_range)) + return {"filename": "T193LQ9K.OE0", "filesize": 8708, "sha256": "ab" * 32} + + +def test_a_series3_event_is_backfilled_then_stored_as_series3(tmp_path): + db = SeismoDb(tmp_path / "seismo.db") + store = RecordingStore() + fake = FakeMiniMateClient() + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) + dl = DownloadedEvent(event_id="BE18193:01110000:20261001080000", serial="BE18193", series=3, + filename="T193LQ9K.OE0", verified=None, event=ev, a5_frames=["frame"], + compliance=fake.compliance) + out = persist_download(dl, store=store, db=db) + saved_ev, serial, frames, geo_range = store.saved[0] + assert (serial, frames, geo_range) == ("BE18193", ["frame"], 0) + assert saved_ev.sample_rate == 1024 and saved_ev.rectime_seconds == 3.0 + assert db.get_event(out.db_event_id)["device_family"] == "series3" + assert out.stored_filename == "T193LQ9K.OE0" + + +def test_backfill_derives_total_samples_only_when_the_decoded_one_is_implausible(): + cc = FakeMiniMateClient().compliance # 1024 sps, 3.0 s + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) + ev.total_samples = 40_000 + backfill_series3_event(ev, cc) + assert ev.total_samples == 3072 + ev.total_samples = 3000 + backfill_series3_event(ev, cc) + assert ev.total_samples == 3000 + + +def test_backfill_without_settings_changes_nothing(): + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) + backfill_series3_event(ev, None) + assert ev.sample_rate is None -- 2.54.1 From 39e0d312e543d9dee80a8e3e931c5cb54ad37359 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:07:42 -0400 Subject: [PATCH 037/223] feat(sfm): list and download events by serial for both series Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/server.py | 44 ++++++++++++- tests/test_server_device_access.py | 101 ++++++++++++++++++++++++++++- 2 files changed, 142 insertions(+), 3 deletions(-) diff --git a/sfm/server.py b/sfm/server.py index 33f01b5..10ce88b 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -382,6 +382,7 @@ def _via_device_access(fn) -> dict: _SERIAL_AWARE_PATHS = frozenset({ "/device/info", "/device/connect", "/device/monitor/status", "/device/settings", + "/device/events", "/device/events/download", }) @@ -571,13 +572,20 @@ def device_connect( @app.get("/device/events") def device_events( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), - baud: int = Query(38400, description="Serial baud rate"), + baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), debug: bool = Query(False, description="Include raw record hex for field-layout inspection"), force: bool = Query(False, description="Bypass cache and re-download all events from device"), + serial: Optional[str] = Query(None, description=_SERIAL_DOC), ) -> dict: """ + **With `serial`** (UM... or BE.../BA...): the unit's events in the shared + shape for either series, read from headers only -- no event is downloaded + to list it -- and not cached. Each carries an `event_id` for + POST /device/events/download. Without `serial`, the legacy Series-3 + behaviour below. + Connect to the device, read the event index, and download all stored events (event headers + full waveform records with peak values). @@ -600,6 +608,10 @@ def device_events( If new events exist on the device, only the new ones are downloaded and merged. Pass *force=true* to bypass the cache entirely and re-download everything. """ + if serial: + return _via_device_access( + lambda: _device_access().list_events(_unit_address(port, baud, host, tcp_port), serial)) + baud = 38400 if baud is None else baud log.info("GET /device/events port=%s host=%s debug=%s force=%s", port, host, debug, force) cache = get_cache() @@ -1255,6 +1267,36 @@ def device_settings( lambda: _device_access().settings(_unit_address(port, baud, host, tcp_port), serial)) +@app.post("/device/events/download") +def device_events_download( + serial: str = Query(..., description=_SERIAL_DOC), + event_id: str = Query(..., description="From GET /device/events?serial=..."), + port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"), + baud: Optional[int] = Query(None, description="Serial baud (default by series)"), + host: Optional[str] = Query(None, description="TCP host -- modem IP"), + tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), +) -> dict: + """Download one event, check it, and store it in SFM's database. + + Read-only on the unit. The stored file and waveform are then at + /db/events/{db_event_id}/... . Storing an event that is already stored + refreshes its row (`inserted: false`). The unit is busy for the whole + download: other requests for it wait, then get 423. + """ + try: + dl = _device_access().download_event(_unit_address(port, baud, host, tcp_port), serial, event_id) + except DeviceError as exc: + raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc + try: + out = persist_download(dl, store=_get_store(), db=_get_db()) + except Exception as exc: + log.error("events/download: %s downloaded but not stored: %s", dl.event_id, exc, exc_info=True) + raise HTTPException( + status_code=500, + detail=f"downloaded {dl.filename} from the unit but could not store it: {exc}") from exc + return dataclasses.asdict(out) + + @app.post("/device/hangup") def device_hangup( port: Optional[str] = Query(None, description="Serial port"), diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 2f600a7..98d83cf 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -26,8 +26,8 @@ TCP = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034) def da(monkeypatch): s3q = [FakeMiniMateClient() for _ in range(5)] s4q = [FakeMicromateClient() for _ in range(5)] - access = DeviceAccess(s3_client_factory=lambda a: s3q.pop(0), - s4_client_factory=lambda a: s4q.pop(0), start_reaper=False) + access = DeviceAccess(s3_client_factory=lambda a, **kw: s3q.pop(0), + s4_client_factory=lambda a, **kw: s4q.pop(0), start_reaper=False) monkeypatch.setattr(srv, "_device_access_instance", access) return access @@ -112,6 +112,7 @@ def test_guard_lets_a_series3_serial_through_on_legacy_routes(): @pytest.mark.parametrize("path", ["/device/info", "/device/connect", "/device/monitor/status", "/device/settings", + "/device/events", "/device/events/download", "/device/hangup"]) def test_guard_allows_um_serial_on_serial_aware_routes_and_hangup(path): assert srv._device_guard(path, {"serial": "UM20147", **Q_TCP}) is None @@ -157,3 +158,99 @@ def test_guard_ignores_an_unparseable_baud_when_checking_for_a_held_line(da): da.status(ADDR, "UM20147") out = srv._device_guard("/device/monitor/stop", {"baud": "38400.0", **Q_TCP}) assert out is not None and out[0] == 409 + + +# ── events ──────────────────────────────────────────────────────────────────── + +from sfm.database import SeismoDb # noqa: E402 +from sfm.waveform_store import WaveformStore # noqa: E402 + +W_ID = "UM20147:055d4a81:20250531135901" + + +@pytest.fixture +def sdm(tmp_path, monkeypatch): + db = SeismoDb(tmp_path / "seismo.db") + store = WaveformStore(tmp_path / "waveforms") + monkeypatch.setattr(srv, "_get_db", lambda: db) + monkeypatch.setattr(srv, "_get_store", lambda: store) + return store, db + + +EV = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034) + + +@pytest.mark.parametrize("serial,series", [("UM20147", 4), ("BE18193", 3)]) +def test_events_with_a_serial_return_the_shared_list(da, serial, series): + out = srv.device_events(debug=False, force=False, serial=serial, **EV) + assert (out["serial"], out["series"], len(out["events"])) == (serial, series, 2) + assert set(out["events"][0]) == {"event_id", "serial", "series", "index", "timestamp", + "record_type", "peak_vector_sum_ips", "peaks_ips", + "filename", "detail"} + + +def test_events_without_a_serial_run_the_legacy_path(monkeypatch): + class Legacy(Exception): + pass + + def untouchable(): + raise AssertionError("DeviceAccess must not be used without a serial") + + def legacy_cache(): + raise Legacy() + monkeypatch.setattr(srv, "_device_access", untouchable) + monkeypatch.setattr(srv, "get_cache", legacy_cache) + with pytest.raises(Legacy): + srv.device_events(debug=False, force=False, serial=None, **EV) + + +def test_download_stores_the_event_and_says_where(da, sdm): + out = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert out["inserted"] is True and out["verified"] is True + assert out["stored_filename"] == "UM20147_20250531135901.IDFW" + _store, db = sdm + assert db.get_event(out["db_event_id"])["serial"] == "UM20147" + + +def test_downloading_it_again_refreshes_the_same_row(da, sdm): + first = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + again = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert again["inserted"] is False and again["db_event_id"] == first["db_event_id"] + + +@pytest.mark.parametrize("event_id,status", [ + ("UM12947:055d4a81:20250531135901", 422), # another unit's event + ("garbage", 422), + ("UM20147:055d4a81:20240101000000", 409), # stale: erased since listed + ("UM20147:deadbeef:-", 404), +]) +def test_download_errors_have_their_statuses(da, sdm, event_id, status): + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=event_id, **EV) + assert ei.value.status_code == status + assert sdm[1].query_events(serial="UM20147") == [] + + +def test_a_decode_that_disagrees_is_502_and_nothing_is_stored(da, sdm, monkeypatch): + from micromate.client import DecodeMismatch + + def mismatch(*a, **kw): + raise DecodeMismatch("decoded PVS differs by +5%") + fake = FakeMicromateClient() + fake.fetch_event = mismatch + monkeypatch.setattr(da, "_s4_factory", lambda a, **kw: fake) + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert ei.value.status_code == 502 + assert sdm[1].query_events(serial="UM20147") == [] + + +def test_a_store_failure_is_500_and_names_what_was_downloaded(da, sdm, monkeypatch): + class BrokenStore: + def save_imported_idf(self, *a, **kw): + raise OSError("disk full") + monkeypatch.setattr(srv, "_get_store", lambda: BrokenStore()) + with pytest.raises(HTTPException) as ei: + srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) + assert ei.value.status_code == 500 + assert "UM20147_20250531135901.IDFW" in ei.value.detail and "disk full" in ei.value.detail -- 2.54.1 From 89a2a493fb08f1e2ca75fa2c615db2a9386a6731 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:11:24 -0400 Subject: [PATCH 038/223] 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. -- 2.54.1 From ddb22d96244754b015c5e7bc0b67a3bf2fc976e8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:13:41 -0400 Subject: [PATCH 039/223] docs(micromate): equal peaks across a histogram/waveform pair are real, not a list bug Flagged in the phase 1b bench review; settled from the histogram file's own interval data (5,021 counts vert = the waveform's 1.5581 in/s). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- docs/micromate_protocol_reference.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index b7e23e4..6541355 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2536,6 +2536,19 @@ 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. +**2026-10-21 -- in Histogram Combo, a histogram's `0x0C` peaks equal the largest +waveform recorded inside it (measured, UM20147, 2 histogram/waveform pairs).** +UM20147's list showed histogram 13:27:33 and waveform 13:27:43 with identical +peaks and PVS to the last float bit, and likewise histogram 13:28:09 and +waveform 13:59:33 (31 minutes apart, before the next histogram at 13:59:53). +Not a listing bug: the histogram file's *own* interval data peaks at vert 5,021 / +tran 735 / long 675 counts = 1.5581 / 0.2281 / 0.2095 in/s at 0.000310308 in/s +per count, the waveform's peaks exactly. The histogram's record reports the +maximum over its whole window. 🔶 Inferred: the record is finalised when the +window closes but stamped with its start, which is how it can carry the peak of +a waveform that triggered later inside it. Do not "fix" equal peaks across +such a pair. + **`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. -- 2.54.1 From ef096e30825838bccdcd337788a0505cd08656bb Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:35:23 -0400 Subject: [PATCH 040/223] fix(sfm): a download never downgrades a stored event -- an existing row is returned, nothing written THOR's watcher (and Blastware's ACH) store every event through /db/import/idf_file and /db/import/blastware_file, with the paired report. Storing a download of the same event afterwards overwrote that richer copy: on Series 4 the file, .h5 and sidecar were rewritten (extensions dropped); on Series 3 the row lost PVS, project strings and ZC frequencies and was repointed at a second, review-less file set. persist_download now looks up (serial, timestamp) first. A row there is returned as it stands -- inserted false, detail.already_stored true -- with no store call, no insert_events and no sidecar write. Never merge. - DownloadedEvent gains `timestamp` (the unit's own event time) and `record` (Series 4's 0x0C fields); both adapters set them. - The Series-3 `event is None` guard now runs before backfill/save, with a message that is true there ("nothing was stored"). - Tests build the watcher's state exactly as the import endpoints do and prove the row dict, the sidecar bytes and the file mtimes are unchanged. No schema change, no migration, no codec change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/models.py | 16 +++- sfm/device_access/s3.py | 3 +- sfm/device_access/s4.py | 5 +- sfm/event_ingest.py | 29 +++++- sfm/server.py | 8 +- tests/test_device_access_s3_events.py | 1 + tests/test_device_access_s4_events.py | 12 +++ tests/test_event_ingest.py | 123 ++++++++++++++++++++++++-- tests/test_server_device_access.py | 3 +- 9 files changed, 178 insertions(+), 22 deletions(-) diff --git a/sfm/device_access/models.py b/sfm/device_access/models.py index 3f0aa19..f3f64af 100644 --- a/sfm/device_access/models.py +++ b/sfm/device_access/models.py @@ -2,6 +2,7 @@ series; anything only one series has goes under `detail`.""" from __future__ import annotations +import datetime from dataclasses import dataclass, field from typing import Any, Dict, List, Optional @@ -102,9 +103,9 @@ class EventDownload: series: int db_event_id: Optional[str] stored_filename: str - filesize: int - sha256: Optional[str] - inserted: bool # False: already stored; the row was refreshed + filesize: Optional[int] # None only for a stored row with no file recorded + sha256: Optional[str] # None when the event was already stored + inserted: bool # False: already stored; nothing was written (detail.already_stored) verified: Optional[bool] # True: decode self-check passed; None: no check exists detail: Dict[str, Any] = field(default_factory=dict) @@ -113,7 +114,12 @@ class EventDownload: class DownloadedEvent: """The device side's result, before SFM stores it. Not an HTTP shape: it carries the payload -- a Series-3 Event + its 5A frames + the compliance - config, or a Series-4 file's bytes -- to sfm.event_ingest.""" + config, or a Series-4 file's bytes -- to sfm.event_ingest. + + `timestamp` is the event's time as the unit reported it: the store looks up + an existing row by (serial, timestamp) before writing anything. `record` is + what the unit's own event record said (Series 4's 0x0C), for the fields the + file alone does not give.""" event_id: str serial: str series: int @@ -123,4 +129,6 @@ class DownloadedEvent: event: Any = field(default=None, repr=False) a5_frames: Optional[list] = field(default=None, repr=False) compliance: Any = field(default=None, repr=False) + timestamp: Optional[datetime.datetime] = None + record: Dict[str, Any] = field(default_factory=dict) detail: Dict[str, Any] = field(default_factory=dict) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index b513327..2c74b14 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -204,6 +204,7 @@ class Series3Adapter: return DownloadedEvent( event_id=make_event_id(serial, key, found), serial=serial, series=3, filename=filename, verified=None, event=ev, a5_frames=ev._a5_frames, - compliance=info.compliance_config, detail={"a5_frames": len(ev._a5_frames)}, + compliance=info.compliance_config, timestamp=_s3_dt(ev), + detail={"a5_frames": len(ev._a5_frames)}, ) return self._run(address, op, timeout=S3_EVENT_TIMEOUT) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 4f49845..7972e3d 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -287,6 +287,9 @@ def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str] return DownloadedEvent( event_id=make_event_id(serial, key, found), serial=serial, series=4, filename=ref.filename, verified=True if err is not None else None, - idf_bytes=blob, detail={"size_bytes": ref.size, "pvs_error": err}, + idf_bytes=blob, timestamp=ref.timestamp, + record={"peak_vector_sum_ips": ref.peak_vector_sum_ips, + "sensor_location": ref.sensor_location, "setup": ref.setup}, + detail={"size_bytes": ref.size, "pvs_error": err}, ) raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index d07cb8d..a283bd9 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -2,9 +2,13 @@ POST /device/events/download. Both series end in the two writes every other ingest path makes: the waveform -store (file + sidecar + .h5) and SeismoDb.insert_events(). The database matches -rows on (serial, timestamp), so storing an event already there -- by an earlier -download, or by THOR's watcher -- refreshes the row instead of duplicating it. +store (file + sidecar + .h5) and SeismoDb.insert_events(). + +An event already stored -- by an earlier download, or by THOR's watcher or +Blastware's ACH -- is returned as it is and NOTHING is written. The watcher's +copy is the richer one (its paired report carries PVS, project strings and ZC +frequencies a bare download does not), so a download never merges into it or +replaces it. """ from __future__ import annotations @@ -51,13 +55,32 @@ def _event_dt(ev: Any) -> Optional[datetime.datetime]: return None +def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload: + return EventDownload( + event_id=dl.event_id, serial=dl.serial, series=dl.series, db_event_id=row["id"], + stored_filename=row.get("blastware_filename") or "", + filesize=row.get("blastware_filesize"), + sha256=None, # the events table does not keep one + inserted=False, verified=dl.verified, + detail={**dl.detail, "already_stored": True}, + ) + + def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownload: + # Never merge: a row for (serial, timestamp) means the event is stored, and + # whoever stored it first keeps it. No store call, no insert, no sidecar. + if dl.timestamp is not None: + rows = db.query_events(serial=dl.serial, from_dt=dl.timestamp, to_dt=dl.timestamp, limit=1) + if rows: + return _already_stored(dl, rows[0]) if dl.series == 4: ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename), serial_hint=dl.serial) family = "series4" else: ev = dl.event + if ev is None: + raise IngestError(f"{dl.filename}: the download carried no event; nothing was stored") backfill_series3_event(ev, dl.compliance) geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None rec = store.save(ev, serial=dl.serial, a5_frames=dl.a5_frames, diff --git a/sfm/server.py b/sfm/server.py index 10ce88b..b228ff1 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -1279,9 +1279,11 @@ def device_events_download( """Download one event, check it, and store it in SFM's database. Read-only on the unit. The stored file and waveform are then at - /db/events/{db_event_id}/... . Storing an event that is already stored - refreshes its row (`inserted: false`). The unit is busy for the whole - download: other requests for it wait, then get 423. + /db/events/{db_event_id}/... . An event already stored -- by an earlier + download, or by THOR's watcher -- comes back as its existing row and + nothing is written (`inserted: false`, `detail.already_stored: true`). + The unit is busy for the whole download: other requests for it wait, + then get 423. """ try: dl = _device_access().download_event(_unit_address(port, baud, host, tcp_port), serial, event_id) diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index a4ba21a..eb6cf87 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -64,6 +64,7 @@ def test_download_returns_the_event_its_frames_and_the_settings(): assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", None) assert dl.event is fake.events[0] and dl.a5_frames == ["frame"] assert dl.compliance is fake.compliance and dl.filename.startswith("T193") + assert dl.timestamp == datetime.datetime(2026, 10, 1, 8, 0, 0) def test_download_refuses_a_different_unit_before_downloading(): diff --git a/tests/test_device_access_s4_events.py b/tests/test_device_access_s4_events.py index 9f39398..2a803b0 100644 --- a/tests/test_device_access_s4_events.py +++ b/tests/test_device_access_s4_events.py @@ -1,6 +1,7 @@ """Series-4 events: the chain walk mapped into the shared shape; download at the cursor.""" from __future__ import annotations +import datetime import os import sys @@ -36,6 +37,17 @@ def test_download_walks_to_the_event_and_uses_thors_chunk_size(): assert (dl.series, dl.filename, dl.verified) == (4, "UM20147_20250531135901.IDFW", True) +def test_download_carries_the_units_timestamp_and_its_own_record(): + # What the unit's 0x0C said: the store looks up an existing row by the + # timestamp, and fills what the file alone cannot give from the record. + ref = FakeMicromateClient().event_refs[0] + ref.sensor_location, ref.setup = "Loc A", "test2" + fake = FakeMicromateClient(event_refs=[ref]) + dl = s4_download_event(fake, "UM20147", W_KEY, "20250531135901") + assert dl.timestamp == datetime.datetime(2025, 5, 31, 13, 59, 1) + assert dl.record == {"peak_vector_sum_ips": 0.2, "sensor_location": "Loc A", "setup": "test2"} + + def test_the_walk_stops_at_the_event_rather_than_reading_ahead(): fake = FakeMicromateClient() s4_download_event(fake, "UM20147", W_KEY, None) diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 5563c3a..0f2ad92 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -13,10 +13,11 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 from sfm.database import SeismoDb # noqa: E402 from sfm.device_access.models import DownloadedEvent # noqa: E402 -from sfm.event_ingest import backfill_series3_event, persist_download # noqa: E402 +from sfm.event_ingest import IngestError, backfill_series3_event, persist_download # noqa: E402 from sfm.waveform_store import WaveformStore # noqa: E402 THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" +BW_FIXTURES = Path(__file__).parent / "fixtures" / "5-11-26" @pytest.fixture @@ -24,9 +25,24 @@ def sdm(tmp_path): return WaveformStore(tmp_path / "waveforms"), SeismoDb(tmp_path / "seismo.db") -def s4_download(name, verified=True): +def s4_download(name, verified=True, record=None): return DownloadedEvent(event_id=f"UM20147:055d4a81:{name[8:22]}", serial="UM20147", series=4, - filename=name, verified=verified, idf_bytes=(THOR_IDF / name).read_bytes()) + filename=name, verified=verified, idf_bytes=(THOR_IDF / name).read_bytes(), + timestamp=datetime.datetime.strptime(name[8:22], "%Y%m%d%H%M%S"), + record=dict(record or {})) + + +def _tree(root): + """Every file under the store: (size, mtime_ns). Any write shows.""" + return {str(p.relative_to(root)): (p.stat().st_size, p.stat().st_mtime_ns) + for p in sorted(root.rglob("*")) if p.is_file()} + + +def _age_files(directory): + """Back-date every file, so a rewrite shows in its mtime whatever the clock's grain.""" + for p in directory.iterdir(): + if p.is_file(): + os.utime(p, ns=(1_000_000_000_000_000_000, 1_000_000_000_000_000_000)) def test_a_series4_waveform_is_stored_and_findable(sdm): @@ -45,13 +61,71 @@ def test_a_series4_histogram_is_stored(sdm): assert out.inserted and out.db_event_id and out.verified is None -def test_storing_the_same_event_twice_refreshes_rather_than_duplicates(sdm): +def test_storing_the_same_event_twice_stores_nothing_the_second_time(sdm): store, db = sdm - first = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) - again = persist_download(s4_download("UM20147_20250531135901.IDFW"), store=store, db=db) + name = "UM20147_20250531135901.IDFW" + first = persist_download(s4_download(name), store=store, db=db) + _age_files(store.root / "UM20147") + row0 = db.get_event(first.db_event_id) + tree0 = _tree(store.root) + again = persist_download(s4_download(name), store=store, db=db) assert (first.inserted, again.inserted) == (True, False) - assert again.db_event_id == first.db_event_id - assert len(db.query_events(serial="UM20147")) == 1 + assert again.db_event_id == first.db_event_id and again.detail["already_stored"] is True + assert db.query_events(serial="UM20147") == [row0] + assert (store.root / "UM20147" / name).stat().st_mtime_ns == tree0[f"UM20147/{name}"][1] + assert _tree(store.root) == tree0 + + +# ── an event THOR's watcher (or Blastware's ACH) already stored ─────────────── +# Built exactly as /db/import/idf_file and /db/import/blastware_file build it +# (sfm/server.py): the store's import call, then insert_events. + +def watcher_import_idf(store, db, name): + ev, rec = store.save_imported_idf((THOR_IDF / name).read_bytes(), source_path=Path(name), + serial_hint=None, idf_report_text=None) + serial = rec.get("serial") or "UNKNOWN" + db.insert_events([ev], serial=serial, + waveform_records={ev._waveform_key.hex(): rec} if ev._waveform_key else None, + device_family="series4") + return serial, rec + + +def watcher_import_bw(store, db, name): + ev, rec = store.save_imported_bw((BW_FIXTURES / name).read_bytes(), source_path=Path(name), + serial_hint=None, + bw_report_text=(BW_FIXTURES / f"{name}.TXT").read_bytes()) + serial = rec.get("serial") or "UNKNOWN" + db.insert_events([ev], serial=serial, + waveform_records={ev._waveform_key.hex(): rec if ev._waveform_key else None} + if ev._waveform_key else None, + device_family="series3") + return serial, rec + + +def test_downloading_an_event_the_watcher_stored_writes_nothing_series4(sdm): + store, db = sdm + name = "UM20147_20250531135901.IDFW" + serial, rec = watcher_import_idf(store, db, name) + assert serial == "UM20147" + # Something only the stored copy has; a rewrite of the sidecar would drop it. + assert store.patch_sidecar(serial, name, extensions={"operator_note": {"text": "checked on site"}}) + _age_files(store.root / serial) + [row0] = db.query_events(serial=serial) + sidecar0 = store.sidecar_path_for(serial, name).read_bytes() + mtime0 = (store.root / serial / name).stat().st_mtime_ns + tree0 = _tree(store.root) + + out = persist_download(s4_download(name, record={"peak_vector_sum_ips": 0.391, + "sensor_location": "Loc A"}), + store=store, db=db) + + assert out.inserted is False and out.detail["already_stored"] is True + assert out.db_event_id == row0["id"] + assert (out.stored_filename, out.filesize) == (name, rec["filesize"]) + assert db.query_events(serial=serial) == [row0] + assert store.sidecar_path_for(serial, name).read_bytes() == sidecar0 + assert (store.root / serial / name).stat().st_mtime_ns == mtime0 + assert _tree(store.root) == tree0 class RecordingStore: @@ -70,7 +144,7 @@ def test_a_series3_event_is_backfilled_then_stored_as_series3(tmp_path): ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) dl = DownloadedEvent(event_id="BE18193:01110000:20261001080000", serial="BE18193", series=3, filename="T193LQ9K.OE0", verified=None, event=ev, a5_frames=["frame"], - compliance=fake.compliance) + compliance=fake.compliance, timestamp=datetime.datetime(2026, 10, 1, 8, 0, 0)) out = persist_download(dl, store=store, db=db) saved_ev, serial, frames, geo_range = store.saved[0] assert (serial, frames, geo_range) == ("BE18193", ["frame"], 0) @@ -79,6 +153,37 @@ def test_a_series3_event_is_backfilled_then_stored_as_series3(tmp_path): assert out.stored_filename == "T193LQ9K.OE0" +def test_downloading_an_event_the_watcher_stored_writes_nothing_series3(tmp_path): + db = SeismoDb(tmp_path / "seismo.db") + serial, rec = watcher_import_bw(WaveformStore(tmp_path / "waveforms"), db, "M529LL1L.V70") + [row0] = db.query_events(serial=serial) + when = datetime.datetime.fromisoformat(row0["timestamp"]) + # The download's own decode differs from the stored row (peaks, file name), so + # any write would show in the row. + ev = s3_event(0, row0["waveform_key"], when) + store = RecordingStore() + dl = DownloadedEvent(event_id=f"{serial}:{row0['waveform_key']}:{when:%Y%m%d%H%M%S}", + serial=serial, series=3, filename="M529LL1L.V70", verified=None, event=ev, + a5_frames=["frame"], compliance=FakeMiniMateClient().compliance, + timestamp=when) + out = persist_download(dl, store=store, db=db) + assert store.saved == [] + assert db.query_events(serial=serial) == [row0] + assert out.inserted is False and out.detail["already_stored"] is True + assert (out.db_event_id, out.stored_filename, out.filesize) == (row0["id"], rec["filename"], + rec["filesize"]) + assert ev.sample_rate is None # not even backfilled + + +def test_a_series3_download_with_no_event_stores_nothing_and_says_so(tmp_path): + store = RecordingStore() + dl = DownloadedEvent(event_id="BE18193:01110000:-", serial="BE18193", series=3, + filename="T193LQ9K.OE0", verified=None, event=None, a5_frames=["frame"]) + with pytest.raises(IngestError, match="nothing was stored"): + persist_download(dl, store=store, db=SeismoDb(tmp_path / "seismo.db")) + assert store.saved == [] + + def test_backfill_derives_total_samples_only_when_the_decoded_one_is_implausible(): cc = FakeMiniMateClient().compliance # 1024 sps, 3.0 s ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 98d83cf..333ff6e 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -212,10 +212,11 @@ def test_download_stores_the_event_and_says_where(da, sdm): assert db.get_event(out["db_event_id"])["serial"] == "UM20147" -def test_downloading_it_again_refreshes_the_same_row(da, sdm): +def test_downloading_it_again_returns_the_stored_row_rather_than_rewriting_it(da, sdm): first = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) again = srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) assert again["inserted"] is False and again["db_event_id"] == first["db_event_id"] + assert again["detail"]["already_stored"] is True @pytest.mark.parametrize("event_id,status", [ -- 2.54.1 From 157fcc51a7586f5cf4f5b642d636f3941672d214 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:36:15 -0400 Subject: [PATCH 041/223] fix(sfm): a fresh Series-4 download keeps the unit's own PVS and sensor location Without Thor's TXT report, save_imported_idf fills only the three PPVs. The unit's 0x0C record -- already read for the list and the stale check -- also gives the peak vector sum and the sensor location, and they were dropped: Terra-View showed a blank PVS, and find_twins (which matches on PVS) could not link the event to its histogram twin. persist_download now overlays DownloadedEvent.record onto the bridged event before insert_events, filling only fields the file left empty (creating PeakValues / ProjectInfo when absent). Not the mic: its 0x0C decode reads a denormal, parked. The sidecar is written by save_imported_idf before the overlay, so it still has no vector sum; the DB row does. No schema change, no migration. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/event_ingest.py | 25 +++++++++++++++++++++ tests/test_event_ingest.py | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index a283bd9..5cd2673 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -66,6 +66,29 @@ def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload: ) +def _overlay_s4_record(ev: Any, record: dict) -> None: + """Fill, where the file left them empty, what the unit's 0x0C said. + + Without Thor's TXT report the IDF file gives only the three PPVs. The + vector sum matters beyond display: find_twins matches on it. Not the mic: + its 0x0C decode reads a denormal (parked). + """ + from minimateplus.models import PeakValues, ProjectInfo + + pvs = record.get("peak_vector_sum_ips") + if pvs is not None: + if ev.peak_values is None: + ev.peak_values = PeakValues() + if ev.peak_values.peak_vector_sum is None: + ev.peak_values.peak_vector_sum = pvs + location = record.get("sensor_location") + if location is not None: + if ev.project_info is None: + ev.project_info = ProjectInfo() + if ev.project_info.sensor_location is None: + ev.project_info.sensor_location = location + + def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownload: # Never merge: a row for (serial, timestamp) means the event is stored, and # whoever stored it first keeps it. No store call, no insert, no sidecar. @@ -76,6 +99,8 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo if dl.series == 4: ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename), serial_hint=dl.serial) + if ev is not None: + _overlay_s4_record(ev, dl.record) family = "series4" else: ev = dl.event diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 0f2ad92..ec4f7a5 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -55,6 +55,52 @@ def test_a_series4_waveform_is_stored_and_findable(sdm): assert out.verified is True and out.sha256 +def test_a_fresh_series4_download_keeps_the_units_pvs_and_sensor_location(sdm): + # Without Thor's TXT the file alone gives only the three PPVs; the unit's + # 0x0C record carries the vector sum (find_twins matches on it) and the location. + store, db = sdm + out = persist_download(s4_download("UM20147_20250531135901.IDFW", + record={"peak_vector_sum_ips": 0.391, "sensor_location": "Loc A"}), + store=store, db=db) + row = db.get_event(out.db_event_id) + assert out.inserted + assert (row["peak_vector_sum"], row["sensor_location"]) == (0.391, "Loc A") + assert row["tran_ppv"] is not None # the file's own peaks still stored + + +def test_the_record_fills_only_what_the_file_left_empty(sdm, monkeypatch): + store, db = sdm + real = store.save_imported_idf + + def with_values(*a, **kw): + ev, rec = real(*a, **kw) + ev.peak_values.peak_vector_sum = 1.5 + ev.project_info.sensor_location = "From the file" + return ev, rec + monkeypatch.setattr(store, "save_imported_idf", with_values) + out = persist_download(s4_download("UM20147_20250531135901.IDFW", + record={"peak_vector_sum_ips": 0.391, "sensor_location": "Loc A"}), + store=store, db=db) + row = db.get_event(out.db_event_id) + assert (row["peak_vector_sum"], row["sensor_location"]) == (1.5, "From the file") + + +def test_the_record_is_kept_even_when_the_file_gave_no_peaks_or_project(sdm, monkeypatch): + store, db = sdm + real = store.save_imported_idf + + def bare(*a, **kw): + ev, rec = real(*a, **kw) + ev.peak_values = ev.project_info = None + return ev, rec + monkeypatch.setattr(store, "save_imported_idf", bare) + out = persist_download(s4_download("UM20147_20250531135901.IDFW", + record={"peak_vector_sum_ips": 0.391, "sensor_location": "Loc A"}), + store=store, db=db) + row = db.get_event(out.db_event_id) + assert (row["peak_vector_sum"], row["sensor_location"]) == (0.391, "Loc A") + + def test_a_series4_histogram_is_stored(sdm): store, db = sdm out = persist_download(s4_download("UM20147_20250330070110.IDFH", verified=None), store=store, db=db) -- 2.54.1 From 01b9188f2500a84ba87a5aca80dc4927abee69b9 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:38:34 -0400 Subject: [PATCH 042/223] fix(sfm): a stale Series-3 id is refused before the full download, not after Series3Adapter.download_event compared the timestamp only after download_event_by_key had run the whole 5A. A stale id cost a full download of the wrong event (minutes on cellular), could surface the 64 KB-page 502 instead of 409, and a lost 0C reply was reported as "the unit was erased". - get_events() gains only_key_timestamp: with only_key, if the target's 0C says another time (or none), the target takes the existing bypass -- no 1F(arm), no POLL, no 5A. A new branch only; it adds no command. - download_event_by_key(key4, *, expected_timestamp=None) passes it on. - The adapter converts the id's stamp to that ISO form and checks, in order: no event -> 404; no readable 0C timestamp -> 502 MalformedReply ("could not read ... record (0C)"); a different time -> 409 StaleEvent; no frames -> 502. - The fake's download mirrors the real walk (no frames on a mismatch) and records what it was asked for. - Legacy get_events() (none of the new options) is pinned by a test of its exact call sequence and 5A arguments, written before the change. Read-only; nothing new on the wire. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 26 ++++++++-- sfm/device_access/s3.py | 11 +++- tests/device_access_fakes.py | 21 +++++++- tests/test_device_access_s3_events.py | 22 ++++++-- tests/test_minimate_event_headers.py | 73 +++++++++++++++++++++++++-- 5 files changed, 141 insertions(+), 12 deletions(-) diff --git a/minimateplus/client.py b/minimateplus/client.py index 9a40328..e0755fd 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -450,7 +450,7 @@ class MiniMateClient: proto.confirm_erase_all() log.info("delete_all_events: erase confirmed — device memory cleared") - def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1, headers_only: bool = False, only_key: Optional[bytes] = None) -> list[Event]: + def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1, headers_only: bool = False, only_key: Optional[bytes] = None, only_key_timestamp: Optional[str] = None) -> list[Event]: """ Download all stored events from the device using the confirmed 1E → 0A → 0C → 5A → 1F event-iterator protocol. @@ -483,6 +483,11 @@ class MiniMateClient: only_key: download only the event with this key (in full, per full_waveform); walk the others without their 5A, and stop once that event is read. + only_key_timestamp: with only_key, the ISO timestamp (as + `_event_timestamp_iso` formats it, e.g. "2026-10-01T08:00:00") the + event was listed with. If the 0C at only_key says another time, or + gave none, that event is returned without its 5A -- 1F(arm), POLL + and 5A are not sent -- and the caller reports which. """ proto = self._require_proto() @@ -586,6 +591,14 @@ class MiniMateClient: # read; 1F(arm) + POLL + 5A are not sent, and 1F(browse) below is # safe because no 5A was ever started. skip_5a = True + elif (only_key is not None and only_key_timestamp is not None + and actual_ts != only_key_timestamp): + # The event at this key is not the one asked for -- erased or + # wrapped since it was listed, or its 0C reply was lost. Do + # not download it; the caller reports which. + log.info("get_events: key=%s is from %r, not %r -- no 5A", + cur_key.hex(), actual_ts, only_key_timestamp) + skip_5a = True arm_key4: Optional[bytes] = None a5_ok = False @@ -765,14 +778,21 @@ class MiniMateClient: """ return self.get_events(headers_only=True) - def download_event_by_key(self, key4: bytes) -> Optional[Event]: + def download_event_by_key(self, key4: bytes, *, expected_timestamp: Optional[str] = None) -> Optional[Event]: """Download ONE event in full; walk past the events before it without their 5A. None if no full record has that key. `get_events(stop_after_index=N)` downloads events 0..N in full and keeps one; this downloads only the one asked for. + + `expected_timestamp` (ISO, as `_event_timestamp_iso` writes it): the + time the event was listed with. If the 0C read at that key says + otherwise -- or could not be read -- the event comes back without its + 5A (`_a5_frames` None) and nothing is downloaded; the caller compares + the timestamp and says which. """ - for ev in self.get_events(full_waveform=True, only_key=key4): + for ev in self.get_events(full_waveform=True, only_key=key4, + only_key_timestamp=expected_timestamp): if ev._waveform_key == key4: return ev return None diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 2c74b14..3d0c75b 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -176,11 +176,16 @@ class Series3Adapter: def download_event(self, address: UnitAddress, serial: str, key: bytes, stamp: Optional[str]) -> DownloadedEvent: + # The walk compares this with the target's 0C and, on a mismatch, sends + # no 5A: a stale id costs a header walk, not a full download of the + # wrong event. + iso = datetime.datetime.strptime(stamp, "%Y%m%d%H%M%S").isoformat() if stamp is not None else None + def op(client: Any) -> DownloadedEvent: info = client.connect() self._check(info.serial, serial, address) try: - ev = client.download_event_by_key(key) + ev = client.download_event_by_key(key, expected_timestamp=iso) except struct.error as exc: # Inferred, not measured here: the known 5A page bug. An event past the unit's # first 64 KB drives TERM's offset negative, and struct.pack rejects it @@ -192,6 +197,10 @@ class Series3Adapter: if ev is None: raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") found = stamp_of(_s3_dt(ev)) + if stamp is not None and found is None: + raise MalformedReply( + f"could not read event {key.hex()}'s record (0C) to confirm it is the one " + "listed -- not downloaded; try again") if stamp is not None and found != stamp: raise StaleEvent( f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 5c87a2d..ec71271 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -57,6 +57,15 @@ def s3_event(index, key_hex, when, *, record_type="Waveform", pvs=0.12, frames=T return ev +def _iso(ev): + """minimateplus.client._event_timestamp_iso's format; "" with no timestamp.""" + ts = ev.timestamp + if ts is None: + return "" + return datetime.datetime(ts.year, ts.month, ts.day, ts.hour or 0, ts.minute or 0, + ts.second or 0).isoformat() + + def default_s3_events(): return [ s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)), @@ -78,6 +87,8 @@ class FakeMiniMateClient(_Base): ) self.compliance = compliance self.events = default_s3_events() if events is None else events + self.download_requests: list = [] # (key4, expected_timestamp) per download + self.last_download = None def connect(self) -> DeviceInfo: self._step("connect") @@ -107,10 +118,18 @@ class FakeMiniMateClient(_Base): out.append(h) return out - def download_event_by_key(self, key4): + def download_event_by_key(self, key4, *, expected_timestamp=None): + """As the real walk: an event whose 0C time is not the expected one comes + back without its 5A.""" self._step("download_event_by_key") + self.download_requests.append((key4, expected_timestamp)) + self.last_download = None for ev in self.events: if ev._waveform_key == key4: + if expected_timestamp is not None and _iso(ev) != expected_timestamp: + ev = copy.copy(ev) + ev._a5_frames = None + self.last_download = ev return ev return None diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index eb6cf87..febcdf5 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -80,13 +80,29 @@ def test_a_key_that_is_not_stored_is_404(): def test_a_stale_id_is_refused_rather_than_downloading_another_event(): + fake = FakeMiniMateClient() with pytest.raises(StaleEvent, match="20261001080000"): - adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, "20250101000000") + adapter(fake).download_event(TCP, "BE18193", FIRST, "20250101000000") + # The walk was told what to expect, so it compared after 0C and sent no 5A. + assert fake.download_requests == [(FIRST, "2025-01-01T00:00:00")] + assert fake.last_download is not None and fake.last_download._a5_frames is None def test_an_id_without_a_timestamp_skips_the_check(): - dl = adapter(FakeMiniMateClient()).download_event(TCP, "BE18193", FIRST, None) + fake = FakeMiniMateClient() + dl = adapter(fake).download_event(TCP, "BE18193", FIRST, None) assert dl.event_id == "BE18193:01110000:20261001080000" + assert fake.download_requests == [(FIRST, None)] + + +def test_a_target_whose_record_could_not_be_read_is_not_called_stale(): + # A lost 0C reply leaves no timestamp to compare: that is a bad reply, not an erase. + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) + ev.timestamp = None + fake = FakeMiniMateClient(events=[ev]) + with pytest.raises(MalformedReply, match="0C"): + adapter(fake).download_event(TCP, "BE18193", FIRST, "20261001080000") + assert fake.last_download._a5_frames is None def test_a_failed_5a_is_a_clear_error(): @@ -99,7 +115,7 @@ def test_a_failed_5a_is_a_clear_error(): def test_the_64k_page_bug_is_named_not_a_bare_500(): fake = FakeMiniMateClient() - def boom(key4): + def boom(key4, **kw): raise struct.error("argument out of range") fake.download_event_by_key = boom with pytest.raises(MalformedReply, match="64 KB"): diff --git a/tests/test_minimate_event_headers.py b/tests/test_minimate_event_headers.py index fee5322..9bdd0fe 100644 --- a/tests/test_minimate_event_headers.py +++ b/tests/test_minimate_event_headers.py @@ -22,13 +22,27 @@ STAMPS = { class FakeProto: - """Records every call; serves a three-event chain the way the unit does.""" + """Records every call; serves a three-event chain the way the unit does. - def __init__(self, keys=KEYS, partial=()): + `fail` injects lost replies: {(name, n): exc} raises exc on the n-th call + (1-based) of that name, after the call is recorded -- the request went out + and its reply never came. Names: "1E", "0A", "0C", "1F-browse", "1F-arm", + "POLL", "5A". With no `fail`, nothing changes. + """ + + def __init__(self, keys=KEYS, partial=(), fail=None): self.keys = list(keys) self.partial = set(partial) + self.fail = dict(fail or {}) self.calls: list[tuple] = [] self._pos = 0 + self._counts: dict[str, int] = {} + + def _maybe_fail(self, name): + n = self._counts[name] = self._counts.get(name, 0) + 1 + exc = self.fail.get((name, n)) + if exc is not None: + raise exc def _entry(self, i): if i >= len(self.keys): @@ -37,20 +51,24 @@ class FakeProto: def read_event_first(self, token=0): self.calls.append(("1E", token)) + self._maybe_fail("1E") if token == 0: self._pos = 0 return self._entry(self._pos) def read_waveform_header(self, key4): self.calls.append(("0A", key4)) + self._maybe_fail("0A") return b"", (0x2C if key4 in self.partial else 0x46) def read_waveform_record(self, key4): self.calls.append(("0C", key4)) + self._maybe_fail("0C") return key4 # decoded by the patched decoder below def advance_event(self, browse=False): self.calls.append(("1F", "browse" if browse else "arm")) + self._maybe_fail("1F-browse" if browse else "1F-arm") if browse: self._pos += 1 return self._entry(self._pos) @@ -58,9 +76,11 @@ class FakeProto: def poll(self): self.calls.append(("POLL",)) + self._maybe_fail("POLL") def read_bulk_waveform_stream(self, key4, **kw): - self.calls.append(("5A", key4)) + self.calls.append(("5A", key4, tuple(sorted(kw.items())))) + self._maybe_fail("5A") return ["frame"] @@ -110,7 +130,7 @@ def test_downloading_one_event_starts_exactly_one_5a(client): proto = FakeProto() ev = client(proto).download_event_by_key(KEYS[1]) assert ev is not None and ev._waveform_key == KEYS[1] - assert [c for c in proto.calls if c[0] == "5A"] == [("5A", KEYS[1])] + assert [c[:2] for c in proto.calls if c[0] == "5A"] == [("5A", KEYS[1])] assert ev._a5_frames == ["frame"] @@ -135,3 +155,48 @@ def test_a_partial_record_is_skipped_by_both(client): events = client(FakeProto(partial={KEYS[1]})).list_event_headers() assert [e._waveform_key for e in events] == [KEYS[0], KEYS[2]] assert client(FakeProto(partial={KEYS[1]})).download_event_by_key(KEYS[1]) is None + + +# ── the legacy walk, pinned: any call passing none of the new options ───────── + +_LEGACY_PER_EVENT = ["0A", "1E", "0C", "1F", "POLL", "POLL", "POLL", "5A", "1F"] + + +@pytest.mark.parametrize("full", [False, True]) +def test_legacy_get_events_sends_exactly_what_it_always_sent(client, full): + proto = FakeProto() + events = client(proto).get_events(full_waveform=full) + assert [e._waveform_key for e in events] == KEYS + assert _subs(proto) == ["1E"] + _LEGACY_PER_EVENT * len(KEYS) + mode = ({"include_terminator": True, "max_chunks": 128, "stop_after_metadata": False} if full else + {"extra_chunks_after_metadata": 1, "include_terminator": True, "max_chunks": 128, + "stop_after_metadata": True}) + assert [c for c in proto.calls if c[0] == "5A"] == [("5A", k, tuple(sorted(mode.items()))) + for k in KEYS] + assert [c for c in proto.calls if c[0] == "1F"] == [("1F", "arm"), ("1F", "browse")] * len(KEYS) + assert all(e._a5_frames == ["frame"] for e in events) + + +# ── a stale id: the target's 0C says another time, so no 5A goes out ────────── + +def test_a_target_from_another_time_gets_no_5a(client): + proto = FakeProto() + ev = client(proto).download_event_by_key(KEYS[1], expected_timestamp="2025-01-01T00:00:00") + assert [c for c in proto.calls if c[0] == "5A"] == [] + assert ("1F", "arm") not in proto.calls and ("POLL",) not in proto.calls + assert ev is not None and ev._waveform_key == KEYS[1] and ev._a5_frames is None + + +def test_the_target_at_its_listed_time_gets_exactly_one_5a(client): + proto = FakeProto() + ev = client(proto).download_event_by_key(KEYS[1], expected_timestamp="2026-10-02T09:30:15") + assert [c[:2] for c in proto.calls if c[0] == "5A"] == [("5A", KEYS[1])] + assert ev._a5_frames == ["frame"] + + +def test_a_target_whose_0c_reply_was_lost_gets_no_5a(client): + from minimateplus.protocol import TimeoutError as MMTimeout + proto = FakeProto(fail={("0C", 2): MMTimeout("0C lost")}) + ev = client(proto).download_event_by_key(KEYS[1], expected_timestamp="2026-10-02T09:30:15") + assert [c for c in proto.calls if c[0] == "5A"] == [] + assert ev is not None and ev.timestamp is None and ev._a5_frames is None -- 2.54.1 From 59dff06f1ce885473c461475f7291aed9f6832fb Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:39:54 -0400 Subject: [PATCH 043/223] fix(sfm): the Series-3 header walk fails loudly, and listing uses the normal timeout One lost 1F reply made the list return 1 of 3 events as a 200, and on a download gave a false 404. The list also ran on the 120 s download timeout, so each lost reply stalled the walk 120 s with the unit locked. - get_events() strict mode (headers_only, or only_key): a lost 0A reply, a lost 1F(browse) reply on the success path and on the partial-record path all re-raise their ProtocolError; a 1F that hands back a key already walked raises ProtocolError("event chain did not advance ..."). Legacy calls (none of the new options) behave exactly as before -- pinned by tests of the same three faults under get_events(). - Series3Adapter.list_events runs on the default timeout (10 s on TCP); download_event keeps 120 s. - FakeProto gains optional lost-reply injection; its default is unchanged. The repeat-key guard sits at the loop head, which is reached only for a non-null key -- equivalent to checking each 1F's key, in one place. Read-only; nothing new on the wire. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 18 +++++++ sfm/device_access/s3.py | 4 +- tests/test_device_access_s3_events.py | 11 ++++- tests/test_minimate_event_headers.py | 67 +++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 3 deletions(-) diff --git a/minimateplus/client.py b/minimateplus/client.py index e0755fd..ca3a1e8 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -488,8 +488,15 @@ class MiniMateClient: event was listed with. If the 0C at only_key says another time, or gave none, that event is returned without its 5A -- 1F(arm), POLL and 5A are not sent -- and the caller reports which. + + Strict mode (headers_only, or only_key): a list or a one-event download + must be all or nothing, so a lost 0A or 1F reply re-raises its + ProtocolError instead of skipping an event or ending the walk early, + and a 1F that returns a key already walked raises ProtocolError. + Without those options (legacy) the walk is exactly as it was. """ proto = self._require_proto() + strict = headers_only or only_key is not None log.info("get_events: requesting first event (SUB 1E)") try: @@ -506,6 +513,7 @@ class MiniMateClient: events: list[Event] = [] idx = 0 + seen: set = set() # strict mode: keys walked, to catch a chain that does not advance # Legacy bare-key skip set is deprecated: the device's key counter # resets to 0x01110000 after every memory erase, so a key in this set @@ -523,6 +531,10 @@ class MiniMateClient: while data8[4:8] != b"\x00\x00\x00\x00": cur_key = key4 # key for this event's 0A/1E-arm/0C/5A calls + if strict and cur_key in seen: + raise ProtocolError( + f"event chain did not advance: key {cur_key.hex()} came back twice") + seen.add(cur_key) log.info("get_events: record %d key=%s", idx, cur_key.hex()) ev = Event(index=idx) @@ -540,6 +552,8 @@ class MiniMateClient: ) proceed = False except ProtocolError as exc: + if strict: + raise log.warning( "get_events: 0A failed for key=%s: %s — skipping", cur_key.hex(), exc, @@ -702,6 +716,8 @@ class MiniMateClient: key4.hex(), data8[4:8].hex(), ) except ProtocolError as exc: + if strict: + raise log.warning("get_events: 1F(browse) failed: %s — stopping", exc) key4 = b"\x00\x00\x00\x00" data8 = b"\x00\x00\x00\x00\x00\x00\x00\x00" @@ -761,6 +777,8 @@ class MiniMateClient: key4.hex(), data8[4:8].hex(), ) except ProtocolError as exc: + if strict: + raise log.warning("get_events: 1F failed: %s — stopping iteration", exc) break diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 3d0c75b..de9c20e 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -172,7 +172,9 @@ class Series3Adapter: self._check(info.serial, serial, address) return EventList(serial=serial, series=3, events=[_s3_ref(ev, serial) for ev in client.list_event_headers()]) - return self._run(address, op, timeout=S3_EVENT_TIMEOUT) + # The default timeout: a header walk is small replies only, so a lost + # one costs 10 s (TCP) with the unit locked, not 120 s. + return self._run(address, op) def download_event(self, address: UnitAddress, serial: str, key: bytes, stamp: Optional[str]) -> DownloadedEvent: diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index febcdf5..55ab07b 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -44,15 +44,22 @@ def test_listing_maps_each_header_into_the_shared_shape(): assert e.filename and e.filename.startswith("T193") -def test_listing_uses_the_header_walk_and_the_long_timeout(): +def test_listing_uses_the_header_walk_and_the_default_timeout(): + # A header walk is small replies only; a lost one should cost 10 s, not 120 s. fake = FakeMiniMateClient() a = adapter(fake) a.list_events(TCP, "BE18193") assert "list_event_headers" in fake.calls and "download_event_by_key" not in fake.calls - assert a.seen == [{"timeout": 120.0}] + assert a.seen == [{}] assert fake.closed == 1 +def test_downloading_uses_the_long_timeout(): + a = adapter(FakeMiniMateClient()) + a.download_event(TCP, "BE18193", FIRST, None) + assert a.seen == [{"timeout": 120.0}] + + def test_listing_refuses_a_different_unit(): with pytest.raises(WrongUnit): adapter(FakeMiniMateClient(serial="BE11529")).list_events(TCP, "BE18193") diff --git a/tests/test_minimate_event_headers.py b/tests/test_minimate_event_headers.py index 9bdd0fe..c232337 100644 --- a/tests/test_minimate_event_headers.py +++ b/tests/test_minimate_event_headers.py @@ -11,6 +11,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import minimateplus.client as mc # noqa: E402 from minimateplus.client import MiniMateClient # noqa: E402 from minimateplus.models import Timestamp # noqa: E402 +from minimateplus.protocol import ProtocolError # noqa: E402 END = b"\x00" * 8 KEYS = [bytes.fromhex(k) for k in ("01110000", "0111245a", "01114290")] @@ -200,3 +201,69 @@ def test_a_target_whose_0c_reply_was_lost_gets_no_5a(client): ev = client(proto).download_event_by_key(KEYS[1], expected_timestamp="2026-10-02T09:30:15") assert [c for c in proto.calls if c[0] == "5A"] == [] assert ev is not None and ev.timestamp is None and ev._a5_frames is None + + +# ── the strict walk: listing and one-event download fail loudly ─────────────── +# A lost reply must not become a short list (200) or a false 404. + +def test_a_lost_1f_reply_fails_the_list_rather_than_shortening_it(client): + lost = ProtocolError("no reply to 1F") + with pytest.raises(ProtocolError) as ei: + client(FakeProto(fail={("1F-browse", 2): lost})).list_event_headers() + assert ei.value is lost + + +def test_a_lost_1f_reply_fails_the_download_rather_than_reporting_no_event(client): + lost = ProtocolError("no reply to 1F") + proto = FakeProto(fail={("1F-browse", 2): lost}) + with pytest.raises(ProtocolError) as ei: + client(proto).download_event_by_key(KEYS[2]) + assert ei.value is lost + assert [c for c in proto.calls if c[0] == "5A"] == [] + + +@pytest.mark.parametrize("walk", ["list", "download"]) +def test_a_lost_0a_reply_fails_the_walk(client, walk): + lost = ProtocolError("no reply to 0A") + c = client(FakeProto(fail={("0A", 2): lost})) + with pytest.raises(ProtocolError) as ei: + c.list_event_headers() if walk == "list" else c.download_event_by_key(KEYS[2]) + assert ei.value is lost + + +def test_a_lost_1f_reply_after_a_partial_record_fails_the_list(client): + lost = ProtocolError("no reply to 1F") + with pytest.raises(ProtocolError) as ei: + client(FakeProto(partial={KEYS[1]}, fail={("1F-browse", 2): lost})).list_event_headers() + assert ei.value is lost + + +@pytest.mark.parametrize("walk", ["list", "download"]) +def test_a_chain_that_does_not_advance_fails_the_walk(client, walk): + proto = FakeProto(keys=[KEYS[0], KEYS[1], KEYS[0]]) + c = client(proto) + with pytest.raises(ProtocolError, match="did not advance.*01110000"): + c.list_event_headers() if walk == "list" else c.download_event_by_key(KEYS[2]) + assert proto.calls.count(("0A", KEYS[0])) == 1 # stopped before re-reading it + + +# ── ... while legacy get_events() keeps doing exactly what it did ──────────── + +def test_legacy_get_events_still_returns_what_it_read_when_a_1f_reply_is_lost(client): + proto = FakeProto(fail={("1F-browse", 2): ProtocolError("no reply to 1F")}) + events = client(proto).get_events() + assert [e._waveform_key for e in events] == KEYS[:2] + assert _subs(proto) == ["1E"] + _LEGACY_PER_EVENT * 2 + + +def test_legacy_get_events_still_skips_an_event_whose_0a_reply_is_lost(client): + proto = FakeProto(fail={("0A", 2): ProtocolError("no reply to 0A")}) + events = client(proto).get_events() + assert [e._waveform_key for e in events] == [KEYS[0], KEYS[2]] + assert _subs(proto) == ["1E"] + _LEGACY_PER_EVENT + ["0A", "1F"] + _LEGACY_PER_EVENT + + +def test_legacy_get_events_still_walks_a_repeated_key(client): + proto = FakeProto(keys=[KEYS[0], KEYS[1], KEYS[0]]) + events = client(proto).get_events() + assert [e._waveform_key for e in events] == [KEYS[0], KEYS[1], KEYS[0]] -- 2.54.1 From 4e1e6a9d5c6b3a8d5c0aaf937697abc7b8277458 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:40:26 -0400 Subject: [PATCH 044/223] fix(sfm): Series-3 events list with no record type, not a wrong one minimateplus's _extract_record_type returns "Waveform" for every 0C record layout -- it cannot tell a histogram -- so a MiniMate histogram was listed as "waveform". The fake's "Histogram" was a value the real client never produces, which is why no test saw it. - _s3_ref: record_type is always None, with detail.record_type_note = "Series 3's event record does not say waveform or histogram; not decoded yet". - default_s3_events(): both events "Waveform", as the real client gives. - The shared-shape contract test allows exactly {"record_type"} to be None for Series 3 and nothing for Series 4. Rows SFM stores for Series 3 still carry "Waveform" from the decode (the same as the legacy blastware_file route); parked in the spec. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 11 +++++++++-- tests/device_access_fakes.py | 2 +- tests/test_device_access_event_dispatch.py | 4 +++- tests/test_device_access_s3_events.py | 4 +++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index de9c20e..e965ecf 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -57,7 +57,13 @@ def _s3_filename(ev: Any, serial: str) -> Optional[str]: return None +S3_RECORD_TYPE_NOTE = "Series 3's event record does not say waveform or histogram; not decoded yet" + + def _s3_ref(ev: Any, serial: str) -> EventRef: + """record_type is always None: minimateplus's 0C decode reports "Waveform" + for every record layout, histograms included, so it cannot be trusted + here. Null rather than wrong until a histogram's 0C is captured.""" dt = _s3_dt(ev) pv = ev.peak_values peaks = {} @@ -67,10 +73,11 @@ def _s3_ref(ev: Any, serial: str) -> EventRef: return EventRef( event_id=make_event_id(serial, ev._waveform_key, stamp_of(dt)), serial=serial, series=3, index=ev.index, timestamp=iso_of(dt), - record_type=ev.record_type.lower() if ev.record_type else None, + record_type=None, peak_vector_sum_ips=pv.peak_vector_sum if pv is not None else None, peaks_ips=peaks, filename=_s3_filename(ev, serial), - detail={"mic_psi": pv.micl if pv is not None else None}, + detail={"mic_psi": pv.micl if pv is not None else None, + "record_type_note": S3_RECORD_TYPE_NOTE}, ) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index ec71271..48eb45a 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -69,7 +69,7 @@ def _iso(ev): def default_s3_events(): return [ s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)), - s3_event(1, "0111245a", datetime.datetime(2026, 10, 2, 9, 30, 15), record_type="Histogram"), + s3_event(1, "0111245a", datetime.datetime(2026, 10, 2, 9, 30, 15)), ] diff --git a/tests/test_device_access_event_dispatch.py b/tests/test_device_access_event_dispatch.py index bcda9fb..77a8d77 100644 --- a/tests/test_device_access_event_dispatch.py +++ b/tests/test_device_access_event_dispatch.py @@ -34,11 +34,13 @@ def test_both_series_list_events_in_the_same_shape(): def test_no_shared_field_is_empty_for_either_series(): # A field one series cannot fill belongs under `detail`, not at the top level. + # Except Series 3's record_type: its 0C cannot tell a histogram yet, and null beats a wrong type. + allowed = {3: {"record_type"}, 4: set()} for out in (access(s3=[FakeMiniMateClient()]).list_events(ADDR, "BE18193"), access(s4=[FakeMicromateClient()]).list_events(ADDR, "UM20147")): for e in out.events: empty = {k for k, v in dataclasses.asdict(e).items() if v is None} - assert empty == set(), (out.series, empty) + assert empty == allowed[out.series], (out.series, empty) def test_a_micromate_list_and_download_share_one_held_line(): diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index 55ab07b..680e8ad 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -38,7 +38,9 @@ def test_listing_maps_each_header_into_the_shared_shape(): assert (out.serial, out.series, len(out.events)) == ("BE18193", 3, 2) e = out.events[1] assert e.event_id == "BE18193:0111245a:20261002093015" - assert (e.index, e.timestamp, e.record_type) == (1, "2026-10-02T09:30:15", "histogram") + assert (e.index, e.timestamp) == (1, "2026-10-02T09:30:15") + # The 0C record does not say waveform or histogram (every layout reads "Waveform"). + assert e.record_type is None and "not decoded yet" in e.detail["record_type_note"] assert e.peaks_ips == {"tran": 0.05, "vert": 0.08, "long": 0.03} assert e.peak_vector_sum_ips == 0.12 and e.detail["mic_psi"] == 0.0001 assert e.filename and e.filename.startswith("T193") -- 2.54.1 From 2a70faf7b54e236b28d21a2e47eb29acb73c55a8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:41:26 -0400 Subject: [PATCH 045/223] docs(sfm): state the held-line invariant, pin the hang-up on a library error, correct the README - Series4Session's docstring now states which errors keep the line: an op raises a DeviceError only for a verdict on a healthy link (not found, stale, unnameable), and _exchange keeps the line for those; any library error means the link is suspect and hangs up. DecodeMismatch is a library error and hangs up -- conservative. Later ops must keep to it. - Test: a micromate TimeoutError mid-download, on a fresh DeviceAccess (no retry path), is NoAnswer, closes the client once and leaves no held line. It pins existing behaviour; a mutation that keeps the line on library errors makes it fail. - README, event rows corrected in place: another unit's id is 422 (not 409); a stale id is 409 without downloading, both series; an event already stored -- including by THOR's watcher -- returns its row and changes nothing (detail.already_stored); MiniMate lists give record_type null, on the normal timeout, and fail on a lost reply. No code behaviour change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- README.md | 4 ++-- sfm/device_access/s4.py | 9 +++++++++ tests/test_device_access_event_dispatch.py | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51638c8..448fccd 100644 --- a/README.md +++ b/README.md @@ -179,8 +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 | +| `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), on the normal timeout, and gives `record_type: null` (its event record does not say waveform or histogram; not decoded yet). A lost reply fails the list rather than shortening it | +| `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) gets **409** without downloading, for both series; an `event_id` from another unit gets **422**, before any I/O. An event already stored — by an earlier download, or by THOR's watcher — returns its existing row and changes nothing (same `db_event_id`, `inserted: false`, `detail.already_stored: true`). 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/sfm/device_access/s4.py b/sfm/device_access/s4.py index 7972e3d..4c9e277 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -112,6 +112,15 @@ class Series4Session: `last_traffic` is any exchange, keep-alives included: the keep-alive schedule measures it. If keep-alives counted as use, the line would never go idle. + + Invariant -- which errors keep the line. An operation raises a + `DeviceError` only for a verdict reached over a healthy link: the event is + not there, the id is stale, the record cannot be named. `_exchange` keeps + the line for those. Anything the library raises means the link is + suspect, and `_exchange` hangs up. `DecodeMismatch` is a library error, + so it hangs up too -- conservative, since the link may be fine. Operations + added in later phases must keep to this: never wrap a link failure in a + `DeviceError` inside an op, or the line stays open on a broken link. """ def __init__(self, address: UnitAddress, serial: str, diff --git a/tests/test_device_access_event_dispatch.py b/tests/test_device_access_event_dispatch.py index 77a8d77..cef297f 100644 --- a/tests/test_device_access_event_dispatch.py +++ b/tests/test_device_access_event_dispatch.py @@ -76,6 +76,22 @@ def test_a_ring_mid_download_releases_the_line_and_downloads_nothing(): assert fake.closed == 1 and da.held_serial(ADDR) is None +def test_a_library_error_mid_download_hangs_up(): + # Only a DeviceError verdict keeps the line; anything the library raises means + # the link is suspect. A fresh DeviceAccess, so the held-line retry cannot apply. + from micromate.protocol import TimeoutError as MicromateTimeout + from sfm.device_access.errors import NoAnswer + fake = FakeMicromateClient() + + def quiet(*a, **kw): + raise MicromateTimeout("quiet") + fake.fetch_event = quiet + da = access(s4=[fake]) + with pytest.raises(NoAnswer): + da.download_event(ADDR, "UM20147", "UM20147:055d4a81:20250531135901") + assert fake.closed == 1 and da.held_serial(ADDR) is None + + def test_a_stale_or_missing_event_keeps_the_line(): # The operation's own verdict (404/409) says nothing is wrong with the link; # hanging up would cost a call-up for no reason. -- 2.54.1 From a5ebe8d4b1358d2799005eec63c745e56fe998c8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:42:24 -0400 Subject: [PATCH 046/223] docs(spec): park the phase 1b review's open items; scope the owed MiniMate bench check - New section "Left open by the phase 1b review (2026-10-21)", after the 1a one: twelve one-line items, each naming the phase it matters to (retry re-running a whole download, last_used after a kept-line error, verified:null's two meanings, mic naming + the S4 0x0C mic denormal, 500 detail text, the serial as a directory name, no server-level ring test, S3 stored record_type, a fresh S4 download's gaps, orphan files, same-second collisions, 423 Retry-After). - The 1b bullets now give the owed MiniMate bench check's scope: a 3+ event list (1F(browse) after 1E(arm) without 1F(arm)), a non-first event, a histogram (capture its 0C), an event past 64 KB (the named 502), a stale id (no 5A), and a dropped reply via mm_link-style fault injection. - The 1b "Download" bullet's "refreshes the row" is retracted in place: the final review changed it to "returns the row, writes nothing". Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 0fd2aad..678f01f 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -335,15 +335,29 @@ Each safety piece arrives with its first real use, so nothing sits untested. `0C` + `1F` browse, no `5A`) instead of downloading every event to list it, and one event downloads without the ones before it. It reuses the bypass `skip_waveform_for_events` already takes, so no new command - reaches the wire. 🔶 Unproven on a unit: **a MiniMate bench check is - owed before this branch merges.** The legacy serial-less - `/device/events` keeps its full-download walk. + reaches the wire. The legacy serial-less `/device/events` keeps its + full-download walk. 🔶 Unproven on a unit: **a MiniMate bench check is + owed before this branch merges.** Its scope (final review, + 2026-10-21): + - a list of three or more events, confirming `1F(browse)` advances + after a `1E(arm)` without `1F(arm)`; + - a non-first event; + - a histogram-mode event, capturing its `0C` (which would let Series + 3's `record_type`, `null` today, be decoded); + - an event past 64 KB, expecting the named 502; + - a stale-id download, confirming no `5A` goes out; + - a dropped reply, via `bridges/mm_link.py`-style fault injection. - **Download = fetch, check, store** in SFM's database, the same as Series 3's `blastware_file` route, and returns the stored row's id. The file and waveform are then served by the existing `/db/events/{id}/…` routes. The database matches on (serial, timestamp), so storing an - event already stored, including one THOR's watcher forwarded, refreshes - the row instead of duplicating it. + event already stored, including one THOR's watcher forwarded, ~~refreshes + the row instead of duplicating it~~. **Changed by the final review + (2026-10-21):** it returns the existing row and writes nothing + (`inserted: false`, `detail.already_stored: true`). Never merge: the + watcher's copy, with its paired report, is the richer one, and a + refresh measurably downgraded it (PVS, project strings and ZC + frequencies went NULL). - **`event_id` = `::`.** Both series reuse keys (after an erase, and across Micromates), so a download whose key now holds a different event fails with 409 instead of fetching it. @@ -429,6 +443,24 @@ plan's scratch ledger. None blocks 1a; the phase each one matters to is named. keep-alive; it looks like a dead unit. Open with `exclusive=True`, or don't hold serial links. +## Left open by the phase 1b review (2026-10-21) + +Parked from the whole-branch review of 1b; none blocks it. The phase each +matters to is named. + +- **Retry re-runs a whole download (1c).** The retry-once on a held-line timeout re-runs the full download, roughly doubling time-to-error; narrow it to failures before the first reply. +- **`last_used` after a kept-line error (1c).** It is not refreshed when an op's verdict (404/409) keeps the line, so the idle hang-up comes early. +- **`verified: null` is ambiguous (1c).** It means both "a histogram" (no check exists) and "a waveform whose check could not run". +- **Mic naming and the Series-4 mic decode (1c).** `detail.mic_psi` on Series 3, `detail.mic` on Series 4; Series 4's `0x0C` mic decodes as a denormal (~5e-39) — fix the decode before 1c shows it. +- **500 detail leaks paths (1c, before SFM is reachable beyond Terra-View).** The download handler's 500 detail includes raw exception text, filesystem paths included. +- **Serial as a directory name (1c).** The serial is never checked against `[A-Z0-9]+` before it names a store directory; only the unit can choose it, but the check is cheap. +- **No server-level RADIO RING mid-download test (1c).** Covered structurally (DeviceAccess-level test + the ring transport), not through the handler. +- **Series-3 stored `record_type` (MiniMate bench check).** Rows SFM stores for Series 3 still say "Waveform" for histograms — pre-existing, the same as the legacy `blastware_file` route; fix it with the `0C` decode. +- **A fresh Series-4 download's gaps (1c).** No `sample_rate` is stored, and the sidecar has no vector sum; the DB row has the unit's PVS (overlaid from `0x0C`). +- **Orphan files (SDM).** An event file in the store with no DB row is still overwritten by a download. +- **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. +- **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. + ## Table 2: to be added later (both series) | area | item | -- 2.54.1 From 67a0fece34e240eac977f96373f47d2e1ec307b0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:45:04 -0400 Subject: [PATCH 047/223] docs(spec): park two more phase 1b items -- a lost 0C in a list, the walk retry Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 678f01f..5f1e194 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -460,6 +460,14 @@ matters to is named. - **Orphan files (SDM).** An event file in the store with no DB row is still overwritten by a download. - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. - **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. +- **A lost `0C` during a Series-3 list.** The strict walk raises on a lost `0A` + or `1F`, but a lost `0C` still lists the event with no timestamp and an + `event_id` ending `:-`. Downloading that id skips the stale check and runs the + full `5A`, then refuses to store it (no timestamp means no filename), so it is + wasted transfer, not bad data. Fix: raise on a lost `0C` in strict mode, or + refuse `:-` ids for Series 3. +- **A lost reply on a Series-3 TCP walk re-runs it once** under the adapter's + cold-boot retry before the 504, doubling time-to-error on a bad link. ## Table 2: to be added later (both series) -- 2.54.1 From a130107fdf0927952d01df9acc49fbd5727cd5a6 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:58:18 -0400 Subject: [PATCH 048/223] fix(sfm): a Series-4 record whose timestamp did not decode is not called stale Mirrors the Series-3 fix (F3): an unreadable 0C timestamp is a decode or comms fault, not proof the unit was erased. Nothing is downloaded. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s4.py | 4 ++++ tests/test_device_access_s4_events.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 4c9e277..a1ceada 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -282,6 +282,10 @@ def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str] if ref.key != key: continue found = stamp_of(ref.timestamp) + if stamp is not None and found is None: + raise MalformedReply( + f"could not read event {key.hex()}'s record (0C) timestamp to confirm it " + "is the one listed -- not downloaded; try again") if stamp is not None and found != stamp: raise StaleEvent( f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- " diff --git a/tests/test_device_access_s4_events.py b/tests/test_device_access_s4_events.py index 2a803b0..4b30136 100644 --- a/tests/test_device_access_s4_events.py +++ b/tests/test_device_access_s4_events.py @@ -69,3 +69,14 @@ def test_a_stale_id_is_refused_and_nothing_is_downloaded(): def test_a_key_that_is_not_stored_is_404(): with pytest.raises(EventNotFound): s4_download_event(FakeMicromateClient(), "UM20147", bytes.fromhex("deadbeef"), None) + + +def test_a_record_whose_timestamp_did_not_decode_is_not_called_stale(): + # Mirrors Series 3 (F3): an unreadable 0C timestamp is a comms/decode fault, + # not proof the unit was erased -- and nothing is downloaded. + from sfm.device_access.errors import MalformedReply + fake = FakeMicromateClient() + fake.event_refs[0].timestamp = None + with pytest.raises(MalformedReply, match="0C"): + s4_download_event(fake, "UM20147", W_KEY, "20250531135901") + assert fake.fetched == [] -- 2.54.1 From 9a6bfa4d904da66b5e2d5523dab967290ba27a12 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:58:18 -0400 Subject: [PATCH 049/223] test: force-add the two Thor event fixtures the device-access tests read tests/fixtures/ is gitignored, so these were never committed. Since phase 1b the test fakes read them, so on a fresh clone every test that builds a fake Micromate -- phase 1a's included -- failed with FileNotFoundError. Same precedent as tests/fixtures/micromate-setup/: UM20147's own bench events. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../thor-idf/UM20147_20250330070110.IDFH | Bin 0 -> 43054 bytes .../thor-idf/UM20147_20250531135901.IDFW | Bin 0 -> 12462 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/fixtures/thor-idf/UM20147_20250330070110.IDFH create mode 100644 tests/fixtures/thor-idf/UM20147_20250531135901.IDFW diff --git a/tests/fixtures/thor-idf/UM20147_20250330070110.IDFH b/tests/fixtures/thor-idf/UM20147_20250330070110.IDFH new file mode 100644 index 0000000000000000000000000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V!gqO-gJ{gyr?IT>H{We#ec`hn^?3*s8#d+pf=4oE-d^hEmPbK^(-K=&Z# z|6KgK-6TxYccR04ZeTOl8J`5w?J^9!hB55&ATYLTG1uB_y9(o`59I9ogXA_}&U8nH zT93_G1iwXRoEv(GSgp22>&Qs&Fz<}`Gk-Ae99e1WR$_;ASAf-Fq>EiAJJ2r5|9|Ty zzqj@14o|XuA&-vvYSN-h8D8F55A0ySkP$=;pX1JIp6u-g&S*@|D&-&Fy(5>#0Ha_QA;dMfqcT3Gq9Dd1eE1Z{uu= z;yGoze3y#vWl!(#Dc`Lz`^WvFJB~5rWNdWbLwg>!GpEdRis4wFu*8~0%pFP|BRUUr z3!#slbAI>>VIYE?GKVB5v8$N6GC*|4Fb2QuOvuUSdV`J4f9!LW=PouC2I)WPSKFSm zWxb((599pA#8z*6*x4@Z1oKo|yz?yZQCmCTlIqQID8}xi(?--4KHlGvyo<(BCTBi? zZ3pOnt@q3=;_K`b$;_Niy#I`IF*@g5ccOG(Xr)v|*RV_?6`b&-JOUB}%(srMSwH0!* zk0{-f_Dq@fR}7@ueSG#m>gT#!t@CC!g|V|E?ntYY`iOm1LqkYSE7On%UN zhwf)J>?M9ihZrvZfqIU<9>2pFbC2bHqhq}(|3S+*zdwL4{LdM7R%}pCWqheeE35ji zTus{^UNl-hdBx_)-UA$Hzop?0;oE8mWN!S1WMNOJ9xdv!=-9VFX4Zn^YpLrgyBBHr z2Ifk>C%hy6z#qM9n(<@pAsyl*P5dgYmzUK(Nhr^Muf9U;p@D%*b;J literal 0 HcmV?d00001 diff --git a/tests/fixtures/thor-idf/UM20147_20250531135901.IDFW b/tests/fixtures/thor-idf/UM20147_20250531135901.IDFW new file mode 100644 index 0000000000000000000000000000000000000000..476ddc905e429f5695c7e2b2185adf0e5ca76a78 GIT binary patch literal 12462 zcmeHtXH*u zb#>J~`|Mrk`}Y2hPy~e#dSKt-7fScNu=hDQ{^ot8kDQ=>gb)o!zV?kjM(F?c zzN^1_r78CzxHcm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v+M$MCYO30HOP{utV3->$MkdLsSI)5OC!?l=cL(RPNqU2U_c zrLL3%v)}m#E$n7oINyvGPXSM)M-zlcsQ6v7w|f43qbOB4EQu+A*brH<09aCgv9;&4 zADu9p6H>KE&Lg%zTsPPbxv%!2nh|?!ns!-#y7$A4u(#UQe{!C#A2vssG|N0;Is%=A tx#{BZIi`7FEZU$Wwv}QkWbGka!{}FT<(cy~Y={pMp`Ju#sHp0|e**7P`BDG? literal 0 HcmV?d00001 -- 2.54.1 From 7a6c74266be4bf09f00c6d40878086da8a4cd202 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 21 Oct 2026 17:59:25 -0400 Subject: [PATCH 050/223] docs: phase 1b re-review residuals -- bench scope gains the already-stored check, parked items corrected Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- README.md | 4 ++-- .../2026-10-20-sfm-series4-parity-design.md | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 448fccd..a370c49 100644 --- a/README.md +++ b/README.md @@ -179,8 +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), on the normal timeout, and gives `record_type: null` (its event record does not say waveform or histogram; not decoded yet). A lost reply fails the list rather than shortening it | -| `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) gets **409** without downloading, for both series; an `event_id` from another unit gets **422**, before any I/O. An event already stored — by an earlier download, or by THOR's watcher — returns its existing row and changes nothing (same `db_event_id`, `inserted: false`, `detail.already_stored: true`). The unit is busy for the whole download; other requests to it get 423 | +| `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), on the normal timeout, and gives `record_type: null` (its event record does not say waveform or histogram; not decoded yet). A lost walk reply fails the list rather than shortening it (a lost event-record reply still lists that event, without a timestamp) | +| `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) gets **409** without downloading, for both series; an `event_id` from another unit gets **422**, before any I/O. An event already stored — by an earlier download, or by THOR's or Blastware's call-home watcher — returns its existing row and changes nothing (same `db_event_id`, `inserted: false`, `detail.already_stored: true`). 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/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 5f1e194..a5e4dfe 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -346,6 +346,13 @@ Each safety piece arrives with its first real use, so nothing sits untested. 3's `record_type`, `null` today, be decoded); - an event past 64 KB, expecting the named 502; - a stale-id download, confirming no `5A` goes out; + - a download of an event Blastware's call-home already delivered (one + waveform, one histogram), expecting `already_stored`. This is the + only way to measure that Series 3's (serial, timestamp) agrees + between the unit's `0C` and the watcher's import; if it does not, + a download silently stores a duplicate row (never a downgrade). + Measured for Series 4: 1,016/1,016 watcher imports found by the + lookup (2026-10-21). - a dropped reply, via `bridges/mm_link.py`-style fault injection. - **Download = fetch, check, store** in SFM's database, the same as Series 3's `blastware_file` route, and returns the stored row's id. The @@ -460,14 +467,18 @@ matters to is named. - **Orphan files (SDM).** An event file in the store with no DB row is still overwritten by a download. - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. - **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. -- **A lost `0C` during a Series-3 list.** The strict walk raises on a lost `0A` +- **A lost `0C` during a Series-3 list (1c).** The strict walk raises on a lost `0A` or `1F`, but a lost `0C` still lists the event with no timestamp and an `event_id` ending `:-`. Downloading that id skips the stale check and runs the - full `5A`, then refuses to store it (no timestamp means no filename), so it is - wasted transfer, not bad data. Fix: raise on a lost `0C` in strict mode, or + full `5A`. If the `0C` is lost again it is refused (no timestamp, no filename); + if it reads, whatever event now sits at that key is stored with no stale check: + self-consistent data, but possibly not the event that was listed. Fix: raise on a lost `0C` in strict mode, or refuse `:-` ids for Series 3. -- **A lost reply on a Series-3 TCP walk re-runs it once** under the adapter's +- **A lost reply on a Series-3 TCP walk re-runs it once (1c)** under the adapter's cold-boot retry before the 504, doubling time-to-error on a bad link. +- **A Series-3 download of an already-stored event still runs the full `5A`** + before the database lookup finds it (the lookup is on the SDM side, after the + device layer). Wasted transfer, not bad data (1c). ## Table 2: to be added later (both series) -- 2.54.1 From 2a6acae259c6cdea6438cd349f371f18bcbc1e5a Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 00:14:30 -0400 Subject: [PATCH 051/223] docs(plan): Series-4 write path phase 2 -- encoder, opcode gate, write plans, dry run Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- ...026-10-22-sfm-series4-write-path-phase2.md | 1135 +++++++++++++++++ .../2026-10-20-sfm-series4-parity-design.md | 8 + 2 files changed, 1143 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-22-sfm-series4-write-path-phase2.md diff --git a/docs/superpowers/plans/2026-10-22-sfm-series4-write-path-phase2.md b/docs/superpowers/plans/2026-10-22-sfm-series4-write-path-phase2.md new file mode 100644 index 0000000..240da39 --- /dev/null +++ b/docs/superpowers/plans/2026-10-22-sfm-series4-write-path-phase2.md @@ -0,0 +1,1135 @@ +# Series-4 write path, phase 2: encoder, opcode guard, dry run — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Build every Micromate write a later phase needs as an exact, reviewable **write plan**, proven byte for byte against THOR's captured frames. Make it impossible for any code path to transmit a write opcode, or `0xA2` ever, by accident. Nothing is sent to a unit. + +**Architecture:** +- `micromate/framing.py`: `build_request()` gains an optional data section, using the same escape set and SUM8 it already applies. +- `micromate/opcodes.py` (new): one table of write SUBs and one of cross-series collisions (`0xA2`). +- **The send-side gate.** `MicromateProtocol._send()` now reads each outgoing frame's SUB. It refuses any write SUB the protocol object was not explicitly allowed, and always refuses a collision. No production caller allows anything in this phase. +- `micromate/writes.py` (new): pure functions that turn the unit's own reads into a `WritePlan`, i.e. the frames, in order, with expected acks. That plan is what each later write endpoint's `dry_run=true` returns. +- A bench tool, `bridges/mm_dry_run.py`, does the reads on a live unit and prints the plan, sending nothing else. It is step 1 of the spec's bench protocol for every first live write. + +**Tech Stack:** Python 3, pytest. `micromate/` codec + protocol (no `sfm` imports). + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`. The sections that apply are *The safety layer* (opcode guard), *Series-4 write path* (encoder, dry run, per-operation table, setup-push details), *Testing* (frame reproduction) and *Build phases* item 2. + +## Global Constraints + +- **Nothing but reads reaches a unit.** No task may construct `MicromateProtocol` / `MicromateClient` with a non-empty `allowed_writes` outside a test that uses a scripted transport. Task 5 (bench) sends reads only. +- **`0xA2` is never transmitted on Series 4.** The collision guard refuses it even when "allowed". Lifting that needs a spec change, not a parameter. +- **A call-home plan changes exactly bit 0 of content byte `[5]`.** Every other byte, including the unit-maintained `[118:120]`, is echoed from the read. Never write modem baud or modem type. +- **The setup-push read-modify-write sends back only what was read.** No field editing in this phase. Field encoding is phase 5. +- **Codec purity:** nothing in `micromate/` imports `sfm`. `micromate/` may import `minimateplus.transport` only, as today. +- **Never move, rename or delete `bridges/captures/`**, even temporarily: it holds irreplaceable research captures. Read it only. +- **Fixtures:** `tests/fixtures/` and `bridges/captures/` are gitignored. Fixtures cut from captures go in `tests/fixtures/micromate-writes/` and are **force-added** (`git add -f`). Tests that read `bridges/captures/` directly must `skipif` when it is absent. +- **The suite's 16 pre-existing failures** (test_bw_ascii_report.py 15, test_event_file_io.py 1; missing gitignored fixtures) stay exactly that set. +- **Branch `feat/series4-sfm-parity`.** + - Never commit to `main` or `dev`. + - Do not edit `CHANGELOG.md`. + - After each commit, run `git push`. +- **Hardware:** only Task 5 touches `/dev/ttyACM0` (UM20147), under `sg dialout -c "..."`. Never start a server on port 8200. +- **Every commit message ends with:** + ``` + Co-Authored-By: Claude Opus 5.5 + Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 + ``` + +## Review Focus + +These are the inputs most likely to bite, each with a test in the named task. + +1. **A write opcode reaching the wire by any path.** This includes `_exchange`, a direct `_send`, a scratch tool calling `protocol._send`, and a frame built by hand. It must be refused with nothing written to the transport (Task 2). +2. **`0xA2` in a plan or a send.** It is refused even when explicitly allowed (Tasks 2, 4). +3. **A read whose block fails its CRC, or has a size THOR's offset was never observed at.** Building a plan from it must be refused. Otherwise it would write corruption back, or use an unverified offset (Task 4). +4. **Escape bytes inside data**, including a literal `0x10` (never captured in write data) and a checksum that lands on `02/03/04/10`. The frame must still be correct (Task 1). +5. **The call-home plan must flip exactly one bit.** Every other byte must equal the read (Task 4). + +--- + +## File map + +| file | change | +|---|---| +| `micromate/framing.py` | `build_request(..., data=b"")`; new `request_sub(frame)` | +| `micromate/opcodes.py` | **new**: `WRITE_SUBS`, `CROSS_SERIES_COLLISIONS`, `OpcodeRefused`, `check_transmit()` | +| `micromate/protocol.py` | `MicromateProtocol(allowed_writes=frozenset())`; `_send` gate; docstring | +| `micromate/client.py` | docstring only ("reads only" now enforced) | +| `micromate/writes.py` | **new**: `WriteStep`, `WritePlan`, `plan_start_monitoring`, `plan_stop_monitoring`, `plan_call_home_enabled`, `plan_setup_push` | +| `scratch/mm_write_fixtures.py` | **new**: cuts fixtures out of the captures (reproducible provenance) | +| `tests/fixtures/micromate-writes/*.json` | **new, force-added**: seven captured sessions | +| `bridges/mm_dry_run.py` | **new**: live dry run, reads only | +| tests | `test_micromate_framing.py` (+), `test_micromate_opcodes.py` (new), `test_micromate_write_fixtures.py` (new), `test_micromate_writes.py` (new) | +| docs | `docs/micromate_protocol_reference.md`, `CLAUDE.md` (Task 5) | + +--- + +### Task 1: The encoder — a data section on `build_request` + +**Files:** +- Modify: `micromate/framing.py`, `build_request` (line 129) +- Test: `tests/test_micromate_framing.py` (append) + +**Interfaces:** +- Produces: + - `build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: bytes = b"") -> bytes`. The data goes after params, inside the stuffing and the checksum. + - `request_sub(frame: bytes) -> int`, the SUB of a built host→unit frame. It raises `ValueError` on anything that isn't one. + +- [ ] **Step 1: Write the failing tests.** Append to `tests/test_micromate_framing.py`: + +```python +# ── the data section (writes) ───────────────────────────────────────────────── + +from micromate.framing import request_sub, unstuff # noqa: E402 + + +def _destuffed_payload(frame: bytes) -> bytes: + body = unstuff(frame[2:-1]) + return body[:-1] # drop the checksum byte + + +def test_data_goes_after_the_params_inside_the_checksum(): + data = bytes(range(0x20, 0x40)) + f = build_request(0x7E, 0x007E, bytes(10), data) + payload = _destuffed_payload(f) + assert payload[:6] == bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + assert payload[6:16] == bytes(10) and payload[16:] == data + assert unstuff(f[2:-1])[-1] == sum(payload) & 0xFF + + +@pytest.mark.parametrize("b", [0x02, 0x03, 0x04, 0x10]) +def test_every_escape_byte_in_data_is_escaped_on_the_wire(b): + f = build_request(0x71, 0x082C, bytes(10), bytes([0x55, b, 0x55])) + assert bytes([0x55, DLE, b, 0x55]) in f + assert _destuffed_payload(f)[16:] == bytes([0x55, b, 0x55]) + + +def test_a_literal_0x10_in_data_round_trips(): + # Never captured in write data; params already prove `10 10` (SUB 0x5A). + data = b"\x10\x10\x00\x10" + assert _destuffed_payload(build_request(0x71, 0x082C, bytes(10), data))[16:] == data + + +def test_a_checksum_that_lands_on_an_escape_byte_is_escaped(): + # Pick the last data byte so SUM8 of the payload is exactly 0x03. + head = bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + bytes(10) + b"\x01\x02" + last = (0x03 - sum(head)) & 0xFF + f = build_request(0x7E, 0x007E, bytes(10), b"\x01\x02" + bytes([last])) + assert f[-3:] == bytes([DLE, 0x03, ETX]) + + +def test_without_data_the_frame_is_unchanged(): + assert build_request(0x5B, 0x0030) == build_request(0x5B, 0x0030, bytes(10), b"") + + +def test_request_sub_reads_the_sub_back_even_when_stuffed(): + assert request_sub(build_request(0x96, 0xFFFF)) == 0x96 + assert request_sub(build_request(0x10, 0x0000)) == 0x10 # SUB itself escaped + assert request_sub(build_request(0x71, 0x082C, bytes(10), b"\x03" * 5)) == 0x71 + + +@pytest.mark.parametrize("junk", [b"", b"\x41\x02\x03", b"\x02\x10\x10\x00\x96\x03", b"hello"]) +def test_request_sub_refuses_anything_that_is_not_a_request_frame(junk): + with pytest.raises(ValueError): + request_sub(junk) + + +@pytest.mark.skipif( + not _CAPTURES.is_dir(), + reason="capture directory is gitignored; present only on a dev box", +) +def test_builder_reproduces_every_captured_request_frame_including_writes(): + """251/251: the 218 reads plus the 33 data-carrying writes.""" + checked = 0 + for path in sorted(_CAPTURES.rglob("raw_bw_*.bin")): + blob = path.read_bytes() + i = 0 + while i < len(blob): + if not (blob[i] == ACK and i + 1 < len(blob) and blob[i + 1] == STX): + i += 1 + continue + j = i + 2 + body = bytearray() + while j < len(blob): + if blob[j] == DLE and j + 1 < len(blob): + body.append(blob[j + 1]) + j += 2 + continue + if blob[j] == ETX: + break + body.append(blob[j]) + j += 1 + payload = bytes(body[:-1]) + sub = payload[2] + offset = (payload[4] << 8) | payload[5] + assert build_request(sub, offset, payload[6:16], payload[16:]) == blob[i:j + 1], ( + f"{path.name} @0x{i:04x} SUB=0x{sub:02x}" + ) + checked += 1 + i = j + 1 + assert checked == 251, f"expected 251 request frames, checked {checked}" +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_framing.py -q` + Expected: FAIL with `ImportError: cannot import name 'request_sub'`. + +- [ ] **Step 3: Implement.** In `micromate/framing.py`: + - Change the signature to `def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: bytes = b"") -> bytes:`. + - Add to its docstring's Args: + +``` + data: the write section after params (empty for every read and for + write confirms). Escaped and checksummed exactly like the rest + of the payload -- reproduces all 33 data-carrying THOR frames. +``` + + - Change the `payload = ...` line to: + +```python + payload = (bytes([MM_CMD, 0x00, sub, 0x00, (offset >> 8) & 0xFF, offset & 0xFF]) + + params + bytes(data)) +``` + + - Add after `build_request`: + +```python +def request_sub(frame: bytes) -> int: + """The SUB of a built host->unit frame (`41 02 03`). + + Used by the protocol's send-side opcode gate, which must see exactly what is + about to go on the wire rather than trust the caller's word for it. + """ + if len(frame) < 5 or frame[0] != ACK or frame[1] != STX or frame[-1] != ETX: + raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}") + body = unstuff(frame[2:-1]) + if len(body) < 17 or body[0] != MM_CMD: + raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}") + return body[2] +``` + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_framing.py -q` + Expected: all pass, including both capture-gated tests on this box (218 and 251). + +- [ ] **Step 5: Commit and push.** Message: `feat(micromate): build_request carries a data section -- reproduces all 251 THOR request frames`. + +--- + +### Task 2: The opcode table and the send-side gate + +**Files:** +- Create: `micromate/opcodes.py` +- Modify: `micromate/protocol.py`: `MicromateProtocol.__init__` (line 241), `_send` (line 511) and the module docstring. Also `micromate/client.py`, docstring line 5. +- Test: `tests/test_micromate_opcodes.py` (new) + +**Interfaces:** +- Consumes: Task 1's `request_sub`. +- Produces: + - `WRITE_SUBS: dict[int, str]` + - `CROSS_SERIES_COLLISIONS: dict[int, str]` + - `class OpcodeRefused(RuntimeError)` + - `check_transmit(sub, allowed_writes=frozenset()) -> None` + - `MicromateProtocol(transport, recv_timeout=..., strict_checksums=True, allowed_writes: frozenset = frozenset())` + +- [ ] **Step 1: Write the failing tests** in `tests/test_micromate_opcodes.py`: + +```python +"""The send-side gate: no write opcode reaches the wire unless allowed, and 0xA2 never.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from micromate.framing import build_request # noqa: E402 +from micromate.opcodes import ( # noqa: E402 + CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused, check_transmit, +) +from test_micromate_protocol import frame, proto # noqa: E402 + +# THOR's captured end-call-home frame -- byte-identical to Series III's CONFIRM ERASE. +A2_WIRE = bytes.fromhex("4102101000a200ffff00000000000000000000b003") + + +def test_no_read_command_is_classed_as_a_write(): + reads = {v for k, v in vars(mm_proto).items() if k.startswith("SUB_")} + assert reads and not (reads & set(WRITE_SUBS)) + + +def test_0xa2_is_a_collision_and_a_write(): + assert 0xA2 in CROSS_SERIES_COLLISIONS and 0xA2 in WRITE_SUBS + + +def test_a_write_is_refused_unless_allowed(): + with pytest.raises(OpcodeRefused, match="0x96"): + check_transmit(0x96) + check_transmit(0x96, frozenset({0x96})) + check_transmit(0x5B) # a read needs no permission + + +def test_0xa2_is_refused_even_when_allowed(): + with pytest.raises(OpcodeRefused, match="ERASE"): + check_transmit(0xA2, frozenset({0xA2})) + + +def test_the_protocol_refuses_a_write_and_writes_nothing(): + p, t = proto([]) + with pytest.raises(OpcodeRefused): + p._exchange(0x96, offset=0xFFFF) + with pytest.raises(OpcodeRefused): + p._send(build_request(0x97, 0xFFFF)) # a direct _send is gated too + assert t.written == [] + + +def test_the_protocol_refuses_the_captured_0xa2_frame_byte_for_byte(): + p, t = proto([], allowed_writes=frozenset({0xA2})) + with pytest.raises(OpcodeRefused): + p._send(A2_WIRE) + assert t.written == [] + + +def test_an_explicitly_allowed_write_goes_out_on_a_scripted_transport(): + p, t = proto([frame(0x69, bytes(11))], allowed_writes=frozenset({0x96})) + p._exchange(0x96, offset=0xFFFF) + assert t.written == [build_request(0x96, 0xFFFF)] + + +def test_reads_are_unaffected_by_the_gate(): + p, t = proto([frame(0xA4, bytes(11))]) + p.poll() + assert len(t.written) == 1 + + +def test_a_frame_that_is_not_a_request_is_refused_not_sent(): + p, t = proto([]) + with pytest.raises(ValueError): + p._send(b"\x41\x03") + assert t.written == [] +``` + + Before running, check `tests/test_micromate_protocol.py`: + - Does `proto(responses, **kw)` forward `**kw` to `MicromateProtocol`? + - Is `frame(rsp_sub, data, ...)` the response builder? + - If either differs, adapt only the import lines and the call shape, and say so in the report. + + Also check what POLL's response SUB is: `0xFF - 0x5B = 0xA4`. + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_opcodes.py -q` + Expected: FAIL with `ModuleNotFoundError: No module named 'micromate.opcodes'`. + +- [ ] **Step 3: Implement.** Create `micromate/opcodes.py`: + +```python +"""Micromate (Series IV) opcode table: which SUBs write, and which collide. + +One place, as the parity spec requires. `MicromateProtocol._send` consults it +on every outgoing frame, so a write cannot reach a unit by a path nobody +thought about -- a scratch tool calling `protocol._send`, a hand-built frame, a +method added later. + +Every SUB here was seen as a host->unit request in THOR's captures +(`docs/micromate_protocol_reference.md`). The table classifies REQUESTS: a few +of these values are also ACK SUBs of other commands (0x71 acks 0x8E, 0x72 acks +0x8D), which is irrelevant to a send-side check. +""" +from __future__ import annotations + +from typing import Dict, FrozenSet + +WRITE_SUBS: Dict[int, str] = { + 0x47: "scheduler enable/disable", + 0x68: "setup push: preferences block (0x08)", + 0x71: "setup push: setup block (0x1A)", + 0x72: "setup push: setup confirm", + 0x73: "setup push: preferences confirm", + 0x7E: "call-home config write (0x2C)", + 0x7F: "call-home config confirm", + 0x82: "setup push: trigger block (0x2E)", + 0x83: "setup push: trigger confirm", + 0x8D: "file open for write", + 0x8E: "file body write", + 0x96: "start monitoring", + 0x97: "stop monitoring", + 0xA2: "end call-home", + 0xA8: "delete one event", + 0xAA: "delete-event confirm", + 0xDA: "setup push: file name", +} + +# Same bytes, opposite consequence on the other series. Never transmitted on +# Series IV, allowed or not: if a Series-III unit is at the address (a moved +# modem, a stale IP), it would execute the other meaning. Lifting an entry is +# a spec change, not a parameter. +CROSS_SERIES_COLLISIONS: Dict[int, str] = { + 0xA2: "CONFIRM ERASE on Series III -- erases every stored event; " + "'end call-home' on Series IV", +} + + +class OpcodeRefused(RuntimeError): + """A frame was stopped before it reached the wire.""" + + +def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> None: + if sub in CROSS_SERIES_COLLISIONS: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X}: {CROSS_SERIES_COLLISIONS[sub]}") + if sub in WRITE_SUBS and sub not in allowed_writes: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X} ({WRITE_SUBS[sub]}): writes are " + "not enabled on this connection") +``` + + In `micromate/protocol.py`: + - Imports: extend `from .framing import ...` with `request_sub`, and add `from .opcodes import check_transmit`. + - `__init__`: add the parameter `allowed_writes: frozenset = frozenset(),` after `strict_checksums`, and set `self._allowed_writes = frozenset(allowed_writes)` with the other assignments. Add to the docstring: + +``` + allowed_writes: write SUBs this connection may transmit. Empty by + default -- every write opcode in `micromate.opcodes` is refused + at `_send`, and `0xA2` is refused whatever this says. +``` + + - `_send`: + +```python + def _send(self, frame: bytes) -> None: + # The gate sees the bytes that are about to go out, not the caller's + # intent: every transmit in this package passes through here. + check_transmit(request_sub(frame), self._allowed_writes) + log.debug("TX %d bytes: %s", len(frame), frame.hex()) + self._transport.write(frame) +``` + + - Module docstring: replace the paragraph that begins `Scope: **reads only.**` up to `...not a side effect of a client that grew a method.` with: + +``` +Scope: **reads only on the wire, enforced.** Every outgoing frame passes +`micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused +unless this connection was constructed with it in `allowed_writes` (nothing in +the codebase does so yet), and `0xA2` -- CONFIRM ERASE on Series III -- is +refused always. No command has ever been originated against a unit by this +project; every write in ``docs/micromate_protocol_reference.md`` was performed +by THOR while we recorded. The first thing this codebase ever sends to a +customer's instrument should be a decision someone made on purpose, not a side +effect of a client that grew a method. Write frames are *built* in +``micromate.writes`` as reviewable plans; building one sends nothing. +``` + + In `micromate/client.py`, change the docstring line saying reads only, at line 5, to say reads only, enforced by the protocol's opcode gate (`micromate.opcodes`). + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_opcodes.py tests/test_micromate_protocol.py tests/test_micromate_client.py tests/test_micromate_events.py -q` + Expected: all pass, including the THOR replay tests on this box. If a replay test now raises `OpcodeRefused`, it was transmitting a captured write through the protocol. STOP and report it; do not allow writes to make it pass. + +- [ ] **Step 5: Full suite.** Run `.venv/bin/python -m pytest -q 2>&1 | tail -3`. Only the 16 pre-existing failures are allowed. + +- [ ] **Step 6: Commit and push.** Message: `feat(micromate): one opcode table and a send-side gate -- writes refused unless allowed, 0xA2 always`. + +--- + +### Task 3: Fixtures cut from THOR's write captures + +**Files:** +- Create: `scratch/mm_write_fixtures.py` +- Create, force-added: `tests/fixtures/micromate-writes/*.json` +- Test: `tests/test_micromate_write_fixtures.py` (new) + +**Interfaces:** +- Produces: one JSON file per captured session, in this schema: + +```json +{ + "source": "bridges/captures/9-24-26 - micromate2/", + "source_sha256": {"bw": "", "s3": ""}, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + {"sub": 65, "request": "", "response_sub": 190, "response_data": ""} + ] +} +``` + + The sessions and their slugs: + +| slug | capture (under `bridges/captures/9-24-26 - micromate2/`) | +|---|---| +| `setup-push-new-test1` | `raw_{bw,s3}_20260924_181942_send_TEST1_to_unit.bin` | +| `setup-push-overwrite-test1` | `overwritetest/raw_{bw,s3}_20260924_185113_test1_overwrite_check.bin` | +| `setup-push-read-scheduler` | `raw_{bw,s3}_20260924_191835_read_scheduler.bin` | +| `setup-push-pull-schedule` | `raw_{bw,s3}_20260925_003029_pull_schedule,_turn_off_repeat_daily,_push_schedule.bin` | +| `setup-push-multiday` | `raw_{bw,s3}_20260925_011907_send_multiday_schedule.bin` | +| `call-home-enable-disable` | `raw_{bw,s3}_20260925_011620_ACH-change_1_setting.bin` | +| `monitor-start-stop` | `raw_{bw,s3}_20260924_191214_turn_on_monitormode_then_attempt_to_write_config.bin` | + +- [ ] **Step 1: Write the extraction script** `scratch/mm_write_fixtures.py`: + +```python +#!/usr/bin/env python3 +"""Cut Micromate write-session fixtures out of THOR's captures. + +bridges/captures/ is gitignored, so the reproduction tests read these instead. +Each fixture is every request (as wire bytes) and every response (as its data +section) of one captured THOR session, paired in order, with the sha256 of the +capture files it came from. Re-run to regenerate: + + .venv/bin/python scratch/mm_write_fixtures.py +""" +from __future__ import annotations + +import hashlib +import json +import sys +from pathlib import Path + +REPO = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(REPO)) + +from micromate.framing import ACK, DLE, ETX, STX, MicromateFrameParser # noqa: E402 + +CAP = REPO / "bridges" / "captures" / "9-24-26 - micromate2" +OUT = REPO / "tests" / "fixtures" / "micromate-writes" +SESSIONS = { + "setup-push-new-test1": "20260924_181942_send_TEST1_to_unit", + "setup-push-overwrite-test1": "overwritetest/*20260924_185113_test1_overwrite_check", + "setup-push-read-scheduler": "20260924_191835_read_scheduler", + "setup-push-pull-schedule": "20260925_003029_pull_schedule,_turn_off_repeat_daily,_push_schedule", + "setup-push-multiday": "20260925_011907_send_multiday_schedule", + "call-home-enable-disable": "20260925_011620_ACH-change_1_setting", + "monitor-start-stop": "20260924_191214_turn_on_monitormode_then_attempt_to_write_config", +} + + +def _find(stem: str, kind: str) -> Path: + if "/" in stem: + sub, rest = stem.split("/", 1) + hits = sorted((CAP / sub).glob(f"raw_{kind}_{rest.lstrip('*')}.bin")) + else: + hits = sorted(CAP.glob(f"raw_{kind}_{stem}.bin")) + if len(hits) != 1: + raise SystemExit(f"expected one raw_{kind} file for {stem!r}, found {hits}") + return hits[0] + + +def requests(blob: bytes) -> list[bytes]: + out, i = [], 0 + while i < len(blob): + if not (blob[i] == ACK and i + 1 < len(blob) and blob[i + 1] == STX): + i += 1 + continue + j = i + 2 + while j < len(blob): + if blob[j] == DLE and j + 1 < len(blob): + j += 2 + continue + if blob[j] == ETX: + break + j += 1 + out.append(blob[i:j + 1]) + i = j + 1 + return out + + +def main() -> None: + OUT.mkdir(parents=True, exist_ok=True) + for slug, stem in SESSIONS.items(): + bw, s3 = _find(stem, "bw"), _find(stem, "s3") + reqs = requests(bw.read_bytes()) + parser = MicromateFrameParser() + rsps = parser.feed(s3.read_bytes()) + if len(reqs) != len(rsps): + raise SystemExit(f"{slug}: {len(reqs)} requests vs {len(rsps)} responses") + exchanges = [] + for rq, rp in zip(reqs, rsps): + from micromate.framing import request_sub + sub = request_sub(rq) + if rp.sub != 0xFF - sub or not rp.checksum_valid: + raise SystemExit(f"{slug}: response 0x{rp.sub:02X} does not answer 0x{sub:02X}") + exchanges.append({"sub": sub, "request": rq.hex(), "response_sub": rp.sub, + "response_data": rp.data.hex()}) + doc = { + "source": str(bw.relative_to(REPO)), + "source_sha256": {"bw": hashlib.sha256(bw.read_bytes()).hexdigest(), + "s3": hashlib.sha256(s3.read_bytes()).hexdigest()}, + "unit": "UM12947", "firmware_line": "11.0CB", + "exchanges": exchanges, + } + (OUT / f"{slug}.json").write_text(json.dumps(doc, indent=1) + "\n") + print(f"{slug}: {len(exchanges)} exchanges") + + +if __name__ == "__main__": + main() +``` + + Check two things before running: + - `MicromateFrameParser().feed()` returns a list of `MicromateFrame` with `.sub`, `.data` and `.checksum_valid` (micromate/framing.py). + - Responses index-align with requests. The survey measured equal counts in every pair; the script refuses otherwise. + + Move the `request_sub` import to the top imports. It is shown inline above only for clarity. + +- [ ] **Step 2: Run it.** `.venv/bin/python scratch/mm_write_fixtures.py`. Expect 7 lines, one per slug. Check the count for each kind of session: + - **setup push:** 12 to 25 exchanges; + - **call-home:** 14; + - **start/stop:** about 40. + + If any session fails alignment, STOP and report it. + +- [ ] **Step 3: Write the tests** in `tests/test_micromate_write_fixtures.py`: + +```python +"""The write-session fixtures are what they claim to be: THOR's own frames, paired.""" +from __future__ import annotations + +import json +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.framing import request_sub, unstuff # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "micromate-writes" +ALL = sorted(FIX.glob("*.json")) + + +def test_all_seven_sessions_are_present(): + assert {p.stem for p in ALL} == { + "setup-push-new-test1", "setup-push-overwrite-test1", "setup-push-read-scheduler", + "setup-push-pull-schedule", "setup-push-multiday", "call-home-enable-disable", + "monitor-start-stop"} + + +@pytest.mark.parametrize("path", ALL, ids=lambda p: p.stem) +def test_every_request_is_a_valid_frame_and_every_response_answers_it(path): + doc = json.loads(path.read_text()) + assert doc["source_sha256"]["bw"] and doc["exchanges"] + for ex in doc["exchanges"]: + wire = bytes.fromhex(ex["request"]) + assert request_sub(wire) == ex["sub"] + body = unstuff(wire[2:-1]) + assert body[-1] == sum(body[:-1]) & 0xFF # plain SUM8 + assert ex["response_sub"] == 0xFF - ex["sub"] + + +@pytest.mark.parametrize("slug,subs", [ + ("setup-push-new-test1", [0x41, 0x08, 0x2E, 0x1A, 0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72]), + ("call-home-enable-disable", [0x2C, 0x7E, 0x7F]), + ("monitor-start-stop", [0x96, 0x97]), +]) +def test_each_session_holds_the_frames_its_tests_need(slug, subs): + seen = [ex["sub"] for ex in json.loads((FIX / f"{slug}.json").read_text())["exchanges"]] + for s in subs: + assert s in seen, f"{slug}: no SUB 0x{s:02X}" +``` + +- [ ] **Step 4: Run the tests and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_write_fixtures.py -q`. + To show the fixtures stand alone, check that neither the fixture tests nor Task 4's tests reference the capture directory: + `grep -n "captures" tests/test_micromate_write_fixtures.py` must print nothing. + ⚠ **Never move, rename or delete `bridges/captures/`**, not even temporarily. It holds irreplaceable research captures. + +- [ ] **Step 5: Commit and push.** Use `git add -f tests/fixtures/micromate-writes/*.json` and `git add scratch/mm_write_fixtures.py tests/test_micromate_write_fixtures.py`. Message: `test(micromate): THOR's write sessions as fixtures -- seven captures, paired, with provenance`. + +--- + +### Task 4: Write plans, reproduced byte for byte + +**Files:** +- Create: `micromate/writes.py` +- Test: `tests/test_micromate_writes.py` (new) + +**Interfaces:** +- Consumes: + - Task 1's `build_request(data=)`; + - Task 2's `WRITE_SUBS`, `CROSS_SERIES_COLLISIONS` and `OpcodeRefused`; + - `micromate.setup_block.crc_ok`; + - Task 3's fixtures. +- Produces: + - `WriteStep(sub, offset, data=b"", params=bytes(10), what="")` with `.ack_sub`, `.frame` and `.describe()`; + - `WritePlan(action, steps)` with `.subs`, `.frames()` and `.describe()`; + - `plan_start_monitoring()`, `plan_stop_monitoring()`; + - `plan_call_home_enabled(call_home: bytes, enabled: bool)`; + - `plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str)`. + + All inputs are block **content**: response data `[11:]`. + +- [ ] **Step 1: Write the failing tests** in `tests/test_micromate_writes.py`: + +```python +"""Write plans: built from the unit's own reads, equal to THOR's frames byte for byte.""" +from __future__ import annotations + +import json +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.opcodes import OpcodeRefused # noqa: E402 +from micromate.writes import ( # noqa: E402 + WritePlan, WriteStep, plan_call_home_enabled, plan_setup_push, + plan_start_monitoring, plan_stop_monitoring, +) + +FIX = Path(__file__).parent / "fixtures" / "micromate-writes" +PUSHES = ["setup-push-new-test1", "setup-push-overwrite-test1", "setup-push-read-scheduler", + "setup-push-pull-schedule", "setup-push-multiday"] +NO_EDIT_PUSHES = ["setup-push-read-scheduler", "setup-push-pull-schedule", "setup-push-multiday"] + + +def _session(slug): + return json.loads((FIX / f"{slug}.json").read_text())["exchanges"] + + +def _content(ex): + return bytes.fromhex(ex["response_data"])[11:] + + +def _first_push(slug): + """The reads (by SUB) and THOR's writes (by SUB) of the session's first push.""" + ex = _session(slug) + start = next(i for i, e in enumerate(ex) if e["sub"] == 0xDA) + reads = {} + for e in ex[:start]: + reads[e["sub"]] = _content(e) # the LAST read of each SUB before the push + writes = {} + for e in ex[start:]: + if e["sub"] in writes: + break + writes[e["sub"]] = bytes.fromhex(e["request"]) + if e["sub"] == 0x72: + break + return reads, writes + + +def _name_from_active(content): + # Mirror how MicromateClient.get_active_setup() extracts the name from the + # 0x41 content -- check it and copy its slicing if the name does not start + # at content[0]. + return content.split(b"\x00", 1)[0].decode("ascii") + + +# ── start / stop ────────────────────────────────────────────────────────────── + +def test_start_and_stop_equal_thors_frames(): + thor = {e["sub"]: bytes.fromhex(e["request"]) for e in _session("monitor-start-stop") + if e["sub"] in (0x96, 0x97)} + assert plan_start_monitoring().frames() == [thor[0x96]] + assert plan_stop_monitoring().frames() == [thor[0x97]] + assert thor[0x96].hex() == "41021010009600ffff00000000000000000000a403" + + +# ── call-home ───────────────────────────────────────────────────────────────── + +def test_call_home_enable_then_disable_equal_thors_frames(): + ex = _session("call-home-enable-disable") + pairs, last_read = [], None + for e in ex: + if e["sub"] == 0x2C: + last_read = _content(e) + elif e["sub"] == 0x7E: + pairs.append((last_read, bytes.fromhex(e["request"]))) + confirms = [bytes.fromhex(e["request"]) for e in ex if e["sub"] == 0x7F] + assert len(pairs) == 2 and len(confirms) == 2 + (r1, w1), (r2, w2) = pairs + on, off = plan_call_home_enabled(r1, True), plan_call_home_enabled(r2, False) + assert on.frames() == [w1, confirms[0]] + assert off.frames() == [w2, confirms[1]] + + +def test_call_home_flips_exactly_one_bit_and_echoes_everything_else(): + r1 = next(_content(e) for e in _session("call-home-enable-disable") if e["sub"] == 0x2C) + for enabled in (True, False): + data = plan_call_home_enabled(r1, enabled).steps[0].data + diff = [i for i in range(len(r1)) if data[i] != r1[i]] + assert set(diff) <= {5} + assert data[5] & 0x01 == (1 if enabled else 0) + assert data[5] & 0xFE == r1[5] & 0xFE + assert data[118:120] == r1[118:120] + + +def test_call_home_refuses_an_unobserved_size(): + with pytest.raises(ValueError, match="126"): + plan_call_home_enabled(bytes(125), True) + + +# ── setup push ──────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize("slug", PUSHES) +def test_setup_push_name_prefs_trigger_and_confirms_equal_thors_frames(slug): + reads, thor = _first_push(slug) + name = ("TEST1.mmb" if slug == "setup-push-new-test1" + else _name_from_active(reads[0x41])) + plan = plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], name) + ours = {s.sub: s.frame for s in plan.steps} + for sub in (0xDA, 0x68, 0x73, 0x82, 0x83, 0x72): + assert ours[sub] == thor[sub], f"{slug}: SUB 0x{sub:02X}" + assert [s.sub for s in plan.steps] == [0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72] + + +@pytest.mark.parametrize("slug", NO_EDIT_PUSHES) +def test_a_no_edit_push_reproduces_thors_setup_block_frame(slug): + reads, thor = _first_push(slug) + plan = plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], _name_from_active(reads[0x41])) + assert next(s.frame for s in plan.steps if s.sub == 0x71) == thor[0x71] + + +def test_setup_push_refuses_a_read_that_fails_its_checksum(): + reads, _ = _first_push("setup-push-multiday") + bad = bytearray(reads[0x1A]) + bad[100] ^= 0xFF + with pytest.raises(ValueError, match="checksum"): + plan_setup_push(reads[0x08], reads[0x2E], bytes(bad), "x.mmb") + + +@pytest.mark.parametrize("which", ["prefs", "trigger", "setup"]) +def test_setup_push_refuses_an_unobserved_block_size(which): + reads, _ = _first_push("setup-push-multiday") + args = {"prefs": reads[0x08], "trigger": reads[0x2E], "setup": reads[0x1A]} + args[which] = args[which] + b"\x00\x00" + with pytest.raises(ValueError, match="size"): + plan_setup_push(args["prefs"], args["trigger"], args["setup"], "x.mmb") + + +@pytest.mark.parametrize("name", ["", "a\x00b", "é.mmb", "x" * 256]) +def test_setup_push_refuses_a_bad_name(name): + reads, _ = _first_push("setup-push-multiday") + with pytest.raises(ValueError): + plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], name) + + +# ── the plan object ─────────────────────────────────────────────────────────── + +def test_a_plan_cannot_hold_a_collision_opcode(): + with pytest.raises(OpcodeRefused): + WritePlan("end call-home", (WriteStep(0xA2, 0xFFFF),)) + + +def test_a_plan_cannot_hold_a_read(): + with pytest.raises(ValueError): + WritePlan("poll", (WriteStep(0x5B, 0x0030),)) + + +def test_describe_is_the_dry_run_shape(): + d = plan_stop_monitoring().describe() + assert d["action"] == "stop monitoring" and d["sends_nothing"] is True + step = d["steps"][0] + assert step == {"sub": "0x97", "what": "stop monitoring", "offset": "0xFFFF", + "data_len": 0, "expect_ack": "0x68", + "frame": "41021010009700ffff00000000000000000000a503"} +``` + +- [ ] **Step 2: Run them, and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_writes.py -q` + Expected: FAIL with `ModuleNotFoundError: No module named 'micromate.writes'`. + +- [ ] **Step 3: Implement** `micromate/writes.py`: + +```python +"""Write plans for a Micromate: the exact frames a write would send, in order. + +A plan is what a dry run returns. Building one sends nothing; transmitting it +also needs a protocol constructed with those SUBs in `allowed_writes`, which no +code does yet (see `micromate.opcodes`). + +Every input is the unit's OWN read of the block being written (content, i.e. +response data[11:]), and every plan sends back exactly what was read except +the one thing the operation changes. THOR works the same way, and the +reproduction tests hold the plans to THOR's frames byte for byte. + +Offsets are THOR's observed constants. 🔶 Each was seen at one block size +only, so a plan refuses a block of any other size rather than guess. +""" +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import FrozenSet, List, Tuple + +from .framing import build_request +from .opcodes import CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused +from .setup_block import crc_ok + +_CONFIRM = 0xFFFF + +# block content sizes THOR's offsets were observed at (all on UM12947 / 11.0CB) +_PREFS_LEN, _TRIGGER_LEN, _SETUP_LEN, _CALL_HOME_LEN = 90, 28, 2092, 126 +_NAME_FIELD = 256 + + +@dataclass(frozen=True) +class WriteStep: + sub: int + offset: int + data: bytes = b"" + params: bytes = field(default=bytes(10)) + what: str = "" + + @property + def ack_sub(self) -> int: + return 0xFF - self.sub + + @property + def frame(self) -> bytes: + return build_request(self.sub, self.offset, self.params, self.data) + + def describe(self) -> dict: + return {"sub": f"0x{self.sub:02X}", "what": self.what, + "offset": f"0x{self.offset:04X}", "data_len": len(self.data), + "expect_ack": f"0x{self.ack_sub:02X}", "frame": self.frame.hex()} + + +@dataclass(frozen=True) +class WritePlan: + action: str + steps: Tuple[WriteStep, ...] + + def __post_init__(self) -> None: + for s in self.steps: + if s.sub in CROSS_SERIES_COLLISIONS: + raise OpcodeRefused( + f"a plan cannot hold SUB 0x{s.sub:02X}: {CROSS_SERIES_COLLISIONS[s.sub]}") + if s.sub not in WRITE_SUBS: + raise ValueError(f"SUB 0x{s.sub:02X} is not a write opcode") + + @property + def subs(self) -> FrozenSet[int]: + return frozenset(s.sub for s in self.steps) + + def frames(self) -> List[bytes]: + return [s.frame for s in self.steps] + + def describe(self) -> dict: + return {"action": self.action, "sends_nothing": True, + "steps": [s.describe() for s in self.steps]} + + +def plan_start_monitoring() -> WritePlan: + return WritePlan("start monitoring", (WriteStep(0x96, _CONFIRM, what="start monitoring"),)) + + +def plan_stop_monitoring() -> WritePlan: + return WritePlan("stop monitoring", (WriteStep(0x97, _CONFIRM, what="stop monitoring"),)) + + +def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: + """Read `0x2C`, flip bit 0 of content[5], send the rest back byte for byte. + + `[5]` reads 0x05 enabled / 0x04 disabled; bit 2 is set in both, so only + bit 0 is the enable. `[118:120]` is unit-maintained and THOR echoes it. + """ + if len(call_home) != _CALL_HOME_LEN: + raise ValueError(f"call-home content must be {_CALL_HOME_LEN} B " + f"(the size THOR's offset was seen at), got {len(call_home)}") + b5 = (call_home[5] | 0x01) if enabled else (call_home[5] & 0xFE) + data = call_home[:5] + bytes([b5]) + call_home[6:] + what = "call-home " + ("enable" if enabled else "disable") + return WritePlan(what, ( + WriteStep(0x7E, 0x007E, data, what="call-home config write"), + WriteStep(0x7F, _CONFIRM, what="call-home config confirm"), + )) + + +def _checked(block: bytes, size: int, label: str) -> bytes: + if len(block) != size: + raise ValueError(f"{label} block size {len(block)} B is not the {size} B " + "THOR's offset was observed at -- refusing to guess") + if not crc_ok(block): + raise ValueError(f"{label} block failed its checksum -- refusing to write a " + "corrupt read back to the unit") + return block + + +def plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str) -> WritePlan: + """Rewrite a setup as THOR does: read 0x08, 0x2E, 0x1A, send each back. + + No field editing here (phase 5). Each block goes back with its length echo + [0:3] zeroed; the unit recomputes the CRCs, so 0x68 and 0x71 drop the CRC + slot and 0x82 sends it zeroed -- exactly THOR's frames. + """ + _checked(prefs, _PREFS_LEN, "preferences (0x08)") + _checked(trigger, _TRIGGER_LEN, "trigger (0x2E)") + _checked(setup, _SETUP_LEN, "setup (0x1A)") + try: + raw = name.encode("ascii") + except UnicodeEncodeError: + raise ValueError(f"setup name must be ASCII: {name!r}") from None + if not raw or b"\x00" in raw or len(raw) >= _NAME_FIELD: + raise ValueError(f"setup name must be 1-{_NAME_FIELD - 1} ASCII bytes " + f"with no NUL: {name!r}") + return WritePlan(f"setup push: {name}", ( + WriteStep(0xDA, 0x0100, raw.ljust(_NAME_FIELD, b"\x00"), what="setup file name"), + WriteStep(0x68, 0x005A, bytes(3) + prefs[3:88], what="preferences block"), + WriteStep(0x73, _CONFIRM, what="preferences confirm"), + WriteStep(0x82, 0x001C, bytes(3) + trigger[3:26] + bytes(2), what="trigger block"), + WriteStep(0x83, _CONFIRM, what="trigger confirm"), + WriteStep(0x71, 0x082C, bytes(3) + setup[3:2090], what="setup block"), + WriteStep(0x72, _CONFIRM, what="setup confirm"), + )) +``` + + If a reproduction assertion fails, do NOT adjust the builder to match one capture. Report the exact byte difference. The builder rules come from the survey's measured diffs (`0x68` = `0x08` content[0:88] with [0:3] zeroed; `0x82` = `0x2E` content[0:28] with [0:3] and [26:28] zeroed; `0x71` = `0x1A` content[0:2090] with [0:3] zeroed; `0xDA` = the name, null-padded to 256). A mismatch means a rule is wrong, and that is a finding. + +- [ ] **Step 4: Run the tests, and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_writes.py -q` + Expected: all pass. + +- [ ] **Step 5: Run the full suite.** Only the 16 pre-existing failures are allowed. + +- [ ] **Step 6: Commit and push.** Message: `feat(micromate): write plans for start/stop, call-home and setup push -- THOR's frames byte for byte`. + +--- + +### Task 5: The dry-run bench tool, run on UM20147 + +**Files:** +- Create: `bridges/mm_dry_run.py` +- Modify: `docs/micromate_protocol_reference.md`, `CLAUDE.md` + +Read-only on the unit. UM20147 is on `/dev/ttyACM0`, which needs `sg dialout -c "..."`. + +- [ ] **Step 1: Write the tool** `bridges/mm_dry_run.py`: + +```python +#!/usr/bin/env python3 +"""Dry run a Micromate write against a live unit: do the reads, print the plan. + +Sends READS only. The write frames are built from the unit's own blocks and +printed for review -- step 1 of the bench protocol for every first live write +(parity spec, Testing). The protocol's opcode gate refuses every write SUB on +this connection, so nothing else can go out even by mistake. + + sg dialout -c ".venv/bin/python bridges/mm_dry_run.py /dev/ttyACM0 call-home-off" + .venv/bin/python bridges/mm_dry_run.py --host 10.0.0.5 --tcp-port 9034 setup-rewrite +""" +from __future__ import annotations + +import argparse +import json +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +from micromate.client import MicromateClient # noqa: E402 +from micromate.writes import ( # noqa: E402 + plan_call_home_enabled, plan_setup_push, plan_start_monitoring, plan_stop_monitoring, +) +from minimateplus.transport import SerialTransport, TcpTransport # noqa: E402 + +ACTIONS = ("start", "stop", "call-home-on", "call-home-off", "setup-rewrite") + + +def _content(data: bytes) -> bytes: + return bytes(data)[11:] + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("port", nargs="?", help="serial port, e.g. /dev/ttyACM0") + ap.add_argument("action", choices=ACTIONS) + ap.add_argument("--host") + ap.add_argument("--tcp-port", type=int, default=9034) + ap.add_argument("--baud", type=int, default=115200) + a = ap.parse_args() + if not (a.port or a.host): + ap.error("give a serial port or --host") + transport = TcpTransport(a.host, port=a.tcp_port) if a.host else SerialTransport(a.port, a.baud) + mm = MicromateClient(transport) + mm.open() + try: + info = mm.connect() + p = mm.protocol + if a.action == "start": + plan = plan_start_monitoring() + elif a.action == "stop": + plan = plan_stop_monitoring() + elif a.action.startswith("call-home"): + plan = plan_call_home_enabled(_content(p.read_call_home_config()), + a.action == "call-home-on") + else: + name = mm.get_active_setup() + plan = plan_setup_push(_content(p.read_event_index()), _content(p.read_trigger_config()), + _content(p.read_compliance_config()), name) + out = plan.describe() + out["unit"] = {"serial": info.serial, "firmware_line": info.firmware_line} + print(json.dumps(out, indent=1)) + finally: + mm.close() + return 0 + + +if __name__ == "__main__": + sys.exit(main()) +``` + + Before running, check the real names and return types of these: + - `MicromateProtocol.read_call_home_config`, `read_event_index` (the `0x08` preferences block), `read_trigger_config` and `read_compliance_config`. Do they return the response data or a frame? + - `MicromateClient.get_active_setup()`. Does it return the file name string, e.g. `"test2.MMB"`? + + Adapt `_content()` and the calls to the real API. Mention any adaptation in the report. + +- [ ] **Step 2: Run it on UM20147, one action at a time.** Run each as its own command, under `sg dialout`: + - `start` + - `stop` + - `call-home-on` + - `call-home-off` + - `setup-rewrite` + + Save each output to `/dryrun/.json`. The scratchpad is `/tmp/claude-1000/-home-serversdown-seismo-relay/fc1049ca-ccbd-41ba-ac35-6b7c3996ffcd/scratchpad`. + + Expected for every action: + - JSON with `sends_nothing: true` and the planned frames. + - No `OpcodeRefused` traceback. The tool only calls reads; a traceback would mean a write was attempted, which is a bug to report. + + If a setup or call-home block is not the observed size on this unit's firmware (11.0BD), the plan is refused with a size error. Record that. It is a finding: THOR's offsets would then be unverified on this firmware. Do not change the size table. + +- [ ] **Step 3: Compare with THOR's frames** (UM12947, 11.0CB, from the fixtures). For each action, tabulate SUB order, offsets and data lengths, ours against THOR's. They should match exactly; only data content differs, since it is the unit's own blocks. + - Also confirm the `setup-rewrite` plan's `0x71` data equals the unit's `0x1A` content [3:2090] with three zero bytes in front. That is a no-edit rewrite. + - For `call-home-off` / `call-home-on`, also confirm exactly one byte ([5]) differs between the two plans' `0x7E` data. + +- [ ] **Step 4: Record.** + - In `docs/micromate_protocol_reference.md`, near the setup-push and call-home write sections, add a **dated, graded** line: "2026-10-22 — UM20147 (11.0BD) block sizes equal UM12947's (11.0CB): …; so THOR's write offsets apply to both firmware lines **as far as size goes** (measured, one unit each; nothing sent)". Use whatever was actually measured. + - In `CLAUDE.md`, add a sentence in the Series-4 "Where things stand" area: + - Phase 2 is done: the write encoder, the opcode gate and write plans. + - It covers start/stop, call-home and the setup rewrite, reproduced byte for byte against THOR (counts). + - `bridges/mm_dry_run.py` prints a write's planned frames from a live unit's reads. + - The protocol's `_send` gate refuses every write opcode unless explicitly allowed, and `0xA2` always. + - "**No command has ever been originated against a unit by this project**" is still true, and is now enforced in code. + +- [ ] **Step 5: Commit and push** the tool and both docs. Message: `feat(bridges): mm_dry_run -- a write's planned frames from a live unit's reads; bench-checked on UM20147`. + +--- + +## Self-review notes + +- **Spec coverage:** + - Encoder: Task 1. + - Opcode guard (one table; `0xA2`): Task 2. + - Dry run: Task 4 (`WritePlan.describe()`) and Task 5 (live). The write endpoints' `dry_run=true` parameter arrives with each write in phases 3–5 and returns `describe()`. + - Frame reproduction for `0x96`/`0x97`, `0x7E`/`0x7F` and the full setup push: Tasks 1, 3 and 4. The `0x71` edit pushes reproduce everything but `0x71`, because field editing is phase 5. + - Fixtures force-added: Task 3. +- **Not in phase 2:** + - Any transmit of a write. + - The identity check, audit table and read-back framework (phase 3). + - Field encoding (phase 5). + - Per-event delete. It is destructive tier; its SUBs are in the opcode table only. + - Scheduler `0x47` and file `0x8D`/`0x8E` (table only). +- **Never captured, and so only synthetic:** + - A checksum on an escape byte. + - A literal `0x10` in data. + - Start or stop when the unit is already in that state. + - Any write on 11.0BD. diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index a5e4dfe..e7cea2c 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -380,6 +380,14 @@ Each safety piece arrives with its first real use, so nothing sits untested. session through every retry, and the call never reaches THOR. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. + (2026-10-22) "Dry run" in this phase means the **write plan**: the exact + frames, in order, with their expected acks, built from the unit's own reads + (`micromate.writes`), plus a bench tool that prints one from a live unit's + reads (`bridges/mm_dry_run.py`). Each write endpoint's `dry_run=true` + arrives with that write in phases 3-5 and returns the plan. The opcode + guard is a **send-side gate** in `MicromateProtocol._send`: every write SUB + is refused unless the connection was built with it allowed (none is, in + this phase), and `0xA2` is refused always. 3. **Start/stop monitoring** (row 7): the first live write, at the bench. Brings the identity check, the audit table and the read-back framework. 4. **Call-home enable/disable** (row 9). -- 2.54.1 From 151ba1546fb672b8adf1d14853640fda8ac96e62 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:07:38 -0400 Subject: [PATCH 052/223] feat(micromate): build_request carries a data section -- reproduces all 251 THOR request frames Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/framing.py | 22 +++++++- tests/test_micromate_framing.py | 91 +++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/micromate/framing.py b/micromate/framing.py index abf16a6..b935fac 100644 --- a/micromate/framing.py +++ b/micromate/framing.py @@ -126,7 +126,7 @@ def checksum(payload: bytes) -> int: # ── Request builder ─────────────────────────────────────────────────────────── -def build_request(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes: +def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: bytes = b"") -> bytes: """Build a host→unit command frame. ⚠ Do **not** substitute `minimateplus.framing.build_bw_frame()` here, even @@ -150,6 +150,9 @@ def build_request(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes Thor asks for `0xFFFF` and gets the whole block — so this is usually `0xFFFF`, not Series III's probe-then-data pair. params: exactly 10 bytes at payload[6:16]. + data: the write section after params (empty for every read and for + write confirms). Escaped and checksummed exactly like the rest + of the payload -- reproduces all 33 data-carrying THOR frames. A `0x10` inside `params` is fine and needs no special handling: Thor sends `SUB 0x5A` with `params = 00 00 10 00 …` and the wire carries `10 10`. @@ -162,11 +165,26 @@ def build_request(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes if not 0 <= sub <= 0xFF: raise ValueError(f"sub must be a single byte, got {sub:#x}") - payload = bytes([MM_CMD, 0x00, sub, 0x00, (offset >> 8) & 0xFF, offset & 0xFF]) + params + payload = (bytes([MM_CMD, 0x00, sub, 0x00, (offset >> 8) & 0xFF, offset & 0xFF]) + + params + bytes(data)) body = payload + bytes([checksum(payload)]) return bytes([ACK, STX]) + stuff(body) + bytes([ETX]) +def request_sub(frame: bytes) -> int: + """The SUB of a built host->unit frame (`41 02 03`). + + Used by the protocol's send-side opcode gate, which must see exactly what is + about to go on the wire rather than trust the caller's word for it. + """ + if len(frame) < 5 or frame[0] != ACK or frame[1] != STX or frame[-1] != ETX: + raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}") + body = unstuff(frame[2:-1]) + if len(body) < 17 or body[0] != MM_CMD: + raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}") + return body[2] + + # ── Response frame ──────────────────────────────────────────────────────────── @dataclass diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 3392154..50d5f2c 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -411,3 +411,94 @@ def test_builder_reproduces_every_captured_read_frame(): checked += 1 i = j + 1 assert checked == 218, f"expected 218 read frames, checked {checked}" + +# ── the data section (writes) ───────────────────────────────────────────────── + +from micromate.framing import request_sub, unstuff # noqa: E402 + + +def _destuffed_payload(frame: bytes) -> bytes: + body = unstuff(frame[2:-1]) + return body[:-1] # drop the checksum byte + + +def test_data_goes_after_the_params_inside_the_checksum(): + data = bytes(range(0x20, 0x40)) + f = build_request(0x7E, 0x007E, bytes(10), data) + payload = _destuffed_payload(f) + assert payload[:6] == bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + assert payload[6:16] == bytes(10) and payload[16:] == data + assert unstuff(f[2:-1])[-1] == sum(payload) & 0xFF + + +@pytest.mark.parametrize("b", [0x02, 0x03, 0x04, 0x10]) +def test_every_escape_byte_in_data_is_escaped_on_the_wire(b): + f = build_request(0x71, 0x082C, bytes(10), bytes([0x55, b, 0x55])) + assert bytes([0x55, DLE, b, 0x55]) in f + assert _destuffed_payload(f)[16:] == bytes([0x55, b, 0x55]) + + +def test_a_literal_0x10_in_data_round_trips(): + # Never captured in write data; params already prove `10 10` (SUB 0x5A). + data = b"\x10\x10\x00\x10" + assert _destuffed_payload(build_request(0x71, 0x082C, bytes(10), data))[16:] == data + + +def test_a_checksum_that_lands_on_an_escape_byte_is_escaped(): + # Pick the last data byte so SUM8 of the payload is exactly 0x03. + head = bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + bytes(10) + b"\x01\x02" + last = (0x03 - sum(head)) & 0xFF + f = build_request(0x7E, 0x007E, bytes(10), b"\x01\x02" + bytes([last])) + assert f[-3:] == bytes([DLE, 0x03, ETX]) + + +def test_without_data_the_frame_is_unchanged(): + assert build_request(0x5B, 0x0030) == build_request(0x5B, 0x0030, bytes(10), b"") + + +def test_request_sub_reads_the_sub_back_even_when_stuffed(): + assert request_sub(build_request(0x96, 0xFFFF)) == 0x96 + assert request_sub(build_request(0x10, 0x0000)) == 0x10 # SUB itself escaped + assert request_sub(build_request(0x71, 0x082C, bytes(10), b"\x03" * 5)) == 0x71 + + +@pytest.mark.parametrize("junk", [b"", b"\x41\x02\x03", b"\x02\x10\x10\x00\x96\x03", b"hello"]) +def test_request_sub_refuses_anything_that_is_not_a_request_frame(junk): + with pytest.raises(ValueError): + request_sub(junk) + + +@pytest.mark.skipif( + not _CAPTURES.is_dir(), + reason="capture directory is gitignored; present only on a dev box", +) +def test_builder_reproduces_every_captured_request_frame_including_writes(): + """251/251: the 218 reads plus the 33 data-carrying writes.""" + checked = 0 + for path in sorted(_CAPTURES.rglob("raw_bw_*.bin")): + blob = path.read_bytes() + i = 0 + while i < len(blob): + if not (blob[i] == ACK and i + 1 < len(blob) and blob[i + 1] == STX): + i += 1 + continue + j = i + 2 + body = bytearray() + while j < len(blob): + if blob[j] == DLE and j + 1 < len(blob): + body.append(blob[j + 1]) + j += 2 + continue + if blob[j] == ETX: + break + body.append(blob[j]) + j += 1 + payload = bytes(body[:-1]) + sub = payload[2] + offset = (payload[4] << 8) | payload[5] + assert build_request(sub, offset, payload[6:16], payload[16:]) == blob[i:j + 1], ( + f"{path.name} @0x{i:04x} SUB=0x{sub:02x}" + ) + checked += 1 + i = j + 1 + assert checked == 251, f"expected 251 request frames, checked {checked}" -- 2.54.1 From a3e4e85dfdc0c19eee9d1d68ea1de5cb7015d9ad Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:10:23 -0400 Subject: [PATCH 053/223] feat(micromate): one opcode table and a send-side gate -- writes refused unless allowed, 0xA2 always micromate/opcodes.py holds WRITE_SUBS and the cross-series collision 0xA2. MicromateProtocol._send reads the SUB of the bytes about to go out (framing.request_sub) and refuses any write SUB not in allowed_writes, and 0xA2 unconditionally. Docstrings now say the reads-only policy is enforced. request_sub also refuses any frame not in canonical form (stuff(unstuff(body)) == body): an interior unescaped 02/03/04, a 10 XX outside {02,03,04,10}, or a trailing lone DLE. What the gate checks is then exactly what the unit parses. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/client.py | 3 +- micromate/framing.py | 6 +++ micromate/opcodes.py | 58 +++++++++++++++++++++++++ micromate/protocol.py | 28 ++++++++---- tests/test_micromate_framing.py | 17 ++++++++ tests/test_micromate_opcodes.py | 75 +++++++++++++++++++++++++++++++++ 6 files changed, 178 insertions(+), 9 deletions(-) create mode 100644 micromate/opcodes.py create mode 100644 tests/test_micromate_opcodes.py diff --git a/micromate/client.py b/micromate/client.py index c29efe2..5b8cdf0 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -2,7 +2,8 @@ client.py — high-level API for a live Micromate (Series IV). Owns the transport, turns raw payloads into models. Read-only, like the layer -below it: nothing here writes, erases, or changes monitoring state. +below it: nothing here writes, erases, or changes monitoring state, and the +protocol's opcode gate (`micromate.opcodes`) enforces that in code. with MicromateClient(TcpTransport("63.45.161.30", 9034)) as mm: info = mm.connect() diff --git a/micromate/framing.py b/micromate/framing.py index b935fac..a676748 100644 --- a/micromate/framing.py +++ b/micromate/framing.py @@ -182,6 +182,12 @@ def request_sub(frame: bytes) -> int: body = unstuff(frame[2:-1]) if len(body) < 17 or body[0] != MM_CMD: raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}") + # Canonical form only: what this check reads must be exactly what the unit + # parses. An unescaped 02/03/04, a `10 XX` outside {02,03,04,10} or a + # trailing lone DLE would be read one way here and another by the unit. + if stuff(body) != frame[2:-1]: + raise ValueError( + f"not a canonical request frame (stuffing differs): {bytes(frame[:8]).hex()}") return body[2] diff --git a/micromate/opcodes.py b/micromate/opcodes.py new file mode 100644 index 0000000..c5f204c --- /dev/null +++ b/micromate/opcodes.py @@ -0,0 +1,58 @@ +"""Micromate (Series IV) opcode table: which SUBs write, and which collide. + +One place, as the parity spec requires. `MicromateProtocol._send` consults it +on every outgoing frame, so a write cannot reach a unit by a path nobody +thought about -- a scratch tool calling `protocol._send`, a hand-built frame, a +method added later. + +Every SUB here was seen as a host->unit request in THOR's captures +(`docs/micromate_protocol_reference.md`). The table classifies REQUESTS: a few +of these values are also ACK SUBs of other commands (0x71 acks 0x8E, 0x72 acks +0x8D), which is irrelevant to a send-side check. +""" +from __future__ import annotations + +from typing import Dict, FrozenSet + +WRITE_SUBS: Dict[int, str] = { + 0x47: "scheduler enable/disable", + 0x68: "setup push: preferences block (0x08)", + 0x71: "setup push: setup block (0x1A)", + 0x72: "setup push: setup confirm", + 0x73: "setup push: preferences confirm", + 0x7E: "call-home config write (0x2C)", + 0x7F: "call-home config confirm", + 0x82: "setup push: trigger block (0x2E)", + 0x83: "setup push: trigger confirm", + 0x8D: "file open for write", + 0x8E: "file body write", + 0x96: "start monitoring", + 0x97: "stop monitoring", + 0xA2: "end call-home", + 0xA8: "delete one event", + 0xAA: "delete-event confirm", + 0xDA: "setup push: file name", +} + +# Same bytes, opposite consequence on the other series. Never transmitted on +# Series IV, allowed or not: if a Series-III unit is at the address (a moved +# modem, a stale IP), it would execute the other meaning. Lifting an entry is +# a spec change, not a parameter. +CROSS_SERIES_COLLISIONS: Dict[int, str] = { + 0xA2: "CONFIRM ERASE on Series III -- erases every stored event; " + "'end call-home' on Series IV", +} + + +class OpcodeRefused(RuntimeError): + """A frame was stopped before it reached the wire.""" + + +def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> None: + if sub in CROSS_SERIES_COLLISIONS: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X}: {CROSS_SERIES_COLLISIONS[sub]}") + if sub in WRITE_SUBS and sub not in allowed_writes: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X} ({WRITE_SUBS[sub]}): writes are " + "not enabled on this connection") diff --git a/micromate/protocol.py b/micromate/protocol.py index 215b02b..4d9892f 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -4,13 +4,16 @@ protocol.py — one method per Micromate (Series IV) wire command. Returns raw payload bytes. Interpretation belongs in ``client.py``; this layer knows frames, offsets and sequencing, and nothing about what a field means. -Scope: **reads only.** Nothing here writes, erases, or changes monitoring -state. That is deliberate and worth keeping — no command has ever been -originated against a unit by this project; every write in -``docs/micromate_protocol_reference.md`` was performed by THOR while we -recorded. The first thing this codebase ever sends to a customer's instrument -should be a decision someone made on purpose, not a side effect of a client -that grew a method. +Scope: **reads only on the wire, enforced.** Every outgoing frame passes +`micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused +unless this connection was constructed with it in `allowed_writes` (nothing in +the codebase does so yet), and `0xA2` -- CONFIRM ERASE on Series III -- is +refused always. No command has ever been originated against a unit by this +project; every write in ``docs/micromate_protocol_reference.md`` was performed +by THOR while we recorded. The first thing this codebase ever sends to a +customer's instrument should be a decision someone made on purpose, not a side +effect of a client that grew a method. Write frames are *built* in +``micromate.writes`` as reviewable plans; building one sends nothing. Every offset and params layout below was read off THOR's own frames in ``bridges/captures/9-24-26 - micromate2/`` rather than taken from the spec @@ -43,7 +46,8 @@ from typing import Optional from minimateplus.transport import BaseTransport -from .framing import MicromateFrame, MicromateFrameParser, build_request +from .framing import MicromateFrame, MicromateFrameParser, build_request, request_sub +from .opcodes import check_transmit log = logging.getLogger(__name__) @@ -243,9 +247,13 @@ class MicromateProtocol: transport: BaseTransport, recv_timeout: float = DEFAULT_RECV_TIMEOUT, strict_checksums: bool = True, + allowed_writes: frozenset = frozenset(), ) -> None: """ Args: + allowed_writes: write SUBs this connection may transmit. Empty by + default -- every write opcode in `micromate.opcodes` is refused + at `_send`, and `0xA2` is refused whatever this says. strict_checksums: raise on a bad checksum. **Defaults to True, unlike the Series III sibling**, which logs and continues because its parser cannot reliably tell an inner-frame @@ -262,6 +270,7 @@ class MicromateProtocol: self._transport = transport self._recv_timeout = recv_timeout self._strict = strict_checksums + self._allowed_writes = frozenset(allowed_writes) self._parser = MicromateFrameParser() self._pending: list[MicromateFrame] = [] @@ -509,6 +518,9 @@ class MicromateProtocol: reset_parser=False) def _send(self, frame: bytes) -> None: + # The gate sees the bytes that are about to go out, not the caller's + # intent: every transmit in this package passes through here. + check_transmit(request_sub(frame), self._allowed_writes) log.debug("TX %d bytes: %s", len(frame), frame.hex()) self._transport.write(frame) diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 50d5f2c..7fcef89 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -468,6 +468,23 @@ def test_request_sub_refuses_anything_that_is_not_a_request_frame(junk): request_sub(junk) +def _noncanonical_frames(): + good = build_request(0x96, 0xFFFF) + return { + "interior raw 03": good[:5] + b"\x03" + good[5:], + "10 05 pair": good[:5] + b"\x10\x05" + good[5:], + "lone DLE before ETX": good[:-1] + b"\x10" + good[-1:], + "double 41 02 prefix": good[:2] + good, + "first byte not 0x10": good[:2] + bytes([0x11]) + good[3:], + } + + +@pytest.mark.parametrize("name", list(_noncanonical_frames())) +def test_request_sub_refuses_a_frame_that_is_not_in_canonical_form(name): + with pytest.raises(ValueError): + request_sub(_noncanonical_frames()[name]) + + @pytest.mark.skipif( not _CAPTURES.is_dir(), reason="capture directory is gitignored; present only on a dev box", diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py new file mode 100644 index 0000000..7c8fd7a --- /dev/null +++ b/tests/test_micromate_opcodes.py @@ -0,0 +1,75 @@ +"""The send-side gate: no write opcode reaches the wire unless allowed, and 0xA2 never.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from micromate.framing import build_request # noqa: E402 +from micromate.opcodes import ( # noqa: E402 + CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused, check_transmit, +) +from test_micromate_protocol import frame, proto # noqa: E402 + +# THOR's captured end-call-home frame -- byte-identical to Series III's CONFIRM ERASE. +A2_WIRE = bytes.fromhex("4102101000a200ffff00000000000000000000b003") + + +def test_no_read_command_is_classed_as_a_write(): + reads = {v for k, v in vars(mm_proto).items() if k.startswith("SUB_")} + assert reads and not (reads & set(WRITE_SUBS)) + + +def test_0xa2_is_a_collision_and_a_write(): + assert 0xA2 in CROSS_SERIES_COLLISIONS and 0xA2 in WRITE_SUBS + + +def test_a_write_is_refused_unless_allowed(): + with pytest.raises(OpcodeRefused, match="0x96"): + check_transmit(0x96) + check_transmit(0x96, frozenset({0x96})) + check_transmit(0x5B) # a read needs no permission + + +def test_0xa2_is_refused_even_when_allowed(): + with pytest.raises(OpcodeRefused, match="ERASE"): + check_transmit(0xA2, frozenset({0xA2})) + + +def test_the_protocol_refuses_a_write_and_writes_nothing(): + p, t = proto([]) + with pytest.raises(OpcodeRefused): + p._exchange(0x96, offset=0xFFFF) + with pytest.raises(OpcodeRefused): + p._send(build_request(0x97, 0xFFFF)) # a direct _send is gated too + assert t.written == [] + + +def test_the_protocol_refuses_the_captured_0xa2_frame_byte_for_byte(): + p, t = proto([], allowed_writes=frozenset({0xA2})) + with pytest.raises(OpcodeRefused): + p._send(A2_WIRE) + assert t.written == [] + + +def test_an_explicitly_allowed_write_goes_out_on_a_scripted_transport(): + p, t = proto([frame(0x69, bytes(11))], allowed_writes=frozenset({0x96})) + p._exchange(0x96, offset=0xFFFF) + assert t.written == [build_request(0x96, 0xFFFF)] + + +def test_reads_are_unaffected_by_the_gate(): + p, t = proto([frame(0xA4, bytes(11))]) + p.poll() + assert len(t.written) == 1 + + +def test_a_frame_that_is_not_a_request_is_refused_not_sent(): + p, t = proto([]) + with pytest.raises(ValueError): + p._send(b"\x41\x03") + assert t.written == [] -- 2.54.1 From 9c1c7cec768ea5f0ec99714a53b0e7d6d865000e Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:19:52 -0400 Subject: [PATCH 054/223] fix(micromate): the opcode gate is an allowlist -- unknown SUBs refused; tables read-only READ_SUBS catalogues every read; a SUB in neither table is refused, and allowed_writes may only name catalogued writes. Tables are MappingProxyType, _send checks the exact bytes it writes, check_transmit documents precedence. Tests cover unknown opcodes, concatenation smuggling and table immutability. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/opcodes.py | 53 ++++++++++++++++++++++++++++++--- micromate/protocol.py | 12 ++++++-- tests/test_micromate_framing.py | 1 + tests/test_micromate_opcodes.py | 49 +++++++++++++++++++++++++++++- 4 files changed, 108 insertions(+), 7 deletions(-) diff --git a/micromate/opcodes.py b/micromate/opcodes.py index c5f204c..74ee7c1 100644 --- a/micromate/opcodes.py +++ b/micromate/opcodes.py @@ -1,6 +1,10 @@ """Micromate (Series IV) opcode table: which SUBs write, and which collide. -One place, as the parity spec requires. `MicromateProtocol._send` consults it +One place, as the parity spec requires. The gate is an ALLOWLIST: a SUB is +transmitted only if it is a catalogued read (READ_SUBS) or a catalogued write +this connection was explicitly allowed. An unknown SUB is refused -- clock-set +and delete-all have Series-IV opcodes nobody has catalogued yet, and "unknown +means read" is the wrong default. `MicromateProtocol._send` consults it on every outgoing frame, so a write cannot reach a unit by a path nobody thought about -- a scratch tool calling `protocol._send`, a hand-built frame, a method added later. @@ -12,9 +16,10 @@ of these values are also ACK SUBs of other commands (0x71 acks 0x8E, 0x72 acks """ from __future__ import annotations -from typing import Dict, FrozenSet +from types import MappingProxyType +from typing import Dict, FrozenSet, Mapping -WRITE_SUBS: Dict[int, str] = { +_WRITE_SUBS: Dict[int, str] = { 0x47: "scheduler enable/disable", 0x68: "setup push: preferences block (0x08)", 0x71: "setup push: setup block (0x1A)", @@ -38,17 +43,53 @@ WRITE_SUBS: Dict[int, str] = { # Series IV, allowed or not: if a Series-III unit is at the address (a moved # modem, a stale IP), it would execute the other meaning. Lifting an entry is # a spec change, not a parameter. -CROSS_SERIES_COLLISIONS: Dict[int, str] = { +_CROSS_SERIES_COLLISIONS: Dict[int, str] = { 0xA2: "CONFIRM ERASE on Series III -- erases every stored event; " "'end call-home' on Series IV", } +_READ_SUBS: Dict[int, str] = { + 0x01: "device info", + 0x06: "storage range", + 0x08: "event index / preferences block", + 0x0A: "monitor log", + 0x0C: "event record", + 0x15: "serial number", + 0x1A: "setup block", + 0x1C: "monitor status", + 0x1E: "event first", + 0x1F: "event next", + 0x2C: "call-home config", + 0x2E: "trigger config", + 0x3F: "setup list first", + 0x40: "setup list next", + 0x41: "active setup", + 0x48: "file read next page", + 0x49: "state", + 0x5A: "bulk download", + 0x5B: "poll", + 0x93: "arm event", + 0x94: "file open for read", +} + +# Read-only views: a stray .pop() anywhere in the process cannot disable a gate. +WRITE_SUBS: Mapping[int, str] = MappingProxyType(_WRITE_SUBS) +CROSS_SERIES_COLLISIONS: Mapping[int, str] = MappingProxyType(_CROSS_SERIES_COLLISIONS) +READ_SUBS: Mapping[int, str] = MappingProxyType(_READ_SUBS) + + class OpcodeRefused(RuntimeError): """A frame was stopped before it reached the wire.""" def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> None: + """Raise OpcodeRefused unless `sub` may go on the wire. + + Precedence: (1) a cross-series collision is refused always; (2) a + catalogued write is refused unless in `allowed_writes`; (3) a SUB in + neither READ_SUBS nor `allowed_writes` is unknown and refused. + """ if sub in CROSS_SERIES_COLLISIONS: raise OpcodeRefused( f"refused to transmit SUB 0x{sub:02X}: {CROSS_SERIES_COLLISIONS[sub]}") @@ -56,3 +97,7 @@ def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> No raise OpcodeRefused( f"refused to transmit SUB 0x{sub:02X} ({WRITE_SUBS[sub]}): writes are " "not enabled on this connection") + if sub not in READ_SUBS and sub not in allowed_writes: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X}: unknown opcode -- not in " + "micromate.opcodes; catalogue it first") diff --git a/micromate/protocol.py b/micromate/protocol.py index 4d9892f..e958225 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -8,7 +8,8 @@ Scope: **reads only on the wire, enforced.** Every outgoing frame passes `micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused unless this connection was constructed with it in `allowed_writes` (nothing in the codebase does so yet), and `0xA2` -- CONFIRM ERASE on Series III -- is -refused always. No command has ever been originated against a unit by this +refused always. The gate is an allowlist: a SUB not catalogued in +`opcodes` (read or write) is refused as unknown. No command has ever been originated against a unit by this project; every write in ``docs/micromate_protocol_reference.md`` was performed by THOR while we recorded. The first thing this codebase ever sends to a customer's instrument should be a decision someone made on purpose, not a side @@ -47,7 +48,7 @@ from typing import Optional from minimateplus.transport import BaseTransport from .framing import MicromateFrame, MicromateFrameParser, build_request, request_sub -from .opcodes import check_transmit +from .opcodes import WRITE_SUBS, check_transmit log = logging.getLogger(__name__) @@ -271,6 +272,12 @@ class MicromateProtocol: self._recv_timeout = recv_timeout self._strict = strict_checksums self._allowed_writes = frozenset(allowed_writes) + unknown = self._allowed_writes - set(WRITE_SUBS) + if unknown: + raise ValueError( + "allowed_writes may only name catalogued write SUBs; not in " + "micromate.opcodes.WRITE_SUBS: " + + ", ".join(f"0x{x:02X}" for x in sorted(unknown))) self._parser = MicromateFrameParser() self._pending: list[MicromateFrame] = [] @@ -520,6 +527,7 @@ class MicromateProtocol: def _send(self, frame: bytes) -> None: # The gate sees the bytes that are about to go out, not the caller's # intent: every transmit in this package passes through here. + frame = bytes(frame) # checked bytes == written bytes check_transmit(request_sub(frame), self._allowed_writes) log.debug("TX %d bytes: %s", len(frame), frame.hex()) self._transport.write(frame) diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 7fcef89..2fe4396 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -476,6 +476,7 @@ def _noncanonical_frames(): "lone DLE before ETX": good[:-1] + b"\x10" + good[-1:], "double 41 02 prefix": good[:2] + good, "first byte not 0x10": good[:2] + bytes([0x11]) + good[3:], + "two frames concatenated": build_request(0x5B, 0x0030) + good, } diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py index 7c8fd7a..336429f 100644 --- a/tests/test_micromate_opcodes.py +++ b/tests/test_micromate_opcodes.py @@ -11,7 +11,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import micromate.protocol as mm_proto # noqa: E402 from micromate.framing import build_request # noqa: E402 from micromate.opcodes import ( # noqa: E402 - CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused, check_transmit, + CROSS_SERIES_COLLISIONS, READ_SUBS, WRITE_SUBS, OpcodeRefused, check_transmit, ) from test_micromate_protocol import frame, proto # noqa: E402 @@ -73,3 +73,50 @@ def test_a_frame_that_is_not_a_request_is_refused_not_sent(): with pytest.raises(ValueError): p._send(b"\x41\x03") assert t.written == [] + + +def test_every_protocol_read_sub_is_in_the_read_table(): + consts = {k: v for k, v in vars(mm_proto).items() if k.startswith("SUB_")} + assert len(consts) == 19 + assert set(consts.values()) <= set(READ_SUBS) + assert {0x94, 0x48} <= set(READ_SUBS) + + +def test_read_and_write_tables_are_disjoint(): + assert not (set(READ_SUBS) & set(WRITE_SUBS)) + + +@pytest.mark.parametrize("sub", [0xA3, 0x69, 0x74, 0x98, 0xEE]) +def test_an_unknown_opcode_is_refused_and_nothing_is_written(sub): + p, t = proto([]) + with pytest.raises(OpcodeRefused, match="unknown opcode"): + p._send(build_request(sub, 0)) + assert t.written == [] + + +def test_allowed_writes_may_only_name_catalogued_writes(): + for bad in (frozenset({0xEE}), frozenset({0x5B})): + with pytest.raises(ValueError): + proto([], allowed_writes=bad) + + +def test_the_tables_are_read_only(): + for table in (WRITE_SUBS, READ_SUBS, CROSS_SERIES_COLLISIONS): + with pytest.raises((TypeError, AttributeError)): + table.pop(next(iter(table))) + with pytest.raises(TypeError): + table[0x00] = "x" + + +@pytest.mark.parametrize("tail", [build_request(0x96, 0xFFFF), A2_WIRE]) +def test_a_read_followed_by_a_write_in_one_send_is_refused(tail): + p, t = proto([], allowed_writes=frozenset({0x96})) + with pytest.raises(ValueError): + p._send(build_request(0x5B, 0x0030) + tail) + assert t.written == [] + + +def test_a_bytearray_frame_is_checked_and_written_as_the_same_bytes(): + p, t = proto([]) + p._send(bytearray(build_request(0x5B, 0x0030))) + assert t.written == [build_request(0x5B, 0x0030)] -- 2.54.1 From c46dd878ff7624ec460cf5ae158a2cf5c90a00c7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:22:08 -0400 Subject: [PATCH 055/223] test(micromate): THOR's write sessions as fixtures -- seven captures, paired, with provenance Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- scratch/mm_write_fixtures.py | 94 +++++++ .../call-home-enable-disable.json | 95 +++++++ .../micromate-writes/monitor-start-stop.json | 251 ++++++++++++++++++ .../micromate-writes/setup-push-multiday.json | 155 +++++++++++ .../setup-push-new-test1.json | 83 ++++++ .../setup-push-overwrite-test1.json | 83 ++++++ .../setup-push-pull-schedule.json | 161 +++++++++++ .../setup-push-read-scheduler.json | 161 +++++++++++ tests/test_micromate_write_fixtures.py | 46 ++++ 9 files changed, 1129 insertions(+) create mode 100755 scratch/mm_write_fixtures.py create mode 100644 tests/fixtures/micromate-writes/call-home-enable-disable.json create mode 100644 tests/fixtures/micromate-writes/monitor-start-stop.json create mode 100644 tests/fixtures/micromate-writes/setup-push-multiday.json create mode 100644 tests/fixtures/micromate-writes/setup-push-new-test1.json create mode 100644 tests/fixtures/micromate-writes/setup-push-overwrite-test1.json create mode 100644 tests/fixtures/micromate-writes/setup-push-pull-schedule.json create mode 100644 tests/fixtures/micromate-writes/setup-push-read-scheduler.json create mode 100644 tests/test_micromate_write_fixtures.py diff --git a/scratch/mm_write_fixtures.py b/scratch/mm_write_fixtures.py new file mode 100755 index 0000000..d68db90 --- /dev/null +++ b/scratch/mm_write_fixtures.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +"""Cut Micromate write-session fixtures out of THOR's captures. + +bridges/captures/ is gitignored, so the reproduction tests read these instead. +Each fixture is every request (as wire bytes) and every response (as its data +section) of one captured THOR session, paired in order, with the sha256 of the +capture files it came from. Re-run to regenerate: + + .venv/bin/python scratch/mm_write_fixtures.py +""" +from __future__ import annotations + +import hashlib +import json +import sys +from pathlib import Path + +REPO = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(REPO)) + +from micromate.framing import ACK, DLE, ETX, STX, MicromateFrameParser, request_sub # noqa: E402 + +CAP = REPO / "bridges" / "captures" / "9-24-26 - micromate2" +OUT = REPO / "tests" / "fixtures" / "micromate-writes" +SESSIONS = { + "setup-push-new-test1": "20260924_181942_send_TEST1_to_unit", + "setup-push-overwrite-test1": "overwritetest/*20260924_185113_test1_overwrite_check", + "setup-push-read-scheduler": "20260924_191835_read_scheduler", + "setup-push-pull-schedule": "20260925_003029_pull_schedule,_turn_off_repeat_daily,_push_schedule", + "setup-push-multiday": "20260925_011907_send_multiday_schedule", + "call-home-enable-disable": "20260925_011620_ACH-change_1_setting", + "monitor-start-stop": "20260924_191214_turn_on_monitormode_then_attempt_to_write_config", +} + + +def _find(stem: str, kind: str) -> Path: + if "/" in stem: + sub, rest = stem.split("/", 1) + hits = sorted((CAP / sub).glob(f"raw_{kind}_{rest.lstrip('*')}.bin")) + else: + hits = sorted(CAP.glob(f"raw_{kind}_{stem}.bin")) + if len(hits) != 1: + raise SystemExit(f"expected one raw_{kind} file for {stem!r}, found {hits}") + return hits[0] + + +def requests(blob: bytes) -> list[bytes]: + out, i = [], 0 + while i < len(blob): + if not (blob[i] == ACK and i + 1 < len(blob) and blob[i + 1] == STX): + i += 1 + continue + j = i + 2 + while j < len(blob): + if blob[j] == DLE and j + 1 < len(blob): + j += 2 + continue + if blob[j] == ETX: + break + j += 1 + out.append(blob[i:j + 1]) + i = j + 1 + return out + + +def main() -> None: + OUT.mkdir(parents=True, exist_ok=True) + for slug, stem in SESSIONS.items(): + bw, s3 = _find(stem, "bw"), _find(stem, "s3") + reqs = requests(bw.read_bytes()) + parser = MicromateFrameParser() + rsps = parser.feed(s3.read_bytes()) + if len(reqs) != len(rsps): + raise SystemExit(f"{slug}: {len(reqs)} requests vs {len(rsps)} responses") + exchanges = [] + for rq, rp in zip(reqs, rsps): + sub = request_sub(rq) + if rp.sub != 0xFF - sub or not rp.checksum_valid: + raise SystemExit(f"{slug}: response 0x{rp.sub:02X} does not answer 0x{sub:02X}") + exchanges.append({"sub": sub, "request": rq.hex(), "response_sub": rp.sub, + "response_data": rp.data.hex()}) + doc = { + "source": str(bw.relative_to(REPO)), + "source_sha256": {"bw": hashlib.sha256(bw.read_bytes()).hexdigest(), + "s3": hashlib.sha256(s3.read_bytes()).hexdigest()}, + "unit": "UM12947", "firmware_line": "11.0CB", + "exchanges": exchanges, + } + (OUT / f"{slug}.json").write_text(json.dumps(doc, indent=1) + "\n") + print(f"{slug}: {len(exchanges)} exchanges") + + +if __name__ == "__main__": + main() diff --git a/tests/fixtures/micromate-writes/call-home-enable-disable.json b/tests/fixtures/micromate-writes/call-home-enable-disable.json new file mode 100644 index 0000000..13a90c2 --- /dev/null +++ b/tests/fixtures/micromate-writes/call-home-enable-disable.json @@ -0,0 +1,95 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260925_011620_ACH-change_1_setting.bin", + "source_sha256": { + "bw": "e44ce87a1e8638a9346386d5182a97ea142c8486fb17b7de2d1c67d1266be9df", + "s3": "5b15f219ff58a64e61c8b2123034dfcc766465534479a61c1447ea6d66ffd878" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 21, + "request": "41021010001500000a000000000000000000002f03", + "response_sub": 234, + "response_data": "0a00000000000000000000554d3132393437003100" + }, + { + "sub": 73, + "request": "41021010004900ffff000000000000000000005703", + "response_sub": 182, + "response_data": "050000000000000000000000e8000b00" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 44, + "request": "41021010002c00ffff000000000000000000003a03", + "response_sub": 211, + "response_data": "7e00000000000000000000007cdc000004524144494f2052494e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000034323003c00000000" + }, + { + "sub": 126, + "request": "41021010007e00007e00000000000000000000007cdc000005524144494f2052494e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000010034323003c00000000ce03", + "response_sub": 129, + "response_data": "0000000000000000000000" + }, + { + "sub": 127, + "request": "41021010007f00ffff000000000000000000008d03", + "response_sub": 128, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 21, + "request": "41021010001500000a000000000000000000002f03", + "response_sub": 234, + "response_data": "0a00000000000000000000554d3132393437003100" + }, + { + "sub": 73, + "request": "41021010004900ffff000000000000000000005703", + "response_sub": 182, + "response_data": "050000000000000000000000e8000b00" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 44, + "request": "41021010002c00ffff000000000000000000003a03", + "response_sub": 211, + "response_data": "7e00000000000000000000007cdc000005524144494f2052494e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000032e5e003c00000000" + }, + { + "sub": 126, + "request": "41021010007e00007e00000000000000000000007cdc00001004524144494f2052494e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000010032e5e003c00000000f303", + "response_sub": 129, + "response_data": "0000000000000000000000" + }, + { + "sub": 127, + "request": "41021010007f00ffff000000000000000000008d03", + "response_sub": 128, + "response_data": "0000000000000000000000" + } + ] +} diff --git a/tests/fixtures/micromate-writes/monitor-start-stop.json b/tests/fixtures/micromate-writes/monitor-start-stop.json new file mode 100644 index 0000000..32d41c2 --- /dev/null +++ b/tests/fixtures/micromate-writes/monitor-start-stop.json @@ -0,0 +1,251 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260924_191214_turn_on_monitormode_then_attempt_to_write_config.bin", + "source_sha256": { + "bw": "f65dd3b3260eb1fe034169a276e29f631e73fff69c65861d7281718fdbc2d999", + "s3": "dd78a64ac15d1d93492d0db7e3bafceddc1533ad0b6e7f8a5d19bffd83ecce66" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 21, + "request": "41021010001500000a000000000000000000002f03", + "response_sub": 234, + "response_data": "0a00000000000000000000554d3132393437003100" + }, + { + "sub": 73, + "request": "41021010004900ffff000000000000000000005703", + "response_sub": 182, + "response_data": "050000000000000000000000e8000b00" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 150, + "request": "41021010009600ffff00000000000000000000a403", + "response_sub": 105, + "response_data": "0000000000000000000000" + }, + { + "sub": 28, + "request": "41021010001c00ffff000000000000000000002a03", + "response_sub": 227, + "response_data": "2c00000000000000000000000e180907ea20130c19000000000001000000000000000000000000000000000000017c00e4e1c000e3f1c0" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 21, + "request": "41021010001500000a000000000000000000002f03", + "response_sub": 234, + "response_data": "0a00000000000000000000554d3132393437003100" + }, + { + "sub": 73, + "request": "41021010004900ffff000000000000000000005703", + "response_sub": 182, + "response_data": "050000000000000000000002e8000b00" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 151, + "request": "41021010009700ffff00000000000000000000a503", + "response_sub": 104, + "response_data": "0000000000000000000000" + }, + { + "sub": 28, + "request": "41021010001c00ffff000000000000000000002a03", + "response_sub": 227, + "response_data": "2c000000000000000000000000180907ea64130d22000000000001000000000000000000000000000000000000017c00e4e1c000e3e1c0" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 21, + "request": "41021010001500000a000000000000000000002f03", + "response_sub": 234, + "response_data": "0a00000000000000000000554d3132393437003100" + }, + { + "sub": 73, + "request": "41021010004900ffff000000000000000000005703", + "response_sub": 182, + "response_data": "050000000000000000000000e8000b00" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 63, + "request": "41021010003f00ffff000000000000000000004d03", + "response_sub": 192, + "response_data": "ff00000000000000000000666163746f72792e4d4d4200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff00000000000000000000544553542e4d4d4200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000042555320544553542e4d4d42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000057616c7368204a56203234312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000057616c7368204a56203030382e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000048617762616b6572203332322e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000048617762616b65722033323220626c617374696e672e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000006d696e2e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff00000000000000000000506c6179686f757365204c6f6320312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000056616c6c657920526f636b20536f6c7574696f6e2e4d4d42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000005265636f7264696e6753657475702e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000055504d432e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000055504d43204c6f6320332e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000005265736964656e636520496e6e2e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000004d6963726f6d6174652065787420747269676765722e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000004d6963726f6d6174652072656d6f727420616c61726d2e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000054726565206f66204c696665202d204c6f632031202d203538363120536f6c7761792e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000004d656c652d505753412d436172726f6c6c202d4c6f6320342e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff000000000000000000004d6963726f6d617465206d696e2074726967676572206d6d622e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff00000000000000000000466179202d204c6179746f6e204272696467652050726f6a6563742e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000044656661756c74204d6963726f6d61746520495345452e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 64, + "request": "41021010004000ffff000000000000000000004e03", + "response_sub": 191, + "response_data": "ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ] +} diff --git a/tests/fixtures/micromate-writes/setup-push-multiday.json b/tests/fixtures/micromate-writes/setup-push-multiday.json new file mode 100644 index 0000000..72d31a8 --- /dev/null +++ b/tests/fixtures/micromate-writes/setup-push-multiday.json @@ -0,0 +1,155 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260925_011907_send_multiday_schedule.bin", + "source_sha256": { + "bw": "1884a47bc25ac20f44b5aef4a0f92da6625ce1c809a8794aa2bb5da483ae4bf5", + "s3": "f26370a1bc880dfb08afdf1f3199f9f2811f49bc43ca9d4c9d3dc2b3cabfdbef" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 8, + "request": "41021010000800ffff000000000000000000001603", + "response_sub": 247, + "response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f" + }, + { + "sub": 46, + "request": "41021010002e00ffff000000000000000000003c03", + "response_sub": 209, + "response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a" + }, + { + "sub": 26, + "request": "41021010001a00ffff000000000000000000002803", + "response_sub": 229, + "response_data": "2c00000000000000000000082a64000004040000020000bf8000000000404000000003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c000242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bbdf" + }, + { + "sub": 218, + "request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603", + "response_sub": 37, + "response_data": "0000000000000000000000" + }, + { + "sub": 104, + "request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03", + "response_sub": 151, + "response_data": "0000000000000000000000" + }, + { + "sub": 115, + "request": "41021010007300ffff000000000000000000008103", + "response_sub": 140, + "response_data": "0000000000000000000000" + }, + { + "sub": 130, + "request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03", + "response_sub": 125, + "response_data": "0000000000000000000000" + }, + { + "sub": 131, + "request": "41021010008300ffff000000000000000000009103", + "response_sub": 124, + "response_data": "0000000000000000000000" + }, + { + "sub": 113, + "request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c001002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f03", + "response_sub": 142, + "response_data": "0000000000000000000000" + }, + { + "sub": 114, + "request": "41021010007200ffff000000000000000000008003", + "response_sub": 141, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 141, + "request": "41021010008d000018000000000000000000005c73797374656d5c7365747570735c74657374322e6d6d626e03", + "response_sub": 114, + "response_data": "0000000000000000000000" + }, + { + "sub": 142, + "request": "41021010008e0008900000000000000000000000011004000010020000bf800000000040400000001003000f053e000f00000000000000000001000074657374322e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e0000000000000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000436c69656e7400000000000000000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000074657374320000000000000000000000000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c00100242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010000000100000000000000010001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000008d03", + "response_sub": 113, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 141, + "request": "41021010008d00001d000000000000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747403", + "response_sub": 114, + "response_data": "0000000000000000000000" + }, + { + "sub": 142, + "request": "41021010008e0010040000000000000000000000100400000010100010020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100110020974657374322e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100210020954455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100310020974657374322e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008603", + "response_sub": 113, + "response_data": "0000000000000000000000" + }, + { + "sub": 142, + "request": "41021010008e001003200000000000000000000000000000000000000000000000000000000000001010100410020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100510020974657374322e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100610020954455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003303", + "response_sub": 113, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 71, + "request": "41021010004700ffff000000000000000100005603", + "response_sub": 184, + "response_data": "040000000000000001000000000001" + }, + { + "sub": 71, + "request": "41021010004700ffff00000000000000100300005803", + "response_sub": 184, + "response_data": "040000000000000003000000000001" + } + ] +} diff --git a/tests/fixtures/micromate-writes/setup-push-new-test1.json b/tests/fixtures/micromate-writes/setup-push-new-test1.json new file mode 100644 index 0000000..06f33bc --- /dev/null +++ b/tests/fixtures/micromate-writes/setup-push-new-test1.json @@ -0,0 +1,83 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260924_181942_send_TEST1_to_unit.bin", + "source_sha256": { + "bw": "ad6d47ab8602e1435360fa979d1b4aaf9bbf3bd37ada2f64bafe8c19b7317e18", + "s3": "0fc85cd78df4002d97d9e9a1e6e94d9c1d99bc22935e3b2d1e72a552032c1b84" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff00000000000000000000556e6976206f6620506974742d3173742059722e20486f7573696e672d4c6f6331205275736b696e2e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 8, + "request": "41021010000800ffff000000000000000000001603", + "response_sub": 247, + "response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f" + }, + { + "sub": 46, + "request": "41021010002e00ffff000000000000000000003c03", + "response_sub": 209, + "response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a" + }, + { + "sub": 26, + "request": "41021010001a00ffff000000000000000000002803", + "response_sub": 229, + "response_data": "2c00000000000000000000082a640000040400003c0000bf8000000000400000000003000f053e0007000000000000000000010000556e6976206f6620506974742d3173742059722e20486f7573696e672d4c6f6331205275736b696e2e6d6d620000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e0000000000000000000000000000556e6976206f6620506974742d31737420597220486f7573696e672d4c6f6331205275736b696e000000436c69656e7400000000000000000000000000000000504a204469636b20496e632e000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000054657272612d4d656368616e6963732c20496e632e202d204861727269736f6e0000000000000000000047656e6572616c204e6f7465730000000000000000004c6f6323312d556e6976206f6620506974742e202d205275736b696e2048616c6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f6320310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003e999999696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003e999999696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003e999999696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c0002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003cfd" + }, + { + "sub": 218, + "request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603", + "response_sub": 37, + "response_data": "0000000000000000000000" + }, + { + "sub": 104, + "request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03", + "response_sub": 151, + "response_data": "0000000000000000000000" + }, + { + "sub": 115, + "request": "41021010007300ffff000000000000000000008103", + "response_sub": 140, + "response_data": "0000000000000000000000" + }, + { + "sub": 130, + "request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03", + "response_sub": 125, + "response_data": "0000000000000000000000" + }, + { + "sub": 131, + "request": "41021010008300ffff000000000000000000009103", + "response_sub": 124, + "response_data": "0000000000000000000000" + }, + { + "sub": 113, + "request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c00100242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cb03", + "response_sub": 142, + "response_data": "0000000000000000000000" + }, + { + "sub": 114, + "request": "41021010007200ffff000000000000000000008003", + "response_sub": 141, + "response_data": "0000000000000000000000" + } + ] +} diff --git a/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json b/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json new file mode 100644 index 0000000..d9c199c --- /dev/null +++ b/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json @@ -0,0 +1,83 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/overwritetest/raw_bw_20260924_185113_test1_overwrite_check.bin", + "source_sha256": { + "bw": "7008231ce9ffadd0f56dfda00cfe030b8721ef928911b72ee58ce11f4ea9146e", + "s3": "d35497ca0ccf554e7bacd464723f3db1c052e2768785ef00b3689784b6e346bd" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 8, + "request": "41021010000800ffff000000000000000000001603", + "response_sub": 247, + "response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f" + }, + { + "sub": 46, + "request": "41021010002e00ffff000000000000000000003c03", + "response_sub": 209, + "response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a" + }, + { + "sub": 26, + "request": "41021010001a00ffff000000000000000000002803", + "response_sub": 229, + "response_data": "2c00000000000000000000082a64000004040000020000bf8000000000404000000003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c000242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d621" + }, + { + "sub": 218, + "request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603", + "response_sub": 37, + "response_data": "0000000000000000000000" + }, + { + "sub": 104, + "request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03", + "response_sub": 151, + "response_data": "0000000000000000000000" + }, + { + "sub": 115, + "request": "41021010007300ffff000000000000000000008103", + "response_sub": 140, + "response_data": "0000000000000000000000" + }, + { + "sub": 130, + "request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03", + "response_sub": 125, + "response_data": "0000000000000000000000" + }, + { + "sub": 131, + "request": "41021010008300ffff000000000000000000009103", + "response_sub": 124, + "response_data": "0000000000000000000000" + }, + { + "sub": 113, + "request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c001002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f03", + "response_sub": 142, + "response_data": "0000000000000000000000" + }, + { + "sub": 114, + "request": "41021010007200ffff000000000000000000008003", + "response_sub": 141, + "response_data": "0000000000000000000000" + } + ] +} diff --git a/tests/fixtures/micromate-writes/setup-push-pull-schedule.json b/tests/fixtures/micromate-writes/setup-push-pull-schedule.json new file mode 100644 index 0000000..be2e400 --- /dev/null +++ b/tests/fixtures/micromate-writes/setup-push-pull-schedule.json @@ -0,0 +1,161 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260925_003029_pull_schedule,_turn_off_repeat_daily,_push_schedule.bin", + "source_sha256": { + "bw": "a6a455fda2702708f4cb36e40eee4d12b7b6cab6b41aa5532210ae205bce735a", + "s3": "d49a4fd199f5a32df2fc2ccdaaf27aaff9a11804dd54a2250efbc0a9e636d786" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 148, + "request": "41021010009400001d000000010000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747c03", + "response_sub": 107, + "response_data": "0000000000000000000000" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000100005703", + "response_sub": 183, + "response_data": "040000000000000001000000000001" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000000005603", + "response_sub": 183, + "response_data": "0c00000000000000000000030000000f03020954455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002703100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000000005603", + "response_sub": 183, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 8, + "request": "41021010000800ffff000000000000000000001603", + "response_sub": 247, + "response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f" + }, + { + "sub": 46, + "request": "41021010002e00ffff000000000000000000003c03", + "response_sub": 209, + "response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a" + }, + { + "sub": 26, + "request": "41021010001a00ffff000000000000000000002803", + "response_sub": 229, + "response_data": "2c00000000000000000000082a64000004040000020000bf8000000000404000000003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c000242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bbdf" + }, + { + "sub": 218, + "request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603", + "response_sub": 37, + "response_data": "0000000000000000000000" + }, + { + "sub": 104, + "request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03", + "response_sub": 151, + "response_data": "0000000000000000000000" + }, + { + "sub": 115, + "request": "41021010007300ffff000000000000000000008103", + "response_sub": 140, + "response_data": "0000000000000000000000" + }, + { + "sub": 130, + "request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03", + "response_sub": 125, + "response_data": "0000000000000000000000" + }, + { + "sub": 131, + "request": "41021010008300ffff000000000000000000009103", + "response_sub": 124, + "response_data": "0000000000000000000000" + }, + { + "sub": 113, + "request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c001002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f03", + "response_sub": 142, + "response_data": "0000000000000000000000" + }, + { + "sub": 114, + "request": "41021010007200ffff000000000000000000008003", + "response_sub": 141, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 141, + "request": "41021010008d00001d000000000000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747403", + "response_sub": 114, + "response_data": "0000000000000000000000" + }, + { + "sub": 142, + "request": "41021010008e0010020c0000000000000000000010020000000f100310020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027100310100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e003", + "response_sub": 113, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 71, + "request": "41021010004700ffff000000000000000100005603", + "response_sub": 184, + "response_data": "040000000000000001000000000001" + }, + { + "sub": 71, + "request": "41021010004700ffff00000000000000100300005803", + "response_sub": 184, + "response_data": "040000000000000003000000000001" + } + ] +} diff --git a/tests/fixtures/micromate-writes/setup-push-read-scheduler.json b/tests/fixtures/micromate-writes/setup-push-read-scheduler.json new file mode 100644 index 0000000..871d4bc --- /dev/null +++ b/tests/fixtures/micromate-writes/setup-push-read-scheduler.json @@ -0,0 +1,161 @@ +{ + "source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260924_191835_read_scheduler.bin", + "source_sha256": { + "bw": "8e9f773f97bc43a0e3ab312e2c5ee072c86ca391b07a01ea7fa71c2d0110ff16", + "s3": "4ef5db0c8b804ac646c61151366e52df3bda1d96a492d4b420cb8fe6934dcedb" + }, + "unit": "UM12947", + "firmware_line": "11.0CB", + "exchanges": [ + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 148, + "request": "41021010009400001d000000010000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747c03", + "response_sub": 107, + "response_data": "0000000000000000000000" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000100005703", + "response_sub": 183, + "response_data": "040000000000000001000000000001" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000000005603", + "response_sub": 183, + "response_data": "0c00000000000000000000030000000f030228556e6976206f6620506974742d3173742059722e20486f7573696e672d4c6f6331205275736b696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002703100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 72, + "request": "41021010004800ffff000000000000000000005603", + "response_sub": 183, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 65, + "request": "41021010004100ffff000000000000000000004f03", + "response_sub": 190, + "response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "sub": 8, + "request": "41021010000800ffff000000000000000000001603", + "response_sub": 247, + "response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f" + }, + { + "sub": 46, + "request": "41021010002e00ffff000000000000000000003c03", + "response_sub": 209, + "response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a" + }, + { + "sub": 26, + "request": "41021010001a00ffff000000000000000000002803", + "response_sub": 229, + "response_data": "2c00000000000000000000082a64000004040000020000bf8000000000404000000003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c000242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bbdf" + }, + { + "sub": 218, + "request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603", + "response_sub": 37, + "response_data": "0000000000000000000000" + }, + { + "sub": 104, + "request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03", + "response_sub": 151, + "response_data": "0000000000000000000000" + }, + { + "sub": 115, + "request": "41021010007300ffff000000000000000000008103", + "response_sub": 140, + "response_data": "0000000000000000000000" + }, + { + "sub": 130, + "request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03", + "response_sub": 125, + "response_data": "0000000000000000000000" + }, + { + "sub": 131, + "request": "41021010008300ffff000000000000000000009103", + "response_sub": 124, + "response_data": "0000000000000000000000" + }, + { + "sub": 113, + "request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c001002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f03", + "response_sub": 142, + "response_data": "0000000000000000000000" + }, + { + "sub": 114, + "request": "41021010007200ffff000000000000000000008003", + "response_sub": 141, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 141, + "request": "41021010008d00001d000000000000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747403", + "response_sub": 114, + "response_data": "0000000000000000000000" + }, + { + "sub": 142, + "request": "41021010008e0010020c0000000000000000000010030000000f100310020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027100310100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e103", + "response_sub": 113, + "response_data": "0000000000000000000000" + }, + { + "sub": 91, + "request": "41021010005b000030000000000000000000009b03", + "response_sub": 164, + "response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76" + }, + { + "sub": 71, + "request": "41021010004700ffff000000000000000100005603", + "response_sub": 184, + "response_data": "040000000000000001000000000001" + }, + { + "sub": 71, + "request": "41021010004700ffff00000000000000100300005803", + "response_sub": 184, + "response_data": "040000000000000003000000000001" + } + ] +} diff --git a/tests/test_micromate_write_fixtures.py b/tests/test_micromate_write_fixtures.py new file mode 100644 index 0000000..c0e1230 --- /dev/null +++ b/tests/test_micromate_write_fixtures.py @@ -0,0 +1,46 @@ +"""The write-session fixtures are what they claim to be: THOR's own frames, paired.""" +from __future__ import annotations + +import json +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.framing import request_sub, unstuff # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "micromate-writes" +ALL = sorted(FIX.glob("*.json")) + + +def test_all_seven_sessions_are_present(): + assert {p.stem for p in ALL} == { + "setup-push-new-test1", "setup-push-overwrite-test1", "setup-push-read-scheduler", + "setup-push-pull-schedule", "setup-push-multiday", "call-home-enable-disable", + "monitor-start-stop"} + + +@pytest.mark.parametrize("path", ALL, ids=lambda p: p.stem) +def test_every_request_is_a_valid_frame_and_every_response_answers_it(path): + doc = json.loads(path.read_text()) + assert doc["source_sha256"]["bw"] and doc["exchanges"] + for ex in doc["exchanges"]: + wire = bytes.fromhex(ex["request"]) + assert request_sub(wire) == ex["sub"] + body = unstuff(wire[2:-1]) + assert body[-1] == sum(body[:-1]) & 0xFF # plain SUM8 + assert ex["response_sub"] == 0xFF - ex["sub"] + + +@pytest.mark.parametrize("slug,subs", [ + ("setup-push-new-test1", [0x41, 0x08, 0x2E, 0x1A, 0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72]), + ("call-home-enable-disable", [0x2C, 0x7E, 0x7F]), + ("monitor-start-stop", [0x96, 0x97]), +]) +def test_each_session_holds_the_frames_its_tests_need(slug, subs): + seen = [ex["sub"] for ex in json.loads((FIX / f"{slug}.json").read_text())["exchanges"]] + for s in subs: + assert s in seen, f"{slug}: no SUB 0x{s:02X}" -- 2.54.1 From 49f8f49ac1cccf886d4eb942650fbb6a48a9a3f3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:24:16 -0400 Subject: [PATCH 056/223] feat(micromate): write plans for start/stop, call-home and setup push -- THOR's frames byte for byte Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/writes.py | 139 ++++++++++++++++++++++++++++ tests/test_micromate_writes.py | 162 +++++++++++++++++++++++++++++++++ 2 files changed, 301 insertions(+) create mode 100644 micromate/writes.py create mode 100644 tests/test_micromate_writes.py diff --git a/micromate/writes.py b/micromate/writes.py new file mode 100644 index 0000000..28d7149 --- /dev/null +++ b/micromate/writes.py @@ -0,0 +1,139 @@ +"""Write plans for a Micromate: the exact frames a write would send, in order. + +A plan is what a dry run returns. Building one sends nothing; transmitting it +also needs a protocol constructed with those SUBs in `allowed_writes`, which no +code does yet (see `micromate.opcodes`). + +Every input is the unit's OWN read of the block being written (content, i.e. +response data[11:]), and every plan sends back exactly what was read except +the one thing the operation changes. THOR works the same way, and the +reproduction tests hold the plans to THOR's frames byte for byte. + +Offsets are THOR's observed constants. 🔶 Each was seen at one block size +only, so a plan refuses a block of any other size rather than guess. +""" +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import FrozenSet, List, Tuple + +from .framing import build_request +from .opcodes import CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused +from .setup_block import crc_ok + +_CONFIRM = 0xFFFF + +# block content sizes THOR's offsets were observed at (all on UM12947 / 11.0CB) +_PREFS_LEN, _TRIGGER_LEN, _SETUP_LEN, _CALL_HOME_LEN = 90, 28, 2092, 126 +_NAME_FIELD = 256 + + +@dataclass(frozen=True) +class WriteStep: + sub: int + offset: int + data: bytes = b"" + params: bytes = field(default=bytes(10)) + what: str = "" + + @property + def ack_sub(self) -> int: + return 0xFF - self.sub + + @property + def frame(self) -> bytes: + return build_request(self.sub, self.offset, self.params, self.data) + + def describe(self) -> dict: + return {"sub": f"0x{self.sub:02X}", "what": self.what, + "offset": f"0x{self.offset:04X}", "data_len": len(self.data), + "expect_ack": f"0x{self.ack_sub:02X}", "frame": self.frame.hex()} + + +@dataclass(frozen=True) +class WritePlan: + action: str + steps: Tuple[WriteStep, ...] + + def __post_init__(self) -> None: + for s in self.steps: + if s.sub in CROSS_SERIES_COLLISIONS: + raise OpcodeRefused( + f"a plan cannot hold SUB 0x{s.sub:02X}: {CROSS_SERIES_COLLISIONS[s.sub]}") + if s.sub not in WRITE_SUBS: + raise ValueError(f"SUB 0x{s.sub:02X} is not a write opcode") + + @property + def subs(self) -> FrozenSet[int]: + return frozenset(s.sub for s in self.steps) + + def frames(self) -> List[bytes]: + return [s.frame for s in self.steps] + + def describe(self) -> dict: + return {"action": self.action, "sends_nothing": True, + "steps": [s.describe() for s in self.steps]} + + +def plan_start_monitoring() -> WritePlan: + return WritePlan("start monitoring", (WriteStep(0x96, _CONFIRM, what="start monitoring"),)) + + +def plan_stop_monitoring() -> WritePlan: + return WritePlan("stop monitoring", (WriteStep(0x97, _CONFIRM, what="stop monitoring"),)) + + +def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: + """Read `0x2C`, flip bit 0 of content[5], send the rest back byte for byte. + + `[5]` reads 0x05 enabled / 0x04 disabled; bit 2 is set in both, so only + bit 0 is the enable. `[118:120]` is unit-maintained and THOR echoes it. + """ + if len(call_home) != _CALL_HOME_LEN: + raise ValueError(f"call-home content must be {_CALL_HOME_LEN} B " + f"(the size THOR's offset was seen at), got {len(call_home)}") + b5 = (call_home[5] | 0x01) if enabled else (call_home[5] & 0xFE) + data = call_home[:5] + bytes([b5]) + call_home[6:] + what = "call-home " + ("enable" if enabled else "disable") + return WritePlan(what, ( + WriteStep(0x7E, 0x007E, data, what="call-home config write"), + WriteStep(0x7F, _CONFIRM, what="call-home config confirm"), + )) + + +def _checked(block: bytes, size: int, label: str) -> bytes: + if len(block) != size: + raise ValueError(f"{label} block size {len(block)} B is not the {size} B " + "THOR's offset was observed at -- refusing to guess") + if not crc_ok(block): + raise ValueError(f"{label} block failed its checksum -- refusing to write a " + "corrupt read back to the unit") + return block + + +def plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str) -> WritePlan: + """Rewrite a setup as THOR does: read 0x08, 0x2E, 0x1A, send each back. + + No field editing here (phase 5). Each block goes back with its length echo + [0:3] zeroed; the unit recomputes the CRCs, so 0x68 and 0x71 drop the CRC + slot and 0x82 sends it zeroed -- exactly THOR's frames. + """ + _checked(prefs, _PREFS_LEN, "preferences (0x08)") + _checked(trigger, _TRIGGER_LEN, "trigger (0x2E)") + _checked(setup, _SETUP_LEN, "setup (0x1A)") + try: + raw = name.encode("ascii") + except UnicodeEncodeError: + raise ValueError(f"setup name must be ASCII: {name!r}") from None + if not raw or b"\x00" in raw or len(raw) >= _NAME_FIELD: + raise ValueError(f"setup name must be 1-{_NAME_FIELD - 1} ASCII bytes " + f"with no NUL: {name!r}") + return WritePlan(f"setup push: {name}", ( + WriteStep(0xDA, 0x0100, raw.ljust(_NAME_FIELD, b"\x00"), what="setup file name"), + WriteStep(0x68, 0x005A, bytes(3) + prefs[3:88], what="preferences block"), + WriteStep(0x73, _CONFIRM, what="preferences confirm"), + WriteStep(0x82, 0x001C, bytes(3) + trigger[3:26] + bytes(2), what="trigger block"), + WriteStep(0x83, _CONFIRM, what="trigger confirm"), + WriteStep(0x71, 0x082C, bytes(3) + setup[3:2090], what="setup block"), + WriteStep(0x72, _CONFIRM, what="setup confirm"), + )) diff --git a/tests/test_micromate_writes.py b/tests/test_micromate_writes.py new file mode 100644 index 0000000..3e3fad7 --- /dev/null +++ b/tests/test_micromate_writes.py @@ -0,0 +1,162 @@ +"""Write plans: built from the unit's own reads, equal to THOR's frames byte for byte.""" +from __future__ import annotations + +import json +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.opcodes import OpcodeRefused # noqa: E402 +from micromate.writes import ( # noqa: E402 + WritePlan, WriteStep, plan_call_home_enabled, plan_setup_push, + plan_start_monitoring, plan_stop_monitoring, +) + +FIX = Path(__file__).parent / "fixtures" / "micromate-writes" +PUSHES = ["setup-push-new-test1", "setup-push-overwrite-test1", "setup-push-read-scheduler", + "setup-push-pull-schedule", "setup-push-multiday"] +NO_EDIT_PUSHES = ["setup-push-read-scheduler", "setup-push-pull-schedule", "setup-push-multiday"] + + +def _session(slug): + return json.loads((FIX / f"{slug}.json").read_text())["exchanges"] + + +def _content(ex): + return bytes.fromhex(ex["response_data"])[11:] + + +def _first_push(slug): + """The reads (by SUB) and THOR's writes (by SUB) of the session's first push.""" + ex = _session(slug) + start = next(i for i, e in enumerate(ex) if e["sub"] == 0xDA) + reads = {} + for e in ex[:start]: + reads[e["sub"]] = _content(e) # the LAST read of each SUB before the push + writes = {} + for e in ex[start:]: + if e["sub"] in writes: + break + writes[e["sub"]] = bytes.fromhex(e["request"]) + if e["sub"] == 0x72: + break + return reads, writes + + +def _name_from_active(content): + # Mirrors micromate.client._cstring(content): name at content[0], NUL-terminated, stripped. + return content.split(b"\x00")[0].decode("ascii", "replace").strip() + + +# ── start / stop ────────────────────────────────────────────────────────────── + +def test_start_and_stop_equal_thors_frames(): + thor = {e["sub"]: bytes.fromhex(e["request"]) for e in _session("monitor-start-stop") + if e["sub"] in (0x96, 0x97)} + assert plan_start_monitoring().frames() == [thor[0x96]] + assert plan_stop_monitoring().frames() == [thor[0x97]] + assert thor[0x96].hex() == "41021010009600ffff00000000000000000000a403" + + +# ── call-home ───────────────────────────────────────────────────────────────── + +def test_call_home_enable_then_disable_equal_thors_frames(): + ex = _session("call-home-enable-disable") + pairs, last_read = [], None + for e in ex: + if e["sub"] == 0x2C: + last_read = _content(e) + elif e["sub"] == 0x7E: + pairs.append((last_read, bytes.fromhex(e["request"]))) + confirms = [bytes.fromhex(e["request"]) for e in ex if e["sub"] == 0x7F] + assert len(pairs) == 2 and len(confirms) == 2 + (r1, w1), (r2, w2) = pairs + on, off = plan_call_home_enabled(r1, True), plan_call_home_enabled(r2, False) + assert on.frames() == [w1, confirms[0]] + assert off.frames() == [w2, confirms[1]] + + +def test_call_home_flips_exactly_one_bit_and_echoes_everything_else(): + r1 = next(_content(e) for e in _session("call-home-enable-disable") if e["sub"] == 0x2C) + for enabled in (True, False): + data = plan_call_home_enabled(r1, enabled).steps[0].data + diff = [i for i in range(len(r1)) if data[i] != r1[i]] + assert set(diff) <= {5} + assert data[5] & 0x01 == (1 if enabled else 0) + assert data[5] & 0xFE == r1[5] & 0xFE + assert data[118:120] == r1[118:120] + + +def test_call_home_refuses_an_unobserved_size(): + with pytest.raises(ValueError, match="126"): + plan_call_home_enabled(bytes(125), True) + + +# ── setup push ──────────────────────────────────────────────────────────────── + +@pytest.mark.parametrize("slug", PUSHES) +def test_setup_push_name_prefs_trigger_and_confirms_equal_thors_frames(slug): + reads, thor = _first_push(slug) + name = ("TEST1.mmb" if slug == "setup-push-new-test1" + else _name_from_active(reads[0x41])) + plan = plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], name) + ours = {s.sub: s.frame for s in plan.steps} + for sub in (0xDA, 0x68, 0x73, 0x82, 0x83, 0x72): + assert ours[sub] == thor[sub], f"{slug}: SUB 0x{sub:02X}" + assert [s.sub for s in plan.steps] == [0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72] + + +@pytest.mark.parametrize("slug", NO_EDIT_PUSHES) +def test_a_no_edit_push_reproduces_thors_setup_block_frame(slug): + reads, thor = _first_push(slug) + plan = plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], _name_from_active(reads[0x41])) + assert next(s.frame for s in plan.steps if s.sub == 0x71) == thor[0x71] + + +def test_setup_push_refuses_a_read_that_fails_its_checksum(): + reads, _ = _first_push("setup-push-multiday") + bad = bytearray(reads[0x1A]) + bad[100] ^= 0xFF + with pytest.raises(ValueError, match="checksum"): + plan_setup_push(reads[0x08], reads[0x2E], bytes(bad), "x.mmb") + + +@pytest.mark.parametrize("which", ["prefs", "trigger", "setup"]) +def test_setup_push_refuses_an_unobserved_block_size(which): + reads, _ = _first_push("setup-push-multiday") + args = {"prefs": reads[0x08], "trigger": reads[0x2E], "setup": reads[0x1A]} + args[which] = args[which] + b"\x00\x00" + with pytest.raises(ValueError, match="size"): + plan_setup_push(args["prefs"], args["trigger"], args["setup"], "x.mmb") + + +@pytest.mark.parametrize("name", ["", "a\x00b", "é.mmb", "x" * 256]) +def test_setup_push_refuses_a_bad_name(name): + reads, _ = _first_push("setup-push-multiday") + with pytest.raises(ValueError): + plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], name) + + +# ── the plan object ─────────────────────────────────────────────────────────── + +def test_a_plan_cannot_hold_a_collision_opcode(): + with pytest.raises(OpcodeRefused): + WritePlan("end call-home", (WriteStep(0xA2, 0xFFFF),)) + + +def test_a_plan_cannot_hold_a_read(): + with pytest.raises(ValueError): + WritePlan("poll", (WriteStep(0x5B, 0x0030),)) + + +def test_describe_is_the_dry_run_shape(): + d = plan_stop_monitoring().describe() + assert d["action"] == "stop monitoring" and d["sends_nothing"] is True + step = d["steps"][0] + assert step == {"sub": "0x97", "what": "stop monitoring", "offset": "0xFFFF", + "data_len": 0, "expect_ack": "0x68", + "frame": "41021010009700ffff00000000000000000000a503"} -- 2.54.1 From cbda4b80df57182cbc942524441148b731dac56a Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:26:41 -0400 Subject: [PATCH 057/223] fix(micromate): a write plan copies its steps -- nothing can be added after validation Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/writes.py | 7 ++++++ tests/test_micromate_writes.py | 45 +++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/micromate/writes.py b/micromate/writes.py index 28d7149..7ce9482 100644 --- a/micromate/writes.py +++ b/micromate/writes.py @@ -56,6 +56,8 @@ class WritePlan: steps: Tuple[WriteStep, ...] def __post_init__(self) -> None: + # Copy: a caller's list must not be able to add a step after validation. + object.__setattr__(self, "steps", tuple(self.steps)) for s in self.steps: if s.sub in CROSS_SERIES_COLLISIONS: raise OpcodeRefused( @@ -117,6 +119,11 @@ def plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str) -> Wr No field editing here (phase 5). Each block goes back with its length echo [0:3] zeroed; the unit recomputes the CRCs, so 0x68 and 0x71 drop the CRC slot and 0x82 sends it zeroed -- exactly THOR's frames. + + The name goes out exactly as given. `MicromateClient.get_active_setup()` + strips whitespace, so a setup name with leading or trailing spaces would + not round-trip through it; phase 5 decides whether to take the unstripped + name from the 0x41 read. """ _checked(prefs, _PREFS_LEN, "preferences (0x08)") _checked(trigger, _TRIGGER_LEN, "trigger (0x2E)") diff --git a/tests/test_micromate_writes.py b/tests/test_micromate_writes.py index 3e3fad7..5beb3bc 100644 --- a/tests/test_micromate_writes.py +++ b/tests/test_micromate_writes.py @@ -1,6 +1,7 @@ """Write plans: built from the unit's own reads, equal to THOR's frames byte for byte.""" from __future__ import annotations +import dataclasses import json import os import sys @@ -80,15 +81,24 @@ def test_call_home_enable_then_disable_equal_thors_frames(): assert off.frames() == [w2, confirms[1]] -def test_call_home_flips_exactly_one_bit_and_echoes_everything_else(): - r1 = next(_content(e) for e in _session("call-home-enable-disable") if e["sub"] == 0x2C) - for enabled in (True, False): - data = plan_call_home_enabled(r1, enabled).steps[0].data - diff = [i for i in range(len(r1)) if data[i] != r1[i]] - assert set(diff) <= {5} - assert data[5] & 0x01 == (1 if enabled else 0) - assert data[5] & 0xFE == r1[5] & 0xFE - assert data[118:120] == r1[118:120] +def _call_home_reads(): + return [_content(e) for e in _session("call-home-enable-disable") if e["sub"] == 0x2C] + + +@pytest.mark.parametrize("read_idx", [0, 1]) +@pytest.mark.parametrize("enabled", [True, False]) +def test_call_home_flips_exactly_one_bit_and_echoes_everything_else(read_idx, enabled): + reads = _call_home_reads() + assert {reads[0][5], reads[1][5]} == {0x04, 0x05} + r = reads[read_idx] + data = plan_call_home_enabled(r, enabled).steps[0].data + diff = [i for i in range(len(r)) if data[i] != r[i]] + assert set(diff) <= {5} + assert data[5] & 0x01 == (1 if enabled else 0) + assert data[5] & 0xFE == r[5] & 0xFE + if (r[5] & 1) == int(enabled): + assert data[5] == r[5] + assert data[118:120] == r[118:120] def test_call_home_refuses_an_unobserved_size(): @@ -160,3 +170,20 @@ def test_describe_is_the_dry_run_shape(): assert step == {"sub": "0x97", "what": "stop monitoring", "offset": "0xFFFF", "data_len": 0, "expect_ack": "0x68", "frame": "41021010009700ffff00000000000000000000a503"} + + +def test_a_plan_copies_its_steps_so_a_later_mutation_cannot_change_it(): + lst = [WriteStep(0x96, 0xFFFF)] + plan = WritePlan("start", lst) + before = plan.frames() + lst.append(WriteStep(0xA2, 0xFFFF)) + lst[0] = WriteStep(0x97, 0xFFFF) + assert isinstance(plan.steps, tuple) and len(plan.steps) == 1 + assert plan.steps[0].sub == 0x96 + assert plan.frames() == before + + +def test_steps_cannot_be_reassigned(): + plan = plan_stop_monitoring() + with pytest.raises(dataclasses.FrozenInstanceError): + plan.steps = () -- 2.54.1 From 9ecf6e6a0c30066cc8db7d331cdb8608af2f2d0c Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:29:00 -0400 Subject: [PATCH 058/223] feat(bridges): mm_dry_run -- a write's planned frames from a live unit's reads; bench-checked on UM20147 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 8 +++ bridges/mm_dry_run.py | 84 ++++++++++++++++++++++++++++ docs/micromate_protocol_reference.md | 15 +++++ 3 files changed, 107 insertions(+) create mode 100644 bridges/mm_dry_run.py diff --git a/CLAUDE.md b/CLAUDE.md index 131a49c..58a4cac 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,6 +27,14 @@ Read this first when picking the project back up. ⚠ **No command has ever been originated against a unit by this project.** Every write was performed by THOR while we recorded. That line is worth keeping. + **Series-4 write path, phase 2 is done (2026-10-22):** the write encoder, a + send-side opcode gate and write *plans* for start/stop, call-home enable and + the setup rewrite, reproduced byte for byte against THOR's captured frames. + `bridges/mm_dry_run.py` prints a write's planned frames from a live unit's + reads (run on UM20147: sizes equal UM12947's). `MicromateProtocol._send` + refuses every write opcode unless explicitly allowed, and `0xA2` always, so + "no command has ever been originated against a unit" is still true and is now + enforced in code. - **✅ `micromate/` HAS a live client (2026-10-02).** `framing.py`, `protocol.py`, `client.py` + models, **119 tests**, mirroring the `minimateplus/` stack and reusing its `transport.py` unchanged. Connect over diff --git a/bridges/mm_dry_run.py b/bridges/mm_dry_run.py new file mode 100644 index 0000000..d803b32 --- /dev/null +++ b/bridges/mm_dry_run.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Dry run a Micromate write against a live unit: do the reads, print the plan. + +Sends READS only. The write frames are built from the unit's own blocks and +printed for review -- step 1 of the bench protocol for every first live write +(parity spec, Testing). The protocol's opcode gate refuses every write SUB on +this connection, so nothing else can go out even by mistake. + + sg dialout -c ".venv/bin/python bridges/mm_dry_run.py /dev/ttyACM0 call-home-off" + .venv/bin/python bridges/mm_dry_run.py --host 10.0.0.5 --tcp-port 9034 setup-rewrite + +The JSON carries a `reads` block (length of each block read, and for +setup-rewrite the blocks themselves in hex) so the plan can be checked against +what the unit actually said. +""" +from __future__ import annotations + +import argparse +import json +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +from micromate.client import CONTENT, MicromateClient # noqa: E402 +from micromate.writes import ( # noqa: E402 + plan_call_home_enabled, plan_setup_push, plan_start_monitoring, plan_stop_monitoring, +) +from minimateplus.transport import SerialTransport, TcpTransport # noqa: E402 + +ACTIONS = ("start", "stop", "call-home-on", "call-home-off", "setup-rewrite") + + +def _content(data: bytes) -> bytes: + """The protocol's read_* methods return the response data with its 11-byte prefix.""" + return bytes(data)[CONTENT:] + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("port", nargs="?", help="serial port, e.g. /dev/ttyACM0") + ap.add_argument("action", choices=ACTIONS) + ap.add_argument("--host") + ap.add_argument("--tcp-port", type=int, default=9034) + ap.add_argument("--baud", type=int, default=115200) + a = ap.parse_args() + if not (a.port or a.host): + ap.error("give a serial port or --host") + transport = TcpTransport(a.host, port=a.tcp_port) if a.host else SerialTransport(a.port, a.baud) + mm = MicromateClient(transport) # no allowed_writes: the gate refuses every write + mm.open() + try: + info = mm.connect() + p = mm.protocol + reads = {} + if a.action == "start": + plan = plan_start_monitoring() + elif a.action == "stop": + plan = plan_stop_monitoring() + elif a.action.startswith("call-home"): + ch = _content(p.read_call_home_config()) + reads["0x2C"] = {"len": len(ch)} + plan = plan_call_home_enabled(ch, a.action == "call-home-on") + else: + name = mm.get_active_setup() + prefs = _content(p.read_event_index()) + trig = _content(p.read_trigger_config()) + setup = _content(p.read_compliance_config()) + reads = {"active_setup": name, + "0x08": {"len": len(prefs), "hex": prefs.hex()}, + "0x2E": {"len": len(trig), "hex": trig.hex()}, + "0x1A": {"len": len(setup), "hex": setup.hex()}} + plan = plan_setup_push(prefs, trig, setup, name) + out = plan.describe() + out["unit"] = {"serial": info.serial, "firmware_line": info.firmware_line} + out["reads"] = reads + print(json.dumps(out, indent=1)) + finally: + mm.close() + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 6541355..3694f0e 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -1782,6 +1782,21 @@ Do **not** retune `_GEO_LSB_IPS` — this is corroboration, not a correction. - **Scheduler / call-home writes.** `callhome.MMB` is a file too, so it may go through the same `0xDA` + block-write shape with a different target name. +### Write-plan dry run on a second unit and firmware line (2026-10-22) + +2026-10-22 — UM20147 (11.0BD) block sizes equal UM12947's (11.0CB): `0x1A` +content 2092 B, `0x08` 90 B, `0x2E` 28 B, `0x2C` 126 B (all CRCs good where a +CRC applies). Its dry-run plans (`bridges/mm_dry_run.py`) have the same SUB +order, offsets and data lengths as THOR's frames from UM12947: `0x96` / `0x97` +(offset `0xFFFF`, 0 B); `0x7E` @ `0x007E` 126 B + `0x7F`; `0xDA` @ `0x0100` 256 B, +`0x68` @ `0x005A` 88 B, `0x73`, `0x82` @ `0x001C` 28 B, `0x83`, `0x71` @ `0x082C` +2090 B, `0x72`. So THOR's write offsets apply to both firmware lines **as far +as size goes** (measured, one unit each; **nothing sent** -- reads only, the +opcode gate refused every write SUB). Not shown: that 11.0BD *accepts* these +frames. The call-home on/off plans differ in exactly one data byte (`[5]`); +the setup-rewrite `0x71` data equals the unit's `0x1A` content `[3:2090]` behind +three zero bytes. + ### ✅ `0xDA` CREATES setup files (confirmed on the device, 2026-09-24) `TEST1.mmb` did not exist on the unit before the push. Afterwards it is -- 2.54.1 From 0e46f3d83f1b3efb968699695d9bba57746b4e1e Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:47:07 -0400 Subject: [PATCH 059/223] fix(micromate): the call-home plan warns when it leaves THOR's observed values Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/writes.py | 20 +++++++++++++++++--- tests/test_micromate_writes.py | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/micromate/writes.py b/micromate/writes.py index 7ce9482..bbf92f2 100644 --- a/micromate/writes.py +++ b/micromate/writes.py @@ -54,10 +54,12 @@ class WriteStep: class WritePlan: action: str steps: Tuple[WriteStep, ...] + warnings: Tuple[str, ...] = () def __post_init__(self) -> None: # Copy: a caller's list must not be able to add a step after validation. object.__setattr__(self, "steps", tuple(self.steps)) + object.__setattr__(self, "warnings", tuple(self.warnings)) for s in self.steps: if s.sub in CROSS_SERIES_COLLISIONS: raise OpcodeRefused( @@ -74,6 +76,7 @@ class WritePlan: def describe(self) -> dict: return {"action": self.action, "sends_nothing": True, + "warnings": list(self.warnings), "steps": [s.describe() for s in self.steps]} @@ -88,8 +91,11 @@ def plan_stop_monitoring() -> WritePlan: def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: """Read `0x2C`, flip bit 0 of content[5], send the rest back byte for byte. - `[5]` reads 0x05 enabled / 0x04 disabled; bit 2 is set in both, so only - bit 0 is the enable. `[118:120]` is unit-maintained and THOR echoes it. + Bit 0 of `[5]` is the enable. 🔶 UM12947 (THOR's unit) read 0x05 enabled / + 0x04 disabled, bit 2 set in both; UM20147 reads 0x01 (measured, phase-2 dry + run). So on UM20147 "off" writes 0x00, a value no capture shows being + written: the target value there is unobserved, and the plan's `warnings` + say so. `[118:120]` is unit-maintained and THOR echoes it. """ if len(call_home) != _CALL_HOME_LEN: raise ValueError(f"call-home content must be {_CALL_HOME_LEN} B " @@ -97,10 +103,18 @@ def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: b5 = (call_home[5] | 0x01) if enabled else (call_home[5] & 0xFE) data = call_home[:5] + bytes([b5]) + call_home[6:] what = "call-home " + ("enable" if enabled else "disable") + start = call_home[5] + warnings = [] + if start not in (0x04, 0x05) or b5 not in (0x04, 0x05): + warnings.append(f"content[5] 0x{start:02X} -> 0x{b5:02X}: THOR was only ever " + "seen writing 0x04/0x05 (UM12947); this value is unobserved") + if b5 == start: + warnings.append(f"the unit is already call-home {'enabled' if enabled else 'disabled'}" + " -- this write changes nothing") return WritePlan(what, ( WriteStep(0x7E, 0x007E, data, what="call-home config write"), WriteStep(0x7F, _CONFIRM, what="call-home config confirm"), - )) + ), tuple(warnings)) def _checked(block: bytes, size: int, label: str) -> bytes: diff --git a/tests/test_micromate_writes.py b/tests/test_micromate_writes.py index 5beb3bc..76125d7 100644 --- a/tests/test_micromate_writes.py +++ b/tests/test_micromate_writes.py @@ -187,3 +187,28 @@ def test_steps_cannot_be_reassigned(): plan = plan_stop_monitoring() with pytest.raises(dataclasses.FrozenInstanceError): plan.steps = () + + +# ── warnings: where a plan leaves THOR's observed values ────────────────────── + +def test_call_home_off_from_an_unobserved_start_value_carries_a_warning(): + r = bytearray(_call_home_reads()[0]) + r[5] = 0x01 # UM20147 reads 0x01, not THOR's 0x04/0x05 + plan = plan_call_home_enabled(bytes(r), False) + assert any("unobserved" in w and "0x01 -> 0x00" in w for w in plan.warnings) + assert plan.describe()["warnings"] and plan.describe()["warnings"] == list(plan.warnings) + + +def test_call_home_on_when_already_on_says_it_changes_nothing(): + r = next(x for x in _call_home_reads() if x[5] == 0x05) + plan = plan_call_home_enabled(r, True) + assert any("changes nothing" in w and "enabled" in w for w in plan.warnings) + + +@pytest.mark.parametrize("read_idx,enabled", [(0, True), (1, False)]) +def test_thors_own_call_home_writes_carry_no_unobserved_warning(read_idx, enabled): + r = _call_home_reads()[read_idx] + plan = plan_call_home_enabled(r, enabled) + assert not any("unobserved" in w for w in plan.warnings) + assert plan.warnings == () + assert plan_stop_monitoring().describe()["warnings"] == [] -- 2.54.1 From b7b054aee95a06b240d3d7558da2e1f16d7fbebe Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:47:25 -0400 Subject: [PATCH 060/223] fix(micromate): the gate refuses an uncatalogued SUB whatever it is told Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/opcodes.py | 17 ++++++++++------- tests/test_micromate_opcodes.py | 8 +++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/micromate/opcodes.py b/micromate/opcodes.py index 74ee7c1..820bf90 100644 --- a/micromate/opcodes.py +++ b/micromate/opcodes.py @@ -39,7 +39,9 @@ _WRITE_SUBS: Dict[int, str] = { 0xDA: "setup push: file name", } -# Same bytes, opposite consequence on the other series. Never transmitted on +# Same SUB, opposite consequence on the other series (not the same bytes: +# Series III's CONFIRM ERASE carries offset 0x0000 and token 0xFE, THOR's 0xA2 +# carries offset 0xFFFF). Never transmitted on # Series IV, allowed or not: if a Series-III unit is at the address (a moved # modem, a stale IP), it would execute the other meaning. Lifting an entry is # a spec change, not a parameter. @@ -87,17 +89,18 @@ def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> No """Raise OpcodeRefused unless `sub` may go on the wire. Precedence: (1) a cross-series collision is refused always; (2) a - catalogued write is refused unless in `allowed_writes`; (3) a SUB in - neither READ_SUBS nor `allowed_writes` is unknown and refused. + SUB in neither READ_SUBS nor WRITE_SUBS is unknown and refused whatever + `allowed_writes` says; (3) a catalogued write is refused unless in + `allowed_writes`. """ if sub in CROSS_SERIES_COLLISIONS: raise OpcodeRefused( f"refused to transmit SUB 0x{sub:02X}: {CROSS_SERIES_COLLISIONS[sub]}") + if sub not in READ_SUBS and sub not in WRITE_SUBS: + raise OpcodeRefused( + f"refused to transmit SUB 0x{sub:02X}: unknown opcode -- not in " + "micromate.opcodes; catalogue it first (allowing it does not help)") if sub in WRITE_SUBS and sub not in allowed_writes: raise OpcodeRefused( f"refused to transmit SUB 0x{sub:02X} ({WRITE_SUBS[sub]}): writes are " "not enabled on this connection") - if sub not in READ_SUBS and sub not in allowed_writes: - raise OpcodeRefused( - f"refused to transmit SUB 0x{sub:02X}: unknown opcode -- not in " - "micromate.opcodes; catalogue it first") diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py index 336429f..b35edfe 100644 --- a/tests/test_micromate_opcodes.py +++ b/tests/test_micromate_opcodes.py @@ -15,7 +15,8 @@ from micromate.opcodes import ( # noqa: E4 ) from test_micromate_protocol import frame, proto # noqa: E402 -# THOR's captured end-call-home frame -- byte-identical to Series III's CONFIRM ERASE. +# THOR's captured end-call-home frame. Same SUB as Series III's CONFIRM ERASE, not the +# same bytes (S3 carries offset 0x0000 and token 0xFE; this carries offset 0xFFFF). A2_WIRE = bytes.fromhex("4102101000a200ffff00000000000000000000b003") @@ -120,3 +121,8 @@ def test_a_bytearray_frame_is_checked_and_written_as_the_same_bytes(): p, t = proto([]) p._send(bytearray(build_request(0x5B, 0x0030))) assert t.written == [build_request(0x5B, 0x0030)] + + +def test_an_uncatalogued_sub_is_refused_even_when_explicitly_allowed(): + with pytest.raises(OpcodeRefused): + check_transmit(0xEE, frozenset({0xEE})) -- 2.54.1 From 137aa699c7961c7cb410104e2d422383c3da7484 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:47:49 -0400 Subject: [PATCH 061/223] fix(micromate): a plan step is immutable once validated; setup push checks each block's own header Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- bridges/mm_dry_run.py | 7 +++++ micromate/writes.py | 21 ++++++++++++++ tests/test_micromate_writes.py | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/bridges/mm_dry_run.py b/bridges/mm_dry_run.py index d803b32..4a491db 100644 --- a/bridges/mm_dry_run.py +++ b/bridges/mm_dry_run.py @@ -12,6 +12,13 @@ this connection, so nothing else can go out even by mistake. The JSON carries a `reads` block (length of each block read, and for setup-rewrite the blocks themselves in hex) so the plan can be checked against what the unit actually said. + +⚠ `0x1A` reads the keypad's edit buffer live. A setup read taken while someone +is in the unit's menu includes their unsaved edits, and pushing that plan would +commit them. + +⚠ The setup-rewrite JSON embeds the unit's whole `0x1A` block (job number, +notes), so do not paste it anywhere public. """ from __future__ import annotations diff --git a/micromate/writes.py b/micromate/writes.py index bbf92f2..c081c4d 100644 --- a/micromate/writes.py +++ b/micromate/writes.py @@ -36,6 +36,17 @@ class WriteStep: params: bytes = field(default=bytes(10)) what: str = "" + def __post_init__(self) -> None: + # Freeze the bytes: a caller's bytearray must not change a validated step. + object.__setattr__(self, "data", bytes(self.data)) + object.__setattr__(self, "params", bytes(self.params)) + if len(self.params) != 10: + raise ValueError(f"params must be 10 bytes, got {len(self.params)}") + if not 0 <= self.offset <= 0xFFFF: + raise ValueError(f"offset 0x{self.offset:X} does not fit a uint16") + if not 0 <= self.sub <= 0xFF: + raise ValueError(f"SUB {self.sub!r} does not fit a byte") + @property def ack_sub(self) -> int: return 0xFF - self.sub @@ -61,6 +72,8 @@ class WritePlan: object.__setattr__(self, "steps", tuple(self.steps)) object.__setattr__(self, "warnings", tuple(self.warnings)) for s in self.steps: + if not isinstance(s, WriteStep): + raise TypeError(f"a plan holds WriteStep objects, got {type(s).__name__}") if s.sub in CROSS_SERIES_COLLISIONS: raise OpcodeRefused( f"a plan cannot hold SUB 0x{s.sub:02X}: {CROSS_SERIES_COLLISIONS[s.sub]}") @@ -121,6 +134,10 @@ def _checked(block: bytes, size: int, label: str) -> bytes: if len(block) != size: raise ValueError(f"{label} block size {len(block)} B is not the {size} B " "THOR's offset was observed at -- refusing to guess") + if int.from_bytes(block[0:2], "big") != size - 2: + raise ValueError(f"{label} block's own header says " + f"{int.from_bytes(block[0:2], 'big')}, expected {size - 2} -- " + "not the block it claims to be") if not crc_ok(block): raise ValueError(f"{label} block failed its checksum -- refusing to write a " "corrupt read back to the unit") @@ -134,6 +151,10 @@ def plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str) -> Wr [0:3] zeroed; the unit recomputes the CRCs, so 0x68 and 0x71 drop the CRC slot and 0x82 sends it zeroed -- exactly THOR's frames. + ⚠ `0x1A` reads the keypad's edit buffer live. A setup read taken while + someone is in the unit's menu includes their unsaved edits, and pushing + this plan would commit them. + The name goes out exactly as given. `MicromateClient.get_active_setup()` strips whitespace, so a setup name with leading or trailing spaces would not round-trip through it; phase 5 decides whether to take the unstripped diff --git a/tests/test_micromate_writes.py b/tests/test_micromate_writes.py index 76125d7..5e475d4 100644 --- a/tests/test_micromate_writes.py +++ b/tests/test_micromate_writes.py @@ -212,3 +212,56 @@ def test_thors_own_call_home_writes_carry_no_unobserved_warning(read_idx, enable assert not any("unobserved" in w for w in plan.warnings) assert plan.warnings == () assert plan_stop_monitoring().describe()["warnings"] == [] + + +# ── a step is immutable after validation ────────────────────────────────────── + +def test_a_step_built_from_a_bytearray_cannot_change_afterwards(): + data, params = bytearray(b"\x01\x02\x03"), bytearray(10) + step = WriteStep(0x7E, 0x007E, data, params) + plan = WritePlan("x", (step,)) + frame, desc = step.frame, plan.describe() + data[0] = 0xFF + params[0] = 0xFF + assert isinstance(step.data, bytes) and isinstance(step.params, bytes) + assert step.frame == frame and plan.describe() == desc + + +@pytest.mark.parametrize("kw", [{"params": bytes(9)}, {"params": bytes(11)}, + {"offset": 0x10000}, {"offset": -1}, + {"sub": 0x100}, {"sub": -1}]) +def test_a_malformed_step_is_refused_at_construction(kw): + args = {"sub": 0x96, "offset": 0xFFFF} + args.update(kw) + with pytest.raises(ValueError): + WriteStep(**args) + + +def test_a_plan_refuses_a_step_that_is_not_a_writestep(): + with pytest.raises(TypeError, match="WriteStep"): + WritePlan("x", (object(),)) + with pytest.raises(TypeError, match="WriteStep"): + WritePlan("x", ((0x96, 0xFFFF),)) + + +def _multi_step_plans(): + reads, _ = _first_push("setup-push-multiday") + return [plan_setup_push(reads[0x08], reads[0x2E], reads[0x1A], "x.mmb"), + plan_call_home_enabled(_call_home_reads()[0], True)] + + +@pytest.mark.parametrize("i", [0, 1]) +def test_describe_frames_match_frames_for_every_step(i): + plan = _multi_step_plans()[i] + d, frames = plan.describe()["steps"], plan.frames() + assert len(d) == len(frames) > 1 + for j, f in enumerate(frames): + assert d[j]["frame"] == f.hex() + + +def test_setup_push_refuses_a_block_whose_own_length_header_is_wrong(): + reads, _ = _first_push("setup-push-multiday") + bad = bytearray(reads[0x1A]) + bad[0:2] = (int.from_bytes(bad[0:2], "big") + 1).to_bytes(2, "big") + with pytest.raises(ValueError, match="header"): + plan_setup_push(reads[0x08], reads[0x2E], bytes(bad), "x.mmb") -- 2.54.1 From 93349ed0405df4f412995b5bef214494a7aa7d92 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:48:04 -0400 Subject: [PATCH 062/223] test(micromate): a checksum landing on any of the four escape bytes is escaped Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/test_micromate_framing.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 2fe4396..3e72f81 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -444,12 +444,16 @@ def test_a_literal_0x10_in_data_round_trips(): assert _destuffed_payload(build_request(0x71, 0x082C, bytes(10), data))[16:] == data -def test_a_checksum_that_lands_on_an_escape_byte_is_escaped(): - # Pick the last data byte so SUM8 of the payload is exactly 0x03. +@pytest.mark.parametrize("target", [0x02, 0x03, 0x04, 0x10]) +def test_a_checksum_that_lands_on_an_escape_byte_is_escaped(target): + # Pick the last data byte so SUM8 of the payload is exactly `target`. If that + # byte is itself an escape byte the earlier bytes shift, but the last three + # on the wire stay DLE target ETX. head = bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + bytes(10) + b"\x01\x02" - last = (0x03 - sum(head)) & 0xFF + last = (target - sum(head)) & 0xFF f = build_request(0x7E, 0x007E, bytes(10), b"\x01\x02" + bytes([last])) - assert f[-3:] == bytes([DLE, 0x03, ETX]) + assert unstuff(f[2:-1])[-1] == target # the checksum byte itself + assert f[-3:] == bytes([DLE, target, ETX]) def test_without_data_the_frame_is_unchanged(): -- 2.54.1 From f47b908a274db7ae105ddb32dcd3ba7cea791542 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:48:20 -0400 Subject: [PATCH 063/223] fix(micromate): fixture metadata separates the measured firmware line from the version Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- scratch/mm_write_fixtures.py | 6 +++++- .../fixtures/micromate-writes/call-home-enable-disable.json | 3 ++- tests/fixtures/micromate-writes/monitor-start-stop.json | 3 ++- tests/fixtures/micromate-writes/setup-push-multiday.json | 3 ++- tests/fixtures/micromate-writes/setup-push-new-test1.json | 3 ++- .../micromate-writes/setup-push-overwrite-test1.json | 3 ++- .../fixtures/micromate-writes/setup-push-pull-schedule.json | 3 ++- .../micromate-writes/setup-push-read-scheduler.json | 3 ++- tests/test_micromate_write_fixtures.py | 2 ++ 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/scratch/mm_write_fixtures.py b/scratch/mm_write_fixtures.py index d68db90..c8bcc02 100755 --- a/scratch/mm_write_fixtures.py +++ b/scratch/mm_write_fixtures.py @@ -73,6 +73,9 @@ def main() -> None: if len(reqs) != len(rsps): raise SystemExit(f"{slug}: {len(reqs)} requests vs {len(rsps)} responses") exchanges = [] + lines = {rp.firmware_line for rp in rsps} + if len(lines) != 1 or lines & {"unknown"}: + raise SystemExit(f"{slug}: responses report firmware lines {sorted(lines)}") for rq, rp in zip(reqs, rsps): sub = request_sub(rq) if rp.sub != 0xFF - sub or not rp.checksum_valid: @@ -83,7 +86,8 @@ def main() -> None: "source": str(bw.relative_to(REPO)), "source_sha256": {"bw": hashlib.sha256(bw.read_bytes()).hexdigest(), "s3": hashlib.sha256(s3.read_bytes()).hexdigest()}, - "unit": "UM12947", "firmware_line": "11.0CB", + "unit": "UM12947", "firmware_version": "11.0CB", + "firmware_line": lines.pop(), "exchanges": exchanges, } (OUT / f"{slug}.json").write_text(json.dumps(doc, indent=1) + "\n") diff --git a/tests/fixtures/micromate-writes/call-home-enable-disable.json b/tests/fixtures/micromate-writes/call-home-enable-disable.json index 13a90c2..8e18a40 100644 --- a/tests/fixtures/micromate-writes/call-home-enable-disable.json +++ b/tests/fixtures/micromate-writes/call-home-enable-disable.json @@ -5,7 +5,8 @@ "s3": "5b15f219ff58a64e61c8b2123034dfcc766465534479a61c1447ea6d66ffd878" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/monitor-start-stop.json b/tests/fixtures/micromate-writes/monitor-start-stop.json index 32d41c2..95701cf 100644 --- a/tests/fixtures/micromate-writes/monitor-start-stop.json +++ b/tests/fixtures/micromate-writes/monitor-start-stop.json @@ -5,7 +5,8 @@ "s3": "dd78a64ac15d1d93492d0db7e3bafceddc1533ad0b6e7f8a5d19bffd83ecce66" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/setup-push-multiday.json b/tests/fixtures/micromate-writes/setup-push-multiday.json index 72d31a8..5094864 100644 --- a/tests/fixtures/micromate-writes/setup-push-multiday.json +++ b/tests/fixtures/micromate-writes/setup-push-multiday.json @@ -5,7 +5,8 @@ "s3": "f26370a1bc880dfb08afdf1f3199f9f2811f49bc43ca9d4c9d3dc2b3cabfdbef" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/setup-push-new-test1.json b/tests/fixtures/micromate-writes/setup-push-new-test1.json index 06f33bc..3c2dfba 100644 --- a/tests/fixtures/micromate-writes/setup-push-new-test1.json +++ b/tests/fixtures/micromate-writes/setup-push-new-test1.json @@ -5,7 +5,8 @@ "s3": "0fc85cd78df4002d97d9e9a1e6e94d9c1d99bc22935e3b2d1e72a552032c1b84" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json b/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json index d9c199c..5ff168e 100644 --- a/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json +++ b/tests/fixtures/micromate-writes/setup-push-overwrite-test1.json @@ -5,7 +5,8 @@ "s3": "d35497ca0ccf554e7bacd464723f3db1c052e2768785ef00b3689784b6e346bd" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/setup-push-pull-schedule.json b/tests/fixtures/micromate-writes/setup-push-pull-schedule.json index be2e400..4571194 100644 --- a/tests/fixtures/micromate-writes/setup-push-pull-schedule.json +++ b/tests/fixtures/micromate-writes/setup-push-pull-schedule.json @@ -5,7 +5,8 @@ "s3": "d49a4fd199f5a32df2fc2ccdaaf27aaff9a11804dd54a2250efbc0a9e636d786" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/fixtures/micromate-writes/setup-push-read-scheduler.json b/tests/fixtures/micromate-writes/setup-push-read-scheduler.json index 871d4bc..fbcfb5d 100644 --- a/tests/fixtures/micromate-writes/setup-push-read-scheduler.json +++ b/tests/fixtures/micromate-writes/setup-push-read-scheduler.json @@ -5,7 +5,8 @@ "s3": "4ef5db0c8b804ac646c61151366e52df3bda1d96a492d4b420cb8fe6934dcedb" }, "unit": "UM12947", - "firmware_line": "11.0CB", + "firmware_version": "11.0CB", + "firmware_line": "blastware", "exchanges": [ { "sub": 91, diff --git a/tests/test_micromate_write_fixtures.py b/tests/test_micromate_write_fixtures.py index c0e1230..bd13774 100644 --- a/tests/test_micromate_write_fixtures.py +++ b/tests/test_micromate_write_fixtures.py @@ -27,6 +27,8 @@ def test_all_seven_sessions_are_present(): def test_every_request_is_a_valid_frame_and_every_response_answers_it(path): doc = json.loads(path.read_text()) assert doc["source_sha256"]["bw"] and doc["exchanges"] + assert doc["firmware_line"] in {"blastware", "thor"} # measured from response flags + assert doc["firmware_version"] # the 09-30 audits' "11.0CB" for ex in doc["exchanges"]: wire = bytes.fromhex(ex["request"]) assert request_sub(wire) == ex["sub"] -- 2.54.1 From 36b6fada3fa04b89a5157223804156db99bf8df7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:48:35 -0400 Subject: [PATCH 064/223] docs: say exactly what the phase-2 dry run and gate showed Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 5 ++++- docs/micromate_protocol_reference.md | 21 ++++++++++++++++++--- micromate/protocol.py | 3 ++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 58a4cac..e8f6dea 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,10 @@ Read this first when picking the project back up. reads (run on UM20147: sizes equal UM12947's). `MicromateProtocol._send` refuses every write opcode unless explicitly allowed, and `0xA2` always, so "no command has ever been originated against a unit" is still true and is now - enforced in code. + enforced in `micromate/` (its `_send` gate); the Series-3 `minimateplus` + stack and raw-socket bench bridges are outside it. The reproduction's + breadth is one distinct input per block (the five pushes share the same name, + prefs and trigger block). - **✅ `micromate/` HAS a live client (2026-10-02).** `framing.py`, `protocol.py`, `client.py` + models, **119 tests**, mirroring the `minimateplus/` stack and reusing its `transport.py` unchanged. Connect over diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 3694f0e..27b438e 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -1784,19 +1784,34 @@ Do **not** retune `_GEO_LSB_IPS` — this is corroboration, not a correction. ### Write-plan dry run on a second unit and firmware line (2026-10-22) -2026-10-22 — UM20147 (11.0BD) block sizes equal UM12947's (11.0CB): `0x1A` +Firmware, stated as line and version separately. UM20147: Thor firmware line +(flags `0x03`, measured 2026-10-22), version 11.0BD per the 2026-09-30 check; +UM12947: Blastware firmware line (flags `0xC5` in all 152 responses of the +seven write sessions), version 11.0CB. + +2026-10-22 — UM20147 block sizes equal UM12947's: `0x1A` content 2092 B, `0x08` 90 B, `0x2E` 28 B, `0x2C` 126 B (all CRCs good where a CRC applies). Its dry-run plans (`bridges/mm_dry_run.py`) have the same SUB order, offsets and data lengths as THOR's frames from UM12947: `0x96` / `0x97` (offset `0xFFFF`, 0 B); `0x7E` @ `0x007E` 126 B + `0x7F`; `0xDA` @ `0x0100` 256 B, `0x68` @ `0x005A` 88 B, `0x73`, `0x82` @ `0x001C` 28 B, `0x83`, `0x71` @ `0x082C` 2090 B, `0x72`. So THOR's write offsets apply to both firmware lines **as far -as size goes** (measured, one unit each; **nothing sent** -- reads only, the -opcode gate refused every write SUB). Not shown: that 11.0BD *accepts* these +as size goes** (measured, one unit each; **nothing sent** -- reads only; the +opcode gate was armed throughout and refused nothing, because no write was +attempted). Not shown: that 11.0BD *accepts* these frames. The call-home on/off plans differ in exactly one data byte (`[5]`); the setup-rewrite `0x71` data equals the unit's `0x1A` content `[3:2090]` behind three zero bytes. +🔶 **Unobserved:** UM20147 call-home `content[5]` reads `0x01` (THOR's UM12947: +`0x04`/`0x05`). Our "off" plan writes `0x00`, which no capture shows being +written. Unobserved; settle at the phase-4 bench. + +Breadth of the reproduction (measured): across the five pushes, the `0xDA`, +`0x68` and `0x82` inputs are byte-identical (one distinct name, prefs and +trigger block), and the three no-edit `0x71` reproductions are the same frame. +So each block was reproduced from one distinct input, not five. + ### ✅ `0xDA` CREATES setup files (confirmed on the device, 2026-09-24) `TEST1.mmb` did not exist on the unit before the push. Afterwards it is diff --git a/micromate/protocol.py b/micromate/protocol.py index e958225..8fb22fd 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -4,7 +4,8 @@ protocol.py — one method per Micromate (Series IV) wire command. Returns raw payload bytes. Interpretation belongs in ``client.py``; this layer knows frames, offsets and sequencing, and nothing about what a field means. -Scope: **reads only on the wire, enforced.** Every outgoing frame passes +Scope: **reads only on the wire, enforced** (in this package: the Series-3 +`minimateplus` stack and raw-socket bench bridges are outside the gate). Every outgoing frame passes `micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused unless this connection was constructed with it in `allowed_writes` (nothing in the codebase does so yet), and `0xA2` -- CONFIRM ERASE on Series III -- is -- 2.54.1 From 75b76949836167760c4fafdd782c63865ab76784 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 22 Oct 2026 17:48:52 -0400 Subject: [PATCH 065/223] docs(spec): phase-3 write preconditions and the measured Series-3 verdict Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 53 ++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index e7cea2c..4e87e19 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -390,6 +390,27 @@ Each safety piece arrives with its first real use, so nothing sits untested. this phase), and `0xA2` is refused always. 3. **Start/stop monitoring** (row 7): the first live write, at the bench. Brings the identity check, the audit table and the read-back framework. + - **Preconditions from the phase-2 final review (2026-10-22):** + - **Write permission is scoped to one call, not a connection.** + `MicromateProtocol.execute(plan)` is the only write path: it transmits + exactly that plan's frames and nothing else. The connection's own + `allowed_writes` stays empty -- a held `Series4Session` lives for + minutes, and a grant made at call-up would outlive the request. + - **A code-reviewed ceiling** in `micromate/opcodes.py` lists the write + SUBs any code may transmit: `{0x96, 0x97}` in this phase, each later + phase adding its own. Delete (`0xA8`/`0xAA`), raw file writes + (`0x8D`/`0x8E` -- they could reach the modem settings) and `0xA2` are + enabled only by a spec change. + - **A write is never retried.** `DeviceAccess._dispatch`'s retry-once + refuses change-tier operations structurally, not by comment. + - **Build the plan inside the unit lock, on the same line, right before + sending.** A plan returned by an earlier dry run is never transmitted; + optionally the dry run returns a digest the live call must echo. + - **Read state first** (`0x49` for start/stop, `0x2C` for call-home) and + decide on purpose whether "already in that state" is skipped or is the + experiment. + - **Refuse writes unless this connection's responses carried Micromate + flags** (0xC5/0x03), alongside the serial identity check. 4. **Call-home enable/disable** (row 9). 5. **Setup push** (row 10): one field first, then several. @@ -442,8 +463,22 @@ plan's scratch ledger. None blocks 1a; the phase each one matters to is named. a hostname vs an IP, or `/dev/serial/by-id/...` vs `/dev/ttyACM0`, gets two locks for one link. - **A serial-less request to an UNHELD Micromate still runs Series-3 bytes.** - The guard only knows about lines SFM holds. This is the phase-2 opcode - guard's job. + The guard only knows about lines SFM holds. ~~This is the phase-2 opcode + guard's job.~~ + **Measured by the phase-2 final review (2026-10-22):** the phase-2 gate + covers `micromate/` only and cannot see this traffic. Only the three blind + stop tools (`/device/stop_monitoring_blind`, `_slow_drip`, `_spam`) send a + write before any parsed reply. Every other legacy write route needs a + parsed `0xA4` POLL reply, and `S3FrameParser` never yields one from + Micromate bytes (364 real responses → 29 spurious frames, none `0xA4`). So + erase, config and call-home writes cannot reach a Micromate. Worst case + (inferred): an unheld Micromate at the address stops monitoring, via the + Series-3 `0x97` at offset 0x0000, never sent to one. The hazard is identity + (a moved modem or a stale IP), not series. **Brian's decision** (the legacy + routes are bound by 'behave exactly as today'): accept until the legacy path + retires after 1c, then require `serial` on the blind tools; or, as an + interim, refuse a blind tool when SFM's DB last saw a `UM` serial at that + host. - **`tcp_port` coercion mismatch.** The guard parses with `int()`, pydantic coerces more loosely (`"9034.0"`), so such a request passes the guard unchecked. Parse with pydantic's own int coercion, or fail closed. @@ -488,6 +523,20 @@ matters to is named. before the database lookup finds it (the lookup is on the SDM side, after the device layer). Wasted transfer, not bad data (1c). +## Left open by the phase 2 review (2026-10-22) + +- **`plan_setup_push` takes any name (phase 5).** It is not tied to the `0x41` + read, and it does not refuse `factory.MMB` or a non-active target, which the + spec requires; the name's case varies (`test2.MMB` vs `test2.mmb`). +- **Stripped-name caveat.** `get_active_setup()` strips whitespace, so a name + with leading or trailing spaces does not round-trip. +- **Bench questions.** Whether a Micromate honours offset 0x0000 on + `0x96`/`0x97`, accepts a no-op call-home write, or accepts 0x00 at `[5]`. + Settle all three at the bench. +- **Phase-5 lead (inferred).** Comparing `0x1A` against the active `.MMB` read + through `0x94`/`0x48` may detect unsaved keypad edits, which would undercut + "can't be detected from the wire". One bench check. + ## Table 2: to be added later (both series) | area | item | -- 2.54.1 From c6f7b5c0315c5148f1aad71001561dfcc6f0d624 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 00:20:08 -0400 Subject: [PATCH 066/223] docs(spec): the ring cool-down is test-first -- bench procedure for the ring path and retries Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 4e87e19..d8e91ed 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -372,12 +372,15 @@ Each safety piece arrives with its first real use, so nothing sits untested. from THOR), with THOR's 1,024-byte chunks. - 1c. **The webapp:** serial + address, and the same read panels for both series. - - **HARD PREREQUISITE:** before any poller or webapp sends `serial`, add a - per-address cool-down after a RADIO RING: call-ups to that address answer - 503 + `Retry-After` until it expires, and `POST /device/hangup` clears it. - The length must come from the unit's measured call-home retry timing (a - bench test). Without it a poller can re-grab the modem's single TCP - session through every retry, and the call never reaches THOR. + - ~~**HARD PREREQUISITE:** before any poller or webapp sends `serial`, add a + per-address cool-down after a RADIO RING~~ -- **changed 2026-10-23 + (Brian): test first, build only if needed.** Before any poller or webapp + sends `serial`, run the ring-path bench test under *Open questions this + design leaves for the bench*. If Run B shows a poller keeps the call + from reaching THOR, add the per-address cool-down: call-ups to that + address answer 503 + `Retry-After` until it expires, and + `POST /device/hangup` clears it, with its length taken from Run A. If + THOR gets the call anyway, no cool-down is needed. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. (2026-10-22) "Dry run" in this phase means the **write plan**: the exact @@ -598,6 +601,32 @@ Open questions: ## Open questions this design leaves for the bench +- **Ring path and retries: does a Micromate's call-home reach THOR when SFM + holds its line?** (Test designed 2026-10-23; decides whether 1c needs a + cool-down.) + - *Already measured (10-14):* with THOR holding the line, the ring arrived on + THOR's own outbound connection (`TcpClientSystemNet ... RADIO RING IS + RECEIVED FROM IP:...:9034`), so the modem did not divert it to the + destination. Unmeasured: the same with SFM as the holder, and what the + unit does after the holder releases. + - *Known from the firmware strings:* "three attempts and it's over". + 🔶 Inferred: 60 s between attempts (`0x2C` content `[120:122]` = `00 3c`, + Series III's "time between retries" offset), and about 21 s of ringing per + attempt (10-14 capture). + - *Setup:* a bench Micromate on a modem whose destination is the office + THOR-ACH server, and a unit THOR is not otherwise watching. SFM runs on a + test port with a scratch DB. Keep THOR's ACH log open. + - **Run A, one call-up:** SFM calls the unit up and holds the line (any + serial-named read). Trigger a call-home on the unit. Record: + - whether SFM logs the RADIO RING and hangs up, with the time; + - whether and when THOR starts a session (its ACH log); + - the number and spacing of rings and attempts. + - **Run B, a poller:** as A, but a script requests the unit's status every + ~10 s throughout. If THOR still gets the call, no cool-down is needed; if + the poller keeps the call from reaching THOR, build it, sized from Run A. + - *Also settles:* whether the modem routes a call-home to its destination + on its own, in which case SFM never sees a ring and THOR gets the call + while SFM is still connected. - The ack for start/stop when the unit is already in that state. - The offset rule, and whether `0x68`/`0x82` are required, for the setup push. - Whether the device ever refuses a write while monitoring. Only THOR's policy -- 2.54.1 From 144d3779a1d60be15a446387259b76176ff60252 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 00:47:12 -0400 Subject: [PATCH 067/223] docs(plan): phase 3 -- start/stop monitoring, the first live write, through the safety layer Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../plans/2026-10-23-sfm-phase3-start-stop.md | 1013 +++++++++++++++++ 1 file changed, 1013 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-23-sfm-phase3-start-stop.md diff --git a/docs/superpowers/plans/2026-10-23-sfm-phase3-start-stop.md b/docs/superpowers/plans/2026-10-23-sfm-phase3-start-stop.md new file mode 100644 index 0000000..75c5241 --- /dev/null +++ b/docs/superpowers/plans/2026-10-23-sfm-phase3-start-stop.md @@ -0,0 +1,1013 @@ +# Phase 3: start / stop monitoring, the first live write — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Task 7 is not for a subagent**: the controller runs it at the bench, with Brian approving the send. + +**Goal:** Start and stop monitoring by serial, for both series, through the safety layer. The layer covers: +- an identity check right before the write; +- the unit's state, read first; +- a dry run that returns the exact frames; +- an audit row for every attempt; +- a read-back that decides success; +- never a retried write. + +Then make the project's first live send to a unit (UM20147), with Brian approving it at the bench. + +**Architecture:** + +- **Series 4.** `MicromateProtocol.execute(plan)` becomes the only write path. + - It transmits exactly a `WritePlan`'s frames, granting permission for that call alone. + - It refuses any plan beyond a code-reviewed ceiling, `ENABLEABLE_WRITES = {0x96, 0x97}`. + - It refuses on a connection whose replies did not carry Micromate flags. +- **The change operation**, one per series: + 1. re-reads the serial; + 2. reads the run state, `0x49` on Series 4 and `0x1C` on Series 3; + 3. skips or refuses as appropriate; + 4. audits the attempt; + 5. sends; + 6. polls the state until it matches or a window expires; + 7. audits the result. + + It returns a `ChangeResult`. +- **No retry.** `DeviceAccess` runs change operations with no retry of any kind. +- **Audit.** The table lives in SDM (`device_commands` in SeismoDb). The device side writes to it through an injected sink, so `sfm/device_access/` still imports no DB. +- **Endpoints.** The existing `POST /device/monitor/start` and `/stop` gain `serial`, `dry_run`, `even_if_already` and `caller`. Without `serial` they behave exactly as today. + +**Tech Stack:** Python 3, FastAPI, pytest, SQLite. + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`, in particular: +- *The safety layer* (tiers, identity, read-back, audit table); +- *Series-4 write path* (dry run, start/stop row); +- *Testing → Bench* (the first-live-send protocol); +- **Build phases item 3, including its "Preconditions from the phase-2 final review" block**, which is binding. + +## Global Constraints + +- **Writes.** The only writes are `0x96`/`0x97`. + - On Series 4 they go through `MicromateProtocol.execute(plan)` only. + - On Series 3 they go through `MiniMateClient.start_monitoring()`/`stop_monitoring()`, which are unchanged. + - Nothing else may be transmitted that changes a unit. + - Tests use fakes and scripted transports only. **No task but Task 7 touches hardware**, and Task 7 sends only with Brian's explicit go-ahead in the conversation. +- **A write is never retried.** + - This covers the retry-once in `DeviceAccess._dispatch`, the TCP retry in `Series3Adapter._run`, and any loop. + - The structure must make retry impossible for a change operation. A comment saying so is not enough. +- **Identity before any write.** + - The serial is read from the unit immediately before the write: `0x15` on Series 4, `connect()` on Series 3. + - A mismatch means 409 and nothing is sent. +- **0xA2 is never sent.** + - The ceiling is `{0x96, 0x97}`. + - Raising it is a spec change. +- **The audit is mandatory.** + - A live change without an audit sink is refused (501), with nothing sent. + - Every live attempt, including a skip, gets one row. + - Dry runs are not audited: they send nothing. +- **Legacy routes are unchanged without `serial`.** + - The only permitted change: `baud` becomes `Optional[int] = Query(None)` with 38400 applied at the top of the legacy path. +- **Schema.** The `device_commands` table is additive (`CREATE TABLE IF NOT EXISTS`). At merge, the changelog must say "schema: new table, no migration, no backfill". +- **Tiers.** `sfm/device_access/` must not import `sfm.database`, `sfm.waveform_store` or `sfm.server`. +- **The suite.** Its 16 pre-existing failures stay exactly that set. +- **Branch.** Work on `feat/series4-sfm-parity`. Never commit to `main` or `dev`, do not edit `CHANGELOG.md`, and run `git push` after each commit. +- **Never move or modify `bridges/captures/`.** Port 8200 is another SFM. +- **Trailers.** Every commit message ends with: + ``` + Co-Authored-By: Claude Opus 5.5 + Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 + ``` + +## Review Focus + +These are the five things most likely to bite, each with the task that tests it: + +1. **A lost ack.** It must never cause a second send, whether through the held-line retry, the Series-3 cold-boot retry, or anything else (Tasks 4, 5). +2. **A different unit at the address**, for example after a modem moved. It must be refused before any write, on a fresh serial read rather than the call-up's cached serial (Tasks 4, 5). +3. **A unit that is calling home** (`0x49` = `0x03`). It is refused, with nothing sent (Task 4). +4. **A clean ack where the state never changes.** This also covers a sensor check that delays the change. It is reported as a failed change after the verify window, audited as `mismatch`, with every state value seen recorded (Tasks 4, 5). +5. **Write permission leaking.** + - After `execute()`, the same connection cannot send `0x96` again without another `execute()`. + - A plan holding `0x7E` (call-home) is refused by the ceiling. + - A connection that has seen no Micromate-flagged reply cannot execute anything (Task 1). + +--- + +## File map + +| file | change | +|---|---| +| `micromate/opcodes.py` | `ENABLEABLE_WRITES` | +| `micromate/protocol.py` | `execute(plan)`; `_send(frame, *, permit=)`; `_validate` records `last_flags` | +| `micromate/models.py` | `MicromateRunState` | +| `micromate/client.py` | `serial(refresh=)`; `read_run_state()` | +| `sfm/database.py` | `device_commands` table; `begin_device_command`, `finish_device_command`, `query_device_commands` | +| `sfm/audit.py` | **new**: `DbAudit`, the SDM sink | +| `sfm/device_access/models.py` | `ChangeResult` | +| `sfm/device_access/s4.py` | `s4_change_monitoring` | +| `sfm/device_access/s3.py` | `Series3Adapter.change_monitoring`; `_run(retry=)` | +| `sfm/device_access/access.py` | `start_monitoring`/`stop_monitoring`; `_dispatch(change=)`; `audit=`, `sleep=`, `verify_*` | +| `sfm/server.py` | serial branch on `/device/monitor/start` and `/stop`; guard paths; `GET /db/device_commands`; audit wiring | +| `tests/device_access_fakes.py` | run states, `execute`, Series-3 start/stop | +| tests | `test_micromate_execute.py`, `test_device_commands.py`, `test_device_access_change.py`, plus additions to `test_micromate_client.py` and `test_server_device_access.py` | + +--- + +### Task 1: `execute(plan)`, the ceiling and the flags check + +**Files:** +- Modify: `micromate/opcodes.py` +- Modify: `micromate/protocol.py` (`__init__`, `_validate`, `_send`, new `execute`, module docstring) +- Test: `tests/test_micromate_execute.py` (new) + +**Interfaces:** +- Produces: + - `ENABLEABLE_WRITES: frozenset` + - `MicromateProtocol.execute(plan: WritePlan) -> list[MicromateFrame]`, returning the ack frames + - `MicromateProtocol.last_flags: Optional[int]` + +- [ ] **Step 1: Write the failing tests.** Create `tests/test_micromate_execute.py`: + +```python +"""execute(plan): the only write path -- exact frames, one call's permission, a ceiling.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.framing import FLAGS_THOR, build_request # noqa: E402 +from micromate.opcodes import ENABLEABLE_WRITES, OpcodeRefused # noqa: E402 +from micromate.protocol import ACK_DATA_LEN, UnexpectedResponse # noqa: E402 +from micromate.writes import ( # noqa: E402 + plan_call_home_enabled, plan_start_monitoring, plan_stop_monitoring, +) +from test_micromate_protocol import frame, proto # noqa: E402 + +ACK_START = frame(0x69, bytes(ACK_DATA_LEN)) +POLL_RSP = frame(0xA4, bytes(48)) + + +def _ready(responses): + """A protocol that has already seen one Micromate-flagged reply (a POLL).""" + p, t = proto([POLL_RSP] + responses) + p.poll() + t.written.clear() + return p, t + + +def test_the_ceiling_is_start_and_stop_only(): + assert ENABLEABLE_WRITES == frozenset({0x96, 0x97}) + + +def test_execute_sends_exactly_the_plans_frame_and_returns_the_ack(): + p, t = _ready([ACK_START]) + acks = p.execute(plan_start_monitoring()) + assert t.written == [build_request(0x96, 0xFFFF)] + assert [a.sub for a in acks] == [0x69] + + +def test_permission_ends_with_the_call(): + p, t = _ready([ACK_START]) + p.execute(plan_start_monitoring()) + with pytest.raises(OpcodeRefused): + p._send(build_request(0x96, 0xFFFF)) + assert len(t.written) == 1 + + +def test_a_plan_beyond_the_ceiling_is_refused_and_nothing_is_sent(): + content = bytes(5) + b"\x05" + bytes(120) + p, t = _ready([]) + with pytest.raises(OpcodeRefused, match="ceiling"): + p.execute(plan_call_home_enabled(content, False)) + assert t.written == [] + + +def test_execute_refuses_before_any_micromate_reply_has_been_seen(): + p, t = proto([ACK_START]) + with pytest.raises(OpcodeRefused, match="Micromate"): + p.execute(plan_start_monitoring()) + assert t.written == [] + + +def test_execute_refuses_after_a_non_micromate_flags_reply(): + p, t = proto([frame(0xA4, bytes(48), flags=0x10), ACK_START], strict_checksums=False) + p.poll() + t.written.clear() + with pytest.raises(OpcodeRefused): + p.execute(plan_stop_monitoring()) + assert t.written == [] + + +def test_a_wrong_ack_sub_raises_after_one_send(): + p, t = _ready([frame(0x68, bytes(ACK_DATA_LEN))]) # stop's ack, for a start + with pytest.raises(UnexpectedResponse): + p.execute(plan_start_monitoring()) + assert len(t.written) == 1 + + +def test_thor_flags_are_accepted_too(): + p, t = proto([frame(0xA4, bytes(48), flags=FLAGS_THOR), frame(0x68, bytes(ACK_DATA_LEN))]) + p.poll() + p.execute(plan_stop_monitoring()) + assert t.written[-1] == build_request(0x97, 0xFFFF) +``` + + Before you write any code, make two checks: + - In `tests/test_micromate_protocol.py`, check that `ScriptedTransport` exposes `.written` as a list you can `.clear()`, and that `frame(..., flags=)` exists. + - Check that `micromate.framing` exports `FLAGS_THOR` and `FLAGS_BLASTWARE`. + + If either differs, adapt the helper calls only, and say so. + +- [ ] **Step 2: Run the tests and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_execute.py -q` + Expected: an ImportError on `ENABLEABLE_WRITES`. + +- [ ] **Step 3: Implement.** + + In `micromate/opcodes.py`, add after the tables: + +```python +# The write SUBs any code may transmit at all -- through MicromateProtocol.execute, +# one call at a time. Raising this is a spec change, reviewed like one: delete +# (0xA8/0xAA), raw file writes (0x8D/0x8E -- they could reach the modem +# settings) and 0xA2 never belong here without one. +ENABLEABLE_WRITES = frozenset({0x96, 0x97}) +``` + + In `micromate/protocol.py`: + - Imports: add `FLAGS_BLASTWARE` and `FLAGS_THOR` to the `from .framing import ...` line. Add `ENABLEABLE_WRITES` and `OpcodeRefused` to the `.opcodes` import. + - In `__init__`, add `self.last_flags: Optional[int] = None`. + - In `_validate`, before `return frame`, add `self.last_flags = frame.flags`. + - Replace `_send` with: + +```python + def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None: + # The gate sees the bytes about to go out, not the caller's intent. + # `permit` is passed only by execute(), for exactly one step. + frame = bytes(frame) + check_transmit(request_sub(frame), self._allowed_writes | permit) + log.debug("TX %d bytes: %s", len(frame), frame.hex()) + self._transport.write(frame) +``` + + - Add after `_exchange`: + +```python + def execute(self, plan) -> list: + """Transmit a `micromate.writes.WritePlan` -- the only write path. + + Permission is granted for this call alone, one step at a time, and only + for SUBs under `ENABLEABLE_WRITES`. Refuses unless the last reply on + this connection carried Micromate flags (0xC5 / 0x03). Each step's ack + is awaited before the next is sent. Never retries: a timeout raises, + and what happened is the caller's to find out by reading the unit back. + """ + beyond = plan.subs - ENABLEABLE_WRITES + if beyond: + raise OpcodeRefused( + "plan holds SUB(s) above the write ceiling: " + + ", ".join(f"0x{s:02X}" for s in sorted(beyond))) + if self.last_flags not in (FLAGS_BLASTWARE, FLAGS_THOR): + raise OpcodeRefused( + "no Micromate-flagged reply seen on this connection -- " + "refusing to write") + acks = [] + for step in plan.steps: + self._parser.reset() + self._pending.clear() + self._send(step.frame, permit=frozenset({step.sub})) + acks.append(self._recv_one(expected_sub=step.ack_sub, reset_parser=False)) + return acks +``` + + - Module docstring: in the scope paragraph, add one sentence. `execute(plan)` is the only write path: one call's permission, at most `ENABLEABLE_WRITES`, and only on a connection that has had Micromate-flagged replies. + +- [ ] **Step 4: Run the tests and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_micromate_execute.py tests/test_micromate_opcodes.py tests/test_micromate_protocol.py -q` + Expected: all pass. + +- [ ] **Step 5: Full suite, then commit and push.** + Message: `feat(micromate): execute(plan) -- the only write path, one call's permission, a start/stop ceiling`. + +--- + +### Task 2: The unit's run state and a fresh serial + +**Files:** +- Modify: `micromate/models.py`, `micromate/client.py` +- Test: `tests/test_micromate_client.py` (append) + +**Interfaces:** +- Produces: + - `MicromateRunState(code: int, name: str)`, where `name` is one of `"idle"` / `"monitoring"` / `"calling_home"` / `"unknown(0xNN)"`. + - `MicromateClient.read_run_state() -> MicromateRunState` + - `MicromateClient.serial(*, refresh: bool = False) -> str` + +- [ ] **Step 1: Write the failing tests.** Append to `tests/test_micromate_client.py`: + +```python +# ── run state (0x49) and a fresh serial ─────────────────────────────────────── + +import json as _json # noqa: E402 + +_WRITES = Path(__file__).parent / "fixtures" / "micromate-writes" + + +def _captured_0x49(): + ex = _json.loads((_WRITES / "monitor-start-stop.json").read_text())["exchanges"] + return [bytes.fromhex(e["response_data"]) for e in ex if e["sub"] == 0x49] + + +def test_run_state_names_thors_captured_states(): + datas = _captured_0x49() + names = [] + for d in datas: + mm, _t = client([frame(0xB6, d)]) + names.append(mm.read_run_state().name) + assert "idle" in names and "monitoring" in names + + +@pytest.mark.parametrize("code,name", [(0x00, "idle"), (0x02, "monitoring"), + (0x03, "calling_home"), (0x07, "unknown(0x07)")]) +def test_run_state_names_every_value(code, name): + data = bytes(11) + bytes([code]) + bytes(4) + mm, _t = client([frame(0xB6, data)]) + st = mm.read_run_state() + assert (st.code, st.name) == (code, name) + + +def test_serial_refresh_reads_the_unit_again(): + mm, t = client([frame(0xEA, bytes(11) + b"UM20147\x00\x00\x00")]) + mm._serial = "UM99999" # a stale cached serial + assert mm.serial(refresh=True) == "UM20147" + assert len(t.written) == 1 +``` + + Before running, check two things: + - `client()` and `frame()` exist in this file with those shapes. If they differ, adapt the calls. + - The response SUBs: `0x49` gives `0xFF-0x49 = 0xB6`, and `0x15` gives `0xEA`. + +- [ ] **Step 2: Run the tests and watch them fail.** + Run: `.venv/bin/python -m pytest tests/test_micromate_client.py -q -k "run_state or refresh"` + Expected: `AttributeError: ... 'read_run_state'`. + +- [ ] **Step 3: Implement.** + + In `micromate/models.py`, add: + +```python +@dataclass(frozen=True) +class MicromateRunState: + """`SUB 0x49` content[0]. 0x00 idle, 0x02 monitoring, 0x03 calling home + (ten of ten in the 10-14 ACH session); anything else is named, not guessed.""" + code: int + name: str +``` + + In `micromate/client.py`: + - Import `MicromateRunState`. + - Change `serial` to `def serial(self, *, refresh: bool = False) -> str:`, with the condition `if refresh or self._serial is None:`. Document that a change operation refreshes it right before writing. + - Add after `serial`: + +```python + _RUN_STATES = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"} + + def read_run_state(self) -> MicromateRunState: + """`SUB 0x49` -> the unit's run state, with the in-call-home value kept + (connect()'s `monitoring` bool flattens 0x03 into True).""" + c = _content(self._proto.read_state()) + if not c: + raise ProtocolError("0x49 state reply has no content") + code = c[_STATE_FLAG] + return MicromateRunState(code, self._RUN_STATES.get(code, f"unknown(0x{code:02X})")) +``` + +- [ ] **Step 4: Run the tests and watch them pass.** Then run the full suite, commit and push. + Message: `feat(micromate): read the unit's run state and refresh its serial on demand`. + +--- + +### Task 3: The audit table and its sink + +**Files:** +- Modify: `sfm/database.py`. Add to `_SCHEMA`, plus three methods. +- Create: `sfm/audit.py` +- Modify: `sfm/server.py`, for `GET /db/device_commands` +- Test: `tests/test_device_commands.py` (new) + +**Interfaces:** +- Produces: + - `SeismoDb.begin_device_command(*, serial, series, address, action, tier, request: dict, caller: str) -> str` + - `SeismoDb.finish_device_command(command_id, *, outcome, verified, ack: Optional[dict], error: Optional[str]) -> None` + - `SeismoDb.query_device_commands(serial=None, limit=100) -> list[dict]`, newest first, with `request` and `ack` parsed back from JSON. + - `DbAudit(get_db: Callable[[], SeismoDb])` with `begin(**fields) -> str` and `finish(command_id, **fields)`. + +- [ ] **Step 1: Write the failing tests** in `tests/test_device_commands.py`: + +```python +"""The device_commands audit table: one row per change attempt, pending -> result.""" +from __future__ import annotations + +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from sfm.audit import DbAudit # noqa: E402 +from sfm.database import SeismoDb # noqa: E402 + +ROW = dict(serial="UM20147", series=4, address="serial:/dev/ttyACM0", + action="start monitoring", tier="change", + request={"plan": {"steps": [{"sub": "0x96"}]}}, caller="test") + + +def test_a_command_is_pending_until_finished(tmp_path): + db = SeismoDb(tmp_path / "s.db") + cid = db.begin_device_command(**ROW) + row = db.query_device_commands(serial="UM20147")[0] + assert (row["id"], row["outcome"], row["verified"]) == (cid, "pending", None) + assert row["request"]["plan"]["steps"][0]["sub"] == "0x96" + db.finish_device_command(cid, outcome="sent", verified="ok", + ack={"subs": ["0x69"]}, error=None) + row = db.query_device_commands(serial="UM20147")[0] + assert (row["outcome"], row["verified"], row["ack"]) == ("sent", "ok", {"subs": ["0x69"]}) + assert row["finished_ts"] + + +def test_the_table_survives_reopening(tmp_path): + SeismoDb(tmp_path / "s.db").begin_device_command(**ROW) + assert len(SeismoDb(tmp_path / "s.db").query_device_commands()) == 1 + + +def test_db_audit_is_a_thin_sink(tmp_path): + db = SeismoDb(tmp_path / "s.db") + audit = DbAudit(lambda: db) + cid = audit.begin(**ROW) + audit.finish(cid, outcome="failed", verified="mismatch", ack=None, error="unit reads idle") + row = db.query_device_commands()[0] + assert (row["outcome"], row["verified"], row["error"]) == ("failed", "mismatch", "unit reads idle") +``` + +- [ ] **Step 2: Run them, and watch them fail** (ImportError). + +- [ ] **Step 3: Implement.** + - Append to `_SCHEMA` in `sfm/database.py`: + +```sql +CREATE TABLE IF NOT EXISTS device_commands ( + id TEXT PRIMARY KEY, + ts TEXT NOT NULL, -- when the attempt began (UTC ISO) + finished_ts TEXT, + serial TEXT NOT NULL, + series INTEGER NOT NULL, + address TEXT NOT NULL, + action TEXT NOT NULL, -- e.g. "start monitoring" + tier TEXT NOT NULL, -- "change" | "destructive" + request TEXT, -- JSON: parameters + the planned frames (hex) + ack TEXT, -- JSON: ack summary + verified TEXT, -- "ok" | "mismatch" | "not_checked" + outcome TEXT NOT NULL, -- "pending" | "sent" | "skipped" | "failed" + error TEXT, + caller TEXT -- "webapp" | "terra-view" | "script" | ... +); +CREATE INDEX IF NOT EXISTS idx_device_commands_serial ON device_commands(serial, ts); +``` + + - Add the methods to `SeismoDb`. Use the existing `_new_id()` and `_connect()`, `json.dumps`/`json.loads` for `request`/`ack`, and a UTC ISO string for `ts`/`finished_ts`. + - `query_device_commands` orders by `ts DESC`. + - Create `sfm/audit.py`: + +```python +"""The SDM side of the device audit: DeviceAccess calls this sink, which writes +SeismoDb.device_commands. Kept here so sfm.device_access never imports the DB.""" +from __future__ import annotations + +from typing import Any, Callable + + +class DbAudit: + def __init__(self, get_db: Callable[[], Any]) -> None: + self._get_db = get_db + + def begin(self, **fields: Any) -> str: + return self._get_db().begin_device_command(**fields) + + def finish(self, command_id: str, **fields: Any) -> None: + self._get_db().finish_device_command(command_id, **fields) +``` + + - Add `GET /db/device_commands`, with params `serial: Optional[str] = Query(None)` and `limit: int = Query(100)`. It returns `{"commands": _get_db().query_device_commands(serial, limit)}`. Put it near the other `/db/*` reads. + +- [ ] **Step 4: Run the tests and watch them pass.** Then run the full suite, commit and push. + Message: `feat(sfm): device_commands audit table -- one row per change attempt`. + +--- + +### Task 4: The Series-4 change operation and `DeviceAccess.start_monitoring` / `stop_monitoring` + +**Files:** +- Modify: `sfm/device_access/models.py` (add `ChangeResult`), `sfm/device_access/s4.py` (add `s4_change_monitoring`), `sfm/device_access/access.py`, `sfm/device_access/__init__.py` +- Modify: `tests/device_access_fakes.py` +- Test: `tests/test_device_access_change.py` (new) + +**Interfaces:** +- Consumes: Task 1 (`execute`), Task 2 (`read_run_state`, `serial(refresh=)`), and the phase-2 `plan_start_monitoring`/`plan_stop_monitoring`. +- Produces: + - `ChangeResult`, with the fields shown below. + - `DeviceAccess(..., audit=None, sleep=time.sleep, verify_timeout_s=60.0, verify_interval_s=2.0)` + - `DeviceAccess.start_monitoring(address, serial, *, dry_run=False, even_if_already=False, caller="api") -> ChangeResult`, and the same for `stop_monitoring`. + +- [ ] **Step 1: Extend the fakes.** In `tests/device_access_fakes.py`, give `FakeMicromateClient` these keyword arguments: + - `run_states=None`, a list of codes consumed one per `read_run_state()` call, with the last one repeating; it defaults to `[0x00]`; + - `serial_reported=None`, defaulting to `serial`; + - `execute_error=None`. + + Then add these methods: + +```python + def serial(self, *, refresh=False): + self._step("serial") + return self.serial_reported + + def read_run_state(self): + from micromate.models import MicromateRunState + self._step("read_run_state") + code = self.run_states.pop(0) if len(self.run_states) > 1 else self.run_states[0] + names = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"} + return MicromateRunState(code, names.get(code, f"unknown(0x{code:02X})")) +``` + + On `_FakeProtocol`, add: + +```python + def execute(self, plan): + self._owner._step("execute") + self._owner.executed.append(plan) + if self._owner.execute_error is not None: + raise self._owner.execute_error + return [type("Ack", (), {"sub": s.ack_sub, "data": bytes(11)})() for s in plan.steps] +``` + + Also add `self.executed = []` to `FakeMicromateClient.__init__`. + +- [ ] **Step 2: Write the failing tests** in `tests/test_device_access_change.py`: + +```python +"""Start/stop through the safety layer: identity, state, dry run, audit, read-back, no retry.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from device_access_fakes import FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + CallHomeInProgress, NotSupported, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class Audit: + def __init__(self): + self.rows = {} + + def begin(self, **f): + cid = f"c{len(self.rows) + 1}" + self.rows[cid] = dict(f, outcome="pending") + return cid + + def finish(self, cid, **f): + self.rows[cid].update(f) + + +def access(fake, audit="default"): + return DeviceAccess(s4_client_factory=lambda a, **kw: fake, start_reaper=False, + audit=Audit() if audit == "default" else audit, + sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) + + +def test_a_dry_run_returns_the_exact_frames_and_sends_nothing(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147", dry_run=True) + assert (r.dry_run, r.sent, r.outcome, r.state_before) == (True, False, "dry_run", "idle") + assert r.plan["steps"][0]["frame"] == "41021010009600ffff00000000000000000000a403" + assert fake.executed == [] and da._audit.rows == {} + + +def test_start_sends_once_and_verifies_by_reading_back(): + fake = FakeMicromateClient(run_states=[0x00, 0x00, 0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.sent, r.outcome, r.verified, r.state_after) == (True, "sent", "ok", "monitoring") + assert len(fake.executed) == 1 + row = da._audit.rows[r.audit_id] + assert (row["outcome"], row["verified"], row["action"]) == ("sent", "ok", "start monitoring") + assert r.detail["states_seen"][-1] == "monitoring" + + +def test_already_in_state_is_skipped_and_audited_as_skipped(): + fake = FakeMicromateClient(run_states=[0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.sent, r.outcome) == (False, "skipped") and fake.executed == [] + assert da._audit.rows[r.audit_id]["outcome"] == "skipped" + + +def test_even_if_already_sends_anyway(): + fake = FakeMicromateClient(run_states=[0x02]) + r = access(fake).start_monitoring(ADDR, "UM20147", even_if_already=True) + assert r.sent and len(fake.executed) == 1 + + +def test_a_unit_calling_home_is_refused_and_nothing_is_sent(): + fake = FakeMicromateClient(run_states=[0x03]) + with pytest.raises(CallHomeInProgress): + access(fake).stop_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_a_different_unit_on_the_fresh_serial_read_is_refused_before_writing(): + fake = FakeMicromateClient(serial_reported="UM12947") + with pytest.raises(WrongUnit): + access(fake).start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_a_live_change_without_an_audit_sink_is_refused(): + fake = FakeMicromateClient() + with pytest.raises(NotSupported, match="audit"): + access(fake, audit=None).start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_a_clean_ack_but_no_state_change_is_a_failed_change(): + fake = FakeMicromateClient(run_states=[0x00]) # never leaves idle + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.outcome, r.verified, r.state_after) == ("failed", "mismatch", "idle") + assert len(r.detail["states_seen"]) == 4 # 6 s window / 2 s + the first read + assert da._audit.rows[r.audit_id]["verified"] == "mismatch" + + +def test_a_lost_ack_is_never_retried(): + fake = FakeMicromateClient(run_states=[0x00, 0x02], + execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + assert (r.outcome, r.state_after) == ("failed", "monitoring") + assert "no ack" in r.detail["error"] + assert da._audit.rows[r.audit_id]["outcome"] == "failed" + + +def test_a_change_on_a_dropped_held_line_is_not_retried(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + da.status(ADDR, "UM20147") # hold the line + fake.fail = [mm_proto.TimeoutError("peer gone")] # next call fails + with pytest.raises(Exception): + da.start_monitoring(ADDR, "UM20147") + assert fake.executed == [] # never reached the write, never re-tried +``` + + Before running, check `FakeMicromateClient.status`'s call sequence, so the `fail` queue in the last test hits the first call of the change. Adapt the queue position if needed, and say so in the report. + +- [ ] **Step 3: Run the tests and watch them fail** (AttributeError: `start_monitoring`). + +- [ ] **Step 4: Implement.** + + `sfm/device_access/models.py`, append: + +```python +@dataclass +class ChangeResult: + """The outcome of a change request. `outcome`: "dry_run" | "skipped" | "sent" | + "failed". `verified`: "ok" | "mismatch" | "not_checked". `plan` is the exact + frames planned (dry run) or sent.""" + serial: str + series: int + action: str + dry_run: bool + sent: bool + outcome: str + verified: str + state_before: Optional[str] + state_after: Optional[str] + audit_id: Optional[str] + plan: Dict[str, Any] = field(default_factory=dict) + detail: Dict[str, Any] = field(default_factory=dict) +``` + + `sfm/device_access/s4.py`, add: + - imports: `from micromate.writes import plan_start_monitoring, plan_stop_monitoring`, plus `ChangeResult`, `CallHomeInProgress`, `NotSupported` and `WrongUnit` where not already imported; + - the function below. It is a plain function; `DeviceAccess` calls it inside `session.run`. + +```python +def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool, + even_if_already: bool, audit: Any, address: UnitAddress, + caller: str, sleep: Callable[[float], None], + verify_timeout_s: float, verify_interval_s: float) -> ChangeResult: + """Identity -> state -> (dry run | skip | audit -> send -> read back -> audit).""" + action = "start monitoring" if start else "stop monitoring" + want = "monitoring" if start else "idle" + + reported = normalise_serial(client.serial(refresh=True)) + if reported != serial: + raise WrongUnit(f"asked for {serial} but {reported} answered at {address.key} -- " + "nothing sent") + before = client.read_run_state() + if before.name == "calling_home": + raise CallHomeInProgress(_RING_MESSAGE) + plan = plan_start_monitoring() if start else plan_stop_monitoring() + base = dict(serial=serial, series=4, action=action, plan=plan.describe(), + state_before=before.name) + + if dry_run: + return ChangeResult(dry_run=True, sent=False, outcome="dry_run", + verified="not_checked", state_after=None, audit_id=None, **base) + if audit is None: + raise NotSupported("no audit log is configured -- SFM refuses to change a unit " + "without one (nothing sent)") + request = {"plan": plan.describe(), "even_if_already": even_if_already} + cid = audit.begin(serial=serial, series=4, address=address.key, action=action, + tier="change", request=request, caller=caller) + if before.name == want and not even_if_already: + audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, + error=f"already {want}") + return ChangeResult(dry_run=False, sent=False, outcome="skipped", + verified="not_checked", state_after=before.name, + audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base) + + try: + acks = client.protocol.execute(plan) + except Exception as exc: # noqa: BLE001 -- recorded, never retried + after = _try_run_state(client) + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}") + if after is None: + raise # the line is suspect: let _exchange hang up + return ChangeResult(dry_run=False, sent=True, outcome="failed", + verified="not_checked", state_after=after, audit_id=cid, + detail={"error": f"no clean ack: {exc}"}, **base) + + ack = {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]} + seen = [before.name] + polls = int(verify_timeout_s // verify_interval_s) + for _ in range(polls): + sleep(verify_interval_s) + seen.append(client.read_run_state().name) + if seen[-1] == want: + break + ok = seen[-1] == want + audit.finish(cid, outcome="sent" if ok else "failed", verified="ok" if ok else "mismatch", + ack=ack, error=None if ok else f"unit reads {seen[-1]}, expected {want}") + return ChangeResult(dry_run=False, sent=True, outcome="sent" if ok else "failed", + verified="ok" if ok else "mismatch", state_after=seen[-1], + audit_id=cid, detail={"states_seen": seen, "ack": ack}, **base) + + +def _try_run_state(client: Any) -> Optional[str]: + try: + return client.read_run_state().name + except Exception: # noqa: BLE001 + return None +``` + + Check the poll count against the test's expectation. With a 6 s window and a 2 s interval, the loop gives 3 reads after the first, so 4 in total. Keep the test and the code consistent. If you change one, say which in the report. + + In `sfm/device_access/access.py`: + - Constructor: add the keyword arguments `audit: Any = None`, `sleep: Callable[[float], None] = time.sleep`, `verify_timeout_s: float = 60.0` and `verify_interval_s: float = 2.0`, and store them, with `self._audit = audit`. + - Add `change: bool = False` to `_dispatch`. Make the Series-4 retry condition `if was_held and not change and isinstance(exc, (NoAnswer, ConnectFailed)):`, and update the comment: a change is never retried, by construction. + - Add the public methods: + +```python + def start_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False, + even_if_already: bool = False, caller: str = "api") -> ChangeResult: + return self._change_monitoring(address, serial, start=True, dry_run=dry_run, + even_if_already=even_if_already, caller=caller) + + def stop_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False, + even_if_already: bool = False, caller: str = "api") -> ChangeResult: + return self._change_monitoring(address, serial, start=False, dry_run=dry_run, + even_if_already=even_if_already, caller=caller) + + def _change_monitoring(self, address, serial, *, start, dry_run, even_if_already, caller): + kw = dict(start=start, dry_run=dry_run, even_if_already=even_if_already, + audit=self._audit, address=address, caller=caller, sleep=self._sleep, + verify_timeout_s=self._verify_timeout_s, + verify_interval_s=self._verify_interval_s) + return self._dispatch( + address, serial, + lambda a, s: self._s3.change_monitoring(a, s, **kw), + lambda c, s: s4_change_monitoring(c, s, **kw), + change=True) +``` + + `self._s3.change_monitoring` arrives in Task 5. Until then, add a stub on `Series3Adapter` that raises `NotSupported("Series 3 start/stop through DeviceAccess arrives in Task 5")`, so this task's tests run. + - Export `ChangeResult` from `__init__.py`. + +- [ ] **Step 5: Run the tests and watch them pass.** + Run: `.venv/bin/python -m pytest tests/test_device_access_change.py tests/test_device_access*.py -q` + Expected: all pass. + +- [ ] **Step 6: Full suite, then commit and push.** + Message: `feat(sfm): start/stop monitoring for Series 4 -- identity, state, dry run, audit, read-back, never retried`. + +--- + +### Task 5: The Series-3 change operation + +**Files:** +- Modify: `sfm/device_access/s3.py` +- Modify: `tests/device_access_fakes.py` +- Test: `tests/test_device_access_change.py` (append) + +**Interfaces:** +- Produces: + - `Series3Adapter.change_monitoring(address, serial, **kw) -> ChangeResult`, with the same keyword arguments as `s4_change_monitoring`. + - `Series3Adapter._run(address, fn, timeout=None, retry=True)` + +- [ ] **Step 1: Extend the fakes.** On `FakeMiniMateClient`: + - add the keyword arguments `monitor_states=None` (a list of bools consumed by `get_monitor_status()`, with the last one repeating; it defaults to `[monitoring]`) and `write_error=None`; + - add `self.writes = []`; + - add `start_monitoring()` and `stop_monitoring()`. Each `_step`s, appends its name to `writes`, and raises `write_error` if one is set; + - make `get_monitor_status()` consume `monitor_states`. + +- [ ] **Step 2: Write the failing tests** (append to `tests/test_device_access_change.py`): + +```python +# ── Series 3 ────────────────────────────────────────────────────────────────── + +import minimateplus.protocol as mmp_proto # noqa: E402 +from device_access_fakes import FakeMiniMateClient # noqa: E402 + +TCP3 = UnitAddress(host="10.0.0.6", tcp_port=12345, port=None, baud=None) + + +def access3(fake, audit="default"): + seen = [] + + def factory(a, **kw): + seen.append(kw) + return fake + da = DeviceAccess(s3_client_factory=factory, start_reaper=False, + audit=Audit() if audit == "default" else audit, + sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) + da.factory_calls = seen + return da + + +def test_series3_dry_run_returns_its_own_frame_and_sends_nothing(): + fake = FakeMiniMateClient(monitor_states=[False]) + r = access3(fake).start_monitoring(TCP3, "BE18193", dry_run=True) + assert (r.series, r.outcome, r.state_before) == (3, "dry_run", "idle") + assert r.plan["steps"][0]["sub"] == "0x96" and fake.writes == [] + + +def test_series3_start_is_verified_by_monitor_status(): + fake = FakeMiniMateClient(monitor_states=[False, False, True]) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") + assert fake.writes == ["start_monitoring"] + + +def test_series3_wrong_unit_is_refused_before_writing(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit): + access3(fake).stop_monitoring(TCP3, "BE18193") + assert fake.writes == [] + + +def test_series3_a_lost_ack_is_never_retried_even_over_tcp(): + fake = FakeMiniMateClient(monitor_states=[False, True], + write_error=mmp_proto.TimeoutError("no ack")) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert fake.writes == ["start_monitoring"] # one send, no cold-boot retry + assert r.outcome == "failed" and r.state_after == "monitoring" +``` + +- [ ] **Step 3: Run them and watch them fail** (the Task 4 stub raises NotSupported). + +- [ ] **Step 4: Implement.** In `sfm/device_access/s3.py`: + - `_run` gains `retry: bool = True`. In its `except NoAnswer:`, add `if not retry or not address.host: raise`. + - Replace the stub with `change_monitoring`. It follows `s4_change_monitoring` step for step: + 1. `info = client.connect()` and `self._check(info.serial, serial, address)`. This is the fresh identity read: `connect()` reads `0x15`. + 2. `before = "monitoring" if client.get_monitor_status().is_monitoring else "idle"`. + 3. The dry-run plan, built from `minimateplus.framing.build_bw_write_frame(SUB_START_MONITORING or SUB_STOP_MONITORING, b"")`. Take the SUB constants from `minimateplus.protocol`. Shape it as `{"action", "sends_nothing": True, "steps": [{"sub": "0x96", "what": ..., "offset": "0x0000", "data_len": 0, "expect_ack": "0x69", "frame": }]}`, the same shape as Series 4. + 4. The audit, skip, send (`client.start_monitoring()`/`stop_monitoring()`), read-back poll and audit-finish logic, identical in shape to Series 4. There is no `calling_home` state on Series 3. + 5. Call `self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False)`. + - Factor the shared poll/audit tail out of `s4_change_monitoring` into a helper in a new module, `sfm/device_access/change.py`, if that keeps both short. Do not duplicate 40 lines. + +- [ ] **Step 5: Run the tests and watch them pass**, then the full suite, then commit and push. + Message: `feat(sfm): start/stop monitoring for Series 3 through the same safety layer`. + +--- + +### Task 6: The endpoints + +**Files:** +- Modify: `sfm/server.py`. Change `device_monitor_start` and `device_monitor_stop`, add to `_SERIAL_AWARE_PATHS`, and build `_device_access_instance` with `audit=DbAudit(_get_db)`. +- Test: `tests/test_server_device_access.py` (append) + +**Interfaces:** +- Produces: `POST /device/monitor/start` and `POST /device/monitor/stop`. Each gains `serial`, `dry_run: bool = False`, `even_if_already: bool = False` and `caller: Optional[str] = None`, and returns the `ChangeResult` as JSON. The HTTP status: + +| case | status | +|---|---| +| dry_run, skipped, sent and verified ok | 200 | +| failed with `verified` "mismatch" | **409** | +| any other failed | **502** | +| a `DeviceError` | its own status | + +- [ ] **Step 1: Write the failing tests.** Append direct-call handler tests. Build each `DeviceAccess` with the fakes and an `Audit` recorder, and monkeypatch `srv._device_access_instance`. Cover: + - a dry run returns 200 with the frame; + - a live start that verifies returns 200; + - a mismatch returns 409 with the body still holding `states_seen`; + - a lost ack where the state read back fine returns 502; + - `/device/monitor/start` without `serial` runs the legacy code unchanged. Use the same "legacy untouchable" pattern as the existing events test: monkeypatch `_device_access` to raise, and monkeypatch `_build_client` to raise a sentinel. + - Add both paths to the guard test's "allowed" list. + +- [ ] **Step 2: Run them and watch them fail.** + +- [ ] **Step 3: Implement.** + - **`baud` parameter:** `baud` becomes `Optional[int] = Query(None)` on both routes. + - **New parameters:** append `serial: Optional[str] = Query(None, description=_SERIAL_DOC)`, `dry_run: bool = Query(False)`, `even_if_already: bool = Query(False)` and `caller: Optional[str] = Query(None)`. + - **Docstring:** add a paragraph. With `serial`: identity check, state first, dry run, audit, read-back, never retried. The response is the ChangeResult. Without `serial`: the legacy behaviour below. + - **Serial branch:** put it first in each route, then `baud = 38400 if baud is None else baud` before the legacy code. + +```python + if serial: + return _change_response(lambda: _device_access().start_monitoring( + _unit_address(port, baud, host, tcp_port), serial, dry_run=dry_run, + even_if_already=even_if_already, caller=caller or "api")) +``` + + - **The helper:** + +```python +def _change_response(fn) -> JSONResponse: + try: + result = fn() + except DeviceError as exc: + raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc + status = 200 + if result.outcome == "failed": + status = 409 if result.verified == "mismatch" else 502 + return JSONResponse(status_code=status, content=dataclasses.asdict(result)) +``` + + - **Wiring:** `_device_access_instance = DeviceAccess(audit=DbAudit(_get_db))`. Import `DbAudit` from `sfm.audit`. + - **Guard:** add `"/device/monitor/start"` and `"/device/monitor/stop"` to `_SERIAL_AWARE_PATHS`. + +- [ ] **Step 4: Run the tests, watch them pass, then the full suite, commit and push.** + Message: `feat(sfm): start/stop monitoring by serial -- dry run, audit, read-back`. + +--- + +### Task 7: The first live send, at the bench (controller and Brian, not a subagent) + +**Run only with Brian present and saying go.** UM20147 is on `/dev/ttyACM0` (`sg dialout`). SFM runs on port 8299 with a scratch database, through the phase-1b launcher pattern (patch `_DEFAULT_DB_PATH`, write a PID file, start and stop in one command). Log `micromate.protocol` at DEBUG, so every TX/RX frame is recorded. + +1. **Dry run, both actions:** + - `POST /device/monitor/start?serial=UM20147&port=/dev/ttyACM0&dry_run=true` + - the same for `/stop` + + Show Brian the state and the exact frame. It must be `41021010009600ffff00000000000000000000a403` for start, byte-identical to THOR's. +2. **Brian says go:** a live `POST /device/monitor/start`. Record: + - the HTTP status and body; + - the debug TX/RX lines; + - `states_seen`, including any sensor-check interval; + - the `device_commands` row. + + Confirm on the unit's screen that it is monitoring. +3. **Brian says go:** a live `POST /device/monitor/stop`. Record the same, and confirm on the screen. +4. **Optional, if Brian wants to settle the open question:** + - Stop again with `even_if_already=true` while idle. This records the ack of a "stop while stopped" (spec: open bench question). + - The plain stop-while-idle path is a skip and sends nothing. +5. **Record the results:** + - **`docs/micromate_protocol_reference.md`:** a dated, graded entry with the frames, acks, states and timings. It answers "does `0x49` reflect the change immediately", and records the sensor-check delay if any. + - **`CLAUDE.md`:** retract, in place, "No command has ever been originated against a unit by this project". Add: the first commands were `0x96`/`0x97` to UM20147 on , sent by SFM at the bench with Brian's approval. + - **Trilium:** a dev-log entry. + +## Self-review notes + +- **Spec coverage.** Build phases item 3 and its six preconditions: + - per-call permission: Task 1; + - ceiling: Task 1; + - never retry: Tasks 4 and 5; + - plan built inside the lock right before sending, with no stored dry-run plan ever sent: Task 4, where the plan is built inside the dispatched operation; + - read state first: Tasks 4 and 5; + - Micromate flags: Task 1. + + The safety layer's identity check, audit table and read-back are Tasks 3–5. The dry run is Tasks 4–6. The bench protocol is Task 7. +- **Not in phase 3:** call-home writes (phase 4), setup push (phase 5), the dry-run digest echo (optional in the spec, deferred), Series-3 held sessions, and the blind-stop-tool decision (Brian). +- **The verify window.** It is 60 s by default. Series 3's sensor check took about 40 s (4-8-26). Series 4's is unmeasured, and Task 7 measures it. -- 2.54.1 From 8daf413fe3112c27577b4562c24f9fbdd2ab1fb2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 15:58:31 -0400 Subject: [PATCH 068/223] feat(micromate): execute(plan) -- the only write path, one call's permission, a start/stop ceiling Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/opcodes.py | 6 +++ micromate/protocol.py | 48 ++++++++++++++++--- tests/test_micromate_execute.py | 85 +++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 tests/test_micromate_execute.py diff --git a/micromate/opcodes.py b/micromate/opcodes.py index 820bf90..31a884e 100644 --- a/micromate/opcodes.py +++ b/micromate/opcodes.py @@ -80,6 +80,12 @@ WRITE_SUBS: Mapping[int, str] = MappingProxyType(_WRITE_SUBS) CROSS_SERIES_COLLISIONS: Mapping[int, str] = MappingProxyType(_CROSS_SERIES_COLLISIONS) READ_SUBS: Mapping[int, str] = MappingProxyType(_READ_SUBS) +# The write SUBs any code may transmit at all -- through MicromateProtocol.execute, +# one call at a time. Raising this is a spec change, reviewed like one: delete +# (0xA8/0xAA), raw file writes (0x8D/0x8E -- they could reach the modem +# settings) and 0xA2 never belong here without one. +ENABLEABLE_WRITES = frozenset({0x96, 0x97}) + class OpcodeRefused(RuntimeError): """A frame was stopped before it reached the wire.""" diff --git a/micromate/protocol.py b/micromate/protocol.py index 8fb22fd..fa6e4e6 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -16,6 +16,9 @@ by THOR while we recorded. The first thing this codebase ever sends to a customer's instrument should be a decision someone made on purpose, not a side effect of a client that grew a method. Write frames are *built* in ``micromate.writes`` as reviewable plans; building one sends nothing. +``execute(plan)`` is the only write path: one call's permission, at most +``ENABLEABLE_WRITES``, and only on a connection that has had Micromate-flagged +replies. Every offset and params layout below was read off THOR's own frames in ``bridges/captures/9-24-26 - micromate2/`` rather than taken from the spec @@ -48,8 +51,11 @@ from typing import Optional from minimateplus.transport import BaseTransport -from .framing import MicromateFrame, MicromateFrameParser, build_request, request_sub -from .opcodes import WRITE_SUBS, check_transmit +from .framing import ( + FLAGS_BLASTWARE, FLAGS_THOR, MicromateFrame, MicromateFrameParser, + build_request, request_sub, +) +from .opcodes import ENABLEABLE_WRITES, WRITE_SUBS, OpcodeRefused, check_transmit log = logging.getLogger(__name__) @@ -281,6 +287,7 @@ class MicromateProtocol: + ", ".join(f"0x{x:02X}" for x in sorted(unknown))) self._parser = MicromateFrameParser() self._pending: list[MicromateFrame] = [] + self.last_flags: Optional[int] = None # ── Identity and state ──────────────────────────────────────────────────── @@ -525,11 +532,37 @@ class MicromateProtocol: return self._recv_one(expected_sub=0xFF - sub, timeout=timeout, reset_parser=False) - def _send(self, frame: bytes) -> None: - # The gate sees the bytes that are about to go out, not the caller's - # intent: every transmit in this package passes through here. - frame = bytes(frame) # checked bytes == written bytes - check_transmit(request_sub(frame), self._allowed_writes) + def execute(self, plan) -> list: + """Transmit a `micromate.writes.WritePlan` -- the only write path. + + Permission is granted for this call alone, one step at a time, and only + for SUBs under `ENABLEABLE_WRITES`. Refuses unless the last reply on + this connection carried Micromate flags (0xC5 / 0x03). Each step's ack + is awaited before the next is sent. Never retries: a timeout raises, + and what happened is the caller's to find out by reading the unit back. + """ + beyond = plan.subs - ENABLEABLE_WRITES + if beyond: + raise OpcodeRefused( + "plan holds SUB(s) above the write ceiling: " + + ", ".join(f"0x{s:02X}" for s in sorted(beyond))) + if self.last_flags not in (FLAGS_BLASTWARE, FLAGS_THOR): + raise OpcodeRefused( + "no Micromate-flagged reply seen on this connection -- " + "refusing to write") + acks = [] + for step in plan.steps: + self._parser.reset() + self._pending.clear() + self._send(step.frame, permit=frozenset({step.sub})) + acks.append(self._recv_one(expected_sub=step.ack_sub, reset_parser=False)) + return acks + + def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None: + # The gate sees the bytes about to go out, not the caller's intent. + # `permit` is passed only by execute(), for exactly one step. + frame = bytes(frame) + check_transmit(request_sub(frame), self._allowed_writes | permit) log.debug("TX %d bytes: %s", len(frame), frame.hex()) self._transport.write(frame) @@ -583,4 +616,5 @@ class MicromateProtocol: raise UnexpectedResponse( f"expected SUB 0x{expected_sub:02X}, got 0x{frame.sub:02X}" ) + self.last_flags = frame.flags return frame diff --git a/tests/test_micromate_execute.py b/tests/test_micromate_execute.py new file mode 100644 index 0000000..3563469 --- /dev/null +++ b/tests/test_micromate_execute.py @@ -0,0 +1,85 @@ +"""execute(plan): the only write path -- exact frames, one call's permission, a ceiling.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from micromate.framing import FLAGS_THOR, build_request # noqa: E402 +from micromate.opcodes import ENABLEABLE_WRITES, OpcodeRefused # noqa: E402 +from micromate.protocol import ACK_DATA_LEN, UnexpectedResponse # noqa: E402 +from micromate.writes import ( # noqa: E402 + plan_call_home_enabled, plan_start_monitoring, plan_stop_monitoring, +) +from test_micromate_protocol import frame, proto # noqa: E402 + +ACK_START = frame(0x69, bytes(ACK_DATA_LEN)) +POLL_RSP = frame(0xA4, bytes(48)) + + +def _ready(responses): + """A protocol that has already seen one Micromate-flagged reply (a POLL).""" + p, t = proto([POLL_RSP] + responses) + p.poll() + t.written.clear() + return p, t + + +def test_the_ceiling_is_start_and_stop_only(): + assert ENABLEABLE_WRITES == frozenset({0x96, 0x97}) + + +def test_execute_sends_exactly_the_plans_frame_and_returns_the_ack(): + p, t = _ready([ACK_START]) + acks = p.execute(plan_start_monitoring()) + assert t.written == [build_request(0x96, 0xFFFF)] + assert [a.sub for a in acks] == [0x69] + + +def test_permission_ends_with_the_call(): + p, t = _ready([ACK_START]) + p.execute(plan_start_monitoring()) + with pytest.raises(OpcodeRefused): + p._send(build_request(0x96, 0xFFFF)) + assert len(t.written) == 1 + + +def test_a_plan_beyond_the_ceiling_is_refused_and_nothing_is_sent(): + content = bytes(5) + b"\x05" + bytes(120) + p, t = _ready([]) + with pytest.raises(OpcodeRefused, match="ceiling"): + p.execute(plan_call_home_enabled(content, False)) + assert t.written == [] + + +def test_execute_refuses_before_any_micromate_reply_has_been_seen(): + p, t = proto([ACK_START]) + with pytest.raises(OpcodeRefused, match="Micromate"): + p.execute(plan_start_monitoring()) + assert t.written == [] + + +def test_execute_refuses_after_a_non_micromate_flags_reply(): + p, t = proto([frame(0xA4, bytes(48), flags=0x10), ACK_START], strict_checksums=False) + p.poll() + t.written.clear() + with pytest.raises(OpcodeRefused): + p.execute(plan_stop_monitoring()) + assert t.written == [] + + +def test_a_wrong_ack_sub_raises_after_one_send(): + p, t = _ready([frame(0x68, bytes(ACK_DATA_LEN))]) # stop's ack, for a start + with pytest.raises(UnexpectedResponse): + p.execute(plan_start_monitoring()) + assert len(t.written) == 1 + + +def test_thor_flags_are_accepted_too(): + p, t = proto([frame(0xA4, bytes(48), flags=FLAGS_THOR), frame(0x68, bytes(ACK_DATA_LEN))]) + p.poll() + p.execute(plan_stop_monitoring()) + assert t.written[-1] == build_request(0x97, 0xFFFF) -- 2.54.1 From a90b8158b6aa48c2f9d54a9cc59939126b9891c7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:06:24 -0400 Subject: [PATCH 069/223] fix(micromate): the write ceiling is enforced at the wire; allowed_writes retired; execute takes only real plans Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/opcodes.py | 3 +- micromate/protocol.py | 50 ++++++++-------- micromate/writes.py | 4 +- tests/test_micromate_execute.py | 101 +++++++++++++++++++++++++++++++- tests/test_micromate_opcodes.py | 32 ++++++---- 5 files changed, 150 insertions(+), 40 deletions(-) diff --git a/micromate/opcodes.py b/micromate/opcodes.py index 31a884e..0527f61 100644 --- a/micromate/opcodes.py +++ b/micromate/opcodes.py @@ -2,7 +2,8 @@ One place, as the parity spec requires. The gate is an ALLOWLIST: a SUB is transmitted only if it is a catalogued read (READ_SUBS) or a catalogued write -this connection was explicitly allowed. An unknown SUB is refused -- clock-set +that arrives through `MicromateProtocol.execute` (one call's permission, capped at +ENABLEABLE_WRITES; the connection itself holds none). An unknown SUB is refused -- clock-set and delete-all have Series-IV opcodes nobody has catalogued yet, and "unknown means read" is the wrong default. `MicromateProtocol._send` consults it on every outgoing frame, so a write cannot reach a unit by a path nobody diff --git a/micromate/protocol.py b/micromate/protocol.py index fa6e4e6..85fa98b 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -7,8 +7,8 @@ knows frames, offsets and sequencing, and nothing about what a field means. Scope: **reads only on the wire, enforced** (in this package: the Series-3 `minimateplus` stack and raw-socket bench bridges are outside the gate). Every outgoing frame passes `micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused -unless this connection was constructed with it in `allowed_writes` (nothing in -the codebase does so yet), and `0xA2` -- CONFIRM ERASE on Series III -- is +unless it arrives through `execute()` (the connection itself holds no write +permission), and `0xA2` -- CONFIRM ERASE on Series III -- is refused always. The gate is an allowlist: a SUB not catalogued in `opcodes` (read or write) is refused as unknown. No command has ever been originated against a unit by this project; every write in ``docs/micromate_protocol_reference.md`` was performed @@ -47,7 +47,7 @@ import logging import math import struct import time -from typing import Optional +from typing import TYPE_CHECKING, Optional from minimateplus.transport import BaseTransport @@ -57,6 +57,9 @@ from .framing import ( ) from .opcodes import ENABLEABLE_WRITES, WRITE_SUBS, OpcodeRefused, check_transmit +if TYPE_CHECKING: + from .writes import WritePlan + log = logging.getLogger(__name__) DEFAULT_RECV_TIMEOUT = 10.0 @@ -255,13 +258,9 @@ class MicromateProtocol: transport: BaseTransport, recv_timeout: float = DEFAULT_RECV_TIMEOUT, strict_checksums: bool = True, - allowed_writes: frozenset = frozenset(), ) -> None: """ Args: - allowed_writes: write SUBs this connection may transmit. Empty by - default -- every write opcode in `micromate.opcodes` is refused - at `_send`, and `0xA2` is refused whatever this says. strict_checksums: raise on a bad checksum. **Defaults to True, unlike the Series III sibling**, which logs and continues because its parser cannot reliably tell an inner-frame @@ -278,13 +277,6 @@ class MicromateProtocol: self._transport = transport self._recv_timeout = recv_timeout self._strict = strict_checksums - self._allowed_writes = frozenset(allowed_writes) - unknown = self._allowed_writes - set(WRITE_SUBS) - if unknown: - raise ValueError( - "allowed_writes may only name catalogued write SUBs; not in " - "micromate.opcodes.WRITE_SUBS: " - + ", ".join(f"0x{x:02X}" for x in sorted(unknown))) self._parser = MicromateFrameParser() self._pending: list[MicromateFrame] = [] self.last_flags: Optional[int] = None @@ -526,13 +518,20 @@ class MicromateProtocol: # so anything already buffered when we send is by definition stale, and # `expected_sub` would reject it anyway — better to discard it here than # to raise a confusing UnexpectedResponse one command later. + return self._request(build_request(sub, offset, params), 0xFF - sub, + timeout=timeout) + + def _request(self, frame: bytes, expected_sub: int, *, timeout: Optional[float] = None, + permit: frozenset = frozenset()) -> MicromateFrame: + """Clean slate, send one frame, receive its reply. The one sequence + every exchange -- read or execute -- goes through.""" self._parser.reset() self._pending.clear() - self._send(build_request(sub, offset, params)) - return self._recv_one(expected_sub=0xFF - sub, timeout=timeout, + self._send(frame, permit=permit) + return self._recv_one(expected_sub=expected_sub, timeout=timeout, reset_parser=False) - def execute(self, plan) -> list: + def execute(self, plan: "WritePlan") -> list[MicromateFrame]: """Transmit a `micromate.writes.WritePlan` -- the only write path. Permission is granted for this call alone, one step at a time, and only @@ -541,7 +540,11 @@ class MicromateProtocol: is awaited before the next is sent. Never retries: a timeout raises, and what happened is the caller's to find out by reading the unit back. """ - beyond = plan.subs - ENABLEABLE_WRITES + # Deferred: writes -> setup_block -> protocol would be circular at import. + from .writes import WritePlan + if not isinstance(plan, WritePlan): + raise TypeError(f"execute takes a WritePlan, got {type(plan).__name__}") + beyond = {st.sub for st in plan.steps} - ENABLEABLE_WRITES if beyond: raise OpcodeRefused( "plan holds SUB(s) above the write ceiling: " @@ -552,17 +555,18 @@ class MicromateProtocol: "refusing to write") acks = [] for step in plan.steps: - self._parser.reset() - self._pending.clear() - self._send(step.frame, permit=frozenset({step.sub})) - acks.append(self._recv_one(expected_sub=step.ack_sub, reset_parser=False)) + acks.append(self._request(step.frame, step.ack_sub, + permit=frozenset({step.sub}))) return acks def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None: # The gate sees the bytes about to go out, not the caller's intent. # `permit` is passed only by execute(), for exactly one step. frame = bytes(frame) - check_transmit(request_sub(frame), self._allowed_writes | permit) + # Trust means the most recent request got a validated Micromate reply. + self.last_flags = None + # The ceiling is enforced here, where frames leave, whatever was permitted. + check_transmit(request_sub(frame), permit & ENABLEABLE_WRITES) log.debug("TX %d bytes: %s", len(frame), frame.hex()) self._transport.write(frame) diff --git a/micromate/writes.py b/micromate/writes.py index c081c4d..61bd3c2 100644 --- a/micromate/writes.py +++ b/micromate/writes.py @@ -1,8 +1,8 @@ """Write plans for a Micromate: the exact frames a write would send, in order. A plan is what a dry run returns. Building one sends nothing; transmitting it -also needs a protocol constructed with those SUBs in `allowed_writes`, which no -code does yet (see `micromate.opcodes`). +is `MicromateProtocol.execute(plan)` and nothing else: the connection holds no +write permission of its own (see `micromate.opcodes`). Every input is the unit's OWN read of the block being written (content, i.e. response data[11:]), and every plan sends back exactly what was read except diff --git a/tests/test_micromate_execute.py b/tests/test_micromate_execute.py index 3563469..5c9dedb 100644 --- a/tests/test_micromate_execute.py +++ b/tests/test_micromate_execute.py @@ -2,7 +2,10 @@ from __future__ import annotations import os +import pathlib +import re import sys +from types import SimpleNamespace import pytest @@ -10,9 +13,10 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from micromate.framing import FLAGS_THOR, build_request # noqa: E402 from micromate.opcodes import ENABLEABLE_WRITES, OpcodeRefused # noqa: E402 -from micromate.protocol import ACK_DATA_LEN, UnexpectedResponse # noqa: E402 +from micromate.protocol import ACK_DATA_LEN, TimeoutError as MmTimeout, UnexpectedResponse # noqa: E402 from micromate.writes import ( # noqa: E402 - plan_call_home_enabled, plan_start_monitoring, plan_stop_monitoring, + WritePlan, WriteStep, plan_call_home_enabled, plan_start_monitoring, + plan_stop_monitoring, ) from test_micromate_protocol import frame, proto # noqa: E402 @@ -63,7 +67,7 @@ def test_execute_refuses_before_any_micromate_reply_has_been_seen(): def test_execute_refuses_after_a_non_micromate_flags_reply(): - p, t = proto([frame(0xA4, bytes(48), flags=0x10), ACK_START], strict_checksums=False) + p, t = proto([frame(0xA4, bytes(48), flags=0x10), ACK_START]) p.poll() t.written.clear() with pytest.raises(OpcodeRefused): @@ -83,3 +87,94 @@ def test_thor_flags_are_accepted_too(): p.poll() p.execute(plan_stop_monitoring()) assert t.written[-1] == build_request(0x97, 0xFFFF) + + +# -- fix round 1: the ceiling is enforced where frames leave -------------------- + +def test_a_permit_beyond_the_ceiling_cannot_send(): + p, t = _ready([]) + with pytest.raises(OpcodeRefused): + p._send(build_request(0x8E, 0), permit=frozenset({0x8E})) + assert t.written == [] + + +def test_the_constructor_no_longer_grants_anything(): + with pytest.raises(TypeError): + proto([], allowed_writes={0xA8}) + + +def test_a_duck_typed_plan_is_refused(): + p, t = _ready([]) + fake = SimpleNamespace(subs=frozenset({0x96}), steps=(WriteStep(0x7E, 0),)) + with pytest.raises(TypeError): + p.execute(fake) + assert t.written == [] + + +def test_a_forged_step_in_a_real_plan_is_refused_at_the_step(): + p, t = _ready([]) + plan = plan_start_monitoring() + object.__setattr__(plan, "steps", (WriteStep(0x7E, 0),)) # subs now reads 0x7E too + with pytest.raises(OpcodeRefused): + p.execute(plan) + assert t.written == [] + + +def test_a_forged_step_hidden_behind_a_good_plan_is_refused(): + class Lying(WritePlan): + @property + def subs(self): + return frozenset({0x96}) + plan = Lying("x", (WriteStep(0x96, 0xFFFF), WriteStep(0x7E, 0))) + p, t = _ready([ACK_START]) + with pytest.raises(OpcodeRefused): + p.execute(plan) + assert t.written == [] + + +# -- a lost ack is never retried, inside the real execute ------------------------ + +def test_a_lost_ack_raises_after_exactly_one_send(): + p, t = _ready([]) + with pytest.raises(MmTimeout): + p.execute(plan_start_monitoring()) + assert len(t.written) == 1 + + +def test_a_lost_first_ack_stops_a_two_step_plan(): + plan = WritePlan("start then stop", + (WriteStep(0x96, 0xFFFF), WriteStep(0x97, 0xFFFF))) + p, t = _ready([]) + with pytest.raises(MmTimeout): + p.execute(plan) + assert t.written == [build_request(0x96, 0xFFFF)] + + +def test_trust_is_the_most_recent_request_not_an_earlier_one(): + p, t = _ready([]) + with pytest.raises(MmTimeout): + p.poll() # sent, never answered + t.written.clear() + with pytest.raises(OpcodeRefused): + p.execute(plan_start_monitoring()) + assert t.written == [] + + +def test_execute_works_right_after_a_valid_read(): + p, t = _ready([ACK_START]) + p.execute(plan_start_monitoring()) + assert len(t.written) == 1 + + +# -- nothing outside protocol.py passes permit= to _send --------------------------- + +def test_only_protocol_py_passes_permit(): + root = pathlib.Path(__file__).resolve().parent.parent + offenders = [] + for d in ("micromate", "sfm", "bridges", "scratch", "scripts"): + for f in (root / d).rglob("*.py"): + if f == root / "micromate" / "protocol.py": + continue + if re.search(r"_send\([^)]*permit\s*=", f.read_text(errors="ignore"), re.S): + offenders.append(str(f)) + assert offenders == [] diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py index b35edfe..6b68e35 100644 --- a/tests/test_micromate_opcodes.py +++ b/tests/test_micromate_opcodes.py @@ -13,6 +13,7 @@ from micromate.framing import build_request # noqa: E4 from micromate.opcodes import ( # noqa: E402 CROSS_SERIES_COLLISIONS, READ_SUBS, WRITE_SUBS, OpcodeRefused, check_transmit, ) +from micromate.writes import plan_start_monitoring # noqa: E402 from test_micromate_protocol import frame, proto # noqa: E402 # THOR's captured end-call-home frame. Same SUB as Series III's CONFIRM ERASE, not the @@ -51,15 +52,17 @@ def test_the_protocol_refuses_a_write_and_writes_nothing(): def test_the_protocol_refuses_the_captured_0xa2_frame_byte_for_byte(): - p, t = proto([], allowed_writes=frozenset({0xA2})) + p, t = proto([]) with pytest.raises(OpcodeRefused): - p._send(A2_WIRE) + p._send(A2_WIRE, permit=frozenset({0xA2})) assert t.written == [] -def test_an_explicitly_allowed_write_goes_out_on_a_scripted_transport(): - p, t = proto([frame(0x69, bytes(11))], allowed_writes=frozenset({0x96})) - p._exchange(0x96, offset=0xFFFF) +def test_a_write_goes_out_only_through_execute_on_a_scripted_transport(): + p, t = proto([frame(0xA4, bytes(48)), frame(0x69, bytes(11))]) + p.poll() + t.written.clear() + p.execute(plan_start_monitoring()) assert t.written == [build_request(0x96, 0xFFFF)] @@ -95,10 +98,17 @@ def test_an_unknown_opcode_is_refused_and_nothing_is_written(sub): assert t.written == [] -def test_allowed_writes_may_only_name_catalogued_writes(): - for bad in (frozenset({0xEE}), frozenset({0x5B})): - with pytest.raises(ValueError): - proto([], allowed_writes=bad) +@pytest.mark.parametrize("sub", [0xEE, 0x7E, 0xA8]) +def test_a_permit_beyond_the_ceiling_is_refused_at_the_wire(sub): + p, t = proto([]) + with pytest.raises(OpcodeRefused): + p._send(build_request(sub, 0), permit=frozenset({sub})) + assert t.written == [] + + +def test_allowed_writes_is_retired(): + with pytest.raises(TypeError): + proto([], allowed_writes=frozenset({0x96})) def test_the_tables_are_read_only(): @@ -111,9 +121,9 @@ def test_the_tables_are_read_only(): @pytest.mark.parametrize("tail", [build_request(0x96, 0xFFFF), A2_WIRE]) def test_a_read_followed_by_a_write_in_one_send_is_refused(tail): - p, t = proto([], allowed_writes=frozenset({0x96})) + p, t = proto([]) with pytest.raises(ValueError): - p._send(build_request(0x5B, 0x0030) + tail) + p._send(build_request(0x5B, 0x0030) + tail, permit=frozenset({0x96})) assert t.written == [] -- 2.54.1 From 9ed9578d1229372d818c8d2823becfe17095abc8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:17:04 -0400 Subject: [PATCH 070/223] test(micromate): an AST scan pins execute() as the only write grant; cover the last mutants Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 2 +- bridges/mm_dry_run.py | 2 +- micromate/protocol.py | 12 ++-- tests/test_micromate_execute.py | 99 +++++++++++++++++++++++++++------ 4 files changed, 90 insertions(+), 25 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e8f6dea..d181397 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,7 +32,7 @@ Read this first when picking the project back up. the setup rewrite, reproduced byte for byte against THOR's captured frames. `bridges/mm_dry_run.py` prints a write's planned frames from a live unit's reads (run on UM20147: sizes equal UM12947's). `MicromateProtocol._send` - refuses every write opcode unless explicitly allowed, and `0xA2` always, so + refuses every write opcode except one start/stop plan at a time through `execute()`, on a connection with a fresh Micromate reply, and `0xA2` always, so "no command has ever been originated against a unit" is still true and is now enforced in `micromate/` (its `_send` gate); the Series-3 `minimateplus` stack and raw-socket bench bridges are outside it. The reproduction's diff --git a/bridges/mm_dry_run.py b/bridges/mm_dry_run.py index 4a491db..3bef3ad 100644 --- a/bridges/mm_dry_run.py +++ b/bridges/mm_dry_run.py @@ -54,7 +54,7 @@ def main() -> int: if not (a.port or a.host): ap.error("give a serial port or --host") transport = TcpTransport(a.host, port=a.tcp_port) if a.host else SerialTransport(a.port, a.baud) - mm = MicromateClient(transport) # no allowed_writes: the gate refuses every write + mm = MicromateClient(transport) # no execute(): nothing here can transmit a write mm.open() try: info = mm.connect() diff --git a/micromate/protocol.py b/micromate/protocol.py index 85fa98b..a457bc1 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -55,7 +55,7 @@ from .framing import ( FLAGS_BLASTWARE, FLAGS_THOR, MicromateFrame, MicromateFrameParser, build_request, request_sub, ) -from .opcodes import ENABLEABLE_WRITES, WRITE_SUBS, OpcodeRefused, check_transmit +from .opcodes import ENABLEABLE_WRITES, OpcodeRefused, check_transmit if TYPE_CHECKING: from .writes import WritePlan @@ -513,11 +513,9 @@ class MicromateProtocol: ) -> MicromateFrame: if offset is None: offset = _OFFSETS.get(sub, READ_ALL) - # Start every exchange clean: drop any half-frame and any frame left - # stashed by the last one. This is a strict request/response protocol, - # so anything already buffered when we send is by definition stale, and - # `expected_sub` would reject it anyway — better to discard it here than - # to raise a confusing UnexpectedResponse one command later. + # `_request` starts every exchange clean (drops any half-frame and any + # stashed frame): this is a strict request/response protocol, so anything + # already buffered when we send is stale. return self._request(build_request(sub, offset, params), 0xFF - sub, timeout=timeout) @@ -561,7 +559,7 @@ class MicromateProtocol: def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None: # The gate sees the bytes about to go out, not the caller's intent. - # `permit` is passed only by execute(), for exactly one step. + # `permit` is passed only via _request, from execute(), for one step. frame = bytes(frame) # Trust means the most recent request got a validated Micromate reply. self.last_flags = None diff --git a/tests/test_micromate_execute.py b/tests/test_micromate_execute.py index 5c9dedb..acb5e46 100644 --- a/tests/test_micromate_execute.py +++ b/tests/test_micromate_execute.py @@ -2,8 +2,9 @@ from __future__ import annotations import os +import ast import pathlib -import re +import subprocess import sys from types import SimpleNamespace @@ -98,11 +99,6 @@ def test_a_permit_beyond_the_ceiling_cannot_send(): assert t.written == [] -def test_the_constructor_no_longer_grants_anything(): - with pytest.raises(TypeError): - proto([], allowed_writes={0xA8}) - - def test_a_duck_typed_plan_is_refused(): p, t = _ready([]) fake = SimpleNamespace(subs=frozenset({0x96}), steps=(WriteStep(0x7E, 0),)) @@ -166,15 +162,86 @@ def test_execute_works_right_after_a_valid_read(): assert len(t.written) == 1 -# -- nothing outside protocol.py passes permit= to _send --------------------------- +def test_a_successful_two_step_plan_sends_both_in_order(): + plan = WritePlan("start then stop", + (WriteStep(0x96, 0xFFFF), WriteStep(0x97, 0xFFFF))) + p, t = _ready([ACK_START, frame(0x68, bytes(ACK_DATA_LEN))]) + acks = p.execute(plan) + assert t.written == [build_request(0x96, 0xFFFF), build_request(0x97, 0xFFFF)] + assert [a.sub for a in acks] == [0x69, 0x68] -def test_only_protocol_py_passes_permit(): + +def test_an_in_ceiling_frame_sub_mismatch_is_refused(): + class Liar(WriteStep): + @property + def frame(self): + return build_request(0x97, 0xFFFF) + p, t = _ready([ACK_START]) + plan = WritePlan("x", (Liar(0x96, 0xFFFF),)) + with pytest.raises(OpcodeRefused): + p.execute(plan) + assert t.written == [] + + +@pytest.mark.parametrize("bad", [ + frame(0x99, bytes(48)), # Micromate flags, wrong SUB + frame(0xA4, bytes(48))[:-2] + b"\x00\x03", # Micromate flags, bad checksum +]) +def test_a_flagged_reply_that_fails_validation_leaves_no_trust(bad): + p, t = _ready([bad]) + with pytest.raises(Exception): + p.poll() + assert p.last_flags is None + t.written.clear() + with pytest.raises(OpcodeRefused): + p.execute(plan_start_monitoring()) + assert t.written == [] + + +# -- nothing outside protocol.py reaches the wire with permission ----------------- + +def scan_source(src: str, name: str = "") -> list[str]: + """Hits: a `permit=` keyword, `**kw` into _send/_request, any `._request` call.""" + hits = [] + for node in ast.walk(ast.parse(src)): + if not isinstance(node, ast.Call): + continue + fn = node.func + fname = fn.attr if isinstance(fn, ast.Attribute) else getattr(fn, "id", "") + if any(k.arg == "permit" for k in node.keywords): + hits.append(f"{name}:{node.lineno} permit=") + if fname in ("_send", "_request") and any(k.arg is None for k in node.keywords): + hits.append(f"{name}:{node.lineno} **kwargs into {fname}") + if isinstance(fn, ast.Attribute) and fn.attr == "_request": + hits.append(f"{name}:{node.lineno} ._request call") + return hits + + +@pytest.mark.parametrize("src", [ + "p._send(build_request(0x96, 0xFFFF), permit=frozenset({0x96}))", + "p._send(frame, **kw)", + "p._request(frame, 0x69, permit=x)", + "p._request(frame, 0x69)", +]) +def test_the_scanner_catches_each_shape(src): + assert scan_source(src) + + +def test_the_scanner_ignores_ordinary_calls(): + assert scan_source("p._send(frame)\nf(a, b=1)") == [] + + +def test_only_protocol_py_grants_write_permission(): root = pathlib.Path(__file__).resolve().parent.parent - offenders = [] - for d in ("micromate", "sfm", "bridges", "scratch", "scripts"): - for f in (root / d).rglob("*.py"): - if f == root / "micromate" / "protocol.py": - continue - if re.search(r"_send\([^)]*permit\s*=", f.read_text(errors="ignore"), re.S): - offenders.append(str(f)) - assert offenders == [] + files = subprocess.run(["git", "ls-files", "*.py"], cwd=root, capture_output=True, + text=True, check=True).stdout.split() + hits = [] + for rel in files: + if rel.startswith("tests/") or rel == "micromate/protocol.py": + continue + try: + src = (root / rel).read_text(errors="ignore") + hits += scan_source(src, rel) + except SyntaxError: + pass + assert hits == [] -- 2.54.1 From 7ff527df0700d646ab4e011f7c4c1d8b06b38b15 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:20:12 -0400 Subject: [PATCH 071/223] feat(micromate): read the unit's run state and refresh its serial on demand Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/client.py | 27 ++++++++++++++++++++++--- micromate/models.py | 8 ++++++++ tests/test_micromate_client.py | 37 ++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/micromate/client.py b/micromate/client.py index 5b8cdf0..5b6a17e 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -40,7 +40,13 @@ from typing import Optional from minimateplus.transport import BaseTransport -from .models import MicromateDeviceInfo, MicromateEventRef, MicromateSetup, MicromateState +from .models import ( + MicromateDeviceInfo, + MicromateEventRef, + MicromateRunState, + MicromateSetup, + MicromateState, +) from .protocol import MicromateProtocol, ProtocolError from .setup_block import decode_setup @@ -365,16 +371,31 @@ class MicromateClient: # ── Events ──────────────────────────────────────────────────────────────── - def serial(self) -> str: + def serial(self, *, refresh: bool = False) -> str: """The unit's serial, cached from `connect()` or read on demand. Needed by anything that handles an event, because an event key is ambiguous without it — see `MicromateEventRef`. + + `refresh=True` forces a fresh `0x15` read. A change operation passes it + right before writing, so the identity check never runs against a serial + cached from an earlier call-up (a modem may have moved to another unit). """ - if self._serial is None: + if refresh or self._serial is None: self._serial = _cstring(_content(self._proto.read_serial())) return self._serial + _RUN_STATES = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"} + + def read_run_state(self) -> MicromateRunState: + """`SUB 0x49` -> the unit's run state, with the in-call-home value kept + (connect()'s `monitoring` bool flattens 0x03 into True).""" + c = _content(self._proto.read_state()) + if not c: + raise ProtocolError("0x49 state reply has no content") + code = c[_STATE_FLAG] + return MicromateRunState(code, self._RUN_STATES.get(code, f"unknown(0x{code:02X})")) + def list_events(self, *, with_records: bool = True) -> list[MicromateEventRef]: """Walk the event chain. `0x93 → 1E`, then `0x93 → 1F` until the sentinel. diff --git a/micromate/models.py b/micromate/models.py index 68054c7..48bcba6 100644 --- a/micromate/models.py +++ b/micromate/models.py @@ -155,6 +155,14 @@ class IdfReport: ) +@dataclass(frozen=True) +class MicromateRunState: + """`SUB 0x49` content[0]. 0x00 idle, 0x02 monitoring, 0x03 calling home + (ten of ten in the 10-14 ACH session); anything else is named, not guessed.""" + code: int + name: str + + # ── IdfPeaks / IdfProjectInfo / IdfSensorCheck (narrow grouping types) ─────── diff --git a/tests/test_micromate_client.py b/tests/test_micromate_client.py index 22f0ce0..8efea13 100644 --- a/tests/test_micromate_client.py +++ b/tests/test_micromate_client.py @@ -574,3 +574,40 @@ def test_read_unsolicited_sends_nothing_and_returns_what_arrived(): mm, t = client([b"\r\nRADIO RING\r\n"]) assert mm.read_unsolicited() == b"\r\nRADIO RING\r\n" assert t.written == [] + +# ── run state (0x49) and a fresh serial ─────────────────────────────────────── + +import json as _json # noqa: E402 +from pathlib import Path # noqa: E402 + +_WRITES = Path(__file__).parent / "fixtures" / "micromate-writes" + + +def _captured_0x49(): + ex = _json.loads((_WRITES / "monitor-start-stop.json").read_text())["exchanges"] + return [bytes.fromhex(e["response_data"]) for e in ex if e["sub"] == 0x49] + + +def test_run_state_names_thors_captured_states(): + datas = _captured_0x49() + names = [] + for d in datas: + mm, _t = client([frame(0xB6, d)]) + names.append(mm.read_run_state().name) + assert "idle" in names and "monitoring" in names + + +@pytest.mark.parametrize("code,name", [(0x00, "idle"), (0x02, "monitoring"), + (0x03, "calling_home"), (0x07, "unknown(0x07)")]) +def test_run_state_names_every_value(code, name): + data = bytes(11) + bytes([code]) + bytes(4) + mm, _t = client([frame(0xB6, data)]) + st = mm.read_run_state() + assert (st.code, st.name) == (code, name) + + +def test_serial_refresh_reads_the_unit_again(): + mm, t = client([frame(0xEA, bytes(11) + b"UM20147\x00\x00\x00")]) + mm._serial = "UM99999" # a stale cached serial + assert mm.serial(refresh=True) == "UM20147" + assert len(t.written) == 1 -- 2.54.1 From fb9b48f25983bd3f214c6defc1fec062c8c5b2d7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:22:28 -0400 Subject: [PATCH 072/223] feat(sfm): device_commands audit table -- one row per change attempt Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/audit.py | 16 ++++++ sfm/database.py | 92 +++++++++++++++++++++++++++++++++++ sfm/server.py | 11 +++++ tests/test_device_commands.py | 41 ++++++++++++++++ 4 files changed, 160 insertions(+) create mode 100644 sfm/audit.py create mode 100644 tests/test_device_commands.py diff --git a/sfm/audit.py b/sfm/audit.py new file mode 100644 index 0000000..69084b0 --- /dev/null +++ b/sfm/audit.py @@ -0,0 +1,16 @@ +"""The SDM side of the device audit: DeviceAccess calls this sink, which writes +SeismoDb.device_commands. Kept here so sfm.device_access never imports the DB.""" +from __future__ import annotations + +from typing import Any, Callable + + +class DbAudit: + def __init__(self, get_db: Callable[[], Any]) -> None: + self._get_db = get_db + + def begin(self, **fields: Any) -> str: + return self._get_db().begin_device_command(**fields) + + def finish(self, command_id: str, **fields: Any) -> None: + self._get_db().finish_device_command(command_id, **fields) diff --git a/sfm/database.py b/sfm/database.py index b2ebf08..dbc31f5 100644 --- a/sfm/database.py +++ b/sfm/database.py @@ -34,6 +34,7 @@ Usage from __future__ import annotations import datetime +import json import logging import sqlite3 import uuid @@ -126,6 +127,24 @@ CREATE TABLE IF NOT EXISTS monitor_log ( CREATE INDEX IF NOT EXISTS idx_monitor_log_serial ON monitor_log(serial); CREATE INDEX IF NOT EXISTS idx_monitor_log_start ON monitor_log(start_time); CREATE INDEX IF NOT EXISTS idx_monitor_log_session ON monitor_log(session_id); + +CREATE TABLE IF NOT EXISTS device_commands ( + id TEXT PRIMARY KEY, + ts TEXT NOT NULL, -- when the attempt began (UTC ISO) + finished_ts TEXT, + serial TEXT NOT NULL, + series INTEGER NOT NULL, + address TEXT NOT NULL, + action TEXT NOT NULL, -- e.g. "start monitoring" + tier TEXT NOT NULL, -- "change" | "destructive" + request TEXT, -- JSON: parameters + the planned frames (hex) + ack TEXT, -- JSON: ack summary + verified TEXT, -- "ok" | "mismatch" | "not_checked" + outcome TEXT NOT NULL, -- "pending" | "sent" | "skipped" | "failed" + error TEXT, + caller TEXT -- "webapp" | "terra-view" | "script" | ... +); +CREATE INDEX IF NOT EXISTS idx_device_commands_serial ON device_commands(serial, ts); """ @@ -372,6 +391,79 @@ class SeismoDb: ).fetchall() return [dict(r) for r in rows] + # ── Device command audit ────────────────────────────────────────────────── + + def begin_device_command( + self, + *, + serial: str, + series: int, + address: str, + action: str, + tier: str, + request: dict, + caller: str, + ) -> str: + """Write a ``pending`` audit row BEFORE anything is sent. Returns its id.""" + cid = self._new_id() + ts = datetime.datetime.now(datetime.timezone.utc).isoformat() + with self._connect() as conn: + conn.execute( + """ + INSERT INTO device_commands + (id, ts, serial, series, address, action, tier, + request, outcome, caller) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'pending', ?) + """, + (cid, ts, serial, series, address, action, tier, + json.dumps(request), caller), + ) + return cid + + def finish_device_command( + self, + command_id: str, + *, + outcome: str, + verified: Optional[str], + ack: Optional[dict], + error: Optional[str], + ) -> None: + """Record the result of a command begun with begin_device_command().""" + ts = datetime.datetime.now(datetime.timezone.utc).isoformat() + with self._connect() as conn: + conn.execute( + "UPDATE device_commands SET finished_ts=?, outcome=?, verified=?, " + "ack=?, error=? WHERE id=?", + (ts, outcome, verified, + json.dumps(ack) if ack is not None else None, + error, command_id), + ) + + def query_device_commands( + self, + serial: Optional[str] = None, + limit: int = 100, + ) -> list[dict]: + """Return audit rows, newest first, with request/ack parsed from JSON.""" + with self._connect() as conn: + if serial: + rows = conn.execute( + "SELECT * FROM device_commands WHERE serial=? " + "ORDER BY ts DESC LIMIT ?", (serial, limit)).fetchall() + else: + rows = conn.execute( + "SELECT * FROM device_commands ORDER BY ts DESC LIMIT ?", + (limit,)).fetchall() + out = [] + for r in rows: + d = dict(r) + for k in ("request", "ack"): + if d[k] is not None: + d[k] = json.loads(d[k]) + out.append(d) + return out + # ── Events ──────────────────────────────────────────────────────────────── def insert_events( diff --git a/sfm/server.py b/sfm/server.py index b228ff1..0d7c3e4 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -3080,6 +3080,17 @@ def db_sessions( return {"count": len(rows), "sessions": rows} +@app.get("/db/device_commands") +def db_device_commands( + serial: Optional[str] = Query(None, description="Filter by unit serial"), + limit: int = Query(100, description="Max rows to return"), +) -> dict: + """ + The audit trail of changes SFM attempted on units, newest first. + """ + return {"commands": _get_db().query_device_commands(serial, limit)} + + # ── Entry point ──────────────────────────────────────────────────────────────── if __name__ == "__main__": diff --git a/tests/test_device_commands.py b/tests/test_device_commands.py new file mode 100644 index 0000000..ac15255 --- /dev/null +++ b/tests/test_device_commands.py @@ -0,0 +1,41 @@ +"""The device_commands audit table: one row per change attempt, pending -> result.""" +from __future__ import annotations + +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from sfm.audit import DbAudit # noqa: E402 +from sfm.database import SeismoDb # noqa: E402 + +ROW = dict(serial="UM20147", series=4, address="serial:/dev/ttyACM0", + action="start monitoring", tier="change", + request={"plan": {"steps": [{"sub": "0x96"}]}}, caller="test") + + +def test_a_command_is_pending_until_finished(tmp_path): + db = SeismoDb(tmp_path / "s.db") + cid = db.begin_device_command(**ROW) + row = db.query_device_commands(serial="UM20147")[0] + assert (row["id"], row["outcome"], row["verified"]) == (cid, "pending", None) + assert row["request"]["plan"]["steps"][0]["sub"] == "0x96" + db.finish_device_command(cid, outcome="sent", verified="ok", + ack={"subs": ["0x69"]}, error=None) + row = db.query_device_commands(serial="UM20147")[0] + assert (row["outcome"], row["verified"], row["ack"]) == ("sent", "ok", {"subs": ["0x69"]}) + assert row["finished_ts"] + + +def test_the_table_survives_reopening(tmp_path): + SeismoDb(tmp_path / "s.db").begin_device_command(**ROW) + assert len(SeismoDb(tmp_path / "s.db").query_device_commands()) == 1 + + +def test_db_audit_is_a_thin_sink(tmp_path): + db = SeismoDb(tmp_path / "s.db") + audit = DbAudit(lambda: db) + cid = audit.begin(**ROW) + audit.finish(cid, outcome="failed", verified="mismatch", ack=None, error="unit reads idle") + row = db.query_device_commands()[0] + assert (row["outcome"], row["verified"], row["error"]) == ("failed", "mismatch", "unit reads idle") -- 2.54.1 From ff0cce1cb2c59cda688b7ce2af24ad68290aa01d Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:24:46 -0400 Subject: [PATCH 073/223] fix(sfm): an audit row can be finished once, from pending -- anything else raises Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/database.py | 12 ++++++++++-- sfm/server.py | 2 +- tests/test_device_commands.py | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/sfm/database.py b/sfm/database.py index dbc31f5..468c7e1 100644 --- a/sfm/database.py +++ b/sfm/database.py @@ -131,6 +131,7 @@ CREATE INDEX IF NOT EXISTS idx_monitor_log_session ON monitor_log(session_id); CREATE TABLE IF NOT EXISTS device_commands ( id TEXT PRIMARY KEY, ts TEXT NOT NULL, -- when the attempt began (UTC ISO) + -- ts/finished_ts: tz-aware UTC ISO (+00:00), unlike the naive UTC of older tables finished_ts TEXT, serial TEXT NOT NULL, series INTEGER NOT NULL, @@ -432,13 +433,20 @@ class SeismoDb: """Record the result of a command begun with begin_device_command().""" ts = datetime.datetime.now(datetime.timezone.utc).isoformat() with self._connect() as conn: - conn.execute( + cur = conn.execute( "UPDATE device_commands SET finished_ts=?, outcome=?, verified=?, " - "ack=?, error=? WHERE id=?", + "ack=?, error=? WHERE id=? AND outcome='pending'", (ts, outcome, verified, json.dumps(ack) if ack is not None else None, error, command_id), ) + if cur.rowcount == 0: + known = conn.execute( + "SELECT 1 FROM device_commands WHERE id=?", + (command_id,)).fetchone() + raise ValueError( + f"device command {command_id} " + + ("is already finished" if known else "is unknown")) def query_device_commands( self, diff --git a/sfm/server.py b/sfm/server.py index 0d7c3e4..54ec0ae 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -3083,7 +3083,7 @@ def db_sessions( @app.get("/db/device_commands") def db_device_commands( serial: Optional[str] = Query(None, description="Filter by unit serial"), - limit: int = Query(100, description="Max rows to return"), + limit: int = Query(100, ge=1, le=1000, description="Max rows to return"), ) -> dict: """ The audit trail of changes SFM attempted on units, newest first. diff --git a/tests/test_device_commands.py b/tests/test_device_commands.py index ac15255..3a9229c 100644 --- a/tests/test_device_commands.py +++ b/tests/test_device_commands.py @@ -39,3 +39,26 @@ def test_db_audit_is_a_thin_sink(tmp_path): audit.finish(cid, outcome="failed", verified="mismatch", ack=None, error="unit reads idle") row = db.query_device_commands()[0] assert (row["outcome"], row["verified"], row["error"]) == ("failed", "mismatch", "unit reads idle") + + +def test_finishing_an_unknown_id_raises_and_creates_nothing(tmp_path): + import pytest + db = SeismoDb(tmp_path / "s.db") + with pytest.raises(ValueError, match="no-such-id"): + db.finish_device_command("no-such-id", outcome="sent", verified="ok", + ack=None, error=None) + assert db.query_device_commands() == [] + + +def test_a_second_finish_raises_and_keeps_the_first_result(tmp_path): + import pytest + db = SeismoDb(tmp_path / "s.db") + cid = db.begin_device_command(**ROW) + db.finish_device_command(cid, outcome="failed", verified="mismatch", + ack={"subs": ["0x69"]}, error="unit reads idle") + with pytest.raises(ValueError, match=cid): + db.finish_device_command(cid, outcome="sent", verified="ok", + ack={"other": 1}, error=None) + row = db.query_device_commands()[0] + assert (row["outcome"], row["verified"], row["ack"], row["error"]) == \ + ("failed", "mismatch", {"subs": ["0x69"]}, "unit reads idle") -- 2.54.1 From eada7ba767cb8f7e51dcba2badeae1d1d3e4d3dc Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:29:03 -0400 Subject: [PATCH 074/223] feat(sfm): start/stop monitoring for Series 4 -- identity, state, dry run, audit, read-back, never retried Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 2 +- sfm/device_access/access.py | 41 ++++++-- sfm/device_access/models.py | 19 ++++ sfm/device_access/s3.py | 5 +- sfm/device_access/s4.py | 92 +++++++++++++++++- tests/device_access_fakes.py | 29 +++++- tests/test_device_access_change.py | 151 +++++++++++++++++++++++++++++ 7 files changed, 326 insertions(+), 13 deletions(-) create mode 100644 tests/test_device_access_change.py diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index 8c82123..a9318fe 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -5,7 +5,7 @@ from .errors import ( translate, ) from .models import ( - DownloadedEvent, EventDownload, EventList, EventRef, UnitAddress, UnitInfo, + ChangeResult, DownloadedEvent, EventDownload, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus, ) from .series import normalise_serial, series_for_serial diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index a22459e..0898e48 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -12,10 +12,10 @@ from typing import Any, Callable, Dict, Optional from .errors import ConnectFailed, DeviceError, NoAnswer, WrongUnit from .events import parse_event_id from .locks import UnitLocks -from .models import DownloadedEvent, EventList, UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .models import ChangeResult, DownloadedEvent, EventList, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .s3 import Series3Adapter, default_s3_client_factory from .s4 import ( - Series4Session, default_s4_client_factory, s4_download_event, s4_identify, s4_list_events, + Series4Session, default_s4_client_factory, s4_change_monitoring, s4_download_event, s4_identify, s4_list_events, s4_settings, s4_status, ) from .series import normalise_serial, series_for_serial @@ -34,7 +34,15 @@ class DeviceAccess: idle_hangup_s: float = 300.0, reaper_interval_s: float = 5.0, start_reaper: bool = True, + audit: Any = None, + sleep: Callable[[float], None] = time.sleep, + verify_timeout_s: float = 60.0, + verify_interval_s: float = 2.0, ) -> None: + self._audit = audit + self._sleep = sleep + self._verify_timeout_s = verify_timeout_s + self._verify_interval_s = verify_interval_s self._locks = UnitLocks(lock_timeout) self._s3 = Series3Adapter(s3_client_factory) self._s4_factory = s4_client_factory @@ -70,6 +78,27 @@ class DeviceAccess: lambda a, s: self._s3.download_event(a, s, key, stamp), lambda c, s: s4_download_event(c, s, key, stamp)) + def start_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False, + even_if_already: bool = False, caller: str = "api") -> ChangeResult: + return self._change_monitoring(address, serial, start=True, dry_run=dry_run, + even_if_already=even_if_already, caller=caller) + + def stop_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False, + even_if_already: bool = False, caller: str = "api") -> ChangeResult: + return self._change_monitoring(address, serial, start=False, dry_run=dry_run, + even_if_already=even_if_already, caller=caller) + + def _change_monitoring(self, address, serial, *, start, dry_run, even_if_already, caller): + kw = dict(start=start, dry_run=dry_run, even_if_already=even_if_already, + audit=self._audit, caller=caller, sleep=self._sleep, + verify_timeout_s=self._verify_timeout_s, + verify_interval_s=self._verify_interval_s) + return self._dispatch( + address, serial, + lambda a, s: self._s3.change_monitoring(a, s, **kw), + lambda c, s: s4_change_monitoring(c, s, address=address, **kw), + change=True) + def held_serial(self, address: UnitAddress) -> Optional[str]: """Serial of the OPEN held Series-4 line at this address, else None. No I/O.""" with self._sessions_guard: @@ -92,7 +121,7 @@ class DeviceAccess: def _dispatch(self, address: UnitAddress, serial: str, s3_op: Callable[[UnitAddress, str], Any], - s4_op: Callable[[Any, str], Any]) -> Any: + s4_op: Callable[[Any, str], Any], *, change: bool = False) -> Any: serial = normalise_serial(serial) series = series_for_serial(serial) # raises BadRequest before any I/O with self._locks.hold(address.key): @@ -115,9 +144,9 @@ class DeviceAccess: # learns at EOF), so the first request on it times out or fails. # Call up fresh and retry ONCE. Safe only because every operation # here is a read (identify, status, settings, list, download -- all - # idempotent); writes (phase 3) must NOT - # inherit this -- a write whose ack was lost must never be sent twice. - if was_held and isinstance(exc, (NoAnswer, ConnectFailed)): + # idempotent). A change (`change=True`) is never retried, by + # construction: a write whose ack was lost must never be sent twice. + if was_held and not change and isinstance(exc, (NoAnswer, ConnectFailed)): self._drop(address.key, session) session.hang_up() session = self._session_for(address, serial) diff --git a/sfm/device_access/models.py b/sfm/device_access/models.py index f3f64af..2d8534c 100644 --- a/sfm/device_access/models.py +++ b/sfm/device_access/models.py @@ -132,3 +132,22 @@ class DownloadedEvent: timestamp: Optional[datetime.datetime] = None record: Dict[str, Any] = field(default_factory=dict) detail: Dict[str, Any] = field(default_factory=dict) + + +@dataclass +class ChangeResult: + """The outcome of a change request. `outcome`: "dry_run" | "skipped" | "sent" | + "failed". `verified`: "ok" | "mismatch" | "not_checked". `plan` is the exact + frames planned (dry run) or sent.""" + serial: str + series: int + action: str + dry_run: bool + sent: bool + outcome: str + verified: str + state_before: Optional[str] + state_after: Optional[str] + audit_id: Optional[str] + plan: Dict[str, Any] = field(default_factory=dict) + detail: Dict[str, Any] = field(default_factory=dict) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index e965ecf..77de656 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -11,7 +11,7 @@ from minimateplus import MiniMateClient from minimateplus.blastware_file import blastware_filename from minimateplus.transport import TcpTransport -from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, StaleEvent, WrongUnit, translate +from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent, WrongUnit, translate from .events import iso_of, make_event_id, stamp_of from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus @@ -85,6 +85,9 @@ class Series3Adapter: def __init__(self, client_factory: Callable[..., Any] = default_s3_client_factory) -> None: self._factory = client_factory + def change_monitoring(self, address: UnitAddress, serial: str, **kw: Any) -> Any: + raise NotSupported("Series 3 start/stop through DeviceAccess arrives in Task 5") + def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None) -> Any: def attempt() -> Any: client = self._factory(address) if timeout is None else self._factory(address, timeout=timeout) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index a1ceada..fff5a75 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -12,13 +12,15 @@ from typing import Any, Callable, Optional, TypeVar from micromate.client import MicromateClient from micromate.protocol import THOR_CHUNK_SIZE +from micromate.writes import plan_start_monitoring, plan_stop_monitoring from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import ( - CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, StaleEvent, WrongUnit, translate, + CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, NotSupported, StaleEvent, + WrongUnit, translate, ) from .events import iso_of, make_event_id, stamp_of -from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .models import ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial log = logging.getLogger("sfm.device_access") @@ -121,6 +123,8 @@ class Series4Session: so it hangs up too -- conservative, since the link may be fine. Operations added in later phases must keep to this: never wrap a link failure in a `DeviceError` inside an op, or the line stays open on a broken link. + The one exception: `CallHomeInProgress` and `WrongUnit` release the line, + because the line itself is the problem. """ def __init__(self, address: UnitAddress, serial: str, @@ -168,6 +172,14 @@ class Series4Session: log.warning("RADIO RING from %s -- released the line so the call reaches THOR", self.address.key) raise CallHomeInProgress(_RING_MESSAGE) from exc + except (CallHomeInProgress, WrongUnit) as exc: + # The line itself is the problem: a call-home rides whatever holds the + # modem's single TCP session, and a line held for X that answers as Y + # must not stay held. + self.hang_up() + log.warning("%s at %s -- released the line: %s", type(exc).__name__, + self.address.key, exc) + raise except DeviceError: # The operation's own verdict (event not found, stale id): the line # is healthy, so keep it. Library errors still hang up below. @@ -306,3 +318,79 @@ def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str] detail={"size_bytes": ref.size, "pvs_error": err}, ) raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") + + +def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool, + even_if_already: bool, audit: Any, address: UnitAddress, + caller: str, sleep: Callable[[float], None], + verify_timeout_s: float, verify_interval_s: float) -> ChangeResult: + """Identity -> state -> (dry run | skip | audit -> send -> read back -> audit).""" + action = "start monitoring" if start else "stop monitoring" + want = "monitoring" if start else "idle" + + reported = normalise_serial(client.serial(refresh=True)) + if reported != serial: + raise WrongUnit(f"asked for {serial} but {reported} answered at {address.key} -- " + "nothing sent") + before = client.read_run_state() + if before.name == "calling_home": + raise CallHomeInProgress(_RING_MESSAGE) + plan = plan_start_monitoring() if start else plan_stop_monitoring() + planned = dict(plan.describe(), sends_nothing=dry_run) + base = dict(serial=serial, series=4, action=action, plan=planned, + state_before=before.name) + + if dry_run: + return ChangeResult(dry_run=True, sent=False, outcome="dry_run", + verified="not_checked", state_after=None, audit_id=None, **base) + if audit is None: + raise NotSupported("no audit log is configured -- SFM refuses to change a unit " + "without one (nothing sent)") + request = {"plan": planned, "even_if_already": even_if_already} + cid = audit.begin(serial=serial, series=4, address=address.key, action=action, + tier="change", request=request, caller=caller) + if before.name == want and not even_if_already: + audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, + error=f"already {want}") + return ChangeResult(dry_run=False, sent=False, outcome="skipped", + verified="not_checked", state_after=before.name, + audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base) + + try: + acks = client.protocol.execute(plan) + except Exception as exc: # noqa: BLE001 -- recorded, never retried + after = _try_run_state(client) + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}") + if after is None: + raise # the line is suspect: let _exchange hang up + return ChangeResult(dry_run=False, sent=True, outcome="failed", + verified="not_checked", state_after=after, audit_id=cid, + detail={"error": f"no clean ack: {exc}"}, **base) + + ack = {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]} + seen = [before.name] + polls = int(verify_timeout_s // verify_interval_s) + try: + for _ in range(polls): + sleep(verify_interval_s) + seen.append(client.read_run_state().name) + if seen[-1] == want: + break + except Exception as exc: # noqa: BLE001 -- the row must not stay pending + audit.finish(cid, outcome="failed", verified="not_checked", ack=ack, + error=f"sent, but the read-back failed: {exc}") + raise + ok = seen[-1] == want + audit.finish(cid, outcome="sent" if ok else "failed", verified="ok" if ok else "mismatch", + ack=ack, error=None if ok else f"unit reads {seen[-1]}, expected {want}") + return ChangeResult(dry_run=False, sent=True, outcome="sent" if ok else "failed", + verified="ok" if ok else "mismatch", state_after=seen[-1], + audit_id=cid, detail={"states_seen": seen, "ack": ack}, **base) + + +def _try_run_state(client: Any) -> Optional[str]: + try: + return client.read_run_state().name + except Exception: # noqa: BLE001 + return None diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 48eb45a..85fb7c6 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -157,12 +157,24 @@ class _FakeProtocol: def poll(self): self._owner._step("poll") + def execute(self, plan): + self._owner._step("execute") + self._owner.executed.append(plan) + if self._owner.execute_error is not None: + raise self._owner.execute_error + return [type("Ack", (), {"sub": s.ack_sub, "data": bytes(11)})() for s in plan.steps] + class FakeMicromateClient(_Base): def __init__(self, serial="UM20147", *, monitoring=False, events=5, - unsolicited=b"", event_refs=None, **kw): + unsolicited=b"", event_refs=None, run_states=None, + serial_reported=None, execute_error=None, **kw): super().__init__(**kw) - self.serial = serial + self.unit_serial = serial # not `serial`: that is the client's method + self.run_states = list(run_states) if run_states else [0x00] + self.serial_reported = serial if serial_reported is None else serial_reported + self.execute_error = execute_error + self.executed = [] self.monitoring = monitoring self.events = events self.unsolicited = unsolicited @@ -177,10 +189,21 @@ class FakeMicromateClient(_Base): def connect(self) -> MicromateDeviceInfo: self._step("connect") return MicromateDeviceInfo( - serial=self.serial, manufacturer="Instantel", model="MM/ISEE/S", + serial=self.unit_serial, manufacturer="Instantel", model="MM/ISEE/S", firmware_line="thor", monitoring=self.monitoring, active_setup="test2.MMB", ) + def serial(self, *, refresh=False): + self._step("serial") + return self.serial_reported + + def read_run_state(self): + from micromate.models import MicromateRunState + self._step("read_run_state") + code = self.run_states.pop(0) if len(self.run_states) > 1 else self.run_states[0] + names = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"} + return MicromateRunState(code, names.get(code, f"unknown(0x{code:02X})")) + def get_state(self) -> MicromateState: self._step("get_state") return MicromateState( diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py new file mode 100644 index 0000000..cc9b249 --- /dev/null +++ b/tests/test_device_access_change.py @@ -0,0 +1,151 @@ +"""Start/stop through the safety layer: identity, state, dry run, audit, read-back, no retry.""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import micromate.protocol as mm_proto # noqa: E402 +from device_access_fakes import FakeMicromateClient # noqa: E402 +from sfm.device_access.access import DeviceAccess # noqa: E402 +from sfm.device_access.errors import ( # noqa: E402 + CallHomeInProgress, NotSupported, WrongUnit, +) +from sfm.device_access.models import UnitAddress # noqa: E402 + +ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) + + +class Audit: + def __init__(self): + self.rows = {} + + def begin(self, **f): + cid = f"c{len(self.rows) + 1}" + self.rows[cid] = dict(f, outcome="pending") + return cid + + def finish(self, cid, **f): + self.rows[cid].update(f) + + +def access(fake, audit="default"): + return DeviceAccess(s4_client_factory=lambda a, **kw: fake, start_reaper=False, + audit=Audit() if audit == "default" else audit, + sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) + + +def test_a_dry_run_returns_the_exact_frames_and_sends_nothing(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147", dry_run=True) + assert (r.dry_run, r.sent, r.outcome, r.state_before) == (True, False, "dry_run", "idle") + assert r.plan["steps"][0]["frame"] == "41021010009600ffff00000000000000000000a403" + assert r.plan["sends_nothing"] is True + assert fake.executed == [] and da._audit.rows == {} + + +def test_start_sends_once_and_verifies_by_reading_back(): + fake = FakeMicromateClient(run_states=[0x00, 0x00, 0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.sent, r.outcome, r.verified, r.state_after) == (True, "sent", "ok", "monitoring") + assert len(fake.executed) == 1 + row = da._audit.rows[r.audit_id] + assert (row["outcome"], row["verified"], row["action"]) == ("sent", "ok", "start monitoring") + assert r.detail["states_seen"][-1] == "monitoring" + assert r.plan["sends_nothing"] is False + assert row["request"]["plan"]["sends_nothing"] is False + + +def test_already_in_state_is_skipped_and_audited_as_skipped(): + fake = FakeMicromateClient(run_states=[0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.sent, r.outcome) == (False, "skipped") and fake.executed == [] + assert da._audit.rows[r.audit_id]["outcome"] == "skipped" + + +def test_even_if_already_sends_anyway(): + fake = FakeMicromateClient(run_states=[0x02]) + r = access(fake).start_monitoring(ADDR, "UM20147", even_if_already=True) + assert r.sent and len(fake.executed) == 1 + + +def test_a_unit_calling_home_is_refused_and_nothing_is_sent(): + fake = FakeMicromateClient(run_states=[0x03]) + da = access(fake) + with pytest.raises(CallHomeInProgress): + da.stop_monitoring(ADDR, "UM20147") + assert fake.executed == [] + assert fake.is_open() is False # the line was released for THOR + assert da.held_serial(ADDR) is None # and the session dropped + + +def test_a_different_unit_on_the_fresh_serial_read_is_refused_before_writing(): + fake = FakeMicromateClient(serial_reported="UM12947") + da = access(fake) + with pytest.raises(WrongUnit): + da.start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + assert fake.is_open() is False + assert da.held_serial(ADDR) is None + + +def test_a_live_change_without_an_audit_sink_is_refused(): + fake = FakeMicromateClient() + with pytest.raises(NotSupported, match="audit"): + access(fake, audit=None).start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_a_clean_ack_but_no_state_change_is_a_failed_change(): + fake = FakeMicromateClient(run_states=[0x00]) # never leaves idle + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert (r.outcome, r.verified, r.state_after) == ("failed", "mismatch", "idle") + assert len(r.detail["states_seen"]) == 4 # 6 s window / 2 s + the first read + assert da._audit.rows[r.audit_id]["verified"] == "mismatch" + + +def test_a_lost_ack_is_never_retried(): + fake = FakeMicromateClient(run_states=[0x00, 0x02], + execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + assert (r.outcome, r.state_after) == ("failed", "monitoring") + assert "no ack" in r.detail["error"] + assert da._audit.rows[r.audit_id]["outcome"] == "failed" + + +def test_a_change_on_a_dropped_held_line_is_not_retried(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + da.status(ADDR, "UM20147") # hold the line + fake.fail = [mm_proto.TimeoutError("peer gone")] # next call fails + with pytest.raises(Exception): + da.start_monitoring(ADDR, "UM20147") + assert fake.executed == [] # never reached the write, never re-tried + + +def test_a_read_back_that_fails_still_finishes_the_audit_row(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + orig = fake.read_run_state + calls = [] + + def flaky(): + calls.append(1) + if len(calls) == 2: # the first read-back + raise mm_proto.TimeoutError("dropped") + return orig() + fake.read_run_state = flaky + with pytest.raises(Exception): + da.start_monitoring(ADDR, "UM20147") + (row,) = da._audit.rows.values() + assert len(fake.executed) == 1 + assert (row["outcome"], row["verified"]) == ("failed", "not_checked") -- 2.54.1 From 14ea80f5a40e27e0b464148c3e2b0945ff539f77 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:39:55 -0400 Subject: [PATCH 075/223] fix(sfm): a ring or a refusal is never mistaken for a send; fresh serial pinned; unmeasured states refused Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/__init__.py | 4 +- sfm/device_access/access.py | 7 +- sfm/device_access/errors.py | 10 +++ sfm/device_access/s4.py | 58 ++++++++++++---- tests/device_access_fakes.py | 2 +- tests/test_device_access_change.py | 106 +++++++++++++++++++++++++++-- 6 files changed, 166 insertions(+), 21 deletions(-) diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index a9318fe..5c00303 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -1,7 +1,7 @@ """One door for every device request -- see the 2026-10-20 parity spec.""" from .errors import ( - BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, EventNotFound, - MalformedReply, NoAnswer, NotSupported, StaleEvent, UnitBusy, WrongUnit, + AuditUnavailable, BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, EventNotFound, + MalformedReply, NoAnswer, NotSupported, StaleEvent, UnitBusy, UnitStateUnknown, WrongUnit, translate, ) from .models import ( diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index 0898e48..84f7755 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -9,7 +9,7 @@ import threading import time from typing import Any, Callable, Dict, Optional -from .errors import ConnectFailed, DeviceError, NoAnswer, WrongUnit +from .errors import ConnectFailed, DeviceError, NoAnswer, NotSupported, WrongUnit from .events import parse_event_id from .locks import UnitLocks from .models import ChangeResult, DownloadedEvent, EventList, UnitAddress, UnitInfo, UnitSettings, UnitStatus @@ -39,6 +39,8 @@ class DeviceAccess: verify_timeout_s: float = 60.0, verify_interval_s: float = 2.0, ) -> None: + if verify_interval_s <= 0 or verify_timeout_s < verify_interval_s: + raise ValueError("verify_interval_s must be > 0 and verify_timeout_s >= verify_interval_s") self._audit = audit self._sleep = sleep self._verify_timeout_s = verify_timeout_s @@ -89,6 +91,9 @@ class DeviceAccess: even_if_already=even_if_already, caller=caller) def _change_monitoring(self, address, serial, *, start, dry_run, even_if_already, caller): + if not dry_run and self._audit is None: + raise NotSupported("no audit log is configured -- SFM refuses to change a unit " + "without one (nothing sent)") kw = dict(start=start, dry_run=dry_run, even_if_already=even_if_already, audit=self._audit, caller=caller, sleep=self._sleep, verify_timeout_s=self._verify_timeout_s, diff --git a/sfm/device_access/errors.py b/sfm/device_access/errors.py index 728ba35..35b4c29 100644 --- a/sfm/device_access/errors.py +++ b/sfm/device_access/errors.py @@ -21,6 +21,16 @@ class WrongUnit(DeviceError): http_status = 409 +class UnitStateUnknown(DeviceError): + """The unit reports a run state that has never been measured.""" + http_status = 409 + + +class AuditUnavailable(DeviceError): + """The audit row could not be written, so nothing was sent.""" + http_status = 503 + + class UnitBusy(DeviceError): http_status = 423 diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index fff5a75..837b0b8 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -11,13 +11,14 @@ import time from typing import Any, Callable, Optional, TypeVar from micromate.client import MicromateClient +from micromate.opcodes import OpcodeRefused from micromate.protocol import THOR_CHUNK_SIZE from micromate.writes import plan_start_monitoring, plan_stop_monitoring from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import ( - CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, NotSupported, StaleEvent, - WrongUnit, translate, + AuditUnavailable, CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, NotSupported, StaleEvent, + UnitStateUnknown, WrongUnit, translate, ) from .events import iso_of, make_event_id, stamp_of from .models import ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus @@ -335,6 +336,9 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool before = client.read_run_state() if before.name == "calling_home": raise CallHomeInProgress(_RING_MESSAGE) + if before.name.startswith("unknown") and not dry_run: + raise UnitStateUnknown(f"the unit reports run state {before.name}, which has never " + "been measured -- nothing sent") plan = plan_start_monitoring() if start else plan_stop_monitoring() planned = dict(plan.describe(), sends_nothing=dry_run) base = dict(serial=serial, series=4, action=action, plan=planned, @@ -347,8 +351,12 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool raise NotSupported("no audit log is configured -- SFM refuses to change a unit " "without one (nothing sent)") request = {"plan": planned, "even_if_already": even_if_already} - cid = audit.begin(serial=serial, series=4, address=address.key, action=action, - tier="change", request=request, caller=caller) + try: + cid = audit.begin(serial=serial, series=4, address=address.key, action=action, + tier="change", request=request, caller=caller) + except Exception as exc: # noqa: BLE001 + raise AuditUnavailable( + f"the audit log could not be written -- nothing sent: {exc}") from exc if before.name == want and not even_if_already: audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, error=f"already {want}") @@ -358,8 +366,25 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool try: acks = client.protocol.execute(plan) + except (OpcodeRefused, TypeError) as exc: # refused by the gate: nothing went out + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"refused before sending: {exc}") + raise + except RingDetected as exc: + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"a call-home began in place of the ack: {exc}") + raise # _exchange releases the line except Exception as exc: # noqa: BLE001 -- recorded, never retried - after = _try_run_state(client) + try: + after = _try_run_state(client) + except RingDetected as ring: + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; a call-home began: {ring}") + raise + if after == "calling_home": + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; the unit is now calling home") + raise CallHomeInProgress(_RING_MESSAGE) from exc audit.finish(cid, outcome="failed", verified="not_checked", ack=None, error=f"no clean ack: {exc}") if after is None: @@ -375,22 +400,29 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool for _ in range(polls): sleep(verify_interval_s) seen.append(client.read_run_state().name) - if seen[-1] == want: + if seen[-1] == want or seen[-1] == "calling_home": break except Exception as exc: # noqa: BLE001 -- the row must not stay pending - audit.finish(cid, outcome="failed", verified="not_checked", ack=ack, - error=f"sent, but the read-back failed: {exc}") + audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, + error=f"sent and acknowledged; reading the state back failed: {exc}") raise + if seen[-1] == "calling_home": + audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, + error="sent and acknowledged; the unit then began calling home") + raise CallHomeInProgress(_RING_MESSAGE) ok = seen[-1] == want - audit.finish(cid, outcome="sent" if ok else "failed", verified="ok" if ok else "mismatch", - ack=ack, error=None if ok else f"unit reads {seen[-1]}, expected {want}") - return ChangeResult(dry_run=False, sent=True, outcome="sent" if ok else "failed", - verified="ok" if ok else "mismatch", state_after=seen[-1], - audit_id=cid, detail={"states_seen": seen, "ack": ack}, **base) + outcome, verified = ("sent", "ok") if ok else ("failed", "mismatch") + audit.finish(cid, outcome=outcome, verified=verified, ack=ack, + error=None if ok else f"unit reads {seen[-1]}, expected {want}") + return ChangeResult(dry_run=False, sent=True, outcome=outcome, verified=verified, + state_after=seen[-1], audit_id=cid, + detail={"states_seen": seen, "ack": ack}, **base) def _try_run_state(client: Any) -> Optional[str]: try: return client.read_run_state().name + except RingDetected: + raise except Exception: # noqa: BLE001 return None diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 85fb7c6..4e9ff9a 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -195,7 +195,7 @@ class FakeMicromateClient(_Base): def serial(self, *, refresh=False): self._step("serial") - return self.serial_reported + return self.serial_reported if refresh else self.unit_serial def read_run_state(self): from micromate.models import MicromateRunState diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index cc9b249..321146b 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -9,10 +9,12 @@ import pytest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import micromate.protocol as mm_proto # noqa: E402 +from micromate.opcodes import OpcodeRefused # noqa: E402 +from sfm.device_access.s4 import RingDetected # noqa: E402 from device_access_fakes import FakeMicromateClient # noqa: E402 from sfm.device_access.access import DeviceAccess # noqa: E402 from sfm.device_access.errors import ( # noqa: E402 - CallHomeInProgress, NotSupported, WrongUnit, + AuditUnavailable, CallHomeInProgress, DeviceError, NoAnswer, NotSupported, UnitStateUnknown, WrongUnit, ) from sfm.device_access.models import UnitAddress # noqa: E402 @@ -56,7 +58,7 @@ def test_start_sends_once_and_verifies_by_reading_back(): assert len(fake.executed) == 1 row = da._audit.rows[r.audit_id] assert (row["outcome"], row["verified"], row["action"]) == ("sent", "ok", "start monitoring") - assert r.detail["states_seen"][-1] == "monitoring" + assert r.detail["states_seen"] == ["idle", "idle", "monitoring"] assert r.plan["sends_nothing"] is False assert row["request"]["plan"]["sends_nothing"] is False @@ -83,6 +85,7 @@ def test_a_unit_calling_home_is_refused_and_nothing_is_sent(): assert fake.executed == [] assert fake.is_open() is False # the line was released for THOR assert da.held_serial(ADDR) is None # and the session dropped + assert ADDR.key not in da._sessions def test_a_different_unit_on_the_fresh_serial_read_is_refused_before_writing(): @@ -93,13 +96,14 @@ def test_a_different_unit_on_the_fresh_serial_read_is_refused_before_writing(): assert fake.executed == [] assert fake.is_open() is False assert da.held_serial(ADDR) is None + assert ADDR.key not in da._sessions def test_a_live_change_without_an_audit_sink_is_refused(): fake = FakeMicromateClient() with pytest.raises(NotSupported, match="audit"): access(fake, audit=None).start_monitoring(ADDR, "UM20147") - assert fake.executed == [] + assert fake.executed == [] and fake.opened == 0 and fake.calls == [] def test_a_clean_ack_but_no_state_change_is_a_failed_change(): @@ -109,9 +113,10 @@ def test_a_clean_ack_but_no_state_change_is_a_failed_change(): assert (r.outcome, r.verified, r.state_after) == ("failed", "mismatch", "idle") assert len(r.detail["states_seen"]) == 4 # 6 s window / 2 s + the first read assert da._audit.rows[r.audit_id]["verified"] == "mismatch" + assert da._audit.rows[r.audit_id]["outcome"] == "failed" -def test_a_lost_ack_is_never_retried(): +def test_a_lost_ack_is_recorded_once_and_not_resent(): fake = FakeMicromateClient(run_states=[0x00, 0x02], execute_error=mm_proto.TimeoutError("no ack")) da = access(fake) @@ -148,4 +153,97 @@ def test_a_read_back_that_fails_still_finishes_the_audit_row(): da.start_monitoring(ADDR, "UM20147") (row,) = da._audit.rows.values() assert len(fake.executed) == 1 + assert (row["outcome"], row["verified"]) == ("sent", "not_checked") + assert row["ack"] is not None + assert "reading the state back failed" in row["error"] + assert fake.is_open() is False and ADDR.key not in da._sessions + + +def test_a_ring_in_place_of_the_ack_is_a_call_home_not_a_send(): + fake = FakeMicromateClient(run_states=[0x00], execute_error=RingDetected("RADIO RING")) + da = access(fake) + with pytest.raises(CallHomeInProgress): + da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + assert fake.is_open() is False and ADDR.key not in da._sessions + (row,) = da._audit.rows.values() assert (row["outcome"], row["verified"]) == ("failed", "not_checked") + assert "call-home began in place of the ack" in row["error"] + + +def test_calling_home_seen_while_polling_releases_the_line(): + fake = FakeMicromateClient(run_states=[0x00, 0x03]) + da = access(fake) + with pytest.raises(CallHomeInProgress): + da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + assert fake.is_open() is False and ADDR.key not in da._sessions + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"]) == ("sent", "not_checked") + assert row["ack"] is not None + + +def test_calling_home_after_a_lost_ack_releases_the_line(): + fake = FakeMicromateClient(run_states=[0x00, 0x03], + execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + with pytest.raises(CallHomeInProgress): + da.start_monitoring(ADDR, "UM20147") + assert fake.is_open() is False + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"]) == ("failed", "not_checked") + + +def test_a_refusal_by_execute_is_not_a_send(): + fake = FakeMicromateClient(execute_error=OpcodeRefused("nope")) + da = access(fake) + with pytest.raises(DeviceError, match="nope"): + da.start_monitoring(ADDR, "UM20147") + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"]) == ("failed", "not_checked") + assert "refused before sending" in row["error"] + + +def test_a_failed_audit_write_sends_nothing(): + class Broken(Audit): + def begin(self, **f): + raise OSError("disk full") + fake = FakeMicromateClient() + with pytest.raises(AuditUnavailable): + access(fake, audit=Broken()).start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_lost_ack_and_failed_follow_up_read_on_a_held_line_releases_it(): + fake = FakeMicromateClient(run_states=[0x00], execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + da.status(ADDR, "UM20147") # hold the line + orig, n = fake.read_run_state, [] + + def flaky(): + n.append(1) + if len(n) == 2: # the follow-up after the lost ack + raise mm_proto.TimeoutError("gone") + return orig() + fake.read_run_state = flaky + with pytest.raises(NoAnswer): + da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + assert fake.is_open() is False and ADDR.key not in da._sessions + + +def test_a_live_change_in_an_unmeasured_state_is_refused_but_a_dry_run_is_not(): + fake = FakeMicromateClient(run_states=[0x07]) + da = access(fake) + with pytest.raises(UnitStateUnknown): + da.start_monitoring(ADDR, "UM20147") + assert fake.executed == [] and da._audit.rows == {} + r = da.start_monitoring(ADDR, "UM20147", dry_run=True) + assert r.state_before == "unknown(0x07)" + + +def test_bad_verify_timings_are_rejected(): + with pytest.raises(ValueError): + DeviceAccess(start_reaper=False, verify_interval_s=0) + with pytest.raises(ValueError): + DeviceAccess(start_reaper=False, verify_interval_s=5, verify_timeout_s=2) -- 2.54.1 From 78c3d568d5d5baaccb89a172a3aeb0944e71f4f2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:45:02 -0400 Subject: [PATCH 076/223] test(sfm): pin the ring-on-follow-up and calling-home poll exits; narrow the refusal clause Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 2 ++ sfm/device_access/s4.py | 2 +- tests/test_device_access_change.py | 36 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index 84f7755..72e2c34 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -91,6 +91,8 @@ class DeviceAccess: even_if_already=even_if_already, caller=caller) def _change_monitoring(self, address, serial, *, start, dry_run, even_if_already, caller): + serial = normalise_serial(serial) + series_for_serial(serial) # BadRequest (422) before the audit check if not dry_run and self._audit is None: raise NotSupported("no audit log is configured -- SFM refuses to change a unit " "without one (nothing sent)") diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 837b0b8..0534015 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -366,7 +366,7 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool try: acks = client.protocol.execute(plan) - except (OpcodeRefused, TypeError) as exc: # refused by the gate: nothing went out + except OpcodeRefused as exc: # refused by the gate: nothing went out audit.finish(cid, outcome="failed", verified="not_checked", ack=None, error=f"refused before sending: {exc}") raise diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 321146b..8d5ccd8 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -177,6 +177,7 @@ def test_calling_home_seen_while_polling_releases_the_line(): with pytest.raises(CallHomeInProgress): da.start_monitoring(ADDR, "UM20147") assert len(fake.executed) == 1 + assert fake.calls.count("read_run_state") == 2 # the read before + the one poll assert fake.is_open() is False and ADDR.key not in da._sessions (row,) = da._audit.rows.values() assert (row["outcome"], row["verified"]) == ("sent", "not_checked") @@ -247,3 +248,38 @@ def test_bad_verify_timings_are_rejected(): DeviceAccess(start_reaper=False, verify_interval_s=0) with pytest.raises(ValueError): DeviceAccess(start_reaper=False, verify_interval_s=5, verify_timeout_s=2) + + +def test_a_ring_on_the_follow_up_read_after_a_lost_ack_finishes_the_row(): + fake = FakeMicromateClient(run_states=[0x00], execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + orig, n = fake.read_run_state, [] + + def ringing(): + n.append(1) + if len(n) == 2: # the first follow-up read + raise RingDetected("RADIO RING") + return orig() + fake.read_run_state = ringing + with pytest.raises(CallHomeInProgress): + da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"]) == ("failed", "not_checked") + assert "a call-home began" in row["error"] + assert fake.is_open() is False and ADDR.key not in da._sessions + + +def test_a_type_error_after_sending_is_recorded_as_no_clean_ack(): + fake = FakeMicromateClient(run_states=[0x00, 0x02], execute_error=TypeError("parser bug")) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert len(fake.executed) == 1 and r.sent is True + assert "no clean ack" in da._audit.rows[r.audit_id]["error"] + assert "refused before sending" not in da._audit.rows[r.audit_id]["error"] + + +def test_a_malformed_serial_is_422_even_without_an_audit_sink(): + from sfm.device_access.errors import BadRequest + with pytest.raises(BadRequest): + access(FakeMicromateClient(), audit=None).start_monitoring(ADDR, "XX123") -- 2.54.1 From ce5d2cb0d69d6ddf4a8d3916056866a082660bb1 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:48:05 -0400 Subject: [PATCH 077/223] feat(sfm): start/stop monitoring for Series 3 through the same safety layer Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/change.py | 126 +++++++++++++++++++++++++++ sfm/device_access/s3.py | 47 +++++++++-- sfm/device_access/s4.py | 113 +++---------------------- tests/device_access_fakes.py | 21 ++++- tests/test_device_access_change.py | 131 +++++++++++++++++++++++++++++ 5 files changed, 332 insertions(+), 106 deletions(-) create mode 100644 sfm/device_access/change.py diff --git a/sfm/device_access/change.py b/sfm/device_access/change.py new file mode 100644 index 0000000..09c278d --- /dev/null +++ b/sfm/device_access/change.py @@ -0,0 +1,126 @@ +"""The series-independent core of a start/stop request. + +Identity -> state -> (dry run | skip | audit -> send once -> read back -> audit). +Each series supplies only its own pieces as callables: how to read the serial, +how to read the run-state name, how to send (returning the ack record), and how +to recognise a refusal or a ring. Nothing in here retries: `send` is called at +most once, and every path after `audit.begin` calls `audit.finish` exactly once. + +The state names `calling_home` and `unknown*` are Series-4 states; Series 3 +never produces them, so those branches are simply never taken there. +""" +from __future__ import annotations + +from typing import Any, Callable, Dict, Optional + +from .errors import AuditUnavailable, CallHomeInProgress, NotSupported, UnitStateUnknown, WrongUnit +from .models import ChangeResult, UnitAddress +from .series import normalise_serial + +CALL_HOME_MESSAGE = ("the unit started calling home; SFM hung up so the call can " + "reach THOR -- try again in a few minutes") + + +def _never(exc: BaseException) -> bool: + return False + + +def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_already: bool, + audit: Any, address: UnitAddress, caller: str, + sleep: Callable[[float], None], verify_timeout_s: float, verify_interval_s: float, + read_serial: Callable[[], str], + read_state: Callable[[], str], + describe_plan: Callable[[], Dict[str, Any]], + send: Callable[[], Dict[str, Any]], + is_refusal: Callable[[BaseException], bool] = _never, + is_ring: Callable[[BaseException], bool] = _never) -> ChangeResult: + action = "start monitoring" if start else "stop monitoring" + want = "monitoring" if start else "idle" + + reported = normalise_serial(read_serial()) + if reported != serial: + raise WrongUnit(f"asked for {serial} but {reported} answered at {address.key} -- " + "nothing sent") + before = read_state() + if before == "calling_home": + raise CallHomeInProgress(CALL_HOME_MESSAGE) + if before.startswith("unknown") and not dry_run: + raise UnitStateUnknown(f"the unit reports run state {before}, which has never " + "been measured -- nothing sent") + planned = dict(describe_plan(), sends_nothing=dry_run) + base = dict(serial=serial, series=series, action=action, plan=planned, state_before=before) + + if dry_run: + return ChangeResult(dry_run=True, sent=False, outcome="dry_run", + verified="not_checked", state_after=None, audit_id=None, **base) + if audit is None: + raise NotSupported("no audit log is configured -- SFM refuses to change a unit " + "without one (nothing sent)") + request = {"plan": planned, "even_if_already": even_if_already} + try: + cid = audit.begin(serial=serial, series=series, address=address.key, action=action, + tier="change", request=request, caller=caller) + except Exception as exc: # noqa: BLE001 + raise AuditUnavailable( + f"the audit log could not be written -- nothing sent: {exc}") from exc + if before == want and not even_if_already: + audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, + error=f"already {want}") + return ChangeResult(dry_run=False, sent=False, outcome="skipped", + verified="not_checked", state_after=before, + audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base) + + try: + ack = send() # the only send; nothing below can reach it again + except Exception as exc: # noqa: BLE001 -- recorded, never retried + if is_refusal(exc): # refused by the gate: nothing went out + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"refused before sending: {exc}") + raise + if is_ring(exc): + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"a call-home began in place of the ack: {exc}") + raise + try: + after: Optional[str] = read_state() + except Exception as follow: # noqa: BLE001 + if is_ring(follow): + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; a call-home began: {follow}") + raise + after = None + if after == "calling_home": + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; the unit is now calling home") + raise CallHomeInProgress(CALL_HOME_MESSAGE) from exc + audit.finish(cid, outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}") + if after is None: + raise # the link is suspect + return ChangeResult(dry_run=False, sent=True, outcome="failed", + verified="not_checked", state_after=after, audit_id=cid, + detail={"error": f"no clean ack: {exc}"}, **base) + + seen = [before] + polls = int(verify_timeout_s // verify_interval_s) + try: + for _ in range(polls): + sleep(verify_interval_s) + seen.append(read_state()) + if seen[-1] == want or seen[-1] == "calling_home": + break + except Exception as exc: # noqa: BLE001 -- the row must not stay pending + audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, + error=f"sent and acknowledged; reading the state back failed: {exc}") + raise + if seen[-1] == "calling_home": + audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, + error="sent and acknowledged; the unit then began calling home") + raise CallHomeInProgress(CALL_HOME_MESSAGE) + ok = seen[-1] == want + outcome, verified = ("sent", "ok") if ok else ("failed", "mismatch") + audit.finish(cid, outcome=outcome, verified=verified, ack=ack, + error=None if ok else f"unit reads {seen[-1]}, expected {want}") + return ChangeResult(dry_run=False, sent=True, outcome=outcome, verified=verified, + state_after=seen[-1], audit_id=cid, + detail={"states_seen": seen, "ack": ack}, **base) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 77de656..caf3826 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -9,11 +9,14 @@ from typing import Any, Callable, Optional from minimateplus import MiniMateClient from minimateplus.blastware_file import blastware_filename +from minimateplus.framing import build_bw_write_frame +from minimateplus.protocol import SUB_START_MONITORING, SUB_STOP_MONITORING from minimateplus.transport import TcpTransport from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent, WrongUnit, translate +from .change import run_change from .events import iso_of, make_event_id, stamp_of -from .models import DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus +from .models import ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus log = logging.getLogger("sfm.device_access") @@ -85,10 +88,44 @@ class Series3Adapter: def __init__(self, client_factory: Callable[..., Any] = default_s3_client_factory) -> None: self._factory = client_factory - def change_monitoring(self, address: UnitAddress, serial: str, **kw: Any) -> Any: - raise NotSupported("Series 3 start/stop through DeviceAccess arrives in Task 5") + def change_monitoring(self, address: UnitAddress, serial: str, *, start: bool, dry_run: bool, + even_if_already: bool, audit: Any, caller: str, + sleep: Callable[[float], None], verify_timeout_s: float, + verify_interval_s: float) -> ChangeResult: + """Series-3 pieces for the shared core in change.py. One attempt, never + retried: `retry=False` stops _run's cold-boot second attempt, and the + core calls the write once.""" + sub = SUB_START_MONITORING if start else SUB_STOP_MONITORING + ack_sub = 0xFF - sub - def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None) -> Any: + def op(client: Any) -> ChangeResult: + def read_serial() -> str: + info = client.connect() # a fresh connection: connect() is the fresh 0x15 read + return info.serial or "" + + def describe_plan() -> dict: + what = "start monitoring" if start else "stop monitoring" + return {"action": what, "sends_nothing": True, "warnings": [], + "steps": [{"sub": f"0x{sub:02X}", "what": what, "offset": "0x0000", + "data_len": 0, "expect_ack": f"0x{ack_sub:02X}", + "frame": build_bw_write_frame(sub, b"").hex()}]} + + def send() -> dict: + # The client validates the ack SUB; it returns nothing else, so none is claimed. + (client.start_monitoring if start else client.stop_monitoring)() + return {"subs": [f"0x{ack_sub:02X}"]} + + return run_change( + serial=serial, series=3, start=start, dry_run=dry_run, + even_if_already=even_if_already, audit=audit, address=address, caller=caller, + sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, + read_serial=read_serial, + read_state=lambda: "monitoring" if client.get_monitor_status().is_monitoring else "idle", + describe_plan=describe_plan, send=send) + return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False) + + def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None, + retry: bool = True) -> Any: def attempt() -> Any: client = self._factory(address) if timeout is None else self._factory(address, timeout=timeout) try: @@ -114,7 +151,7 @@ class Series3Adapter: # server._run_with_retry (any protocol error): retrying a # MalformedReply would also retry "no settings block", which a # reconnect cannot fix. - if not address.host: + if not retry or not address.host: raise log.info("Series 3 at %s: no clean answer, retrying once (unit may be cold)", address.key) return attempt() diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 0534015..e5cf27c 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -20,6 +20,7 @@ from .errors import ( AuditUnavailable, CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, NotSupported, StaleEvent, UnitStateUnknown, WrongUnit, translate, ) +from .change import CALL_HOME_MESSAGE, run_change from .events import iso_of, make_event_id, stamp_of from .models import ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus from .series import normalise_serial @@ -104,8 +105,7 @@ def _close(client: Any) -> None: log.debug("close failed", exc_info=True) -_RING_MESSAGE = ("the unit started calling home; SFM hung up so the call can " - "reach THOR -- try again in a few minutes") +_RING_MESSAGE = CALL_HOME_MESSAGE class Series4Session: @@ -325,104 +325,19 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool even_if_already: bool, audit: Any, address: UnitAddress, caller: str, sleep: Callable[[float], None], verify_timeout_s: float, verify_interval_s: float) -> ChangeResult: - """Identity -> state -> (dry run | skip | audit -> send -> read back -> audit).""" - action = "start monitoring" if start else "stop monitoring" - want = "monitoring" if start else "idle" - - reported = normalise_serial(client.serial(refresh=True)) - if reported != serial: - raise WrongUnit(f"asked for {serial} but {reported} answered at {address.key} -- " - "nothing sent") - before = client.read_run_state() - if before.name == "calling_home": - raise CallHomeInProgress(_RING_MESSAGE) - if before.name.startswith("unknown") and not dry_run: - raise UnitStateUnknown(f"the unit reports run state {before.name}, which has never " - "been measured -- nothing sent") + """Series-4 pieces for the shared core in change.py.""" plan = plan_start_monitoring() if start else plan_stop_monitoring() - planned = dict(plan.describe(), sends_nothing=dry_run) - base = dict(serial=serial, series=4, action=action, plan=planned, - state_before=before.name) - if dry_run: - return ChangeResult(dry_run=True, sent=False, outcome="dry_run", - verified="not_checked", state_after=None, audit_id=None, **base) - if audit is None: - raise NotSupported("no audit log is configured -- SFM refuses to change a unit " - "without one (nothing sent)") - request = {"plan": planned, "even_if_already": even_if_already} - try: - cid = audit.begin(serial=serial, series=4, address=address.key, action=action, - tier="change", request=request, caller=caller) - except Exception as exc: # noqa: BLE001 - raise AuditUnavailable( - f"the audit log could not be written -- nothing sent: {exc}") from exc - if before.name == want and not even_if_already: - audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, - error=f"already {want}") - return ChangeResult(dry_run=False, sent=False, outcome="skipped", - verified="not_checked", state_after=before.name, - audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base) - - try: + def send() -> dict: acks = client.protocol.execute(plan) - except OpcodeRefused as exc: # refused by the gate: nothing went out - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"refused before sending: {exc}") - raise - except RingDetected as exc: - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"a call-home began in place of the ack: {exc}") - raise # _exchange releases the line - except Exception as exc: # noqa: BLE001 -- recorded, never retried - try: - after = _try_run_state(client) - except RingDetected as ring: - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}; a call-home began: {ring}") - raise - if after == "calling_home": - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}; the unit is now calling home") - raise CallHomeInProgress(_RING_MESSAGE) from exc - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}") - if after is None: - raise # the line is suspect: let _exchange hang up - return ChangeResult(dry_run=False, sent=True, outcome="failed", - verified="not_checked", state_after=after, audit_id=cid, - detail={"error": f"no clean ack: {exc}"}, **base) + return {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]} - ack = {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]} - seen = [before.name] - polls = int(verify_timeout_s // verify_interval_s) - try: - for _ in range(polls): - sleep(verify_interval_s) - seen.append(client.read_run_state().name) - if seen[-1] == want or seen[-1] == "calling_home": - break - except Exception as exc: # noqa: BLE001 -- the row must not stay pending - audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, - error=f"sent and acknowledged; reading the state back failed: {exc}") - raise - if seen[-1] == "calling_home": - audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, - error="sent and acknowledged; the unit then began calling home") - raise CallHomeInProgress(_RING_MESSAGE) - ok = seen[-1] == want - outcome, verified = ("sent", "ok") if ok else ("failed", "mismatch") - audit.finish(cid, outcome=outcome, verified=verified, ack=ack, - error=None if ok else f"unit reads {seen[-1]}, expected {want}") - return ChangeResult(dry_run=False, sent=True, outcome=outcome, verified=verified, - state_after=seen[-1], audit_id=cid, - detail={"states_seen": seen, "ack": ack}, **base) - - -def _try_run_state(client: Any) -> Optional[str]: - try: - return client.read_run_state().name - except RingDetected: - raise - except Exception: # noqa: BLE001 - return None + return run_change( + serial=serial, series=4, start=start, dry_run=dry_run, even_if_already=even_if_already, + audit=audit, address=address, caller=caller, sleep=sleep, + verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, + read_serial=lambda: client.serial(refresh=True), + read_state=lambda: client.read_run_state().name, + describe_plan=plan.describe, send=send, + is_refusal=lambda e: isinstance(e, OpcodeRefused), + is_ring=lambda e: isinstance(e, RingDetected)) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 4e9ff9a..02698ca 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -74,10 +74,14 @@ def default_s3_events(): class FakeMiniMateClient(_Base): - def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, **kw): + def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, + monitor_states=None, write_error=None, **kw): super().__init__(**kw) self.serial = serial self.monitoring = monitoring + self.monitor_states = list(monitor_states) if monitor_states else [monitoring] + self.write_error = write_error + self.writes: list = [] if compliance == "default": compliance = ComplianceConfig( recording_mode=0x01, sample_rate=1024, histogram_interval_sec=300, @@ -103,12 +107,25 @@ class FakeMiniMateClient(_Base): def get_monitor_status(self) -> MonitorStatus: self._step("get_monitor_status") + state = self.monitor_states.pop(0) if len(self.monitor_states) > 1 else self.monitor_states[0] return MonitorStatus( - is_monitoring=self.monitoring, battery_v=6.8, + is_monitoring=state, battery_v=6.8, memory_total=983026, memory_free=900000, ) + def _write(self, name): + self._step(name) + self.writes.append(name) + if self.write_error is not None: + raise self.write_error + + def start_monitoring(self) -> None: + self._write("start_monitoring") + + def stop_monitoring(self) -> None: + self._write("stop_monitoring") + def list_event_headers(self): self._step("list_event_headers") out = [] diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 8d5ccd8..d2f82df 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -283,3 +283,134 @@ def test_a_malformed_serial_is_422_even_without_an_audit_sink(): from sfm.device_access.errors import BadRequest with pytest.raises(BadRequest): access(FakeMicromateClient(), audit=None).start_monitoring(ADDR, "XX123") + + +# ── Series 3 ────────────────────────────────────────────────────────────────── + +import minimateplus.protocol as mmp_proto # noqa: E402 +from device_access_fakes import FakeMiniMateClient # noqa: E402 + +TCP3 = UnitAddress(host="10.0.0.6", tcp_port=12345, port=None, baud=None) + + +def access3(fake, audit="default"): + seen = [] + + def factory(a, **kw): + seen.append(kw) + return fake + da = DeviceAccess(s3_client_factory=factory, start_reaper=False, + audit=Audit() if audit == "default" else audit, + sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) + da.factory_calls = seen + return da + + +def test_series3_dry_run_returns_its_own_frame_and_sends_nothing(): + fake = FakeMiniMateClient(monitor_states=[False]) + r = access3(fake).start_monitoring(TCP3, "BE18193", dry_run=True) + assert (r.series, r.outcome, r.state_before) == (3, "dry_run", "idle") + assert r.plan["steps"][0]["sub"] == "0x96" and fake.writes == [] + assert r.plan["steps"][0]["expect_ack"] == "0x69" and r.plan["sends_nothing"] is True + + +def test_series3_start_is_verified_by_monitor_status(): + fake = FakeMiniMateClient(monitor_states=[False, False, True]) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") + assert fake.writes == ["start_monitoring"] + assert da._audit.rows[r.audit_id]["ack"] == {"subs": ["0x69"]} + + +def test_series3_stop_acks_0x68(): + fake = FakeMiniMateClient(monitor_states=[True, False]) + da = access3(fake) + r = da.stop_monitoring(TCP3, "BE18193") + assert r.verified == "ok" and fake.writes == ["stop_monitoring"] + assert da._audit.rows[r.audit_id]["ack"] == {"subs": ["0x68"]} + + +def test_series3_wrong_unit_is_refused_before_writing(): + fake = FakeMiniMateClient(serial="BE11529") + with pytest.raises(WrongUnit): + access3(fake).stop_monitoring(TCP3, "BE18193") + assert fake.writes == [] + + +def test_series3_a_lost_ack_is_never_retried_even_over_tcp(): + fake = FakeMiniMateClient(monitor_states=[False, True], + write_error=mmp_proto.TimeoutError("no ack")) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert fake.writes == ["start_monitoring"] # one send, no cold-boot retry + assert r.outcome == "failed" and r.state_after == "monitoring" + + +def test_series3_already_in_state_is_skipped(): + fake = FakeMiniMateClient(monitor_states=[True]) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert (r.sent, r.outcome) == (False, "skipped") and fake.writes == [] + assert da._audit.rows[r.audit_id]["outcome"] == "skipped" + + +def test_series3_a_state_that_never_changes_is_a_mismatch(): + fake = FakeMiniMateClient(monitor_states=[False]) + da = access3(fake) + r = da.start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("failed", "mismatch", "idle") + assert da._audit.rows[r.audit_id]["verified"] == "mismatch" + + +def test_series3_a_failing_read_back_is_audited_then_raised(): + fake = FakeMiniMateClient(monitor_states=[False]) + da = access3(fake) + real = fake.get_monitor_status + calls = [] + + def flaky(): + calls.append(1) + if len(calls) > 1: + raise mmp_proto.TimeoutError("quiet") + return real() + fake.get_monitor_status = flaky + with pytest.raises(NoAnswer): + da.start_monitoring(TCP3, "BE18193") + row = next(iter(da._audit.rows.values())) + assert (row["outcome"], row["verified"]) == ("sent", "not_checked") + assert "reading the state back failed" in row["error"] + assert fake.writes == ["start_monitoring"] + + +def test_series3_audit_begin_failing_sends_nothing(): + class Broken(Audit): + def begin(self, **f): + raise RuntimeError("disk full") + fake = FakeMiniMateClient(monitor_states=[False]) + with pytest.raises(AuditUnavailable): + access3(fake, audit=Broken()).start_monitoring(TCP3, "BE18193") + assert fake.writes == [] + + +def test_series3_lost_ack_with_unreadable_follow_up_raises_and_is_not_retried(): + fake = FakeMiniMateClient(monitor_states=[False], write_error=mmp_proto.TimeoutError("no ack")) + da = access3(fake) + real = fake.get_monitor_status + n = [] + + def second_fails(): + n.append(1) + if len(n) > 1: + raise mmp_proto.TimeoutError("still quiet") + return real() + fake.get_monitor_status = second_fails + with pytest.raises(NoAnswer): + da.start_monitoring(TCP3, "BE18193") + assert fake.writes == ["start_monitoring"] + assert len(da.factory_calls) == 1 # no second TCP attempt + row = next(iter(da._audit.rows.values())) + assert row["outcome"] == "failed" + +# The other Series-3 operations still retry once over TCP on a cold unit: +# tests/test_device_access_s3.py::test_a_cold_unit_over_tcp_gets_one_retry. -- 2.54.1 From c3e7e169c0e2f407c0c623723aa6cb3a2b1283dc Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 16:57:47 -0400 Subject: [PATCH 078/223] feat(sfm): start/stop monitoring by serial -- dry run, audit, read-back Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/server.py | 59 ++++++++++++-- tests/test_server_device_access.py | 127 ++++++++++++++++++++++++++++- 2 files changed, 180 insertions(+), 6 deletions(-) diff --git a/sfm/server.py b/sfm/server.py index 54ec0ae..5f1a320 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -87,6 +87,7 @@ import dataclasses from sfm.device_access import DeviceAccess, DeviceError, UnitAddress from sfm.device_access.errors import BadRequest from sfm.device_access.series import normalise_serial +from sfm.audit import DbAudit logging.basicConfig( level=logging.INFO, @@ -359,7 +360,8 @@ def _run_with_retry(fn, *, is_tcp: bool): # legacy Series-3 path unchanged (spec 2026-10-20). # Constructing it does no I/O and starts no thread until a Series-4 session exists. -_device_access_instance: DeviceAccess = DeviceAccess() +# The audit sink is mandatory for live changes: without one they are refused. +_device_access_instance: DeviceAccess = DeviceAccess(audit=DbAudit(_get_db)) def _device_access() -> DeviceAccess: @@ -380,9 +382,22 @@ def _via_device_access(fn) -> dict: return dataclasses.asdict(result) if dataclasses.is_dataclass(result) else result +def _change_response(fn) -> JSONResponse: + """Run a start/stop; the ChangeResult is the body, its outcome picks the status. + + DeviceError mapping is _via_device_access's -- not repeated here. + """ + body = _via_device_access(fn) + status = 200 + if body["outcome"] == "failed": + status = 409 if body["verified"] == "mismatch" else 502 + return JSONResponse(status_code=status, content=body) + + _SERIAL_AWARE_PATHS = frozenset({ "/device/info", "/device/connect", "/device/monitor/status", "/device/settings", "/device/events", "/device/events/download", + "/device/monitor/start", "/device/monitor/stop", }) @@ -1838,15 +1853,32 @@ def device_rescue( @app.post("/device/monitor/start") def device_monitor_start( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), - baud: int = Query(38400, description="Serial baud rate"), + baud: Optional[int] = Query(None, description="Serial baud rate"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), -) -> dict: + serial: Optional[str] = Query(None, description=_SERIAL_DOC), + dry_run: bool = Query(False, description="Return the planned frames; send nothing"), + even_if_already: bool = Query(False, description="Send even if the unit is already in the target state"), + caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"), +): """ Command the device to start monitoring (recording triggered events). Sends SUB 0x96 and waits for ack SUB 0x69. + + With `serial`: the unit's identity is read first (a different unit is a 409, + nothing sent), then its state; `dry_run` returns the planned frames and sends + nothing; a live change is audited, verified by reading the state back, and + never retried. The response is the ChangeResult (409 if the unit never + reached the state, 502 if the ack was lost). + + Without `serial`: the legacy behaviour above, unchanged. """ + if serial: + return _change_response(lambda: _device_access().start_monitoring( + _unit_address(port, baud, host, tcp_port), serial, dry_run=dry_run, + even_if_already=even_if_already, caller=caller or "api")) + baud = 38400 if baud is None else baud conn_key = _live_cache.make_conn_key(host, tcp_port, port, baud) with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client: try: @@ -1864,15 +1896,32 @@ def device_monitor_start( @app.post("/device/monitor/stop") def device_monitor_stop( port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"), - baud: int = Query(38400, description="Serial baud rate"), + baud: Optional[int] = Query(None, description="Serial baud rate"), host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"), tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), -) -> dict: + serial: Optional[str] = Query(None, description=_SERIAL_DOC), + dry_run: bool = Query(False, description="Return the planned frames; send nothing"), + even_if_already: bool = Query(False, description="Send even if the unit is already in the target state"), + caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"), +): """ Command the device to stop monitoring. Sends SUB 0x97 and waits for ack SUB 0x68. + + With `serial`: the unit's identity is read first (a different unit is a 409, + nothing sent), then its state; `dry_run` returns the planned frames and sends + nothing; a live change is audited, verified by reading the state back, and + never retried. The response is the ChangeResult (409 if the unit never + reached the state, 502 if the ack was lost). + + Without `serial`: the legacy behaviour above, unchanged. """ + if serial: + return _change_response(lambda: _device_access().stop_monitoring( + _unit_address(port, baud, host, tcp_port), serial, dry_run=dry_run, + even_if_already=even_if_already, caller=caller or "api")) + baud = 38400 if baud is None else baud conn_key = _live_cache.make_conn_key(host, tcp_port, port, baud) with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client: try: diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 333ff6e..9f28a60 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -100,7 +100,7 @@ ADDR = UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None) Q_TCP = {"host": "10.0.0.5", "tcp_port": "9034"} -@pytest.mark.parametrize("path", ["/device/events/erase", "/device/monitor/stop", "/device/config"]) +@pytest.mark.parametrize("path", ["/device/events/erase", "/device/config"]) def test_guard_refuses_a_um_serial_on_unsupported_routes_with_501(path): out = srv._device_guard(path, {"serial": "um20147", **Q_TCP}) assert out is not None and out[0] == 501 and path in out[1] @@ -113,6 +113,7 @@ def test_guard_lets_a_series3_serial_through_on_legacy_routes(): @pytest.mark.parametrize("path", ["/device/info", "/device/connect", "/device/monitor/status", "/device/settings", "/device/events", "/device/events/download", + "/device/monitor/start", "/device/monitor/stop", "/device/hangup"]) def test_guard_allows_um_serial_on_serial_aware_routes_and_hangup(path): assert srv._device_guard(path, {"serial": "UM20147", **Q_TCP}) is None @@ -255,3 +256,127 @@ def test_a_store_failure_is_500_and_names_what_was_downloaded(da, sdm, monkeypat srv.device_events_download(serial="UM20147", event_id=W_ID, **EV) assert ei.value.status_code == 500 assert "UM20147_20250531135901.IDFW" in ei.value.detail and "disk full" in ei.value.detail + + +# ── start / stop monitoring by serial ───────────────────────────────────────── + +import micromate.protocol as _mm_proto # noqa: E402 +from sfm.audit import DbAudit # noqa: E402 + +CH = dict(port=None, baud=None, host="10.0.0.5", tcp_port=9034, + serial="UM20147", dry_run=False, even_if_already=False, caller=None) + + +class _Rec: + def __init__(self): + self.rows = {} + + def begin(self, **f): + cid = f"c{len(self.rows) + 1}" + self.rows[cid] = dict(f, outcome="pending") + return cid + + def finish(self, cid, **f): + self.rows[cid].update(f) + + +def _s4(monkeypatch, fake, audit=None): + access = DeviceAccess(s4_client_factory=lambda a, **kw: fake, start_reaper=False, + audit=audit or _Rec(), sleep=lambda s: None, + verify_timeout_s=6.0, verify_interval_s=2.0) + monkeypatch.setattr(srv, "_device_access_instance", access) + return access + + +def _body(resp): + import json + return json.loads(resp.body) + + +def test_a_dry_run_is_200_with_the_frame(monkeypatch): + fake = FakeMicromateClient(run_states=[0x00]) + _s4(monkeypatch, fake) + resp = srv.device_monitor_start(**{**CH, "dry_run": True}) + assert resp.status_code == 200 + body = _body(resp) + assert body["outcome"] == "dry_run" and body["plan"]["steps"][0]["frame"].startswith("4102") + assert fake.executed == [] + + +def test_a_verified_live_start_is_200(monkeypatch): + fake = FakeMicromateClient(run_states=[0x00, 0x00, 0x02]) + _s4(monkeypatch, fake) + resp = srv.device_monitor_start(**CH) + assert resp.status_code == 200 and _body(resp)["verified"] == "ok" + + +def test_a_mismatch_is_409_and_keeps_states_seen(monkeypatch): + fake = FakeMicromateClient(run_states=[0x00]) + _s4(monkeypatch, fake) + resp = srv.device_monitor_start(**CH) + assert resp.status_code == 409 + body = _body(resp) + assert body["verified"] == "mismatch" and body["detail"]["states_seen"] + + +def test_a_lost_ack_with_a_good_read_back_is_502(monkeypatch): + fake = FakeMicromateClient(run_states=[0x00, 0x02], + execute_error=_mm_proto.TimeoutError("no ack")) + _s4(monkeypatch, fake) + resp = srv.device_monitor_start(**CH) + assert resp.status_code == 502 + assert _body(resp)["verified"] == "not_checked" or _body(resp)["outcome"] == "failed" + + +def test_stop_by_serial_works(monkeypatch): + fake = FakeMicromateClient(run_states=[0x02, 0x02, 0x00]) + _s4(monkeypatch, fake) + resp = srv.device_monitor_stop(**CH) + assert resp.status_code == 200 and _body(resp)["action"].startswith("stop") + + +@pytest.mark.parametrize("fn", ["device_monitor_start", "device_monitor_stop"]) +@pytest.mark.parametrize("run_state,exc,status", [(0x03, CallHomeInProgress, 503)]) +def test_a_device_error_maps_to_its_own_status(monkeypatch, fn, run_state, exc, status): + _s4(monkeypatch, FakeMicromateClient(run_states=[run_state])) + with pytest.raises(HTTPException) as e: + getattr(srv, fn)(**CH) + assert e.value.status_code == status + + +def test_a_wrong_unit_is_409(monkeypatch): + _s4(monkeypatch, FakeMicromateClient(serial_reported="UM12947")) + with pytest.raises(HTTPException) as e: + srv.device_monitor_start(**CH) + assert e.value.status_code == 409 + + +def test_a_live_change_through_the_real_wiring_records_an_audit_row(tmp_path, monkeypatch): + db = SeismoDb(tmp_path / "seismo.db") + fake = FakeMicromateClient(run_states=[0x00, 0x00, 0x02]) + _s4(monkeypatch, fake, audit=DbAudit(lambda: db)) + resp = srv.device_monitor_start(**CH) + assert resp.status_code == 200 + rows = db.query_device_commands() + assert len(rows) == 1 and rows[0]["outcome"] == "sent" + + +def test_the_module_instance_is_built_with_an_audit_sink(): + assert srv._device_access_instance._audit is not None + + +@pytest.mark.parametrize("fn", ["device_monitor_start", "device_monitor_stop"]) +def test_monitor_without_a_serial_runs_the_legacy_path_unchanged(monkeypatch, fn): + class Legacy(Exception): + pass + + def untouchable(): + raise AssertionError("DeviceAccess must not be used without a serial") + + def legacy_client(**kw): + assert kw["baud"] == 38400 # the default is restored on the legacy path + raise Legacy() + monkeypatch.setattr(srv, "_device_access", untouchable) + monkeypatch.setattr(srv, "_build_client", legacy_client) + with pytest.raises(Legacy): + getattr(srv, fn)(**{**CH, "serial": None}) -- 2.54.1 From ac33c8ffa4856e1a58426d8f75b7811510c7175a Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 17:00:31 -0400 Subject: [PATCH 079/223] fix(sfm): start/stop HTTP status is an allow-list -- only verified, skipped or dry-run is 200 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/server.py | 7 ++++--- tests/test_server_device_access.py | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/sfm/server.py b/sfm/server.py index 5f1a320..04ce048 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -388,9 +388,10 @@ def _change_response(fn) -> JSONResponse: DeviceError mapping is _via_device_access's -- not repeated here. """ body = _via_device_access(fn) - status = 200 - if body["outcome"] == "failed": - status = 409 if body["verified"] == "mismatch" else 502 + # An allow-list: only a dry run, a skip, or a change read back as made is a 200. + ok = (body["outcome"] in ("dry_run", "skipped") + or (body["outcome"] == "sent" and body["verified"] == "ok")) + status = 200 if ok else (409 if body["verified"] == "mismatch" else 502) return JSONResponse(status_code=status, content=body) diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 9f28a60..6858caa 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -325,7 +325,19 @@ def test_a_lost_ack_with_a_good_read_back_is_502(monkeypatch): _s4(monkeypatch, fake) resp = srv.device_monitor_start(**CH) assert resp.status_code == 502 - assert _body(resp)["verified"] == "not_checked" or _body(resp)["outcome"] == "failed" + body = _body(resp) + assert body["outcome"] == "failed" + assert body["verified"] == "not_checked" + assert body["sent"] is True + assert "no clean ack" in body["detail"]["error"] + + +def test_sent_but_unverified_is_never_a_200(): + from sfm.device_access.models import ChangeResult + r = ChangeResult(serial="UM20147", series=4, action="start monitoring", dry_run=False, + sent=True, outcome="sent", verified="not_checked", + state_before="idle", state_after=None, audit_id="c1") + assert srv._change_response(lambda: r).status_code == 502 def test_stop_by_serial_works(monkeypatch): @@ -336,9 +348,15 @@ def test_stop_by_serial_works(monkeypatch): @pytest.mark.parametrize("fn", ["device_monitor_start", "device_monitor_stop"]) -@pytest.mark.parametrize("run_state,exc,status", [(0x03, CallHomeInProgress, 503)]) -def test_a_device_error_maps_to_its_own_status(monkeypatch, fn, run_state, exc, status): - _s4(monkeypatch, FakeMicromateClient(run_states=[run_state])) +@pytest.mark.parametrize("exc,status", [(CallHomeInProgress("calling home"), 503), + (WrongUnit("other unit"), 409), + (NoAnswer("silent"), 504)]) +def test_a_device_error_maps_to_its_own_status(monkeypatch, fn, exc, status): + class Raises: + def start_monitoring(self, *a, **kw): + raise exc + stop_monitoring = start_monitoring + monkeypatch.setattr(srv, "_device_access_instance", Raises()) with pytest.raises(HTTPException) as e: getattr(srv, fn)(**CH) assert e.value.status_code == status -- 2.54.1 From 8f68b09f5e32ea1857af3730537c69b0c74f5318 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 19:16:45 -0400 Subject: [PATCH 080/223] fix(sfm): a change that fails after the send says so; the audit row records sent + states; S3 unknown states refused Final fix wave for phase 3 (start/stop monitoring), per the whole-phase review. - I1 + M2: every failure after the send has started is a ChangeUnconfirmed (audit_id, sent = "acknowledged" | "unknown", the cause's HTTP status) whose message says the frame was sent and names the audit record -- the ring in place of the ack, the four lost-ack follow-ups, and the three read-back paths. Series4Session releases the line on it. Every audit finish goes through one helper; a finish that fails is AuditIncomplete (500) and still says what happened to the unit. The line is kept. - I2: device_commands gains `sent` (1 acknowledged, 0 nothing sent, NULL unknown) and `states` (before / seen / after), with an idempotent ADD COLUMN in _migrate for a table created earlier on this branch. - M1: a RADIO RING already buffered is caught before 0x96/0x97 goes out (pre_send = read_unsolicited, one 10 ms transport read). That is a CallHomeInProgress with sent=0, not ChangeUnconfirmed. - M3: Series 3 reads the raw 0x1C flag (new MonitorStatus.state_flag); a byte other than 0x00/0x10, or a short section, is unknown(...) and refused. - M8: even_if_already on a unit already in the state notes that the read-back proves nothing. - M10: a scan pins `.protocol.execute(` to sfm/device_access/s4.py; both scans fail closed on a file that does not parse. - M11: docs corrected (CLAUDE.md phase-2 sentence, phase-3 bullet, REST list; micromate/protocol.py scope and the 0x49 read_state docstring; s4.py; route docstrings). "No command has ever been originated" is NOT retracted. - M12: GET /db/device_commands normalises the serial. - Minors: unused imports, S3 dry-run frames and 120 s timeout pinned, test rename, serial-cache and short-0x49 tests, _RUN_STATES comment. Schema: two NULLable columns on the branch-new device_commands table, added by _migrate on open; no backfill. No codec change, TOOL_VERSION unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 32 ++- micromate/client.py | 1 + micromate/protocol.py | 30 ++- minimateplus/client.py | 4 + minimateplus/models.py | 5 + sfm/database.py | 34 +++- sfm/device_access/__init__.py | 6 +- sfm/device_access/change.py | 184 +++++++++++++---- sfm/device_access/errors.py | 25 +++ sfm/device_access/s3.py | 17 +- sfm/device_access/s4.py | 29 ++- sfm/server.py | 63 +++++- tests/device_access_fakes.py | 6 +- tests/test_device_access_change.py | 316 +++++++++++++++++++++++++++-- tests/test_device_commands.py | 59 ++++++ tests/test_micromate_client.py | 24 +++ tests/test_micromate_execute.py | 54 ++++- tests/test_server_device_access.py | 24 +++ 18 files changed, 806 insertions(+), 107 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d181397..eefb656 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,10 +32,12 @@ Read this first when picking the project back up. the setup rewrite, reproduced byte for byte against THOR's captured frames. `bridges/mm_dry_run.py` prints a write's planned frames from a live unit's reads (run on UM20147: sizes equal UM12947's). `MicromateProtocol._send` - refuses every write opcode except one start/stop plan at a time through `execute()`, on a connection with a fresh Micromate reply, and `0xA2` always, so - "no command has ever been originated against a unit" is still true and is now - enforced in `micromate/` (its `_send` gate); the Series-3 `minimateplus` - stack and raw-socket bench bridges are outside it. The reproduction's + refuses every write opcode except one start/stop plan at a time through + `execute()`, on a connection with a fresh Micromate reply, and refuses `0xA2` + always. The only transmit path for a write is `execute()`, reached only from + SFM's serial-named start/stop routes through `sfm/device_access` (identity, + state, audit, read-back, never retried); the Series-3 `minimateplus` stack + and raw-socket bench bridges are outside the gate. The reproduction's breadth is one distinct input per block (the five pushes share the same name, prefs and trigger block). - **✅ `micromate/` HAS a live client (2026-10-02).** `framing.py`, @@ -121,6 +123,16 @@ Read this first when picking the project back up. 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). +- **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built and + reviewed offline; the first live send is pending at the bench.** Both + series go through one safety core, `sfm/device_access/change.py`: a fresh + identity read, the run state (calling home or never measured is refused), + `dry_run` (the exact frames, nothing sent), a row in the new + `device_commands` audit table (`GET /db/device_commands`; `sent` says whether + a frame went out, `states` keeps every read), one send never retried, then a + read-back. The HTTP status is an allow-list -- only a dry run, a skip or a + send read back as made is a 200 -- and a failure after the send says so and + names its audit record. - **🔑 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, @@ -1429,14 +1441,19 @@ 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 POST /device/monitor/stop?host=1.2.3.4&tcp_port=9034 ← stop recording +POST /device/monitor/start?serial=UM20147&host=...&tcp_port=...&dry_run=&even_if_already= ← audited start, either series +POST /device/monitor/stop?serial=UM20147&host=...&tcp_port=...&dry_run=&even_if_already= ← audited stop, either series GET /device/settings?serial=UM20147&host=1.2.3.4&tcp_port=9034 ← shared-model settings, either series POST /device/hangup?host=1.2.3.4&tcp_port=9034 ← release a held Series-4 line ``` `serial=` (UM = Series 4, BE/BA = Series 3) on `/device/info`, `/connect`, -`/monitor/status`, `/settings` returns the shared model, uncached. A `UM` serial on any -other `/device/*` route is 501; any request taking the legacy Series-3 path at a held -Series-4 address is 409. +`/monitor/status`, `/settings` returns the shared model, uncached; on `/events` and +`/events/download` it lists and downloads by `event_id`; on `/monitor/start` and +`/monitor/stop` it runs the audited change (`dry_run=true` returns the frames and sends +nothing; `even_if_already=true` sends even when the unit is already in that state). A +`UM` serial on any other `/device/*` route is 501; any request taking the legacy +Series-3 path at a held Series-4 address is 409. SFM must run a single uvicorn worker (locks and held lines are per process). Server retries once on `ProtocolError` for TCP connections (handles cold-boot timing). @@ -1449,6 +1466,7 @@ GET /db/events?serial=BE11529&from_dt=&to_dt=&limit= ← triggered events, ne GET /db/monitor_log?serial=BE11529&from_dt=&to_dt= ← monitoring intervals, newest first GET /db/sessions?serial=BE11529&limit=50 ← ACH call-home sessions, newest first PATCH /db/events/{id}/false_trigger?value=true ← flag/unflag false triggers +GET /db/device_commands?serial=UM20147&limit=100 ← start/stop audit trail (sent, states), newest first ``` DB file: `bridges/captures/seismo_relay.db` (default; override with `--db-path` at startup). diff --git a/micromate/client.py b/micromate/client.py index 5b6a17e..a61f4dc 100644 --- a/micromate/client.py +++ b/micromate/client.py @@ -385,6 +385,7 @@ class MicromateClient: self._serial = _cstring(_content(self._proto.read_serial())) return self._serial + # Anything else reads unknown(0x..): the safe default, which the change path refuses. _RUN_STATES = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"} def read_run_state(self) -> MicromateRunState: diff --git a/micromate/protocol.py b/micromate/protocol.py index a457bc1..ab5883f 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -4,14 +4,17 @@ protocol.py — one method per Micromate (Series IV) wire command. Returns raw payload bytes. Interpretation belongs in ``client.py``; this layer knows frames, offsets and sequencing, and nothing about what a field means. -Scope: **reads only on the wire, enforced** (in this package: the Series-3 -`minimateplus` stack and raw-socket bench bridges are outside the gate). Every outgoing frame passes +Scope: **reads, plus start/stop monitoring through `execute()` only -- +enforced** (in this package: the Series-3 `minimateplus` stack and raw-socket +bench bridges are outside the gate). Every outgoing frame passes `micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused unless it arrives through `execute()` (the connection itself holds no write -permission), and `0xA2` -- CONFIRM ERASE on Series III -- is -refused always. The gate is an allowlist: a SUB not catalogued in -`opcodes` (read or write) is refused as unknown. No command has ever been originated against a unit by this -project; every write in ``docs/micromate_protocol_reference.md`` was performed +permission), `execute()` can permit only SUBs under `ENABLEABLE_WRITES` +(`0x96` / `0x97`), and `0xA2` -- CONFIRM ERASE on Series III -- is refused +always. The one caller of `execute()` is SFM's change path, +`sfm/device_access/s4.py` (a test pins that). The gate is an allowlist: a SUB +not catalogued in `opcodes` (read or write) is refused as unknown. No command +has ever been originated against a unit by this project; every write in ``docs/micromate_protocol_reference.md`` was performed by THOR while we recorded. The first thing this codebase ever sends to a customer's instrument should be a decision someone made on purpose, not a side effect of a client that grew a method. Write frames are *built* in @@ -305,10 +308,19 @@ class MicromateProtocol: return self._read(SUB_DEVICE_INFO) def read_state(self) -> bytes: - """`0x49` → `0xB6`. A cheap monitoring check; 16 B. + """`0x49` → `0xB6`. A cheap state check; 16 B of data. - ⚠ Test `data[11]` for **non-zero**, never against a constant — it has - read both `0x0E` and `0x0C` while monitoring. + `data[11]` (content[0]) is the run state. Measured: `0x00` idle, + `0x02` monitoring (every monitoring sample so far), and `0x03` while + calling home (ten reads of ten in the captured 2026-10-14 ACH + session). No other value has been seen. + `MicromateClient.read_run_state` matches those three exactly and names + anything else `unknown(0x..)`, which the change path refuses; + `connect()`'s `monitoring` tests non-zero, so `0x03` reads True there. + + ⚠ `0x0E` and `0x0C` (both read while monitoring, so "test for + non-zero") belong to `SUB 0x1C` `data[12]`, a separate field -- not to + this byte. See the reference's `0x49` and `0x1C` sections. """ return self._read(SUB_STATE) diff --git a/minimateplus/client.py b/minimateplus/client.py index ca3a1e8..599ae95 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -2688,6 +2688,9 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus: # section[1] = 0x00 in all IDLE frames, 0x10 in all MONITORING frames. # (section[6] also changes but has non-binary values 0xea/0x07 — device-specific.) is_monitoring = len(section) > 1 and section[1] == 0x10 + # The same byte, raw -- but only from a real section: for data of 11 bytes + # or fewer, `section` above falls back to the header itself. + state_flag = data[12] if len(data) > 12 else None battery_v = None memory_total = None @@ -2713,6 +2716,7 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus: battery_v=battery_v, memory_total=memory_total, memory_free=memory_free, + state_flag=state_flag, ) diff --git a/minimateplus/models.py b/minimateplus/models.py index 9e7865d..a395538 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -660,3 +660,8 @@ class MonitorStatus: battery_v: Optional[float] = None # Battery voltage in volts ✅ memory_total: Optional[int] = None # Total flash memory in bytes ✅ memory_free: Optional[int] = None # Free flash memory in bytes ✅ + # The raw flag byte `is_monitoring` is derived from: section[1] = data[12]. + # Measured: 0x00 idle, 0x10 monitoring. None when the section is too short + # to hold it. Kept raw so a caller can refuse a value never measured, + # where `is_monitoring` reads anything but 0x10 as idle. + state_flag: Optional[int] = None diff --git a/sfm/database.py b/sfm/database.py index 468c7e1..c7c6215 100644 --- a/sfm/database.py +++ b/sfm/database.py @@ -143,7 +143,9 @@ CREATE TABLE IF NOT EXISTS device_commands ( verified TEXT, -- "ok" | "mismatch" | "not_checked" outcome TEXT NOT NULL, -- "pending" | "sent" | "skipped" | "failed" error TEXT, - caller TEXT -- "webapp" | "terra-view" | "script" | ... + caller TEXT, -- "webapp" | "terra-view" | "script" | ... + sent INTEGER, -- did a frame go out: 1 acknowledged, 0 nothing sent, NULL unknown + states TEXT -- JSON: {"before": ..., "seen": [...], "after": ...} ); CREATE INDEX IF NOT EXISTS idx_device_commands_serial ON device_commands(serial, ts); """ @@ -302,6 +304,17 @@ class SeismoDb: log.info("_migrate: device_family backfill complete (remaining NULL=%d)", remaining) + # Migration 1d: device_commands gained `sent` and `states` after the + # table first shipped on feat/series4-sfm-parity. NULLable, so rows + # written before read NULL (= unknown). + existing_cols = { + r[1] for r in conn.execute("PRAGMA table_info(device_commands)").fetchall() + } + for col, ddl in (("sent", "INTEGER"), ("states", "TEXT")): + if col not in existing_cols: + log.info("_migrate: device_commands ADD COLUMN %s %s", col, ddl) + conn.execute(f"ALTER TABLE device_commands ADD COLUMN {col} {ddl}") + # Migration 2: change monitor_log UNIQUE from (serial, waveform_key) to # (serial, start_time) — same reasoning as events. row = conn.execute( @@ -429,16 +442,25 @@ class SeismoDb: verified: Optional[str], ack: Optional[dict], error: Optional[str], + sent: Optional[int] = None, + states: Optional[dict] = None, ) -> None: - """Record the result of a command begun with begin_device_command().""" + """Record the result of a command begun with begin_device_command(). + + `sent`: 1 a frame went out and was acknowledged, 0 nothing was sent, + None unknown (the ack was lost). `states`: what was read from the unit, + ``{"before": ..., "seen": [...], "after": ...}``. + """ ts = datetime.datetime.now(datetime.timezone.utc).isoformat() with self._connect() as conn: cur = conn.execute( "UPDATE device_commands SET finished_ts=?, outcome=?, verified=?, " - "ack=?, error=? WHERE id=? AND outcome='pending'", + "ack=?, error=?, sent=?, states=? WHERE id=? AND outcome='pending'", (ts, outcome, verified, json.dumps(ack) if ack is not None else None, - error, command_id), + error, sent, + json.dumps(states) if states is not None else None, + command_id), ) if cur.rowcount == 0: known = conn.execute( @@ -453,7 +475,7 @@ class SeismoDb: serial: Optional[str] = None, limit: int = 100, ) -> list[dict]: - """Return audit rows, newest first, with request/ack parsed from JSON.""" + """Return audit rows, newest first, with request/ack/states parsed from JSON.""" with self._connect() as conn: if serial: rows = conn.execute( @@ -466,7 +488,7 @@ class SeismoDb: out = [] for r in rows: d = dict(r) - for k in ("request", "ack"): + for k in ("request", "ack", "states"): if d[k] is not None: d[k] = json.loads(d[k]) out.append(d) diff --git a/sfm/device_access/__init__.py b/sfm/device_access/__init__.py index 5c00303..fae8073 100644 --- a/sfm/device_access/__init__.py +++ b/sfm/device_access/__init__.py @@ -1,8 +1,8 @@ """One door for every device request -- see the 2026-10-20 parity spec.""" from .errors import ( - AuditUnavailable, BadRequest, CallHomeInProgress, ConnectFailed, DeviceError, EventNotFound, - MalformedReply, NoAnswer, NotSupported, StaleEvent, UnitBusy, UnitStateUnknown, WrongUnit, - translate, + AuditIncomplete, AuditUnavailable, BadRequest, CallHomeInProgress, ChangeUnconfirmed, + ConnectFailed, DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent, + UnitBusy, UnitStateUnknown, WrongUnit, translate, ) from .models import ( ChangeResult, DownloadedEvent, EventDownload, EventList, EventRef, UnitAddress, UnitInfo, diff --git a/sfm/device_access/change.py b/sfm/device_access/change.py index 09c278d..2af5fc0 100644 --- a/sfm/device_access/change.py +++ b/sfm/device_access/change.py @@ -1,24 +1,40 @@ """The series-independent core of a start/stop request. -Identity -> state -> (dry run | skip | audit -> send once -> read back -> audit). -Each series supplies only its own pieces as callables: how to read the serial, -how to read the run-state name, how to send (returning the ack record), and how -to recognise a refusal or a ring. Nothing in here retries: `send` is called at -most once, and every path after `audit.begin` calls `audit.finish` exactly once. +Identity -> state -> (dry run | skip | audit -> pre-send drain -> send once -> +read back -> audit). Each series supplies only its own pieces as callables: +how to read the serial, how to read the run-state name, how to send (returning +the ack record), how to recognise a refusal or a ring, and optionally what to +drain from the line just before sending. Nothing in here retries: `send` is +called at most once, and every path after `audit.begin` calls `audit.finish` +exactly once, through `finish` below. -The state names `calling_home` and `unknown*` are Series-4 states; Series 3 -never produces them, so those branches are simply never taken there. +Once the send has started, a failure is never reported as if nothing went out: +it is a `ChangeUnconfirmed` naming the audit row, carrying the status its cause +would have had. The row's `sent` column says whether a frame went out (1), +did not (0), or may have (NULL), and `states` keeps every state read. + +The state names `calling_home` and `unknown*` are Series-4 states, except +`unknown(...)`, which Series 3 also produces for a flag byte never measured. +Series 3 never produces `calling_home` or a ring, so those branches are simply +never taken there. """ from __future__ import annotations -from typing import Any, Callable, Dict, Optional +from typing import Any, Callable, Dict, List, NoReturn, Optional -from .errors import AuditUnavailable, CallHomeInProgress, NotSupported, UnitStateUnknown, WrongUnit +from .errors import ( + AuditIncomplete, AuditUnavailable, CallHomeInProgress, ChangeUnconfirmed, NotSupported, + UnitStateUnknown, WrongUnit, translate, +) from .models import ChangeResult, UnitAddress from .series import normalise_serial CALL_HOME_MESSAGE = ("the unit started calling home; SFM hung up so the call can " "reach THOR -- try again in a few minutes") +_HUNG_UP = "SFM hung up so the call can reach THOR" + +# The row's `sent` column. +SENT_ACKNOWLEDGED, NOTHING_SENT, SENT_UNKNOWN = 1, 0, None def _never(exc: BaseException) -> bool: @@ -33,9 +49,11 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ describe_plan: Callable[[], Dict[str, Any]], send: Callable[[], Dict[str, Any]], is_refusal: Callable[[BaseException], bool] = _never, - is_ring: Callable[[BaseException], bool] = _never) -> ChangeResult: + is_ring: Callable[[BaseException], bool] = _never, + pre_send: Optional[Callable[[], None]] = None) -> ChangeResult: action = "start monitoring" if start else "stop monitoring" want = "monitoring" if start else "idle" + became = "started" if start else "stopped" reported = normalise_serial(read_serial()) if reported != serial: @@ -63,45 +81,110 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ except Exception as exc: # noqa: BLE001 raise AuditUnavailable( f"the audit log could not be written -- nothing sent: {exc}") from exc + + def states(seen: List[str], after: Optional[str]) -> Dict[str, Any]: + return {"before": before, "seen": list(seen), "after": after} + + def finish(unit: str, **fields: Any) -> None: + """The only way a row is finished. `unit` says what happened to the + unit, so a finish that fails still says it.""" + try: + audit.finish(cid, **fields) + except Exception as exc: # noqa: BLE001 + raise AuditIncomplete( + f"{unit} -- but audit record {cid} could not be finished: {exc}") from exc + + def unconfirmed(unit: str, cause: BaseException, *, went_out: str, status: int, + **fields: Any) -> NoReturn: + """Finish the row, then say the change went out (or may have) and name it. + `went_out` is "acknowledged" or "unknown"; the row's `sent` follows it.""" + finish(unit, sent=SENT_ACKNOWLEDGED if went_out == "acknowledged" else SENT_UNKNOWN, + **fields) + raise ChangeUnconfirmed(f"{unit} -- audit record {cid}", audit_id=cid, sent=went_out, + http_status=status) from cause + + def status_of(exc: BaseException) -> int: + return translate(exc, connecting=False).http_status + if before == want and not even_if_already: - audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, - error=f"already {want}") + finish(f"nothing was sent ({serial} is already {want})", + outcome="skipped", verified="not_checked", ack=None, error=f"already {want}", + sent=NOTHING_SENT, states=states([before], None)) return ChangeResult(dry_run=False, sent=False, outcome="skipped", verified="not_checked", state_after=before, audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base) + if pre_send is not None: + try: + pre_send() # sends nothing: drains what is already waiting + except Exception as exc: # noqa: BLE001 + if is_ring(exc): + finish("nothing was sent (a call-home began before sending)", + outcome="failed", verified="not_checked", ack=None, + error="a call-home began before sending -- nothing sent", + sent=NOTHING_SENT, states=states([before], None)) + raise CallHomeInProgress(CALL_HOME_MESSAGE) from exc + finish(f"nothing was sent (the line failed before sending: {exc})", + outcome="failed", verified="not_checked", ack=None, + error=f"the line failed before sending -- nothing sent: {exc}", + sent=NOTHING_SENT, states=states([before], None)) + raise # the link is suspect + try: ack = send() # the only send; nothing below can reach it again except Exception as exc: # noqa: BLE001 -- recorded, never retried if is_refusal(exc): # refused by the gate: nothing went out - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"refused before sending: {exc}") + finish(f"nothing was sent (refused before sending: {exc})", + outcome="failed", verified="not_checked", ack=None, + error=f"refused before sending: {exc}", + sent=NOTHING_SENT, states=states([before], None)) raise if is_ring(exc): - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"a call-home began in place of the ack: {exc}") - raise + unconfirmed(f"{action} was sent, but a call-home began in place of the " + f"acknowledgement -- whether it {became} is unknown; {_HUNG_UP}", + exc, went_out="unknown", status=CallHomeInProgress.http_status, + outcome="failed", verified="not_checked", ack=None, + error=f"a call-home began in place of the ack: {exc}", + states=states([before], None)) try: after: Optional[str] = read_state() except Exception as follow: # noqa: BLE001 if is_ring(follow): - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}; a call-home began: {follow}") - raise - after = None + unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and " + f"the unit then began calling home -- whether it {became} is " + f"unknown; {_HUNG_UP}", + follow, went_out="unknown", status=CallHomeInProgress.http_status, + outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; a call-home began: {follow}", + states=states([before], None)) + unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and " + f"reading the state afterwards failed ({follow}) -- whether it " + f"{became} is unknown", + exc, went_out="unknown", status=status_of(exc), + outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; the follow-up read failed: {follow}", + states=states([before], None)) if after == "calling_home": - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}; the unit is now calling home") - raise CallHomeInProgress(CALL_HOME_MESSAGE) from exc - audit.finish(cid, outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}") - if after is None: - raise # the link is suspect + unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and " + f"the unit then began calling home -- whether it {became} is " + f"unknown; {_HUNG_UP}", + exc, went_out="unknown", status=CallHomeInProgress.http_status, + outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}; the unit is now calling home", + states=states([before], after)) + finish(f"{action} was sent but the acknowledgement was lost ({exc}); the unit " + f"now reads {after}", + outcome="failed", verified="not_checked", ack=None, + error=f"no clean ack: {exc}", sent=SENT_UNKNOWN, states=states([before], after)) return ChangeResult(dry_run=False, sent=True, outcome="failed", verified="not_checked", state_after=after, audit_id=cid, detail={"error": f"no clean ack: {exc}"}, **base) seen = [before] + + def last_poll() -> Optional[str]: + return seen[-1] if len(seen) > 1 else None + polls = int(verify_timeout_s // verify_interval_s) try: for _ in range(polls): @@ -110,17 +193,42 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ if seen[-1] == want or seen[-1] == "calling_home": break except Exception as exc: # noqa: BLE001 -- the row must not stay pending - audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, - error=f"sent and acknowledged; reading the state back failed: {exc}") - raise + if is_ring(exc): + unconfirmed(f"{action} was sent and acknowledged, but the unit then began " + f"calling home before its state could be read back -- whether it " + f"{became} is unknown; {_HUNG_UP}", + exc, went_out="acknowledged", status=CallHomeInProgress.http_status, + outcome="sent", verified="not_checked", ack=ack, + error=f"sent and acknowledged; a call-home began while reading the " + f"state back: {exc}", + states=states(seen, last_poll())) + unconfirmed(f"{action} was sent and acknowledged, but reading the state back " + f"failed: {exc}", + exc, went_out="acknowledged", status=status_of(exc), + outcome="sent", verified="not_checked", ack=ack, + error=f"sent and acknowledged; reading the state back failed: {exc}", + states=states(seen, last_poll())) if seen[-1] == "calling_home": - audit.finish(cid, outcome="sent", verified="not_checked", ack=ack, - error="sent and acknowledged; the unit then began calling home") - raise CallHomeInProgress(CALL_HOME_MESSAGE) + cause = CallHomeInProgress(CALL_HOME_MESSAGE) + unconfirmed(f"{action} was sent and acknowledged, but the unit then began calling " + f"home -- whether it {became} is unknown; {_HUNG_UP}", + cause, went_out="acknowledged", status=cause.http_status, + outcome="sent", verified="not_checked", ack=ack, + error="sent and acknowledged; the unit then began calling home", + states=states(seen, last_poll())) ok = seen[-1] == want outcome, verified = ("sent", "ok") if ok else ("failed", "mismatch") - audit.finish(cid, outcome=outcome, verified=verified, ack=ack, - error=None if ok else f"unit reads {seen[-1]}, expected {want}") + error = None if ok else f"unit reads {seen[-1]}, expected {want}" + detail: Dict[str, Any] = {"states_seen": seen, "ack": ack} + if even_if_already and before == want: + note = (f"the unit was already {want} before sending; the read-back cannot show " + "that this send changed anything") + detail["note"] = note + if error is None: + error = note + finish(f"{action} was sent and verified" if ok else + f"{action} was sent and acknowledged, but the unit reads {seen[-1]}, not {want}", + outcome=outcome, verified=verified, ack=ack, error=error, + sent=SENT_ACKNOWLEDGED, states=states(seen, last_poll())) return ChangeResult(dry_run=False, sent=True, outcome=outcome, verified=verified, - state_after=seen[-1], audit_id=cid, - detail={"states_seen": seen, "ack": ack}, **base) + state_after=seen[-1], audit_id=cid, detail=detail, **base) diff --git a/sfm/device_access/errors.py b/sfm/device_access/errors.py index 35b4c29..c954f5e 100644 --- a/sfm/device_access/errors.py +++ b/sfm/device_access/errors.py @@ -31,6 +31,31 @@ class AuditUnavailable(DeviceError): http_status = 503 +class AuditIncomplete(DeviceError): + """The unit was dealt with, but its audit row could not be finished. The + message says what happened to the unit first, then names the row.""" + http_status = 500 + + +class ChangeUnconfirmed(DeviceError): + """A change failed after its frame went out, or may have gone out. + + `sent` is "acknowledged" (the ack came back; the read-back failed) or + "unknown" (the ack was lost, or a call-home took its place). The status is + the one the cause would have had, set per instance, and the message names + the audit record. It never means "nothing was sent". + """ + http_status = 500 + + def __init__(self, message: str, *, audit_id: str, sent: str, http_status: int) -> None: + if sent not in ("acknowledged", "unknown"): + raise ValueError(f"sent must be 'acknowledged' or 'unknown', not {sent!r}") + super().__init__(message) + self.audit_id = audit_id + self.sent = sent + self.http_status = http_status + + class UnitBusy(DeviceError): http_status = 423 diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index caf3826..a7efaa6 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -13,7 +13,7 @@ from minimateplus.framing import build_bw_write_frame from minimateplus.protocol import SUB_START_MONITORING, SUB_STOP_MONITORING from minimateplus.transport import TcpTransport -from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent, WrongUnit, translate +from .errors import DeviceError, EventNotFound, MalformedReply, NoAnswer, StaleEvent, WrongUnit, translate from .change import run_change from .events import iso_of, make_event_id, stamp_of from .models import ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, UnitInfo, UnitSettings, UnitStatus @@ -26,6 +26,19 @@ S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "H S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use +# The 0x1C flag byte (section[1]): the only two values ever measured. +S3_RUN_STATES = {0x00: "idle", 0x10: "monitoring"} + + +def s3_run_state(status: Any) -> str: + """The change path's state name from the raw 0x1C flag -- never + `is_monitoring`, which reads every byte but 0x10 as idle. A value never + measured is `unknown(0x..)`, and the change core refuses it.""" + flag = getattr(status, "state_flag", None) + if flag is None: + return "unknown(short)" + return S3_RUN_STATES.get(flag, f"unknown(0x{flag:02X})") + def default_s3_client_factory(address: UnitAddress, timeout: Optional[float] = None) -> MiniMateClient: if address.host: @@ -120,7 +133,7 @@ class Series3Adapter: even_if_already=even_if_already, audit=audit, address=address, caller=caller, sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, read_serial=read_serial, - read_state=lambda: "monitoring" if client.get_monitor_status().is_monitoring else "idle", + read_state=lambda: s3_run_state(client.get_monitor_status()), describe_plan=describe_plan, send=send) return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index e5cf27c..e0014fd 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -1,5 +1,11 @@ """Series-4 sessions: call up once, stay on the line, hang up when idle. +⚠ **This module hosts a write path.** `s4_change_monitoring` is the Series-4 +wrapper of the shared change core (`change.run_change`): it sends `0x96` / +`0x97` through `MicromateProtocol.execute()`, and it is the only caller of +`.protocol.execute(` in the codebase (a test pins that). Everything else here +is a read. + ⚠ Imports only minimateplus.transport from the Series-3 package. Nothing here may build or send a Series-3 frame -- SESSION_RESET (41 03) has never been sent to a Micromate. @@ -17,8 +23,8 @@ from micromate.writes import plan_start_monitoring, plan_stop_monitoring from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import ( - AuditUnavailable, CallHomeInProgress, DeviceError, EventNotFound, MalformedReply, NotSupported, StaleEvent, - UnitStateUnknown, WrongUnit, translate, + CallHomeInProgress, ChangeUnconfirmed, DeviceError, EventNotFound, MalformedReply, StaleEvent, + WrongUnit, translate, ) from .change import CALL_HOME_MESSAGE, run_change from .events import iso_of, make_event_id, stamp_of @@ -124,8 +130,10 @@ class Series4Session: so it hangs up too -- conservative, since the link may be fine. Operations added in later phases must keep to this: never wrap a link failure in a `DeviceError` inside an op, or the line stays open on a broken link. - The one exception: `CallHomeInProgress` and `WrongUnit` release the line, - because the line itself is the problem. + The exceptions: `CallHomeInProgress` and `WrongUnit` release the line, + because the line itself is the problem; so does `ChangeUnconfirmed`, which + the change core raises only after a link fault or a ring, once the frame + has gone out. `AuditIncomplete` is an ordinary verdict: the line is kept. """ def __init__(self, address: UnitAddress, serial: str, @@ -173,10 +181,13 @@ class Series4Session: log.warning("RADIO RING from %s -- released the line so the call reaches THOR", self.address.key) raise CallHomeInProgress(_RING_MESSAGE) from exc - except (CallHomeInProgress, WrongUnit) as exc: + except (CallHomeInProgress, WrongUnit, ChangeUnconfirmed) as exc: # The line itself is the problem: a call-home rides whatever holds the # modem's single TCP session, and a line held for X that answers as Y - # must not stay held. + # must not stay held. ChangeUnconfirmed always follows a link fault + # or a ring (the core converts those itself, so the RingDetected + # clause above never sees them). All three are DeviceErrors, so this + # clause must stay above `except DeviceError`. self.hang_up() log.warning("%s at %s -- released the line: %s", type(exc).__name__, self.address.key, exc) @@ -340,4 +351,8 @@ def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool read_state=lambda: client.read_run_state().name, describe_plan=plan.describe, send=send, is_refusal=lambda e: isinstance(e, OpcodeRefused), - is_ring=lambda e: isinstance(e, RingDetected)) + is_ring=lambda e: isinstance(e, RingDetected), + # A RADIO RING already buffered is caught here, before 0x96/0x97 goes + # out. One transport read: RingWatchTransport over Tcp/SerialTransport, + # each with a 10 ms read timeout, so it returns at once on a quiet line. + pre_send=lambda: client.read_unsolicited()) diff --git a/sfm/server.py b/sfm/server.py index 04ce048..e1d39d1 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -1869,9 +1869,31 @@ def device_monitor_start( With `serial`: the unit's identity is read first (a different unit is a 409, nothing sent), then its state; `dry_run` returns the planned frames and sends - nothing; a live change is audited, verified by reading the state back, and - never retried. The response is the ChangeResult (409 if the unit never - reached the state, 502 if the ack was lost). + nothing; a live change is audited (`GET /db/device_commands`), verified by + reading the state back, and never retried. `even_if_already` sends even + when the unit is already in the target state. + + Statuses with `serial`: + 200 the ChangeResult: a dry run, a skip (already in the state), or a send + read back as made + 409 ChangeResult: sent and acknowledged, but the unit never reached the + state (`verified: mismatch`, every state seen kept); or, as an + error, a different unit answered or its state was never measured + (nothing sent either way) + 502 ChangeResult: the ack was lost but the unit could be read afterwards + 422 a malformed serial or address; 423 the unit is busy; + 501 no audit log is configured (nothing sent) + 503 the unit is calling home, or a call-home was already waiting before + sending (nothing sent); or the audit log could not be written + (nothing sent) + 500 the audit row could not be finished -- the detail says first what + happened to the unit (sent and verified, nothing sent, ...) + 504 / 502 / 503 a link failure before anything was sent + A failure AFTER the frame went out (or may have) -- the read-back failed, + the ack was lost and the unit could not be read, or a call-home began -- + takes the status its cause would have had (503 for a call-home, 504 for + silence, 502 for a bad reply, 503 for a lost connection), and its detail + says the frame was sent and names the audit record. Without `serial`: the legacy behaviour above, unchanged. """ @@ -1912,9 +1934,31 @@ def device_monitor_stop( With `serial`: the unit's identity is read first (a different unit is a 409, nothing sent), then its state; `dry_run` returns the planned frames and sends - nothing; a live change is audited, verified by reading the state back, and - never retried. The response is the ChangeResult (409 if the unit never - reached the state, 502 if the ack was lost). + nothing; a live change is audited (`GET /db/device_commands`), verified by + reading the state back, and never retried. `even_if_already` sends even + when the unit is already in the target state. + + Statuses with `serial`: + 200 the ChangeResult: a dry run, a skip (already in the state), or a send + read back as made + 409 ChangeResult: sent and acknowledged, but the unit never reached the + state (`verified: mismatch`, every state seen kept); or, as an + error, a different unit answered or its state was never measured + (nothing sent either way) + 502 ChangeResult: the ack was lost but the unit could be read afterwards + 422 a malformed serial or address; 423 the unit is busy; + 501 no audit log is configured (nothing sent) + 503 the unit is calling home, or a call-home was already waiting before + sending (nothing sent); or the audit log could not be written + (nothing sent) + 500 the audit row could not be finished -- the detail says first what + happened to the unit (sent and verified, nothing sent, ...) + 504 / 502 / 503 a link failure before anything was sent + A failure AFTER the frame went out (or may have) -- the read-back failed, + the ack was lost and the unit could not be read, or a call-home began -- + takes the status its cause would have had (503 for a call-home, 504 for + silence, 502 for a bad reply, 503 for a lost connection), and its detail + says the frame was sent and names the audit record. Without `serial`: the legacy behaviour above, unchanged. """ @@ -3137,8 +3181,13 @@ def db_device_commands( ) -> dict: """ The audit trail of changes SFM attempted on units, newest first. + + Each row's `sent` says whether a frame went out (1 acknowledged, 0 nothing + sent, null unknown) and `states` holds every state read (before / seen / + after). `serial` is matched case-insensitively. """ - return {"commands": _get_db().query_device_commands(serial, limit)} + serial = normalise_serial(serial) if serial else None + return {"commands": _get_db().query_device_commands(serial or None, limit)} # ── Entry point ──────────────────────────────────────────────────────────────── diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 02698ca..01a2b89 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -108,9 +108,11 @@ class FakeMiniMateClient(_Base): def get_monitor_status(self) -> MonitorStatus: self._step("get_monitor_status") state = self.monitor_states.pop(0) if len(self.monitor_states) > 1 else self.monitor_states[0] + # A bool is a measured state; an int (or None: a short section) is the raw 0x1C flag byte. + flag = (0x10 if state else 0x00) if isinstance(state, bool) else state return MonitorStatus( - is_monitoring=state, battery_v=6.8, - memory_total=983026, memory_free=900000, + is_monitoring=flag == 0x10, battery_v=6.8, + memory_total=983026, memory_free=900000, state_flag=flag, ) diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index d2f82df..7dd9970 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -14,7 +14,8 @@ from sfm.device_access.s4 import RingDetected # no from device_access_fakes import FakeMicromateClient # noqa: E402 from sfm.device_access.access import DeviceAccess # noqa: E402 from sfm.device_access.errors import ( # noqa: E402 - AuditUnavailable, CallHomeInProgress, DeviceError, NoAnswer, NotSupported, UnitStateUnknown, WrongUnit, + AuditIncomplete, AuditUnavailable, CallHomeInProgress, ChangeUnconfirmed, ConnectFailed, DeviceError, + NotSupported, UnitStateUnknown, WrongUnit, ) from sfm.device_access.models import UnitAddress # noqa: E402 @@ -40,6 +41,21 @@ def access(fake, audit="default"): sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) +def unconfirmed(excinfo, da, *, sent, status): + """A failure after the send: it names the one audit row, says a frame went + out (or may have), and carries its cause's status. Returns the row.""" + ((cid, row),) = da._audit.rows.items() + e = excinfo.value + assert (e.audit_id, e.sent, e.http_status) == (cid, sent, status) + assert f"audit record {cid}" in str(e) + assert "was sent" in str(e) and "nothing sent" not in str(e) + return row + + +def released(fake, da): + return fake.is_open() is False and ADDR.key not in da._sessions + + def test_a_dry_run_returns_the_exact_frames_and_sends_nothing(): fake = FakeMicromateClient(run_states=[0x00]) da = access(fake) @@ -149,50 +165,64 @@ def test_a_read_back_that_fails_still_finishes_the_audit_row(): raise mm_proto.TimeoutError("dropped") return orig() fake.read_run_state = flaky - with pytest.raises(Exception): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") - (row,) = da._audit.rows.values() + row = unconfirmed(e, da, sent="acknowledged", status=504) + assert "sent and acknowledged" in str(e.value) and "dropped" in str(e.value) assert len(fake.executed) == 1 assert (row["outcome"], row["verified"]) == ("sent", "not_checked") assert row["ack"] is not None assert "reading the state back failed" in row["error"] + assert row["sent"] == 1 assert fake.is_open() is False and ADDR.key not in da._sessions def test_a_ring_in_place_of_the_ack_is_a_call_home_not_a_send(): fake = FakeMicromateClient(run_states=[0x00], execute_error=RingDetected("RADIO RING")) da = access(fake) - with pytest.raises(CallHomeInProgress): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") + row = unconfirmed(e, da, sent="unknown", status=503) + assert "hung up so the call can reach THOR" in str(e.value) + assert "whether it started is unknown" in str(e.value) assert len(fake.executed) == 1 assert fake.is_open() is False and ADDR.key not in da._sessions - (row,) = da._audit.rows.values() assert (row["outcome"], row["verified"]) == ("failed", "not_checked") assert "call-home began in place of the ack" in row["error"] + assert row["sent"] is None def test_calling_home_seen_while_polling_releases_the_line(): fake = FakeMicromateClient(run_states=[0x00, 0x03]) da = access(fake) - with pytest.raises(CallHomeInProgress): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") + row = unconfirmed(e, da, sent="acknowledged", status=503) + assert "hung up so the call can reach THOR" in str(e.value) assert len(fake.executed) == 1 assert fake.calls.count("read_run_state") == 2 # the read before + the one poll assert fake.is_open() is False and ADDR.key not in da._sessions - (row,) = da._audit.rows.values() assert (row["outcome"], row["verified"]) == ("sent", "not_checked") assert row["ack"] is not None + assert row["sent"] == 1 + assert row["states"] == {"before": "idle", "seen": ["idle", "calling_home"], + "after": "calling_home"} def test_calling_home_after_a_lost_ack_releases_the_line(): fake = FakeMicromateClient(run_states=[0x00, 0x03], execute_error=mm_proto.TimeoutError("no ack")) da = access(fake) - with pytest.raises(CallHomeInProgress): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") - assert fake.is_open() is False - (row,) = da._audit.rows.values() + row = unconfirmed(e, da, sent="unknown", status=503) + assert "acknowledgement was lost" in str(e.value) + assert "whether it started is unknown" in str(e.value) + assert "hung up so the call can reach THOR" in str(e.value) + assert fake.is_open() is False and ADDR.key not in da._sessions assert (row["outcome"], row["verified"]) == ("failed", "not_checked") + assert row["sent"] is None + assert row["states"] == {"before": "idle", "seen": ["idle"], "after": "calling_home"} def test_a_refusal_by_execute_is_not_a_send(): @@ -227,10 +257,13 @@ def test_lost_ack_and_failed_follow_up_read_on_a_held_line_releases_it(): raise mm_proto.TimeoutError("gone") return orig() fake.read_run_state = flaky - with pytest.raises(NoAnswer): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") + row = unconfirmed(e, da, sent="unknown", status=504) + assert "acknowledgement was lost" in str(e.value) and "gone" in str(e.value) assert len(fake.executed) == 1 assert fake.is_open() is False and ADDR.key not in da._sessions + assert (row["outcome"], row["verified"], row["sent"]) == ("failed", "not_checked", None) def test_a_live_change_in_an_unmeasured_state_is_refused_but_a_dry_run_is_not(): @@ -261,12 +294,14 @@ def test_a_ring_on_the_follow_up_read_after_a_lost_ack_finishes_the_row(): raise RingDetected("RADIO RING") return orig() fake.read_run_state = ringing - with pytest.raises(CallHomeInProgress): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(ADDR, "UM20147") + row = unconfirmed(e, da, sent="unknown", status=503) + assert "hung up so the call can reach THOR" in str(e.value) assert len(fake.executed) == 1 - (row,) = da._audit.rows.values() assert (row["outcome"], row["verified"]) == ("failed", "not_checked") assert "a call-home began" in row["error"] + assert row["sent"] is None assert fake.is_open() is False and ADDR.key not in da._sessions @@ -312,6 +347,11 @@ def test_series3_dry_run_returns_its_own_frame_and_sends_nothing(): assert (r.series, r.outcome, r.state_before) == (3, "dry_run", "idle") assert r.plan["steps"][0]["sub"] == "0x96" and fake.writes == [] assert r.plan["steps"][0]["expect_ack"] == "0x69" and r.plan["sends_nothing"] is True + assert r.plan["steps"][0]["frame"] == "41021010009600000000000000000000000000a603" + stop = access3(FakeMiniMateClient(monitor_states=[True])).stop_monitoring( + TCP3, "BE18193", dry_run=True) + assert stop.plan["steps"][0]["frame"] == "41021010009700000000000000000000000000a703" + assert stop.plan["steps"][0]["expect_ack"] == "0x68" and stop.outcome == "dry_run" def test_series3_start_is_verified_by_monitor_status(): @@ -321,6 +361,7 @@ def test_series3_start_is_verified_by_monitor_status(): assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") assert fake.writes == ["start_monitoring"] assert da._audit.rows[r.audit_id]["ack"] == {"subs": ["0x69"]} + assert da.factory_calls == [{"timeout": 120.0}] def test_series3_stop_acks_0x68(): @@ -338,7 +379,7 @@ def test_series3_wrong_unit_is_refused_before_writing(): assert fake.writes == [] -def test_series3_a_lost_ack_is_never_retried_even_over_tcp(): +def test_series3_a_lost_ack_with_a_good_read_back_is_one_write(): fake = FakeMiniMateClient(monitor_states=[False, True], write_error=mmp_proto.TimeoutError("no ack")) da = access3(fake) @@ -375,9 +416,9 @@ def test_series3_a_failing_read_back_is_audited_then_raised(): raise mmp_proto.TimeoutError("quiet") return real() fake.get_monitor_status = flaky - with pytest.raises(NoAnswer): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(TCP3, "BE18193") - row = next(iter(da._audit.rows.values())) + row = unconfirmed(e, da, sent="acknowledged", status=504) assert (row["outcome"], row["verified"]) == ("sent", "not_checked") assert "reading the state back failed" in row["error"] assert fake.writes == ["start_monitoring"] @@ -405,12 +446,251 @@ def test_series3_lost_ack_with_unreadable_follow_up_raises_and_is_not_retried(): raise mmp_proto.TimeoutError("still quiet") return real() fake.get_monitor_status = second_fails - with pytest.raises(NoAnswer): + with pytest.raises(ChangeUnconfirmed) as e: da.start_monitoring(TCP3, "BE18193") + row = unconfirmed(e, da, sent="unknown", status=504) assert fake.writes == ["start_monitoring"] assert len(da.factory_calls) == 1 # no second TCP attempt - row = next(iter(da._audit.rows.values())) assert row["outcome"] == "failed" # The other Series-3 operations still retry once over TCP on a cold unit: # tests/test_device_access_s3.py::test_a_cold_unit_over_tcp_gets_one_retry. + + +# ── final fix wave: after-send honesty, the audit row, pre-send ring, S3 states ── + +from sfm.audit import DbAudit # noqa: E402 +from sfm.database import SeismoDb # noqa: E402 + + +def test_a_lost_stop_ack_then_a_call_home_says_whether_it_stopped_is_unknown(): + fake = FakeMicromateClient(run_states=[0x02, 0x03], + execute_error=mm_proto.TimeoutError("no ack")) + da = access(fake) + with pytest.raises(ChangeUnconfirmed) as e: + da.stop_monitoring(ADDR, "UM20147") + unconfirmed(e, da, sent="unknown", status=503) + assert str(e.value).startswith("stop monitoring was sent but the acknowledgement was lost") + assert "whether it stopped is unknown" in str(e.value) + assert released(fake, da) + + +def test_a_ring_on_a_read_back_poll_is_unconfirmed_and_releases_the_line(): + fake = FakeMicromateClient(run_states=[0x00]) + da = access(fake) + orig, n = fake.read_run_state, [] + + def ringing(): + n.append(1) + if len(n) == 2: # the first read-back poll + raise RingDetected("RADIO RING") + return orig() + fake.read_run_state = ringing + with pytest.raises(ChangeUnconfirmed) as e: + da.start_monitoring(ADDR, "UM20147") + row = unconfirmed(e, da, sent="acknowledged", status=503) + assert "hung up so the call can reach THOR" in str(e.value) + assert len(fake.executed) == 1 + assert (row["outcome"], row["verified"], row["sent"]) == ("sent", "not_checked", 1) + assert row["ack"] is not None and "call-home began" in row["error"] + assert released(fake, da) + + +def test_a_ring_already_waiting_before_the_send_sends_nothing(): + fake = FakeMicromateClient(run_states=[0x00]) + + def buffered_ring(): + fake.calls.append("read_unsolicited") + raise RingDetected("RADIO RING") + fake.read_unsolicited = buffered_ring + da = access(fake) + with pytest.raises(CallHomeInProgress) as e: + da.start_monitoring(ADDR, "UM20147") + assert not isinstance(e.value, ChangeUnconfirmed) + assert fake.executed == [] + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"], row["sent"]) == ("failed", "not_checked", 0) + assert row["error"] == "a call-home began before sending -- nothing sent" + assert released(fake, da) + + +def test_the_pre_send_drain_runs_after_the_state_read_and_before_the_send(): + fake = FakeMicromateClient(run_states=[0x00, 0x02]) + access(fake).start_monitoring(ADDR, "UM20147") + assert fake.calls.index("read_unsolicited") > fake.calls.index("read_run_state") + assert fake.calls.index("read_unsolicited") < fake.calls.index("execute") + + +def test_a_skip_does_not_drain_the_line(): + fake = FakeMicromateClient(run_states=[0x02]) + access(fake).start_monitoring(ADDR, "UM20147") + assert "read_unsolicited" not in fake.calls + + +def test_a_link_fault_on_the_pre_send_drain_sends_nothing_and_finishes_the_row(): + fake = FakeMicromateClient(run_states=[0x00]) + + def dead(): + raise OSError("connection reset") + fake.read_unsolicited = dead + da = access(fake) + with pytest.raises(ConnectFailed): + da.start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + (row,) = da._audit.rows.values() + assert (row["outcome"], row["verified"], row["sent"]) == ("failed", "not_checked", 0) + assert "nothing sent" in row["error"] + assert released(fake, da) + + +class FinishFails(Audit): + def finish(self, cid, **f): + raise OSError("disk full") + + +def test_a_finish_that_fails_after_a_verified_send_is_audit_incomplete_and_keeps_the_line(): + fake = FakeMicromateClient(run_states=[0x00, 0x02]) + da = access(fake, audit=FinishFails()) + with pytest.raises(AuditIncomplete) as e: + da.start_monitoring(ADDR, "UM20147") + assert e.value.http_status == 500 + assert "start monitoring was sent and verified" in str(e.value) + assert "audit record c1 could not be finished: disk full" in str(e.value) + assert len(fake.executed) == 1 + assert fake.is_open() is True and da.held_serial(ADDR) == "UM20147" + + +def test_a_finish_that_fails_on_a_skip_says_nothing_was_sent(): + fake = FakeMicromateClient(run_states=[0x02]) + with pytest.raises(AuditIncomplete, match="nothing was sent .*already monitoring"): + access(fake, audit=FinishFails()).start_monitoring(ADDR, "UM20147") + assert fake.executed == [] + + +def test_a_finish_that_fails_while_unconfirmed_keeps_the_unit_outcome(): + fake = FakeMicromateClient(run_states=[0x00], execute_error=RingDetected("RADIO RING")) + with pytest.raises(AuditIncomplete) as e: + access(fake, audit=FinishFails()).start_monitoring(ADDR, "UM20147") + assert "start monitoring was sent" in str(e.value) + assert "whether it started is unknown" in str(e.value) + assert "could not be finished: disk full" in str(e.value) + + +def test_even_if_already_notes_that_the_read_back_proves_nothing(): + fake = FakeMicromateClient(run_states=[0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147", even_if_already=True) + note = ("the unit was already monitoring before sending; the read-back cannot show " + "that this send changed anything") + assert (r.outcome, r.verified) == ("sent", "ok") + assert r.detail["note"] == note + assert da._audit.rows[r.audit_id]["error"] == note + + +def test_without_even_if_already_there_is_no_note(): + fake = FakeMicromateClient(run_states=[0x00, 0x02]) + da = access(fake) + r = da.start_monitoring(ADDR, "UM20147") + assert "note" not in r.detail and da._audit.rows[r.audit_id]["error"] is None + + +# -- the audit row records whether a frame went out, and the states, in the real DB + +def db_access(fake, tmp_path): + db = SeismoDb(tmp_path / "s.db") + da = access(fake, audit=DbAudit(lambda: db)) + return da, db + + +def test_db_row_for_a_skip_says_nothing_was_sent(tmp_path): + da, db = db_access(FakeMicromateClient(run_states=[0x02]), tmp_path) + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert (row["outcome"], row["sent"]) == ("skipped", 0) + assert row["states"] == {"before": "monitoring", "seen": ["monitoring"], "after": None} + + +def test_db_row_for_a_verified_send(tmp_path): + da, db = db_access(FakeMicromateClient(run_states=[0x00, 0x00, 0x02]), tmp_path) + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert (row["outcome"], row["verified"], row["sent"]) == ("sent", "ok", 1) + assert row["states"] == {"before": "idle", "seen": ["idle", "idle", "monitoring"], + "after": "monitoring"} + + +def test_db_row_for_a_mismatch(tmp_path): + da, db = db_access(FakeMicromateClient(run_states=[0x00]), tmp_path) + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert (row["outcome"], row["verified"], row["sent"]) == ("failed", "mismatch", 1) + assert row["states"] == {"before": "idle", "seen": ["idle"] * 4, "after": "idle"} + + +def test_db_row_for_a_lost_ack_with_a_readable_follow_up(tmp_path): + fake = FakeMicromateClient(run_states=[0x00, 0x02], execute_error=mm_proto.TimeoutError("no ack")) + da, db = db_access(fake, tmp_path) + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert (row["outcome"], row["sent"]) == ("failed", None) + assert row["states"] == {"before": "idle", "seen": ["idle"], "after": "monitoring"} + + +def test_db_row_for_a_read_back_failure(tmp_path): + fake = FakeMicromateClient(run_states=[0x00]) + orig, n = fake.read_run_state, [] + + def flaky(): + n.append(1) + if len(n) == 3: # the second read-back poll + raise mm_proto.TimeoutError("dropped") + return orig() + fake.read_run_state = flaky + da, db = db_access(fake, tmp_path) + with pytest.raises(ChangeUnconfirmed) as e: + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert e.value.audit_id == row["id"] + assert (row["outcome"], row["verified"], row["sent"]) == ("sent", "not_checked", 1) + assert row["states"] == {"before": "idle", "seen": ["idle", "idle"], "after": "idle"} + + +def test_db_row_for_a_pre_send_ring_says_nothing_was_sent(tmp_path): + fake = FakeMicromateClient(run_states=[0x00]) + + def buffered_ring(): + raise RingDetected("RADIO RING") + fake.read_unsolicited = buffered_ring + da, db = db_access(fake, tmp_path) + with pytest.raises(CallHomeInProgress): + da.start_monitoring(ADDR, "UM20147") + (row,) = db.query_device_commands() + assert (row["outcome"], row["sent"]) == ("failed", 0) + + +# -- Series 3: the raw state byte, never collapsed into "idle" ---------------------- + +def test_series3_an_unmeasured_state_byte_is_refused_with_nothing_written(): + fake = FakeMiniMateClient(monitor_states=[0x07]) + da = access3(fake) + with pytest.raises(UnitStateUnknown, match="0x07"): + da.start_monitoring(TCP3, "BE18193") + assert fake.writes == [] and da._audit.rows == {} + + +@pytest.mark.parametrize("flag,state", [(0x00, "idle"), (0x10, "monitoring"), + (0x07, "unknown(0x07)"), (None, "unknown(short)")]) +def test_series3_state_names_come_from_the_raw_flag(flag, state): + fake = FakeMiniMateClient(monitor_states=[flag]) + r = access3(fake).start_monitoring(TCP3, "BE18193", dry_run=True) + assert r.state_before == state + + +def test_series3_monitor_status_decode_keeps_the_raw_flag(): + from minimateplus.client import _decode_monitor_status + tail = bytes.fromhex("02a8000effc0000e9e52") # battery + memory: the last 10 bytes + for flag, monitoring in ((0x00, False), (0x10, True), (0x07, False)): + st = _decode_monitor_status(bytes(11) + bytes([0x00, flag]) + bytes(34) + tail) + assert (st.state_flag, st.is_monitoring) == (flag, monitoring) + assert _decode_monitor_status(bytes(12)).state_flag is None # no section[1] + assert _decode_monitor_status(b"").state_flag is None diff --git a/tests/test_device_commands.py b/tests/test_device_commands.py index 3a9229c..54d94b3 100644 --- a/tests/test_device_commands.py +++ b/tests/test_device_commands.py @@ -62,3 +62,62 @@ def test_a_second_finish_raises_and_keeps_the_first_result(tmp_path): row = db.query_device_commands()[0] assert (row["outcome"], row["verified"], row["ack"], row["error"]) == \ ("failed", "mismatch", {"subs": ["0x69"]}, "unit reads idle") + + +def test_a_finish_records_whether_a_frame_went_out_and_the_states(tmp_path): + db = SeismoDb(tmp_path / "s.db") + states = {"before": "idle", "seen": ["idle", "monitoring"], "after": "monitoring"} + cid = db.begin_device_command(**ROW) + db.finish_device_command(cid, outcome="sent", verified="ok", ack={"subs": ["0x69"]}, + error=None, sent=1, states=states) + row = db.query_device_commands()[0] + assert (row["sent"], row["states"]) == (1, states) + + +def test_sent_and_states_default_to_null(tmp_path): + db = SeismoDb(tmp_path / "s.db") + cid = db.begin_device_command(**ROW) + db.finish_device_command(cid, outcome="failed", verified="not_checked", ack=None, + error="no clean ack") + row = db.query_device_commands()[0] + assert (row["sent"], row["states"]) == (None, None) + + +def test_db_audit_passes_sent_and_states_through(tmp_path): + db = SeismoDb(tmp_path / "s.db") + audit = DbAudit(lambda: db) + cid = audit.begin(**ROW) + audit.finish(cid, outcome="skipped", verified="not_checked", ack=None, error="already idle", + sent=0, states={"before": "idle", "seen": ["idle"], "after": None}) + row = db.query_device_commands()[0] + assert row["sent"] == 0 and row["states"]["before"] == "idle" + + +# The device_commands table as Task 3 created it: no `sent`, no `states`. +_TASK3_TABLE = """ +CREATE TABLE device_commands ( + id TEXT PRIMARY KEY, ts TEXT NOT NULL, finished_ts TEXT, serial TEXT NOT NULL, + series INTEGER NOT NULL, address TEXT NOT NULL, action TEXT NOT NULL, tier TEXT NOT NULL, + request TEXT, ack TEXT, verified TEXT, outcome TEXT NOT NULL, error TEXT, caller TEXT +); +INSERT INTO device_commands (id, ts, serial, series, address, action, tier, outcome) + VALUES ('old', '2026-10-22T00:00:00+00:00', 'UM20147', 4, 'tcp:x', 'stop monitoring', + 'change', 'pending'); +""" + + +def test_an_existing_task3_table_gains_sent_and_states(tmp_path): + import sqlite3 + path = tmp_path / "s.db" + with sqlite3.connect(path) as conn: + conn.executescript(_TASK3_TABLE) + db = SeismoDb(path) + with sqlite3.connect(path) as conn: + cols = {r[1] for r in conn.execute("PRAGMA table_info(device_commands)")} + assert {"sent", "states"} <= cols + old = db.query_device_commands()[0] + assert (old["id"], old["sent"], old["states"]) == ("old", None, None) + db.finish_device_command("old", outcome="failed", verified="not_checked", ack=None, + error="x", sent=0, states={"before": "idle", "seen": ["idle"], "after": None}) + assert db.query_device_commands()[0]["sent"] == 0 + SeismoDb(path) # a second open is a no-op diff --git a/tests/test_micromate_client.py b/tests/test_micromate_client.py index 8efea13..b5f2a5e 100644 --- a/tests/test_micromate_client.py +++ b/tests/test_micromate_client.py @@ -611,3 +611,27 @@ def test_serial_refresh_reads_the_unit_again(): mm._serial = "UM99999" # a stale cached serial assert mm.serial(refresh=True) == "UM20147" assert len(t.written) == 1 + assert mm._serial == "UM20147" # the cache took the fresh read + assert mm.serial() == "UM20147" and len(t.written) == 1 # and a plain read sends nothing + + +@pytest.mark.parametrize("data", [b"", bytes(11)]) +def test_an_empty_or_short_0x49_reply_raises(data): + mm, _t = client([frame(0xB6, data)]) + with pytest.raises(ProtocolError, match="no content"): + mm.read_run_state() + + +def test_reading_unsolicited_bytes_keeps_executes_fresh_reply_precondition(): + """The change path drains the line between its state read and its send. A + raw transport read never goes through `_send`, so the trust `execute` + needs survives it.""" + from micromate.protocol import ACK_DATA_LEN + from micromate.writes import plan_start_monitoring + mm, t = client([frame(0xB6, bytes(11) + bytes([0x00]) + bytes(4)), b"\x00\xff stray", + frame(0x69, bytes(ACK_DATA_LEN))]) + assert mm.read_run_state().name == "idle" + assert mm.read_unsolicited() == b"\x00\xff stray" + assert mm.protocol.last_flags == FLAGS_CB + acks = mm.protocol.execute(plan_start_monitoring()) + assert [a.sub for a in acks] == [0x69] and len(t.written) == 2 diff --git a/tests/test_micromate_execute.py b/tests/test_micromate_execute.py index acb5e46..c1b984f 100644 --- a/tests/test_micromate_execute.py +++ b/tests/test_micromate_execute.py @@ -231,17 +231,55 @@ def test_the_scanner_ignores_ordinary_calls(): assert scan_source("p._send(frame)\nf(a, b=1)") == [] -def test_only_protocol_py_grants_write_permission(): +def scan_file(scanner, src: str, rel: str) -> list[str]: + """Fails closed: a file the scanner cannot parse is a hit, not a pass.""" + try: + return scanner(src, rel) + except SyntaxError as exc: + return [f"{rel}: does not parse, so it cannot be scanned ({exc})"] + + +def scan_tracked(scanner, skip) -> list[str]: root = pathlib.Path(__file__).resolve().parent.parent files = subprocess.run(["git", "ls-files", "*.py"], cwd=root, capture_output=True, text=True, check=True).stdout.split() hits = [] for rel in files: - if rel.startswith("tests/") or rel == "micromate/protocol.py": + if rel.startswith("tests/") or skip(rel): continue - try: - src = (root / rel).read_text(errors="ignore") - hits += scan_source(src, rel) - except SyntaxError: - pass - assert hits == [] + hits += scan_file(scanner, (root / rel).read_text(errors="ignore"), rel) + return hits + + +def test_a_file_that_does_not_parse_fails_the_scan(): + assert scan_file(scan_source, "def broken(:\n", "x.py") + assert scan_file(scan_execute_callers, "def broken(:\n", "x.py") + + +def test_only_protocol_py_grants_write_permission(): + assert scan_tracked(scan_source, lambda rel: rel == "micromate/protocol.py") == [] + + +# -- nothing outside the safety layer calls protocol.execute( ------------------- + +def scan_execute_callers(src: str, name: str = "") -> list[str]: + """Hits: any `.protocol.execute(...)` call -- the Series-4 write entry.""" + hits = [] + for node in ast.walk(ast.parse(src)): + if not isinstance(node, ast.Call): + continue + fn = node.func + if (isinstance(fn, ast.Attribute) and fn.attr == "execute" + and isinstance(fn.value, ast.Attribute) and fn.value.attr == "protocol"): + hits.append(f"{name}:{node.lineno} .protocol.execute call") + return hits + + +def test_the_execute_scanner_catches_a_protocol_execute_and_not_sqlite(): + assert scan_execute_callers("client.protocol.execute(plan)") + assert scan_execute_callers("conn.execute('SELECT 1')") == [] + + +def test_only_the_safety_layer_calls_protocol_execute(): + assert scan_tracked(scan_execute_callers, + lambda rel: rel == "sfm/device_access/s4.py") == [] diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 6858caa..7d73182 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -398,3 +398,27 @@ def test_monitor_without_a_serial_runs_the_legacy_path_unchanged(monkeypatch, fn monkeypatch.setattr(srv, "_build_client", legacy_client) with pytest.raises(Legacy): getattr(srv, fn)(**{**CH, "serial": None}) + + +def test_a_change_unconfirmed_keeps_its_cause_status_and_names_the_audit_record(monkeypatch): + from sfm.device_access.errors import ChangeUnconfirmed + + class Raises: + def start_monitoring(self, *a, **kw): + raise ChangeUnconfirmed( + "start monitoring was sent and acknowledged, but reading the state back " + "failed: silent -- audit record c7", audit_id="c7", sent="acknowledged", + http_status=504) + monkeypatch.setattr(srv, "_device_access_instance", Raises()) + with pytest.raises(HTTPException) as e: + srv.device_monitor_start(**CH) + assert e.value.status_code == 504 + assert "audit record c7" in e.value.detail + + +def test_device_commands_normalises_the_serial(tmp_path, monkeypatch): + db = SeismoDb(tmp_path / "seismo.db") + db.begin_device_command(serial="UM20147", series=4, address="tcp:10.0.0.5:9034", + action="start monitoring", tier="change", request={}, caller="test") + monkeypatch.setattr(srv, "_get_db", lambda: db) + assert len(srv.db_device_commands(serial=" um20147 ", limit=100)["commands"]) == 1 -- 2.54.1 From cdc6360ec042baf150f309e095faa8fef9a727bc Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 19:36:00 -0400 Subject: [PATCH 081/223] fix(sfm): an audit finish that fails on a hang-up path still releases the line The final fix wave's AuditIncomplete landed in _exchange's `except DeviceError`, which keeps the line -- so on the nine ring / link-fault paths (and a refusal) a failed audit write turned a hang-up into a held Series-4 line, blocking a THOR call-home for up to the 5-minute idle hang-up and making "SFM hung up" false. AuditIncomplete now carries release_line, set by every finish whose path hangs up anyway, and _exchange honours it. Also pins the Series-3 change path's retry=False again (the rewritten lost-ack test no longer could). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/change.py | 17 ++++--- sfm/device_access/errors.py | 10 ++++- sfm/device_access/s4.py | 15 +++++-- tests/test_device_access_change.py | 72 +++++++++++++++++++++++++++++- 4 files changed, 102 insertions(+), 12 deletions(-) diff --git a/sfm/device_access/change.py b/sfm/device_access/change.py index 2af5fc0..f157c35 100644 --- a/sfm/device_access/change.py +++ b/sfm/device_access/change.py @@ -85,20 +85,23 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ def states(seen: List[str], after: Optional[str]) -> Dict[str, Any]: return {"before": before, "seen": list(seen), "after": after} - def finish(unit: str, **fields: Any) -> None: + def finish(unit: str, *, release_line: bool = False, **fields: Any) -> None: """The only way a row is finished. `unit` says what happened to the - unit, so a finish that fails still says it.""" + unit, so a finish that fails still says it. `release_line` says whether + this path hangs up anyway, so a failed finish does not hold the line.""" try: audit.finish(cid, **fields) except Exception as exc: # noqa: BLE001 raise AuditIncomplete( - f"{unit} -- but audit record {cid} could not be finished: {exc}") from exc + f"{unit} -- but audit record {cid} could not be finished: {exc}", + release_line=release_line) from exc def unconfirmed(unit: str, cause: BaseException, *, went_out: str, status: int, **fields: Any) -> NoReturn: """Finish the row, then say the change went out (or may have) and name it. `went_out` is "acknowledged" or "unknown"; the row's `sent` follows it.""" - finish(unit, sent=SENT_ACKNOWLEDGED if went_out == "acknowledged" else SENT_UNKNOWN, + finish(unit, release_line=True, + sent=SENT_ACKNOWLEDGED if went_out == "acknowledged" else SENT_UNKNOWN, **fields) raise ChangeUnconfirmed(f"{unit} -- audit record {cid}", audit_id=cid, sent=went_out, http_status=status) from cause @@ -119,12 +122,12 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ pre_send() # sends nothing: drains what is already waiting except Exception as exc: # noqa: BLE001 if is_ring(exc): - finish("nothing was sent (a call-home began before sending)", + finish("nothing was sent (a call-home began before sending)", release_line=True, outcome="failed", verified="not_checked", ack=None, error="a call-home began before sending -- nothing sent", sent=NOTHING_SENT, states=states([before], None)) raise CallHomeInProgress(CALL_HOME_MESSAGE) from exc - finish(f"nothing was sent (the line failed before sending: {exc})", + finish(f"nothing was sent (the line failed before sending: {exc})", release_line=True, outcome="failed", verified="not_checked", ack=None, error=f"the line failed before sending -- nothing sent: {exc}", sent=NOTHING_SENT, states=states([before], None)) @@ -134,7 +137,7 @@ def run_change(*, serial: str, series: int, start: bool, dry_run: bool, even_if_ ack = send() # the only send; nothing below can reach it again except Exception as exc: # noqa: BLE001 -- recorded, never retried if is_refusal(exc): # refused by the gate: nothing went out - finish(f"nothing was sent (refused before sending: {exc})", + finish(f"nothing was sent (refused before sending: {exc})", release_line=True, outcome="failed", verified="not_checked", ack=None, error=f"refused before sending: {exc}", sent=NOTHING_SENT, states=states([before], None)) diff --git a/sfm/device_access/errors.py b/sfm/device_access/errors.py index c954f5e..6f65e31 100644 --- a/sfm/device_access/errors.py +++ b/sfm/device_access/errors.py @@ -33,9 +33,17 @@ class AuditUnavailable(DeviceError): class AuditIncomplete(DeviceError): """The unit was dealt with, but its audit row could not be finished. The - message says what happened to the unit first, then names the row.""" + message says what happened to the unit first, then names the row. + + `release_line` is True when the path would have hung up had the finish + worked (a ring, a link fault, a refusal): the failed write to the audit log + must not turn that into a held line, which would block a call-home.""" http_status = 500 + def __init__(self, message: str, *, release_line: bool = False) -> None: + super().__init__(message) + self.release_line = release_line + class ChangeUnconfirmed(DeviceError): """A change failed after its frame went out, or may have gone out. diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index e0014fd..10961c6 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -23,8 +23,8 @@ from micromate.writes import plan_start_monitoring, plan_stop_monitoring from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import ( - CallHomeInProgress, ChangeUnconfirmed, DeviceError, EventNotFound, MalformedReply, StaleEvent, - WrongUnit, translate, + AuditIncomplete, CallHomeInProgress, ChangeUnconfirmed, DeviceError, EventNotFound, + MalformedReply, StaleEvent, WrongUnit, translate, ) from .change import CALL_HOME_MESSAGE, run_change from .events import iso_of, make_event_id, stamp_of @@ -133,7 +133,8 @@ class Series4Session: The exceptions: `CallHomeInProgress` and `WrongUnit` release the line, because the line itself is the problem; so does `ChangeUnconfirmed`, which the change core raises only after a link fault or a ring, once the frame - has gone out. `AuditIncomplete` is an ordinary verdict: the line is kept. + has gone out. `AuditIncomplete` keeps the line unless its `release_line` + says the path would have hung up anyway (a ring, a link fault, a refusal). """ def __init__(self, address: UnitAddress, serial: str, @@ -192,6 +193,14 @@ class Series4Session: log.warning("%s at %s -- released the line: %s", type(exc).__name__, self.address.key, exc) raise + except AuditIncomplete as exc: + # A finish that failed on a path that hangs up anyway (ring, link + # fault, refusal) must still hang up; on a healthy path, keep the line. + if exc.release_line: + self.hang_up() + log.warning("AuditIncomplete at %s -- released the line: %s", + self.address.key, exc) + raise except DeviceError: # The operation's own verdict (event not found, stale id): the line # is healthy, so keep it. Library errors still hang up below. diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 7dd9970..56b32d9 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -15,7 +15,7 @@ from device_access_fakes import FakeMicromateClient # no from sfm.device_access.access import DeviceAccess # noqa: E402 from sfm.device_access.errors import ( # noqa: E402 AuditIncomplete, AuditUnavailable, CallHomeInProgress, ChangeUnconfirmed, ConnectFailed, DeviceError, - NotSupported, UnitStateUnknown, WrongUnit, + NoAnswer, NotSupported, UnitStateUnknown, WrongUnit, ) from sfm.device_access.models import UnitAddress # noqa: E402 @@ -694,3 +694,73 @@ def test_series3_monitor_status_decode_keeps_the_raw_flag(): assert (st.state_flag, st.is_monitoring) == (flag, monitoring) assert _decode_monitor_status(bytes(12)).state_flag is None # no section[1] assert _decode_monitor_status(b"").state_flag is None + + +# ── an audit finish that fails must not turn a hang-up into a held line ─────── + +def _reads_then(fake, exc): + """read_run_state answers once (the state before the send), then raises.""" + orig, n = fake.read_run_state, [] + + def flaky(): + n.append(1) + if len(n) > 1: + raise exc + return orig() + fake.read_run_state = flaky + return fake + + +def _drain_raises(fake, exc): + def drain(): + raise exc + fake.read_unsolicited = drain + return fake + + +_LOST = mm_proto.TimeoutError("no ack") +_HANG_UP_PATHS = { + "ring in place of the ack": + lambda: FakeMicromateClient(run_states=[0x00], execute_error=RingDetected("RADIO RING")), + "lost ack, ring on the follow-up": + lambda: _reads_then(FakeMicromateClient(run_states=[0x00], execute_error=_LOST), + RingDetected("RADIO RING")), + "lost ack, follow-up reads calling_home": + lambda: FakeMicromateClient(run_states=[0x00, 0x03], execute_error=_LOST), + "lost ack, follow-up unreadable": + lambda: _reads_then(FakeMicromateClient(run_states=[0x00], execute_error=_LOST), + mm_proto.TimeoutError("silent")), + "read-back raises": + lambda: _reads_then(FakeMicromateClient(run_states=[0x00]), mm_proto.TimeoutError("silent")), + "read-back rings": + lambda: _reads_then(FakeMicromateClient(run_states=[0x00]), RingDetected("RADIO RING")), + "read-back reads calling_home": + lambda: FakeMicromateClient(run_states=[0x00, 0x03]), + "ring before the send": + lambda: _drain_raises(FakeMicromateClient(run_states=[0x00]), RingDetected("RADIO RING")), + "link fault before the send": + lambda: _drain_raises(FakeMicromateClient(run_states=[0x00]), OSError("connection reset")), + "refused by execute": + lambda: FakeMicromateClient(run_states=[0x00], execute_error=OpcodeRefused("nope")), +} + + +@pytest.mark.parametrize("path", sorted(_HANG_UP_PATHS)) +def test_a_finish_that_fails_on_a_hang_up_path_still_releases_the_line(path): + fake = _HANG_UP_PATHS[path]() + da = access(fake, audit=FinishFails()) + with pytest.raises(AuditIncomplete) as e: + da.start_monitoring(ADDR, "UM20147") + assert e.value.release_line is True + assert "could not be finished: disk full" in str(e.value) + assert len(fake.executed) <= 1 + assert released(fake, da) + + +def test_series3_a_cold_unit_during_a_change_is_not_retried(): + fake = FakeMiniMateClient(fail=[mmp_proto.TimeoutError("cold")]) + da = access3(fake) + with pytest.raises(NoAnswer): + da.start_monitoring(TCP3, "BE18193") + assert fake.writes == [] + assert len(da.factory_calls) == 1 # the change path never takes _run's retry -- 2.54.1 From b1c87ecccd64c0cd9fef077cb9d043b32439dbf1 Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 23 Oct 2026 19:36:36 -0400 Subject: [PATCH 082/223] docs(spec): what the phase 3 review left open, and why Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index d8e91ed..875d3c0 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -540,6 +540,55 @@ matters to is named. through `0x94`/`0x48` may detect unsaved keypad edits, which would undercut "can't be detected from the wire". One bench check. +## Left open by the phase 3 review (2026-10-23) + +The whole-phase review judged phase 3 ready for the bench, with nothing that +sends twice, sends without an audit row, or sends to an unverified unit. These +items were left for later on purpose: + +- **Series-3 change path shape. Settle before the MiniMate bench check.** + - The change path makes one POLL at a 120 s receive timeout, with no retry. A + cold MiniMate that drops that POLL costs 120 s of a locked unit and then a + 504. The legacy route retried `poll()` on the same connection at 10 s. + - The identity read is a full `connect()` (POLL, `0x15`, `0x01`, `0x1A`, `0x08`). + The spec asks for one serial read. + - Proposed: 10 s timeouts before the send, one identity-poll retry on the same + connection (a read, never the write), POLL plus `0x15` in place of + `connect()`, and the long timeout only on the read-back polls. + - That needs two measurements first: whether a *monitoring* MiniMate answers + the full `connect()` over TCP, and what `0x1C` reads during the ~40 s sensor + check. +- **For 1c (the webapp).** + - 409 means three things. "Wrong unit" and "unmeasured state" sent nothing; + "mismatch" sent a frame with a clean ack. Only the body tells them apart. + - `ChangeResult.detail` is a dict, so the webapp's `e.detail || r.statusText` + would print `[object Object]`. + - The 60 s verify window, plus the call-up, plus up to 20 s of lock wait, + exceeds the 60 s Terra-View proxy timeout. A mismatch could never be + delivered through that proxy. + - Nothing marks `pending` rows left by a restart mid-change. Reconcile them at + server start only, never on every `SeismoDb` open. +- **A late `0x69` after a lost ack.** When the ack is lost but the follow-up + read validates, the line is kept, and a late `0x69` then breaks the next + unrelated request with a 502. Safe, but confusing. Hanging up after any lost + ack needs a way to release the line on a path that returns a result. +- **Legacy routes take no per-address lock.** They can interleave with an + audited change on the same address. This belongs with the blind-stop-tools + decision, which is still open. +- **Test and scan gaps.** + - The `protocol.execute(` caller scan does not catch an aliased caller. + - Dropping the S4 ack's `data` field is not caught by any test. + - The fake's `fail` queue is also consumed by `read_unsolicited` on the change + path. +- **Docs nits.** + - `s4.py` says `ChangeUnconfirmed` follows "a link fault or a ring". It also + follows a `calling_home` read. + - The 2026-10-02 CLAUDE.md bullet still says "Read-only". + - The route docstrings' 409 line omits the held-line `WrongUnit`. +- **For the merge to dev.** The changelog states: a new `device_commands` table + (`CREATE TABLE IF NOT EXISTS`) plus a `_migrate` step that adds `sent` and + `states` to tables created from this branch. Prod: no migration, no backfill. + ## Table 2: to be added later (both series) | area | item | -- 2.54.1 From 4b911b1c0c7474f6ee7de0cdd5cf4b03a82a4d16 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 15:56:18 -0400 Subject: [PATCH 083/223] docs: the first commands this project originated -- start/stop on UM20147 Bench, 2026-10-25, Brian's go per send: 0x96 acked in 464 ms and read back monitoring at the first 2 s poll (during the sensor check); 0x97 acked in 116 ms, then 0x49 read a new value 0x01 for ~18 s (inferred: the unit's call-home attempts after a stop) before idle; two stops to an idle unit acked in 10 ms and changed nothing. Retracts "no command has ever been originated" in place in CLAUDE.md and the reference's untested list; answers the spec's stop-while-stopped question. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 21 +++- docs/micromate_protocol_reference.md | 114 +++++++++++++++++- .../2026-10-20-sfm-series4-parity-design.md | 7 ++ 3 files changed, 135 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index eefb656..bf64cd7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,7 +10,7 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as --- -## Where things stand (updated 2026-10-19) +## Where things stand (updated 2026-10-25) Read this first when picking the project back up. @@ -24,9 +24,15 @@ Read this first when picking the project back up. by 47x). Read path, event chain, setups, scheduler, monitoring control and per-event delete are all mapped — **and as of 2026-10-14 so is the inbound call-home session.** There are no protocol unknowns left. - ⚠ **No command has ever been originated against a unit by this project.** + ~~⚠ **No command has ever been originated against a unit by this project.** Every write was performed by THOR while we recorded. That line is worth - keeping. + keeping.~~ **Retracted 2026-10-25:** the first commands this project + originated were `0x96` / `0x97` (start / stop monitoring) to **UM20147 on + 2026-10-25**, sent by SFM at the bench with Brian's go for each send — 4 + sends, each acked and read back, each audited. Every *other* write + (call-home, setup push, delete, scheduler) is still THOR-only, never sent by + us. Details: `docs/micromate_protocol_reference.md` → *The first commands + this project originated*. **Series-4 write path, phase 2 is done (2026-10-22):** the write encoder, a send-side opcode gate and write *plans* for start/stop, call-home enable and the setup rewrite, reproduced byte for byte against THOR's captured frames. @@ -123,8 +129,13 @@ Read this first when picking the project back up. 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). -- **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built and - reviewed offline; the first live send is pending at the bench.** Both +- **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, + reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in + 0.46 s and read back as monitoring at the first 2 s poll (during the sensor + check); stop acked in 0.12 s, then `0x49` read a new value **`0x01` for ~18 s** + (inferred: the unit's call-home attempts after a stop — refused as unmeasured + until settled) before idle; a stop while idle is a harmless 10 ms no-op. The + Series-3 path is unproven on a unit (MiniMate bench check owed). Both series go through one safety core, `sfm/device_access/change.py`: a fresh identity read, the run state (calling home or never measured is refused), `dry_run` (the exact frames, nothing sent), a row in the new diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 27b438e..fb61439 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2217,6 +2217,13 @@ having: nothing else read so far reports the unit's own time. ↑ data[11]: 0x02 monitoring, 0x00 idle ``` +> **Amended 2026-10-25.** There are four values now. `0x03` is a call-home +> session; see *Correction: `SUB 0x49` has a third state value*. `0x01` reads +> for about 18 s after a stop; its meaning is inferred to be a call-home attempt +> that has not connected. See *The first commands this project originated*. +> `0x02` was also read 2.5 s after a start, while the screen showed the sensor +> check. + **A second monitoring indicator, in a 21-byte response instead of `0x1C`'s 60.** Different encoding from `0x1C`'s flag (`0x02` vs `0x0E`), so they are separate fields, not the same byte read twice. For a polling client this is the cheaper @@ -4165,8 +4172,108 @@ assumed: device will not stop it and the ack will not distinguish it. That guard has to live in SFM. +## ✅ The first commands this project originated: start and stop on UM20147 (2026-10-25) + +These were the first frames this project ever sent to a unit that change its +state. Every write before this one was THOR's, recorded while we watched. Brian +gave a go at the bench for each send. + +**Setup.** +- **Unit:** UM20147, firmware `11.0BD` (Thor line, reply flags `0x03`), on USB + CDC-ACM `/dev/ttyACM0`. +- **Sensors:** none attached. +- **Active setup:** `BENCH01`. +- **Sender:** SFM's `POST /device/monitor/start|stop?serial=UM20147` (branch + `feat/series4-sfm-parity` at `b1c87ec`), with every TX frame and every + validated RX frame logged at millisecond resolution. +- **Path:** each send went through the phase-3 safety core in this order: + 1. a fresh serial read; + 2. a `0x49` state read; + 3. the audit row written; + 4. one `execute()`; + 5. read back every 2 s. + +### What was sent and what came back (measured) + +| time (EDT) | sent | ack | ack latency | `0x49` content[0] afterwards | +|---|---|---|---|---| +| 15:43:47.430 | `0x96` `41021010009600ffff00000000000000000000a403` | `0x69`, 11 zero bytes | **464 ms** | `0x02` at the first read, 2.0 s after the ack | +| 15:45:51.922 | `0x97` `41021010009700ffff00000000000000000000a503` | `0x68`, 11 zero bytes | **116 ms** | **`0x01` on all 9 reads from +2.1 s to +18.2 s**, then `0x00` from +20.3 s | +| 15:52:42.645 | `0x97` (unit already idle; `even_if_already`) | `0x68`, 11 zero bytes | **10 ms** | `0x00`, unchanged | +| 15:53:51.871 | `0x97` (idle again, screen watched) | `0x68`, 11 zero bytes | **10 ms** | `0x00`, unchanged | + +- **The frames.** Both are THOR's own bytes, offset `0xFFFF` included. The phase-2 + bench question "is offset `0x0000` honoured" was not tested and does not need + to be. +- **`0x1C` `data[12]` agrees.** It read `0x00` idle before the start, `0x0E` at + the start's read-back and at the stop's preamble, and `0x00` again at +20 s. + `0x0E` is the same monitoring value UM12947 showed on 2026-09-24. `0x1C` was + not read during the `0x01` window. +- **The start's screen** showed a sensor check, then monitoring. With no sensors + attached, the check passed without complaint (Brian, watching). +- **The start's state.** `0x49` already read `0x02` at +2.5 s, so the state + byte very probably reads monitoring *during* the sensor check. That is + inferred, not measured: the check's length on screen was not timed. + Consequence: a second start sent during the check would see "monitoring" and + be skipped, not sent. +- **One histogram was recorded and closed.** The event is timestamped + 15:44:01, 14 s after the start, which is roughly the length of the sensor + check. The event count went 5 → 6 at the stop (`UM20147_20261025154401.IDFH`, + 7,976 B). + - Its peaks are 0.00186 in/s on all three channels, identical, because no + sensors were attached. + - Free memory fell 4,096 B at the start and another 4,096 B by the stop. The + same 4 KiB step was seen in the 2026-09-24 session. +- **The stop's screen.** The unit tried to call home right after the stop. Brian + says it always does this when taken out of monitor mode. It never connected, + because it has no modem, and it ran out of attempts. A watch of `0x49` + once a second from 15:47:19 to 15:49:50 read `0x00` throughout. +- **A stop sent to an idle unit is harmless.** It was acked in 10 ms, twice. + Nothing changed: not the state, the event count, free memory or the screen, + and there was no call-home attempt. The ~10x shorter ack suggests the + firmware skips its close-down work. This settles the spec's open question + "what does a stop-while-stopped do". + +### 🔶 `0x49` content[0] = `0x01`: a fourth state value (value measured, meaning inferred) + +The values are now `0x00` idle, `0x02` monitoring and `0x03` in a call-home +session (10 of 10 reads, 2026-10-14). The new one is **`0x01`, for about 18 s +right after a stop**. + +**Inferred meaning: a call-home *attempt* in progress, dialling and not +connected.** It is distinct from `0x03`, a call-home *session* that has +connected. The timing fits: the `0x01` window opened 2 s after the stop, on +screen the unit was trying to call home, and it closed when the attempts ran +out. + +**Not excluded:** `0x01` could instead mean "stopping, closing the record", with +the call-home attempts overlapping it. Two tests would separate them: +- a stop with call-home-after-event switched off; +- a stop on a unit whose modem connects, where the inference predicts + `0x01` → `0x03`. This fits into the ring-path Run A/B. + +**What SFM does with it.** `read_run_state()` names it `unknown(0x01)`, so the +change path refuses any start or stop in that window ("never been measured -- +nothing sent", HTTP 409). That is deliberate: name it only once its meaning is +measured. The stop's read-back simply kept polling through it, because `0x01` +is not idle, and the stop verified at +20 s, well inside the 60 s window. + +### Audit rows (SFM `device_commands`, scratch bench DB) + +All four rows read `outcome=sent`, `verified=ok`, `sent=1`, caller +`bench-brian`. Their `states` columns: +- **start:** `idle → [idle, monitoring] → monitoring` +- **stop:** `monitoring → [monitoring, 9 × unknown(0x01), idle] → idle` +- **the two forced stops:** `idle → [idle, idle] → idle`, each carrying the note + that the read-back cannot show the send changed anything. + ## ⚠ Untested and unsafe-until-agreed +> ✅ **Retracted in part (2026-10-25):** the opening line below was true until +> 2026-10-25. Start and stop (`0x96` / `0x97`) have now been **originated by +> SFM** against UM20147. See *The first commands this project originated*. Every +> other item in this section remains never-sent. + **Nothing below has been sent to a unit by us, and nothing should be without an explicit decision.** @@ -4183,12 +4290,15 @@ is known; our encoder is unwritten and unproven. `0x55`. **Destructive.** Series III's `0xA3`/`0xA2` erase-all has *not* been seen on Series IV and may not exist - **Start / stop monitoring** (`0x96` / `0x97`) — observed via Thor 2026-09-24, - acks `0x69` / `0x68` + acks `0x69` / `0x68`. ✅ **Originated by SFM 2026-10-25** on UM20147 (4 sends, + all acked and verified) — no longer untested - **Scheduler enable** (`0x47`) — observed; `params[7]` semantics still unclear Every one of these is now *observed*. **None has ever been originated by us**, and that is the line that still matters: the wire format is known, our encoder is -unwritten and unproven. +unwritten and unproven. *(2026-10-25: true still of every item here except +start/stop, which SFM originated at the bench — see the retraction note at the +top of this section.)* - `0x1F` (advance event pointer) — non-destructive on Series III but it does move device state, so it is parked with the rest diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 875d3c0..c1cbfbd 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -677,6 +677,13 @@ Open questions: on its own, in which case SFM never sees a ring and THOR gets the call while SFM is still connected. - The ack for start/stop when the unit is already in that state. + ✅ **Answered for stop (2026-10-25, UM20147):** a stop sent to an idle unit + is acked `0x68` in 10 ms (twice) and changes nothing: not the state, the + events, memory or the screen. Start while already monitoring has not been + tried. Also measured at that bench: `0x49` reads `0x01` for ~18 s after a + real stop. Its meaning is inferred to be the unit's call-home attempts, and + Run A/B can settle it: the inference predicts `0x01` → `0x03` when the modem + connects. - The offset rule, and whether `0x68`/`0x82` are required, for the setup push. - Whether the device ever refuses a write while monitoring. Only THOR's policy has been seen. -- 2.54.1 From 5527fcd91f179b7b2a594e24f098ec334dd0e91a Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 16:40:47 -0400 Subject: [PATCH 084/223] docs: correct today's overclaim -- the first *Micromate* commands, not the first ever 4b911b1 (and its subject line) called UM20147's start/stop "the first commands this project originated". The retracted CLAUDE.md line was always about Series 4: the minimateplus stack has sent Series-III writes (start/stop, config push, erase, call-home config) since April 2026. Narrowed in CLAUDE.md and the Micromate reference. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 15 +++++++++------ docs/micromate_protocol_reference.md | 14 ++++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bf64cd7..2785be6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,12 +27,15 @@ Read this first when picking the project back up. ~~⚠ **No command has ever been originated against a unit by this project.** Every write was performed by THOR while we recorded. That line is worth keeping.~~ **Retracted 2026-10-25:** the first commands this project - originated were `0x96` / `0x97` (start / stop monitoring) to **UM20147 on - 2026-10-25**, sent by SFM at the bench with Brian's go for each send — 4 - sends, each acked and read back, each audited. Every *other* write - (call-home, setup push, delete, scheduler) is still THOR-only, never sent by - us. Details: `docs/micromate_protocol_reference.md` → *The first commands - this project originated*. + originated against a **Micromate** were `0x96` / `0x97` (start / stop + monitoring) to **UM20147 on 2026-10-25**, sent by SFM at the bench with + Brian's go for each send — 4 sends, each acked and read back, each audited. + (This line was always about Series 4: the `minimateplus` stack has sent + Series-III writes — start/stop, config push, erase, call-home config — since + April 2026.) Every *other* Micromate write (call-home, setup push, delete, + scheduler) is still THOR-only, never sent by us. Details: + `docs/micromate_protocol_reference.md` → *The first commands this project + originated against a Micromate*. **Series-4 write path, phase 2 is done (2026-10-22):** the write encoder, a send-side opcode gate and write *plans* for start/stop, call-home enable and the setup rewrite, reproduced byte for byte against THOR's captured frames. diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index fb61439..8518ebc 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2220,7 +2220,7 @@ having: nothing else read so far reports the unit's own time. > **Amended 2026-10-25.** There are four values now. `0x03` is a call-home > session; see *Correction: `SUB 0x49` has a third state value*. `0x01` reads > for about 18 s after a stop; its meaning is inferred to be a call-home attempt -> that has not connected. See *The first commands this project originated*. +> that has not connected. See *The first commands this project originated against a Micromate*. > `0x02` was also read 2.5 s after a start, while the screen showed the sensor > check. @@ -4172,11 +4172,13 @@ assumed: device will not stop it and the ack will not distinguish it. That guard has to live in SFM. -## ✅ The first commands this project originated: start and stop on UM20147 (2026-10-25) +## ✅ The first commands this project originated against a Micromate: start and stop on UM20147 (2026-10-25) -These were the first frames this project ever sent to a unit that change its -state. Every write before this one was THOR's, recorded while we watched. Brian -gave a go at the bench for each send. +These were the first frames this project ever sent to a **Micromate** that +change its state. Every Micromate write before this one was THOR's, recorded +while we watched. (Series III is different: the `minimateplus` stack has sent +writes — start/stop, config push, erase, call-home config — since April 2026.) +Brian gave a go at the bench for each send. **Setup.** - **Unit:** UM20147, firmware `11.0BD` (Thor line, reply flags `0x03`), on USB @@ -4271,7 +4273,7 @@ All four rows read `outcome=sent`, `verified=ok`, `sent=1`, caller > ✅ **Retracted in part (2026-10-25):** the opening line below was true until > 2026-10-25. Start and stop (`0x96` / `0x97`) have now been **originated by -> SFM** against UM20147. See *The first commands this project originated*. Every +> SFM** against UM20147. See *The first commands this project originated against a Micromate*. Every > other item in this section remains never-sent. **Nothing below has been sent to a unit by us, and nothing should be without an -- 2.54.1 From a8cc5166017ee0330842d3457b2ac7e8e75c5996 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 17:14:11 -0400 Subject: [PATCH 085/223] fix(minimateplus): SUB 0x15's serial is a C string -- cut at the first NUL BE9441 (MiniMate bench, 2026-10-25) answers b"BE9441\x00?": six characters, the terminator, a leftover byte. rstrip(b"\x00") kept the "?", so the serial read "BE9441\x00?" and the serial-named path refused every request as the wrong unit (409). Seven-character serials fill the field to the terminator, which is why no earlier unit showed it. The legacy /device/info output is cleaned too. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 7 +++++-- tests/test_minimate_serial_decode.py | 30 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 tests/test_minimate_serial_decode.py diff --git a/minimateplus/client.py b/minimateplus/client.py index 599ae95..e5002bf 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -1305,12 +1305,15 @@ def _decode_serial_number(data: bytes) -> DeviceInfo: # Actual serial payload starts at data[11]. actual = data[11:] if len(data) > 11 else data + # The serial is a C string: cut at the first NUL. A short serial leaves a + # stray byte after its terminator (BE9441 sends b"BE9441\x00?"), so + # stripping trailing NULs alone is not enough. if len(actual) < 9: # Short payload — gracefully degrade - serial = actual.rstrip(b"\x00").decode("ascii", errors="replace") + serial = actual.split(b"\x00", 1)[0].decode("ascii", errors="replace") return DeviceInfo(serial=serial, firmware_minor=0) - serial = actual[:8].rstrip(b"\x00").decode("ascii", errors="replace") + serial = actual[:8].split(b"\x00", 1)[0].decode("ascii", errors="replace") trail_0 = actual[8] if len(actual) > 8 else None fw_minor = actual[9] if len(actual) > 9 else 0 diff --git a/tests/test_minimate_serial_decode.py b/tests/test_minimate_serial_decode.py new file mode 100644 index 0000000..ac7c01d --- /dev/null +++ b/tests/test_minimate_serial_decode.py @@ -0,0 +1,30 @@ +"""SUB 0x15's serial is a C string in an 8-byte field: cut at the first NUL. + +BE9441 (bench, 2026-10-25) answers `BE9441\\x00?` -- six characters, the +terminator, then a leftover byte. Stripping only trailing NULs kept the `?`, so +the serial read as "BE9441\\x00?" and every serial-named request was refused as +the wrong unit. Seven-character serials (BE11529, BE18189) fill the field up to +the terminator, which is why this never showed before. +""" +from __future__ import annotations + +from minimateplus.client import _decode_serial_number + +_HEADER = bytes(11) # data[0:11]: the section header + + +def _reply(field8: bytes, trail: int = 0x00, fw_minor: int = 0x11) -> bytes: + return _HEADER + field8 + bytes([trail, fw_minor]) + + +def test_a_six_character_serial_stops_at_its_terminator(): + assert _decode_serial_number(_reply(b"BE9441\x00?")).serial == "BE9441" + + +def test_a_seven_character_serial_is_unchanged(): + info = _decode_serial_number(_reply(b"BE18189\x00", trail=0x2A, fw_minor=0x11)) + assert (info.serial, info.firmware_minor) == ("BE18189", 0x11) + + +def test_a_short_payload_also_stops_at_the_terminator(): + assert _decode_serial_number(_HEADER + b"BE9441\x00?").serial == "BE9441" -- 2.54.1 From 352f6944e73633b52c9aa2f3018daa542c1840d8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:05:44 -0400 Subject: [PATCH 086/223] fix(minimateplus): a non-first event's 5A stream has no metadata pages -- stop cutting 2 bytes extract_body_bytes() and write_blastware_file() skipped 13 bytes on A5 frames 1 and 2 unconditionally, as if they were the global metadata pages (0x1002, 0x1004). Only the event-1 walk fetches those; a non-first event goes straight from the probe to sample chunks (skip 12), so every non-first event SFM built lost two bytes and decoded truncated (BE9441 event 1: 1,024 / 2,782 / 512 samples instead of 21,504, peaks far low). Frames now say which they are: each A5 reply echoes its address, and both 0x1002 at frame 1 and 0x1004 at frame 2 must match. Rebuilt from the bench's logged bytes, event 1 decodes 21,504 x 3 with peaks equal to the unit's own 0C values. Fixtures: BE9441's raw replies for events 0 and 1 (force-added). Operational: affects only Series-3 files SFM assembled itself (live downloads, bridges/ach_server.py) for non-first events -- not Blastware's own files, which is what the production store ingests. Such files are two bytes short; their .a5.pkl sidecars can rebuild them. No DB or schema change; codec unchanged (TOOL_VERSION not bumped). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/blastware_file.py | 27 ++++++-- .../BE9441_event0_01110000_rx.bin | Bin 0 -> 37552 bytes .../BE9441_event1_0111646a_rx.bin | Bin 0 -> 38249 bytes .../minimate-bench-10-25-26/README.md | 15 +++++ tests/test_minimate_body_no_metadata.py | 62 ++++++++++++++++++ 5 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 tests/fixtures/minimate-bench-10-25-26/BE9441_event0_01110000_rx.bin create mode 100644 tests/fixtures/minimate-bench-10-25-26/BE9441_event1_0111646a_rx.bin create mode 100644 tests/fixtures/minimate-bench-10-25-26/README.md create mode 100644 tests/test_minimate_body_no_metadata.py diff --git a/minimateplus/blastware_file.py b/minimateplus/blastware_file.py index 2784040..d10eab6 100644 --- a/minimateplus/blastware_file.py +++ b/minimateplus/blastware_file.py @@ -552,6 +552,21 @@ def classify_frame(frame: S3Frame) -> str: # ── Waveform file writer ─────────────────────────────────────────────────────────── +def _has_metadata_pages(a5_frames) -> bool: + """Whether A5 frames 1 and 2 are the global metadata pages. + + Only the event-1 walk (start_key[2:4] == 0) fetches them, at 0x1002 and + 0x1004; a non-first event's stream goes straight from the probe to sample + chunks. Each A5 reply echoes its address at data[2:6], so the frames say + which they are. Both must match: a sample chunk can sit at 0x1002, but then + the next one is at 0x1202, never 0x1004. (Assuming metadata pages in every + stream lost two bytes from every non-first event -- BE9441, 2026-10-25.) + """ + return (len(a5_frames) > 2 + and bytes(a5_frames[1].data[4:6]) == b"\x10\x02" + and bytes(a5_frames[2].data[4:6]) == b"\x10\x04") + + def extract_body_bytes(a5_frames): """Reconstruct the Blastware-file body bytes from a list of A5 frames. @@ -612,11 +627,12 @@ def extract_body_bytes(a5_frames): body_frames = a5_frames term_frame = None + meta = _has_metadata_pages(body_frames) all_bytes = bytearray() for fi, frame in enumerate(body_frames): if fi == 0: skip = probe_skip - elif fi in (1, 2): + elif fi in (1, 2) and meta: skip = 13 # metadata pages else: skip = 12 # sample chunks @@ -786,8 +802,8 @@ def write_blastware_file( # Frame contribution loop (v0.14.0 BW-exact walk). # Skip values: # probe (fi=0): probe_skip - # meta@0x1002 (fi=1): 13 (6-byte inner header) - # meta@0x1004 (fi=2): 13 (6-byte inner header) + # meta@0x1002 (fi=1): 13 (6-byte inner header) -- event-1 walk only + # meta@0x1004 (fi=2): 13 (6-byte inner header) -- event-1 walk only # sample chunks (fi=3+): 12 (5-byte inner header) last_fi = len(body_frames) - 1 @@ -796,13 +812,14 @@ def write_blastware_file( len(body_frames), last_fi, ) + meta = _has_metadata_pages(body_frames) all_bytes = bytearray() for fi, frame in enumerate(body_frames): if fi == 0: skip = probe_skip - elif fi in (1, 2): - skip = 13 # metadata pages + elif fi in (1, 2) and meta: + skip = 13 # metadata pages (event-1 walk only) else: skip = 12 # sample chunks diff --git a/tests/fixtures/minimate-bench-10-25-26/BE9441_event0_01110000_rx.bin b/tests/fixtures/minimate-bench-10-25-26/BE9441_event0_01110000_rx.bin new file mode 100644 index 0000000000000000000000000000000000000000..03e78a0eb2fe1b6d8f0a964d80a3db44bef902d2 GIT binary patch literal 37552 zcmeI5e~@KoS?AA9hD>MDnZ6T77;&U;LaPn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wC>VE$j}rFseH*5lq`nl1wSW+_}HsrGf>E(na0+ z2`zGS0;U;>++0&3usOl%d-SiHF7J49dH!YJxw3LWdG5ir0?=MXM}6dI=Jw~_TFUb% z>HK)V7hiqRMSFH%@a$49Sl<2Y3(J$YZ+qzSwGU0A^23SBm(W-Qylpm#;k@ z#g#|aj$C!P?U4Tpuapnos;0fS^JjQk**5s$vhC74E_?N* z@4xmzoHTg<{_>t(Q&*$F;e*Exk6yfb=;*P-N7k+%UA?+~^UHT1UtKR(9XopC>Y??E z%YoJ7>({IuSwBybUxwuJf}4)4uDRvdv4iJbxq9e^gKI|)9WU1$Up+Q@(ZQFks?$W% z=<>BgyGQ4Z_8&ZU?8xz>YvtXQz!03W<*)8jq~$8mB0TQL=QaUvR96lPv3sV^z@l$?qG<}F{|S&{qQHM z^mk@v$BrFmPM>+k^!DxBPd|NXYTIyl;FZ@N*mu!6XQSBW=E+CyKXKx|6ZhVC?|mP; z_rCk?J8|OShwp#nkw+foRy+UUz0#Y^1PX+nTr}(?1b;##vgz4hyHq_jXLG-!R$v8NuT<|Po6k& z|7RTDM-|>Lf93CC@tNV4eb$@7|Ao^v*l)yn{a<%@7meM<2z0JfINDcpYbl*<3ovAsZJE;*9Jo xexf{m$5f`#Y)dC77?xjnSN)%{9{}GRnO=XJ_CL^S)Hs;^{iRY?|Li%Z{cq48dQboW literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-25-26/README.md b/tests/fixtures/minimate-bench-10-25-26/README.md new file mode 100644 index 0000000..7983416 --- /dev/null +++ b/tests/fixtures/minimate-bench-10-25-26/README.md @@ -0,0 +1,15 @@ +# MiniMate bench, 2026-10-25 — BE9441 (S338.17, mic disabled), serial cable + +Raw unit-to-SFM bytes of two one-event downloads by serial (`POST /device/events/download`), +taken from the bench frame log in the order received: the whole session (POLL, serial, +config, the event walk, then the `0x5A` bulk stream). Parse with `S3FrameParser` and keep +the `0xA5` frames. + +| file | event | key | 0x5A pattern | unit's own 0C peaks (in/s) T / V / L | +|---|---|---|---|---| +| `BE9441_event0_01110000_rx.bin` | 0 (first) | `01110000` | probe, metadata pages `0x1002` `0x1004`, samples, TERM | 0.020 / 0.060 / 0.015 | +| `BE9441_event1_0111646a_rx.bin` | 1 | `0111646a` | probe, samples, TERM — no metadata pages | 0.030 / 0.095 / 0.020 | + +Both events: single shot, 4096 sps, 5 s record + 1 s pre-trigger = 21,504 samples per channel. +Event 1 is the case that showed the body builder skipping 13 bytes on its second and third +frames as if they were metadata pages (2 bytes lost, decode truncated at 1,024 / 2,782 / 512). diff --git a/tests/test_minimate_body_no_metadata.py b/tests/test_minimate_body_no_metadata.py new file mode 100644 index 0000000..befb939 --- /dev/null +++ b/tests/test_minimate_body_no_metadata.py @@ -0,0 +1,62 @@ +"""A non-first MiniMate event's 5A stream has no metadata pages. + +The event-1 walk fetches the two global metadata pages (0x1002, 0x1004) as A5 +frames 1 and 2, which carry a 6-byte inner header (skip 13). A non-first event's +walk fetches none, so its frames 1 and 2 are ordinary sample chunks (skip 12). +The body builder skipped 13 on frames 1 and 2 unconditionally: every non-first +event lost two bytes and decoded truncated. Found on BE9441 at the bench +(2026-10-25); fixtures are its raw replies (see the fixture README). +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from minimateplus.blastware_file import extract_body_bytes, write_blastware_file # noqa: E402 +from minimateplus.event_file_io import read_blastware_file # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 +from minimateplus.models import Event # noqa: E402 +from minimateplus.waveform_codec import decode_waveform_v2 # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" +SAMPLES = 21_504 # 5 s record + 1 s pre-trigger at 4096 sps +UNIT_PEAKS = { # the unit's own 0C peaks, in/s + "event0": {"Tran": 0.020, "Vert": 0.060, "Long": 0.015}, + "event1": {"Tran": 0.030, "Vert": 0.095, "Long": 0.020}, +} +FILES = {"event0": "BE9441_event0_01110000_rx.bin", "event1": "BE9441_event1_0111646a_rx.bin"} + + +def a5_frames(which): + return [f for f in S3FrameParser().feed((FIX / FILES[which]).read_bytes()) if f.sub == 0xA5] + + +@pytest.mark.parametrize("which", ["event0", "event1"]) +def test_the_body_decodes_whole_and_matches_the_units_own_peaks(which): + _strt, body, _footer = extract_body_bytes(a5_frames(which)) + dec = decode_waveform_v2(body) + for ch, peak in UNIT_PEAKS[which].items(): + assert len(dec[ch]) == SAMPLES, ch + assert max(abs(x) for x in dec[ch]) * 0.005 == pytest.approx(peak, abs=1e-9), ch + + +def test_metadata_pages_are_recognised_by_their_echoed_addresses(): + first, other = a5_frames("event0"), a5_frames("event1") + assert (bytes(first[1].data[4:6]), bytes(first[2].data[4:6])) == (b"\x10\x02", b"\x10\x04") + assert bytes(other[1].data[4:6]) not in (b"\x10\x02", b"\x10\x04") + + +@pytest.mark.parametrize("which", ["event0", "event1"]) +def test_the_written_file_reads_back_whole(which, tmp_path): + ev = Event(index=0) + ev.timestamp = None # the builder takes the footer from the TERM frame + path = tmp_path / f"{which}.P00" + write_blastware_file(ev, a5_frames(which), path) + pv = read_blastware_file(path).peak_values + got = {"Tran": pv.tran, "Vert": pv.vert, "Long": pv.long} + assert got == pytest.approx(UNIT_PEAKS[which], abs=1e-6) -- 2.54.1 From 75d79ece6c312d53373bf10ab91919d4134bf4a2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:11:13 -0400 Subject: [PATCH 087/223] fix(minimateplus): a one-event download is whole or it is an error BE9441 rebooted mid-download at the bench (2026-10-25): the chunk at 0x7D06 got one stray byte and then silence, the 5A loop logged "unexpected end-of- stream -- proceeding to TERM", the TERM got no reply either, and the short event (17,920 / 17,920 / 17,408 of 21,504 samples) was stored as a success. read_bulk_waveform_stream(strict=True) now raises on every early end: no STRT, a metadata page or chunk with no reply, a mid-stream terminator, the chunk cap, or no TERM reply. get_events passes it for the strict walks (headers_only, only_key) and, in strict mode, re-raises a 5A error instead of logging "metadata unavailable" and returning the event without frames. The legacy full walk is unchanged, call for call (strict passed only when on). Tests replay BE9441's recorded session through the real MiniMateClient: whole, event 1 comes back in full; with the 5A stream quiet from chunk 40 while the walk is still answered -- the bench's reboot -- it raises "ended early". No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 8 +- minimateplus/protocol.py | 39 ++++++++- tests/test_minimate_5a_strict.py | 97 ++++++++++++++++++++++ tests/test_minimate_download_replay.py | 108 +++++++++++++++++++++++++ 4 files changed, 247 insertions(+), 5 deletions(-) create mode 100644 tests/test_minimate_5a_strict.py create mode 100644 tests/test_minimate_download_replay.py diff --git a/minimateplus/client.py b/minimateplus/client.py index e5002bf..5f74588 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -497,6 +497,8 @@ class MiniMateClient: """ proto = self._require_proto() strict = headers_only or only_key is not None + # Passed only when on, so the legacy walk's 5A call is unchanged. + strict_5a = {"strict": True} if strict else {} log.info("get_events: requesting first event (SUB 1E)") try: @@ -653,7 +655,7 @@ class MiniMateClient: ) a5_frames = proto.read_bulk_waveform_stream( cur_key, stop_after_metadata=False, max_chunks=128, - include_terminator=True, + include_terminator=True, **strict_5a, ) if a5_frames: a5_ok = True @@ -672,7 +674,7 @@ class MiniMateClient: cur_key, stop_after_metadata=True, include_terminator=True, extra_chunks_after_metadata=extra_chunks_after_metadata, - max_chunks=128, + max_chunks=128, **strict_5a, ) if a5_frames: a5_ok = True @@ -684,6 +686,8 @@ class MiniMateClient: ev.project_info.operator if ev.project_info else None, ) except ProtocolError as exc: + if strict: + raise # a one-event download is whole or it is an error log.warning( "get_events: 5A failed for key=%s: %s — metadata unavailable", cur_key.hex(), exc, diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 1c0bdea..509f235 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -538,11 +538,19 @@ class MiniMateProtocol: max_chunks: int = 256, # safety cap only; loop is bounded by end_offset include_terminator: bool = False, extra_chunks_after_metadata: int = 1, # DEPRECATED — no-op + strict: bool = False, ) -> list[S3Frame]: """ Download the SUB 5A (BULK_WAVEFORM_STREAM) A5 frames for one event using Blastware's exact protocol. REWRITTEN 2026-05-02 (v0.14.0). + strict: the stream must arrive whole, or this raises ProtocolError -- a + missing STRT, a metadata page or chunk with no reply, a mid-stream + terminator, the chunk cap, or no TERM reply. The one-event download uses + it: a short event must never be stored (BE9441 rebooted mid-download on + 2026-10-25 and its partial event was kept). Without strict the legacy + tolerance stands: an early end proceeds to TERM and returns what arrived. + Algorithm (matches BW captures across 2-sec / 3-sec / event-2): 1. Probe @@ -645,6 +653,10 @@ class MiniMateProtocol: # ── Step 2: parse STRT end_offset from probe response ──────────────── end_offset = parse_strt_end_offset(rsp.data) + if end_offset is None and strict: + raise ProtocolError( + f"5A probe for {key4.hex()} carried no STRT record, so the event's end " + "is unknown -- not downloaded") if end_offset is None: log.warning( "5A probe response did not contain a STRT record; " @@ -683,7 +695,11 @@ class MiniMateProtocol: meta_rsp = self._recv_one( expected_sub=rsp_sub, reset_parser=False, timeout=10.0, ) - except TimeoutError: + except TimeoutError as exc: + if strict: + raise TimeoutError( + f"5A stream ended early: metadata page 0x{meta_counter:04X} got " + "no reply -- the event was not kept") from exc log.warning( "5A metadata page 0x%04X TIMED OUT — continuing", meta_counter, @@ -728,12 +744,17 @@ class MiniMateProtocol: rsp = self._recv_one( expected_sub=rsp_sub, reset_parser=False, timeout=10.0, ) - except TimeoutError: + except TimeoutError as exc: raw = self._parser.bytes_fed log.warning( "5A TIMEOUT chunk=%d counter=0x%04X raw_bytes=%d", chunks_fetched + 1, counter, raw, ) + if strict: + raise TimeoutError( + f"5A stream ended early: no reply for the chunk at 0x{counter:04X}; the " + f"event ends at 0x{end_offset:04X} ({chunks_fetched} chunk(s) received) " + "-- the event was not kept") from exc if raw > 0 and frames_data: log.warning( "5A unexpected end-of-stream — proceeding to TERM", @@ -748,6 +769,10 @@ class MiniMateProtocol: if rsp.page_key == 0x0000: # Device terminated mid-stream unexpectedly. + if strict: + raise ProtocolError( + f"5A stream ended early: the unit sent its terminator at 0x{counter:04X}, " + f"before the event's end 0x{end_offset:04X} -- the event was not kept") log.warning( "5A unexpected page_key=0x0000 mid-stream at counter=0x%04X", counter, @@ -761,6 +786,10 @@ class MiniMateProtocol: counter += _BULK_COUNTER_STEP chunks_fetched += 1 else: + if strict: + raise ProtocolError( + f"5A reached the {max_chunks}-chunk cap at 0x{counter:04X} before the " + f"event's end 0x{end_offset:04X} -- the event was not kept") log.warning( "5A reached max_chunks=%d at counter=0x%04X (end=0x%04X)", max_chunks, counter, end_offset, @@ -796,7 +825,11 @@ class MiniMateProtocol: ) if include_terminator: frames_data.append(term_rsp) - except TimeoutError: + except TimeoutError as exc: + if strict: + raise TimeoutError( + "5A stream ended early: no reply to the TERM request, which carries the " + "event's tail and footer -- the event was not kept") from exc log.warning("5A no TERM response (timeout)") return frames_data diff --git a/tests/test_minimate_5a_strict.py b/tests/test_minimate_5a_strict.py new file mode 100644 index 0000000..7d085d1 --- /dev/null +++ b/tests/test_minimate_5a_strict.py @@ -0,0 +1,97 @@ +"""A one-event download must not keep an event whose 5A stream ended early. + +BE9441 rebooted mid-download at the bench (2026-10-25): the chunk at 0x7D06 got +no reply, the loop logged "unexpected end-of-stream -- proceeding to TERM", the +TERM got no reply either, and the short event was stored as a success. In +strict mode (the one-event download) every early end now raises; the legacy +full walk keeps its tolerance. Driven by BE9441's recorded replies for event 1. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.protocol as mp # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" +KEY = bytes.fromhex("0111646a") + + +def a5_replies() -> list: + """The raw bytes of each A5 reply, in order (the parser fed one byte at a time).""" + raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + if f.sub == 0xA5: + out.append(raw[start:i + 1]) + start = i + 1 + return out + + +class Replay: + """One recorded reply per 5A request; from request number `silent_from` on, one + stray 0x41 and then silence -- what BE9441 sent as it rebooted.""" + + def __init__(self, replies, silent_from=None): + self.replies, self.silent_from, self.sent, self._buf = list(replies), silent_from, 0, b"" + + def write(self, data): + n, self.sent = self.sent, self.sent + 1 + if self.silent_from is None or n < self.silent_from: + self._buf += self.replies[n] + elif n == self.silent_from: + self._buf += b"\x41" + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +@pytest.fixture(autouse=True) +def fast_clock(monkeypatch): + t = [0.0] + + def tick(): + t[0] += 0.5 + return t[0] + monkeypatch.setattr(mp.time, "monotonic", tick) + monkeypatch.setattr(mp.time, "sleep", lambda s: None) + + +def proto(silent_from=None): + replies = a5_replies() + p = mp.MiniMateProtocol(Replay(replies, silent_from)) + return p, len(replies) + + +def test_the_recorded_stream_replays_whole(): + p, n = proto() + frames = p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, + strict=True) + assert len(frames) == n == 51 + + +def test_strict_raises_when_a_chunk_gets_no_reply(): + p, _ = proto(silent_from=40) + with pytest.raises(mp.ProtocolError, match="ended early"): + p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, + strict=True) + + +def test_strict_raises_when_the_term_gets_no_reply(): + p, n = proto(silent_from=50) # every chunk answered, the TERM not + with pytest.raises(mp.ProtocolError, match="TERM"): + p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, + strict=True) + + +def test_the_legacy_walk_keeps_its_tolerance(): + p, _ = proto(silent_from=40) + frames = p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True) + assert 0 < len(frames) < 51 # short, returned, not raised -- as before diff --git a/tests/test_minimate_download_replay.py b/tests/test_minimate_download_replay.py new file mode 100644 index 0000000..702d619 --- /dev/null +++ b/tests/test_minimate_download_replay.py @@ -0,0 +1,108 @@ +"""BE9441's recorded one-event download, replayed through the real MiniMateClient. + +The bench session (2026-10-25) is replayed reply for reply: SESSION_RESET gets +none, every other request the next recorded frame. Whole, it must give event 1 +in full (the metadata-page fix); silenced partway through the 5A stream, as the +unit was when it rebooted, it must raise (the strict-stream fix), never return +a short event. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.client as mc # noqa: E402 +import minimateplus.protocol as mp # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" +KEY = bytes.fromhex("0111646a") +STAMP = "2026-10-25T14:10:49" +SESSION_RESET = b"\x41\x03" + + +def recorded_replies(): + """[(sub, raw_bytes)] for every frame of the session, in order.""" + raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + out.append((f.sub, raw[start:i + 1])) + start = i + 1 + return out + + +class SessionReplay: + """Answers each request with the next recorded reply of its own SUB (reply = + 0xFF - request). `quiet_5a_from`: from that 5A request on, the 5A stream gets + one stray 0x41 and then nothing, while every other request is still answered + -- BE9441 dropped out of the stream as it rebooted, then answered the walk.""" + + def __init__(self, replies, quiet_5a_from=None): + self.queues = {} + for sub, raw in replies: + self.queues.setdefault(sub, []).append(raw) + self.quiet_5a_from, self.n5a, self._buf, self.open_ = quiet_5a_from, 0, b"", False + + def connect(self): + self.open_ = True + + def disconnect(self): + self.open_ = False + + def is_connected(self): + return self.open_ + + def write(self, data): + data = bytes(data) + if data == SESSION_RESET: + return + req = data[5] # 41 02 10 10 00 + if req == 0x5A: + n, self.n5a = self.n5a, self.n5a + 1 + if self.quiet_5a_from is not None and n >= self.quiet_5a_from: + if n == self.quiet_5a_from: + self._buf += b"\x41" + return + self._buf += self.queues[0xFF - req].pop(0) + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + def read_until_idle(self, *a, **kw): + out, self._buf = self._buf, b"" + return out + + +@pytest.fixture(autouse=True) +def fast_clock(monkeypatch): + t = [0.0] + + def tick(): + t[0] += 0.5 + return t[0] + monkeypatch.setattr(mp.time, "monotonic", tick) + monkeypatch.setattr(mp.time, "sleep", lambda s: None) + + +def download(quiet_5a_from=None): + client = mc.MiniMateClient(transport=SessionReplay(recorded_replies(), quiet_5a_from)) + client.open() + client.connect() + return client.download_event_by_key(KEY, expected_timestamp=STAMP) + + +def test_the_whole_session_gives_event_1_in_full(): + ev = download() + assert {ch: len(ev.raw_samples[ch]) for ch in ("Tran", "Vert", "Long")} == \ + {"Tran": 21_504, "Vert": 21_504, "Long": 21_504} + + +def test_a_unit_that_goes_quiet_mid_stream_raises_instead_of_returning_a_short_event(): + with pytest.raises(mp.ProtocolError, match="ended early"): + download(quiet_5a_from=40) -- 2.54.1 From 36f4e5d985a7de925ec132c5b1e4ee11ed8f506b Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:14:44 -0400 Subject: [PATCH 088/223] feat(sfm): a MiniMate download is checked against the unit's own peaks before it is stored Series 4 downloads were checked (decoded PVS against the unit's); Series 3's were stored unchecked (verified=None), so BE9441's two bad files went in as successes at the bench (2026-10-25). verify_s3_download(): if the waveform decodes, all three geophone channels must be the same length and each peak must be the unit's own 0C peak to one 0.005 in/s step, or the download is refused (MalformedReply, "not saved"). Unverified (stored, as before): no waveform decode -- a histogram; 0 of ~430 fixture histograms decode as one -- or a sensitive-range unit, whose scale is still open. The reason goes in detail["check"]. A test puts the metadata-page bug back and the check refuses the file it produced. Session-replay helpers move to tests/minimate_replay.py. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 45 +++++++++++- tests/minimate_replay.py | 82 ++++++++++++++++++++++ tests/test_device_access_s3_verify.py | 95 ++++++++++++++++++++++++++ tests/test_minimate_download_replay.py | 76 ++------------------- 4 files changed, 226 insertions(+), 72 deletions(-) create mode 100644 tests/minimate_replay.py create mode 100644 tests/test_device_access_s3_verify.py diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index a7efaa6..cc8b6d5 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -9,6 +9,7 @@ from typing import Any, Callable, Optional from minimateplus import MiniMateClient from minimateplus.blastware_file import blastware_filename +from minimateplus.event_file_io import _GEO_INT16_FS from minimateplus.framing import build_bw_write_frame from minimateplus.protocol import SUB_START_MONITORING, SUB_STOP_MONITORING from minimateplus.transport import TcpTransport @@ -97,6 +98,45 @@ def _s3_ref(ev: Any, serial: str) -> EventRef: ) +_GEO_FULL_SCALE_IPS = 10.0 # normal range; one decoder step = 0.005 in/s +_PEAK_TOLERANCE_IPS = 0.0051 # one 0.005 in/s step, plus the 0C's float32 slop + + +def verify_s3_download(ev: Any, compliance: Any) -> tuple: + """Check a downloaded waveform against the unit's own 0C peaks: (verified, why). + + True: all three geophone channels decode to the same length and each + channel's peak is the unit's own to one 0.005 in/s step. None: nothing to + check against -- no waveform decode (a histogram: none of ~430 fixture + histograms decodes as a waveform) or a sensitive-range unit, whose scale is + still open (the 8x discrepancy). Raises MalformedReply ("not saved") + otherwise: a short or misassembled event must not reach the store. BE9441's + bench (2026-10-25) stored two such events as successes before this existed. + """ + samples = getattr(ev, "raw_samples", None) or {} + chans = ("Tran", "Vert", "Long") + if not all(samples.get(c) for c in chans): + return None, "no waveform decode to check (a histogram, or no codec for it)" + if getattr(compliance, "geo_range", 0) not in (0, None): + return None, "sensitive range: the sample scale is not settled, so not checked" + lengths = {c: len(samples[c]) for c in chans} + if len(set(lengths.values())) != 1: + raise MalformedReply( + f"the downloaded waveform's channels have different lengths {lengths} -- the " + "download is incomplete or misassembled; not saved") + pv = ev.peak_values + unit = {"Tran": pv.tran, "Vert": pv.vert, "Long": pv.long} if pv else {} + for c in chans: + if unit.get(c) is None: + return None, f"the unit's record gives no {c} peak to check against" + decoded = max(abs(x) for x in samples[c]) * _GEO_FULL_SCALE_IPS / _GEO_INT16_FS + if abs(decoded - unit[c]) > _PEAK_TOLERANCE_IPS: + raise MalformedReply( + f"the downloaded {c} peak is {decoded:.4f} in/s but the unit's own record says " + f"{unit[c]:.4f} -- the download is incomplete or misassembled; not saved") + return True, f"{lengths['Tran']} samples per channel, peaks match the unit's own" + + class Series3Adapter: def __init__(self, client_factory: Callable[..., Any] = default_s3_client_factory) -> None: self._factory = client_factory @@ -272,10 +312,11 @@ class Series3Adapter: filename = _s3_filename(ev, serial) if filename is None: raise MalformedReply(f"event {key.hex()} has no usable timestamp, so it cannot be named or stored") + verified, why = verify_s3_download(ev, info.compliance_config) return DownloadedEvent( event_id=make_event_id(serial, key, found), serial=serial, series=3, - filename=filename, verified=None, event=ev, a5_frames=ev._a5_frames, + filename=filename, verified=verified, event=ev, a5_frames=ev._a5_frames, compliance=info.compliance_config, timestamp=_s3_dt(ev), - detail={"a5_frames": len(ev._a5_frames)}, + detail={"a5_frames": len(ev._a5_frames), "check": why}, ) return self._run(address, op, timeout=S3_EVENT_TIMEOUT) diff --git a/tests/minimate_replay.py b/tests/minimate_replay.py new file mode 100644 index 0000000..8e75391 --- /dev/null +++ b/tests/minimate_replay.py @@ -0,0 +1,82 @@ +"""BE9441's recorded bench session (2026-10-25), replayed reply for reply. + +Shared by the MiniMate download tests. See +tests/fixtures/minimate-bench-10-25-26/README.md for the provenance. +""" +from __future__ import annotations + +from pathlib import Path + +import minimateplus.protocol as mp +from minimateplus.framing import S3FrameParser + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" +KEY = bytes.fromhex("0111646a") +STAMP = "2026-10-25T14:10:49" +UNIT_PEAKS = {"Tran": 0.030, "Vert": 0.095, "Long": 0.020} # the unit's own 0C peaks, in/s +SESSION_RESET = b"\x41\x03" + + +def recorded_replies(): + """[(sub, raw_bytes)] for every frame of the session, in order.""" + raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + out.append((f.sub, raw[start:i + 1])) + start = i + 1 + return out + + +class SessionReplay: + """Answers each request with the next recorded reply of its own SUB (reply = + 0xFF - request). `quiet_5a_from`: from that 5A request on, the 5A stream gets + one stray 0x41 and then nothing, while every other request is still answered + -- BE9441 dropped out of the stream as it rebooted, then answered the walk.""" + + def __init__(self, replies, quiet_5a_from=None): + self.queues = {} + for sub, raw in replies: + self.queues.setdefault(sub, []).append(raw) + self.quiet_5a_from, self.n5a, self._buf, self.open_ = quiet_5a_from, 0, b"", False + + def connect(self): + self.open_ = True + + def disconnect(self): + self.open_ = False + + def is_connected(self): + return self.open_ + + def write(self, data): + data = bytes(data) + if data == SESSION_RESET: + return + req = data[5] # 41 02 10 10 00 + if req == 0x5A: + n, self.n5a = self.n5a, self.n5a + 1 + if self.quiet_5a_from is not None and n >= self.quiet_5a_from: + if n == self.quiet_5a_from: + self._buf += b"\x41" + return + self._buf += self.queues[0xFF - req].pop(0) + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + def read_until_idle(self, *a, **kw): + out, self._buf = self._buf, b"" + return out + + + +def fast_clock(monkeypatch): + """Make the protocol's 10 s receive deadlines pass in a few loop turns.""" + t = [0.0] + + def tick(): + t[0] += 0.5 + return t[0] + monkeypatch.setattr(mp.time, "monotonic", tick) + monkeypatch.setattr(mp.time, "sleep", lambda s: None) diff --git a/tests/test_device_access_s3_verify.py b/tests/test_device_access_s3_verify.py new file mode 100644 index 0000000..a4f5ee4 --- /dev/null +++ b/tests/test_device_access_s3_verify.py @@ -0,0 +1,95 @@ +"""A MiniMate download is checked against the unit's own peaks before it is stored. + +Series 4 downloads were already checked (decoded PVS against the unit's). +Series 3's were not, so two bad files went into the store as successes at the +bench (2026-10-25). Now: if the waveform decodes, all three geophone channels +must be the same length and each channel's peak must match the unit's own 0C +peak to one 0.005 in/s step, or the download is refused and nothing is stored. +No waveform decode (a histogram -- 0 of ~430 fixture histograms decode as one) +or a sensitive-range unit (its scale is still open) is stored unverified. +""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +import minimateplus.blastware_file as bw # noqa: E402 +import minimateplus.client as mc # noqa: E402 +from minimate_replay import KEY, SessionReplay, fast_clock, recorded_replies # noqa: E402 +from minimateplus.models import ComplianceConfig, Event, PeakValues # noqa: E402 +from sfm.device_access.errors import MalformedReply # noqa: E402 +from sfm.device_access.models import UnitAddress # noqa: E402 +from sfm.device_access.s3 import Series3Adapter, verify_s3_download # noqa: E402 + +CABLE = UnitAddress(host=None, tcp_port=None, port="/dev/ttyUSB0", baud=38400) +COUNTS_PER_IPS = 3200 # 32000 counts = 10.000 in/s (normal range) + + +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +def event(samples, peaks): + ev = Event(index=0) + ev.raw_samples = samples + ev.peak_values = PeakValues(tran=peaks[0], vert=peaks[1], long=peaks[2]) + return ev + + +def flat(n, peak_ips): + return [0] * (n - 1) + [round(peak_ips * COUNTS_PER_IPS)] + + +NORMAL = ComplianceConfig(geo_range=0) + + +def test_matching_peaks_and_lengths_verify(): + ev = event({c: flat(100, p) for c, p in zip(("Tran", "Vert", "Long"), (0.03, 0.095, 0.02))}, + (0.02999996, 0.09499989, 0.01999998)) + assert verify_s3_download(ev, NORMAL)[0] is True + + +def test_a_peak_that_disagrees_is_refused(): + ev = event({c: flat(100, p) for c, p in zip(("Tran", "Vert", "Long"), (0.01, 0.01, 0.005))}, + (0.03, 0.095, 0.02)) + with pytest.raises(MalformedReply, match="Tran peak is 0.0100.*not saved"): + verify_s3_download(ev, NORMAL) + + +def test_unequal_channel_lengths_are_refused(): + ev = event({"Tran": flat(100, 0.03), "Vert": flat(100, 0.095), "Long": flat(90, 0.02)}, + (0.03, 0.095, 0.02)) + with pytest.raises(MalformedReply, match="lengths.*not saved"): + verify_s3_download(ev, NORMAL) + + +def test_no_waveform_decode_is_stored_unverified(): + assert verify_s3_download(event(None, (0.03, 0.095, 0.02)), NORMAL)[0] is None + + +def test_a_sensitive_range_unit_is_stored_unverified(): + ev = event({c: flat(100, 0.5) for c in ("Tran", "Vert", "Long")}, (0.03, 0.095, 0.02)) + assert verify_s3_download(ev, ComplianceConfig(geo_range=1))[0] is None + + +def adapter(): + def factory(address, **kw): + return mc.MiniMateClient(transport=SessionReplay(recorded_replies())) + return Series3Adapter(client_factory=factory) + + +def test_be9441_event_1_downloads_verified(): + dl = adapter().download_event(CABLE, "BE9441", KEY, "20261025141049") + assert dl.verified is True + + +def test_the_check_refuses_the_file_the_metadata_page_bug_produced(monkeypatch): + monkeypatch.setattr(bw, "_has_metadata_pages", lambda frames: True) # the bug, back + with pytest.raises(MalformedReply, match="not saved"): + adapter().download_event(CABLE, "BE9441", KEY, "20261025141049") diff --git a/tests/test_minimate_download_replay.py b/tests/test_minimate_download_replay.py index 702d619..ef2d7af 100644 --- a/tests/test_minimate_download_replay.py +++ b/tests/test_minimate_download_replay.py @@ -10,84 +10,20 @@ from __future__ import annotations import os import sys -from pathlib import Path import pytest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -import minimateplus.client as mc # noqa: E402 -import minimateplus.protocol as mp # noqa: E402 -from minimateplus.framing import S3FrameParser # noqa: E402 - -FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" -KEY = bytes.fromhex("0111646a") -STAMP = "2026-10-25T14:10:49" -SESSION_RESET = b"\x41\x03" - - -def recorded_replies(): - """[(sub, raw_bytes)] for every frame of the session, in order.""" - raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() - for i in range(len(raw)): - for f in p.feed(raw[i:i + 1]): - out.append((f.sub, raw[start:i + 1])) - start = i + 1 - return out - - -class SessionReplay: - """Answers each request with the next recorded reply of its own SUB (reply = - 0xFF - request). `quiet_5a_from`: from that 5A request on, the 5A stream gets - one stray 0x41 and then nothing, while every other request is still answered - -- BE9441 dropped out of the stream as it rebooted, then answered the walk.""" - - def __init__(self, replies, quiet_5a_from=None): - self.queues = {} - for sub, raw in replies: - self.queues.setdefault(sub, []).append(raw) - self.quiet_5a_from, self.n5a, self._buf, self.open_ = quiet_5a_from, 0, b"", False - - def connect(self): - self.open_ = True - - def disconnect(self): - self.open_ = False - - def is_connected(self): - return self.open_ - - def write(self, data): - data = bytes(data) - if data == SESSION_RESET: - return - req = data[5] # 41 02 10 10 00 - if req == 0x5A: - n, self.n5a = self.n5a, self.n5a + 1 - if self.quiet_5a_from is not None and n >= self.quiet_5a_from: - if n == self.quiet_5a_from: - self._buf += b"\x41" - return - self._buf += self.queues[0xFF - req].pop(0) - - def read(self, n): - out, self._buf = self._buf[:n], self._buf[n:] - return out - - def read_until_idle(self, *a, **kw): - out, self._buf = self._buf, b"" - return out +import minimateplus.client as mc # noqa: E402 +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import KEY, STAMP, SessionReplay, fast_clock, recorded_replies # noqa: E402 @pytest.fixture(autouse=True) -def fast_clock(monkeypatch): - t = [0.0] - - def tick(): - t[0] += 0.5 - return t[0] - monkeypatch.setattr(mp.time, "monotonic", tick) - monkeypatch.setattr(mp.time, "sleep", lambda s: None) +def _fast(monkeypatch): + fast_clock(monkeypatch) def download(quiet_5a_from=None): -- 2.54.1 From d73a27d2e37dc390e60c5851e0d7250528e65863 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:17:09 -0400 Subject: [PATCH 089/223] fix(minimateplus): a MiniMate that boots on connect is waited for, not given up on BE9441 on a serial cable (bench, 2026-10-25) twice sent "Operating System" ~3 s after the port opened and ignored the POLL sent before it; the request then failed at the full receive timeout (502 after 15 s on /device/info, 504 after 120 s on a download). After a mid-download reboot it answered 8.8 s after its banner -- the one measured readiness point. startup()'s first POLL now stops waiting the moment the banner arrives (that POLL will never be answered) and polls again every 2 s for up to 20 s. Without a banner nothing changes: a silent unit fails at the normal timeout, with no re-polling. Only SESSION_RESET and POLL are sent, so this is safe in front of the change path too. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/protocol.py | 56 +++++++++++++++++-- tests/test_minimate_boot_on_connect.py | 77 ++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 tests/test_minimate_boot_on_connect.py diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 509f235..9b7aadb 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -223,10 +223,9 @@ class MiniMateProtocol: log.debug("startup: POLL probe") self._send(POLL_PROBE) - probe_rsp = self._recv_one( - expected_sub=_expected_rsp_sub(SUB_POLL), - timeout=self._recv_timeout, - ) + probe_rsp = self._await_poll_or_boot(self._recv_timeout) + if probe_rsp is None: + probe_rsp = self._poll_until_booted() log.debug( "startup: POLL probe response page_key=0x%04X", probe_rsp.page_key ) @@ -1570,6 +1569,55 @@ class MiniMateProtocol: f"Expected SUB=0x{expected_sub:02X}, got 0x{frame.sub:02X}" ) + # A MiniMate whose port has just opened may boot: it sends this banner a few + # seconds later and ignores a POLL sent before it. Measured on BE9441 over a + # serial cable (2026-10-25): banner ~3 s after the port opened, twice; after a + # mid-download reboot it answered 8.8 s after the banner. + _BOOT_BANNER = b"Operating System" + _BOOT_GRACE_S = 20.0 + _BOOT_POLL_S = 2.0 + + def _await_poll_or_boot(self, timeout: float) -> Optional[S3Frame]: + """The first POLL probe's reply -- or None the moment the unit sends its + boot banner, because a POLL sent before the banner is never answered.""" + expected = _expected_rsp_sub(SUB_POLL) + deadline = time.monotonic() + timeout + tail = b"" + while time.monotonic() < deadline: + chunk = self._transport.read(256) + if not chunk: + time.sleep(0.005) + continue + log.debug("RX %d bytes: %s", len(chunk), chunk.hex()) + frames = self._parser.feed(chunk) + if frames: + self._pending_frames.extend(frames[1:]) + self._validate_frame(frames[0], expected) + return frames[0] + tail = (tail + chunk)[-64:] + if self._BOOT_BANNER in tail: + return None + raise TimeoutError( + f"No S3 frame received within {timeout:.1f}s (expected SUB 0x{expected:02X})") + + def _poll_until_booted(self) -> S3Frame: + """The unit said it is booting: POLL again until it answers. A read -- + nothing is ever sent but SESSION_RESET and POLL.""" + log.info("startup: the unit is booting (it sent %r) -- polling again until it answers", + self._BOOT_BANNER.decode()) + deadline = time.monotonic() + self._BOOT_GRACE_S + while time.monotonic() < deadline: + self._send(SESSION_RESET) + self._send(POLL_PROBE) + try: + return self._recv_one(expected_sub=_expected_rsp_sub(SUB_POLL), + timeout=self._BOOT_POLL_S) + except TimeoutError: + continue + raise TimeoutError( + f"the unit sent its boot message but did not answer a POLL within " + f"{self._BOOT_GRACE_S:.0f} s") + def _drain_boot_string(self, drain_ms: int = 200) -> None: """ Read and discard any boot-string bytes ("Operating System") the device diff --git a/tests/test_minimate_boot_on_connect.py b/tests/test_minimate_boot_on_connect.py new file mode 100644 index 0000000..010b4a9 --- /dev/null +++ b/tests/test_minimate_boot_on_connect.py @@ -0,0 +1,77 @@ +"""A MiniMate that boots when its port opens is waited for, not given up on. + +BE9441 on a serial cable (bench, 2026-10-25) twice sent its boot banner +("Operating System") ~3 s after the port opened and ignored the POLL sent +before it; the request then failed at the full receive timeout (15 s, or 120 s +on the download path). After a mid-download reboot it answered 8.8 s after its +banner. startup() now stops waiting on the moment it sees the banner and polls +again until the unit answers (up to 20 s); with no banner, nothing changes. +""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +import minimateplus.client as mc # noqa: E402 +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import SessionReplay, fast_clock, recorded_replies # noqa: E402 + +BANNER = b"Operating System" + + +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +class Booting(SessionReplay): + """Banner instead of an answer to the first POLL; then `deaf` more POLL probes + go unanswered (still booting); after that, the recorded session as normal.""" + + def __init__(self, replies, deaf=2, banner=True): + super().__init__(replies) + self.deaf, self.banner, self.polls = deaf, banner, 0 + + def write(self, data): + data = bytes(data) + if data[:2] == b"\x41\x02" and data[5] == 0x5B and data[8] == 0x00: # the POLL probe + self.polls += 1 + if self.polls == 1: + if self.banner: + self._buf += BANNER + return + if self.polls <= 1 + self.deaf: + return + super().write(data) + + +def connect(transport): + client = mc.MiniMateClient(transport=transport) + client.open() + return client, client.connect() + + +def test_a_unit_booting_on_connect_is_waited_for(): + t = Booting(recorded_replies(), deaf=2) + _client, info = connect(t) + assert info.serial == "BE9441" + assert t.polls == 4 # the lost one, two while booting, the answered one + + +def test_a_unit_that_boots_but_never_answers_says_so(): + t = Booting(recorded_replies(), deaf=10_000) + with pytest.raises(mp.TimeoutError, match="boot"): + connect(t) + + +def test_a_silent_unit_without_a_banner_fails_as_before(): + t = Booting(recorded_replies(), deaf=10_000, banner=False) + with pytest.raises(mp.TimeoutError) as e: + connect(t) + assert "boot" not in str(e.value) + assert t.polls == 1 # no re-polling without the banner -- 2.54.1 From 3898d032362abb0149cd3c7295383f62cc4ccf53 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:19:14 -0400 Subject: [PATCH 090/223] docs: the first MiniMate bench run -- four bugs found, what remains of the check Series-III reference: the 0x15 serial is a C string (BE9441's "BE9441\x00?"), A5 replies echo their address at data[2:6] (metadata pages only on the event-1 walk), the unit boots on serial-port open (banner ~3 s, answered 8.8 s after a reboot's banner), one mid-download reboot, and 24 index entries vs 20 listed events (inferred: monitor-log entries). Spec: the MiniMate check's first run, item by item, and what is still owed. CLAUDE.md: the phase-1b "unproven" line retracted in place, with the four bugs and the re-run owed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 22 +- docs/instantel_protocol_reference.md | 7327 +++++++++-------- .../2026-10-20-sfm-series4-parity-design.md | 24 + 3 files changed, 3709 insertions(+), 3664 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2785be6..935bb40 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -130,8 +130,26 @@ Read this first when picking the project back up. 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). + sequence. ~~⚠ The MiniMate header walk is **unproven on a unit; a MiniMate + bench check is owed before the branch merges.**~~ **2026-10-25, first + MiniMate bench run (BE9441, serial cable):** the header walk listed 20 + events correctly, and the check found four bugs, all fixed and tested on its + logged bytes. + 1. **Every non-first event SFM assembled was 2 bytes short.** The body + builder assumed the 0x1002/0x1004 metadata pages in every 5A stream; it + now reads each A5 reply's echoed address. This also affected legacy + `get_events` and `ach_server.py` files. Blastware's own files were not + affected. + 2. **A reboot mid-download stored a partial event as a success.** A strict + 5A stream now raises on any early end. + 3. **The unit boots when its port opens** and ignores a POLL sent before the + `Operating System` banner. Startup now waits for it. + 4. **The 0x15 serial is a C string** (`"BE9441\x00?"`). + + Series-3 downloads are now checked against the unit's own 0C peaks before + being stored. ⚠ **A re-run with the fixes in place is still owed before + merge**, plus the rest of the check's scope (spec, phase 1b). Next: 1c + (webapp). - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index b236d5c..1212e70 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -1,3662 +1,3665 @@ -# Instantel MiniMate Plus — Blastware RS-232 Protocol Reference -### "The Rosetta Stone" -> Reverse-engineered via RS-232 serial bridge sniffing between Blastware software and an Instantel MiniMate Plus seismograph (S/N: BE18189). -> Cross-referenced against Instantel MiniMate Plus Operator Manual (716U0101 Rev 15) from v0.18 onward. -> **Certainty Ratings:** ✅ CONFIRMED | 🔶 INFERRED | ❓ SPECULATIVE -> Certainty ratings apply only to protocol semantics, not to capture tooling behavior. - ---- - -## Changelog - -| Date | Section | Change | -|---|---|---| -| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | -| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | -| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | -| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | -| 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. | -| 2026-05-20 | §2, §3, §4.2, §5.1, §5.3, §6, §7.5b, §7.6.1, §7.6.3, §7.6.4, §7.7.2, §7.7.3, §7.7.5, §7.8.4, §7.8.7, §7.9, §8, §11, §12, §13, §14, §15, Appendix D | **DOC AUDIT PASS — accuracy sweep against `CLAUDE.md` + `minimateplus/` code.** Fixed: (1) S3 frames terminate on bare ETX, not DLE+ETX — §2/§3 rewritten. (2) §3 payload layout corrected — byte[1]=flags, byte[2]=SUB (was wrongly labelled DLE/ADDR). (3) §4.2 — probe responses do NOT carry data length; lengths are hardcoded `DATA_LENGTHS` constants. (4) §5.1 — removed stale duplicate "SUB 1C = TRIGGER CONFIG READ" row; SUB 0A lengths corrected from `0x30/0x26` to `0x46/0x2C` (real event / boundary marker). (5) §5.3 — added missing write-frame format (BW_CMD-only doubling, DLE-aware checksum, offset formula, ack format, SUB 71 chunk parameters). (6) §6 — fixed "SUB 06 → channel config read" → event storage range. (7) §7.5b / §8 — added the 10-byte `sub_code=0x03` continuous-mode timestamp variant alongside the 9-byte single-shot layout; peak vector sum location corrected from "fixed offset 87" to `tran_pos − 12` (label-relative). (8) §7.6 / §7.6.1 / §7.6.3 / §7.6.4 — switched compliance-anchor convention from the 10-byte form to the canonical 6-byte `\xbe\x80\x00\x00\x00\x00`; recording_mode confirmed at anchor−8 in BOTH read and write (was wrongly listed as anchor−3 write / anchor−4 read); sample_rate at anchor−6, histogram_interval at anchor−4, record_time at anchor+6; geo_range row added at channel_label+33. (9) §7.7.2 — token byte position corrected from `params[6]` to `params[7]`. (10) §7.8.4 — fi==9 skip marked FIXED (already removed from code); chunk-count totals updated. (11) §7.8.7 — TODO replaced with current state of `_decode_a5_metadata_into`. (12) §7.9 — Histogram Interval upgraded ❓ → ✅. (13) §11 — POLL example wire bytes corrected; SUB 5A row added to checksum table. (14) §13 — device-under-test updated for current primary unit (BE11529 / S338.17). (15) §14 — TCP Idle Timeout fixed (0→2 min); Data Forwarding Timeout units clarified. (16) §15 (renumbered from second §14) — open-question items already resolved in CLAUDE.md closed out. (17) Appendix D — extension taxonomy rewritten to reflect the AB0T timestamp encoding (D.5.2/D.5.3); EXTENSION REFUTED warning replaced with the resolved encoding. | -| 2026-05-08 | §7.6.1 (RETRACTION) | **❌ RETRACTED — "raw int16 LE 8 bytes/sample-set" body codec was never validated.** The original 4-2-26 confirmation was based on misreading broken-decoder output (full-scale ±32K noise) as evidence the signal had saturated. BW's own 0C peaks for that capture (Tran=0.420 / Vert=3.870 / Long=0.495 in/s) prove the signal was NOT saturated — none of those exceed 13K ADC counts. No event in the project's archive has ever come close to saturation, yet the decoder consistently produces ±32K noise on every event. Conclusion: the body codec is not raw int16 LE; the actual encoding is open. Body byte distribution is heavily skewed (24% `0x00`, 10.5% `0x10`, lots of `10 XX` pairs) — likely a delta encoding with `0x10` as escape, but unverified. Retraction box added at top of §7.6.1; "fully-saturating event" claim removed from channel-identification note. The histogram codec in §7.6.2 IS verified and decoded correctly (different recording mode, 32-byte blocks); use it as a structural hint when reverse-engineering the waveform codec. | -| 2026-02-26 | Initial | Document created from first hex dump analysis | -| 2026-02-26 | §2 Frame Structure | **CORRECTED:** Frame uses DLE-STX (`0x10 0x02`) and DLE-ETX (`0x10 0x03`), not bare `0x02`/`0x03`. `0x41` confirmed as ACK not STX. DLE stuffing rule added. | -| 2026-02-26 | §8 Timestamp | **UPDATED:** Year `0x07CB = 1995` confirmed as MiniMate hardware default date when RTC battery is disconnected. Not an encoding error. Confidence upgraded from ❓ to 🔶. | -| 2026-02-26 | §10 DLE Stuffing | **UPGRADED:** Section upgraded from ❓ SPECULATIVE to ✅ CONFIRMED. Full stuffing rules and parser state machine documented. | -| 2026-02-26 | §11 Checksum | **UPDATED:** Frame builder and parser rewritten to handle DLE framing and byte stuffing correctly. | -| 2026-02-26 | §14 Open Questions | DLE question removed (resolved). Timestamp year question removed (resolved). | -| 2026-02-26 | §7.2 Serial Number Response | **CORRECTED:** Trailing bytes are `0x79 0x11` only (2 bytes, not 3). `0x20` was misidentified as a trailing byte — it is the frame checksum. | -| 2026-02-26 | §7.2 Serial Number Response | **UPDATED:** Two-unit comparison confirms `0x11` = firmware minor version (S337.**17** → `0x11` = 17). Byte 0 is unit-specific, derivation unknown. | -| 2026-02-26 | §15 Binary Log Format | **NEW:** `.bin` logger format strips DLE from ETX (`0x10 0x03` → `0x03`). Not raw wire bytes. | -| 2026-02-26 | §5.1 Request Commands | **ADDED:** Three new read commands confirmed: SUB `09`, `1A`, `2E`. | -| 2026-02-26 | §5.3 Write Commands | **NEW SECTION:** Full write command family documented from compliance setup capture. SUBs `68`–`83`. | -| 2026-02-26 | §7.5 Full Waveform Record | **UPDATED:** Project strings field layout fully mapped from write payload diff. Client field confirmed at byte +230 in SUB `71` frame. | -| 2026-02-26 | §14 Open Questions | Write commands question resolved. Session `152427` had swapped port labels — superseded by sessions `184518` and `185019`. | -| 2026-02-26 | Global | **CORRECTED:** Firmware version `S338.17` → `S337.17` everywhere, including hex encoding at config offset `0x34`. | -| 2026-02-26 | §3 Payload Structure | **DOWNGRADED:** ADDR field certainty `🔶 INFERRED` → `❓ SPECULATIVE`. Added note that bytes 1–2 purpose is unconfirmed. | -| 2026-02-26 | §5.2 Response SUBs | **STRENGTHENED:** `0xFF - SUB` rule wording clarified — high confidence, no counterexample, not yet formally proven. | -| 2026-02-26 | §15 → Appendix A | **RENAMED:** Binary log format section moved to Appendix A with explicit note that it describes tooling behavior, not protocol. | -| 2026-02-26 | Header | **ADDED:** Certainty legend clarification — ratings apply to protocol semantics only, not tooling behavior. | -| 2026-02-26 | §7.6 Channel Config Float Layout | **NEW SECTION:** Trigger level confirmed as IEEE 754 BE float in in/s. Alarm level identified as adjacent float = 1.0 in/s. Unit string `"in./s"` embedded inline. `0x082A` removed as trigger level candidate. | -| 2026-03-01 | §7.6 Channel Config Float Layout | **UPGRADED:** Alarm level offset fully confirmed via controlled capture (alarm 1.0→2.0, trigger 0.5→0.6). Complete per-channel layout documented. Three-channel repetition confirmed (Tran, Vert, Long). Certainty upgraded to ✅ CONFIRMED. | -| 2026-03-01 | §7.7 `.set` File Format | **NEW SECTION:** Blastware save-to-disk format decoded. Little-endian binary struct matching wire protocol payload. Full per-channel block layout mapped. Record time confirmed as uint32 at +16. MicL unit string confirmed as `"psi\0"`. `0x082A` mystery noted — not obviously record time, needs one more capture to resolve. | -| 2026-03-02 | §7.4 Event Index Block | **CONFIRMED:** Backlight and power save offsets independently confirmed via device-set capture (backlight=100=0x64 at +75, power-save=30=0x1E at +83). On-device change visible in S3→BW read response — no Blastware write involved. Offsets are ✅ CONFIRMED. | -| 2026-03-02 | §7.4 Event Index Block | **NEW:** `Monitoring LCD Cycle` identified at offsets +84/+85 as uint16 BE. Default value = 65500 (0xFFDC) = effectively disabled / maximum. Confirmed from operator manual §3.13.1g. | -| 2026-03-02 | §7.4 Event Index Block | **UPDATED:** Backlight confirmed as uint8 range 0–255 seconds per operator manual §3.13.1e ("adjustable timer, 0 to 255 seconds"). Power save unit confirmed as minutes per operator manual §3.13.1f. | -| 2026-03-02 | Global | **NEW SOURCE:** Operator manual (716U0101 Rev 15) added as reference. Cross-referencing settings definitions, ranges, and units. Header updated. | -| 2026-03-02 | §14 Open Questions | Float 6.2061 in/s mystery: manual confirms only two geo ranges (1.25 in/s and 10.0 in/s). 6.2061 is NOT a user-selectable range → originally speculated as internal ADC full-scale constant, but was NOT confirmed at this time. Using it directly as the range produces ~9× PPV overread. Meaning unknown. Downgraded to LOW 2026-03-02, re-escalated to HIGH 2026-04-16. **RESOLVED 2026-04-17 — see §7.6.2 and changelog entry.** | -| 2026-03-02 | §14 Open Questions | `0x082A` hypothesis refined: 2090 decimal. At 1024 sps, 2 sec record = 2048 samples. Possible that 0x082A = total samples including 0.25s pre-trigger (256 samples) at some adjusted rate. Needs capture with different record time. | -| 2026-03-02 | §14 Open Questions | **NEW items added:** Trigger sample width (default=2), Auto Window (1-9 sec), Aux Trigger (enabled/disabled) — all confirmed settings from operator manual not yet mapped in protocol. | -| 2026-03-02 | §14 Open Questions | Monitoring LCD Cycle resolved — removed from open questions. | -| 2026-03-02 | Appendix A | **CORRECTED:** Previous entry stated logger strips DLE from ETX. This was wrong — it applied to an older logger version. `s3_bridge v0.5.0` confirmed to preserve raw wire bytes including `0x10 0x03` intact. HxD inspection of new capture confirmed `10 03` present in S3→BW record payloads. | -| 2026-03-02 | Appendix A | **UPDATED:** New capture architecture: two flat raw wire dumps per session (`raw_s3.bin`, `raw_bw.bin`), one per direction, no record wrapper. Replaces structured `.bin` format for parser input. | -| 2026-03-02 | Appendix A | **PARSER:** Deterministic DLE state machine implemented (`s3_parser.py`). Three states: `IDLE → IN_FRAME → AFTER_DLE`. Replaces heuristic global scanning. Properly handles DLE stuffing (`10 10` → literal `10`). Only complete STX→ETX pairs counted as frames. | -| 2026-03-02 | Appendix A | **VALIDATED:** `raw_bw.bin` yields 7 complete frames via state machine. `raw_s3.bin` contains large structured responses (first frame payload ~3922 bytes). Both files confirmed lossless. BW bare `0x02` pattern confirmed as asymmetric framing (BW sends bare STX, S3 sends DLE+STX). | -| 2026-03-09 | §7.6, §Appendix B | **CONFIRMED:** Record time located in SUB E5 data page2 at payload offset `+0x28` as **float32 BE**. Confirmed via two controlled captures: 7 sec = `40 E0 00 00`, 13 sec = `41 50 00 00`. Geo range (only 1.25 or 10.0 in/s) eliminates ambiguity — 7 and 13 are not valid geo range values. | -| 2026-03-09 | §7.5, §14 | **CORRECTED:** The byte `0x0A` appearing after the "Extended Notes" null-padded label in the E5 payload is **NOT** record time. It is an unknown field that equals 10 and does not change when record time changes. False lead closed. | -| 2026-03-09 | §14 | **RESOLVED:** `0x082A` mystery closed — confirmed as fixed-size E5 payload length (2090 bytes), not a record-time-derived sample count. Value is constant regardless of record time or other settings. | -| 2026-03-09 | §7.8, §14, Appendix B | **NEW — Trigger Sample Width confirmed:** Located in BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Confirmed via BW-side capture (`raw_bw.bin`) diffing two sessions: Width=4 → `0x04`, Width=3 → `0x03`. Setting is **transmitted only on BW→S3 write** (SUB `0x82`), invisible in S3-side compliance dumps. | -| 2026-03-09 | §14, Appendix B | **CONFIRMED — Mode gating is a real protocol behavior:** Several settings are only transmitted (and possibly only interpreted by the device) when the required mode is active. Trigger Sample Width is only sent when in Compliance/Single-Shot/Fixed Record Time mode. Auto Window is only relevant when Record Stop Mode = Auto — attempting to capture it in Fixed mode produced no change on the wire (F7 and D1 blocks identical before/after). This is an architectural property, not a gap in the capture methodology. Future capture attempts for mode-gated settings must first activate the appropriate mode. | -| 2026-03-09 | §14 | **UPDATED — Auto Window:** Capture attempted (Auto Window 3→9) in Fixed record time mode. No change observed in any S3-side frame (F7, D1, E5 all identical). Confirmed mode-gated behind Record Stop Mode = Auto. Not capturable without switching modes — deferred. | -| 2026-03-11 | §14, Appendix B | **CONFIRMED — Aux Trigger read location:** SUB `FE` (FULL_CONFIG_RESPONSE), destuffed payload offset `0x0109`, uint8. `0x00` = disabled, `0x01` = enabled. Confirmed via controlled capture: changed Aux Trigger in Blastware, sent to unit, re-read config. FE diff showed clean isolated flip at `0x0109` with only 3 other bytes changing (likely counters/checksums at `0x0033`, `0x00C0`, `0x04ED`). | -| 2026-03-11 | §14, Appendix B | **PARTIAL — Aux Trigger write path:** Write command not yet isolated. The BW→S3 write appears to occur inside the A4 (POLL_RESPONSE) stream via inner frame handshaking — multiple WRITE_CONFIRM_RESPONSE inner frames (SUBs `7C`, `7D`, `8B`, `8C`, `8D`, `8E`, `96`, `97`) appeared in A4 after the write, and the TRIGGER_CONFIG_RESPONSE (SUB `E3`) inner frames were removed. Write command itself not yet captured in a clean session — likely SUB `15` or embedded in the partial session 0. Write path deferred for a future clean capture. | -| 2026-03-11 | §4, §14 | **NEW — SUB A4 is a composite container frame:** A4 (POLL_RESPONSE) payload contains multiple embedded inner frames using the same DLE framing (10 02 start, 10 03 end, 10 10 stuffing). Phase-shift diffing issue resolved in s3_analyzer.py by adding `_extract_a4_inner_frames()` and `_diff_a4_payloads()` — diff count reduced from 2300 → 17 meaningful entries. | -| 2026-03-11 | §14 | **NEW — SUB `6E` response anomaly:** BW sends SUB `1C` (TRIGGER_CONFIG_READ) and S3 responds with SUB `6E` — does NOT follow the `0xFF - SUB` rule (`0xFF - 0x1C = 0xE3`). Only known exception to the response pairing rule observed to date. SUB `6E` payload starts with ASCII string `"Long2"`. ~~CORRECTION 2026-04-08: This "exception" was a misidentification. The `1C` in that capture was BW→S3 (a monitor status poll), and the `6E` response was from an inner A4 sub-frame misread as a top-level S3 frame. Confirmed from 4-8-26/2ndtry capture (338 BW TX frames): SUB 0x1C always receives response SUB 0xE3 (= 0xFF − 0x1C). No exceptions to the response pairing rule are known.~~ | -| 2026-03-12 | §11 | **CONFIRMED — BW→S3 large-frame checksum algorithm:** SUBs `68`, `69`, `71`, `82`, and `1A` (with data) use: `chk = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) % 256` — SUM8 of payload bytes `[2:-1]` skipping all `0x10` bytes, plus `0x10` as a constant, mod 256. Validated across 20 frames from two independent captures with differing string content (checksums differ between sessions, both validate correctly). Small frames (POLL, read commands) continue to use plain SUM8 of `payload[0:-1]`. The two formulas are consistent: small frames have exactly one `0x10` (CMD at `[0]`), which the large-frame formula's `[2:]` start and `+0x10` constant account for. | -| 2026-03-12 | §11 | **RESOLVED — BAD CHK false positives on BW POLL frames:** Parser bug — BW frame terminator (`03 41`, ETX+ACK) was being included in the de-stuffed payload instead of being stripped as framing. BW frames end with bare `0x03` (not `10 03`). Fix: strip trailing `03 41` from BW payloads before checksum computation. | -| 2026-03-30 | §3, §5.1 | **CONFIRMED — BW→S3 two-step read offset is at payload[5], NOT payload[3:4].** All BW read-command frames have `payload[3] = 0x00` and `payload[4] = 0x00` unconditionally. The two-step offset byte lives at `payload[5]`: `0x00` for the length-probe step, `DATA_LEN` for the data-fetch step. Validated against all captured frames in `bridges/captures/3-11-26/raw_bw_*.bin` — every frame is an exact bit-for-bit match when built with offset at `[5]`. The `page_hi`/`page_lo` framing in the docstring was a misattribution from the S3-side response layout (where `[3]`/`[4]` ARE page bytes). | -| 2026-03-30 | §4, §5.2 | **CONFIRMED — S3 probe response page_key is always 0x0000.** The S3 response to a length-probe step does NOT carry the data length back in `page_hi`/`page_lo`. Both bytes are `0x00` in every observed probe response. Data lengths for each SUB are fixed constants (see §5.1 table). The `minimateplus` library now uses a hardcoded `DATA_LENGTHS` dict rather than trying to read the length from the probe response. | -| 2026-03-31 | §12 TCP Transport | **NEW SECTION — TCP/modem transport confirmed transparent from Blastware Operator Manual (714U0301 Rev 22).** Key facts confirmed: (1) Protocol bytes over TCP are bit-for-bit identical to RS-232 — no handshake framing. (2) No ENQ byte on TCP connect (`Enable ENQ on TCP Connect: 0-Disable` in Raven ACEmanager). (3) Raven modem `Data Forwarding Timeout = 1 second` — modem buffers serial bytes up to 1s before forwarding over TCP; `TcpTransport.read_until_idle` uses `idle_gap=1.5s` to compensate. (4) TCP port is user-configurable (12335 in manual example; user's install uses 12345). (5) Baud rate over serial link to modem is 38400,8N1 regardless of TCP path. (6) ACH (Auto Call Home) = INBOUND to server (unit calls home); "call up" = OUTBOUND from client (Blastware/SFM connects to modem IP). `TcpTransport` implements outbound (call-up) mode. | -| 2026-03-31 | §14.3 | **NEW — Sierra Wireless RV50/RV55 Quiet Mode requirement confirmed.** Quiet Mode (ATQ) must be **enabled** on the serial port. When disabled (+ Verbose mode on), the modem injects `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time — MiniMate receives unexpected bytes, loses protocol sync, and never responds to POLL (unit beeps but returns no S3 frame). Working RV50 field config: Quiet Mode enabled, Data Forwarding Timeout=1, TCP Connect Response Delay=0. Misconfigured RV55 had all three wrong. | -| 2026-03-31 | §14.2 | **CORRECTED — Sierra Wireless RV50/RV55 sends `RING`/`CONNECT` over TCP to caller even with Quiet Mode enabled.** Quiet Mode suppresses these only on the serial port (protecting the MiniMate). TCP client still receives `\r\nRING\r\n\r\nCONNECT\r\n` prefixed before the first S3 frame bytes. Parser handles correctly by scanning for DLE+STX (`0x10 0x02`) and discarding prefix bytes. Previous note "no CONNECT string" described Raven X ENQ-disable behaviour; RV50/RV55 differ. | -| 2026-03-31 | §7.3 | **NEW — Calibration date field confirmed** at Full Config (SUB FE) destuffed payload offsets 0x53–0x57. Two-unit comparison: BE18189 (calibrated 2023) has `07 E7` at 0x56–0x57; BE11529 (calibrated 2025) has `07 E9`. Bytes 0x56–0x57 = uint16 BE calibration year ✅ CONFIRMED. Adjacent bytes at 0x53–0x55 likely encode month/day (both units show `0x10` at offset 0x54 = BCD October; 0x53 and 0x55 differ between units). Full date layout 🔶 INFERRED — pending third-unit capture or recalibration diff. Resolves open question. | -| 2026-03-31 | §9 | **CONFIRMED via Console cold-start capture** — `"Operating System"` (16 B: `4f 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d`) arrives as first TCP bytes on cold-connect before unit enters DLE-framed mode. `TcpTransport` + retry logic handles gracefully: first attempt times out waiting for SUB A4; second connect (after unit fully booted) succeeds. | -| 2026-04-01 | §7.7.5, §8 | **CONFIRMED — Full waveform record (0C) timestamp layout** cross-referenced against Blastware event report for BE11529 thump event ("00:28:12 April 1, 2026"). 9-byte format at bytes[0–8]: `[day][sub_code][month][year:2 BE][unknown][hour][min][sec]`. All fields verified. Sub_code `0x10` = Waveform (continuous/single-shot). **Previous 7-byte format doc was wrong** — replaced with confirmed 9-byte layout. | -| 2026-04-01 | §7.7.5 | **CONFIRMED — Record type** encoded in byte[1] (sub_code), not as ASCII string. `0x10` = Waveform ✅. Histogram sub_code not yet captured. ASCII string search approach removed. | -| 2026-04-01 | §7.7.5, §14 | **CONFIRMED — Per-channel PPV** at label+6 (✅ all four channels), cross-referenced vs Blastware: Tran=0.420, Vert=3.870, Long=0.495 in/s. **CONFIRMED — Peak Vector Sum** at fixed offset 87 = 3.906 in/s ✅ matches Blastware "Peak Vector Sum". Is √(Tran²+Vert²+Long²) at max instantaneous vector moment, not vector sum of per-channel peaks. Open question "offset 87 purpose" closed. | -| 2026-04-01 | §8 | **RESOLVED — §8 unknown byte at offset 3.** Field is confirmed absent in the 9-byte waveform record format (no such field). The 6-byte event-index format has a separator byte at [3] whose purpose remains ❓ but is no longer actively blocking anything. | -| 2026-04-01 | §7.6.2 (NEW) | **NEW — SUB 1A multi-frame read protocol documented.** SUB 1A (compliance config read) requires a 4-frame sequence, not a simple 2-step probe+fetch. Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture, ACK+STX/ETX format, BW CMD=0x10). Sequence: (A) probe `offset=0x0000, params=...00 64 00 00`; (B) data request `offset=0x0400, params=...00 64 00 00`; (C) data request `offset=0x0400, params=...04 00 00 64 00 00`; (D) data request `offset=0x002A, params=...08 00 00 64 00 00`. E5 response to each frame carries a `page_key` field (bytes `data[3:5]`): page `0x0000` = 44-byte header chunk, page `0x0010` = main config data (~1027+1055 bytes across C and D). | -| 2026-04-01 | §7.6.2 | **NEW — BE11529 duplicate-page behaviour.** BE11529 (firmware S338.17) sometimes responds to frame D with page `0x0000` (44 bytes) instead of page `0x0010` (~1055 bytes). When this happens, frame D is an exact duplicate of frame B and must be dropped to prevent cfg mis-alignment. Detection: track `(page_key, chunk_len)` pairs and skip repeats. When frame D delivers page `0x0010` correctly, total cfg = 44 + 1027 + 1055 = 2126 bytes; with duplicate D, cfg = 44 + 1027 = 1071 bytes. Both are valid inputs to the decoder. | -| 2026-04-01 | §7.6.1 | **CORRECTED — Record time offset.** Previous doc (`+0x28` from E5 data page2 start) was correct for single-frame reads but unreliable for BE11529 due to a 1-byte DLE jitter (see §7.6.3). The `minimateplus` library now uses an anchor-based approach: search for `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100]; record time float32 BE is at anchor+10. Validated at 3.0, 5.0, and 8.0 seconds. | -| 2026-04-01 | §7.6.3 (NEW) | **NEW — Sample rate confirmed and documented.** Sample rate (Normal=1024 / Fast=2048 / Faster=4096 Sa/s) is stored as uint16 BE at anchor−2, where anchor is the 10-byte sequence `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00`. DLE jitter root cause: 4096 = 0x1000, so in the raw S3 frame the sample-rate bytes are sent as `10 10 00` (DLE-escaped `10`); after DLE unstuffing → `10 00` (2 bytes instead of 3 for 1024/2048), making frame C 1 byte shorter and shifting all subsequent offsets by −1. Anchor search is immune to this shift. All three modes confirmed on BE11529 firmware S338.17. | -| 2026-04-01 | §5.1 | **CONFIRMED — `_pending_frames` buffer and `reset_parser=False` parameter.** `MiniMateProtocol._recv_one()` now supports `reset_parser=False` to preserve parser state between consecutive reads within a multi-frame sequence. A `_pending_frames: list[S3Frame]` buffer stores extra frames parsed from a single TCP chunk when multiple E5 responses arrive together. Required for reliable SUB 1A frame B/C/D sequence on BE11529. | -| 2026-04-02 | §7.8 (NEW) | **CONFIRMED — SUB 5A frame format.** `offset_hi` byte (`0x10`) must be sent **raw, not DLE-stuffed** — standard `build_bw_frame` incorrectly stuffs it to `10 10` on the wire; device ignores the frame. BW sends it as bare `10`. Checksum is **DLE-aware**: when walking the byte sequence, `10 XX` pairs contribute only `XX` to the sum; lone bytes contribute normally. `build_5a_frame()` reproduces BW's exact wire format. | -| 2026-04-02 | §7.8 | **CONFIRMED — SUB 5A params are 11 bytes (not 10) for chunk frames.** Extra trailing `0x00` confirmed from 1-2-26 BW wire capture. Probe frame and termination frame differ — see `bulk_waveform_params()` in `framing.py`. | -| 2026-04-02 | §7.7.5 | **CONFIRMED — Event-time metadata source.** `Client:`, `User Name:`, and `Seis Loc:` strings are present in **A5 frame 7** of the SUB 5A bulk waveform stream — they are NOT in the 210-byte SUB 0C waveform record. They reflect the compliance setup active when the event was stored on the device (not the current setup). `get_events()` now issues SUB 5A after each 0C download. Sequence: `1E → 0A → 0C → 5A → 1F`. | -| 2026-04-02 | §7.6.2 | **FIXED — Compliance config orphaned send bug.** An extra `self._send(SUB_COMPLIANCE / 0x2A / DATA_PARAMS)` before the B/C/D receive loop had no corresponding `recv_one()`. Every receive in the loop was consuming the previous send's response, leaving frame D's channel block unread. Bug removed. Total config bytes now ~2126 (was ~1071 due to truncation). `trigger_level_geo`, `alarm_level_geo`, `max_range_geo` are now correctly populated. | -| 2026-04-02 | §7.6.1 | **CORRECTED — Anchor search range.** Previous doc stated anchor search range `cfg[40:100]`. With the orphaned-send bug fixed, the 44-byte header padding is gone and the anchor now appears at `cfg[11]`. Corrected to `cfg[0:150]`. | -| 2026-04-03 | §7.6 | **CONFIRMED — Blast waveform format (4-2-26 capture).** Blast/waveform-mode SUB 5A stream uses 4-channel interleaved signed int16 LE, 8 bytes per sample-set [T,V,L,M]. NOT the 32-byte block format (which is noise/histogram mode only). Frame sizes are NOT multiples of 8 — cross-frame alignment correction required (track global byte offset mod 8; skip `(8-align)%8` bytes at each frame start). A5[0] STRT record confirmed: 21 bytes at db[7:]+11; waveform starts at strt_pos+27 (after 2-byte null pad + 4-byte 0xFF sentinel). Frame index 7 = metadata only, no ADC data. Full §7.6 rewritten. | -| 2026-04-03 | §7.6 | **CONFIRMED — Noise block format details.** 32-byte blocks: LE uint16 type + LE uint16 ctr + 9×int16 LE samples + 10B metadata. Samples are little-endian (previous doc said big-endian — WRONG). Type: 0x0016=sync (appears at start of each A5 frame), 0x0000=data. Noise floor ≈ 9–11 counts. Metadata fixed pattern `00 01 43 [2B var] 00 [pretrig] [rectime] 00 00` confirmed. | -| 2026-04-03 | client.py | **NEW — `_decode_a5_waveform()` and `download_waveform()` implemented.** `_decode_a5_waveform(frames_data, event)` decodes full A5 waveform stream into `event.raw_samples = {"Tran":[…], "Vert":[…], "Long":[…], "Mic":[…]}`. Populates `event.total_samples`, `event.pretrig_samples`, `event.rectime_seconds` from STRT record. Handles cross-frame alignment. `MiniMateClient.download_waveform(event)` calls `read_bulk_waveform_stream(stop_after_metadata=False)` then invokes the decoder. Waveform key stored on Event as `_waveform_key` during `get_events()`. | -| 2026-04-03 | §7.7.5 | **CONFIRMED — sub_code=0x03 (Waveform continuous) uses 10-byte timestamp header** — one byte wider than sub_code=0x10 layout. Cross-referenced against Blastware event report for BE11529 (15:20:17 Apr 3 2026). Raw header: `10 03 10 04 07 ea 00 0f 14 11` = [unknown_a][day][unknown_b][month][year:2 BE][unknown][hour][min][sec]. Peak Vector Sum is at `tran_label − 12` (label-relative, NOT fixed offset 87 — fixed offset only incidentally correct for sub_code=0x10). | -| 2026-04-05 | §7.8 | **CONFIRMED — 5A "Project:" string is session-start config, NOT per-event.** The "Project:" value in A5 frame 7 reflects the compliance setup active when the monitoring session started, not when the individual event was recorded. `_decode_a5_metadata_into()` only sets `project` from 5A when 0C did not already supply one. "Client:", "User Name:", "Seis Loc:", and "Extended Notes" are NOT in the 0C record and are set unconditionally from 5A. | -| 2026-04-06 | §5.1 | **CORRECTED — SUB 1F token position is params[7], NOT params[6].** Both 3-31-26 and 4-3-26 BW TX captures confirm: raw params `00 00 00 00 00 00 00 FE 00 00`, token byte at index 7. Previous doc (params[6]) was wrong — with wrong position the device ignores the token and 1F returns null immediately. | -| 2026-04-06 | §6.1 | **NEW — Full event download sequence documented** (§6.1). Sequence confirmed from 4-2-26 and 4-3-26 BW TX captures: `1E(all-zero) → [per event: 0A → 1E(arm/0xFE) → 0C → 1F(arm/0xFE) → POLL×3 → 5A → 1F(browse)]`. Each step documented with confirmed requirements. | -| 2026-04-06 | §6.1 | **CONFIRMED — 1E(token=0xFE) arm step required.** Device silently ignores all 5A probe frames unless a second 1E with token=0xFE is sent between 0A and 0C. Present in every download cycle in the 4-2-26 and 4-3-26 captures. | -| 2026-04-06 | §6.1 | **CONFIRMED — SUB 1F(token=0xFE) must precede POLL×3 before 5A.** BW always sends 1F(0xFE) before the 3 POLL cycles before 5A. 5A still uses the pre-advance key (set by 0A+1E-arm+0C); 1F only arms the device's 5A state machine. | -| 2026-04-06 | §6.1 | **CONFIRMED — browse 1F must be conditional.** Calling 1F(browse=True/all-zero) after a FAILED 5A disrupts device state and causes the next event's 5A probe to time out with 0 bytes received. Browse 1F is only called after a SUCCESSFUL 5A. Failure fallback: use the key returned by the prior 1F(arm/0xFE) call. | -| 2026-04-06 | §7.8 | **ADDED — `bytes_fed` diagnostic counter on S3FrameParser.** Counts raw bytes fed to the parser since last `reset()`. Logged at WARNING when 5A probe times out — distinguishes "device sent no bytes at all" from "device responded but frame was malformed or had wrong SUB". | -| 2026-04-06 | §7.8.2 | **CORRECTED — SUB 5A chunk counter is monotonic for ALL chunks.** Previous doc hard-coded chunk 1 counter as `0x1004` (from 4-2-26 BW TX capture). This was a Blastware artifact. Empirically confirmed: `counter = chunk_num * 0x0400` works (device responds immediately); counter=0x1004 for chunk 1 causes 120 s timeout. BW's true internal formula appears to be `key4[2:4] + n * 0x0400` — for event 1 (key `01110000`) this equals `n * 0x0400`. The device does not strictly validate counter values. | -| 2026-04-06 | §7.8.4 | **NEW — 5A end-of-stream signalling confirmed.** After streaming all waveform chunks, the device sends exactly **1 raw byte** in response to the next chunk request, then goes silent for the full recv timeout. This byte is NOT a complete DLE-framed A5 response — the frame parser accumulates it as `bytes_fed=1` and never assembles a frame. This is the device's natural end-of-stream signal. Handling: on TimeoutError, if `bytes_fed > 0` AND prior chunks were received, treat as graceful end and proceed to the termination frame. A `bytes_fed=0` timeout with no prior chunks is a genuine transport failure and must still raise. | -| 2026-04-06 | §7.8.4 | **NEW — 5A chunk timing and count (empirical, BE11529 at 1024 sps).** Each chunk response arrives within ~1 second over TCP/cellular. A 9,306-sample event (≈9.1 s at 1024 sps) produces **35 chunks** before end-of-stream. Chunks 1–16 have varying data lengths (1036–1123 bytes); chunks 17–35 are uniformly 1036 bytes each (post-event silence, all-zero ADC samples). Safe recv timeout for chunk loop: **10 s** (10× typical response time). Default transport timeout (120 s) results in a ~2-minute stall per event at end-of-stream. | -| 2026-04-06 | §7.8.3 | **KNOWN ISSUE — `_decode_a5_waveform` hardcoded fi==9 skip.** The decoder contains `elif fi == 9: continue` which was written for the 9-frame original blast capture where frame 9 was a device terminator. For streams with >9 frames (current device produces 35+), frame index 9 is live waveform data — this skip discards ~1,070 bytes (~133 sample-sets) per event. The terminator is now detected via `page_key == 0x0000`, not by frame index. The fi==9 skip should be removed. | -| 2026-04-06 | §7.8 | **⚠ PARTIALLY INVALIDATED — ADC count-to-physical-unit conversion.** Raw waveform samples are signed 16-bit integers (counts). Conversion formula `value = counts × (range / 32767)` is believed correct, but the `range` value was UNKNOWN at time of writing. **UPDATED 2026-04-17:** `max_range_geo` = 6.206053 is confirmed as the ADC-to-velocity scale factor (inverse sensitivity, (in/s)/V). The correct conversion is therefore: `PPV (in/s) = counts × (1.61133 / 32767) × 6.206053` = `counts × 4.982e-5` in/s per count. The earlier ~9× overread from using 6.206053 directly as the range was because the range IS 1.61133 × 6.206053 = 10.000 in/s, not 6.206053. See §7.6.2 for the confirmed field layout. | -| 2026-04-08 | §5.1, §7.10, §12 | **NEW — Monitoring commands confirmed.** SUB 0x1C (monitor status), 0x96 (start monitoring), 0x97 (stop monitoring) all confirmed from 4-8-26/2ndtry capture. SESSION_RESET (`41 03`) required before POLL to wake a monitoring unit. | -| 2026-04-09 | §7.10 | **CORRECTED — monitoring flag and battery/memory offsets.** `section[1] == 0x10` is the monitoring flag (100% accurate across 144 data frames in 2ndtry capture). Previous note claiming `section[6]` was wrong — section[6] has device-specific non-binary values (0xea/0x07). Battery/memory offsets corrected: `section[-10:-8]` (battery×100), `section[-8:-4]` (memory_total), `section[-4:]` (memory_free). NOTE: `frame.data` has checksum stripped by parser — earlier offsets of `[-11:-9]`/`[-9:-5]`/`[-5:-1]` were wrong because they assumed a trailing checksum byte that isn't there. | -| 2026-04-08 | §7.10 | **NEW — SUBs 0x0E (channel sensor data) and 0x98 (trigger test) observed** in 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). SUB 0x0E: 2-step read with channel selector in `params[6:8]`, data length 0x0A per channel, RSP SUB = 0xF1. SUB 0x98: single probe frame with `params[0] = 0xFF`, RSP SUB = 0x67; sent twice per test cycle. Not yet implemented in SFM. | -| 2026-04-08 | §7.10 | **NEW — SUBs 0x15 and 0x01 observed in sensor-check capture.** SUB 0x15 (serial number short form, data length 0x0A, RSP 0xEA) and SUB 0x01 (device info block, data length 0x98 = 152 bytes, RSP 0xFE) seen in Blastware's "Unit Channel Test" init sequence. Note: SUB 0x01 response SUB 0xFE collides with the existing SUB 0xFE → RSP 0x01 naming convention — they are inverse commands. | -| 2026-04-08 | §12 | **CONFIRMED — Unit partially reachable during on-device sensor check.** 4-8-26/sensor-check capture shows: POLL responds normally throughout; SUB 0x0E channel reads partially served (channels 0–4 responded), then ~40s silent gap while sensor check ran, then channels 5–7 responded. On-device sensor check duration ≈ 40 s. SFM `_pollMonitorConfirm()` polls status every 5 s for up to 60 s after start_monitoring. | -| 2026-04-08 | §7.9 (NEW) | **NEW — Compliance config field inventory captured from Blastware UI.** See §7.9 for full field list (Recording Setup, Notes, Special Setups tabs). Most fields NOT yet mapped to raw byte offsets. Confirmed decoded: sample_rate, record_time, trigger_level_geo, alarm_level_geo, max_range_geo, backlight_on_time, power_saving_timeout, monitoring_lcd_cycle, project/client/operator/sensor_location/notes. Sensor Check dropdown (Before monitoring / After each event / Disabled) NOT YET LOCATED in raw config bytes. | -| 2026-04-11 | §5.1, §5.2 | **NEW — Erase-all command sequence confirmed from MITM capture.** SUB 0xA3 (begin erase, token=0xFE → ack 0x5C) + SUB 0xA2 (confirm erase, token=0xFE → ack 0x5D). Standard `build_bw_frame` format (not write-format). Required intermediate steps: 0x1C probe+data (monitor status read) + 0x06 probe+data (event storage range). All response SUBs follow the standard 0xFF−SUB formula with no exceptions. | -| 2026-04-11 | §5.1 | **CONFIRMED — SUB 0x06 (CHANNEL CONFIG READ) now confirmed as event storage range.** Two-step read, data offset = 0x24 (36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (bytes −8:−4) and last stored event key (bytes −4:). Both equal `01110000` when device memory is empty. Used by Blastware to verify erase completion. | -| 2026-04-11 | §7.11 (NEW) | **NEW — §7.11 Erase-All Protocol added.** Full wire sequence, SUB 0x06 storage range payload layout, post-erase key counter reset (resets to `0x01110000`). Confirmed from 4-11-26 MITM capture of live Blastware ACH session. | -| 2026-04-11 | §14.6 | **RESOLVED — ACH Session Lifecycle is no longer "Future".** `bridges/ach_server.py` fully implements inbound ACH: POLL handshake, device info, event download. State tracked via `ach_state.json` (key-based, with `max_downloaded_key` for post-erase detection). `--clear-after-download` flag added for the standard delete-after-upload workflow. | -| 2026-04-17 | §7.6.2, §14 | **RESOLVED — Float 6.206053 at channel_label+28 is the ADC-to-velocity scale factor.** Confirmed from Series III Interface Handbook §4.5 formula: `Range (×1) = 1.61133 V / Sensitivity (V/unit)`. For the standard Instantel geophone at Normal range (10.000 in/s): Sensitivity = 1.61133 / 10 = 0.161133 V/(in/s). The stored value is the **inverse sensitivity** = 1/0.161133 = **6.206053 (in/s)/V**. Cross-check: 1.61133 V × 6.206053 = 10.000 in/s ✅. The firmware uses it as: `PPV (in/s) = ADC_voltage (V) × 6.206053`. Value is identical on all Instantel standard geophones — it is a hardware/firmware constant, NOT a user-configurable setting. Do NOT write this field. Open question §14 item "Max Geo Range float 6.2061" is now **RESOLVED**. | -| 2026-04-20 | §7.6.4 (NEW), §7.9, Appendix B | **CONFIRMED — Recording Mode byte location.** Three targeted captures (4-20-26) confirmed `recording_mode` at anchor−8 in both the E5 read payload and the BW write payload (6-byte anchor `\xbe\x80\x00\x00\x00\x00`). BW write payload and E5 read payload are **byte-identical** around the anchor region — Blastware round-trips the wire-encoded E5 bytes verbatim with only the target field modified. Anchor position varies by ±1 depending on whether recording_mode = 0x03 (Histogram), because E5 wire-encodes `0x03` as the inner DLE+ETX pair `\x10\x03` (2 bytes), which S3FrameParser preserves as two literal bytes in `compliance_raw`. Enum: `0x00`=Single Shot, `0x01`=Continuous, `0x03`=Histogram, `0x04`=Histogram+Continuous. `0x02` value not yet observed. The byte at anchor−9 is `0x00` for Single Shot / Continuous, and `0x10` for Histogram (DLE prefix from E5 encoding) and Histogram+Continuous (actual config byte). See §7.6.4 for full details. | -| 2026-04-21 | Appendix D (NEW) | **NEW — Blastware .N00 and .MLG file formats fully decoded.** `minimateplus/blastware_file.py` implements `write_n00()` and `write_mlg()`. N00 file format confirmed: 22B header + 21B STRT record + variable body + 26B footer. Body reconstructed from A5 bulk waveform stream frames with per-frame skip amounts (probe=7+strt_pos+21, A5[1]=13, A5[2+]=12, terminator=11) and DLE strip rule (strip `0x10` before `{0x02,0x03,0x04}`, keep following byte). Footer extracted verbatim from terminator frame's last 26 bytes. Split-pair edge case: when `frame.data[-1]==0x10` and `chk_byte∈{0x02,0x03,0x04}`, reunite both bytes before stripping and always remove trailing chk_byte (`stripped[:-1]`) — chk_byte is checksum, not payload. STRT record must be copied verbatim from A5[0]; bytes [10:20] are device-specific and cannot be reconstructed from Event fields. `write_n00` verified byte-perfect against `M529LIY6.N00` from 4-3-26-multi_event capture. MLG format: 308B header + N×292B records; CRC algorithm unknown (write as 0x0000). | -| 2026-04-21 | Appendix D §D.5 (NEW) | **NEW — Blastware filename encoding fully decoded.** Serial prefix: `chr(ord('B') + floor(serial/1000))` + last 3 digits zero-padded. Stem: 4-char base-36 of `floor(total_seconds/1296)`. Extension: `AB0` for manual/direct downloads (3 chars), `AB0W` or `AB0H` for ACH/call-home downloads (4 chars), where `AB` = 2-char base-36 of `total_seconds % 1296` and W/H = waveform/histogram. Epoch = 1985-01-01 00:00:00 device local time. Confirmed against 3,248 files from 10-year production archive with zero errors. 3-day cycle property: same daily recording time cycles through 3 extensions (864s/day shift, period=3 days). `blastware_filename(event, serial, ach=False)` implements full formula. | -| 2026-04-21 | §7.6.2, §5.3 | **CORRECTED — compliance_raw contains wire-encoded bytes, NOT logical bytes.** S3FrameParser appends DLE+ETX inner-frame pairs as two literal bytes to the frame body. Any `0x03` values in the compliance config appear in `compliance_raw` as `\x10\x03` (two bytes), not as a single `0x03`. The previous claim "S3FrameParser handles this transparently so compliance_raw contains logical (destuffed) bytes" was wrong. Consequence: `compliance_raw` is the wire-encoded E5 payload; anchor-relative reads work correctly because the anchor position automatically accounts for any DLE-encoded bytes before it. For write-back, round-tripping `compliance_raw` verbatim sends the correct wire bytes to the device. **DLE ETX escaping in write frames:** Blastware escapes `0x03` bytes in write frame data as `\x10\x03` on wire; our `build_bw_write_frame` does not (writes data raw). Device is confirmed to accept raw writes for all tested modes — likely uses the offset/length field for write frame framing, not ETX scanning. | -| 2026-04-20 | §7.6.2, §7.9, Appendix B | **CONFIRMED — Geophone maximum range / sensitivity selector byte location.** Two targeted captures (4-20-26, geo sensitivity folder): one at Normal 10.000 in/s, one at Sensitive 1.250 in/s. E5 read payload diff: exactly 3 bytes differ at channel_label+33 for Tran/Vert/Long. Values: `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Same offset applies to the SUB 71 write payload (which is the same 2126-byte E5-format buffer round-tripped verbatim). **`channel_label+20` reads `0x01` in ALL captures regardless of range setting — it is NOT this field.** Previous hypothesis (uint8 at Tran+20, 0x01=Normal) was WRONG. Stored as `geo_range` in `ComplianceConfig`. Encoded to all three geo channel blocks (Tran/Vert/Long) at label+33. | -| 2026-04-20 | §5.1, §5.3, §7.12 (NEW) | **NEW — Auto Call Home config protocol confirmed from 4-20-26 call home settings captures.** SUB 0x2C (Call Home Config READ, response 0xD3, data offset 0x7C=124) and SUB 0x7E/0x7F (WRITE + CONFIRM, response 0x81/0x80) confirmed. Write payload = read payload (125 bytes) + `\x00\x00` (127 bytes total). **DLE-escaped ETX at raw[117:119]:** the device returns logical value 0x03 (num_retries=3) as `\x10\x03` on the wire — S3FrameParser preserves both bytes as two literals, causing a +1 byte shift for all subsequent fields. Write frame sends these bytes verbatim (device interprets `\x10\x03` as literal value 3). Field map confirmed from 10-frame BW TX diff. See §7.12 for full layout. | -| 2026-05-01 | §7.8.2, §7.8.5 (NEW), §7.8.6 (NEW), §7.8.7 (NEW) | **REWRITTEN — SUB 5A bulk waveform stream protocol.** Five BW MITM captures (4-27-26 "open 2sec waveform" + "copy event to disk", 5-1-26 BW 3-sec + 2nd-event + Download All) prove that the previous chunk-counter formula `max(key4[2:4], 0x0400) + (chunk_num-1) * 0x0400` over-reads 5× past the actual event end. BW reads ~12-16 chunks per event at **0x0200 increments (NOT 0x0400)**, bounded by `end_offset` extracted from the STRT record at `data[23:27]` of the first A5 response. **TERM frame formula corrected:** `offset_word = end_offset - next_boundary`, `params[2:4] = next_boundary BE` where `next_boundary = last_chunk_counter + 0x0200`. Verified across 3 events (offsets 0x1ABE, 0x21F2, 0x417E). **Metadata pages 0x1002 / 0x1004** are global, fixed-address device pages containing Project/Client/User Name/Seis Loc/Extended Notes — read ONCE per Blastware session (not per event). **Event-1 vs event-N split:** events at start_key[2:4]=0 use probe@0x0000 + metadata pages + sample chunks at 0x0600 onward; continuation events skip metadata and start at start_key+0x0046. **WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundary markers** — the "Download All" pattern walks 1E/0A/1F to map all event keys+lengths upfront, then downloads each `0x46`-keyed event in turn. Old `stop_after_metadata=True` knob is a workaround for the missing end_offset bound and becomes obsolete under the new walk. See new §7.8.5 / §7.8.6 / §7.8.7 for full details. | -| 2026-05-04 | §7.8.5, §7.8.8 | **CORRECTED — Event-N probe counter is just `start_offset`, NOT `start_offset + 0x0046`.** The `+0x46` formula in the original §7.8.5 was based on calling the off=0x2C boundary key the "start_key", but in the iteration walk `cur_key` passed into `read_bulk_waveform_stream` is always the off=0x46 WAVEHDR record key from 1F (the partial-record skip path in `get_events` re-runs 1F to advance past 0x2C boundary records). Adding +0x46 placed the probe one WAVEHDR past the actual event start; the response no longer contained STRT at byte 17, `parse_strt_end_offset` returned None, and the chunk loop fell back to the `max_chunks=128` cap, walking ~110 chunks of post-event circular-buffer garbage. Confirmed against both the 5-1-26 "copy 2nd address" capture (probe at counter=0x2238 with key=01112238) and the 5-4-26 BW 2-sec event capture. Fixed in protocol.py `read_bulk_waveform_stream` v0.14.1. | -| 2026-05-05 | §7.8.1 (rule #3 added) | **CONFIRMED — Partial DLE stuffing of `0x10` bytes in 5A params region.** The device's de-stuffing rule for the SUB 5A params region is: `10 10` → `10`, `10 02/03/04` → kept literal (inner-frame markers), `10 X` for any other X → de-stuffs to just `X` (drops the `0x10`). Therefore any `0x10` byte in the logical params followed by a byte NOT in {0x02, 0x03, 0x04, 0x10} MUST be doubled on the wire. This affects counters with `0x10` in the high byte — most importantly counter=`0x1000`, where logical params bytes `... 10 00 ...` were being sent raw and the device de-stuffed `10 00` to just `00`, returning the response for counter=0x0000 (= the file header + STRT). That STRT block then ended up embedded in the assembled file body at file offset `0x1016` and Blastware refused to open the file. This was the root cause of the long-standing ">1-sec event 0 won't open in BW" pattern (1-sec events worked because their `end_offset < 0x1000`, so no chunk request ever needed counter `0x10__`). All 17 5A request frames in the 5-1-26 bwcap3sec capture (probe + 2 meta + 13 samples + TERM) now match BW byte-for-byte after the fix. Fixed in framing.py `build_5a_frame` v0.14.3. | -| 2026-05-05 | §7.8 / Blastware file format | **CONFIRMED — File body assembly is contiguous concatenation, no de-duplication.** The "duplicate header+STRT strip" hack from v0.13.x was actively destroying valid waveform data — sample chunks at counter `0x1000` and beyond often coincidentally contain the byte sequence `00 12 03 00 STRT` in their delta-encoded ADC stream, and the strip was zeroing 25 bytes per match. Removed in v0.14.2. The correct file body is: probe contribution + meta@0x1002 + meta@0x1004 + sample contributions in stream order + TERM contribution. Verified byte-perfect against BW reference `M529LKIQ.G10` (8708 bytes, 0 differences) when fed the same A5 frames as the BW capture. | - ---- - -## 1. Physical Layer - -| Parameter | Value | Certainty | -|---|---|---| -| Interface | RS-232 serial | ✅ CONFIRMED | -| Baud rate | 38400 | ✅ CONFIRMED (from bridge log header) | -| Data bits | 8 | ✅ CONFIRMED (standard for this baud/era) | -| Parity | None | 🔶 INFERRED (no parity errors observed) | -| Stop bits | 1 | 🔶 INFERRED (standard assumption) | -| Flow control | None (no RTS/CTS activity) | 🔶 INFERRED | - ---- - -## 2. Frame Structure -> ⚠️ **2026-02-26 — CORRECTED:** Previous version incorrectly identified `0x41` as STX and `0x02`/`0x03` as bare frame delimiters. The protocol uses proper **DLE framing**. See below. - -Frame structure is asymmetric — BW→S3 (requests we send) and S3→BW (device replies) -use slightly different framing markers, both terminated by a **bare** `0x03` ETX: - -``` -BW→S3 (our requests): [ACK=0x41] [STX=0x02] [stuffed payload + chk] [ETX=0x03] -S3→BW (device replies): [DLE=0x10] [STX=0x02] [stuffed payload + chk] [ETX=0x03] -``` - -**Critical:** The outer frame terminator is a **bare ETX (`0x03`), not `DLE+ETX`.** S3 -responses contain inner sub-frames (notably inside SUB A4 POLL_RESPONSE and SUB E5 -compliance reads) that use `DLE+ETX` (`0x10 0x03`) as *inner-frame* terminators — the -outer parser preserves both bytes as literal payload data when it sees `DLE+ETX` and -only ends the frame on a bare ETX. See §10 (parser state machine) and the -`S3FrameParser` docstring in `minimateplus/framing.py`. - -### Special Byte Definitions - -| Token | Raw Bytes | Meaning | Certainty | -|---|---|---|---| -| ACK | `0x41` (ASCII `'A'`) | Acknowledgment / ready token. Standalone single byte; often precedes frames. | ✅ CONFIRMED | -| DLE | `0x10` | Data Link Escape. Prefixes the next byte to give it special meaning. | ✅ CONFIRMED — 2026-02-26 | -| STX (BW→S3) | `0x02` (bare) | BW-side start marker — preceded by ACK, not by DLE | ✅ CONFIRMED | -| STX (S3→BW) | `0x10 0x02` | DLE+STX device-side start-of-frame | ✅ CONFIRMED | -| ETX | `0x03` (bare) | End-of-frame terminator in BOTH directions; `DLE+ETX` inside a frame body is an inner sub-frame terminator preserved as literal payload | ✅ CONFIRMED | -| CHECKSUM | 1 byte | Sits between payload and the bare ETX. Two variants — see §11 (standard SUM8 for reads, DLE-aware large-frame for writes / SUB 5A). | ✅ CONFIRMED | - -### DLE Byte Stuffing Rule -> ✅ CONFIRMED — 2026-02-26 - -Any `0x10` byte appearing **naturally in the payload data** is escaped by doubling it: `0x10` → `0x10 0x10`. This prevents the parser from confusing real data with frame control sequences. - -- **Transmit:** Replace every `0x10` in payload with `0x10 0x10` -- **Receive:** Replace every `0x10 0x10` in the frame body with a single `0x10` - -| Sequence on wire | Meaning | -|---|---| -| `0x10 0x02` | Frame START — only valid at beginning | -| `0x10 0x03` | Frame END | -| `0x10 0x10` | Escaped literal `0x10` byte in payload data | -| Any other `0x10 0xXX` | Protocol error / undefined | - -### Frame Parser Notes - -- The `0x41` ACK **may arrive in a separate `read()` call** before the frame body due to RS-232 inter-byte timing or TCP segmentation. The S3 parser treats stray ACK bytes as no-ops while idle. -- Your parser must be **stateful and buffered** — read byte by byte, accumulate after STX, terminate on a bare ETX. Never assume one `read()` = one frame. -- `DLE+ETX` inside a frame body is treated as inner-frame data and appended literally; only a bare ETX ends the outer frame. -- Checksum is computed on the **de-stuffed** payload for standard reads. SUB 5A and write frames use a DLE-aware variant (see §11). -- ACK and the STX bytes are **not** included in the checksum. - -### Checksum Verification Example - -Raw S3→BW POLL probe response wire bytes: -``` -10 02 | 10 00 A4 00 00 00 ... [stuffed payload + chk] ... | 03 -^STX^ ^ETX^ -``` - -After de-stuffing (`0x10 0x10` → `0x10`), the payload is checksum-validated using -the formula from §11. The bare ETX terminates the frame. - ---- - -## 3. Payload Structure - -> ✅ **CONFIRMED 2026-03-30** — field positions verified bit-for-bit against -> `bridges/captures/3-11-26/raw_bw_*.bin`. The earlier "[CMD][DLE][ADDR]…" layout -> that called bytes [1] and [2] both `0x10` was wrong — byte [1] is `flags` -> (`0x00` for BW requests, `0x10` for S3 responses) and byte [2] is the SUB byte. - -The payload (between STX and the checksum, after de-stuffing) is a 16-byte fixed -header for read commands. BW→S3 and S3→BW use the **same field layout** but -swap the values in bytes [0] and [1]: - -``` -BW→S3 (request): S3→BW (response): - [0] BW_CMD 0x10 [0] CMD 0x00 - [1] flags 0x00 [1] flags 0x10 - [2] SUB command [2] SUB 0xFF − request_SUB - [3] 0x00 always [3] PAGE_HI (probe responses: 0x00) - [4] 0x00 always [4] PAGE_LO (probe responses: 0x00) - [5] OFFSET probe:0x00; data:DATA_LENGTH - [5+] data response body - [6:16] params 10-byte field -``` - -| Field | Position | Notes | Certainty | -|---|---|---|---| -| BW_CMD / CMD | byte 0 | `0x10` in BW→S3 requests; `0x00` in S3→BW responses. The `0x10` is the only byte DLE-stuffed in write frames. | ✅ CONFIRMED | -| flags | byte 1 | `0x00` in BW→S3; `0x10` in S3→BW. The byte pattern that earlier docs read as "ADDR" was actually flags. | ✅ CONFIRMED — 2026-03-30 | -| SUB | byte 2 | Command/response selector. Response SUB = `0xFF − request SUB`. | ✅ CONFIRMED | -| OFFSET (requests) | byte 5 | `0x00` for the probe step; `DATA_LENGTH` (hardcoded constant — see §4.2 and §5.1) for the data fetch step. Bytes [3] and [4] are always `0x00` in requests. | ✅ CONFIRMED — 2026-03-30 | -| PAGE_HI / PAGE_LO (responses) | bytes 3–4 | Observed as `0x00 0x00` in probe responses. For chunked data reads (SUB E5, SUB A5) carries the page key / chunk address. | ✅ CONFIRMED | -| params (requests) | bytes 6–15 | 10-byte parameter field; per-SUB structure (event keys, tokens, channel selectors, chunk addresses). | ✅ CONFIRMED | -| data (responses) | bytes 5+ | Response body. For two-step data fetches the actual record begins at `data[11]` after a fixed 11-byte echo header — see §7.7.4. | ✅ CONFIRMED | - -> The only `0x10` byte in a BW request payload is `BW_CMD` at `[0]`. Other `0x10` -> bytes may appear in the `OFFSET` field (e.g. offset_hi=0x10 for compliance writes) -> or in `params` (notably SUB 5A chunk counters). DLE-stuffing of these `0x10` bytes -> on the wire varies by command — see §5.3 (write frames) and §7.8.1 (SUB 5A). - ---- - -## 4. Communication Pattern - -### 4.1 ACK Handshake (Every Transaction) - -``` -Side A → 0x41 (ACK: "ready / received") -Side A → 10 02 [payload] [chk] 10 03 (frame) -Side B → 0x41 (ACK) -Side B → 10 02 [payload] [chk] 10 03 (response frame) -``` - -### 4.2 Two-Step Paged Read Pattern - -> ✅ **CORRECTED 2026-03-30** — earlier description claimed the probe response carries -> the data length in `PAGE_HI`/`PAGE_LO`. It does NOT. The S3 probe response has both -> bytes `0x00`. **Data lengths are hardcoded constants per SUB** — see the `DATA_LENGTHS` -> dict in `minimateplus/protocol.py` and the per-SUB column in §5.1. - -All data reads use a two-step pattern. It is not optional — sending the data -fetch without the probe causes the device to ignore the request. - -``` -Step 1 — Probe (BW: offset=0 in payload[5]): - BW → 41 02 10 10 00 [SUB] 00 00 00 00 [params×10] [chk] 03 - S3 → 10 02 00 10 [RSP] 00 00 [zeroed body] [chk] 03 - (probe ack — PAGE_HI=PAGE_LO=0x00, no length info) - -Step 2 — Data fetch (BW: offset=DATA_LENGTH in payload[5]): - BW → 41 02 10 10 00 [SUB] 00 00 [DATA_LENGTH] [params×10] [chk] 03 - S3 → 10 02 00 10 [RSP] 00 00 [DATA…] [chk] 03 -``` - -Implementations must use the per-SUB `DATA_LENGTH` constant (see §5.1) — there is -no length negotiation step. The two-step nature serves an arming purpose on the -device side, not length discovery. - ---- - -## 5. Command Reference Table - -### 5.1 Request Commands (Blastware → S3) - -| SUB Byte | Name | Description | Certainty | -|---|---|---|---| -| `5B` | **POLL / KEEPALIVE** | Sent continuously (~every 80ms). Requests device identity/status. | ✅ CONFIRMED | -| `15` | **SERIAL NUMBER REQUEST** | Requests device serial number. | ✅ CONFIRMED | -| `01` | **FULL CONFIG READ** | Requests complete device configuration block (~0x98 bytes). Firmware, model, serial, channel config, scaling factors. | ✅ CONFIRMED | -| `08` | **EVENT INDEX READ** | Requests the event record index (0x58 bytes). Event count and record pointers. | ✅ CONFIRMED | -| `06` | **EVENT STORAGE RANGE READ** | Requests event storage range block (0x24 = 36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (`[-8:-4]`) and last stored event key (`[-4:]`). Both equal `01110000` when device is empty. Used by Blastware as part of the erase-all verification step. Previously labelled "CHANNEL CONFIG READ" — function now confirmed from 4-11-26 MITM capture. | ✅ CONFIRMED 2026-04-11 | -| `1E` | **EVENT HEADER READ** | Gets first waveform key. Token byte at params[7] (0x00=browse, 0xFE=download-arm). Key at data[11:15]; trailing offset at data[15:19] (0 = only one event). Two uses: (1) all-zero to get key0; (2) token=0xFE after 0A, before 0C — REQUIRED to arm device for SUB 5A. | ✅ CONFIRMED 2026-04-06 | -| `0A` | **WAVEFORM HEADER READ** | Checks record type for a given waveform key. Variable DATA_LENGTH at `data_rsp.data[5]`: **`0x46` (= 70 bytes) = real triggered event start**; **`0x2C` (= 44 bytes) = boundary marker / monitor-log partial record**. Key at params[4..7]. Required before every 1F call to establish device waveform context. Used by the "Download All" walk (§7.8.8) to map real events vs boundary keys. | ✅ CONFIRMED 2026-05-01 | -| `0C` | **FULL WAVEFORM RECORD** | Downloads 210-byte waveform/histogram record. Sub_code at byte[1]: 0x10=Waveform (9-byte timestamp hdr), 0x03=Waveform-continuous (10-byte hdr, 1-byte shift). PPV floats at label+6 (search "Tran"/"Vert"/"Long"/"MicL"). Peak Vector Sum at tran_label−12 (NOT fixed offset). Key at params[4..7], DATA_LENGTH=0xD2. | ✅ CONFIRMED 2026-04-03 | -| `1F` | **EVENT ADVANCE** | Advances to next waveform key. Token byte at params[7] (⚠️ NOT params[6]): 0x00=browse (all-zero params), 0xFE=download (arm 5A state machine). Returns next key at data[11:15]; null sentinel when data[15:19]=0x00000000. Requires preceding 0A to establish context. Browse 1F must ONLY be called after successful 5A — calling it after a failed 5A disrupts device state for the next event's 5A probe. | ✅ CONFIRMED 2026-04-06 | -| `5A` | **BULK WAVEFORM STREAM** | Bulk download of raw ADC sample data. Non-standard frame format: offset_hi=0x10 sent raw (not DLE-stuffed), DLE-aware checksum, **partial DLE stuffing of 0x10 in params** (`10 X` where X∉{02,03,04,10} must be doubled to `10 10 X` — see §7.8). Requires 1E-arm + 0C + 1F(0xFE) + POLL×3 before first probe. Walk: probe at counter=`start_offset` (event 1: 0x0000) → metadata pages 0x1002 + 0x1004 (event 1 only) → sample chunks at 0x0600, 0x0800, …, step 0x0200, bounded by `end_offset` parsed from STRT@data[17] of probe response → TERM frame at residual offset_word. Project:/Client:/User Name:/Seis Loc: live in the metadata pages, NOT in the sample-chunk stream. | ✅ CONFIRMED 2026-05-05 (BYTE-PERFECT vs BW capture) | -| `24` | **WAVEFORM PAGE A?** | Paged waveform read, possibly channel group A. | 🔶 INFERRED | -| `25` | **WAVEFORM PAGE B?** | Paged waveform read, possibly channel group B. | 🔶 INFERRED | -| `09` | **UNKNOWN READ A** | Read command, response (`F6`) returns 0xCA (202) bytes. Purpose unknown. | 🔶 INFERRED | -| `1A` | **COMPLIANCE CONFIG READ** | Multi-step sequence (A+B+C+D frames). Response (E5) carries recording_mode (uint8 at **anchor − 8** — same offset in read AND write, confirmed 2026-04-21), sample_rate (uint16 BE at anchor − 6), histogram_interval_sec (uint16 BE at anchor − 4), record_time (float32 BE at anchor + 6), trigger/alarm/max_range floats, and project strings. **Anchor: 6-byte `\xbe\x80\x00\x00\x00\x00`**, search `cfg[0:150]`. Total ~2126 cfg bytes. See §7.6.4 for recording_mode enum. | ✅ CONFIRMED 2026-04-02; recording_mode offset corrected 2026-04-21 | -| `2E` | **UNKNOWN READ B** | Read command, response (`D1`) returns 0x1A (26) bytes. Purpose unknown. | 🔶 INFERRED | -| `0E` | **CHANNEL SENSOR DATA** | Real-time sensor reading for one channel. Two-step read, data length 0x0A (10 bytes). Channel selector in params[6:8] (0x0000–0x0007 for 8 channels). Response (F1) carries amplitude, frequency, overswing data for that channel. Used by Blastware "Unit Channel Test" comms check. | ✅ CONFIRMED 2026-04-08 | -| `98` | **TRIGGER TEST** | Trigger-test command. Single probe frame; `params[0] = 0xFF`. Response (0x67) is all-zero data. Sent twice per Blastware comms-check cycle. Not a full POLL, no monitor state change. | ✅ CONFIRMED 2026-04-08 | -| `1C` | **MONITOR STATUS READ** | Two-step read, data offset 0x2C (44 bytes). `section[1] == 0x10` → monitoring; `0x00` → idle (CONFIRMED 2026-04-09, 100% accuracy on 144 frames). Payload length: 46–47 bytes IDLE, 48–49 bytes MONITORING. `frame.data` has checksum stripped — no trailing byte to skip. Battery/memory at end: `section[-10:-8]` = battery×100 (uint16 BE), `section[-8:-4]` = memory_total (uint32 BE), `section[-4:]` = memory_free (uint32 BE). | ✅ CONFIRMED 2026-04-09 | -| `96` | **START MONITORING** | Single write frame, no data payload. Transitions unit from idle to monitoring mode (after optional on-device sensor check ~40 s). | ✅ CONFIRMED 2026-04-08 | -| `97` | **STOP MONITORING** | Single write frame, no data payload. Stops monitoring, unit returns to idle. | ✅ CONFIRMED 2026-04-08 | -| `2C` | **CALL HOME CONFIG READ** | Two-step read, data offset 0x7C (124 bytes + 1-byte DLE artefact = 125 raw bytes). Returns Auto Call Home configuration: enable flag, dial string, scheduled call times, retry settings, modem timing. Response SUB = 0xD3. **DLE note:** logical value 0x03 (num_retries) is returned as `\x10\x03` on the wire, which S3FrameParser preserves as two literal bytes — this shifts all subsequent field positions by +1. See §7.12 for full field map. | ✅ CONFIRMED 2026-04-20 | -| `A3` | **ERASE ALL BEGIN** | Single frame, token=0xFE at params[7]. Initiates device memory erase. Must be followed by 0x1C probe+data + 0x06 probe+data + 0xA2 to complete. Standard `build_bw_frame` (not write-format). Response ack SUB = 0x5C. | ✅ CONFIRMED 2026-04-11 | -| `A2` | **ERASE ALL CONFIRM** | Single frame, token=0xFE at params[7]. Commits the erase initiated by 0xA3. After this ack (SUB 0x5D), device memory is cleared and the event counter resets to `0x01110000`. | ✅ CONFIRMED 2026-04-11 | - -All requests use CMD byte `0x02`. All responses use CMD byte `0x10 0x02` (which, after de-stuffing, is just the DLE+CMD combination — see §3). - -### 5.2 Response SUB Bytes (S3 → Blastware) - -> 🔶 **INFERRED pattern:** Response SUB = `0xFF - Request SUB`. Verified on all observed pairs to date — no counterexample has been observed across read commands, write commands, or either unit. Confidence is high but not formally proven across the full command space. - -| Request SUB | Response SUB | Certainty | -|---|---|---| -| `5B` | `A4` | ✅ CONFIRMED | -| `15` | `EA` | ✅ CONFIRMED | -| `01` | `FE` | ✅ CONFIRMED | -| `08` | `F7` | ✅ CONFIRMED | -| `06` | `F9` | ✅ CONFIRMED 2026-04-11 | -| `1C` | `E3` | ✅ CONFIRMED 2026-04-08 | -| `1E` | `E1` | ✅ CONFIRMED | -| `0A` | `F5` | ✅ CONFIRMED | -| `0C` | `F3` | ✅ CONFIRMED | -| `5A` | `A5` | ✅ CONFIRMED | -| `1F` | `E0` | ✅ CONFIRMED 2026-03-31 | -| `09` | `F6` | ✅ CONFIRMED | -| `1A` | `E5` | ✅ CONFIRMED | -| `2E` | `D1` | ✅ CONFIRMED | -| `0E` | `F1` | ✅ CONFIRMED 2026-04-08 | -| `98` | `67` | ✅ CONFIRMED 2026-04-08 | -| `96` | `69` | ✅ CONFIRMED 2026-04-08 | -| `97` | `68` | ✅ CONFIRMED 2026-04-08 | -| `2C` | `D3` | ✅ CONFIRMED 2026-04-20 | -| `A3` | `5C` | ✅ CONFIRMED 2026-04-11 | -| `A2` | `5D` | ✅ CONFIRMED 2026-04-11 | - ---- - -### 5.3 Write Commands (Blastware → Device) - -> ✅ **CONFIRMED — 2026-02-26** from compliance setup capture (session `185019`); -> framing mechanics confirmed 2026-04-07 from `bridges/captures/3-11-26/raw_bw_*_170151.bin`. - -Write commands are initiated by Blastware (`BW→S3`) and use SUB bytes in the `0x60`–`0x83` range. The device acknowledges each write with a short response frame containing no data payload (17 bytes total wire including framing). - -**Pattern:** Write SUB = Read SUB + `0x60` (e.g. `0x08` EVENT INDEX READ → `0x68` EVENT INDEX WRITE). - -#### Write frame format — minimal DLE stuffing - -Write frames do **NOT** use the full DLE stuffing that read frames do. Only the -`BW_CMD` byte at payload position `[0]` is doubled on the wire — all other bytes -(flags, SUB, offset, params, data, checksum) are written **raw**, even when they -contain `0x10`. See `build_bw_write_frame()` in `minimateplus/framing.py`. - -``` -Wire layout: - [41] ACK - [02] STX - [10 10] BW_CMD doubled (the ONLY DLE stuffing applied) - [00] flags - [SUB] write command byte (0x68–0x83) - [00] always zero - [hi][lo] offset uint16 BE — RAW (not stuffed even if hi=0x10) - [params] 10 bytes — RAW - [data] variable-length write payload — RAW (0x10 bytes not stuffed) - [chk] checksum — RAW (not stuffed even if 0x10) - [03] ETX -``` - -Total wire length = `21 + len(data)` bytes. - -#### Write frame checksum - -All write frames use the **large-frame DLE-aware checksum**: - -```python -chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) & 0xFF -``` - -This sums payload bytes from `SUB` onward, skipping every `0x10` byte, then adds -`0x10` as a constant. The same formula is used for confirm frames (data=`b""`), -since they contain no embedded `0x10` bytes and degrade to the standard SUM8. - -#### Single-chunk write offset formula - -For write payloads that fit in one frame (SUBs `0x68`, `0x69`, `0x82`, `0x7E`): - -``` -offset = data[1] + 2 -``` - -`data[0:2]` is a 2-byte header `[0x00][length]`. The offset on the wire encodes -that embedded length + 2. Confirmed across all single-chunk writes in the -3-11-26 capture (`0x68`: 0x5A, `0x82`: 0x1C, `0x69`: 0xCA, `0x7E`: 0x7E). - -#### Write ack response format - -Every device ack for a write command is a **17-byte zero-data S3 frame**: - -``` -[DLE=0x10] [STX=0x02] [stuffed header + chk] [bare ETX=0x03] -``` - -Data section is zeros; `RSP_SUB = 0xFF − write_request_SUB`. - -#### SUB 71 — multi-chunk compliance write - -The compliance config payload (~2128 bytes) is split into **exactly 3 chunks**. -Confirmed from 3-11-26 BW TX frames 104–108: - -| Chunk | Size | `offset` | `params` (10 bytes hex) | -|---|---|---|---| -| 1 (first) | 1027 bytes | `0x1004` | `00 00 00 00 00 00 00 00 00 00` | -| 2 (middle) | 1055 bytes | `0x1004` | `00 00 00 10 04 00 00 00 00 00` | -| 3 (last) | remainder | `0x002C` | `00 00 08 00 00 00 00 00 00 00` | - -After all three chunks are acked (`0x8E` each), send SUB `72` confirm → device acks `0x8D`. - -#### Full write sequences - -``` -Compliance setup push: 68 → 73 | 71 ×3 → 72 | 82 → 83 | 69 → 74 → 72 -Auto Call Home push: 7E → 7F -``` - -| SUB | Name | Description | Response SUB | Certainty | -|---|---|---|---|---| -| `68` | **EVENT INDEX WRITE** | Writes event index block (mirrors SUB `08` read). Contains event count and timestamps. | `97` | ✅ CONFIRMED | -| `69` | **WAVEFORM DATA WRITE** | Writes large waveform/channel data block (0xCA bytes, mirrors SUB `09`). | `96` | ✅ CONFIRMED | -| `71` | **COMPLIANCE / PROJECT STRINGS WRITE** | Writes compliance config and all project string fields. Contains setup name, project, client, operator, sensor location, and extended notes. Also contains channel scaling floats and `0x082A` threshold value. | `8E` | ✅ CONFIRMED | -| `72` | **WRITE CONFIRM A** | Short frame, no data. Likely commit/confirm step after `71`. | `8D` | ✅ CONFIRMED | -| `73` | **WRITE CONFIRM B** | Short frame, no data. | `8C` | ✅ CONFIRMED | -| `74` | **WRITE CONFIRM C** | Short frame, no data. | `8B` | ✅ CONFIRMED | -| `7E` | **CALL HOME CONFIG WRITE** | Writes Auto Call Home configuration (127 bytes: 125-byte read payload + `\x00\x00`). Offset = data[1]+2 = 0x7E. Write format (DLE-aware checksum, only BW_CMD `0x10` doubled on wire). Response SUB = 0x81. Must be followed by SUB 0x7F confirm. | `81` | ✅ CONFIRMED 2026-04-20 | -| `7F` | **CALL HOME WRITE CONFIRM** | Short frame, no data. Commits call home config write from SUB 0x7E. Response SUB = 0x80. | `80` | ✅ CONFIRMED 2026-04-20 | -| `82` | **TRIGGER CONFIG WRITE** | Writes trigger config block (0x1C bytes, mirrors SUB `1C` read). | `7D` | ✅ CONFIRMED | -| `83` | **TRIGGER WRITE CONFIRM** | Short frame, no data. Likely commit step after `82`. | `7C` | ✅ CONFIRMED | - -**Write response SUB pairs** follow the same `0xFF - request` rule: - -| Write SUB | Response SUB | -|---|---| -| `68` | `97` | -| `69` | `96` | -| `71` | `8E` | -| `72` | `8D` | -| `73` | `8C` | -| `74` | `8B` | -| `7E` | `81` | -| `7F` | `80` | -| `82` | `7D` | -| `83` | `7C` | - ---- - -## 6. Session Startup Sequence - -``` -1. Device powers on / resets -2. S3 → "Operating System" (raw ASCII, no DLE framing — UART boot string) -3. BW → 0x41 + POLL frame (SUB 5B) -4. S3 → 0x41 + POLL RESPONSE (SUB A4, reports data length = 0x30) -5. BW → 0x41 + POLL frame (SUB 5B, offset = 0x30) -6. S3 → 0x41 + POLL RESPONSE with data: "Instantel" + "MiniMate Plus" -7. BW → SUB 15 → serial number -8. BW → SUB 01 → full config block -9. BW → SUB 1A → compliance config (4-frame sequence: A+B+C+D) -10. BW → SUB 08 → event index -11. BW → SUB 06 → event storage range (used during erase verification; see §7.11) -``` - -### 6.1 Event Download Sequence (per-event, confirmed from 4-2-26 + 4-3-26 BW captures) - -``` -# Once per session: -BW → SUB 1E (all-zero params) → key0, trailing0 - -# Per event (repeat until null sentinel data[15:19]=0x00000000): -BW → SUB 0A (key) ← REQUIRED before every 1F; establishes device context -BW → SUB 1E (token=0xFE) ← REQUIRED arm step; must be BETWEEN 0A and 0C -BW → SUB 0C (key) ← read waveform record (peaks, timestamp, project) -BW → SUB 1F (token=0xFE) ← arm 5A state machine; do NOT use returned key -BW → SUB 5B × 3 ← REQUIRED: 3 full POLL probe+data cycles before 5A -BW → SUB 5A (key) ← bulk waveform stream (A5 frames) -# IF 5A succeeded: -BW → SUB 1F (all-zero) → next_key ← use this for loop iteration -# IF 5A failed/timed out: -# Do NOT send 1F(browse) — use cached key from 1F(token=0xFE) above instead -``` - -**Null sentinel:** `data[15:19] == b"\x00\x00\x00\x00"` in both 1E and 1F responses. -Do NOT use `data[11:15]` (key) as sentinel — event 0 has key=0x00000000. - ---- - -## 7. Known Data Payloads - -> 📑 **Navigation note (2026-05-20):** §7 grew organically and contains some -> duplicate section numbers — most notably **§7.5 / §7.5b** (waveform record), -> **§7.6 / §7.7 / §7.8 / §7.9** appear twice each. Sections that re-use a -> number are clearly banner-marked as either DEPRECATED (the old `0x0400`-step -> SUB 5A protocol) or as alternate-context views of the same SUB. **Always -> consult the most recent dated subsection when sections appear to conflict.** -> Canonical SUB 5A walk is in §7.8.5–§7.8.8; canonical compliance config layout -> is in §7.6 / §7.6.1 / §7.6.3 / §7.6.4. - -### 7.1 Poll Response (SUB A4) — Device Identity Block / Composite Container - -> ⚠️ **SUB A4 is a composite container frame.** The large A4 payload (~3600+ bytes) contains multiple embedded inner sub-frames using the same DLE framing as the outer protocol (`10 02` start, `10 03` end, `10 10` stuffing). Inner frames carry WRITE_CONFIRM_RESPONSE and TRIGGER_CONFIG_RESPONSE sub-frames among others. Flat byte-by-byte diffing of A4 is unreliable due to phase shifting — use inner-frame-aware diffing (`_diff_a4_payloads()` in s3_analyzer.py). Confirmed 2026-03-11. - -Two-step read. Data payload = 0x30 bytes. - -``` -Offset 0x00: 0x08 — string length prefix -Offset 0x01: "Instantel" — manufacturer (null-padded to ~20 bytes) -Offset 0x15: "MiniMate Plus" — model name (null-padded to ~20 bytes) -``` - -Raw payload (after de-stuffing): -``` -00 00 00 08 49 6E 73 74 61 6E 74 65 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 -4D 69 6E 69 4D 61 74 65 20 50 6C 75 73 00 00 00 00 00 00 00 00 00 -``` - -### 7.2 Serial Number Response (SUB EA) - -Data payload = 0x0A bytes: -``` -"BE18189\x00" — 7 ASCII bytes + null terminator (8 bytes) -79 11 — 2 trailing bytes -``` - -| Trailing Byte | Value (Unit 1) | Value (Unit 2) | Meaning | Certainty | -|---|---|---|---|---| -| `trail[0]` | `0x79` | `0x70` | Unit-specific — factory calibration ID or HW stamp? | ❓ SPECULATIVE | -| `trail[1]` | `0x11` | `0x11` | Firmware minor version — `0x11` = 17 = `S337.**17**` | ✅ CONFIRMED — 2026-02-26 | - -Two-unit comparison data: -``` -Unit 1: serial="BE18189" trail=79 11 firmware=S337.17 -Unit 2: serial="BE11529" trail=70 11 firmware=S337.17 -``` - -> ✅ **2026-02-26 — CORRECTED:** Previously documented as `79 11 20` (3 bytes). `0x20` is the **frame checksum**, not payload data. Actual data block is exactly 10 bytes (`0x0A`). - -> ✅ **2026-02-26 — CONFIRMED:** `trail[1]` = firmware minor version. Both units share firmware `S337.17` → minor = 17 = `0x11`. Will change if firmware differs between units. - -> ❓ **Still unknown:** `trail[0]` is unit-specific. Does not derive from serial string via sum, XOR, or modulo. Possibly written at factory calibration. Needs a third unit or write-command capture to determine. - -### 7.3 Full Config Response (SUB FE) — 0x98 bytes - -| Offset | Raw | Decoded | Certainty | -|---|---|---|---| -| 0x00 | `42 45 31 38 31 38 39 00` | `"BE18189\x00"` — Serial number | ✅ CONFIRMED | -| 0x08 | `79 11` | Unknown — possibly HW revision or calibration stamp | ❓ SPECULATIVE | -| 0x0A | `00 01` | Unknown flags | ❓ SPECULATIVE | -| 0x14 | `3F 80 00 00` | IEEE 754 float = **1.0** (Tran scale factor) | 🔶 INFERRED | -| 0x18 | `41 00 00 00` | IEEE 754 float = **8.0** (unknown — MicL range?) | 🔶 INFERRED | -| 0x1C | `3F 80 00 00` ×6 | IEEE 754 float = **1.0** ×6 (remaining channel scales) | 🔶 INFERRED | -| 0x34 | `53 33 33 37 2E 31 37 00` | `"S337.17\x00"` — Firmware version | ✅ CONFIRMED | -| 0x3C | `31 30 2E 37 32 00` | `"10.72\x00"` — DSP / secondary firmware version | ✅ CONFIRMED | -| 0x53 | varies | Likely calibration day or time field — 0x15 (BE18189), 0x1D (BE11529) | 🔶 INFERRED | -| 0x54 | `10` | Calibration month — BCD `0x10` = October (both units) | 🔶 INFERRED | -| 0x55 | varies | Calibration day — `0x02` (BE18189), `0x04` (BE11529) | 🔶 INFERRED | -| 0x56–0x57 | `07 E7` / `07 E9` | Calibration year — uint16 BE. `0x07E7`=2023, `0x07E9`=2025 | ✅ CONFIRMED — 2026-03-31 | -| 0x44 | `49 6E 73 74 61 6E 74 65 6C...` | `"Instantel"` — Manufacturer (repeated) | ✅ CONFIRMED | -| 0x6D | `4D 69 6E 69 4D 61 74 65 20 50 6C 75 73` | `"MiniMate Plus"` — Model name | ✅ CONFIRMED | - -### 7.4 Event Index Response (SUB F7) — 0x58 bytes - -> ✅ **2026-03-02 — CONFIRMED:** Backlight and power save offsets confirmed via two independent captures with device-set values. Offsets are from the start of the **data section** (after the 16-byte protocol header). - -**Layout (offsets relative to data section start):** - -``` -Offset +00: 00 58 09 — Total index size or record count ❓ -Offset +03: 00 00 00 01 — Possibly stored event count = 1 ❓ -Offset +07: 01 07 CB 00 06 1E — Timestamp of event 1 (see §8) -Offset +0D: 01 07 CB 00 14 00 — Timestamp of event 2 (see §8) -Offset +13: 00 00 00 17 3B — Unknown ❓ -Offset +4B: [backlight] — BACKLIGHT ON TIME ✅ CONFIRMED -Offset +4C: 00 — padding (backlight is uint8, not uint16) -Offset +53: [power_save] — POWER SAVING TIMEOUT ✅ CONFIRMED -Offset +54: [lcd_hi] [lcd_lo] — MONITORING LCD CYCLE (uint16 BE) ✅ CONFIRMED -``` - -| Offset | Size | Type | Known values | Meaning | Certainty | -|---|---|---|---|---|---| -| +4B | 1 | uint8 | 250, 100 | **BACKLIGHT ON TIME** (0–255 seconds per manual) | ✅ CONFIRMED | -| +4C | 1 | — | 0x00 | Padding / high byte of potential uint16 | 🔶 INFERRED | -| +53 | 1 | uint8 | 10, 30 | **POWER SAVING TIMEOUT** (minutes) | ✅ CONFIRMED | -| +54..+55 | 2 | uint16 BE | 0xFFDC = 65500 | **MONITORING LCD CYCLE** (seconds; 65500 ≈ disabled/max) | ✅ CONFIRMED | - -**Confirmation captures:** - -| Capture | Backlight (+4B) | Power Save (+53) | LCD Cycle (+54/55) | -|---|---|---|---| -| `20260301_160702` (BW-written) | `0xFA` = 250 | `0x0A` = 10 min | `0xFF 0xDC` = 65500 | -| `20260302_144606` (device-set) | `0x64` = 100 | `0x1E` = 30 min | `0xFF 0xDC` = 65500 | - -> 📖 **Manual cross-reference (716U0101 Rev 15, §3.13.1):** -> - Backlight On Time: "adjustable timer, from 0 to 255 seconds" (§3.13.1e) -> - Power Saving Timeout: "automatically turns the Minimate Plus off" — stored in minutes (§3.13.1f) -> - Monitoring LCD Cycle: "cycles off for the time period... set to zero to turn off" — 65500 = effectively disabled (§3.13.1g) - -### 7.5 Full Waveform Record (SUB F3) — 0xD2 bytes × 2 pages - -> ✅ **2026-02-26 — UPDATED:** Project strings field layout confirmed by diffing compliance setup write payload (SUB `71`). Client field change `"Hello Claude"` → `"Claude test2"` isolated exact byte position. - -**Project strings field layout** (confirmed from SUB `71` write frame, offset +230 from frame start): - -``` -Offset Field label (null-padded, ~16 bytes) Field value (null-padded, ~32 bytes) ------- ------------------------------------ ------------------------------------ -+0x00 "Standard Recording Setup" ← setup name (no label) -+0x28 "Project:" project description string -+0x50 "Client:" client name string ← confirmed at +230 -+0x78 "User Name:" operator name string -+0xA0 "Seis Loc:" sensor location string -+0xC8 "Extended Notes" notes string -``` - -> 🔶 Offsets are approximate — exact byte boundaries need one more targeted capture with a known-length string change to pin down padding rules. - -Confirmed ASCII strings extracted from payload: - -``` -"Project:" -"I-70 at SR 51-75978 - Loc 1 - 4256 SR51 " ← project description -"BE18189" ← serial number -"Histogram" ← record type -"Standard Recording Setup" ← setup name -"Client:" -"Golden Triangle" ← client name -"User Name:" -"Terra-Mechanics Inc. - B. Harrison" ← operator -"Seis Loc:" -"Location #1 - 4256 SR 51 - Intec" ← sensor location -"Extended Notes" -"Tran" ← Transverse channel -"Vert" ← Vertical channel -"Long" ← Longitudinal channel -"MicL" ← Microphone / air overpressure -``` - -### 7.6 Channel Config Float Layout (SUB E5 / SUB 71) - -> ✅ **CONFIRMED — 2026-03-01** from controlled captures (sessions `193237` and `151147`). Trigger changed `0.500 → 0.200`, then `0.200 → 0.600`. Alarm changed `1.0 → 2.0`. All positions confirmed. - -The SUB `1A` read response (`E5`) and SUB `71` write block contain per-channel threshold and scaling values packed as **IEEE 754 big-endian floats**, with inline unit strings. This layout repeats **once per geophone channel** (Tran, Vert, Long — 3×): - -``` -[00 00] [max_range float] [00 00] [trigger float] ["in.\0"] [alarm float] ["/s\0\0"] [00 01] [chan_label...] - 40 C6 97 FD 3F 19 99 9A 69 6E 2E 40 00 00 00 2F 73 00 00 - = 6.206 = 0.600 in/s "in." = 2.000 in/s "/s" -``` - -| Field | Example bytes | Decoded | Certainty | -|---|---|---|---| -| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | -| ADC scale factor | `40 C6 97 FD` | **6.206053 (in/s)/V — CONFIRMED 2026-04-17.** This is the inverse sensitivity of the standard Instantel geophone = 1/0.161133. Interface Handbook §4.5: `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Used by firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant — do NOT write. Offset = **channel_label + 28** (same in E5 read and SUB 71 write). | ✅ CONFIRMED | -| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | -| **Trigger level** | `3F 19 99 9A` | **0.600 in/s** — IEEE 754 BE float | ✅ CONFIRMED | -| Unit string | `69 6E 2E 00` | `"in.\0"` | ✅ CONFIRMED | -| **Alarm level** | `40 00 00 00` | **2.000 in/s** — IEEE 754 BE float | ✅ CONFIRMED | -| Unit string | `2F 73 00 00` | `"/s\0\0"` | ✅ CONFIRMED | -| `[00 01]` | `00 01` | Unknown flag / separator | 🔶 INFERRED | -| Channel label | e.g. `56 65 72 74` | `"Vert"` — identifies which channel | ✅ CONFIRMED | -| **Geo range (sensitivity selector)** | `00` or `01` | **uint8** — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Offset = **channel_label + 33** (same in E5 read and SUB 71 write). Applied to all three geo channel blocks (Tran/Vert/Long). **Note: `channel_label + 20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | ✅ CONFIRMED 2026-04-20 | - -**State transitions observed across captures:** - -| Capture | Trigger | Alarm | Notes | -|---|---|---|---| -| `193237` (read) | `3F000000` = 0.500 | `3F800000` = 1.000 | Device state before any change | -| `193237` (write 1) | `3E4CCCCD` = 0.200 | `3F800000` = 1.000 | Trigger changed only | -| `151147` (write 1) | `3E4CCCCD` = 0.200 | `40000000` = 2.000 | Alarm changed, trigger carried over | -| `151147` (write 2) | `3F19999A` = 0.600 | `40000000` = 2.000 | Trigger changed, alarm carried over | - -Values are stored natively in **imperial units (in/s)** — unit strings `"in."` and `"/s"` embedded inline confirm this regardless of display locale. - -### 7.6.1 Record Time - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Anchor convention -> updated 2026-04-21 — search for the 6-byte stable anchor, not the 10-byte form. - -Record time is stored as a **32-bit IEEE 754 float, big-endian**, located via an -anchor pattern (see §7.6.3 / §7.6.4 for the rest of the anchor-relative fields). - -**Anchor:** search for the 6-byte sequence `\xbe\x80\x00\x00\x00\x00` in -`cfg[0:150]`. **Record time is at anchor + 6** (i.e. 6 bytes past the start of -the anchor). - -> ⚠️ **The earlier "10-byte anchor" form `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` -> is NOT stable.** Its leading two bytes `\x01\x2c` (= 300) are the -> `histogram_interval_sec` field, which changes when the histogram interval is -> reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant. -> Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`. - -> 🔶 **2026-10-17 — the 6-byte suffix may not be constant either (INFERRED from Series IV).** -> On a Micromate the same position holds `[pre-trigger f32 BE, negative seconds][record stop mode]`, -> measured setting by setting: `be 80 00 00` = −0.25 s, and `00 00` = Fixed (Auto reads `00 01`). -> Every S3 unit this anchor was confirmed on would have been at those defaults. If S3 shares the layout, -> a unit in **Record Stop Mode = Auto** returns `be 80 00 00 00 01`, `find()` returns −1, and the four -> anchor-relative fields silently go undecoded. **Not yet measured on S3** — one BW capture in Auto -> mode settles it. Until then, treat a missing anchor as this, not as DLE jitter. - -> ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the -> compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental -> header padding is gone and the anchor now appears at `cfg[11]`. Search range -> widened to `cfg[0:150]`. - -| Record Time | float32 BE bytes | Decoded | -|---|---|---| -| 3 seconds | `40 40 00 00` | 3.0 | -| 5 seconds | `40 A0 00 00` | 5.0 | -| 7 seconds | `40 E0 00 00` | 7.0 | -| 8 seconds | `41 00 00 00` | 8.0 | -| 10 seconds | `41 20 00 00` | 10.0 | -| 13 seconds | `41 50 00 00` | 13.0 | - -**⚠️ Do NOT use absolute offset `+0x28` from page2 start for BE11529.** The total cfg length varies by ±1 byte depending on sample rate setting (see §7.6.3 DLE jitter note). Absolute offsets are unreliable; anchor search is the correct approach. - -**`0x0A` after "Extended Notes" label:** invariant across record time changes — not record time. - -> ✅ **`0x082A` (= 2090) — RESOLVED:** Fixed payload length of the E5 response block. Constant regardless of any setting. - ---- - -### 7.6.2 SUB 1A Multi-Frame Read Protocol - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture). - -SUB 1A (compliance config read) requires **four frames**, not the standard 2-step probe+fetch used by other SUBs. The Blastware TX frame format for these is ACK (`0x41`) + STX (`0x02`) + [DLE-stuffed body] + ETX (`0x03`) with CMD=`0x10`. - -**Frame sequence:** - -| Step | Name | BW offset param | Notes | -|---|---|---|---| -| A | Probe | `0x0000` | Triggers E5 response with page_key=`0x0000` (44-byte header) | -| B | Data B | `0x0400` | params: `00 00 00 00 00 00 00 64 00 00`; E5 page_key=`0x0000` (44 bytes) | -| C | Data C | `0x0400` | params: `00 00 04 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1027 bytes) | -| D | Data D | `0x002A` | params: `00 00 08 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1055 bytes, or 0x0000/44 bytes when BE11529 sends a duplicate) | - -**E5 response `page_key` field:** bytes `data[3:5]` of the E5 payload. `0x0000` = header/short chunk, `0x0010` = main config data. - -**Assembling cfg:** concatenate non-duplicate chunks in order (B+C+D). Track `(page_key, chunk_len)` pairs; drop any repeat to avoid mis-alignment. - -**Expected cfg lengths:** -- Frame D delivers page `0x0010` correctly: **44 + 1027 + 1055 = 2126 bytes** -- Frame D duplicates page `0x0000` (BE11529 occasional): **44 + 1027 = 1071 bytes** (still fully decodable) - ---- - -### 7.6.3 Sample Rate and DLE Jitter - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Validated across -> Normal (1024), Fast (2048), and Faster (4096) modes. - -**Location:** `uint16 BE` at **anchor − 6**, using the 6-byte stable anchor -`\xbe\x80\x00\x00\x00\x00` searched in `cfg[0:150]`. - -| Device Mode | uint16 BE value | Sa/s | -|---|---|---| -| Normal | `04 00` | 1024 | -| Fast | `08 00` | 2048 | -| Faster | `10 00` | 4096 | - -**DLE jitter (critical — explains the ±1 byte cfg length variation):** - -The sample rate bytes sit a few bytes before the anchor in the raw S3 frame. -For "Faster" mode (4096 = `0x1000`), the high byte `0x10` is itself a DLE -character and was historically escaped on the wire as `10 10`. After DLE -unstuffing: `10 10 00` → `10 00` (2 bytes). For Normal/Fast modes (high byte = -`0x04` / `0x08`), no escaping needed and the payload stays 3 bytes. Result: -"Faster" mode can produce a cfg that is **1 byte shorter** than Normal/Fast, -shifting any absolute offset by −1. - -**Why anchor search is required:** any decoder that uses fixed absolute offsets -for record_time or sample_rate will produce garbage values when the device is -set to "Faster" mode. The 6-byte anchor (start of the alarm-level floats -`\xbe\x80\x00\x00\x00\x00`) is past the DLE-affected bytes and is unaffected by -this shift. - ---- - -### 7.6.4 Recording Mode - -> ✅ **CONFIRMED — 2026-04-20** (BE11529 / firmware S338.17); offsets corrected -> 2026-04-21 after a write-cycle drift bug was traced to writing to the wrong -> byte. **`recording_mode` is at `anchor − 8` for BOTH read and write.** - -Recording mode is a **uint8** stored at a fixed anchor-relative position (using -the 6-byte stable anchor `\xbe\x80\x00\x00\x00\x00`): - -| Enum | Mode | -|---|---| -| `0x00` | Single Shot | -| `0x01` | Continuous | -| `0x02` | Unknown (not yet observed) | -| `0x03` | Histogram | -| `0x04` | Histogram + Continuous (combined mode) | - -**Layout around the anchor (same in E5 read response and SUB 71 write payload):** - -``` -buf[anchor − 9] = mode_prefix (uint8; 0x00 for Single Shot/Continuous, - 0x10 for Histogram (DLE prefix in E5 wire - encoding of 0x03) and for Histogram+Continuous - (actual stored byte)) -buf[anchor − 8] = recording_mode (uint8) ← SAME OFFSET IN READ AND WRITE -buf[anchor − 7] = 0x10 (constant; part of the sample-rate field area; - do NOT overwrite — see warning below) -buf[anchor − 6] = sample_rate_hi (uint8, MSB of uint16 BE) -buf[anchor − 5] = sample_rate_lo (uint8, LSB of uint16 BE) -buf[anchor − 4 : anchor − 2] = histogram_interval_sec (uint16 BE, seconds; - mode-gated to Histogram) -buf[anchor − 2 : anchor] = 0x00 0x00 (padding) -buf[anchor : anchor + 6] = \xbe\x80\x00\x00\x00\x00 (anchor) -buf[anchor + 6 : anchor + 10] = record_time (float32 BE) -``` - -> ⚠️ **Do NOT write to `anchor − 7`.** The byte there is a DLE marker that the -> device firmware re-generates on every read. Writing to it shifts the anchor -> position by +1 on every subsequent read, drifting compliance config offsets -> indefinitely. The CLAUDE.md note "write to anchor-7" was a known mistake — -> see the `_encode_compliance_config` comment block in `client.py:2062–2068`. - -**`compliance_raw` DLE encoding:** - -`compliance_raw` returned by `read_compliance_config()` is NOT purely logical -bytes — it is the wire-encoded payload where any logical `0x03` byte appears as -the literal pair `\x10\x03` (preserved by `S3FrameParser` as inner-frame -literal data). Consequences: - -- For `recording_mode = 0x03` (Histogram), `compliance_raw[anc − 9] = 0x10` - (the DLE prefix from the wire encoding of `0x03`) and - `compliance_raw[anc − 8] = 0x03` (the actual value). -- For Histogram + Continuous (`0x04`), `compliance_raw[anc − 9] = 0x10` is an - actual stored config byte (not a DLE prefix). -- The 6-byte anchor search (`buf.find(b'\xbe\x80...', 0, 150)`) locates the - anchor correctly regardless of these mode-dependent shifts. -- When SFM writes `recording_mode` and round-trips the rest verbatim, the byte - at `anc − 9` is preserved from the previous read. Transitioning - Histogram → other modes via SFM may leave a `0x10` at `anc − 9` — the device - stores it as a literal byte; it does not affect recording-mode operation - (which is at `anc − 8`) but is one byte different from what BW writes. - -**Decode path (`_decode_compliance_config_into`):** `data[anchor_pos − 8]`. -**Encode path (`_encode_compliance_config`):** `buf[anchor_pos − 8] = recording_mode`. - ---- - -### 7.7 Blastware `.set` File Format - -> 🔶 **INFERRED — 2026-03-01** from `Standard_Recording_Setup.set` cross-referenced against known wire payloads. - -Blastware's "save setup to disk" feature produces a binary `.set` file that is structurally identical to the wire protocol payload, but with **all multi-byte values in little-endian byte order** (Windows-native) rather than the big-endian order used on the wire. No DLE framing, no checksums — raw struct dump. - -**File layout (2522 bytes observed):** - -``` -0x0000 Header / metadata block (~40 bytes) — partially decoded -0x002A "Standard Recording Setup.set\0" — setup filename, null-padded -0x0078 Project strings block — same layout as SUB 71 wire payload - "Project:\0" + value, "Client:\0" + value, "User Name:\0" + value, - "Seis Loc:\0" + value, "Extended Notes\0" + value -0x06A0 Channel records block — one record per channel (geo×3 + mic×1 + duplicates) -0x0820 Device info block — serial number, firmware, model strings -0x08C0 Event index / timestamp block -0x0910 Histogram / reporting config -0x09D0 Trailer (10 bytes) -``` - -**Per-channel record layout (little-endian, ~46 bytes per channel):** - -``` -offset size type value (Tran example) meaning -+00 2 uint16 0x0001 channel type (1=geophone, 0=mic) -+02 4 char[4] "Tran" channel label -+06 2 uint16 0x0000 padding -+08 2 uint16 0x0001 unknown -+0A 2 uint16 0x0050 = 80 unknown (sensitivity? gain?) -+0C 2 uint16 0x000F = 15 unknown -+0E 2 uint16 0x0028 = 40 unknown -+10 2 uint16 0x0015 = 21 unknown -+12 4 bytes 03 02 04 01 flags (recording mode etc.) -+16 4 uint32 0x00000003 record time in seconds ✅ CONFIRMED -+1A 4 float32 6.206053 ✅ CONFIRMED 2026-04-17 — ADC-to-velocity scale factor (= 1/sensitivity = (in/s)/V). Interface Handbook §4.5: Range = 1.61133 V × 6.206053 = 10.000 in/s (Normal range). Firmware uses: PPV (in/s) = ADC_voltage × 6.206053. Hardware constant — identical on all tested units. Do NOT write. -+1E 2 00 00 padding -+20 4 float32 0.6000 trigger level ✅ CONFIRMED -+24 4 char[4] "in.\0" / "psi\0" unit string (geo vs mic) -+28 4 float32 2.0000 alarm level ✅ CONFIRMED -+2C 4 char[4] "/s\0\0" / varies unit string 2 -``` - -**MicL channel differences:** -- `channel_type` = 0 (vs 1 for geophones) -- trigger = 0.009, alarm = 0.021 (in psi) -- unit string = `"psi\0"` instead of `"in.\0"` — **confirms MicL units are psi** ✅ - -**Endianness summary:** - -| Context | Byte order | Example (0.6 in/s trigger) | -|---|---|---| -| `.set` file | Little-endian | `9A 99 19 3F` | -| Wire protocol (SUB 71 / E5) | Big-endian | `3F 19 99 9A` | - -> ❓ **`0x082A`** — still unidentified. Record time in the `.set` file = `0x00000003` (3 sec), which would be `00 00 00 03` on wire — not `0x082A`. The original sessions had record time = 2, which would be `00 00 00 02`. `0x082A` = 2090 doesn't match any obvious record time encoding. May correspond to one of the unknown uint16 fields at +0A through +10. A capture changing sample rate or histogram interval would help isolate it. - ---- - -### 7.8 Trigger / Advanced Config Write Frame (BW→S3 SUB `0x82`) - -> ✅ **CONFIRMED — 2026-03-09** from controlled BW-side capture diff (Trigger Sample Width 4→3). - -SUB `0x82` is the BW→S3 write command for the advanced trigger configuration block. It is the write counterpart to the S3→BW read response SUB `0xD1` (0xFF − 0x82 = 0x7D is a separate sub; the D1/2E read pair is distinct). The `0x82` write frame is only visible in `raw_bw.bin` — it does not appear in S3-side compliance dumps. - -**Destuffed BW write frame layout (47 raw bytes → 46 destuffed):** - -``` -offset value meaning -[00] 0x10 addr (literal 0x10 after destuffing) -[01] 0x00 unknown -[02] 0x82 SUB: advanced config write -[03] 0x00 unknown -[04] 0x00 unknown -[05] 0x1C length = 28 bytes (payload size) -[06..10] 00.. header/padding -[11..16] 00.. header/padding -[17] 0x1A unknown (constant 26 = 0x1A) -[18] 0xD5 unknown (constant) -[19] 0x00 unknown -[20] 0x00 unknown -[21] 0x10 literal 0x10 (stuffed in raw frame as 10 10) -[22] 0x04/0x03 Trigger Sample Width ✅ CONFIRMED (uint8, samples) -[23] 0x0A unknown (constant 10; NOT Auto Window) -[24..43] 0xFF.. padding -[44] 0x00 unknown -[45] checksum -``` - -**Confirmed Trigger Sample Width values:** - -| Width setting | Byte [22] | -|---|---| -| 4 samples | `0x04` | -| 3 samples | `0x03` | -| 2 samples (default) | `0x02` (expected — not yet captured) | - -**Known constants in this frame:** `[17]=0x1A`, `[18]=0xD5`, `[23]=0x0A`. These do not change with Trigger Sample Width changes. Byte `[23]` = 10 was initially a candidate for Auto Window (range 1–9) but cannot be Auto Window because 10 is outside the valid range. - -**Mode gating:** This write frame is only transmitted when Blastware performs a Send To Unit operation in Compliance / Single-Shot / Fixed Record Time mode. The frame is absent from other session types. - ---- - -### 7.9 Mode Gating — Protocol Architecture Note - -> ✅ **CONFIRMED — 2026-03-09** from controlled captures and null-change experiments. - -Several settings are **mode-gated**: the device only transmits (reads) or accepts (writes) certain fields when the appropriate operating mode is active. This is an architectural property of the protocol, not a gap in capture methodology. - -**Observed mode gating:** - -| Setting | Gate Condition | Evidence | -|---|---|---| -| Trigger Sample Width | Compliance / Single-Shot / Fixed Record Time mode | Not visible in S3-side reads; only in BW write frame (SUB `0x82`) when mode is active | -| Auto Window | Record Stop Mode = Auto | Capture of 3→9 change in Fixed mode produced zero wire change in all frames (F7, D1, E5 all identical) | - -**Implication for captures:** To map a mode-gated setting, you must first activate the gating mode on the device, then perform the compliance dump or write capture. Changing the setting value while in the wrong mode will produce no observable wire change. - -**Suspected mode-gated settings not yet captured:** -- Auto Window (requires Record Stop Mode = Auto) -- Auxiliary Trigger (unknown gate condition) - ---- - -### 7.5b Full Waveform Record (SUB F3) — 0xD2 bytes (210 bytes) - -> ✅ **Updated 2026-03-31** — Full layout confirmed. See §7.7.5 for the -> complete record structure including timestamp, record type, PPV float -> positions, and project strings. -> Section number changed to `7.5b` 2026-05-20 to disambiguate from §7.5 above. - -Peak values are found by searching for channel label strings `"Tran"`, -`"Vert"`, `"Long"`, `"MicL"` and reading `float32 BE` at `label_offset + 6`. -The floats are **not 4-byte aligned** — confirmed from 3-31-26 capture. - -Example peak values (event 1 from 3-31-26): -``` -Tran: 3D BB 45 7A = 0.0916 in/s -Vert: 3D B9 56 E1 = 0.0907 in/s -Long: 3D 75 C2 7C = 0.0605 in/s -MicL: 39 BE 18 B8 = 0.000145 psi ✅ units confirmed -``` - -Example peak values (event 2 from earlier capture): -``` -Tran: 3D 56 CB B9 = 0.0521 in/s -Vert: 3C F5 C2 7C = 0.0300 in/s -Long: 3C F5 C2 7C = 0.0300 in/s -MicL: 39 64 1D AA = 0.0000875 psi -``` - -> ⚠️ The record is delivered as `data_rsp.data[11:11+0xD2]` — the outer -> data section header (LENGTH_ECHO, KEY_ECHO) occupies data[0..10]. -> Callers of `read_waveform_record()` receive the 210-byte record directly. - -### 7.6 Bulk Waveform Stream (SUB A5) — Raw ADC Sample Records - -> ⛔ **§7.6 below describes the deprecated `0x0400`-step walk and is RETAINED FOR HISTORICAL CONTEXT ONLY.** -> The "A5[7] is metadata", "A5[9] is terminator", and chunk-counter frame-index claims in this section -> are all artifacts of the broken walk that was overrunning past event end by ~5×. -> -> **For the corrected protocol (v0.14.0+), use:** -> - **§7.8.5** — chunk addressing (probe at `start_offset`, samples step 0x0200, bounded by STRT `end_offset`) -> - **§7.8.6** — TERM frame formula -> - **§7.8.7** — fixed metadata pages 0x1002 / 0x1004 (this is where Project / Client / User Name / Seis Loc -> strings actually live — NOT in any sample-chunk frame) -> - **§7.8.8** — multi-event "Download All" sequence -> -> The waveform sample encoding described in §7.6.1 below (4-channel interleaved s16 LE, 8 bytes -> per sample-set) is **NOT actually verified** — see the retraction note at the top of §7.6.1. -> The frame-indexing claims and metadata-source claims in §7.6 are also wrong; use §7.8.5–§7.8.8. - -**Two distinct formats exist depending on recording mode. Both confirmed from captures.** - ---- - -#### 7.6.1 Blast / Waveform mode — 🟡 PARTIAL DECODE (2026-05-11) - -> ### 📌 CURRENT STATUS — read this first -> -> The body codec is **partially decoded** as of 2026-05-11. This -> section contains both current-truth spec AND historical retractions; -> when in doubt, the working summary lives at -> `docs/waveform_codec_re_status.md`. -> -> | Item | Status | -> |---|---| -> | Body has tagged variable-length blocks, NOT raw int16 LE | ✅ confirmed | -> | 5 block tag types (10/20/00/30/40 NN) with lengths | ✅ confirmed | -> | 7-byte preamble: `00 02 00` + Tran[0] + Tran[1] int16 BE | ✅ confirmed | -> | `00 NN` = RLE for zero deltas in the current channel | ✅ confirmed | -> | Tran channel, segment 0 (~482-510 samples / event) | ✅ byte-exact, 5/5 events | -> | Multi-segment Tran continuation | ❌ open (breaks at sample ~512) | -> | Vert / Long / MicL channel decoders | ❌ open | -> | `30 NN` block content (loud-from-start events) | ❌ open | -> | Earlier "raw int16 LE, 8 bytes per sample-set" claim | ❌ REFUTED | -> -> **Production code in `client.py:_decode_a5_waveform` still uses the -> broken int16 LE decoder.** The `.h5` sidecars SFM produces contain -> wrong sample values and must be treated as "unverified" downstream. -> The BW binary write path is unaffected (it's pure passthrough of the -> device's flash bytes, no decoding) and remains byte-perfect. - -The "4-channel interleaved s16 LE, 8 bytes per sample-set" claim that -appeared in earlier revisions of this section was never validated and -was wrong. No event in the project's archive ever came close to ADC -saturation, yet the int16 LE decoder consistently produced full-scale -±32K noise — that was the signature of mis-aligned encoded data, not -signal saturation. - -##### Body file layout - -A Blastware waveform-file body (the variable-length section between -the 21-byte STRT record and the 26-byte file footer) is composed of -**tagged variable-length blocks**, NOT raw int16 samples. - -``` -[preamble: 7 or 9 bytes] -[stream of tagged blocks] -[trailer: per-channel summary blocks] -``` - -**Preamble (CONFIRMED 2026-05-11 across 3+4 events):** - -``` -body[0:3] = 00 02 00 magic -body[3:5] = Tran[0] int16 BE first Tran sample (LSB = 0.005 in/s) -body[5:7] = Tran[1] int16 BE second Tran sample -``` - -The preamble is therefore 7 bytes long. Earlier observations of a -"9-byte preamble" on continuous-mode events were a misread — those -events still have a 7-byte preamble; the next 2 bytes are part of the -first ``10 NN`` or ``20 NN`` data block (its tag). - -Verified preamble decode for all 7 fixture events — Tran[0] and Tran[1] -from the preamble bytes exactly match the BW ASCII export (rounded to -0.005 in/s): - -| Event | Preamble [3:7] (hex) | T[0] decoded | T[0] truth | T[1] decoded | T[1] truth | -|---|---|---|---|---|---| -| event-a (May 8) | ``01 00 00 00`` | +1 | +1 (0.005) | 0 | 0 | -| event-b (May 8) | ``ff ff ff 00`` | -1 | -1 | -1 | -1 | -| event-c (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | -| event-d (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | -| SP0 (May 11) | ``00 04 00 04`` | +4 | +4 (0.020) | +4 | +4 | -| SS0 (May 11) | ``ff a7 ff a7`` | -89 | -89 (-0.445) | -89 | -89 | -| SV0 (May 11) | ``fd 17 fd 06`` | -745 | -745 (-3.725) | -762 | -762 | - -##### Block tags (CONFIRMED 2026-05-08) - -Every block starts with a 2-byte tag. Five tag types are confirmed: - -| Tag (hex) | Block type | On-wire length | -|-----------|-------------------------------------|-----------------------| -| ``10 NN`` | Small-delta data block | NN/2 + 2 bytes | -| ``20 NN`` | Literal data block (int8-shaped) | NN + 2 bytes | -| ``00 NN`` | RLE zero-delta run | 2 bytes | -| ``30 NN`` | Trailer summary block | NN × 4 bytes | -| ``40 NN`` | Segment header | 2 × NN + 16 bytes | - -NN is always a multiple of 4. ``10 NN`` and ``20 NN`` data blocks -alternate with ``00 NN`` markers — every ``10/20 NN`` block is -followed by a ``00 NN`` marker before the next data block. - -###### Wide-NN forms — ``0X NN`` (CONFIRMED 2026-08-25) - -The 12-bit wide-NN encoding already documented for ``1X NN`` / -``2X NN`` (low nibble of the tag byte carries the high nibble of NN, -so effective ``NN = ((tag & 0x0F) << 8) | NN``) **also applies to the -``00 NN`` RLE tag.** A narrow RLE run maxes out at NN = 0xFC, so a -quiet stretch longer than 252 samples must use the wide form. - -Confirmed against six production events, e.g. ``01 0c`` (NN = 268) in -``BE9558/K558LKOF.460W``. Before this was handled, the walker hit its -unknown-tag break at the first long quiet run and silently truncated -every channel decoded after that point. - -###### ``30 NN`` is not capped at NN = 0x10 (CONFIRMED 2026-08-25) - -Data-section ``30 NN`` blocks occur with NN up to at least 0x18 (24), -e.g. ``30 18`` in ``BE18193/T193LQ45.NN0W`` and ``30 14`` in -``BE18193/T193LQ9W.AF0W``. The data-section length formula -(``NN × 1.5 + 2``) holds for these; only the earlier ``NN ≤ 0x10`` -guard was wrong. - -###### ``40 NN`` segment headers are variable width (CONFIRMED 2026-08-25) - -``40 02`` is the common case, but **NN is the count of int16 BE -continuation deltas the header carries for the *previous* channel**, so -the header grows with NN and every field after the deltas shifts by -``2 × NN``: - -``` -length = 2 (tag) + 2 × NN (prev-channel deltas) + 14 (fixed tail) -``` - -``40 01`` (18 bytes) and ``40 03`` (22 bytes) both occur in production -files — see ``BE12599/N599LP1S.UO0W`` and ``BE18438/T438LO30.GA0W``. -In each case the constant ``02 00`` marker sits at ``data[2×NN+8]`` and -the following tag lands exactly on a valid block boundary. - -##### Segments - -The body is divided into segments separated by ``40 02`` segment headers. -**Segment size is variable** — bounded by a fixed device-flash byte -budget, not a fixed sample count. Quiet events fit more samples per -segment (RLE compacts zero deltas via ``00 NN`` markers); loud events -fit fewer. Observed first-segment sizes in the bundled fixtures: - -| Event | Segment 0 size (Tran samples) | -|---|---| -| SP0 (loud, 0.25s pretrig) | 510 | -| SV0 (loud-from-start) | 58 (stops at first ``30 NN``) | -| SS0 (loud-from-start) | 42 (stops at first ``30 04``) | -| JQ0 (Vert-heavy, quiet Tran) | 510 | -| V70 (Mic-heavy, quiet geos) | 510 | - -⚠️ Earlier drafts of this section claimed "~80 sample-sets per segment" -based on incomplete walks; that figure is wrong. Segments are -flash-page-sized in bytes, not sample-count-sized. - -The ``40 NN`` payload structure (offsets shown for the common NN=2 / -18-byte-payload case; add ``2 × (NN − 2)`` to every offset from ``[4:6]`` -onward for other widths): - -| Offset (NN=2) | Generic | Field | Status | -|---------------|------------------|----------------------------------------|-------------| -| [0:4] | [0 : 2NN] | NN × int16 BE continuation deltas for | ✅ confirmed| -| | | the PREVIOUS channel (16-count units) | | -| [4:6] | [2NN : 2NN+2] | Unknown (varies; possibly a checksum) | ❓ open | -| [6:8] | [2NN+2 : 2NN+4] | Byte length to next segment header − 2 | 🟡 likely | -| | | (uint16 BE; off by ±4 on some files) | | -| [8:12] | [2NN+4 : 2NN+8] | Monotonic uint32 LE counter | ✅ confirmed| -| | | (starts ~0x47, +1 per segment) | | -| [12:14] | [2NN+8 : 2NN+10] | Constant ``02 00`` | ✅ confirmed| -| [14:18] | [2NN+10 : 2NN+14]| THIS channel's 2-sample anchor pair | ✅ confirmed| -| | | (2 × int16 BE) | | - -⚠️ An earlier draft listed ``[14:18]`` as an "unknown 4-byte field" and -``[12:16]`` as a constant ``02 00 00 01``. Both were wrong: the constant -is only the 2-byte ``02 00``, and the four bytes after it are the anchor -pair the decoder needs. Corrected 2026-08-25. - -###### Tagless segment headers (CONFIRMED 2026-08-25) - -A segment header can appear with **no ``40 NN`` tag at all** — just the -14-byte tail: - -``` -[field2:2][len_to_next:2][channel_id:4][marker:2][anchors:4] -``` - -This is the NN=0 case: the previous channel needed no continuation -deltas, so there is no tag and no delta bytes. Detect it by the six -bytes at ``[4:10]`` — a known channel id, two zero bytes, a small -segment index, then the ``01 00`` / ``02 00`` marker. - -It is where the walk stopped in 7 of the 8 events that still truncated -after the wide-RLE / ``30 NN`` / variable-width-``40 NN`` fixes. - -###### The header "counter" is really a channel id (CONFIRMED 2026-08-25) - -The 4-byte field previously documented as a *"monotonic uint32 LE -counter (starts ~0x47, increments by 1 per segment)"* is actually: - -``` -[channel_id:1][00][00][segment_index:1] -``` - -| channel_id | channel | -|---|---| -| ``0x46`` | Tran | -| ``0x47`` | Vert | -| ``0x48`` | Long | -| ``0x49`` | MicL | - -Verified on **1697 of 1697** segment headers across the ground-truth -corpus — every one agrees with the channel the rotation would assign, -zero disagreements, no other id values observed. The old reading was -plausible because the id byte cycles 0x46→0x47→0x48→0x49 and the -segment index increments, which *looks* monotonic in LE. - -Decoders should take the channel from this field rather than from -rotation position: one missed or extra header (exactly what tagless -headers used to cause) desyncs rotation and corrupts every channel -after it. - -###### Geophone full scale is 32000 counts, not 32768 (CONFIRMED 2026-08-25) - -The body codec emits geo samples in 16-count units whose LSB is exactly -**0.005 in/s**. With the consumer-side ``×16`` to ADC counts, one ADC -count is ``0.005 / 16`` in/s, so Normal range (10.000 in/s) is - -``` -10.0 / (0.005 / 16) = 32000 counts -``` - -Dividing by 32768 scales every geophone sample and every derived peak -down by ``1 - 32000/32768`` = **2.34%**. Measured on 216 per-channel -comparisons against preserved Blastware ASCII exports: 32768 gave -151/216 exact (worst error 0.238 in/s on a 10 in/s event); 32000 gives -216/216 exact with a worst error of 0.005 in/s — exactly 1 LSB, i.e. -pure quantization. - -This also explains why Blastware reports geo peaks slightly above -nominal full scale (e.g. 10.14 in/s): the ADC has headroom past 32000. - -**Scope — this is not waveform-specific.** The scale is applied where -ADC counts become physical units, which every event passes through -regardless of which codec produced the samples. Verified after -re-deriving the whole production store: - -| source | median ratio ours/device, 32768 | with 32000 | -|---|---|---| -| series-3 waveform (vs ASCII sample table) | 0.9766 | **1.0000** | -| series-3 histogram (vs ASCII PPV, n=1137) | 0.9766 | **1.0000** | -| series-4 Thor IDF (vs device peak, n=1468) | 0.960 | **0.983** | - -The series-4 figure is closer to correct but not exact — the Thor -per-count LSB is its own open question (see §15). - -###### SUPERSEDED 2026-08-25 — the body is a RECORD CHAIN, not a tag stream - -Everything above about ``40 NN`` segment headers, tagless headers, variable -header widths and channel rotation describes a model that is **wrong**. It -produced nearly-correct output because the block table happens to tile the -data sections correctly, but the framing is not what the device writes. - -The body is a chain of **self-delimiting per-channel records**: - -``` -off+0 field2 uint16 purpose unknown (not a length, not a checksum) -off+2 len uint16 BE next_record = off + 2 + len <- authoritative -off+4 chan_id 0x46 Tran / 0x47 Vert / 0x48 Long / 0x49 MicL - 0x06 = END OF WAVEFORM STREAM -off+5 0x00 -off+6 0x00 -off+7 segment index -off+8 mode 2 bytes, a 3-valued enum -off+10 anchors 2 x int16 BE, ABSOLUTE -- present ONLY when mode == 02 00 -``` - -**Mode enum**, all three ground-truth verified: - -| mode | header | data section | -|---|---|---| -| ``02 00`` | 14 bytes | anchors emitted, then blocks are **cumulative deltas** | -| ``01 00`` | 10 bytes | no anchors, blocks carry **absolute** sample values | -| ``00 03`` | 10 bytes | **no tags at all** — raw 12-bit packed absolute samples | - -Census over the 1,388 production series-3 waveform binaries: -``02 00`` x 32,617, ``01 00`` x 74, ``00 03`` x 71. - -**``40 NN`` is an ordinary int16 BE data block** of length ``2*NN + 2`` -(1 <= NN <= 8), never a header. The superseded model read it as a header of -length ``2*NN + 16``, which is exactly why walks drifted: the "variable prefix" -of 0/2/4/6/8 bytes reported earlier was walker drift, precisely -``4 - (old_stop - true_record_start)``, on all 25 affected files. - -Block table for data sections (``NN = ((tag_hi & 0x0F) << 8) | tag_lo``): - -| tag | length | samples | -|---|---|---| -| ``0X NN`` | 2 | NN (RLE hold — holds the previous value in BOTH delta and absolute modes) | -| ``1X NN`` | NN/2 + 2 | NN (4-bit nibble) | -| ``2X NN`` | NN + 2 | NN (int8) | -| ``30 NN`` | NN*1.5 + 2 | NN (12-bit packed) | -| ``40 NN`` | 2*NN + 2 | NN (int16 BE) | - -The ``30 NN`` "trailer length = NN*4" fallback must NOT be applied inside a -record — it corrupts records whose ``30 NN`` sits near a boundary. - -**The preamble is segment 0's implicit Tran record.** ``body[1:3]`` carries -the same mode pair: ``00 02 00`` (1,387 of 1,388 files) means two int16 BE -anchors at ``body[3:7]`` then delta blocks; ``00 00 03`` (1 file, -``BE13121/O121L4L1.KF0W``) means raw 12-bit absolute from ``body[3]``, which -cannot be block-walked — the first record must be located by scanning. - -**Verification.** The length chain terminates on a ``0x06`` record in 1,387 of -1,388 files (the exception has an ambiguous footer signature inside its sample -stream). All four channels come out at identical length in **1,388/1,388**, -against 156/1,388 under the superseded model. Against the 75 events with a -preserved Blastware ASCII export: sample-count exact **72/75 -> 75/75**, fully -exact **70/75 -> 73/75** (the 2 remaining differ by exactly 1 LSB on samples -sitting at the +-10.000 in/s rail). Against device-reported PPVs on a live -decode: waveform **1306/1306** exact with mean absolute ratio error 0.00000; -histogram **4458/4459**. - -This also eliminated the walker-over-read class entirely. 24 of those 35 -"histogram" over-reads were histogram files that ``read_blastware_file`` fed to -the *waveform* codec first; the old walker accepted them and returned garbage -(one produced 98,923 "intervals"), while the record-chain decoder correctly -returns None so they fall through to ``histogram_codec``. - -##### Trailer - -The trailer (after the last segment's data) is a sequence of 32-byte -``30 08`` blocks plus a final ``30 04`` / ``20 04`` / ``40 02`` summary -ending in the constant 2-byte tail ``00 1A``. These contain -per-channel statistics (peak times, peak values, mean offsets — bytes -in the form ``f3/f4/f5`` near ``20 10`` markers strongly resemble -int8 channel-bias values around -12). Detailed decoding of the -trailer is outside the path needed for sample reconstruction. - -##### Tran channel codec — CONFIRMED 2026-05-11 (segment 0) - -After the 7-byte preamble, the body's segment 0 carries Tran deltas -via three block types: - -- ``10 NN``: ``NN/2`` bytes of payload. Each byte = two 4-bit signed - nibbles (high nibble first; 0..7 → 0..+7, 8..F → -8..-1). Each - nibble is one Tran delta in 16-count units (LSB = 0.005 in/s). - -- ``20 NN``: ``NN`` bytes of payload. Each byte = one int8 signed - delta in 16-count units. Used when deltas don't fit in 4 bits. - -- ``00 NN``: a 2-byte marker. Run-length-encoded zero deltas — append - NN copies of the current cumulative Tran value (no change). Used - heavily for silent stretches. - -Segment 0 ends at the first ``40 02`` segment header. Segment 0 typically -covers ~510 sample-sets for events with mostly-quiet Tran, fewer for -events with rapid Tran changes. - -Verified against all bundled fixture events (5-8 and 5-11 bundles): - -| Event | Tran character | Segment 0 size | Matches truth | -|---|---|---|---| -| SP0 (loud all-channels, pretrig=0.25s) | small near sample 0 | 510 | 510/510 ✓ | -| SS0 (loud-from-start) | big from sample 0 | 42* | 42/42 ✓ | -| SV0 (loud-from-start) | big from sample 0 | 58* | 58/58 ✓ | -| JQ0 (Vert-heavy) | near zero | 510 | 510/510 ✓ | -| V70 (Mic-heavy) | near zero | 510 | 510/510 ✓ | - -\* SS0 and SV0 decode stops early because their segment 0 contains -``30 04`` blocks whose internal format hasn't been decoded yet (likely -a channel-switch marker for the high-amplitude regime). The two events -where the codec is most complex stop at the first ``30 04``. - -Implementation: :func:`minimateplus.waveform_codec.decode_tran_initial`. - -##### Multi-segment Tran continuation — OPEN - -After segment 0 ends and the segment header's T_delta (bytes [0:2]) -is applied, the next segment's blocks produce values that diverge from -truth by sample ~512. The block structure inside segment 1 is -identical to segment 0 (alternating ``10 NN`` / ``20 NN`` data + -``00 NN`` RLE), and the per-segment delta budget exactly matches the -segment size — V70 segment 1 has 264 nibble-deltas + 244 RLE-zeros = -508 = the segment's sample count. Cumulative deltas are correct in -aggregate (V70 net-zero ≈ truth net-zero) but the per-sample trajectory -is wrong when applied as Tran continuation. - -The strongest unverified hypothesis is that **segments rotate -channels**: segment 0 = Tran, segment 1 = Vert, segment 2 = Long, -segment 3 = Mic, segment 4 = Tran continuation, … This would explain -the per-segment delta-budget match while also explaining why segment -1 isn't Tran continuation. Verification needs the per-channel anchor -to come from segment-header bytes [4:6] or [14:18], which are still -open. - -##### What's still open - -- **Tran past the first data block.** After the first block, the - body has more ``10 NN`` / ``20 NN`` blocks separated by ``00 NN`` - markers and occasionally ``30 NN`` blocks. Naive continuation - (treat all subsequent ``10/20 NN`` blocks as Tran) does NOT match - truth past the first block — the codec interleaves channels somehow. - ``30 04`` markers appearing in SS0 between blocks 1 and 5 look - like channel-switch tags, but the switching rule has not been - fully decoded. - -- **Vert / Long / MicL channel encodings.** No verified decoder - exists for these yet. Hypotheses tested without success: - V_init stored as int16 BE in ``30 NN`` block payload; V/L/M - blocks encoded in order after Tran with ``30 NN`` separators; - V encoded as ``V - T`` differential. None match truth. - -- **``30 NN`` block length.** In the trailer, ``30 NN`` blocks - are NN×4 bytes long. In the data section, ``30 NN`` blocks are - NN×2 bytes long (= 8 bytes for NN=4 in SS0). The walker tries - NN×2 first and falls back to NN×4 if needed. - -- **Walker correctness past offset ~427 in event-b.** The walker - bails out partway through event-b — there is at least one block - whose length doesn't fit the lengths confirmed for the other - events. This is a separate (now lower-priority) issue. - -##### Recommended next step - -A capture with a known external waveform (calibration tone of known -frequency and amplitude) would unlock the magnitude scaling and -disambiguate which channel a ``20 NN`` block belongs to. Multiple -captures of the same signal at different ``geo_range`` settings -(Normal 10 in/s vs Sensitive 1.25 in/s) would also pin down whether -sample values are scaled at the codec layer or only at the BW -display layer. - -##### Reference module - -``minimateplus/waveform_codec.py`` implements the verified block -walker (:func:`walk_body`, :func:`split_segments`, -:func:`parse_segment_header`). ``decode_waveform_v2`` is a stub that -returns ``None`` until a verified per-byte sample decoder is wired -up; production code (``minimateplus/client.py``) continues to use -the legacy int16 LE decoder, which produces wrong samples but stable -output shape — keep the ``.h5`` sidecars marked as -"sample-codec unverified" until the byte-to-sample mapping lands. - -##### History (do not re-derive) - -| Date | Note | -|---|---| -| 2026-05-11 | Tran channel codec cracked using a high-amplitude (PPV 6-7 in/s) event bundle. Preamble[3:7] = Tran[0]/Tran[1] as int16 BE in 16-count units (LSB = 0.005 in/s). First data block (``10 NN`` nibble-deltas or ``20 NN`` int8-deltas) carries Tran deltas from sample 2. Verified 22+42+46 = 110 samples across SP0/SS0/SV0 with 0 errors. Earlier 96-combination brute-force search on the quiet 5-8 bundle failed because Tran[0] = Tran[1] = 0 in those events made initial-value-from-preamble undetectable. | -| 2026-05-08 | Block tagging confirmed against the 4-event May 2026 bundle. All bodies parse cleanly through `walk_body` for events a/c/d. Event-b walks partway and stops at offset 427 (open issue). | -| 2026-05-08 | Earlier "4-channel interleaved s16 LE" claim formally retracted — never validated, produced full-scale ±32K noise on every event because the bytes are encoded, not raw samples. | -| 2026-04-02 | "Frame 7 metadata", "Frame 9 terminator", and `0x0400`-step chunk-counter claims documented as-was; later proved to be artifacts of an over-reading 5A walk (now superseded by §7.8.5–7.8.7). | - ---- - -#### 7.6.2 Noise monitoring / Histogram mode — ✅ CONFIRMED (3-31-26 capture) - -32-byte blocks with the following layout: - -``` -Offset Size Type Description - 0 2 uint16 LE block type: 0x0016=sync, 0x0000=data - 2 2 uint16 LE block counter (ctr) - 4 18 int16 LE × 9 ADC samples -22 10 bytes metadata: [00 01 43 VAR VAR 00 pretrig rectime 00 00] -``` - -- Sync blocks (type=0x0016) appear at the start of each A5 frame; ctr=0 in sync blocks. -- Data blocks (type=0x0000) carry actual sample data. First data block ctr=288 (empirical, - not yet decoded — likely related to a pre-trigger sample offset). -- Metadata fixed bytes: `00 01 43` then 2 variable bytes, then `00 [pretrig] [rectime] 00 00`. - Pretrig byte = 0x1E (30) and rectime byte = 0x0A (10) for the 3-31-26 capture. -- 9 samples per block (int16 LE, NOT big-endian). Noise floor ≈ 9–11 counts. -- **This is a different recording mode** from waveform/blast — the device firmware uses - 32-byte blocks for histogram/noise monitoring and 4-channel continuous for waveform events. - -> ❓ **Open:** The 9-sample-per-block structure does not divide evenly into 4 channels. -> Whether these represent a single channel, all channels in rotation, or downsampled -> aggregates is not yet determined. The first data block ctr=288 vs pretrig=30 is also -> unexplained — possibly counting in units other than sample-sets. - ---- - ---- - -### 7.7 Event Download Protocol — Confirmed from 3-31-26 Capture ✅ - -> **Added 2026-03-31.** All findings confirmed from live bridge capture -> `bridges/captures/3-31-26/raw_bw_20260331_200245.bin` + -> `raw_s3_20260331_200245.bin` (148 BW frames / 147 S3 frames). -> Analysis scripts: `parsers/analyze_3_31_26.py`. - -#### Overview - -Event download uses four SUBs in a key-driven iterator loop. The -"waveform key" is a 4-byte opaque record address that uniquely identifies -one histogram bin or waveform record on the device's internal storage. - -| Step | BW SUB | S3 Response | Purpose | -|---|---|---|---| -| 1 (once) | `1E` — EVENT_HEADER | `E1` | Get the first waveform key | -| 2 | `0A` — WAVEFORM_HEADER | `F5` | Check record type / confirm full bin | -| 3 | `0C` — WAVEFORM_RECORD | `F3` | Download 210-byte record (peaks, project, timestamp) | -| 4 | `1F` — EVENT_ADVANCE | `E0` | Advance iterator, get next key | -| ↑ repeat steps 2–4 until key == `00 00 00 00` | | | | - -**Blastware optimisation (confirmed):** Step 2 (0A) is only called for the -_first_ key. Subsequent keys come from `1F` with token `0xFE` (download -mode), which guarantees they are full records — so Blastware skips 0A and -jumps directly to 0C. Our implementation follows the same pattern. - ---- - -#### 7.7.1 Waveform Key - -The waveform key is a 4-byte opaque record address (`uint32`, likely -a flash sector offset or circular-buffer pointer internal to the S3 DSP). - -- First key: returned by `1E` at `data[11:15]` -- Subsequent keys: returned by `1F` at `data[11:15]` -- Terminator: `00 00 00 00` signals no more events - -Example keys from 3-31-26 capture (one Blastware "event"): -``` -01 11 00 16 ← first key (full record — see §7.7.3 for length disambiguation) -01 11 11 B6 ← intermediate boundary key -01 11 11 F6 ← intermediate boundary key -01 11 12 36 ← next real-event key -00 00 00 00 ← terminator -``` - -> ⚠️ The 3-31-26 capture was the only "events present" capture available at the -> time of original analysis and contained a single event. The "0x30 = full / -> 0x26 = partial" interpretation in earlier drafts was an artifact of that -> single-event capture; the canonical lengths are `0x46` (real event) and `0x2C` -> (boundary), confirmed across 5-1-26 multi-event captures. See §7.7.3 / §7.8.8. - ---- - -#### 7.7.2 Token Byte (SUB 1E / 1F) - -> ✅ **CORRECTED 2026-04-06** — token byte is at **`params[7]`** (not `params[6]`). -> Confirmed from raw params `00 00 00 00 00 00 00 FE 00 00` in both the 3-31-26 -> and 4-3-26 BW TX captures. With the wrong position the device silently ignores -> the token. - -A token byte at **`params[7]`** controls the 1E/1F behaviour: - -| Token | Mode | Behaviour | -|---|---|---| -| `0x00` | Browse | Advance one record across the full event chain (including boundary keys) | -| `0xFE` | Download (arm) | Used in the 5A bulk-stream arming sequence — see §6.1 | - -**Browse vs download is context-dependent:** - -- `count_events()` and the "Download All" pre-walk (§7.8.8) use **browse mode - (token=`0x00`)** to enumerate the full key chain and discriminate real events - from boundaries via SUB 0A's echoed length (§7.7.3). -- `get_events()` uses `0xFE` for the **arm step** between 0A and 0C (REQUIRED - to wake the 5A state machine — see §6.1) and after 1F to arm the bulk stream, - but then uses browse-mode 1F to advance to the next event key after a - successful 5A. - -Calling 1F with `0xFE` cold (without the preceding 0A and 1E-arm) returns the -null sentinel regardless of how many events are stored — an earlier observation -that token=0xFE "returns null" was the result of testing without those -prerequisite steps. - ---- - -#### 7.7.3 Variable DATA_LENGTH for SUB 0A (WAVEFORM_HEADER) - -> ✅ **CORRECTED 2026-05-01** — earlier values `0x30` / `0x26` came from the -> deprecated histogram-only walk. Confirmed values for triggered-event downloads -> are `0x46` / `0x2C` (see §5.1, §7.8.8). - -Unlike all other SUBs, `0A` does NOT have a fixed data length. The length -is echoed in the probe response at `data[5]` (and is also the value the -data-request step sends back as its offset): - -| Length | Meaning | -|---|---| -| `0x46` (70 bytes) | Full triggered-event waveform header — has a real event to download | -| `0x2C` (44 bytes) | Boundary marker / monitor-log partial record — no triggered event | - -Both the probe and data-request frames carry the same key in `params[4..7]`. -`read_waveform_header()` (protocol.py) reads the echoed length from the probe -response and uses it as the data-request offset, then returns -`(raw_data, length)` so callers (`get_events`, `get_monitor_log_entries`, -"Download All" walk) can decide whether to issue a 0C/5A download or just -advance the iterator. - ---- - -#### 7.7.4 Response Data Section Layout - -**All S3 event download responses** share this data section prefix: - -``` -data[0] LENGTH_ECHO — echoes the request DATA_LENGTH byte -data[1..4] 00 00 00 00 — four zero bytes -data[5..8] KEY_ECHO — echoes the 4-byte waveform key from the request -data[9..10] 00 00 — two zero bytes -data[11..] ACTUAL_DATA — real payload starts here -``` - -Actual data lengths: -- `1E` response (`E1`): `data[11:19]` — 8 bytes (`data[11:15]` = key4) -- `0A` probe response (`F5`): `data[4]` = variable length (0x30 or 0x26) -- `0A` data response (`F5`): `data[11:11+length]` — waveform header bytes -- `0C` data response (`F3`): `data[11:11+0xD2]` — 210-byte waveform record -- `1F` response (`E0`): `data[11:15]` = next key4; `data[8]` = token echo - ---- - -#### 7.7.5 Waveform Record Layout (210 bytes, SUB F3 → response F3) - -> ✅ **Updated 2026-04-01** — Full timestamp layout confirmed against Blastware -> event report (BE11529 thump event, "00:28:12 April 1, 2026"). Record type -> encoding corrected (byte[1], not ASCII string search). Peak Vector Sum field -> confirmed at fixed offset 87. - -The 210-byte record (`data_rsp.data[11:11+0xD2]`) contains: - -**Header / Timestamp** — two layouts exist; **detect via `byte[0]`** of the record header: - -- `byte[0] != 0x10` → **9-byte format** (sub_code=0x10, single-shot waveform) -- `byte[0] == 0x10` → **10-byte format** (sub_code=0x03, continuous waveform; same - layout as partial monitor-log records — see §7.10 / `_decode_0a_partial_header` in client.py) - -The auto-detect logic lives in `_decode_waveform_record_into` (client.py) and in -`_decode_0a_partial_header` for monitor log entries. - -**9-byte format — sub_code = 0x10 (Waveform single-shot) ✅ CONFIRMED 2026-04-01:** -``` -byte[0]: day (uint8) -byte[1]: sub_code 0x10 = Waveform single-shot -byte[2]: month (uint8) -bytes[3–4]: year (uint16 big-endian) -byte[5]: unknown (0x00 in all observed samples ❓) -byte[6]: hour (uint8) -byte[7]: minute (uint8) -byte[8]: second (uint8) -``` - -Thump event raw bytes (2026-04-01 00:28:12, single-shot): -``` -01 10 04 07 ea 00 00 1c 0c -↑ ↑ ↑ ↑──↑ ↑ ↑ ↑ ↑ -d=1 sub m=4 y=2026 ? h=0 m=28 s=12 -``` - -**10-byte format — sub_code = 0x03 (Waveform continuous) ✅ CONFIRMED 2026-04-03:** - -One byte wider than the single-shot layout. All subsequent fields shift +1. - -``` -byte[0]: 0x10 (marker byte; how the decoder distinguishes the two layouts) -byte[1]: day (uint8) -byte[2]: 0x10 (marker; reflects the wire-encoded sub_code=0x03) -byte[3]: month (uint8) -bytes[4–5]: year (uint16 big-endian) -byte[6]: unknown (0x00 ❓) -byte[7]: hour (uint8) -byte[8]: minute (uint8) -byte[9]: second (uint8) -``` - -Continuous event raw bytes (2026-04-03 15:20:17): -``` -10 03 10 04 07 ea 00 0f 14 11 -``` - -Cross-referenced against the `.MLG` file for a single-shot event, which stores an -8-byte timestamp at two offsets (trigger time and end time): -``` -MLG format: [day:1][month:1][year:2 LE][?:1][hour:1][min:1][sec:1] -01 04 ea 07 00 00 1c 0c → trigger at April 1, 2026 00:28:12 -01 04 ea 07 00 00 1c 0f → end time April 1, 2026 00:28:15 (3.0 s record time ✅) -``` - -**Record type** — encoded in `byte[1]` (single-shot) or `byte[0]/byte[2]` markers -(continuous), NOT as an ASCII string: -- `0x10` at `byte[1]` → Waveform single-shot ✅ -- `0x10` at `byte[0]` + `0x10` at `byte[2]` → Waveform continuous ✅ -- histogram sub_code: not yet confirmed in a 0C response (the monitor-log - 10-byte timestamp uses the same continuous-mode marker) - -**Peak particle velocity floats** (✅ CONFIRMED 2026-03-31, re-confirmed 2026-04-01): - -Channel labels `"Tran"`, `"Vert"`, `"Long"`, `"MicL"` are embedded as -ASCII strings at variable offsets within the record. The PPV float for -each channel is at `label_offset + 6` (IEEE 754 big-endian float32). - -The floats are **NOT 4-byte aligned** — Tran, Long, and MicL all fall at -non-aligned offsets. The previous heuristic step-4 scanner missed all three. - -Confirmed offsets from thump event (2026-04-01, cross-referenced vs Blastware): -``` -"Tran" at offset 99 → float at 105 = 0x3ED70A2D = 0.420 in/s ✅ Blastware: 0.420 -"Vert" at offset 114 → float at 120 = 0x4077AE01 = 3.870 in/s ✅ Blastware: 3.870 -"Long" at offset 129 → float at 135 = 0x3EFD7090 = 0.495 in/s ✅ Blastware: 0.495 -"MicL" at offset 144 → float at 150 = 0x3985114E = 0.000254 psi -``` - -Channel labels are separated by inner-frame bytes `10 03` (DLE ETX), -preserved as literal data by `S3FrameParser`. - -**Peak Vector Sum** (✅ CONFIRMED 2026-04-01; offset corrected 2026-04-03): - -``` -Location: tran_pos − 12 (label-relative; IEEE 754 big-endian float32) - = √(Tran² + Vert² + Long²) at the sample instant of maximum - combined geo motion - NOT the vector sum of the three per-channel peaks (those may - occur at different sample times) -``` - -> ⚠️ **Do NOT use fixed offset 87.** That value only happens to be correct for -> `sub_code = 0x10` (single-shot) records, where the 9-byte timestamp leaves the -> peak vector sum at byte 87. For `sub_code = 0x03` (continuous) records, the -> 10-byte timestamp pushes everything one byte later — `tran_pos − 12` is the -> canonical label-relative location and works for both record types. - -``` -Thump event (single-shot, tran_pos=99): - Value at tran_pos − 12 = byte 87 = 0x4079F6C5 = 3.906 in/s - ✅ matches Blastware "Peak Vector Sum: 3.906 in/s" -Near-ambient (single-shot): 0x3C75C28F = 0.015 in/s -``` - -**Project strings** — ASCII label-value pairs (search for label, read null-terminated value): -``` -"Project:" → project description (in 0C record ✅, also mirrored in metadata pages) -"Client:" → client name (in SUB 5A metadata pages ✅ — NOT in 0C) -"User Name:" → operator / user (in SUB 5A metadata pages ✅ — NOT in 0C) -"Seis Loc:" → sensor location (in SUB 5A metadata pages ✅ — NOT in 0C) -"Extended Notes"→ notes field (in SUB 5A metadata pages ✅) -``` - -> ✅ **UPDATED 2026-05-05:** `Client:`, `User Name:`, and `Seis Loc:` come from the -> dedicated **SUB 5A metadata pages at counter `0x1002` and `0x1004`** — see §7.8.7. -> They are NOT present in the 210-byte SUB 0C waveform record. -> -> An earlier draft of this doc claimed they came from "A5 frame 7" of the bulk waveform -> stream — that was an artifact of the deprecated `0x0400`-step walk where the broken -> chunk counter formula happened to land sample-chunk fi=7 on top of the 0x1002 metadata -> page. Under the corrected v0.14.0+ walk (§7.8.5), sample chunks at `0x1000` / `0x1200` -> contain ordinary waveform data, and the metadata pages are read separately. -> -> The strings reflect the compliance setup that was active when the *monitoring session* -> first started (not per-event). `get_events()` reads the metadata pages once at the start -> of the SFM session and the decoded values are stamped onto every event in that session. - ---- - -#### 7.7.6 Complete Download Loop (Python pseudocode) - -```python -key4, _ = proto.read_event_first() # SUB 1E -if key4 == b'\x00\x00\x00\x00': - return [] # no events - -events = [] -is_first = True - -while key4 != b'\x00\x00\x00\x00': - if is_first: - _header, rec_len = proto.read_waveform_header(key4) # SUB 0A - is_first = False - if rec_len < 0x30: - key4 = proto.advance_event() # skip partial first bin - continue - - record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) - events.append(decode(record)) - - key4 = proto.advance_event() # SUB 1F (token=0xFE) - -return events -``` - ---- - -### 7.7.7 Updated Download Loop with SUB 5A Metadata - -> ⛔ **The loop in this subsection is DEPRECATED — it uses the broken `stop_after_metadata=True` -> hack and the wrong sequence ordering.** See §7.8.5–§7.8.8 for the corrected protocol. -> The pseudocode below is preserved as historical record only. - -```python -key4, _ = proto.read_event_first() # SUB 1E -if key4 == b'\x00\x00\x00\x00': - return [] - -events = [] -is_first = True - -while key4 != b'\x00\x00\x00\x00': - if is_first: - _header, rec_len = proto.read_waveform_header(key4) # SUB 0A - is_first = False - if rec_len < 0x30: - key4 = proto.advance_event() - continue - - record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) - event = decode(record) - - a5_data = proto.read_bulk_waveform_stream( # SUB 5A → A5 frames - key4, stop_after_metadata=True) - client._decode_a5_metadata_into(a5_data, event) # overwrites project_info - - events.append(event) - key4 = proto.advance_event() # SUB 1F (token=0xFE) - -return events -``` - ---- - -### 7.8 SUB 5A — Bulk Waveform Stream (event-time metadata) - -> ✅ **§7.8.1 (frame format) — added 2026-04-02; v0.14.3 partial DLE stuffing finalized 2026-05-05.** -> Frame format confirmed by reproducing Blastware wire bytes byte-for-byte across the 1-2-26 -> capture (10 frames) and the 5-1-26 bwcap3sec capture (17 frames, all match including the -> DLE-stuffed `10 10 00` for counter=0x1000). - -SUB 5A initiates a bulk transfer of the raw sample data for a stored event. The response is -a sequence of A5 frames. Project-info ASCII strings (`Project:`, `Client:`, `User Name:`, -`Seis Loc:`, `Extended Notes`) live in the dedicated metadata pages at counter `0x1002` -and `0x1004` (see §7.8.7), not in the sample-chunk stream. - -**For the corrected protocol read in order:** -- §7.8.1 — frame format (raw `offset_hi`, DLE-aware checksum, partial DLE stuffing of params) -- §7.8.5 — chunk addressing (probe → metadata pages → samples → TERM, all bounded by `end_offset`) -- §7.8.6 — TERM frame formula -- §7.8.7 — fixed metadata pages 0x1002 / 0x1004 -- §7.8.8 — multi-event "Download All" sequence - -§7.8.2–§7.8.4 are retained as historical record of earlier (incorrect) understandings — -do not implement against them. - -#### 7.8.1 Frame Format - -SUB 5A uses a **non-standard frame layout** that differs from all other BW→S3 write commands. - -``` -[ACK][STX][10][10][00][5A][00][offset_hi][offset_lo][params...][chk][ETX] - 41 02 10 10 00 5A 00 ^^raw^^ ^^raw^^ ^^stuffed^^ -``` - -Three critical differences from `build_bw_frame`: - -1. **`offset_hi` is sent raw, not DLE-stuffed.** When `offset_hi = 0x10`, the wire carries - a bare `0x10` — NOT the stuffed `10 10` that `build_bw_frame` would produce. The device - ignores frames where this byte is incorrectly stuffed. - -2. **DLE-aware checksum.** Walking the full frame byte sequence: when a `10 XX` pair is seen, - only `XX` is added to the running sum; lone bytes are added normally. - -3. **Partial DLE stuffing of `0x10` bytes in the params region** (CONFIRMED 2026-05-05). - The device's de-stuffing rule for the params region is: - - - `10 10` → de-stuffs to `10` - - `10 02 / 03 / 04` → kept literal (these are inner-frame markers) - - `10 X` for other X → de-stuffs to just `X` (drops the leading `0x10`) - - Therefore any `0x10` byte in the *logical* params that is followed by a byte NOT in - `{0x02, 0x03, 0x04, 0x10}` MUST be doubled on the wire (`10 X` → `10 10 X`) so the - device's de-stuffer reproduces the original `10 X` pair. This applies most commonly - to counters with `0x10` in the high byte (e.g. counter=`0x1000` produces logical - params bytes `... 10 00 ...`, which BW encodes on the wire as `... 10 10 00 ...`). - Without this stuffing the device interprets counter=`0x1000` as `0x0000` and returns - the probe response (= a copy of the file header + STRT record); that STRT block then - ends up embedded in the assembled file body and Blastware refuses to open the file. - - `0x10` bytes in `offset_hi` are still written RAW per (1) above — only the params - region has this stuffing requirement. Metadata-page params for counter `0x1002` / - `0x1004` survive without stuffing because `10 02` / `10 04` fall in the "kept literal" - carve-out. - - Verified against BW 5-1-26 bwcap3sec frame 20: params logical bytes - `00 01 11 10 00 00 00 00 00 00 00` (counter=0x1000) are encoded on the wire as - `00 01 11 10 10 00 00 00 00 00 00 00` (12 wire bytes for 11 logical bytes). - -#### 7.8.2 Request Sequence — DEPRECATED 2026-05-01 (see §7.8.5–§7.8.7 for the corrected protocol) - -> ⛔ **The 0x0400-step / max(key4[2:4], 0x0400) formula in this section is WRONG.** Five new -> BW MITM captures (4-27-26 + 5-1-26) prove the actual chunk increment is **0x0200**, the -> chunk loop is bounded by `end_offset` from the STRT record (not by chunk count or by a -> device-side timeout), and the TERM frame's `offset_word=0x005A` magic is incorrect — the -> real TERM offset_word is computed from `end_offset` and the last chunk address. Under the -> deprecated formula SFM over-reads roughly 5× past the actual event end into post-event -> circular-buffer garbage, corrupting reconstructed Blastware files for any waveform ≥ 2 sec. -> -> The whole "stop_after_metadata + one extra chunk + 0e 08 footer" workaround in this -> section was compensating for the missing end_offset bound. It is obsoleted by the -> STRT-bounded walk in §7.8.5. -> -> **Read this section for historical context only.** For the correct protocol, jump to: -> - §7.8.5 — chunk addressing and the STRT end_offset -> - §7.8.6 — TERM frame formula -> - §7.8.7 — fixed metadata pages 0x1002 and 0x1004 - -| Frame | offset_word | counter | params | Purpose | -|---|---|---|---|---| -| Probe | `0x1004` | `0x0000` | 10 bytes (`bulk_waveform_params(0)`) | Initiate transfer | -| Chunk 1 | `0x1004` | `max(key4[2:4], 0x0400)` | 11 bytes | First data chunk | -| Chunk 2 | `0x1004` | `max(key4[2:4], 0x0400) + 0x0400` | 11 bytes | Second chunk | -| Chunk N | `0x1004` | `max(key4[2:4], 0x0400) + (N-1) * 0x0400` | 11 bytes | Nth chunk | -| … | … | … | … | … | -| Termination | `0x005A` | `max(key4[2:4], 0x0400) + N * 0x0400` | 10 bytes | End transfer | - -> Historical correction notes (left in place to deter re-derivation of the same wrong formula): -> the table above was the result of three iterative "corrections" between 2026-04-06 and -> 2026-04-26 that progressively narrowed in on the wrong answer because every test was on -> events with `key4[2:4]=0` and the device responds to whatever counter you ask for. The -> 5-1-26 captures with a non-zero start_key event (`01112238`) finally exposed the bug. - -The `stop_after_metadata=True` flag (deprecated as a primary loop-exit) scanned for -`b"Project:"` in the chunk stream because the metadata strings happened to be reachable -when the broken 0x0400-step walk passed the global metadata pages at 0x1002/0x1004. Under -the corrected walk, those strings come from explicit reads at counter=0x1002 and 0x1004, -not from the sample-chunk stream — see §7.8.7. - -#### 7.8.3 A5 Frame Layout — DEPRECATED 2026-05-01 - -> ⛔ **The "Frame 7 carries the compliance text block" claim below is WRONG.** It was -> an artifact of the deprecated `0x0400`-step walk where the broken counter formula -> happened to land sample-chunk fi=7 on top of the 0x1002 metadata page in flash. -> Under the corrected v0.14.0+ walk (§7.8.5), Frame 7 of the sample-chunk sequence is -> just sample-chunk #5 (counter=0x1000), and contains either ordinary waveform data or — -> critically when DLE-stuffing of params is wrong (§7.8.1.3) — a duplicate file header + -> STRT block when the device misinterprets counter=0x1000 as 0x0000. See §7.8.7 for the -> actual source of these strings. - -Historical claim (NOT TO BE IMPLEMENTED): each A5 response frame contains a chunk of raw -bulk data; Frame 7 of the stream carries the compliance text block with all project-info -label-value pairs: - -``` -"Project:" → null-terminated project name -"Client:" → null-terminated client name -"User Name:" → null-terminated operator name -"Seis Loc:" → null-terminated sensor location -"Extended Notes" → null-terminated notes -``` - -All five fields do reflect the **setup at event-record time**, not the current device -config. But the source is the metadata pages (§7.8.7), not "Frame 7" of the sample -stream. - -#### 7.8.4 End-of-Stream Behaviour and Chunk Timing — REINTERPRETED 2026-05-01 - -> The "1 raw byte then silence" pattern documented below was originally interpreted as -> "the device's natural end-of-event signal." The 5-1-26 captures show this is actually -> the device's response when the requester has walked **past** the addressable buffer -> region (i.e. ~5× past the actual event end under the deprecated 0x0400-step walk). -> Under the corrected STRT-bounded walk (§7.8.5), the stream ends cleanly with the TERM -> frame's response — no timeout, no 1-byte teaser. The fallback below remains useful as -> defensive handling for malformed events but should not be the primary loop-exit. - -**Defensive fallback handling in `read_bulk_waveform_stream`:** -``` -TimeoutError caught (rare under corrected walk): - if bytes_fed > 0 AND frames already collected: - → graceful end-of-stream; break loop; proceed to termination frame - else (bytes_fed == 0, no prior frames): - → genuine transport failure; re-raise -``` - -**Chunk timing (BE11529, 1024 sps, TCP/cellular) — total A5 frames per event:** - -| Metric | Observed value | -|---|---| -| Chunk response time | ~1 s per chunk | -| 2-sec event 1 (corrected walk) | ~15 frames (probe + 2 metadata pages + ~12 sample chunks + TERM) | -| 3-sec event 1 (corrected walk) | 16 frames (probe + 2 metadata pages + 13 sample chunks + TERM) | -| 2-sec continuation event (corrected walk) | 16 frames (~15 sample chunks + TERM; no metadata reread) | -| 3-sec continuation event (corrected walk) | ~15 frames (~14 sample chunks + TERM) | -| Same event under deprecated 0x0400 walk | ~37 frames (over-reads ~5× into post-event garbage) | -| Data per chunk (corrected, 0x0200 size) | ~540–575 bytes wire (= 0x0200 payload + framing) | -| Data per chunk (deprecated 0x0400 step) | 1,036–1,123 bytes wire (= 0x0400 payload + framing) | -| Safe recv timeout per chunk | **10 s** (10× typical) | -| Default transport timeout | 120 s → ~2-min stall at end-of-stream | - -**ADC count-to-physical conversion — ✅ CONFIRMED 2026-04-17:** - -Raw samples are signed 16-bit integers (−32,768 to +32,767). Source: Interface Handbook §4.5. - -**CONFIRMED 2026-04-17** — The `max_range_geo` field (float32 = 6.206053, bytes `40 C6 97 FD`) is the **ADC-to-velocity scale factor** (inverse sensitivity, (in/s)/V) for the standard Instantel geophone, confirmed from Interface Handbook §4.5. The correct conversion formula is: - -``` -PPV (in/s) = ADC_voltage (V) × 6.206053 - = counts × (1.61133 / 32767) × 6.206053 - = counts × 4.982e-5 (in/s per count at full scale) -``` - -where `geo_range = 1.61133 V × 6.206053 = 10.000 in/s` is the Normal (Gain=1) full-scale range. The earlier ~9× overread was caused by mistakenly using 6.206053 as the range directly — it is actually the scale factor, and the range itself is `ADC_fullscale × scale_factor = 1.61133 × 6.206053 = 10.000 in/s`. Mic channel uses psi units with its own range (still unresolved). - -**Decoder note — fi==9 hardcoded skip (FIXED 2026-04-06):** - -`_decode_a5_waveform()` previously had `elif fi == 9: continue` — a leftover from -the original 9-frame blast capture where frame 9 was assumed to be the device -terminator. Removed. Under the v0.14.0+ STRT-bounded walk the chunk loop never -encounters a "terminator frame index" anyway — it stops at `end_offset` -calculated from the STRT record (§7.8.5) and the TERM frame is sent explicitly -(§7.8.6). For other decoders, terminator detection should use -`frame.page_key == 0x0000`, not a hardcoded frame index. - -#### 7.8.5 Chunk addressing and the STRT end_offset (NEW 2026-05-01) ✅ - -> ✅ Confirmed across 3 events (4-27-26 + 5-1-26 captures). - -`params[0]` is always `0x00`. `params[1:5]` is a 4-byte absolute device flash-buffer -address — equivalently, "the key of the page being requested." The device returns 0x0200 -(= 512) bytes starting at that address. Increments between consecutive sample chunks are -**0x0200, NOT 0x0400** (the previous 0x0400 figure was a Blastware-side artifact / our -implementation's bug — see §7.8.2). - -##### STRT record (data layout in the first A5 response) - -The first A5 response (the probe response, or the first chunk for continuation events) -contains a **STRT record** at byte offset 17 of `data`: - -``` -data[ 0:14] echoes request: [chunk_size_hi=0x02 / 0x04 ...] [00] [01 11] [counter_hi counter_lo] [00 × 8] [00 12] -data[14:17] 10 03 00 ← inner DLE+ETX frame separator (preserved literally) -data[17:21] "STRT" ← magic -data[21:23] ff fe ← sentinel -data[23:27] end_key ← 4-byte key of where this event ENDS -data[27:31] start_key ← 4-byte key of where this event STARTS -data[31:33] uint16 BE ← ?? sample count or byte count, varies (not yet decoded) -data[33:35] uint16 BE ← ?? -data[35] 0x46 ← record type marker (waveform full record) -data[36:] additional pointers / first sample bytes — content varies by event -``` - -`end_offset = (end_key[2] << 8) | end_key[3]` is **the authoritative event-end pointer**. -Use it to bound the chunk loop and to compute the TERM frame. - -##### Chunk pattern by event location in buffer - -**Event 1 / start_key[2:4] = 0x0000** (first event after erase or wrap): - -``` -1. Probe at counter = 0x0000 (params[1:5] = full key) -2. Read fixed metadata pages counter = 0x1002, then 0x1004 -3. Walk sample chunks counter = 0x0600, 0x0800, …, by 0x0200, - up to but not including end_offset & 0xFE00 -4. TERM (see §7.8.6) -``` - -The range `[0x0046, 0x0600)` is skipped — likely some pre-event firmware-reserved area for -the first slot in a freshly-erased buffer. Harmless to skip; BW does the same. - -**Event 2+ / start_key[2:4] != 0x0000** (continuation events in a populated buffer): - -``` -1. First chunk at counter = start_key[2:4] ← acts as both probe and first - sample chunk; response carries STRT at byte 17 -2. Walk sample chunks counter += 0x0200 each -3. TERM -``` - -**`start_key` here is the off=0x46 WAVEHDR record key returned by 1F** (e.g. `01112238`), -NOT the off=0x2C boundary key that immediately precedes it. An earlier draft of this -spec described event-N as "probe at start + 0x46" — that formula was correct only if -"start" meant the boundary key (0x21F2 in the 5-1-26 event 2 case). In the iteration -walk used by SFM and BW, `cur_key` passed into the 5A flow is always the off=0x46 key, -so the probe counter equals `cur_key[2:4]` with no extra offset. Adding +0x46 places -the probe one WAVEHDR past the actual event start, the response no longer contains -STRT at byte 17, and the chunk loop falls back to the `max_chunks` cap. - -Confirmed: -- 5-1-26 "copy 2nd address" BW capture: probe counter=0x2238 with key=01112238; A5[0] - has STRT@17 with end_offset=0x417E. -- 5-4-26 BW 2-sec event capture: same probe counter=0x2238, same end_offset=0x417E. - -**No metadata-page reads.** Pages 0x1002/0x1004 are session-global and were already read -during event 1 in the same Blastware session. In SFM, treat metadata pages as a once- -per-`MiniMateClient.connect()` (or once-per-call-home) read, not per-event. - -##### Verified end_offset values - -| Capture | start_key | end_key | end_offset | event size | sample-chunk start | -|---|---|---|---|---|---| -| 4-27-26 "open 2sec" / "copy event to disk" | `01110000` | `01111ABE` | `0x1ABE` | 6,846 B | 0x0600 (event-1 case) | -| 5-1-26 "copy 3sec" / Download All event 1 | `01110000` | `011121F2` | `0x21F2` | 8,690 B | 0x0600 (event-1 case) | -| 5-1-26 "copy 2nd address" / DA event 2 | `01112238` (= 1F result) | `0111417E` | `0x417E`, span 0x1F8C = 8,076 B | 0x2238 (= cur_key[2:4]) | -| 5-4-26 BW 2-sec event | `01112238` | `0111417E` | `0x417E` | 0x2238 (= cur_key[2:4]) | - -#### 7.8.6 TERM Frame Formula (NEW 2026-05-01) ✅ - -> ✅ Confirmed across 3 events. Replaces the deprecated `offset_word=0x005A` / `params[2] = key4[2]` formula in §7.8.2. - -The TERM frame fetches the partial last chunk and the file footer. Its response payload -contains the bytes between the last full 0x0200-aligned chunk and `end_offset` — typically -20–520 B — and is **required for reconstructing the Blastware waveform file**. Append the -TERM response data to the chunk stream like any other A5 frame. - -``` -last_chunk_counter = address of last full 0x0200-byte chunk read -next_boundary = last_chunk_counter + 0x0200 -TERM offset_word = end_offset - next_boundary -TERM params[0] = key[0] (= 0x01 on every observed device) -TERM params[1] = key[1] (= 0x11) -TERM params[2] = (next_boundary >> 8) & 0xFF -TERM params[3] = next_boundary & 0xFF -TERM params[4:10] = zeros ← 10-byte params (not 11) - -Frame = build_5a_frame(offset_word, params) -``` - -The device receives `requested_address = (params[2] << 8) | offset_word` (where offset_word -contains both `offset_hi` and `offset_lo` of the 5A frame, with the high bit of offset_hi -being effectively `bit 0 of (end_offset >> 8)`). It reconstructs `end_offset` and replies -with `(end_offset - next_boundary)` bytes of waveform tail starting at `next_boundary`. - -##### Verification - -| Event | end_offset | last chunk | next_boundary | TERM offset_word | TERM params[2:4] | TERM response size | -|---|---|---|---|---|---|---| -| 2-sec | `0x1ABE` | `0x1800` | `0x1A00` | `0x00BE` ✓ | `1A 00` ✓ | 208 B | -| 3-sec | `0x21F2` | `0x1E00` | `0x2000` | `0x01F2` ✓ | `20 00` ✓ | 520 B | -| Event-2 | `0x417E` | `0x3E38` | `0x4038` | `0x0146` ✓ | `40 38` ✓ | (not measured directly; same pattern) | - -Equivalent way to write the formula: -- `offset_word = end_offset & 0x01FF` — low 9 bits of end_offset -- `params[2:4] = (end_offset & 0xFE00) BE` — high 7 bits of end_offset, low byte zeroed - -(The two forms are arithmetically identical to `end_offset - next_boundary` and -`next_boundary` because `next_boundary = end_offset & 0xFE00` whenever the chunk loop -stopped at the last full 0x0200 boundary below end_offset.) - -#### 7.8.7 Fixed Metadata Pages 0x1002 / 0x1004 (NEW 2026-05-01) 🔶 - -> 🔶 Inferred — observed in BW captures but page contents not yet byte-decoded. - -Two chunk addresses are **GLOBAL** device/session metadata, not event-specific: - -- `counter = 0x1002` — first metadata page -- `counter = 0x1004` — second metadata page - -These are at fixed absolute addresses in the device's flash buffer. They contain the -session-start compliance-setup ASCII strings — **Project**, **Client**, **User Name**, -**Seis Loc**, **Extended Notes** — that under the deprecated 0x0400-step walk used to be -discoverable in the sample-chunk stream as "A5 frame 7" content. Under the corrected -0x0200-step walk these strings come exclusively from the dedicated metadata-page reads, -not from sample chunks. - -##### Caching strategy - -BW reads them ONCE per Blastware session, during event 1's download, and caches them. -For SFM: -- Read once per `MiniMateClient.connect()` / once per call-home session. -- Subsequent events in the same session don't need to re-fetch them. -- Their content does not change while iterating events. They DO change when the user - applies a new compliance setup (SUB 71 write) — invalidate the cache then. - -##### Content layout — string-search decoder in place - -The full byte-for-byte structural layout of pages 0x1002 and 0x1004 has not been -mapped, but `_decode_a5_metadata_into` (`minimateplus/client.py`) successfully -extracts the user-facing strings via label scans: - -``` -b"Project:" → project description -b"Client:" → client name -b"User Name:" → operator -b"Seis Loc:" → sensor location -b"Extended Notes" → notes -``` - -This works across all observed captures (4-27-26, 5-1-26, 5-4-26). A future -project could dump the structural layout if additional session-global fields -need to be extracted — but the strings already decode correctly. - -#### 7.8.8 "Download All" Sequence (NEW 2026-05-01) ✅ - -> ✅ Confirmed from 5-1-26 "Download All" capture (`raw_*_171216_download_all_2events.bin`). - -Before any 5A traffic, BW's "Download All" pre-walks the entire event chain to map keys -and event boundaries: - -``` -SERIAL × 2 → CHCFG → EVT_KEY (1E, all-zero) → key0 - → WAVEHDR (0A, key0) → off=0x46 (real event start) - → EVT_NEXT (1F, all-zero) → key1 - → WAVEHDR (0A, key1) → off=0x2C (boundary) - → EVT_NEXT → key2 - → WAVEHDR (0A, key2) → off=0x46 (real event start) - → EVT_NEXT → key3 - → WAVEHDR (0A, key3) → off=0x2C (boundary) - → EVT_NEXT → null sentinel -``` - -The DATA_LENGTH at `data_rsp.data[5]` (echoed BW offset for the data fetch step) -disambiguates real events from boundary markers: - -| WAVEHDR offset | Meaning | -|---|---| -| `0x46` (= 70) | Real event start key — this key has event data behind it | -| `0x2C` (= 44) | Boundary marker — this key is the END of the previous event AND the start of the empty/header gap before the next event | - -Pairs: each real event spans `[real_key, next_real_key)` in the buffer. In the example -above: event 1 = `[01110000, 011121F2)`, event 2 = `[01112238, 0111417E)`. Note that the -"end of event 1" key (`011121F2`) is also the "boundary key" that comes BEFORE event 2's -real start key (`01112238`) — they differ by exactly 0x46 bytes (the event header size). - -After the pre-walk completes, BW downloads each `0x46`-keyed event in turn using the 5A -bulk stream protocol from §7.8.5. Use the `0x46` keys, not the `0x2C` keys, as input to -`read_bulk_waveform_stream`. - ---- - -## 7.9 Compliance Config Field Inventory (Blastware UI, 2026-04-08) ✅ - -Fields visible in the Blastware "Compliance Setup" dialog. ✅ = byte offset confirmed in code. ❓ = not yet located in raw bytes. - -### Recording Setup tab - -| Field | Values / Type | Status | -|---|---|---| -| Recording Mode | Single Shot (`0x00`) / Continuous (`0x01`) / Histogram (`0x03`) / Histogram+Continuous (`0x04`) | ✅ `recording_mode` — uint8 at **anchor − 8** (SAME offset in E5 read and SUB 71 write, using 6-byte anchor `\xbe\x80\x00\x00\x00\x00`) — confirmed 2026-04-21 | -| Record Stop Mode | Fixed Record Time / Auto / Manual Stop | ❓ Hint: `data[40]` in E5 sf1 changed `01 7F` → `00 00` alongside Continuous → Single Shot; may be related but unconfirmed independently | -| Sample Rate | Standard 1024 / Fast 2048 / Faster 4096 sps | ✅ `sample_rate` — uint16 BE at **anchor − 6** | -| Record Time | float, seconds (3, 5, 8, 10, 13…) | ✅ `record_time` — float32 BE at **anchor + 6** | -| Histogram Interval | `2s / 5s / 15s / 1m / 5m / 15m` (uint16 BE seconds; mode-gated to Histogram / Histogram+Continuous) | ✅ `histogram_interval_sec` — uint16 BE at **anchor − 4**, same in read and write — confirmed 2026-04-20 | -| Storage Mode | Save All Data / Save Triggered | ❓ | -| Geophone Type | Standard Triaxial / 4.5 Hz Geophone | ❓ | -| Geophone — Enable all | bool | ❓ | -| Geophone — Trigger Source | bool | ❓ | -| Chan 1-3 Trigger Level | float, in/s | ✅ `trigger_level_geo` | -| Chan 1-3 Maximum Range (range selector) | Normal 10.000 / 1.25 in/s | ✅ `geo_range` uint8 — **CONFIRMED 2026-04-20.** Offset = Tran+33 (same in E5 read and SUB 71 write — 2126-byte buffer is round-tripped verbatim). `0x00`=Normal 10 in/s, `0x01`=Sensitive 1.25 in/s. Applied to Tran/Vert/Long. **`Tran+20` is NOT this field** (constant 0x01 on all captures). | -| Chan 1-3 ADC Scale Factor | 6.206053 (in/s)/V | ✅ `geo_adc_scale` float32 — **CONFIRMED 2026-04-17.** Offset = Tran+28 (same in E5 read and SUB 71 write). Inverse sensitivity = 1/0.161133. Interface Handbook §4.5: 1.61133 V × 6.206053 = 10.000 in/s. Hardware constant — do NOT write. | -| Microphone — Enable all | bool | ❓ | -| Microphone — Trigger Source | bool | ❓ | -| Chan 4 Trigger Level | float, dB or psi | ❓ | - -### Notes tab - -| Field | Values / Type | Status | -|---|---|---| -| Enable User Notes | bool | ❓ | -| Project | ASCII string | ✅ (sourced from SUB 5A metadata pages at counter `0x1002` / `0x1004` — see §7.8.7) | -| Client | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| User Name | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| Seis Loc | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| Enable Extended Notes | bool | ❓ | -| Extended Notes | ASCII text | ❓ | -| Extended Notes Title | ASCII string | ❓ | -| Enable Job Number | bool | ❓ | -| Job Number | int | ❓ | -| Enable Scaled Distance | bool | ❓ | -| Distance from Blast | float | ❓ | -| Charge Weight | float | ❓ | - -### Special Setups tab - -| Field | Values / Type | Status | -|---|---|---| -| Unit Timer Mode | Off / On | ❓ | -| Start Date/Time | date+time | ❓ | -| Stop Date/Time | date+time | ❓ | -| Self Check Mode | Off / On | ❓ | -| Self Check Time | HH:MM | ❓ | -| **Sensor Check** | **Before monitoring / After each event / Disabled** | ❓ not yet located | -| Measurement Units | Imperial / Metric | ❓ | -| Show Mic units in dB | bool | ❓ | -| Time Format | 24 Hour / 12 Hour (AM/PM) | ❓ | -| Backlight on Time | int, seconds (0–255) | ✅ event index block +75 | -| Power Saving Timeout | int, minutes | ✅ event index block +83 | -| Monitoring LCD Cycle | int | ✅ event index block +84:86 (uint16 BE) | -| Set unit time with setup | bool | ❓ | - -**Note on Sensor Check:** The dropdown has three states — "Before monitoring", "After each event", "Disabled". The user's unit always runs "Before monitoring", so no enable/disable diff capture has been done yet. Finding this byte requires a capture with Disabled vs Before-monitoring with all other settings held constant. - ---- - -## 7.10 SUB 0x0E — Channel Sensor Data & SUB 0x98 — Trigger Test ✅ 2026-04-08 - -Both confirmed from 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). - -### SUB 0x0E — Channel Sensor Data - -Standard two-step read. Data length: **0x0A (10 bytes)** per channel. - -**Request params:** Channel selector in `params[6:8]` (bytes 6 and 7 of the 10-byte params field). - -| `params[6:8]` | Channel | -|---|---| -| `00 00` | Channel 0 (Transverse) | -| `00 01` | Channel 1 (Vertical) | -| `10 02` | Channel 2 (Longitudinal) — note `0x10` in params[6] | -| `00 03` | Channel 3 | -| `10 04` | Channel 4 — note `0x10` in params[6] | -| `00 05` | Channel 5 | -| `00 06` | Channel 6 | -| `00 07` | Channel 7 | - -Response SUB = 0xFF − 0x0E = **0xF1**. - -**Response data (10 bytes at section = data[11:]):** - -The data response payload for each channel is 10 bytes. From the sensor-check S3 capture, -channels 0 and 1 have non-zero data; channels 5–7 are all-zero (no sensors connected to those channels). Full byte-level field mapping NOT YET done — data includes overswing ratio, frequency, and amplitude per the Blastware "Unit Channel Test" dialog columns. - -Example (channel 0, first pass): -``` -data[11:] = 00 01 00 00 4A 00 25 10 02 0A (17 bytes including probe + data frames combined) -``` - -Probe frame response confirms data length in page bytes; data frame carries the 10-byte channel reading. - -**Blastware "Unit Channel Test" sequence (confirmed 4-8-26/sensor-check):** - -``` -SESSION_RESET + POLL × 3 (startup — SESSION_RESET required for monitoring unit) -SUB 0x08 (event index read) -POLL × 8 (Blastware polls while waiting; unit may be in sensor check during this window) -SUB 0x15 (serial number, data length 0x0A) -SUB 0x01 (device info, data length 0x98) -SUB 0x08 (event index again) -SUB 0x01 (device info again) -SUB 0x0E × 8 channels (pass 1 — channels 0–7, probe+data each) - [~40 second gap if unit is performing on-device sensor check] -SUB 0x0E × 8 channels (pass 2 — same channels, fresh ADC readings) -SUB 0x98 × 2 (trigger test) -``` - -### SUB 0x98 — Trigger Test - -Single probe frame only. No data step. - -**Request format:** `params[0] = 0xFF` (all other param bytes = 0x00). Sent as a single frame (probe step only, no data step). - -Response SUB = 0xFF − 0x98 = **0x67**. Response is a standard 17-byte zero-data S3 frame. - -Wire bytes for request (confirmed frame 52 of 4-8-26 BW capture): -``` -41 02 10 10 00 98 FF 00 00 00 00 00 00 00 00 00 00 00 00 A7 03 -``` - -Blastware sends SUB 0x98 twice per comms-check cycle. - -### SUB 0x01 — Device Info Block ❓ - -Observed in Blastware comms-check init sequence (before 0x0E channel reads). Standard two-step read with data length 0x98 (152 bytes). - -**Response SUB = 0xFE** (= 0xFF − 0x01 = 0xFE). - -⚠️ **Naming collision:** The existing SUB 0xFE (Full Config Read, RSP 0x01) and this SUB 0x01 (RSP 0xFE) are inverse commands. They are NOT the same command. SUB 0xFE is a full 166-byte config block used for firmware version, calibration date, etc. SUB 0x01 returns 152 bytes and appears to contain a subset of device identification data. - -Observed payload (data[11:], first ~40 bytes of 161 total): -``` -00 00 00 00 00 42 45 31 31 35 32 39 00 ... "BE11529\0" -``` -Contains serial number, firmware bytes, and floating-point calibration fields. Full field map NOT YET done. - ---- - -## 7.11 Erase-All Protocol (SUBs 0xA3 / 0xA2 / 0x06) ✅ 2026-04-11 - -> ✅ **Confirmed 2026-04-11** from MITM capture of a live Blastware ACH session -> (`bridges/captures/mitm/ach_mitm_20260411_001912/`). - -Blastware uses a 4-step sequence to erase all stored events from device memory. -All frames use standard `build_bw_frame` format (NOT write-format). - -### 7.11.1 Wire Sequence - -``` -BW → device: SUB 0xA3 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 -device → BW: SUB 0x5C (begin-erase ack) - -BW → device: SUB 0x1C offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) -device → BW: SUB 0xE3 (probe ack) -BW → device: SUB 0x1C offset=0x002C params=(same) (data) -device → BW: SUB 0xE3 (44-byte monitor status response) - -BW → device: SUB 0x06 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) -device → BW: SUB 0xF9 (probe ack) -BW → device: SUB 0x06 offset=0x0024 params=(same) (data) -device → BW: SUB 0xF9 (36-byte storage range response) - -BW → device: SUB 0xA2 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 -device → BW: SUB 0x5D (confirm-erase ack — device memory is now cleared) -``` - -All response SUBs follow the standard formula `0xFF − request_SUB`. No exceptions. -The `token=0xFE` at `params[7]` is required for 0xA3, 0x06, and 0xA2. - -### 7.11.2 SUB 0x06 Storage Range Response (36 bytes) - -The 36-byte response from the data step ends with two 4-byte event keys: - -| Offset (from response end) | Field | Notes | -|---|---|---| -| `[-8:-4]` | First stored event key | e.g. `0111ea60` before erase | -| `[-4:]` | Last stored event key | e.g. `0111eaa6` before erase | - -After a successful erase: -- Both keys read `01110000` (device-empty sentinel) -- The device's internal event counter has reset - -Example pre-erase: `... 0111ea60 0111eaa6` -Example post-erase: `... 01110000 01110000` - -### 7.11.3 Post-Erase Key Counter Reset - -After a successful erase the device resets its event counter. New events start -from key `0x01110000` — the same key as the very first event ever recorded on -the device. This means: - -- Any system using event keys for deduplication must clear its "seen keys" state - after an erase, or risk treating fresh events as already downloaded. -- Detection heuristic: if `max(device_keys) < historical_max_key`, the counter - was reset. All device keys should be treated as new regardless of prior state. - -The `ach_server.py` implementation stores `max_downloaded_key` in `ach_state.json` -and applies this heuristic on every call-home. - -### 7.11.4 Implementation Notes - -- `MiniMateClient.delete_all_events()` in `client.py` orchestrates the full sequence. -- `MiniMateProtocol` exposes `begin_erase_all()`, `confirm_erase_all()`, and - `read_event_storage_range()` as separate methods. -- The ACH server `--clear-after-download` flag calls `delete_all_events()` after a - successful event download and resets `ach_state.json` state for the unit. - ---- - -### 7.12 Auto Call Home Config (SUB 0x2C / 0x7E / 0x7F) — ✅ CONFIRMED 2026-04-20 - -> Confirmed from `bridges/captures/4-20-26/call home settings/` — 10 BW TX write frames -> diffed against the S3 read payload. Accessible in Blastware via Remote Access → Setup Unit. - -#### 7.12.1 Read Protocol — SUB 0x2C → Response 0xD3 - -Standard two-step read: - -| Step | Offset | Purpose | -|---|---|---| -| Probe | `0x0000` | Get ack (no data returned) | -| Data | `0x007C` (124) | Receive 125-byte raw payload | - -`DATA_LENGTHS[SUB_CALL_HOME] = 0x7C` - -The raw payload is accessed as `data_rsp.data[11:]` — this is 125 bytes (not 124) because -the device returns logical value 0x03 (num_retries=3) as the two-byte wire sequence -`\x10\x03`. S3FrameParser is in `STATE_IN_FRAME` when it sees `0x10`, transitions to -`STATE_AFTER_DLE`, and then on `0x03` (ETX qualifier) it would normally end the frame — -but in the `_IN_FRAME_DLE` state it instead appends **both** the `0x10` and the `0x03` -literally to the payload. The result: `raw[117] = 0x10`, `raw[118] = 0x03`, and all -subsequent fields are shifted +1 from their logical positions. - -#### 7.12.2 Raw Payload Field Map (125 bytes, from `data_rsp.data[11:]`) - -> All offsets are into the 125-byte raw array. Offsets ≥ 119 are shifted +1 from logical -> due to the DLE-escaped 0x03 at raw[117:119]. - -| Raw Offset | Field | Type | Notes | -|---|---|---|---| -| `[5]` | `auto_call_home_enabled` | uint8 | `0x00` = disabled, `0x01` = enabled | -| `[6:46]` | `dial_string` | ASCII | 40-byte null-padded, e.g. `"12345"` or phone number | -| `[87]` | `after_event_recorded` | uint8 | `0x00` = off, `0x01` = on | -| `[91]` | `at_specified_times` | uint8 | `0x00` = off, `0x01` = on | -| `[93]` | `time1_enabled` | uint8 | `0x00` = off, `0x01` = on | -| `[101]` | `time1_hour` | uint8 | 0–23 | -| `[102]` | `time1_min` | uint8 | 0–59 | -| `[95]` | `time2_enabled` | uint8 | `0x00` = off, `0x01` = on | -| `[105]` | `time2_hour` | uint8 | 0–23 | -| `[106]` | `time2_min` | uint8 | 0–59 | -| `[117]` | DLE prefix `0x10` | — | Part of `\x10\x03` wire encoding for num_retries value 3 | -| `[118]` | `num_retries` (value = 3) | uint8 | Logical value 0x03; check `raw[117] == 0x10` to detect DLE prefix | -| `[120]` | `time_between_retries_sec` | uint8 | Shift +1 from logical 119 | -| `[122]` | `wait_for_connection_sec` | uint8 | Shift +1 from logical 121 | -| `[124]` | `warm_up_time_sec` | uint8 | Shift +1 from logical 123 | - -**Unconfirmed fields** (offsets not yet mapped from captures): -- Time slots 3 and 4 (if they exist — Blastware UI only shows 2 time slots in observed sessions) -- `modem_power_relay_enabled` (bool) -- `storage_mode` (call home trigger on all events vs. triggered only?) - -#### 7.12.3 DLE-Escaped 0x03 — Critical Detail - -The `\x10\x03` sequence at raw[117:119] is **not** a DLE stuffing artifact in the usual -sense. Standard DLE stuffing escapes `\x10` → `\x10\x10`. But here the device is encoding -the integer value `3` in a position where the byte `\x03` would be indistinguishable from -the frame ETX terminator. The device therefore sends `\x10\x03` (DLE + ETX = "inner-frame -terminator" in S3 inner-frame syntax). S3FrameParser correctly handles this: in -`STATE_AFTER_DLE`, seeing `\x03` (ETX) while **inside** an outer frame causes it to -append both `\x10` and `\x03` as literal bytes rather than ending the frame. The outer -frame only terminates on a **bare** `\x03` (without the DLE prefix). - -The write frame sends these bytes verbatim — the device accepts `\x10\x03` in the write -payload and interprets it as the value 3. No transformation is needed in -`_encode_call_home_config()`. - -**Limitation:** Any field that needs to encode the value `3` (0x03) requires this DLE -prefix. The current encoder raises `ValueError` if any hour or minute field equals 3, -since the encoder does not yet implement DLE-prefixed writes for arbitrary field positions. -In practice, 3:00 AM / 3 minutes past are unlikely scheduled call times. - -#### 7.12.4 Write Protocol — SUB 0x7E → 0x7F - -Write format (same as other write commands — only BW_CMD `0x10` doubled on wire; -all other bytes written raw; DLE-aware checksum): - -| Step | SUB | Payload | Offset | Response | -|---|---|---|---|---| -| Data write | `0x7E` | 127 bytes (125-byte read payload + `\x00\x00`) | `data[1]+2 = 0x7E` (126) | `0x81` | -| Confirm | `0x7F` | empty | `0x00` | `0x80` | - -**Write payload construction:** -```python -write_payload = bytearray(raw_125_bytes) -write_payload.append(0x00) -write_payload.append(0x00) -# patch fields in-place, then pass bytes(write_payload) to build_bw_write_frame -``` - -**Offset formula:** `write_payload[1] = 0x7C` (same as DATA_LENGTH). -`offset = write_payload[1] + 2 = 0x7C + 2 = 0x7E = 126`. -This follows the identical pattern as SUB 0x68 (event index write) and SUB 0x69 (waveform write). - -**No preceding 0x2C read required** — Blastware sends SUB 0x7E directly using cached -state. The `seismo-relay` implementation always reads first (`get_call_home_config()`) -before writing for safety. - -#### 7.12.5 Implementation Notes - -- `MiniMateProtocol.read_call_home_config()` — standard two-step read; returns `data_rsp.data[11:]` (125 bytes raw) -- `MiniMateProtocol.write_call_home_config(data)` — sends SUB 0x7E (127-byte payload) then SUB 0x7F confirm -- `MiniMateClient.get_call_home_config()` → `CallHomeConfig` dataclass -- `MiniMateClient.set_call_home_config(...)` — reads current config, patches via `_encode_call_home_config()`, writes back -- `_decode_call_home_config(raw)` — handles DLE prefix detection at raw[117] -- `_encode_call_home_config(raw, ...)` — patches in-place, appends 2 trailing zeros; raises `ValueError` if any hour/min == 3 -- REST API: `GET /device/call_home` and `POST /device/call_home` in `sfm/server.py` -- Web UI: "Call Home" tab in `sfm/sfm_webapp.html` - ---- - -## 8. Timestamp Format - -Two timestamp wire formats are used: - -### 8.1 6-byte format (event index / 1E header) -> 🔶 **Updated 2026-02-26** — Year field resolved. Confidence upgraded. - -Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent. - -**Observed example:** -``` -01 07 CB 00 06 1E -``` - -| Byte(s) | Value | Meaning | Certainty | -|---|---|---|---| -| `01` | 1 | Record validity / type flag | 🔶 INFERRED | -| `07 CB` | 1995 | Year — 16-bit big-endian integer | ✅ CONFIRMED — 2026-02-26 | -| `00` | 0 | Unknown separator | ❓ | -| `06` | 6 | Month (June) | ✅ CONFIRMED | -| `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED | - -> ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly. - -### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10) -> ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report -> for BE11529 thump event: "00:28:12 April 1, 2026". - -Full date + time, including a sub_code byte. Used for **single-shot waveform** -recordings (`sub_code = 0x10`). - -**Observed example (thump event, 2026-04-01):** -``` -01 10 04 07 ea 00 00 1c 0c -``` - -| Byte(s) | Value | Meaning | Certainty | -|---|---|---|---| -| `01` | 1 | Day | ✅ | -| `10` | 0x10 | Sub_code: `0x10` = Waveform single-shot | ✅ | -| `04` | 4 | Month (April) | ✅ | -| `07 ea` | 2026 | Year — 16-bit big-endian integer | ✅ | -| `00` | 0 | Unknown separator | ❓ | -| `00` | 0 | Hour | ✅ | -| `1c` | 28 | Minute | ✅ | -| `0c` | 12 | Second | ✅ | - -### 8.3 10-byte format (Full Waveform Record / SUB 0C, sub_code=0x03; monitor-log partial records) -> ✅ **CONFIRMED 2026-04-03** — Cross-referenced against Blastware event report -> for BE11529 (15:20:17 April 3, 2026). Same layout is used for partial-record -> (monitor log, record type `0x2C`) entries — see §7.10 / `_decode_0a_partial_header`. - -Used for **continuous waveform** recordings (`sub_code = 0x03`). One byte -wider than the 9-byte layout — a leading `0x10` marker shifts every subsequent -field by +1. - -**Observed example (continuous event, 2026-04-03 15:20:17):** -``` -10 03 10 04 07 ea 00 0f 14 11 -``` - -| Byte | Value | Meaning | -|---|---|---| -| `10` | 0x10 | Marker; how the decoder distinguishes 10-byte from 9-byte layout | -| `03` | 3 | Day | -| `10` | 0x10 | Marker (reflects wire-encoded sub_code=0x03) | -| `04` | 4 | Month | -| `07 ea` | 2026 | Year — uint16 BE | -| `00` | 0 | Unknown separator | -| `0f` | 15 | Hour | -| `14` | 20 | Minute | -| `11` | 17 | Second | - -**Auto-detection rule:** if `record[0] == 0x10`, use the 10-byte layout; -otherwise use the 9-byte layout. - -The `.MLG` file for a single-shot event stores the timestamp in a different -binary representation (little-endian year, no sub_code byte), confirming the -waveform record and the saved file use distinct serialisation formats. - ---- - -## 9. Out-of-Band / Non-Frame Messages - -| Message | Direction | Trigger | Certainty | -|---|---|---|---| -| `"Operating System"` | S3 → BW | Device boot / UART init / RTC reset | ✅ CONFIRMED | - -> The device prints this boot string directly to the UART **before** switching to DLE-framed binary protocol mode. Your implementation should discard any non-`0x41`/non-`0x10 0x02` bytes during the connection phase. Wait for the first valid framed poll response before proceeding. - ---- - -## 10. DLE Byte Stuffing -> ✅ **CONFIRMED — 2026-02-26** (previously ❓ SPECULATIVE) - -This protocol uses standard **DLE (Data Link Escape) byte stuffing**, a classical technique used in protocols like IBM BISYNC dating to the 1970s. - -### Parser State Machine - -``` -IDLE: - receive 0x41 → emit ACK event, stay IDLE - receive 0x10 → goto WAIT_STX - -WAIT_STX: - receive 0x02 → frame started, goto IN_FRAME - receive anything → error, goto IDLE - -IN_FRAME: - receive 0x10 → goto ESCAPE - receive any byte → append to buffer, stay IN_FRAME - -ESCAPE: - receive 0x03 → frame complete — validate checksum, process buffer, goto IDLE - receive 0x10 → append single 0x10 to buffer, goto IN_FRAME (stuffed literal) - receive 0x02 → error (nested STX), goto IDLE - receive anything → error, goto IDLE -``` - ---- - -## 11. Checksum Reference Implementation -> ⚠️ **Updated 2026-03-12** — BW→S3 large-frame checksum algorithm confirmed. Two distinct formulas apply depending on frame direction and size. - -### Checksum Overview - -| Direction | Frame type | Formula | Coverage | -|---|---|---|---| -| S3→BW | All frames | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | -| BW→S3 | Small frames (POLL, read cmds) | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | -| BW→S3 | Large write frames (SUB `68`, `69`, `71`, `82`, `7E`, `1A`+data) | DLE-aware large-frame: `(sum(payload[2:] where b != 0x10) + 0x10) & 0xFF` | De-stuffed payload bytes `[2:]`, skipping `0x10` bytes, plus constant | -| BW→S3 | SUB 5A bulk waveform | DLE-aware over the **stuffed** wire bytes | For each `10 XX` pair in the stuffed section, count `XX`; lone bytes count as-is. See `build_5a_frame` in `minimateplus/framing.py`. | - -### BW→S3 Large-Frame Checksum Formula - -```python -def calc_checksum_bw_large(payload: bytes) -> int: - """ - Checksum for large BW→S3 write frames (SUB 68, 69, 71, 82, 1A with data). - - Formula: sum all bytes in payload[2:-1], skipping 0x10 bytes, add 0x10, mod 256. - Confirmed across 20 frames from two independent captures (2026-03-12). - """ - return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF -``` - -**Why this formula:** The CMD byte at `payload[0]` is always `0x10` (DLE). The byte at `payload[1]` is always `0x00`. Starting from `payload[2]` skips both. All `0x10` bytes in the data section are excluded from the sum, then `0x10` is added back as a constant — effectively treating DLE as a transparent/invisible byte in the checksum. This is consistent with `0x10` being a framing/control character in the protocol. - -**Consistency check:** For small frames, `payload[0]` = `0x10` and there are no other `0x10` bytes in the payload. The large-frame formula applied to a small frame would give `(sum(payload[2:-1]) + 0x10) = sum(payload[0:-1])` — identical to the plain SUM8. The two formulas converge for frames without embedded `0x10` data bytes. - -```python -DLE = 0x10 -STX = 0x02 -ETX = 0x03 -ACK = 0x41 - - -def stuff(data: bytes) -> bytes: - """Escape all 0x10 bytes in payload as 0x10 0x10 for transmission.""" - out = [] - for b in data: - out.append(b) - if b == DLE: - out.append(DLE) # double it - return bytes(out) - - -def destuff(data: bytes) -> bytes: - """Remove DLE stuffing from received payload bytes.""" - out = [] - i = 0 - while i < len(data): - if data[i] == DLE and i + 1 < len(data) and data[i + 1] == DLE: - out.append(DLE) - i += 2 - else: - out.append(data[i]) - i += 1 - return bytes(out) - - -def calc_checksum_s3(payload: bytes) -> int: - """ - Standard SUM8: used for all S3→BW frames and small BW→S3 frames. - Sum of all payload bytes (excluding the checksum byte itself), mod 256. - """ - return sum(payload) & 0xFF - - -def calc_checksum_bw_large(payload: bytes) -> int: - """ - Large BW→S3 write frame checksum (SUB 68, 69, 71, 82, 1A with data). - Sum payload[2:-1] skipping 0x10 bytes, add 0x10, mod 256. - """ - return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF - - -# Backwards-compatible alias -def calc_checksum(payload: bytes) -> int: - return calc_checksum_s3(payload) - - -def build_frame(payload: bytes) -> bytes: - """ - Build a complete on-wire frame from a raw payload. - Output: ACK + DLE+STX + stuffed_payload + checksum + DLE+ETX - """ - chk = calc_checksum(payload) - stuffed = stuff(payload) - return bytes([ACK, DLE, STX]) + stuffed + bytes([chk, DLE, ETX]) - - -def parse_frame(raw: bytes) -> bytes | None: - """ - Parse and validate a raw on-wire frame. - Accepts input starting with ACK (0x41) or DLE+STX (0x10 0x02). - Returns de-stuffed payload bytes on success, None on any error. - """ - # Strip optional leading ACK - if raw and raw[0] == ACK: - raw = raw[1:] - - # Validate frame delimiters - if len(raw) < 5: - return None - if raw[0] != DLE or raw[1] != STX: - return None - if raw[-2] != DLE or raw[-1] != ETX: - return None - - # Extract: everything between DLE+STX and DLE+ETX - inner = raw[2:-2] - chk_received = inner[-1] - stuffed_payload = inner[:-1] - - # De-stuff and validate checksum - payload = destuff(stuffed_payload) - if calc_checksum(payload) != chk_received: - return None - - return payload - - -# ── Example: build a POLL probe request (SUB 5B) ───────────────────────────── -# Layout per §3: BW_CMD=0x10, flags=0x00, SUB=0x5B, [0x00, 0x00], OFFSET=0x00, -# then 10 bytes of params — 16 bytes total payload. -poll_payload = bytes([ - 0x10, # [0] BW_CMD - 0x00, # [1] flags - 0x5B, # [2] SUB: POLL - 0x00, 0x00, # [3:5] always zero - 0x00, # [5] OFFSET (probe step) - 0x00, 0x00, 0x00, 0x00, 0x00, # [6:11] params - 0x00, 0x00, 0x00, 0x00, 0x00, # [11:16] params -]) -# checksum = SUM8 over payload[0:-1] for small read frames; here = (0x10 + 0x5B) & 0xFF = 0x6B -# Wire output (BW→S3): the leading 0x10 is DLE-stuffed to 0x10 0x10: -# 41 02 10 10 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 6B 03 -# ^ ^ ^^^^^ ^ ^ -# ACK STX (bare 0x02) chk bare ETX -# See `build_bw_frame()` in `minimateplus/framing.py` for the canonical builder. -``` - ---- - -## 12. Recommended Implementation Sequence - -Build in this order — each step is independently testable. **Don't try to -implement event download (step 8 onward) without reading §6.1 first** — the -1E-arm / POLL×3 / 5A walk has multiple device-side state-machine prerequisites -that are easy to miss. - -1. **DLE frame parser** — stateful byte-by-byte reader implementing the §10 state machine. Handles ACK, stuffing, de-stuffing, bare-ETX termination, checksum validation. -2. **`connect(port, baud=38400)`** — open port, flush buffer, discard ASCII boot strings (§9), send first POLL frame. -3. **`identify()`** — SUB `5B` two-step read → returns `{"manufacturer": "Instantel", "model": "MiniMate Plus"}`. -4. **`get_serial()`** — SUB `15` two-step read → returns serial number string. -5. **`get_config()`** — SUB `01` / SUB `FE` two-step read → returns full config dict (firmware, calibration date, aux trigger). -6. **`get_event_count()`** — SUB `08` event index read. -7. **`get_event_header(key)`** — SUB `1E` (browse mode, token=`0x00` at params[7]) → first event key; iterate with SUB `1F`. -8. **`get_event_record(key)`** — SUB `0C` paginated read → 210-byte waveform record (peaks, timestamp, project). Use the 9-byte / 10-byte timestamp auto-detect from §7.5b / §8. -9. **`download_waveform(key)`** — SUB `5A` bulk stream. **Requires the full arm sequence from §6.1:** 0A → 1E(arm) → 0C → 1F(arm) → POLL × 3 → 5A. Use the STRT-bounded chunk walk from §7.8.5, the TERM frame from §7.8.6, and the metadata pages from §7.8.7. -10. **Write commands** — see §5.3 for the frame format and SUB pairings. Compliance push, call-home setup, and erase-all are all confirmed (§7.11, §7.12). - ---- - -## 13. Devices Under Test - -Multiple units have contributed captures to this reference. Primary development -target is **BE11529** (firmware S338.17); earlier sessions used BE18189. - -| Field | Primary unit | Secondary unit(s) | -|---|---|---| -| Manufacturer | Instantel | — | -| Model | MiniMate Plus | — | -| Serial Number | **BE11529** | BE18189, BE6907, BE14036, BE17353, BE18003, BE18191, BE18676 (archive only) | -| Firmware | **S338.17** | S337.17 (BE18189); various S338.x for other units | -| DSP / Secondary FW | 10.72 | 10.72 | -| Channels | Tran, Vert, Long, MicL (4 channels) | — | -| Sample Rate | 1024 / 2048 / 4096 sps (selectable) | — | -| Bridge Config (RS-232) | direct or via Sierra Wireless RV50/RV55 modem, 38400,8N1 | — | -| Bridge Config (TCP) | port 12345 (configurable) | — | -| Capture Tool | s3_bridge v0.5.0+ | v0.4.0 used for 1-2-26 / 3-11-26 captures | - ---- - -## 14. TCP / Modem Transport -> ✅ **CONFIRMED — 2026-03-31** from Blastware Operator Manual 714U0301 Rev 22 §4.4 and ACEmanager Raven modem configuration screenshots. - -The MiniMate Plus protocol is **fully transport-agnostic at the byte level**. The same DLE-framed S3/BW frame stream that flows over RS-232 is transmitted unmodified over a TCP socket. No additional framing, handshake bytes, or session tokens are added at the application layer. - ---- - -### 14.1 Two Usage Modes - -**"Call Up" (Outbound TCP — SFM connects to modem)** - -Blastware or SFM opens a TCP connection to the modem's static IP address on its device port. The modem bridges the TCP socket to its RS-232 serial port, which is wired directly to the MiniMate Plus. From the protocol perspective this is identical to a direct serial connection. - -``` -SFM ──TCP──► Raven modem ──RS-232──► MiniMate Plus - (static IP, port N) (38400,8N1) -``` - -This is the mode implemented by `TcpTransport(host, port)`. Typical call: - -``` -GET /device/info?host=203.0.113.5&tcp_port=12345 -``` - -**"Call Home" / ACH (Inbound TCP — unit calls the server)** - -The MiniMate Plus is configured with an IP address and port. On an event trigger or scheduled time it powers up its modem, which establishes a TCP connection outbound to the server. Blastware (or a future SFM ACH listener) accepts the incoming connection. After the unit connects, the PC has a configurable "Wait for Connection" window to send the first command before the unit times out and hangs up. - -``` -MiniMate Plus ──RS-232──► Raven modem ──TCP──► ACH server (listening) - (static office IP, port N) -``` - -`TcpTransport` is a **client** (outbound connect only). A separate `AchServer` listener component is needed for this mode — not yet implemented. - ---- - -### 14.2 No Application-Layer Handshake on TCP Connect - -✅ **Confirmed from ACEmanager configuration screenshot:** - -``` -Enable ENQ on TCP Connect: 0-Disable -``` - -When a TCP connection is established (in either direction), **no ENQ byte or other handshake marker is sent** by the modem before the protocol stream starts. The first byte from either side is a raw protocol byte — for SFM-initiated call-up, SFM sends POLL_PROBE immediately after `connect()`. - -**Sierra Wireless RV50/RV55 note:** Even with Quiet Mode enabled, these modems send `\r\nRING\r\n\r\nCONNECT\r\n` over the TCP connection to the calling client at connect time. Quiet Mode only suppresses these strings on the *serial* port (protecting the MiniMate Plus). The TCP client must tolerate these prefix bytes — scan for DLE+STX (`0x10 0x02`) and discard everything before it. This is the same approach used for the `"Operating System"` boot string (§9). - -The Raven X (deprecated) did not exhibit this behaviour. The note below about "no CONNECT string" describes Raven X with ENQ-disable; it does **not** apply to RV50/RV55. - -No ENQ byte or other application-layer handshake is added. The Raven modem's TCP dialog is configured with: - -| ACEmanager Setting | Value | Meaning | -|---|---|---| -| TCP Auto Answer | 2 — Telnet Server | TCP mode (transparent pass-through, not actually Telnet) | -| Telnet Echo Mode | 0 — No Echo | No echo of received bytes | -| Enable ENQ on TCP Connect | 0 — Disable | No ENQ byte on connect | -| TCP Connect Response Delay | 0 | No delay before first byte | -| TCP Idle Timeout | **2** (minutes) | Prevents premature disconnect; must match §14.3 | - ---- - -### 14.3 Modem Serial Port Configuration - -> **Hardware note:** The Raven X modem shown in the Blastware manual is 3G-only and no longer operational (3G network shutdown). The current field hardware is the **Sierra Wireless RV55** (and newer RX55). Both run ALEOS firmware and have an identical ACEmanager web UI — the settings below apply to all three generations. - -The modem's RS-232 port (wired to the MiniMate Plus) must be configured as: - -| ACEmanager Setting | Value | -|---|---| -| Configure Serial Port | **38400,8N1** | -| Flow Control | None | -| DB9 Serial Echo | OFF | -| Data Forwarding Timeout | **`1` (= 0.1 s)** in ACEmanager units (1 tick = 0.1 s; see §14.3 RV50/RV55 table) | -| Data Forwarding Character | 0 (disabled) | - -The **Data Forwarding Timeout** is the most protocol-critical setting. The modem -accumulates bytes from the RS-232 port for up to the configured interval before -forwarding them as a TCP segment. This means: - -- A large S3 response frame may arrive as multiple TCP segments with up to 1-second gaps between them. -- A `read_until_idle` implementation with `idle_gap < 1.0 s` will **incorrectly declare the frame complete mid-stream**. -- `TcpTransport.read_until_idle` overrides the default `idle_gap=0.05 s` to `idle_gap=1.5 s` to compensate. - -If connecting to a unit via a direct Ethernet connection (no serial modem in the path), the 1.5 s idle gap will still work but will feel slower. In that case you can pass `idle_gap=0.1` explicitly. - -#### Sierra Wireless RV50 / RV55 Required Settings -> ✅ **CONFIRMED — 2026-03-31** from working RV50 field config vs misconfigured RV55. - -The following ACEmanager Serial settings are required for correct transparent operation. A single wrong setting is enough to break the protocol exchange (unit beeps on connect but never returns an S3 frame): - -| ACEmanager Setting | Required Value | Why | -|---|---|---| -| **Quiet Mode** | **Enable** | Disabling it causes the modem to inject `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time, corrupting the S3 handshake. | -| **Configure Serial Port** | `38400,8N1` | Must match MiniMate baud rate. | -| **Flow Control** | `None` | Hardware flow control (CTS/RTS) will block unit's serial TX if pins are not wired. | -| **Data Forwarding Timeout** | `1` (= 0.1 s) | Controls RS-232→TCP forwarding latency. `5` (0.5 s) works but is sluggish; `1` matches working field units. | -| **TCP Connect Response Delay** | `0` | Any non-zero value causes the modem to silently discard our POLL frame during the delay window. | -| **TCP Idle Timeout** | `2` (minutes) | Prevents premature disconnect. Too low and the modem drops the session before the unit responds. | -| **DB9 Serial Echo** | `Disable` | Echo would corrupt the S3 stream. | - ---- - -### 14.4 Connection Timeouts on the Unit Side - -The MiniMate Plus firmware has two relevant timeouts configurable via Blastware's Call Home Setup dialog: - -| Timeout | Description | Impact | -|---|---|---| -| **Wait for Connection** | Seconds after TCP connect during which the unit waits for the first BW frame. If nothing arrives, unit terminates the session. | SFM must send POLL_PROBE within this window after `connect()`. Default appears short (≈15–30 s). | -| **Serial Idle Time** | Seconds of inactivity after which the unit terminates the connection. | SFM must complete its work and disconnect cleanly — or send periodic keep-alive frames — within this window. | - -For our `TcpTransport` + `MiniMateProtocol` stack, both timeouts are satisfied automatically because `connect()` is immediately followed by `protocol.poll()` which sends POLL_PROBE, and the full session (POLL + read + disconnect) typically completes in < 30 seconds. - ---- - -### 14.5 Port Numbers - -The TCP port is **user-configurable** in both Blastware and the modem. There is no universally fixed port. - -| Setting location | Value in manual example | Value in user's install | -|---|---|---| -| Blastware TCP Communication dialog | 12335 | 12345 | -| Raven ACEmanager Destination Port | 12349 (UDP example) | varies | - -`TcpTransport` defaults to `DEFAULT_TCP_PORT = 12345` which matches the user's install. This can be overridden by the `port` argument or the `tcp_port` query parameter in the SFM server. - ---- - -### 14.6 ACH Session Lifecycle (Call Home Mode) ✅ IMPLEMENTED 2026-04-11 - -When the unit calls home under ACH, the session lifecycle from the unit's perspective is: - -1. Unit triggers (event or scheduled time) -2. Unit powers up modem, dials / connects TCP to server IP:port -3. Unit waits for "Wait for Connection" window for first BW frame from server -4. Server sends POLL_PROBE → unit responds with POLL_RESPONSE (same as serial) -5. Server reads serial number, full config, events as needed -6. (Optional) Server erases device memory: SUB 0xA3 → 0x1C → 0x06 → 0xA2 -7. Server disconnects (or unit disconnects on Serial Idle Time expiry) -8. Unit detects DCD/DTR going low (modem signals line drop), returns to monitor mode automatically - -Step 4 onward is **identical to the serial/call-up protocol**. The only difference -from our perspective is that we are the **listener** rather than the **connector**. - -**Implementation: `bridges/ach_server.py`** — run with `python bridges/ach_server.py`. -Key flags: -- `--clear-after-download` — erase device memory after a successful event download -- `--allow-ip IP` — restrict to specific unit IPs -- `--max-events N` — cap events per session for safety - -**State persistence: `ach_state.json`** — tracks `downloaded_keys` (set of event key -hex strings) and `max_downloaded_key` (high-water mark) per unit serial number. -Post-erase key reuse (`0x01110000` recycled) is detected via the high-water mark. - -**Note on DCD/DTR:** The MiniMate Plus monitors the RS-232 DCD line. When the TCP -connection closes, the Sierra Wireless modem drops DCD, which the unit interprets as -"serial connection ended" and automatically resumes monitoring. No `start_monitoring()` -(SUB 0x96) command is needed from the server. ⚠️ Newer RV55 firmware may not assert DCD -by default — known issue, not yet resolved. - ---- - -## Appendix A — s3_bridge Capture Format -> ✅ **CONFIRMED — 2026-02-26** - -> ⚠️ **This behavior is not part of the Instantel protocol. It is an artifact of the bridge logger implementation.** - -The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger makes one modification: - -| Wire sequence | In .bin file | Notes | -|---|---|---| -| `0x10 0x03` (DLE+ETX) | `0x03` | DLE stripped from end-of-frame marker | -| All other bytes | Unchanged | ACK, DLE+STX, stuffed payload, checksum all preserved verbatim | - -**Practical impact for parsing `.bin` files:** -- Frame end: scan for bare `0x03` (not `0x10 0x03`) -- Checksum: the byte immediately before the bare `0x03` is the checksum -- Everything else (ACK detection, DLE+STX, payload de-stuffing) works as documented in §10 - -> ⚠️ This means checksums cannot be verified on frames where the stuffed payload ends in `0x10` — that trailing `0x10` would normally be the DLE prefix of ETX, but the logger strips it, making the frame boundary ambiguous in that edge case. In practice this has not been observed in captured data. - ---- - -## 15. Open Questions / Still Needs Cracking - -| Question | Priority | Added | Notes | -|---|---|---|---| -| Timestamp 6-byte format byte[3] — purpose of the separator `0x00` byte | LOW | 2026-02-26 | Not blocking; 9-byte waveform record format (§8.2) fully confirmed without this byte. | -| `trail[0]` in serial number response — unit-specific byte, derivation unknown. `trail[1]` resolved as firmware minor version. | MEDIUM | 2026-02-26 | | -| ~~Full channel ID mapping in SUB `5A` stream~~ — **RESOLVED 2026-08-25 for the waveform body:** every `40 NN` segment header carries `[channel_id][00][00][segment_index]` at `data[2*NN+4]`, with `0x46`=Tran `0x47`=Vert `0x48`=Long `0x49`=MicL. Verified on 1697/1697 segment headers with zero disagreements against the decoded channel rotation. See §7.6.1. | RESOLVED | 2026-02-26 | Resolved 2026-08-25 | -| ~~Exact byte boundaries of project string fields in SUB `71` write frame~~ — **RESOLVED 2026-05-05:** project/client/operator/seis-loc/extended-notes come from SUB 5A metadata pages at counter `0x1002` / `0x1004` (§7.8.7), NOT from the SUB 71 write payload. `_decode_a5_metadata_into` locates them via ASCII label scans. | RESOLVED | 2026-02-26 | Resolved 2026-05-05 | -| Purpose of SUB `09` / response `F6` — 202-byte read block | MEDIUM | 2026-02-26 | | -| Purpose of SUB `2E` / response `D1` — 26-byte read block | MEDIUM | 2026-02-26 | | -| Full field mapping of SUB `1A` / response `E5` — channel scaling / compliance config block. **RESOLVED 2026-04-21:** Multi-frame sequence (§7.6.2), page_key chunking, duplicate-page detection, record_time at anchor+6 (§7.6.1), sample_rate at anchor−6 (§7.6.3), recording_mode at anchor−8 (§7.6.4), histogram_interval at anchor−4, trigger_level_geo and alarm_level_geo in channel block (§7.6), geo_range at channel_label+33 (§7.6), adc_scale_factor at channel_label+28, and project strings (via 5A metadata pages, §7.8.7) all confirmed. | RESOLVED | 2026-02-26 | Resolved 2026-04-21 | -| `0x082A` in channel config block — not trigger, alarm, or record time directly. **RESOLVED: fixed E5 payload length (2090 bytes).** Constant regardless of all settings. | RESOLVED | 2026-03-01 | Resolved 2026-03-09 | -| **Record time in wire protocol** — float32 BE, anchor-relative in cfg (see §7.6.1/§7.6.3). **RESOLVED.** Previous `+0x28` offset was unreliable due to DLE jitter — superseded by anchor search. Confirmed at 3, 5, 7, 8, 10, 13 seconds. | RESOLVED | 2026-03-09 | Confirmed 2026-03-09; anchor method confirmed 2026-04-01 | -| **Sample rate** — uint16 BE at anchor−2 in cfg. **RESOLVED.** Normal=1024, Fast=2048, Faster=4096. Anchor required to handle DLE jitter. See §7.6.3. | RESOLVED | 2026-04-01 | Confirmed 2026-04-01 | -| Unknown uint16 fields at channel block +0A (=80), +0C (=15), +0E (=40), +10 (=21) — manual describes "Sensitive (Gain=8) / Normal (Gain=1)" per-channel range; 80/15/40/21 might encode gain, sensitivity, or ADC config. | LOW | 2026-03-01 | | -| ~~Full trigger configuration field mapping (SUB `1C` / write `82`)~~ — **PARTIALLY RESOLVED:** SUB `1C` now confirmed as MONITOR STATUS READ (§5.1, §7.10) — not trigger config; the old "0x6E response" was misidentification. SUB `82` (trigger config write) layout partially mapped — Trigger Sample Width at `[22]`. Remaining unknowns: full per-channel structure of the 0x82 payload. | LOW | 2026-02-26 | Updated 2026-05-20 | -| Whether SUB `24`/`25` are distinct from SUB `5A` or redundant | LOW | 2026-02-26 | | -| **Meaning of `0x07 E7` field in config block — RESOLVED:** Calibration year. uint16 BE at destuffed payload offset 0x56–0x57. Confirmed via two-unit comparison: BE18189 (calibrated 2023) = `07 E7`; BE11529 (calibrated 2025) = `07 E9`. Adjacent bytes at 0x53–0x55 encode remaining calibration date (month confirmed as BCD October for both units; full layout 🔶 INFERRED). | RESOLVED | 2026-02-26 | Resolved 2026-03-31 | -| **Trigger Sample Width** — **RESOLVED:** BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Width=4 → `0x04`, Width=3 → `0x03`. Confirmed via BW-side capture diff. Only visible in `raw_bw.bin` write traffic, not in S3-side compliance reads. | RESOLVED | 2026-03-02 | Confirmed 2026-03-09 | -| **Auto Window** — "1 to 9 seconds" per manual (§3.13.1b). **Mode-gated:** only transmitted/active when Record Stop Mode = Auto. Capture attempted in Fixed mode (3→9 change) — no wire change observed in any frame. Deferred pending mode switch. | LOW | 2026-03-02 | Updated 2026-03-09 | -| **Auxiliary Trigger read location** — **RESOLVED:** SUB `FE` offset `0x0109`, uint8, `0x00`=disabled, `0x01`=enabled. Confirmed 2026-03-11 via controlled toggle capture. | RESOLVED | 2026-03-02 | Resolved 2026-03-11 | -| **Auxiliary Trigger write path** — Write command not yet captured in a clean session. Inner frame handshake visible in A4 (multiple WRITE_CONFIRM_RESPONSE SUBs appear, TRIGGER_CONFIG_RESPONSE removed), but the BW→S3 write command itself was in a partial session. Likely SUB `15` or similar. Deferred for clean capture. | LOW | 2026-03-11 | NEW | -| ~~**SUB `6E` response to SUB `1C`**~~ — ~~RESOLVED 2026-04-08: This was a misidentification.~~ The `1C → 6E` "exception" was misread — likely an inner A4 sub-frame. Confirmed from 4-8-26 capture (338 frames): SUB 0x1C always → 0xE3. No exceptions to the `0xFF − SUB` rule are known. | RESOLVED | 2026-04-08 | CLOSED | -| ~~**Max Geo Range float 6.2061**~~ — **RESOLVED 2026-04-17.** Confirmed as the **ADC-to-velocity scale factor** = inverse sensitivity = 1/0.161133 = **6.206053 (in/s)/V**. Source: Interface Handbook §4.5 formula `Range = 1.61133 V / Sensitivity`. For standard Instantel geo at Normal (Gain=1) range: Sensitivity = 1.61133/10 = 0.161133 V/(in/s), scale = 6.206053. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. The earlier ~9× overread was from using 6.206053 directly as range instead of as scale factor (range = 1.61133 V × 6.206053 = 10.000 in/s). Hardware constant — do NOT write. | RESOLVED | 2026-02-26 | Resolved 2026-04-17 | -| MicL channel units — **RESOLVED: psi**, confirmed from `.set` file unit string `"psi\0"` | RESOLVED | 2026-03-01 | | -| Backlight offset — **RESOLVED: +4B in event index data**, uint8, seconds | RESOLVED | 2026-03-02 | | -| Power save offset — **RESOLVED: +53 in event index data**, uint8, minutes | RESOLVED | 2026-03-02 | | -| Monitoring LCD Cycle — **RESOLVED: +54/+55 in event index data**, uint16 BE, seconds (65500 = disabled) | RESOLVED | 2026-03-02 | | -| **SUB 0x06 purpose — RESOLVED: event storage range.** Previously labeled "CHANNEL CONFIG READ". 4-11-26 MITM capture confirms it returns first/last stored event keys in the final 8 bytes of the 36-byte response. Used by Blastware as part of the erase-all verification step. | RESOLVED | 2026-04-11 | | -| **Erase-all command sequence — RESOLVED.** SUB 0xA3 (begin) + 0x1C (monitor status) + 0x06 (storage range) + 0xA2 (confirm). Confirmed from 4-11-26 MITM capture. All frames standard `build_bw_frame`, token=0xFE. | RESOLVED | 2026-04-11 | | -| **ACH inbound server — RESOLVED.** `bridges/ach_server.py` implements full inbound ACH pipeline. `--clear-after-download` flag for delete-after-upload workflow. Post-erase key-reuse detection via `max_downloaded_key` high-water mark. | RESOLVED | 2026-04-11 | | -| **Sensor Check dropdown byte location** — byte offset in 1A compliance config payload for the "Sensor Check: Before monitoring / After each event / Disabled" setting is NOT YET LOCATED. Confirmed: unit always runs with "Before monitoring" set. Need a capture with "Disabled" to diff. | MEDIUM | 2026-04-08 | Still open | -| **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open | -| ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | -| ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | -| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | -| **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open | -| **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open | - ---- - ---- - -## Appendix B — Operator Manual Cross-Reference (716U0101 Rev 15) - -> Added 2026-03-02. Cross-referencing confirms setting names, ranges, units, and behavior for fields found in protocol captures. The manual does NOT describe the wire protocol — it describes the user-facing device interface. Use to infer data types, ranges, and semantics of protocol fields. - -| Setting Name (Manual) | Manual Location | Protocol Location | Type | Range / Notes | -|---|---|---|---|---| -| Backlight On Time | §3.13.1e | Event Index +4B | uint8 | 0–255 seconds | -| Power Saving Timeout | §3.13.1f | Event Index +53 | uint8 | minutes (user sets 1–60+) | -| Monitoring LCD Cycle | §3.13.1g | Event Index +54/55 | uint16 BE | seconds; 0=off; 65500≈disabled | -| Trigger Level (Geo) | §3.8.6 | Channel block, float | float32 BE | 0.005–10.000 in/s | -| Alarm Level (Geo) | §3.9.9 | Channel block, float | float32 BE | higher than trigger level | -| Trigger Level (Mic) | §3.8.6 | Channel block, float | float32 BE | 100–148 dB in 1 dB steps | -| Alarm Level (Mic) | §3.9.10 | Channel block, float | float32 BE | higher than mic trigger | -| Record Time | §3.8.9 | cfg anchor+10, float32 BE (wire); `.set` +16, uint32 LE (file) | float32 BE (wire) | 1–105 s; confirmed 3→`40400000`, 5→`40A00000`, 8→`41000000`, 13→`41500000`. Use anchor §7.6.1/§7.6.3 — NOT fixed offset. | -| ADC Scale Factor (geo_adc_scale) | §3.8.4 / Interface Handbook §4.5 | Channel block, Tran+28 (same in E5 read and SUB 71 write), float32 BE | float32 BE = 6.206053 | ✅ CONFIRMED 2026-04-17 — inverse sensitivity (in/s)/V. `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant, identical on all units. Do NOT write. | -| Max Geo Range (geo_range) | §3.8.4 | Channel block, Tran+33 (same in E5 read and SUB 71 write), uint8; applied to Tran/Vert/Long | uint8 | ✅ CONFIRMED 2026-04-20 — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. **NOTE: `Tran+20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | -| Microphone Units | §3.9.7 | Inline unit string | char[4] | `"psi\0"`, `"pa.\0"`, `"dB\0\0"` | -| Sample Rate | §3.8.2 | cfg anchor−2, uint16 BE — anchor=`\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100] | uint16 BE | Normal=1024, Fast=2048, Faster=4096 ✅ CONFIRMED 2026-04-01 (BE11529 S338.17). Anchor required — see §7.6.3 DLE jitter. | -| Record Mode | §3.8.1 | Write: `cfg[anchor−3]`, uint8. Read (E5 sf1): `data[anchor−4]`, uint8. Note: extra `0x10` byte at read `data[anchor−3]` shifts offset by 1 vs write. | uint8 | `0x00`=Single Shot, `0x01`=Continuous, `0x02`=unknown, `0x03`=Histogram, `0x04`=Histogram+Continuous. ✅ CONFIRMED 2026-04-20 | -| Trigger Sample Width | §3.13.1h | BW→S3 SUB `0x82` write frame, destuffed `[22]`, uint8 | uint8 | Default=2; confirmed 4=`0x04`, 3=`0x03`. **BW-side write only** — not visible in S3 compliance reads. Mode-gated: only sent in Compliance/Single-Shot/Fixed mode. | -| Auto Window | §3.13.1b | **Mode-gated — NOT YET MAPPED** | uint8? | 1–9 seconds; only active when Record Stop Mode = Auto. Capture in Fixed mode produced no wire change. | -| Auxiliary Trigger | §3.13.1d | SUB `FE` (FULL_CONFIG_RESPONSE) offset `0x0109` (read); write path not yet isolated | uint8 (bool) | `0x00`=disabled, `0x01`=enabled; confirmed 2026-03-11 | -| Password | §3.13.1c | Unknown | — | 4-key sequence | -| Serial Connection | §3.9.11 | Unknown | — | Direct / Via Modem | -| Baud Rate | §3.9.12 | Unknown | — | 38400 for direct | - ---- - -## Appendix C — Logger & Parser Validation (2026-03-02) - -> Documents the logger integrity verification and parser refactor completed 2026-03-02. Tooling behavior only — not protocol semantics. - -### C.1 Logger Validation - -**Concern:** Earlier sessions noted that the `s3_bridge` logger may have been stripping `0x10` from `DLE ETX` sequences, producing bare `0x03` terminators in the capture file. - -**Resolution:** HxD inspection of a new capture produced by `s3_bridge v0.5.0` confirmed that `10 03` sequences are present intact inside S3→BW record payloads. The `forward_loop` function writes raw bytes to the `.bin` before any sniffer or framing logic runs — there is no ETX stripping in v0.5.0. - -The earlier stripping behavior applied to a previous logger version. v0.5.0 is confirmed lossless with respect to wire bytes. - -**Confirmed wire framing:** -- Frame start: `0x10 0x02` (DLE STX) ✅ -- Frame end: `0x10 0x03` (DLE ETX) ✅ -- DLE stuffing: `0x10 0x10` in payload = literal `0x10` ✅ - -### C.2 Capture Architecture (Current) - -As of 2026-03-02 the capture pipeline produces two flat raw wire dump files per session: - -| File | Contents | -|---|---| -| `raw_s3.bin` | All bytes transmitted by S3 (device → Blastware), in order | -| `raw_bw.bin` | All bytes transmitted by BW (Blastware → device), in order | - -No record headers, no timestamps, no framing logic applied by the dumper. Files are flat concatenations of `serial.read()` chunks. Frame boundaries must be recovered by the parser. - -### C.3 Parser Design — DLE State Machine - -A deterministic state machine replaces all prior heuristic scanning. - -**States:** - -``` -STATE_IDLE — scanning for frame start -STATE_IN_FRAME — consuming payload bytes -STATE_AFTER_DLE — last byte was 0x10, awaiting qualifier -``` - -**Transitions:** - -| Current State | Byte | Action | Next State | -|---|---|---|---| -| IDLE | `10 02` | Begin new frame | IN_FRAME | -| IDLE | any | Discard | IDLE | -| IN_FRAME | `!= 10` | Append to payload | IN_FRAME | -| IN_FRAME | `10` | — | AFTER_DLE | -| AFTER_DLE | `10` | Append literal `0x10` | IN_FRAME | -| AFTER_DLE | `03` | Frame complete, emit | IDLE | -| AFTER_DLE | other | Treat as payload (recovery) | IN_FRAME | - -**Properties:** -- Does not scan globally for `10 02` -- Only complete STX→ETX pairs are emitted as frames -- Incomplete trailing frames at EOF are discarded (expected at capture boundaries) -- DLE stuffing handled correctly - -### C.4 Observed Traffic (Validation Captures) - -**`raw_bw.bin`** (Blastware → S3): -- 7 complete frames via state machine -- Mostly small command/control frames, several zero-length payloads -- Bare `0x02` used as STX (asymmetric — BW does not use DLE STX) -- Contains project metadata strings: `"Standard Recording Setup.set"`, `"Claude test2"`, `"Location #1 - Brians House"` - -**`raw_s3.bin`** (S3 → Blastware): -- First frame payload ~3922 bytes (large structured response) -- Repeated `"Instantel"` / `"MiniMate Plus"` / `"BE18189"` strings throughout -- Multiple medium-length structured frames -- DLE+ETX confirmed intact - -### C.5 Key Lessons - -1. **Global byte counting ≠ frame counting.** `0x10 0x02` appears inside payloads. Only state machine transitions produce valid frame boundaries. -2. **STX count ≠ frame count.** Only STX→ETX pairs within proper state transitions count. -3. **EOF mid-frame is normal.** Capture termination during active traffic produces an incomplete trailing frame. Not an error. -4. **Layer separation.** The parser extracts frames only. Decoding block IDs, validating checksums, and interpreting semantics are responsibilities of a separate protocol decoder layer above it. - -### C.6 Parser Layer Architecture - -``` -raw_s3.bin / raw_bw.bin - ↓ -DLE Frame Parser (s3_parser.py) <- framing only - ↓ -Protocol Decoder (future) <- SUB IDs, block layout, checksums - ↓ -Semantic Interpretation <- settings, events, responses -``` - ---- - ---- - -## Appendix D — Blastware Binary File Formats (.N00 / .MLG / others) - -> ✅ CONFIRMED 2026-04-21 — all fields verified by binary diff of reconstructed vs reference -> files from the 4-3-26-multi_event capture (M529LIY6.N00, BE11529.MLG). -> -> ✅ **EXTENSION ENCODING FULLY DECODED 2026-04-22** — supersedes the earlier -> "extension encodes recording mode" hypothesis (which was wrong) AND the -> "extension encoding algorithm is unknown" note. Extensions encode a -> **timestamp** (seconds within a 21.6-minute window), NOT recording mode. -> See **D.5.2** for the full formula, confirmed against 3,248 files from a -> 10-year production archive. Cross-references throughout this appendix have -> been updated. - -### D.1 Common File Header (22 bytes) - -All Blastware files (regardless of type) share an 18-byte prefix followed by a 4-byte type tag. - -| Offset | Length | Value | Description | -|---|---|---|---| -| 0x00 | 6 | `10 00 01 80 00 00` | Fixed prefix | -| 0x06 | 10 | `Instantel\x00` | ASCII string | -| 0x10 | 2 | `07 2c` | Fixed suffix | -| 0x12 | 4 | varies | File type tag (see below) | - -**Total header: 22 bytes.** - -**Type tags:** - -| Extension | Type tag | Description | -|---|---|---| -| `AB0` / `AB0W` (Waveform) | `00 12 03 00` | Waveform event — extension encodes timestamp, see D.5.2/D.5.3 | -| `AB0H` (Histogram) | `00 12 03 00` | Histogram event — ACH only | -| `.N00` | `00 12 03 00` | Old-firmware placeholder (Waveform); `blastware_filename()` falls back to this for S338 firmware | -| `.MLG` | `22 01 0e a0` | Monitor log | - -**Extension encoding — new firmware (V10.72+) FULLY DECODED (confirmed 2026-04-22):** - -The extension differs depending on how the file was saved: - -| Download method | Extension format | Example | -|---|---|---| -| Manual / direct (Blastware connected to unit) | `AB0` (3 chars) | `.CE0` | -| Call-home / ACH | `AB0W` or `AB0H` (4 chars) | `.CE0H` | - -Where: -- `AB` = 2-char base-36 of `total_seconds % 1296`; `A = value // 36`, `B = value % 36` -- `total_seconds = (event_local_time − 1985-01-01T00:00:00_local)` in seconds -- `0` = always literal digit zero -- `W` = Full Waveform, `H` = Full Histogram (ACH only) - -Base-36 alphabet: `0–9` = 0–9, `A–Z` = 10–35. - -The 10-year production archive contains only ACH files (all end in W or H). Manual Blastware downloads produce the same `AB0` prefix but without the trailing type character. - -**3-day cycle property (confirmed 2026-04-22):** A unit recording at a fixed daily time cycles through exactly **3 different extensions** with a 3-day period. Each calendar day shifts `total_seconds % 1296` by 864 (since `86400 % 1296 = 864`). The cycle repeats every 3 days because `gcd(1296, 864) = 432`. Confirmed from archive: top 3 extensions `CE0H` (95), `0E0H` (93), `OE0H` (91) are the 3-day cycle of a 06:00:14 daily call-in (seconds-in-window = 446, 14, 878). - -**B character invariance:** `864 = 24 × 36`, so adding one day never changes `value % 36` — the second extension character is invariant for a fixed daily recording time. Only the first character cycles through 3 values. - -**Old firmware (S338):** 3-char extensions observed (`.N00`, `.EI0`, etc.) — may simply be manual downloads under the same AB0 scheme, or a different encoding. Not yet confirmed. - -**Micromate Series 4** uses a different extension format (observed: `IDFH`, `IDFW`). This formula does NOT apply to Micromate units. - -All waveform files share the same `00 12 03 00` type tag regardless of extension. Blastware identifies file type by extension, not by type tag alone. - -### D.2 Timestamp Encoding (Blastware files) - -All timestamps in N00 and MLG files use an **8-byte big-endian format**: - -| Byte | Field | -|---|---| -| 0 | day (uint8) | -| 1 | month (uint8) | -| 2–3 | year (uint16 BE) | -| 4 | `0x00` (reserved) | -| 5 | hour (uint8) | -| 6 | minute (uint8) | -| 7 | second (uint8) | - -Example: `01 04 07 ea 00 00 1c 08` → April 1, 2026, 00:28:08. - -Note: this differs from the 8-byte protocol timestamp (`[day][sub_code][month][year_HI][year_LO][0x00][hour][min][sec]` = 9 bytes) used in the device's on-wire 0C waveform records. The file format uses a compact 8-byte layout without the `sub_code` byte. - -### D.3 N00 File Format — Single-Shot Waveform Event - -**File layout:** `[22B header] [21B STRT record] [body bytes] [26B footer]` - -#### D.3.1 STRT Record (21 bytes) - -The STRT record immediately follows the 22-byte header. - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 4 | `STRT` | ASCII literal | -| 4 | 2 | `ff fe` | Fixed | -| 6 | 4 | event key (key4) | 4-byte waveform key | -| 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field | -| 14 | 6 | device-specific | NOT zero-padded — device-internal fields | -| 20 | 1 | rectime | uint8 seconds | - -**Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone. - -#### D.3.2 Body Bytes (variable) - -The body is reconstructed from the raw A5 bulk waveform stream frames by stripping DLE framing markers and taking the appropriate slice of each frame's data section. - -**Per-frame contribution (from `frame.data`):** - -| Frame | Skip amount | Notes | -|---|---|---| -| A5[0] (probe) | `7 + strt_pos_in_w0 + 21` | Skip frame.data prefix + STRT record | -| A5[1] | 13 | 7-byte prefix + 6-byte first-chunk header | -| A5[2..N] | 12 | 7-byte prefix + 5-byte chunk header | -| Terminator (page_key=0x0000) | 11 | 7-byte prefix + 4-byte terminator header | - -**DLE strip rule:** For each frame's contribution (`frame.data[skip:]`), strip any `0x10` byte immediately followed by `0x02`, `0x03`, or `0x04`. Only the `0x10` is stripped; the following byte is kept as payload. - -**Split-pair edge case:** When `frame.data[-1] == 0x10` AND `frame.chk_byte ∈ {0x02, 0x03, 0x04}`, the S3FrameParser split a DLE+XX pair at the payload/checksum boundary. Reunite the bytes before stripping (`relevant + bytes([chk_byte])`), then always remove the trailing chk_byte from the result (`stripped[:-1]`) — chk_byte is the wire checksum, never payload. - -**Body/footer split:** Accumulate all frame contributions (data frames + terminator) into `all_bytes`. Then: -- `body = all_bytes[:-26]` (variable length) -- `footer = all_bytes[-26:]` (always 26 bytes — extracted from terminator content) - -#### D.3.3 Footer (26 bytes) - -The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata. - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 2 | `0e 08` | Fixed marker | -| 2 | 8 | ts1 | Start timestamp (8B big-endian) | -| 10 | 8 | ts2 | Stop timestamp (8B big-endian) | -| 18 | 6 | `00 01 00 02 00 00` | Fixed | -| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed | - -**CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. - -### D.4 MLG File Format — Monitor Log - -**File layout:** `[308B header] [N × 292B records]` - -#### D.4.1 MLG Header (308 bytes) - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0x00 | 22 | common header | prefix + `22 01 0e a0` type tag | -| 0x16 | 16 | unknown | observed as zeros in BE11529.MLG | -| 0x2A | 8 | serial number | null-padded ASCII (e.g. `"BE11529"`) | -| 0x32 | remainder | zero pad | pads to 308 bytes total | - -#### D.4.2 MLG Record (292 bytes each) - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 2 | CRC | 2-byte CRC — algorithm unconfirmed; write as `00 00` | -| 2 | 4 | `22 01 0e 80` | Record marker | -| 6 | 8 | ts1 | Start timestamp (8B big-endian) | -| 14 | 8 | ts2 | Stop timestamp (8B big-endian); zeros if no stop | -| 22 | 4 | flags | Record type flags (see below) | -| 26 | 10 | serial | Null-padded ASCII serial number | -| 36 | variable | text | Type-dependent content | -| — | remainder | zero pad | pads to 292 bytes total | - -**Record flags:** - -| Value | Meaning | -|---|---| -| `ff ff 00 00` | Monitoring start with no stop recorded | -| `01 00 02 00` | Triggered event (has ts1 + ts2) | -| `02 00 00 00` | Monitoring interval (has ts1 + ts2) | - -**Text content for triggered events (`flags = 01 00 02 00`):** - -| Byte | Field | -|---|---| -| 0 | `0x08` | -| 1–8 | ts1 copy (8B big-endian) | -| 9+ | `"Geo: X.XXX in/s\x00"` ASCII geo threshold | - -#### D.4.3 MLG CRC - -The 2-byte CRC at record[0:2] uses an unconfirmed algorithm. Tested against CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), word sums, XOR variants, and 40+ polynomial/init combinations — none matched. The writer emits `00 00`. Blastware may reject files with incorrect CRCs (impact on import unknown — TODO: test). - -### D.5 Filename Encoding ✅ PARTIALLY CONFIRMED 2026-04-22 - -Blastware assigns waveform filenames of the form ``, where: - -#### D.5.1 Serial Prefix ✅ CONFIRMED 2026-04-22 - -The first 4 characters of the filename encode the full device serial number: - -``` -prefix_letter = chr(ord('B') + floor(serial_numeric / 1000)) -serial3 = f"{serial_numeric % 1000:03d}" (last 3 digits, zero-padded) -``` - -Where `serial_numeric` is the integer after the "BE" device-type prefix. - -Examples (all confirmed from archive): - -| Serial | serial_numeric / 1000 | prefix_letter | serial3 | Filename prefix | -|--------|----------------------|---------------|---------|-----------------| -| BE6907 | 6 | H | 907 | H907 | -| BE7145 | 7 | I | 145 | I145 | -| BE11529 | 11 | M | 529 | M529 | -| BE14036 | 14 | P | 036 | P036 | -| BE17353 | 17 | S | 353 | S353 | -| BE18003 | 18 | T | 003 | T003 | -| BE18191 | 18 | T | 191 | T191 | -| BE18676 | 18 | T | 676 | T676 | - -**Interpretation:** The prefix letter encodes the production generation (batch of 1000 units). B=generation 0 (serials 0–999), C=generation 1 (1000–1999), etc. No units with prefix A have been observed — the earliest known units start around serial 2000+ (prefix D). - -**Note:** The "BE" device-type prefix is implicit. The filename only encodes the numeric part of the serial. Other Instantel device types (Micromate, Blastmate) may use a different scheme. - -#### D.5.2 Stem + Extension — full timestamp encoding ✅ FULLY CONFIRMED 2026-04-22 - -The stem (4 chars) and AB extension (2 chars) together form a 6-digit base-36 number encoding a complete second-resolution timestamp: - -```python -total_seconds = stem_int * 1296 + ab_int -event_local_time = datetime(1985, 1, 1) + timedelta(seconds=total_seconds) -``` - -- **Epoch:** `1985-01-01 00:00:00` **device local time** ✅ CONFIRMED — verified against 3,248 files from a 10-year production archive; zero errors (only 2 mismatches were Micromate `IDFH`/`IDFW` files which use a completely different naming scheme) -- **Unit:** 1296 seconds = 36² ≈ 21.6 minutes per stem increment -- **Alphabet:** `"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"` (digits then uppercase letters) -- **Collision:** Events within the same 21.6-minute window share a stem; extension distinguishes them - -**Decoding example — `P036L318.C80H` (BE14036, Full Histogram):** -``` -stem L318 = 21×36³ + 3×36² + 1×36 + 8 = 983,708 -AB C8 = 12×36 + 8 = 440 -total_sec = 983,708 × 1296 + 440 = 1,274,886,008 -event_time = 1985-01-01 + 1,274,886,008s = 2025-05-26 15:00:08 local -``` - -**Note on local time:** The device's onboard clock is set to the local timezone of the deployment site. The epoch and all timestamps are in that same local time — there is no UTC conversion. Files moved between timezones will decode to the original deployment timezone. - -#### D.5.3 Extension taxonomy — historical rewrite (FULLY DECODED 2026-04-22) - -The extension third character is always `'0'`. The full encoding scheme is now -mapped — see **D.5.2** for the canonical formula. The earlier "recording-mode" -taxonomy in this section was wrong and has been removed. - -**Summary (new firmware V10.72+ via ACH download):** - -``` -Extension = AB0T - -AB = base-36 of (total_seconds % 1296) — seconds within the 21.6-min window -0 = literal digit zero (invariant third character) -T = W (Waveform) | H (Histogram) — present only for ACH downloads -``` - -Direct/manual Blastware downloads produce `.AB0` (3 chars, no trailing type -character). `blastware_filename()` in `minimateplus/blastware_file.py` -implements the formula; it falls back to `.N00` as a placeholder for -old-firmware units (S338) where the extension encoding has not been confirmed. - -The previously listed extensions `.9T0` / `.490` / `.5K0` / `.980` / `.ML0` -were the **same continuous-mode unit recording at different times of day**. -Their bytes were byte-for-byte identical except for header fields that change -per event — exactly what D.5.2 predicts: same firmware, same recording mode, -different timestamp → different extensions. No correlation with recording mode. - -| Extension type char (4-char ACH) | Meaning | -|---|---| -| `W` | Full Waveform | -| `H` | Full Histogram | - -**Micromate Series 4** uses a different scheme entirely (`IDFH`, `IDFW` -observed) and does NOT follow the AB0T formula. - -**DLE-shift offset note for reading recording_mode from N00/9T0 body:** - -The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: - -| 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) | -|---|---| -| `file[anc−7]` = recording_mode | `file[anc−8]` = recording_mode | -| `file[anc−6:anc−4]` = sample_rate | `file[anc−6:anc−4]` = sample_rate | - -For 1024 sps files, the expected file bytes around the anchor are: -``` -file[anc−9]: mode_prefix (0x00 for Single Shot/Continuous; 0x10 for Histogram) -file[anc−8]: 0x00 (was recording_mode, but shifted away — now reads 0x00 for mode_prefix) -file[anc−7]: recording_mode (0x00=Single Shot, 0x01=Continuous, etc.) -file[anc−6]: 0x04 (sample_rate_HI for 1024 sps) -file[anc−5]: 0x00 (sample_rate_LO) -file[anc−4]: histogram_interval_HI -file[anc−3]: histogram_interval_LO -``` - ---- - -*All findings reverse-engineered from live RS-232 bridge captures.* -*Cross-referenced from 2026-03-02 with Instantel MiniMate Plus Operator Manual (716U0101 Rev 15).* -*This is a living document — append changelog entries and timestamps as new findings are confirmed or corrected.* - ---- - -## Appendix E — Known Device Faults (field-observed, 2026-08-25) - -This appendix records *device* behaviour, not protocol. It exists -because these signatures are easy to mistake for decoder bugs — and one -of them was, for a while. - -### E.1 The "offset" fault - -> **The full investigation now lives in `docs/offset_investigation.md`** -- -> base rate, detector definition, per-unit case files, ruled-out hypotheses, -> and Instantel's own autozero procedure with its 2027-2069 acceptance -> window. This appendix is kept as the protocol-side summary. - -**Symptom.** One geophone channel's baseline steps away from zero and -stays there. The trace still carries the real AC signal, but it rides -on a DC pedestal of a few tenths of an in/s. Operators call this an -"offset"; it is a known recurring hardware fault, historically resolved -by returning the unit to Instantel, shelving it until calibration, or a -per-channel re-zero in an advanced/professional Blastware build. - -**Why it floods the queue.** The pedestal exceeds the unit's own geo -trigger level, so the channel sits permanently above threshold and the -unit retriggers as fast as it can rearm — one event every 3–7 minutes -for as long as the fault persists. In the surveyed snapshot the worst -episode produced 193 events in 38 hours. - -| unit | window | events | channel | pedestal | that unit's trigger level | -|---|---|---|---|---|---| -| BE9558 | 2026-05-15 → 05-16 | 193 | Long | +0.335 | 0.200 | -| BE18438 | 2026-02-25 → 02-26 | 64 | Vert | +0.327 | 0.200 | -| BE18438 | 2025-11-15 | 12 | Vert | +0.312 | 0.200 | -| BE9558 | 2026-04-14 / 04-29 / 05-04 | 5 total | Tran | +0.29…+0.44 | 0.200 | - -**It is NOT a decode artifact.** These events reproduce *exactly* in -Blastware's own ASCII export — e.g. `BE12599/N599LQD7.8E0W` Tran reads -mean +0.345, min +0.335, max +0.355 in both our decode and BW's. Any -shape-based false-trigger detector must treat this as a real device -condition, not corrupt data. - -**Detection rule that works:** - -``` -dominant geo axis: |mean| / peak > 0.7 - AND: |mean| >= 0.9 x that unit's geo trigger level -group hits into episodes by serial with a 12 h gap -``` - -A bare `|mean|/peak` threshold is useless — a quiet trace sitting at the -0.010 in/s noise floor clears any ratio test. On the surveyed store the -bare rule flagged 7,184 events; the rule above flags 274, all real. -Candidate list: `scratch/offset_candidates.csv`. - -**What the data rules out.** - -- *Not the geophone.* The on-device sensor check passes on every unit, - offset or not — test frequency 7.2–8.1 Hz, damping ratio 3.3–4.7, - zero failures fleet-wide, including mid-episode. The coil and its - mechanical response are healthy. -- *Not the battery.* 6.6–6.8 V on the affected units, same as the rest. -- *Not environmental.* Only 2 units of 21 ever show it. BE17353 logged - 395 waveform events over nine months with zero occurrences; BE7145, - 295 events, zero. Weather acts on all of them equally. -- *Not condensation.* BE18438's Vert held 0.179 → 0.189 for 34 hours - **including a 10-hour overnight gap**, then stepped to 0.33 at 13:24 - in the afternoon. Dew would peak overnight; it was flat overnight. - -**What the data shows.** The pedestal is *piecewise constant* — it -holds rock-steady, survives power-off gaps, and changes only in discrete -steps. A small common-mode diurnal wobble rides on top of it, but that -wobble is present on the healthy channels too (it is the unit's normal -thermal breathing) and is not the fault. - -**The fault is on the geophone side.** Operator report (2026-08-25): -*attaching a different geophone to an affected unit makes the offset go -away.* That is the channel-swap test, already run in the field many -times, and it rules out the unit's analog front-end and any stored -per-channel zero constant — a constant lives in the unit and would -survive a sensor swap. - -The stored data agrees. MicL — a separate transducer on its own cable — -shows no offset during either episode (`|mean|/peak` = 0.17 and 0.02), -while the geo channels on the same unit at the same moment are pinned. - -**Two distinct failure patterns**, both geophone-side: - -| unit | Tran | Vert | Long | MicL | reading | -|---|---|---|---|---|---| -| BE18438 | 0.16 | **0.97** | 0.18 | 0.02 | one element only | -| BE9558 | 0.90 | 0.81 | **0.99** | 0.17 | all three, Long dominant | - -(values are `\|mean\|/peak` on the dominant axis) - -BE18438 has a single faulted conductor pair with the other two clean. -BE9558 has all three geo channels offset by different amounts -(Long +0.340, Tran +0.037, Vert −0.020) — that points at a shared return -or ground path in the housing rather than one element. - -**Candidate mechanisms.** A geophone coil is passive and cannot -generate sustained DC on its own, so an offset originating on the sensor -side has to come from one of: - -1. *Galvanic corrosion at a connector or splice* — dissimilar metals - plus moisture form a literal cell. This generates DC directly, in - the tens-of-millivolts range that matches the measured offset - (0.29 in/s ÷ 6.206053 in/s per volt ≈ 46 mV referred to the ADC - input). Fits the discrete steps, surviving power cycles, and being - cured by swapping the sensor. -2. *A leakage path to shield or another conductor*, letting the unit's - own bias/reference divide into the signal pair. Best fit for the - BE9558 all-three-channels pattern. -3. *Changed coil DC resistance* (partial short or degraded winding) - interacting with the amplifier's input bias current — - `V_offset = I_bias × R_source`. Best fit for the BE18438 - single-element pattern. Note the on-device sensor check would not - catch this: it measures ring-down frequency and damping, not DC. - -**Caveat on the swap test.** Swapping a geophone requires stopping and -restarting monitoring, and these units run Sensor Check "Before -monitoring" — so the restart also re-zeros the channels. The swap -therefore does not cleanly separate *"new sensor"* from *"the restart -re-zeroed it"*. Two cheap controls settle it: restart monitoring -**without** swapping (if the offset clears, it was the re-zero), or swap -the **original** sensor back (if the offset returns, it is the sensor). -The operator's remedy being a swap rather than a restart is weak -evidence for the sensor, since a restart is the easier thing to try -first. - -**Best single measurement when it recurs:** DC voltage across the -suspect geophone's connector pins with the sensor **disconnected from -the unit**. A galvanic cell (mechanism 1) shows an open-circuit -voltage; mechanisms 2 and 3 do not. - -**Note:** the surveyed population is subject to survivorship bias — -flooded events were routinely deleted before this snapshot, so units -that look clean here may have had episodes that were scrubbed. +# Instantel MiniMate Plus — Blastware RS-232 Protocol Reference +### "The Rosetta Stone" +> Reverse-engineered via RS-232 serial bridge sniffing between Blastware software and an Instantel MiniMate Plus seismograph (S/N: BE18189). +> Cross-referenced against Instantel MiniMate Plus Operator Manual (716U0101 Rev 15) from v0.18 onward. +> **Certainty Ratings:** ✅ CONFIRMED | 🔶 INFERRED | ❓ SPECULATIVE +> Certainty ratings apply only to protocol semantics, not to capture tooling behavior. + +--- + +## Changelog + +| Date | Section | Change | +|---|---|---| +| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s plus 1 s pre-trigger), all three channels equal, peaks equal to the unit's own 0C values. | +| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | +| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | +| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | +| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | +| 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. | +| 2026-05-20 | §2, §3, §4.2, §5.1, §5.3, §6, §7.5b, §7.6.1, §7.6.3, §7.6.4, §7.7.2, §7.7.3, §7.7.5, §7.8.4, §7.8.7, §7.9, §8, §11, §12, §13, §14, §15, Appendix D | **DOC AUDIT PASS — accuracy sweep against `CLAUDE.md` + `minimateplus/` code.** Fixed: (1) S3 frames terminate on bare ETX, not DLE+ETX — §2/§3 rewritten. (2) §3 payload layout corrected — byte[1]=flags, byte[2]=SUB (was wrongly labelled DLE/ADDR). (3) §4.2 — probe responses do NOT carry data length; lengths are hardcoded `DATA_LENGTHS` constants. (4) §5.1 — removed stale duplicate "SUB 1C = TRIGGER CONFIG READ" row; SUB 0A lengths corrected from `0x30/0x26` to `0x46/0x2C` (real event / boundary marker). (5) §5.3 — added missing write-frame format (BW_CMD-only doubling, DLE-aware checksum, offset formula, ack format, SUB 71 chunk parameters). (6) §6 — fixed "SUB 06 → channel config read" → event storage range. (7) §7.5b / §8 — added the 10-byte `sub_code=0x03` continuous-mode timestamp variant alongside the 9-byte single-shot layout; peak vector sum location corrected from "fixed offset 87" to `tran_pos − 12` (label-relative). (8) §7.6 / §7.6.1 / §7.6.3 / §7.6.4 — switched compliance-anchor convention from the 10-byte form to the canonical 6-byte `\xbe\x80\x00\x00\x00\x00`; recording_mode confirmed at anchor−8 in BOTH read and write (was wrongly listed as anchor−3 write / anchor−4 read); sample_rate at anchor−6, histogram_interval at anchor−4, record_time at anchor+6; geo_range row added at channel_label+33. (9) §7.7.2 — token byte position corrected from `params[6]` to `params[7]`. (10) §7.8.4 — fi==9 skip marked FIXED (already removed from code); chunk-count totals updated. (11) §7.8.7 — TODO replaced with current state of `_decode_a5_metadata_into`. (12) §7.9 — Histogram Interval upgraded ❓ → ✅. (13) §11 — POLL example wire bytes corrected; SUB 5A row added to checksum table. (14) §13 — device-under-test updated for current primary unit (BE11529 / S338.17). (15) §14 — TCP Idle Timeout fixed (0→2 min); Data Forwarding Timeout units clarified. (16) §15 (renumbered from second §14) — open-question items already resolved in CLAUDE.md closed out. (17) Appendix D — extension taxonomy rewritten to reflect the AB0T timestamp encoding (D.5.2/D.5.3); EXTENSION REFUTED warning replaced with the resolved encoding. | +| 2026-05-08 | §7.6.1 (RETRACTION) | **❌ RETRACTED — "raw int16 LE 8 bytes/sample-set" body codec was never validated.** The original 4-2-26 confirmation was based on misreading broken-decoder output (full-scale ±32K noise) as evidence the signal had saturated. BW's own 0C peaks for that capture (Tran=0.420 / Vert=3.870 / Long=0.495 in/s) prove the signal was NOT saturated — none of those exceed 13K ADC counts. No event in the project's archive has ever come close to saturation, yet the decoder consistently produces ±32K noise on every event. Conclusion: the body codec is not raw int16 LE; the actual encoding is open. Body byte distribution is heavily skewed (24% `0x00`, 10.5% `0x10`, lots of `10 XX` pairs) — likely a delta encoding with `0x10` as escape, but unverified. Retraction box added at top of §7.6.1; "fully-saturating event" claim removed from channel-identification note. The histogram codec in §7.6.2 IS verified and decoded correctly (different recording mode, 32-byte blocks); use it as a structural hint when reverse-engineering the waveform codec. | +| 2026-02-26 | Initial | Document created from first hex dump analysis | +| 2026-02-26 | §2 Frame Structure | **CORRECTED:** Frame uses DLE-STX (`0x10 0x02`) and DLE-ETX (`0x10 0x03`), not bare `0x02`/`0x03`. `0x41` confirmed as ACK not STX. DLE stuffing rule added. | +| 2026-02-26 | §8 Timestamp | **UPDATED:** Year `0x07CB = 1995` confirmed as MiniMate hardware default date when RTC battery is disconnected. Not an encoding error. Confidence upgraded from ❓ to 🔶. | +| 2026-02-26 | §10 DLE Stuffing | **UPGRADED:** Section upgraded from ❓ SPECULATIVE to ✅ CONFIRMED. Full stuffing rules and parser state machine documented. | +| 2026-02-26 | §11 Checksum | **UPDATED:** Frame builder and parser rewritten to handle DLE framing and byte stuffing correctly. | +| 2026-02-26 | §14 Open Questions | DLE question removed (resolved). Timestamp year question removed (resolved). | +| 2026-02-26 | §7.2 Serial Number Response | **CORRECTED:** Trailing bytes are `0x79 0x11` only (2 bytes, not 3). `0x20` was misidentified as a trailing byte — it is the frame checksum. | +| 2026-02-26 | §7.2 Serial Number Response | **UPDATED:** Two-unit comparison confirms `0x11` = firmware minor version (S337.**17** → `0x11` = 17). Byte 0 is unit-specific, derivation unknown. | +| 2026-02-26 | §15 Binary Log Format | **NEW:** `.bin` logger format strips DLE from ETX (`0x10 0x03` → `0x03`). Not raw wire bytes. | +| 2026-02-26 | §5.1 Request Commands | **ADDED:** Three new read commands confirmed: SUB `09`, `1A`, `2E`. | +| 2026-02-26 | §5.3 Write Commands | **NEW SECTION:** Full write command family documented from compliance setup capture. SUBs `68`–`83`. | +| 2026-02-26 | §7.5 Full Waveform Record | **UPDATED:** Project strings field layout fully mapped from write payload diff. Client field confirmed at byte +230 in SUB `71` frame. | +| 2026-02-26 | §14 Open Questions | Write commands question resolved. Session `152427` had swapped port labels — superseded by sessions `184518` and `185019`. | +| 2026-02-26 | Global | **CORRECTED:** Firmware version `S338.17` → `S337.17` everywhere, including hex encoding at config offset `0x34`. | +| 2026-02-26 | §3 Payload Structure | **DOWNGRADED:** ADDR field certainty `🔶 INFERRED` → `❓ SPECULATIVE`. Added note that bytes 1–2 purpose is unconfirmed. | +| 2026-02-26 | §5.2 Response SUBs | **STRENGTHENED:** `0xFF - SUB` rule wording clarified — high confidence, no counterexample, not yet formally proven. | +| 2026-02-26 | §15 → Appendix A | **RENAMED:** Binary log format section moved to Appendix A with explicit note that it describes tooling behavior, not protocol. | +| 2026-02-26 | Header | **ADDED:** Certainty legend clarification — ratings apply to protocol semantics only, not tooling behavior. | +| 2026-02-26 | §7.6 Channel Config Float Layout | **NEW SECTION:** Trigger level confirmed as IEEE 754 BE float in in/s. Alarm level identified as adjacent float = 1.0 in/s. Unit string `"in./s"` embedded inline. `0x082A` removed as trigger level candidate. | +| 2026-03-01 | §7.6 Channel Config Float Layout | **UPGRADED:** Alarm level offset fully confirmed via controlled capture (alarm 1.0→2.0, trigger 0.5→0.6). Complete per-channel layout documented. Three-channel repetition confirmed (Tran, Vert, Long). Certainty upgraded to ✅ CONFIRMED. | +| 2026-03-01 | §7.7 `.set` File Format | **NEW SECTION:** Blastware save-to-disk format decoded. Little-endian binary struct matching wire protocol payload. Full per-channel block layout mapped. Record time confirmed as uint32 at +16. MicL unit string confirmed as `"psi\0"`. `0x082A` mystery noted — not obviously record time, needs one more capture to resolve. | +| 2026-03-02 | §7.4 Event Index Block | **CONFIRMED:** Backlight and power save offsets independently confirmed via device-set capture (backlight=100=0x64 at +75, power-save=30=0x1E at +83). On-device change visible in S3→BW read response — no Blastware write involved. Offsets are ✅ CONFIRMED. | +| 2026-03-02 | §7.4 Event Index Block | **NEW:** `Monitoring LCD Cycle` identified at offsets +84/+85 as uint16 BE. Default value = 65500 (0xFFDC) = effectively disabled / maximum. Confirmed from operator manual §3.13.1g. | +| 2026-03-02 | §7.4 Event Index Block | **UPDATED:** Backlight confirmed as uint8 range 0–255 seconds per operator manual §3.13.1e ("adjustable timer, 0 to 255 seconds"). Power save unit confirmed as minutes per operator manual §3.13.1f. | +| 2026-03-02 | Global | **NEW SOURCE:** Operator manual (716U0101 Rev 15) added as reference. Cross-referencing settings definitions, ranges, and units. Header updated. | +| 2026-03-02 | §14 Open Questions | Float 6.2061 in/s mystery: manual confirms only two geo ranges (1.25 in/s and 10.0 in/s). 6.2061 is NOT a user-selectable range → originally speculated as internal ADC full-scale constant, but was NOT confirmed at this time. Using it directly as the range produces ~9× PPV overread. Meaning unknown. Downgraded to LOW 2026-03-02, re-escalated to HIGH 2026-04-16. **RESOLVED 2026-04-17 — see §7.6.2 and changelog entry.** | +| 2026-03-02 | §14 Open Questions | `0x082A` hypothesis refined: 2090 decimal. At 1024 sps, 2 sec record = 2048 samples. Possible that 0x082A = total samples including 0.25s pre-trigger (256 samples) at some adjusted rate. Needs capture with different record time. | +| 2026-03-02 | §14 Open Questions | **NEW items added:** Trigger sample width (default=2), Auto Window (1-9 sec), Aux Trigger (enabled/disabled) — all confirmed settings from operator manual not yet mapped in protocol. | +| 2026-03-02 | §14 Open Questions | Monitoring LCD Cycle resolved — removed from open questions. | +| 2026-03-02 | Appendix A | **CORRECTED:** Previous entry stated logger strips DLE from ETX. This was wrong — it applied to an older logger version. `s3_bridge v0.5.0` confirmed to preserve raw wire bytes including `0x10 0x03` intact. HxD inspection of new capture confirmed `10 03` present in S3→BW record payloads. | +| 2026-03-02 | Appendix A | **UPDATED:** New capture architecture: two flat raw wire dumps per session (`raw_s3.bin`, `raw_bw.bin`), one per direction, no record wrapper. Replaces structured `.bin` format for parser input. | +| 2026-03-02 | Appendix A | **PARSER:** Deterministic DLE state machine implemented (`s3_parser.py`). Three states: `IDLE → IN_FRAME → AFTER_DLE`. Replaces heuristic global scanning. Properly handles DLE stuffing (`10 10` → literal `10`). Only complete STX→ETX pairs counted as frames. | +| 2026-03-02 | Appendix A | **VALIDATED:** `raw_bw.bin` yields 7 complete frames via state machine. `raw_s3.bin` contains large structured responses (first frame payload ~3922 bytes). Both files confirmed lossless. BW bare `0x02` pattern confirmed as asymmetric framing (BW sends bare STX, S3 sends DLE+STX). | +| 2026-03-09 | §7.6, §Appendix B | **CONFIRMED:** Record time located in SUB E5 data page2 at payload offset `+0x28` as **float32 BE**. Confirmed via two controlled captures: 7 sec = `40 E0 00 00`, 13 sec = `41 50 00 00`. Geo range (only 1.25 or 10.0 in/s) eliminates ambiguity — 7 and 13 are not valid geo range values. | +| 2026-03-09 | §7.5, §14 | **CORRECTED:** The byte `0x0A` appearing after the "Extended Notes" null-padded label in the E5 payload is **NOT** record time. It is an unknown field that equals 10 and does not change when record time changes. False lead closed. | +| 2026-03-09 | §14 | **RESOLVED:** `0x082A` mystery closed — confirmed as fixed-size E5 payload length (2090 bytes), not a record-time-derived sample count. Value is constant regardless of record time or other settings. | +| 2026-03-09 | §7.8, §14, Appendix B | **NEW — Trigger Sample Width confirmed:** Located in BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Confirmed via BW-side capture (`raw_bw.bin`) diffing two sessions: Width=4 → `0x04`, Width=3 → `0x03`. Setting is **transmitted only on BW→S3 write** (SUB `0x82`), invisible in S3-side compliance dumps. | +| 2026-03-09 | §14, Appendix B | **CONFIRMED — Mode gating is a real protocol behavior:** Several settings are only transmitted (and possibly only interpreted by the device) when the required mode is active. Trigger Sample Width is only sent when in Compliance/Single-Shot/Fixed Record Time mode. Auto Window is only relevant when Record Stop Mode = Auto — attempting to capture it in Fixed mode produced no change on the wire (F7 and D1 blocks identical before/after). This is an architectural property, not a gap in the capture methodology. Future capture attempts for mode-gated settings must first activate the appropriate mode. | +| 2026-03-09 | §14 | **UPDATED — Auto Window:** Capture attempted (Auto Window 3→9) in Fixed record time mode. No change observed in any S3-side frame (F7, D1, E5 all identical). Confirmed mode-gated behind Record Stop Mode = Auto. Not capturable without switching modes — deferred. | +| 2026-03-11 | §14, Appendix B | **CONFIRMED — Aux Trigger read location:** SUB `FE` (FULL_CONFIG_RESPONSE), destuffed payload offset `0x0109`, uint8. `0x00` = disabled, `0x01` = enabled. Confirmed via controlled capture: changed Aux Trigger in Blastware, sent to unit, re-read config. FE diff showed clean isolated flip at `0x0109` with only 3 other bytes changing (likely counters/checksums at `0x0033`, `0x00C0`, `0x04ED`). | +| 2026-03-11 | §14, Appendix B | **PARTIAL — Aux Trigger write path:** Write command not yet isolated. The BW→S3 write appears to occur inside the A4 (POLL_RESPONSE) stream via inner frame handshaking — multiple WRITE_CONFIRM_RESPONSE inner frames (SUBs `7C`, `7D`, `8B`, `8C`, `8D`, `8E`, `96`, `97`) appeared in A4 after the write, and the TRIGGER_CONFIG_RESPONSE (SUB `E3`) inner frames were removed. Write command itself not yet captured in a clean session — likely SUB `15` or embedded in the partial session 0. Write path deferred for a future clean capture. | +| 2026-03-11 | §4, §14 | **NEW — SUB A4 is a composite container frame:** A4 (POLL_RESPONSE) payload contains multiple embedded inner frames using the same DLE framing (10 02 start, 10 03 end, 10 10 stuffing). Phase-shift diffing issue resolved in s3_analyzer.py by adding `_extract_a4_inner_frames()` and `_diff_a4_payloads()` — diff count reduced from 2300 → 17 meaningful entries. | +| 2026-03-11 | §14 | **NEW — SUB `6E` response anomaly:** BW sends SUB `1C` (TRIGGER_CONFIG_READ) and S3 responds with SUB `6E` — does NOT follow the `0xFF - SUB` rule (`0xFF - 0x1C = 0xE3`). Only known exception to the response pairing rule observed to date. SUB `6E` payload starts with ASCII string `"Long2"`. ~~CORRECTION 2026-04-08: This "exception" was a misidentification. The `1C` in that capture was BW→S3 (a monitor status poll), and the `6E` response was from an inner A4 sub-frame misread as a top-level S3 frame. Confirmed from 4-8-26/2ndtry capture (338 BW TX frames): SUB 0x1C always receives response SUB 0xE3 (= 0xFF − 0x1C). No exceptions to the response pairing rule are known.~~ | +| 2026-03-12 | §11 | **CONFIRMED — BW→S3 large-frame checksum algorithm:** SUBs `68`, `69`, `71`, `82`, and `1A` (with data) use: `chk = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) % 256` — SUM8 of payload bytes `[2:-1]` skipping all `0x10` bytes, plus `0x10` as a constant, mod 256. Validated across 20 frames from two independent captures with differing string content (checksums differ between sessions, both validate correctly). Small frames (POLL, read commands) continue to use plain SUM8 of `payload[0:-1]`. The two formulas are consistent: small frames have exactly one `0x10` (CMD at `[0]`), which the large-frame formula's `[2:]` start and `+0x10` constant account for. | +| 2026-03-12 | §11 | **RESOLVED — BAD CHK false positives on BW POLL frames:** Parser bug — BW frame terminator (`03 41`, ETX+ACK) was being included in the de-stuffed payload instead of being stripped as framing. BW frames end with bare `0x03` (not `10 03`). Fix: strip trailing `03 41` from BW payloads before checksum computation. | +| 2026-03-30 | §3, §5.1 | **CONFIRMED — BW→S3 two-step read offset is at payload[5], NOT payload[3:4].** All BW read-command frames have `payload[3] = 0x00` and `payload[4] = 0x00` unconditionally. The two-step offset byte lives at `payload[5]`: `0x00` for the length-probe step, `DATA_LEN` for the data-fetch step. Validated against all captured frames in `bridges/captures/3-11-26/raw_bw_*.bin` — every frame is an exact bit-for-bit match when built with offset at `[5]`. The `page_hi`/`page_lo` framing in the docstring was a misattribution from the S3-side response layout (where `[3]`/`[4]` ARE page bytes). | +| 2026-03-30 | §4, §5.2 | **CONFIRMED — S3 probe response page_key is always 0x0000.** The S3 response to a length-probe step does NOT carry the data length back in `page_hi`/`page_lo`. Both bytes are `0x00` in every observed probe response. Data lengths for each SUB are fixed constants (see §5.1 table). The `minimateplus` library now uses a hardcoded `DATA_LENGTHS` dict rather than trying to read the length from the probe response. | +| 2026-03-31 | §12 TCP Transport | **NEW SECTION — TCP/modem transport confirmed transparent from Blastware Operator Manual (714U0301 Rev 22).** Key facts confirmed: (1) Protocol bytes over TCP are bit-for-bit identical to RS-232 — no handshake framing. (2) No ENQ byte on TCP connect (`Enable ENQ on TCP Connect: 0-Disable` in Raven ACEmanager). (3) Raven modem `Data Forwarding Timeout = 1 second` — modem buffers serial bytes up to 1s before forwarding over TCP; `TcpTransport.read_until_idle` uses `idle_gap=1.5s` to compensate. (4) TCP port is user-configurable (12335 in manual example; user's install uses 12345). (5) Baud rate over serial link to modem is 38400,8N1 regardless of TCP path. (6) ACH (Auto Call Home) = INBOUND to server (unit calls home); "call up" = OUTBOUND from client (Blastware/SFM connects to modem IP). `TcpTransport` implements outbound (call-up) mode. | +| 2026-03-31 | §14.3 | **NEW — Sierra Wireless RV50/RV55 Quiet Mode requirement confirmed.** Quiet Mode (ATQ) must be **enabled** on the serial port. When disabled (+ Verbose mode on), the modem injects `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time — MiniMate receives unexpected bytes, loses protocol sync, and never responds to POLL (unit beeps but returns no S3 frame). Working RV50 field config: Quiet Mode enabled, Data Forwarding Timeout=1, TCP Connect Response Delay=0. Misconfigured RV55 had all three wrong. | +| 2026-03-31 | §14.2 | **CORRECTED — Sierra Wireless RV50/RV55 sends `RING`/`CONNECT` over TCP to caller even with Quiet Mode enabled.** Quiet Mode suppresses these only on the serial port (protecting the MiniMate). TCP client still receives `\r\nRING\r\n\r\nCONNECT\r\n` prefixed before the first S3 frame bytes. Parser handles correctly by scanning for DLE+STX (`0x10 0x02`) and discarding prefix bytes. Previous note "no CONNECT string" described Raven X ENQ-disable behaviour; RV50/RV55 differ. | +| 2026-03-31 | §7.3 | **NEW — Calibration date field confirmed** at Full Config (SUB FE) destuffed payload offsets 0x53–0x57. Two-unit comparison: BE18189 (calibrated 2023) has `07 E7` at 0x56–0x57; BE11529 (calibrated 2025) has `07 E9`. Bytes 0x56–0x57 = uint16 BE calibration year ✅ CONFIRMED. Adjacent bytes at 0x53–0x55 likely encode month/day (both units show `0x10` at offset 0x54 = BCD October; 0x53 and 0x55 differ between units). Full date layout 🔶 INFERRED — pending third-unit capture or recalibration diff. Resolves open question. | +| 2026-03-31 | §9 | **CONFIRMED via Console cold-start capture** — `"Operating System"` (16 B: `4f 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d`) arrives as first TCP bytes on cold-connect before unit enters DLE-framed mode. `TcpTransport` + retry logic handles gracefully: first attempt times out waiting for SUB A4; second connect (after unit fully booted) succeeds. | +| 2026-04-01 | §7.7.5, §8 | **CONFIRMED — Full waveform record (0C) timestamp layout** cross-referenced against Blastware event report for BE11529 thump event ("00:28:12 April 1, 2026"). 9-byte format at bytes[0–8]: `[day][sub_code][month][year:2 BE][unknown][hour][min][sec]`. All fields verified. Sub_code `0x10` = Waveform (continuous/single-shot). **Previous 7-byte format doc was wrong** — replaced with confirmed 9-byte layout. | +| 2026-04-01 | §7.7.5 | **CONFIRMED — Record type** encoded in byte[1] (sub_code), not as ASCII string. `0x10` = Waveform ✅. Histogram sub_code not yet captured. ASCII string search approach removed. | +| 2026-04-01 | §7.7.5, §14 | **CONFIRMED — Per-channel PPV** at label+6 (✅ all four channels), cross-referenced vs Blastware: Tran=0.420, Vert=3.870, Long=0.495 in/s. **CONFIRMED — Peak Vector Sum** at fixed offset 87 = 3.906 in/s ✅ matches Blastware "Peak Vector Sum". Is √(Tran²+Vert²+Long²) at max instantaneous vector moment, not vector sum of per-channel peaks. Open question "offset 87 purpose" closed. | +| 2026-04-01 | §8 | **RESOLVED — §8 unknown byte at offset 3.** Field is confirmed absent in the 9-byte waveform record format (no such field). The 6-byte event-index format has a separator byte at [3] whose purpose remains ❓ but is no longer actively blocking anything. | +| 2026-04-01 | §7.6.2 (NEW) | **NEW — SUB 1A multi-frame read protocol documented.** SUB 1A (compliance config read) requires a 4-frame sequence, not a simple 2-step probe+fetch. Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture, ACK+STX/ETX format, BW CMD=0x10). Sequence: (A) probe `offset=0x0000, params=...00 64 00 00`; (B) data request `offset=0x0400, params=...00 64 00 00`; (C) data request `offset=0x0400, params=...04 00 00 64 00 00`; (D) data request `offset=0x002A, params=...08 00 00 64 00 00`. E5 response to each frame carries a `page_key` field (bytes `data[3:5]`): page `0x0000` = 44-byte header chunk, page `0x0010` = main config data (~1027+1055 bytes across C and D). | +| 2026-04-01 | §7.6.2 | **NEW — BE11529 duplicate-page behaviour.** BE11529 (firmware S338.17) sometimes responds to frame D with page `0x0000` (44 bytes) instead of page `0x0010` (~1055 bytes). When this happens, frame D is an exact duplicate of frame B and must be dropped to prevent cfg mis-alignment. Detection: track `(page_key, chunk_len)` pairs and skip repeats. When frame D delivers page `0x0010` correctly, total cfg = 44 + 1027 + 1055 = 2126 bytes; with duplicate D, cfg = 44 + 1027 = 1071 bytes. Both are valid inputs to the decoder. | +| 2026-04-01 | §7.6.1 | **CORRECTED — Record time offset.** Previous doc (`+0x28` from E5 data page2 start) was correct for single-frame reads but unreliable for BE11529 due to a 1-byte DLE jitter (see §7.6.3). The `minimateplus` library now uses an anchor-based approach: search for `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100]; record time float32 BE is at anchor+10. Validated at 3.0, 5.0, and 8.0 seconds. | +| 2026-04-01 | §7.6.3 (NEW) | **NEW — Sample rate confirmed and documented.** Sample rate (Normal=1024 / Fast=2048 / Faster=4096 Sa/s) is stored as uint16 BE at anchor−2, where anchor is the 10-byte sequence `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00`. DLE jitter root cause: 4096 = 0x1000, so in the raw S3 frame the sample-rate bytes are sent as `10 10 00` (DLE-escaped `10`); after DLE unstuffing → `10 00` (2 bytes instead of 3 for 1024/2048), making frame C 1 byte shorter and shifting all subsequent offsets by −1. Anchor search is immune to this shift. All three modes confirmed on BE11529 firmware S338.17. | +| 2026-04-01 | §5.1 | **CONFIRMED — `_pending_frames` buffer and `reset_parser=False` parameter.** `MiniMateProtocol._recv_one()` now supports `reset_parser=False` to preserve parser state between consecutive reads within a multi-frame sequence. A `_pending_frames: list[S3Frame]` buffer stores extra frames parsed from a single TCP chunk when multiple E5 responses arrive together. Required for reliable SUB 1A frame B/C/D sequence on BE11529. | +| 2026-04-02 | §7.8 (NEW) | **CONFIRMED — SUB 5A frame format.** `offset_hi` byte (`0x10`) must be sent **raw, not DLE-stuffed** — standard `build_bw_frame` incorrectly stuffs it to `10 10` on the wire; device ignores the frame. BW sends it as bare `10`. Checksum is **DLE-aware**: when walking the byte sequence, `10 XX` pairs contribute only `XX` to the sum; lone bytes contribute normally. `build_5a_frame()` reproduces BW's exact wire format. | +| 2026-04-02 | §7.8 | **CONFIRMED — SUB 5A params are 11 bytes (not 10) for chunk frames.** Extra trailing `0x00` confirmed from 1-2-26 BW wire capture. Probe frame and termination frame differ — see `bulk_waveform_params()` in `framing.py`. | +| 2026-04-02 | §7.7.5 | **CONFIRMED — Event-time metadata source.** `Client:`, `User Name:`, and `Seis Loc:` strings are present in **A5 frame 7** of the SUB 5A bulk waveform stream — they are NOT in the 210-byte SUB 0C waveform record. They reflect the compliance setup active when the event was stored on the device (not the current setup). `get_events()` now issues SUB 5A after each 0C download. Sequence: `1E → 0A → 0C → 5A → 1F`. | +| 2026-04-02 | §7.6.2 | **FIXED — Compliance config orphaned send bug.** An extra `self._send(SUB_COMPLIANCE / 0x2A / DATA_PARAMS)` before the B/C/D receive loop had no corresponding `recv_one()`. Every receive in the loop was consuming the previous send's response, leaving frame D's channel block unread. Bug removed. Total config bytes now ~2126 (was ~1071 due to truncation). `trigger_level_geo`, `alarm_level_geo`, `max_range_geo` are now correctly populated. | +| 2026-04-02 | §7.6.1 | **CORRECTED — Anchor search range.** Previous doc stated anchor search range `cfg[40:100]`. With the orphaned-send bug fixed, the 44-byte header padding is gone and the anchor now appears at `cfg[11]`. Corrected to `cfg[0:150]`. | +| 2026-04-03 | §7.6 | **CONFIRMED — Blast waveform format (4-2-26 capture).** Blast/waveform-mode SUB 5A stream uses 4-channel interleaved signed int16 LE, 8 bytes per sample-set [T,V,L,M]. NOT the 32-byte block format (which is noise/histogram mode only). Frame sizes are NOT multiples of 8 — cross-frame alignment correction required (track global byte offset mod 8; skip `(8-align)%8` bytes at each frame start). A5[0] STRT record confirmed: 21 bytes at db[7:]+11; waveform starts at strt_pos+27 (after 2-byte null pad + 4-byte 0xFF sentinel). Frame index 7 = metadata only, no ADC data. Full §7.6 rewritten. | +| 2026-04-03 | §7.6 | **CONFIRMED — Noise block format details.** 32-byte blocks: LE uint16 type + LE uint16 ctr + 9×int16 LE samples + 10B metadata. Samples are little-endian (previous doc said big-endian — WRONG). Type: 0x0016=sync (appears at start of each A5 frame), 0x0000=data. Noise floor ≈ 9–11 counts. Metadata fixed pattern `00 01 43 [2B var] 00 [pretrig] [rectime] 00 00` confirmed. | +| 2026-04-03 | client.py | **NEW — `_decode_a5_waveform()` and `download_waveform()` implemented.** `_decode_a5_waveform(frames_data, event)` decodes full A5 waveform stream into `event.raw_samples = {"Tran":[…], "Vert":[…], "Long":[…], "Mic":[…]}`. Populates `event.total_samples`, `event.pretrig_samples`, `event.rectime_seconds` from STRT record. Handles cross-frame alignment. `MiniMateClient.download_waveform(event)` calls `read_bulk_waveform_stream(stop_after_metadata=False)` then invokes the decoder. Waveform key stored on Event as `_waveform_key` during `get_events()`. | +| 2026-04-03 | §7.7.5 | **CONFIRMED — sub_code=0x03 (Waveform continuous) uses 10-byte timestamp header** — one byte wider than sub_code=0x10 layout. Cross-referenced against Blastware event report for BE11529 (15:20:17 Apr 3 2026). Raw header: `10 03 10 04 07 ea 00 0f 14 11` = [unknown_a][day][unknown_b][month][year:2 BE][unknown][hour][min][sec]. Peak Vector Sum is at `tran_label − 12` (label-relative, NOT fixed offset 87 — fixed offset only incidentally correct for sub_code=0x10). | +| 2026-04-05 | §7.8 | **CONFIRMED — 5A "Project:" string is session-start config, NOT per-event.** The "Project:" value in A5 frame 7 reflects the compliance setup active when the monitoring session started, not when the individual event was recorded. `_decode_a5_metadata_into()` only sets `project` from 5A when 0C did not already supply one. "Client:", "User Name:", "Seis Loc:", and "Extended Notes" are NOT in the 0C record and are set unconditionally from 5A. | +| 2026-04-06 | §5.1 | **CORRECTED — SUB 1F token position is params[7], NOT params[6].** Both 3-31-26 and 4-3-26 BW TX captures confirm: raw params `00 00 00 00 00 00 00 FE 00 00`, token byte at index 7. Previous doc (params[6]) was wrong — with wrong position the device ignores the token and 1F returns null immediately. | +| 2026-04-06 | §6.1 | **NEW — Full event download sequence documented** (§6.1). Sequence confirmed from 4-2-26 and 4-3-26 BW TX captures: `1E(all-zero) → [per event: 0A → 1E(arm/0xFE) → 0C → 1F(arm/0xFE) → POLL×3 → 5A → 1F(browse)]`. Each step documented with confirmed requirements. | +| 2026-04-06 | §6.1 | **CONFIRMED — 1E(token=0xFE) arm step required.** Device silently ignores all 5A probe frames unless a second 1E with token=0xFE is sent between 0A and 0C. Present in every download cycle in the 4-2-26 and 4-3-26 captures. | +| 2026-04-06 | §6.1 | **CONFIRMED — SUB 1F(token=0xFE) must precede POLL×3 before 5A.** BW always sends 1F(0xFE) before the 3 POLL cycles before 5A. 5A still uses the pre-advance key (set by 0A+1E-arm+0C); 1F only arms the device's 5A state machine. | +| 2026-04-06 | §6.1 | **CONFIRMED — browse 1F must be conditional.** Calling 1F(browse=True/all-zero) after a FAILED 5A disrupts device state and causes the next event's 5A probe to time out with 0 bytes received. Browse 1F is only called after a SUCCESSFUL 5A. Failure fallback: use the key returned by the prior 1F(arm/0xFE) call. | +| 2026-04-06 | §7.8 | **ADDED — `bytes_fed` diagnostic counter on S3FrameParser.** Counts raw bytes fed to the parser since last `reset()`. Logged at WARNING when 5A probe times out — distinguishes "device sent no bytes at all" from "device responded but frame was malformed or had wrong SUB". | +| 2026-04-06 | §7.8.2 | **CORRECTED — SUB 5A chunk counter is monotonic for ALL chunks.** Previous doc hard-coded chunk 1 counter as `0x1004` (from 4-2-26 BW TX capture). This was a Blastware artifact. Empirically confirmed: `counter = chunk_num * 0x0400` works (device responds immediately); counter=0x1004 for chunk 1 causes 120 s timeout. BW's true internal formula appears to be `key4[2:4] + n * 0x0400` — for event 1 (key `01110000`) this equals `n * 0x0400`. The device does not strictly validate counter values. | +| 2026-04-06 | §7.8.4 | **NEW — 5A end-of-stream signalling confirmed.** After streaming all waveform chunks, the device sends exactly **1 raw byte** in response to the next chunk request, then goes silent for the full recv timeout. This byte is NOT a complete DLE-framed A5 response — the frame parser accumulates it as `bytes_fed=1` and never assembles a frame. This is the device's natural end-of-stream signal. Handling: on TimeoutError, if `bytes_fed > 0` AND prior chunks were received, treat as graceful end and proceed to the termination frame. A `bytes_fed=0` timeout with no prior chunks is a genuine transport failure and must still raise. | +| 2026-04-06 | §7.8.4 | **NEW — 5A chunk timing and count (empirical, BE11529 at 1024 sps).** Each chunk response arrives within ~1 second over TCP/cellular. A 9,306-sample event (≈9.1 s at 1024 sps) produces **35 chunks** before end-of-stream. Chunks 1–16 have varying data lengths (1036–1123 bytes); chunks 17–35 are uniformly 1036 bytes each (post-event silence, all-zero ADC samples). Safe recv timeout for chunk loop: **10 s** (10× typical response time). Default transport timeout (120 s) results in a ~2-minute stall per event at end-of-stream. | +| 2026-04-06 | §7.8.3 | **KNOWN ISSUE — `_decode_a5_waveform` hardcoded fi==9 skip.** The decoder contains `elif fi == 9: continue` which was written for the 9-frame original blast capture where frame 9 was a device terminator. For streams with >9 frames (current device produces 35+), frame index 9 is live waveform data — this skip discards ~1,070 bytes (~133 sample-sets) per event. The terminator is now detected via `page_key == 0x0000`, not by frame index. The fi==9 skip should be removed. | +| 2026-04-06 | §7.8 | **⚠ PARTIALLY INVALIDATED — ADC count-to-physical-unit conversion.** Raw waveform samples are signed 16-bit integers (counts). Conversion formula `value = counts × (range / 32767)` is believed correct, but the `range` value was UNKNOWN at time of writing. **UPDATED 2026-04-17:** `max_range_geo` = 6.206053 is confirmed as the ADC-to-velocity scale factor (inverse sensitivity, (in/s)/V). The correct conversion is therefore: `PPV (in/s) = counts × (1.61133 / 32767) × 6.206053` = `counts × 4.982e-5` in/s per count. The earlier ~9× overread from using 6.206053 directly as the range was because the range IS 1.61133 × 6.206053 = 10.000 in/s, not 6.206053. See §7.6.2 for the confirmed field layout. | +| 2026-04-08 | §5.1, §7.10, §12 | **NEW — Monitoring commands confirmed.** SUB 0x1C (monitor status), 0x96 (start monitoring), 0x97 (stop monitoring) all confirmed from 4-8-26/2ndtry capture. SESSION_RESET (`41 03`) required before POLL to wake a monitoring unit. | +| 2026-04-09 | §7.10 | **CORRECTED — monitoring flag and battery/memory offsets.** `section[1] == 0x10` is the monitoring flag (100% accurate across 144 data frames in 2ndtry capture). Previous note claiming `section[6]` was wrong — section[6] has device-specific non-binary values (0xea/0x07). Battery/memory offsets corrected: `section[-10:-8]` (battery×100), `section[-8:-4]` (memory_total), `section[-4:]` (memory_free). NOTE: `frame.data` has checksum stripped by parser — earlier offsets of `[-11:-9]`/`[-9:-5]`/`[-5:-1]` were wrong because they assumed a trailing checksum byte that isn't there. | +| 2026-04-08 | §7.10 | **NEW — SUBs 0x0E (channel sensor data) and 0x98 (trigger test) observed** in 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). SUB 0x0E: 2-step read with channel selector in `params[6:8]`, data length 0x0A per channel, RSP SUB = 0xF1. SUB 0x98: single probe frame with `params[0] = 0xFF`, RSP SUB = 0x67; sent twice per test cycle. Not yet implemented in SFM. | +| 2026-04-08 | §7.10 | **NEW — SUBs 0x15 and 0x01 observed in sensor-check capture.** SUB 0x15 (serial number short form, data length 0x0A, RSP 0xEA) and SUB 0x01 (device info block, data length 0x98 = 152 bytes, RSP 0xFE) seen in Blastware's "Unit Channel Test" init sequence. Note: SUB 0x01 response SUB 0xFE collides with the existing SUB 0xFE → RSP 0x01 naming convention — they are inverse commands. | +| 2026-04-08 | §12 | **CONFIRMED — Unit partially reachable during on-device sensor check.** 4-8-26/sensor-check capture shows: POLL responds normally throughout; SUB 0x0E channel reads partially served (channels 0–4 responded), then ~40s silent gap while sensor check ran, then channels 5–7 responded. On-device sensor check duration ≈ 40 s. SFM `_pollMonitorConfirm()` polls status every 5 s for up to 60 s after start_monitoring. | +| 2026-04-08 | §7.9 (NEW) | **NEW — Compliance config field inventory captured from Blastware UI.** See §7.9 for full field list (Recording Setup, Notes, Special Setups tabs). Most fields NOT yet mapped to raw byte offsets. Confirmed decoded: sample_rate, record_time, trigger_level_geo, alarm_level_geo, max_range_geo, backlight_on_time, power_saving_timeout, monitoring_lcd_cycle, project/client/operator/sensor_location/notes. Sensor Check dropdown (Before monitoring / After each event / Disabled) NOT YET LOCATED in raw config bytes. | +| 2026-04-11 | §5.1, §5.2 | **NEW — Erase-all command sequence confirmed from MITM capture.** SUB 0xA3 (begin erase, token=0xFE → ack 0x5C) + SUB 0xA2 (confirm erase, token=0xFE → ack 0x5D). Standard `build_bw_frame` format (not write-format). Required intermediate steps: 0x1C probe+data (monitor status read) + 0x06 probe+data (event storage range). All response SUBs follow the standard 0xFF−SUB formula with no exceptions. | +| 2026-04-11 | §5.1 | **CONFIRMED — SUB 0x06 (CHANNEL CONFIG READ) now confirmed as event storage range.** Two-step read, data offset = 0x24 (36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (bytes −8:−4) and last stored event key (bytes −4:). Both equal `01110000` when device memory is empty. Used by Blastware to verify erase completion. | +| 2026-04-11 | §7.11 (NEW) | **NEW — §7.11 Erase-All Protocol added.** Full wire sequence, SUB 0x06 storage range payload layout, post-erase key counter reset (resets to `0x01110000`). Confirmed from 4-11-26 MITM capture of live Blastware ACH session. | +| 2026-04-11 | §14.6 | **RESOLVED — ACH Session Lifecycle is no longer "Future".** `bridges/ach_server.py` fully implements inbound ACH: POLL handshake, device info, event download. State tracked via `ach_state.json` (key-based, with `max_downloaded_key` for post-erase detection). `--clear-after-download` flag added for the standard delete-after-upload workflow. | +| 2026-04-17 | §7.6.2, §14 | **RESOLVED — Float 6.206053 at channel_label+28 is the ADC-to-velocity scale factor.** Confirmed from Series III Interface Handbook §4.5 formula: `Range (×1) = 1.61133 V / Sensitivity (V/unit)`. For the standard Instantel geophone at Normal range (10.000 in/s): Sensitivity = 1.61133 / 10 = 0.161133 V/(in/s). The stored value is the **inverse sensitivity** = 1/0.161133 = **6.206053 (in/s)/V**. Cross-check: 1.61133 V × 6.206053 = 10.000 in/s ✅. The firmware uses it as: `PPV (in/s) = ADC_voltage (V) × 6.206053`. Value is identical on all Instantel standard geophones — it is a hardware/firmware constant, NOT a user-configurable setting. Do NOT write this field. Open question §14 item "Max Geo Range float 6.2061" is now **RESOLVED**. | +| 2026-04-20 | §7.6.4 (NEW), §7.9, Appendix B | **CONFIRMED — Recording Mode byte location.** Three targeted captures (4-20-26) confirmed `recording_mode` at anchor−8 in both the E5 read payload and the BW write payload (6-byte anchor `\xbe\x80\x00\x00\x00\x00`). BW write payload and E5 read payload are **byte-identical** around the anchor region — Blastware round-trips the wire-encoded E5 bytes verbatim with only the target field modified. Anchor position varies by ±1 depending on whether recording_mode = 0x03 (Histogram), because E5 wire-encodes `0x03` as the inner DLE+ETX pair `\x10\x03` (2 bytes), which S3FrameParser preserves as two literal bytes in `compliance_raw`. Enum: `0x00`=Single Shot, `0x01`=Continuous, `0x03`=Histogram, `0x04`=Histogram+Continuous. `0x02` value not yet observed. The byte at anchor−9 is `0x00` for Single Shot / Continuous, and `0x10` for Histogram (DLE prefix from E5 encoding) and Histogram+Continuous (actual config byte). See §7.6.4 for full details. | +| 2026-04-21 | Appendix D (NEW) | **NEW — Blastware .N00 and .MLG file formats fully decoded.** `minimateplus/blastware_file.py` implements `write_n00()` and `write_mlg()`. N00 file format confirmed: 22B header + 21B STRT record + variable body + 26B footer. Body reconstructed from A5 bulk waveform stream frames with per-frame skip amounts (probe=7+strt_pos+21, A5[1]=13, A5[2+]=12, terminator=11) and DLE strip rule (strip `0x10` before `{0x02,0x03,0x04}`, keep following byte). Footer extracted verbatim from terminator frame's last 26 bytes. Split-pair edge case: when `frame.data[-1]==0x10` and `chk_byte∈{0x02,0x03,0x04}`, reunite both bytes before stripping and always remove trailing chk_byte (`stripped[:-1]`) — chk_byte is checksum, not payload. STRT record must be copied verbatim from A5[0]; bytes [10:20] are device-specific and cannot be reconstructed from Event fields. `write_n00` verified byte-perfect against `M529LIY6.N00` from 4-3-26-multi_event capture. MLG format: 308B header + N×292B records; CRC algorithm unknown (write as 0x0000). | +| 2026-04-21 | Appendix D §D.5 (NEW) | **NEW — Blastware filename encoding fully decoded.** Serial prefix: `chr(ord('B') + floor(serial/1000))` + last 3 digits zero-padded. Stem: 4-char base-36 of `floor(total_seconds/1296)`. Extension: `AB0` for manual/direct downloads (3 chars), `AB0W` or `AB0H` for ACH/call-home downloads (4 chars), where `AB` = 2-char base-36 of `total_seconds % 1296` and W/H = waveform/histogram. Epoch = 1985-01-01 00:00:00 device local time. Confirmed against 3,248 files from 10-year production archive with zero errors. 3-day cycle property: same daily recording time cycles through 3 extensions (864s/day shift, period=3 days). `blastware_filename(event, serial, ach=False)` implements full formula. | +| 2026-04-21 | §7.6.2, §5.3 | **CORRECTED — compliance_raw contains wire-encoded bytes, NOT logical bytes.** S3FrameParser appends DLE+ETX inner-frame pairs as two literal bytes to the frame body. Any `0x03` values in the compliance config appear in `compliance_raw` as `\x10\x03` (two bytes), not as a single `0x03`. The previous claim "S3FrameParser handles this transparently so compliance_raw contains logical (destuffed) bytes" was wrong. Consequence: `compliance_raw` is the wire-encoded E5 payload; anchor-relative reads work correctly because the anchor position automatically accounts for any DLE-encoded bytes before it. For write-back, round-tripping `compliance_raw` verbatim sends the correct wire bytes to the device. **DLE ETX escaping in write frames:** Blastware escapes `0x03` bytes in write frame data as `\x10\x03` on wire; our `build_bw_write_frame` does not (writes data raw). Device is confirmed to accept raw writes for all tested modes — likely uses the offset/length field for write frame framing, not ETX scanning. | +| 2026-04-20 | §7.6.2, §7.9, Appendix B | **CONFIRMED — Geophone maximum range / sensitivity selector byte location.** Two targeted captures (4-20-26, geo sensitivity folder): one at Normal 10.000 in/s, one at Sensitive 1.250 in/s. E5 read payload diff: exactly 3 bytes differ at channel_label+33 for Tran/Vert/Long. Values: `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Same offset applies to the SUB 71 write payload (which is the same 2126-byte E5-format buffer round-tripped verbatim). **`channel_label+20` reads `0x01` in ALL captures regardless of range setting — it is NOT this field.** Previous hypothesis (uint8 at Tran+20, 0x01=Normal) was WRONG. Stored as `geo_range` in `ComplianceConfig`. Encoded to all three geo channel blocks (Tran/Vert/Long) at label+33. | +| 2026-04-20 | §5.1, §5.3, §7.12 (NEW) | **NEW — Auto Call Home config protocol confirmed from 4-20-26 call home settings captures.** SUB 0x2C (Call Home Config READ, response 0xD3, data offset 0x7C=124) and SUB 0x7E/0x7F (WRITE + CONFIRM, response 0x81/0x80) confirmed. Write payload = read payload (125 bytes) + `\x00\x00` (127 bytes total). **DLE-escaped ETX at raw[117:119]:** the device returns logical value 0x03 (num_retries=3) as `\x10\x03` on the wire — S3FrameParser preserves both bytes as two literals, causing a +1 byte shift for all subsequent fields. Write frame sends these bytes verbatim (device interprets `\x10\x03` as literal value 3). Field map confirmed from 10-frame BW TX diff. See §7.12 for full layout. | +| 2026-05-01 | §7.8.2, §7.8.5 (NEW), §7.8.6 (NEW), §7.8.7 (NEW) | **REWRITTEN — SUB 5A bulk waveform stream protocol.** Five BW MITM captures (4-27-26 "open 2sec waveform" + "copy event to disk", 5-1-26 BW 3-sec + 2nd-event + Download All) prove that the previous chunk-counter formula `max(key4[2:4], 0x0400) + (chunk_num-1) * 0x0400` over-reads 5× past the actual event end. BW reads ~12-16 chunks per event at **0x0200 increments (NOT 0x0400)**, bounded by `end_offset` extracted from the STRT record at `data[23:27]` of the first A5 response. **TERM frame formula corrected:** `offset_word = end_offset - next_boundary`, `params[2:4] = next_boundary BE` where `next_boundary = last_chunk_counter + 0x0200`. Verified across 3 events (offsets 0x1ABE, 0x21F2, 0x417E). **Metadata pages 0x1002 / 0x1004** are global, fixed-address device pages containing Project/Client/User Name/Seis Loc/Extended Notes — read ONCE per Blastware session (not per event). **Event-1 vs event-N split:** events at start_key[2:4]=0 use probe@0x0000 + metadata pages + sample chunks at 0x0600 onward; continuation events skip metadata and start at start_key+0x0046. **WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundary markers** — the "Download All" pattern walks 1E/0A/1F to map all event keys+lengths upfront, then downloads each `0x46`-keyed event in turn. Old `stop_after_metadata=True` knob is a workaround for the missing end_offset bound and becomes obsolete under the new walk. See new §7.8.5 / §7.8.6 / §7.8.7 for full details. | +| 2026-05-04 | §7.8.5, §7.8.8 | **CORRECTED — Event-N probe counter is just `start_offset`, NOT `start_offset + 0x0046`.** The `+0x46` formula in the original §7.8.5 was based on calling the off=0x2C boundary key the "start_key", but in the iteration walk `cur_key` passed into `read_bulk_waveform_stream` is always the off=0x46 WAVEHDR record key from 1F (the partial-record skip path in `get_events` re-runs 1F to advance past 0x2C boundary records). Adding +0x46 placed the probe one WAVEHDR past the actual event start; the response no longer contained STRT at byte 17, `parse_strt_end_offset` returned None, and the chunk loop fell back to the `max_chunks=128` cap, walking ~110 chunks of post-event circular-buffer garbage. Confirmed against both the 5-1-26 "copy 2nd address" capture (probe at counter=0x2238 with key=01112238) and the 5-4-26 BW 2-sec event capture. Fixed in protocol.py `read_bulk_waveform_stream` v0.14.1. | +| 2026-05-05 | §7.8.1 (rule #3 added) | **CONFIRMED — Partial DLE stuffing of `0x10` bytes in 5A params region.** The device's de-stuffing rule for the SUB 5A params region is: `10 10` → `10`, `10 02/03/04` → kept literal (inner-frame markers), `10 X` for any other X → de-stuffs to just `X` (drops the `0x10`). Therefore any `0x10` byte in the logical params followed by a byte NOT in {0x02, 0x03, 0x04, 0x10} MUST be doubled on the wire. This affects counters with `0x10` in the high byte — most importantly counter=`0x1000`, where logical params bytes `... 10 00 ...` were being sent raw and the device de-stuffed `10 00` to just `00`, returning the response for counter=0x0000 (= the file header + STRT). That STRT block then ended up embedded in the assembled file body at file offset `0x1016` and Blastware refused to open the file. This was the root cause of the long-standing ">1-sec event 0 won't open in BW" pattern (1-sec events worked because their `end_offset < 0x1000`, so no chunk request ever needed counter `0x10__`). All 17 5A request frames in the 5-1-26 bwcap3sec capture (probe + 2 meta + 13 samples + TERM) now match BW byte-for-byte after the fix. Fixed in framing.py `build_5a_frame` v0.14.3. | +| 2026-05-05 | §7.8 / Blastware file format | **CONFIRMED — File body assembly is contiguous concatenation, no de-duplication.** The "duplicate header+STRT strip" hack from v0.13.x was actively destroying valid waveform data — sample chunks at counter `0x1000` and beyond often coincidentally contain the byte sequence `00 12 03 00 STRT` in their delta-encoded ADC stream, and the strip was zeroing 25 bytes per match. Removed in v0.14.2. The correct file body is: probe contribution + meta@0x1002 + meta@0x1004 + sample contributions in stream order + TERM contribution. Verified byte-perfect against BW reference `M529LKIQ.G10` (8708 bytes, 0 differences) when fed the same A5 frames as the BW capture. | + +--- + +## 1. Physical Layer + +| Parameter | Value | Certainty | +|---|---|---| +| Interface | RS-232 serial | ✅ CONFIRMED | +| Baud rate | 38400 | ✅ CONFIRMED (from bridge log header) | +| Data bits | 8 | ✅ CONFIRMED (standard for this baud/era) | +| Parity | None | 🔶 INFERRED (no parity errors observed) | +| Stop bits | 1 | 🔶 INFERRED (standard assumption) | +| Flow control | None (no RTS/CTS activity) | 🔶 INFERRED | + +--- + +## 2. Frame Structure +> ⚠️ **2026-02-26 — CORRECTED:** Previous version incorrectly identified `0x41` as STX and `0x02`/`0x03` as bare frame delimiters. The protocol uses proper **DLE framing**. See below. + +Frame structure is asymmetric — BW→S3 (requests we send) and S3→BW (device replies) +use slightly different framing markers, both terminated by a **bare** `0x03` ETX: + +``` +BW→S3 (our requests): [ACK=0x41] [STX=0x02] [stuffed payload + chk] [ETX=0x03] +S3→BW (device replies): [DLE=0x10] [STX=0x02] [stuffed payload + chk] [ETX=0x03] +``` + +**Critical:** The outer frame terminator is a **bare ETX (`0x03`), not `DLE+ETX`.** S3 +responses contain inner sub-frames (notably inside SUB A4 POLL_RESPONSE and SUB E5 +compliance reads) that use `DLE+ETX` (`0x10 0x03`) as *inner-frame* terminators — the +outer parser preserves both bytes as literal payload data when it sees `DLE+ETX` and +only ends the frame on a bare ETX. See §10 (parser state machine) and the +`S3FrameParser` docstring in `minimateplus/framing.py`. + +### Special Byte Definitions + +| Token | Raw Bytes | Meaning | Certainty | +|---|---|---|---| +| ACK | `0x41` (ASCII `'A'`) | Acknowledgment / ready token. Standalone single byte; often precedes frames. | ✅ CONFIRMED | +| DLE | `0x10` | Data Link Escape. Prefixes the next byte to give it special meaning. | ✅ CONFIRMED — 2026-02-26 | +| STX (BW→S3) | `0x02` (bare) | BW-side start marker — preceded by ACK, not by DLE | ✅ CONFIRMED | +| STX (S3→BW) | `0x10 0x02` | DLE+STX device-side start-of-frame | ✅ CONFIRMED | +| ETX | `0x03` (bare) | End-of-frame terminator in BOTH directions; `DLE+ETX` inside a frame body is an inner sub-frame terminator preserved as literal payload | ✅ CONFIRMED | +| CHECKSUM | 1 byte | Sits between payload and the bare ETX. Two variants — see §11 (standard SUM8 for reads, DLE-aware large-frame for writes / SUB 5A). | ✅ CONFIRMED | + +### DLE Byte Stuffing Rule +> ✅ CONFIRMED — 2026-02-26 + +Any `0x10` byte appearing **naturally in the payload data** is escaped by doubling it: `0x10` → `0x10 0x10`. This prevents the parser from confusing real data with frame control sequences. + +- **Transmit:** Replace every `0x10` in payload with `0x10 0x10` +- **Receive:** Replace every `0x10 0x10` in the frame body with a single `0x10` + +| Sequence on wire | Meaning | +|---|---| +| `0x10 0x02` | Frame START — only valid at beginning | +| `0x10 0x03` | Frame END | +| `0x10 0x10` | Escaped literal `0x10` byte in payload data | +| Any other `0x10 0xXX` | Protocol error / undefined | + +### Frame Parser Notes + +- The `0x41` ACK **may arrive in a separate `read()` call** before the frame body due to RS-232 inter-byte timing or TCP segmentation. The S3 parser treats stray ACK bytes as no-ops while idle. +- Your parser must be **stateful and buffered** — read byte by byte, accumulate after STX, terminate on a bare ETX. Never assume one `read()` = one frame. +- `DLE+ETX` inside a frame body is treated as inner-frame data and appended literally; only a bare ETX ends the outer frame. +- Checksum is computed on the **de-stuffed** payload for standard reads. SUB 5A and write frames use a DLE-aware variant (see §11). +- ACK and the STX bytes are **not** included in the checksum. + +### Checksum Verification Example + +Raw S3→BW POLL probe response wire bytes: +``` +10 02 | 10 00 A4 00 00 00 ... [stuffed payload + chk] ... | 03 +^STX^ ^ETX^ +``` + +After de-stuffing (`0x10 0x10` → `0x10`), the payload is checksum-validated using +the formula from §11. The bare ETX terminates the frame. + +--- + +## 3. Payload Structure + +> ✅ **CONFIRMED 2026-03-30** — field positions verified bit-for-bit against +> `bridges/captures/3-11-26/raw_bw_*.bin`. The earlier "[CMD][DLE][ADDR]…" layout +> that called bytes [1] and [2] both `0x10` was wrong — byte [1] is `flags` +> (`0x00` for BW requests, `0x10` for S3 responses) and byte [2] is the SUB byte. + +The payload (between STX and the checksum, after de-stuffing) is a 16-byte fixed +header for read commands. BW→S3 and S3→BW use the **same field layout** but +swap the values in bytes [0] and [1]: + +``` +BW→S3 (request): S3→BW (response): + [0] BW_CMD 0x10 [0] CMD 0x00 + [1] flags 0x00 [1] flags 0x10 + [2] SUB command [2] SUB 0xFF − request_SUB + [3] 0x00 always [3] PAGE_HI (probe responses: 0x00) + [4] 0x00 always [4] PAGE_LO (probe responses: 0x00) + [5] OFFSET probe:0x00; data:DATA_LENGTH + [5+] data response body + [6:16] params 10-byte field +``` + +| Field | Position | Notes | Certainty | +|---|---|---|---| +| BW_CMD / CMD | byte 0 | `0x10` in BW→S3 requests; `0x00` in S3→BW responses. The `0x10` is the only byte DLE-stuffed in write frames. | ✅ CONFIRMED | +| flags | byte 1 | `0x00` in BW→S3; `0x10` in S3→BW. The byte pattern that earlier docs read as "ADDR" was actually flags. | ✅ CONFIRMED — 2026-03-30 | +| SUB | byte 2 | Command/response selector. Response SUB = `0xFF − request SUB`. | ✅ CONFIRMED | +| OFFSET (requests) | byte 5 | `0x00` for the probe step; `DATA_LENGTH` (hardcoded constant — see §4.2 and §5.1) for the data fetch step. Bytes [3] and [4] are always `0x00` in requests. | ✅ CONFIRMED — 2026-03-30 | +| PAGE_HI / PAGE_LO (responses) | bytes 3–4 | Observed as `0x00 0x00` in probe responses. For chunked data reads (SUB E5, SUB A5) carries the page key / chunk address. | ✅ CONFIRMED | +| params (requests) | bytes 6–15 | 10-byte parameter field; per-SUB structure (event keys, tokens, channel selectors, chunk addresses). | ✅ CONFIRMED | +| data (responses) | bytes 5+ | Response body. For two-step data fetches the actual record begins at `data[11]` after a fixed 11-byte echo header — see §7.7.4. | ✅ CONFIRMED | + +> The only `0x10` byte in a BW request payload is `BW_CMD` at `[0]`. Other `0x10` +> bytes may appear in the `OFFSET` field (e.g. offset_hi=0x10 for compliance writes) +> or in `params` (notably SUB 5A chunk counters). DLE-stuffing of these `0x10` bytes +> on the wire varies by command — see §5.3 (write frames) and §7.8.1 (SUB 5A). + +--- + +## 4. Communication Pattern + +### 4.1 ACK Handshake (Every Transaction) + +``` +Side A → 0x41 (ACK: "ready / received") +Side A → 10 02 [payload] [chk] 10 03 (frame) +Side B → 0x41 (ACK) +Side B → 10 02 [payload] [chk] 10 03 (response frame) +``` + +### 4.2 Two-Step Paged Read Pattern + +> ✅ **CORRECTED 2026-03-30** — earlier description claimed the probe response carries +> the data length in `PAGE_HI`/`PAGE_LO`. It does NOT. The S3 probe response has both +> bytes `0x00`. **Data lengths are hardcoded constants per SUB** — see the `DATA_LENGTHS` +> dict in `minimateplus/protocol.py` and the per-SUB column in §5.1. + +All data reads use a two-step pattern. It is not optional — sending the data +fetch without the probe causes the device to ignore the request. + +``` +Step 1 — Probe (BW: offset=0 in payload[5]): + BW → 41 02 10 10 00 [SUB] 00 00 00 00 [params×10] [chk] 03 + S3 → 10 02 00 10 [RSP] 00 00 [zeroed body] [chk] 03 + (probe ack — PAGE_HI=PAGE_LO=0x00, no length info) + +Step 2 — Data fetch (BW: offset=DATA_LENGTH in payload[5]): + BW → 41 02 10 10 00 [SUB] 00 00 [DATA_LENGTH] [params×10] [chk] 03 + S3 → 10 02 00 10 [RSP] 00 00 [DATA…] [chk] 03 +``` + +Implementations must use the per-SUB `DATA_LENGTH` constant (see §5.1) — there is +no length negotiation step. The two-step nature serves an arming purpose on the +device side, not length discovery. + +--- + +## 5. Command Reference Table + +### 5.1 Request Commands (Blastware → S3) + +| SUB Byte | Name | Description | Certainty | +|---|---|---|---| +| `5B` | **POLL / KEEPALIVE** | Sent continuously (~every 80ms). Requests device identity/status. | ✅ CONFIRMED | +| `15` | **SERIAL NUMBER REQUEST** | Requests device serial number. | ✅ CONFIRMED | +| `01` | **FULL CONFIG READ** | Requests complete device configuration block (~0x98 bytes). Firmware, model, serial, channel config, scaling factors. | ✅ CONFIRMED | +| `08` | **EVENT INDEX READ** | Requests the event record index (0x58 bytes). Event count and record pointers. | ✅ CONFIRMED | +| `06` | **EVENT STORAGE RANGE READ** | Requests event storage range block (0x24 = 36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (`[-8:-4]`) and last stored event key (`[-4:]`). Both equal `01110000` when device is empty. Used by Blastware as part of the erase-all verification step. Previously labelled "CHANNEL CONFIG READ" — function now confirmed from 4-11-26 MITM capture. | ✅ CONFIRMED 2026-04-11 | +| `1E` | **EVENT HEADER READ** | Gets first waveform key. Token byte at params[7] (0x00=browse, 0xFE=download-arm). Key at data[11:15]; trailing offset at data[15:19] (0 = only one event). Two uses: (1) all-zero to get key0; (2) token=0xFE after 0A, before 0C — REQUIRED to arm device for SUB 5A. | ✅ CONFIRMED 2026-04-06 | +| `0A` | **WAVEFORM HEADER READ** | Checks record type for a given waveform key. Variable DATA_LENGTH at `data_rsp.data[5]`: **`0x46` (= 70 bytes) = real triggered event start**; **`0x2C` (= 44 bytes) = boundary marker / monitor-log partial record**. Key at params[4..7]. Required before every 1F call to establish device waveform context. Used by the "Download All" walk (§7.8.8) to map real events vs boundary keys. | ✅ CONFIRMED 2026-05-01 | +| `0C` | **FULL WAVEFORM RECORD** | Downloads 210-byte waveform/histogram record. Sub_code at byte[1]: 0x10=Waveform (9-byte timestamp hdr), 0x03=Waveform-continuous (10-byte hdr, 1-byte shift). PPV floats at label+6 (search "Tran"/"Vert"/"Long"/"MicL"). Peak Vector Sum at tran_label−12 (NOT fixed offset). Key at params[4..7], DATA_LENGTH=0xD2. | ✅ CONFIRMED 2026-04-03 | +| `1F` | **EVENT ADVANCE** | Advances to next waveform key. Token byte at params[7] (⚠️ NOT params[6]): 0x00=browse (all-zero params), 0xFE=download (arm 5A state machine). Returns next key at data[11:15]; null sentinel when data[15:19]=0x00000000. Requires preceding 0A to establish context. Browse 1F must ONLY be called after successful 5A — calling it after a failed 5A disrupts device state for the next event's 5A probe. | ✅ CONFIRMED 2026-04-06 | +| `5A` | **BULK WAVEFORM STREAM** | Bulk download of raw ADC sample data. Non-standard frame format: offset_hi=0x10 sent raw (not DLE-stuffed), DLE-aware checksum, **partial DLE stuffing of 0x10 in params** (`10 X` where X∉{02,03,04,10} must be doubled to `10 10 X` — see §7.8). Requires 1E-arm + 0C + 1F(0xFE) + POLL×3 before first probe. Walk: probe at counter=`start_offset` (event 1: 0x0000) → metadata pages 0x1002 + 0x1004 (event 1 only) → sample chunks at 0x0600, 0x0800, …, step 0x0200, bounded by `end_offset` parsed from STRT@data[17] of probe response → TERM frame at residual offset_word. Project:/Client:/User Name:/Seis Loc: live in the metadata pages, NOT in the sample-chunk stream. | ✅ CONFIRMED 2026-05-05 (BYTE-PERFECT vs BW capture) | +| `24` | **WAVEFORM PAGE A?** | Paged waveform read, possibly channel group A. | 🔶 INFERRED | +| `25` | **WAVEFORM PAGE B?** | Paged waveform read, possibly channel group B. | 🔶 INFERRED | +| `09` | **UNKNOWN READ A** | Read command, response (`F6`) returns 0xCA (202) bytes. Purpose unknown. | 🔶 INFERRED | +| `1A` | **COMPLIANCE CONFIG READ** | Multi-step sequence (A+B+C+D frames). Response (E5) carries recording_mode (uint8 at **anchor − 8** — same offset in read AND write, confirmed 2026-04-21), sample_rate (uint16 BE at anchor − 6), histogram_interval_sec (uint16 BE at anchor − 4), record_time (float32 BE at anchor + 6), trigger/alarm/max_range floats, and project strings. **Anchor: 6-byte `\xbe\x80\x00\x00\x00\x00`**, search `cfg[0:150]`. Total ~2126 cfg bytes. See §7.6.4 for recording_mode enum. | ✅ CONFIRMED 2026-04-02; recording_mode offset corrected 2026-04-21 | +| `2E` | **UNKNOWN READ B** | Read command, response (`D1`) returns 0x1A (26) bytes. Purpose unknown. | 🔶 INFERRED | +| `0E` | **CHANNEL SENSOR DATA** | Real-time sensor reading for one channel. Two-step read, data length 0x0A (10 bytes). Channel selector in params[6:8] (0x0000–0x0007 for 8 channels). Response (F1) carries amplitude, frequency, overswing data for that channel. Used by Blastware "Unit Channel Test" comms check. | ✅ CONFIRMED 2026-04-08 | +| `98` | **TRIGGER TEST** | Trigger-test command. Single probe frame; `params[0] = 0xFF`. Response (0x67) is all-zero data. Sent twice per Blastware comms-check cycle. Not a full POLL, no monitor state change. | ✅ CONFIRMED 2026-04-08 | +| `1C` | **MONITOR STATUS READ** | Two-step read, data offset 0x2C (44 bytes). `section[1] == 0x10` → monitoring; `0x00` → idle (CONFIRMED 2026-04-09, 100% accuracy on 144 frames). Payload length: 46–47 bytes IDLE, 48–49 bytes MONITORING. `frame.data` has checksum stripped — no trailing byte to skip. Battery/memory at end: `section[-10:-8]` = battery×100 (uint16 BE), `section[-8:-4]` = memory_total (uint32 BE), `section[-4:]` = memory_free (uint32 BE). | ✅ CONFIRMED 2026-04-09 | +| `96` | **START MONITORING** | Single write frame, no data payload. Transitions unit from idle to monitoring mode (after optional on-device sensor check ~40 s). | ✅ CONFIRMED 2026-04-08 | +| `97` | **STOP MONITORING** | Single write frame, no data payload. Stops monitoring, unit returns to idle. | ✅ CONFIRMED 2026-04-08 | +| `2C` | **CALL HOME CONFIG READ** | Two-step read, data offset 0x7C (124 bytes + 1-byte DLE artefact = 125 raw bytes). Returns Auto Call Home configuration: enable flag, dial string, scheduled call times, retry settings, modem timing. Response SUB = 0xD3. **DLE note:** logical value 0x03 (num_retries) is returned as `\x10\x03` on the wire, which S3FrameParser preserves as two literal bytes — this shifts all subsequent field positions by +1. See §7.12 for full field map. | ✅ CONFIRMED 2026-04-20 | +| `A3` | **ERASE ALL BEGIN** | Single frame, token=0xFE at params[7]. Initiates device memory erase. Must be followed by 0x1C probe+data + 0x06 probe+data + 0xA2 to complete. Standard `build_bw_frame` (not write-format). Response ack SUB = 0x5C. | ✅ CONFIRMED 2026-04-11 | +| `A2` | **ERASE ALL CONFIRM** | Single frame, token=0xFE at params[7]. Commits the erase initiated by 0xA3. After this ack (SUB 0x5D), device memory is cleared and the event counter resets to `0x01110000`. | ✅ CONFIRMED 2026-04-11 | + +All requests use CMD byte `0x02`. All responses use CMD byte `0x10 0x02` (which, after de-stuffing, is just the DLE+CMD combination — see §3). + +### 5.2 Response SUB Bytes (S3 → Blastware) + +> 🔶 **INFERRED pattern:** Response SUB = `0xFF - Request SUB`. Verified on all observed pairs to date — no counterexample has been observed across read commands, write commands, or either unit. Confidence is high but not formally proven across the full command space. + +| Request SUB | Response SUB | Certainty | +|---|---|---| +| `5B` | `A4` | ✅ CONFIRMED | +| `15` | `EA` | ✅ CONFIRMED | +| `01` | `FE` | ✅ CONFIRMED | +| `08` | `F7` | ✅ CONFIRMED | +| `06` | `F9` | ✅ CONFIRMED 2026-04-11 | +| `1C` | `E3` | ✅ CONFIRMED 2026-04-08 | +| `1E` | `E1` | ✅ CONFIRMED | +| `0A` | `F5` | ✅ CONFIRMED | +| `0C` | `F3` | ✅ CONFIRMED | +| `5A` | `A5` | ✅ CONFIRMED | +| `1F` | `E0` | ✅ CONFIRMED 2026-03-31 | +| `09` | `F6` | ✅ CONFIRMED | +| `1A` | `E5` | ✅ CONFIRMED | +| `2E` | `D1` | ✅ CONFIRMED | +| `0E` | `F1` | ✅ CONFIRMED 2026-04-08 | +| `98` | `67` | ✅ CONFIRMED 2026-04-08 | +| `96` | `69` | ✅ CONFIRMED 2026-04-08 | +| `97` | `68` | ✅ CONFIRMED 2026-04-08 | +| `2C` | `D3` | ✅ CONFIRMED 2026-04-20 | +| `A3` | `5C` | ✅ CONFIRMED 2026-04-11 | +| `A2` | `5D` | ✅ CONFIRMED 2026-04-11 | + +--- + +### 5.3 Write Commands (Blastware → Device) + +> ✅ **CONFIRMED — 2026-02-26** from compliance setup capture (session `185019`); +> framing mechanics confirmed 2026-04-07 from `bridges/captures/3-11-26/raw_bw_*_170151.bin`. + +Write commands are initiated by Blastware (`BW→S3`) and use SUB bytes in the `0x60`–`0x83` range. The device acknowledges each write with a short response frame containing no data payload (17 bytes total wire including framing). + +**Pattern:** Write SUB = Read SUB + `0x60` (e.g. `0x08` EVENT INDEX READ → `0x68` EVENT INDEX WRITE). + +#### Write frame format — minimal DLE stuffing + +Write frames do **NOT** use the full DLE stuffing that read frames do. Only the +`BW_CMD` byte at payload position `[0]` is doubled on the wire — all other bytes +(flags, SUB, offset, params, data, checksum) are written **raw**, even when they +contain `0x10`. See `build_bw_write_frame()` in `minimateplus/framing.py`. + +``` +Wire layout: + [41] ACK + [02] STX + [10 10] BW_CMD doubled (the ONLY DLE stuffing applied) + [00] flags + [SUB] write command byte (0x68–0x83) + [00] always zero + [hi][lo] offset uint16 BE — RAW (not stuffed even if hi=0x10) + [params] 10 bytes — RAW + [data] variable-length write payload — RAW (0x10 bytes not stuffed) + [chk] checksum — RAW (not stuffed even if 0x10) + [03] ETX +``` + +Total wire length = `21 + len(data)` bytes. + +#### Write frame checksum + +All write frames use the **large-frame DLE-aware checksum**: + +```python +chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) & 0xFF +``` + +This sums payload bytes from `SUB` onward, skipping every `0x10` byte, then adds +`0x10` as a constant. The same formula is used for confirm frames (data=`b""`), +since they contain no embedded `0x10` bytes and degrade to the standard SUM8. + +#### Single-chunk write offset formula + +For write payloads that fit in one frame (SUBs `0x68`, `0x69`, `0x82`, `0x7E`): + +``` +offset = data[1] + 2 +``` + +`data[0:2]` is a 2-byte header `[0x00][length]`. The offset on the wire encodes +that embedded length + 2. Confirmed across all single-chunk writes in the +3-11-26 capture (`0x68`: 0x5A, `0x82`: 0x1C, `0x69`: 0xCA, `0x7E`: 0x7E). + +#### Write ack response format + +Every device ack for a write command is a **17-byte zero-data S3 frame**: + +``` +[DLE=0x10] [STX=0x02] [stuffed header + chk] [bare ETX=0x03] +``` + +Data section is zeros; `RSP_SUB = 0xFF − write_request_SUB`. + +#### SUB 71 — multi-chunk compliance write + +The compliance config payload (~2128 bytes) is split into **exactly 3 chunks**. +Confirmed from 3-11-26 BW TX frames 104–108: + +| Chunk | Size | `offset` | `params` (10 bytes hex) | +|---|---|---|---| +| 1 (first) | 1027 bytes | `0x1004` | `00 00 00 00 00 00 00 00 00 00` | +| 2 (middle) | 1055 bytes | `0x1004` | `00 00 00 10 04 00 00 00 00 00` | +| 3 (last) | remainder | `0x002C` | `00 00 08 00 00 00 00 00 00 00` | + +After all three chunks are acked (`0x8E` each), send SUB `72` confirm → device acks `0x8D`. + +#### Full write sequences + +``` +Compliance setup push: 68 → 73 | 71 ×3 → 72 | 82 → 83 | 69 → 74 → 72 +Auto Call Home push: 7E → 7F +``` + +| SUB | Name | Description | Response SUB | Certainty | +|---|---|---|---|---| +| `68` | **EVENT INDEX WRITE** | Writes event index block (mirrors SUB `08` read). Contains event count and timestamps. | `97` | ✅ CONFIRMED | +| `69` | **WAVEFORM DATA WRITE** | Writes large waveform/channel data block (0xCA bytes, mirrors SUB `09`). | `96` | ✅ CONFIRMED | +| `71` | **COMPLIANCE / PROJECT STRINGS WRITE** | Writes compliance config and all project string fields. Contains setup name, project, client, operator, sensor location, and extended notes. Also contains channel scaling floats and `0x082A` threshold value. | `8E` | ✅ CONFIRMED | +| `72` | **WRITE CONFIRM A** | Short frame, no data. Likely commit/confirm step after `71`. | `8D` | ✅ CONFIRMED | +| `73` | **WRITE CONFIRM B** | Short frame, no data. | `8C` | ✅ CONFIRMED | +| `74` | **WRITE CONFIRM C** | Short frame, no data. | `8B` | ✅ CONFIRMED | +| `7E` | **CALL HOME CONFIG WRITE** | Writes Auto Call Home configuration (127 bytes: 125-byte read payload + `\x00\x00`). Offset = data[1]+2 = 0x7E. Write format (DLE-aware checksum, only BW_CMD `0x10` doubled on wire). Response SUB = 0x81. Must be followed by SUB 0x7F confirm. | `81` | ✅ CONFIRMED 2026-04-20 | +| `7F` | **CALL HOME WRITE CONFIRM** | Short frame, no data. Commits call home config write from SUB 0x7E. Response SUB = 0x80. | `80` | ✅ CONFIRMED 2026-04-20 | +| `82` | **TRIGGER CONFIG WRITE** | Writes trigger config block (0x1C bytes, mirrors SUB `1C` read). | `7D` | ✅ CONFIRMED | +| `83` | **TRIGGER WRITE CONFIRM** | Short frame, no data. Likely commit step after `82`. | `7C` | ✅ CONFIRMED | + +**Write response SUB pairs** follow the same `0xFF - request` rule: + +| Write SUB | Response SUB | +|---|---| +| `68` | `97` | +| `69` | `96` | +| `71` | `8E` | +| `72` | `8D` | +| `73` | `8C` | +| `74` | `8B` | +| `7E` | `81` | +| `7F` | `80` | +| `82` | `7D` | +| `83` | `7C` | + +--- + +## 6. Session Startup Sequence + +``` +1. Device powers on / resets +2. S3 → "Operating System" (raw ASCII, no DLE framing — UART boot string) +3. BW → 0x41 + POLL frame (SUB 5B) +4. S3 → 0x41 + POLL RESPONSE (SUB A4, reports data length = 0x30) +5. BW → 0x41 + POLL frame (SUB 5B, offset = 0x30) +6. S3 → 0x41 + POLL RESPONSE with data: "Instantel" + "MiniMate Plus" +7. BW → SUB 15 → serial number +8. BW → SUB 01 → full config block +9. BW → SUB 1A → compliance config (4-frame sequence: A+B+C+D) +10. BW → SUB 08 → event index +11. BW → SUB 06 → event storage range (used during erase verification; see §7.11) +``` + +### 6.1 Event Download Sequence (per-event, confirmed from 4-2-26 + 4-3-26 BW captures) + +``` +# Once per session: +BW → SUB 1E (all-zero params) → key0, trailing0 + +# Per event (repeat until null sentinel data[15:19]=0x00000000): +BW → SUB 0A (key) ← REQUIRED before every 1F; establishes device context +BW → SUB 1E (token=0xFE) ← REQUIRED arm step; must be BETWEEN 0A and 0C +BW → SUB 0C (key) ← read waveform record (peaks, timestamp, project) +BW → SUB 1F (token=0xFE) ← arm 5A state machine; do NOT use returned key +BW → SUB 5B × 3 ← REQUIRED: 3 full POLL probe+data cycles before 5A +BW → SUB 5A (key) ← bulk waveform stream (A5 frames) +# IF 5A succeeded: +BW → SUB 1F (all-zero) → next_key ← use this for loop iteration +# IF 5A failed/timed out: +# Do NOT send 1F(browse) — use cached key from 1F(token=0xFE) above instead +``` + +**Null sentinel:** `data[15:19] == b"\x00\x00\x00\x00"` in both 1E and 1F responses. +Do NOT use `data[11:15]` (key) as sentinel — event 0 has key=0x00000000. + +--- + +## 7. Known Data Payloads + +> 📑 **Navigation note (2026-05-20):** §7 grew organically and contains some +> duplicate section numbers — most notably **§7.5 / §7.5b** (waveform record), +> **§7.6 / §7.7 / §7.8 / §7.9** appear twice each. Sections that re-use a +> number are clearly banner-marked as either DEPRECATED (the old `0x0400`-step +> SUB 5A protocol) or as alternate-context views of the same SUB. **Always +> consult the most recent dated subsection when sections appear to conflict.** +> Canonical SUB 5A walk is in §7.8.5–§7.8.8; canonical compliance config layout +> is in §7.6 / §7.6.1 / §7.6.3 / §7.6.4. + +### 7.1 Poll Response (SUB A4) — Device Identity Block / Composite Container + +> ⚠️ **SUB A4 is a composite container frame.** The large A4 payload (~3600+ bytes) contains multiple embedded inner sub-frames using the same DLE framing as the outer protocol (`10 02` start, `10 03` end, `10 10` stuffing). Inner frames carry WRITE_CONFIRM_RESPONSE and TRIGGER_CONFIG_RESPONSE sub-frames among others. Flat byte-by-byte diffing of A4 is unreliable due to phase shifting — use inner-frame-aware diffing (`_diff_a4_payloads()` in s3_analyzer.py). Confirmed 2026-03-11. + +Two-step read. Data payload = 0x30 bytes. + +``` +Offset 0x00: 0x08 — string length prefix +Offset 0x01: "Instantel" — manufacturer (null-padded to ~20 bytes) +Offset 0x15: "MiniMate Plus" — model name (null-padded to ~20 bytes) +``` + +Raw payload (after de-stuffing): +``` +00 00 00 08 49 6E 73 74 61 6E 74 65 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 +4D 69 6E 69 4D 61 74 65 20 50 6C 75 73 00 00 00 00 00 00 00 00 00 +``` + +### 7.2 Serial Number Response (SUB EA) + +Data payload = 0x0A bytes: +``` +"BE18189\x00" — 7 ASCII bytes + null terminator (8 bytes) +79 11 — 2 trailing bytes +``` + +| Trailing Byte | Value (Unit 1) | Value (Unit 2) | Meaning | Certainty | +|---|---|---|---|---| +| `trail[0]` | `0x79` | `0x70` | Unit-specific — factory calibration ID or HW stamp? | ❓ SPECULATIVE | +| `trail[1]` | `0x11` | `0x11` | Firmware minor version — `0x11` = 17 = `S337.**17**` | ✅ CONFIRMED — 2026-02-26 | + +Two-unit comparison data: +``` +Unit 1: serial="BE18189" trail=79 11 firmware=S337.17 +Unit 2: serial="BE11529" trail=70 11 firmware=S337.17 +``` + +> ✅ **2026-02-26 — CORRECTED:** Previously documented as `79 11 20` (3 bytes). `0x20` is the **frame checksum**, not payload data. Actual data block is exactly 10 bytes (`0x0A`). + +> ✅ **2026-02-26 — CONFIRMED:** `trail[1]` = firmware minor version. Both units share firmware `S337.17` → minor = 17 = `0x11`. Will change if firmware differs between units. + +> ❓ **Still unknown:** `trail[0]` is unit-specific. Does not derive from serial string via sum, XOR, or modulo. Possibly written at factory calibration. Needs a third unit or write-command capture to determine. + +> ⚠ **2026-10-25 — AMENDED (measured, BE9441).** The 8-byte serial field is a **C string, not null-padded**. A six-character serial leaves a stray byte after its terminator: BE9441 sends `42 45 39 34 34 31 00 3f` = `"BE9441\x00?"`. Stripping trailing NULs alone keeps the `?`; cut at the first NUL. Every unit seen before had a seven-character serial, which fills the field exactly to the terminator. + +### 7.3 Full Config Response (SUB FE) — 0x98 bytes + +| Offset | Raw | Decoded | Certainty | +|---|---|---|---| +| 0x00 | `42 45 31 38 31 38 39 00` | `"BE18189\x00"` — Serial number | ✅ CONFIRMED | +| 0x08 | `79 11` | Unknown — possibly HW revision or calibration stamp | ❓ SPECULATIVE | +| 0x0A | `00 01` | Unknown flags | ❓ SPECULATIVE | +| 0x14 | `3F 80 00 00` | IEEE 754 float = **1.0** (Tran scale factor) | 🔶 INFERRED | +| 0x18 | `41 00 00 00` | IEEE 754 float = **8.0** (unknown — MicL range?) | 🔶 INFERRED | +| 0x1C | `3F 80 00 00` ×6 | IEEE 754 float = **1.0** ×6 (remaining channel scales) | 🔶 INFERRED | +| 0x34 | `53 33 33 37 2E 31 37 00` | `"S337.17\x00"` — Firmware version | ✅ CONFIRMED | +| 0x3C | `31 30 2E 37 32 00` | `"10.72\x00"` — DSP / secondary firmware version | ✅ CONFIRMED | +| 0x53 | varies | Likely calibration day or time field — 0x15 (BE18189), 0x1D (BE11529) | 🔶 INFERRED | +| 0x54 | `10` | Calibration month — BCD `0x10` = October (both units) | 🔶 INFERRED | +| 0x55 | varies | Calibration day — `0x02` (BE18189), `0x04` (BE11529) | 🔶 INFERRED | +| 0x56–0x57 | `07 E7` / `07 E9` | Calibration year — uint16 BE. `0x07E7`=2023, `0x07E9`=2025 | ✅ CONFIRMED — 2026-03-31 | +| 0x44 | `49 6E 73 74 61 6E 74 65 6C...` | `"Instantel"` — Manufacturer (repeated) | ✅ CONFIRMED | +| 0x6D | `4D 69 6E 69 4D 61 74 65 20 50 6C 75 73` | `"MiniMate Plus"` — Model name | ✅ CONFIRMED | + +### 7.4 Event Index Response (SUB F7) — 0x58 bytes + +> ✅ **2026-03-02 — CONFIRMED:** Backlight and power save offsets confirmed via two independent captures with device-set values. Offsets are from the start of the **data section** (after the 16-byte protocol header). + +**Layout (offsets relative to data section start):** + +``` +Offset +00: 00 58 09 — Total index size or record count ❓ +Offset +03: 00 00 00 01 — Possibly stored event count = 1 ❓ +Offset +07: 01 07 CB 00 06 1E — Timestamp of event 1 (see §8) +Offset +0D: 01 07 CB 00 14 00 — Timestamp of event 2 (see §8) +Offset +13: 00 00 00 17 3B — Unknown ❓ +Offset +4B: [backlight] — BACKLIGHT ON TIME ✅ CONFIRMED +Offset +4C: 00 — padding (backlight is uint8, not uint16) +Offset +53: [power_save] — POWER SAVING TIMEOUT ✅ CONFIRMED +Offset +54: [lcd_hi] [lcd_lo] — MONITORING LCD CYCLE (uint16 BE) ✅ CONFIRMED +``` + +| Offset | Size | Type | Known values | Meaning | Certainty | +|---|---|---|---|---|---| +| +4B | 1 | uint8 | 250, 100 | **BACKLIGHT ON TIME** (0–255 seconds per manual) | ✅ CONFIRMED | +| +4C | 1 | — | 0x00 | Padding / high byte of potential uint16 | 🔶 INFERRED | +| +53 | 1 | uint8 | 10, 30 | **POWER SAVING TIMEOUT** (minutes) | ✅ CONFIRMED | +| +54..+55 | 2 | uint16 BE | 0xFFDC = 65500 | **MONITORING LCD CYCLE** (seconds; 65500 ≈ disabled/max) | ✅ CONFIRMED | + +**Confirmation captures:** + +| Capture | Backlight (+4B) | Power Save (+53) | LCD Cycle (+54/55) | +|---|---|---|---| +| `20260301_160702` (BW-written) | `0xFA` = 250 | `0x0A` = 10 min | `0xFF 0xDC` = 65500 | +| `20260302_144606` (device-set) | `0x64` = 100 | `0x1E` = 30 min | `0xFF 0xDC` = 65500 | + +> 📖 **Manual cross-reference (716U0101 Rev 15, §3.13.1):** +> - Backlight On Time: "adjustable timer, from 0 to 255 seconds" (§3.13.1e) +> - Power Saving Timeout: "automatically turns the Minimate Plus off" — stored in minutes (§3.13.1f) +> - Monitoring LCD Cycle: "cycles off for the time period... set to zero to turn off" — 65500 = effectively disabled (§3.13.1g) + +### 7.5 Full Waveform Record (SUB F3) — 0xD2 bytes × 2 pages + +> ✅ **2026-02-26 — UPDATED:** Project strings field layout confirmed by diffing compliance setup write payload (SUB `71`). Client field change `"Hello Claude"` → `"Claude test2"` isolated exact byte position. + +**Project strings field layout** (confirmed from SUB `71` write frame, offset +230 from frame start): + +``` +Offset Field label (null-padded, ~16 bytes) Field value (null-padded, ~32 bytes) +------ ------------------------------------ ------------------------------------ ++0x00 "Standard Recording Setup" ← setup name (no label) ++0x28 "Project:" project description string ++0x50 "Client:" client name string ← confirmed at +230 ++0x78 "User Name:" operator name string ++0xA0 "Seis Loc:" sensor location string ++0xC8 "Extended Notes" notes string +``` + +> 🔶 Offsets are approximate — exact byte boundaries need one more targeted capture with a known-length string change to pin down padding rules. + +Confirmed ASCII strings extracted from payload: + +``` +"Project:" +"I-70 at SR 51-75978 - Loc 1 - 4256 SR51 " ← project description +"BE18189" ← serial number +"Histogram" ← record type +"Standard Recording Setup" ← setup name +"Client:" +"Golden Triangle" ← client name +"User Name:" +"Terra-Mechanics Inc. - B. Harrison" ← operator +"Seis Loc:" +"Location #1 - 4256 SR 51 - Intec" ← sensor location +"Extended Notes" +"Tran" ← Transverse channel +"Vert" ← Vertical channel +"Long" ← Longitudinal channel +"MicL" ← Microphone / air overpressure +``` + +### 7.6 Channel Config Float Layout (SUB E5 / SUB 71) + +> ✅ **CONFIRMED — 2026-03-01** from controlled captures (sessions `193237` and `151147`). Trigger changed `0.500 → 0.200`, then `0.200 → 0.600`. Alarm changed `1.0 → 2.0`. All positions confirmed. + +The SUB `1A` read response (`E5`) and SUB `71` write block contain per-channel threshold and scaling values packed as **IEEE 754 big-endian floats**, with inline unit strings. This layout repeats **once per geophone channel** (Tran, Vert, Long — 3×): + +``` +[00 00] [max_range float] [00 00] [trigger float] ["in.\0"] [alarm float] ["/s\0\0"] [00 01] [chan_label...] + 40 C6 97 FD 3F 19 99 9A 69 6E 2E 40 00 00 00 2F 73 00 00 + = 6.206 = 0.600 in/s "in." = 2.000 in/s "/s" +``` + +| Field | Example bytes | Decoded | Certainty | +|---|---|---|---| +| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | +| ADC scale factor | `40 C6 97 FD` | **6.206053 (in/s)/V — CONFIRMED 2026-04-17.** This is the inverse sensitivity of the standard Instantel geophone = 1/0.161133. Interface Handbook §4.5: `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Used by firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant — do NOT write. Offset = **channel_label + 28** (same in E5 read and SUB 71 write). | ✅ CONFIRMED | +| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | +| **Trigger level** | `3F 19 99 9A` | **0.600 in/s** — IEEE 754 BE float | ✅ CONFIRMED | +| Unit string | `69 6E 2E 00` | `"in.\0"` | ✅ CONFIRMED | +| **Alarm level** | `40 00 00 00` | **2.000 in/s** — IEEE 754 BE float | ✅ CONFIRMED | +| Unit string | `2F 73 00 00` | `"/s\0\0"` | ✅ CONFIRMED | +| `[00 01]` | `00 01` | Unknown flag / separator | 🔶 INFERRED | +| Channel label | e.g. `56 65 72 74` | `"Vert"` — identifies which channel | ✅ CONFIRMED | +| **Geo range (sensitivity selector)** | `00` or `01` | **uint8** — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Offset = **channel_label + 33** (same in E5 read and SUB 71 write). Applied to all three geo channel blocks (Tran/Vert/Long). **Note: `channel_label + 20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | ✅ CONFIRMED 2026-04-20 | + +**State transitions observed across captures:** + +| Capture | Trigger | Alarm | Notes | +|---|---|---|---| +| `193237` (read) | `3F000000` = 0.500 | `3F800000` = 1.000 | Device state before any change | +| `193237` (write 1) | `3E4CCCCD` = 0.200 | `3F800000` = 1.000 | Trigger changed only | +| `151147` (write 1) | `3E4CCCCD` = 0.200 | `40000000` = 2.000 | Alarm changed, trigger carried over | +| `151147` (write 2) | `3F19999A` = 0.600 | `40000000` = 2.000 | Trigger changed, alarm carried over | + +Values are stored natively in **imperial units (in/s)** — unit strings `"in."` and `"/s"` embedded inline confirm this regardless of display locale. + +### 7.6.1 Record Time + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Anchor convention +> updated 2026-04-21 — search for the 6-byte stable anchor, not the 10-byte form. + +Record time is stored as a **32-bit IEEE 754 float, big-endian**, located via an +anchor pattern (see §7.6.3 / §7.6.4 for the rest of the anchor-relative fields). + +**Anchor:** search for the 6-byte sequence `\xbe\x80\x00\x00\x00\x00` in +`cfg[0:150]`. **Record time is at anchor + 6** (i.e. 6 bytes past the start of +the anchor). + +> ⚠️ **The earlier "10-byte anchor" form `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` +> is NOT stable.** Its leading two bytes `\x01\x2c` (= 300) are the +> `histogram_interval_sec` field, which changes when the histogram interval is +> reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant. +> Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`. + +> 🔶 **2026-10-17 — the 6-byte suffix may not be constant either (INFERRED from Series IV).** +> On a Micromate the same position holds `[pre-trigger f32 BE, negative seconds][record stop mode]`, +> measured setting by setting: `be 80 00 00` = −0.25 s, and `00 00` = Fixed (Auto reads `00 01`). +> Every S3 unit this anchor was confirmed on would have been at those defaults. If S3 shares the layout, +> a unit in **Record Stop Mode = Auto** returns `be 80 00 00 00 01`, `find()` returns −1, and the four +> anchor-relative fields silently go undecoded. **Not yet measured on S3** — one BW capture in Auto +> mode settles it. Until then, treat a missing anchor as this, not as DLE jitter. + +> ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the +> compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental +> header padding is gone and the anchor now appears at `cfg[11]`. Search range +> widened to `cfg[0:150]`. + +| Record Time | float32 BE bytes | Decoded | +|---|---|---| +| 3 seconds | `40 40 00 00` | 3.0 | +| 5 seconds | `40 A0 00 00` | 5.0 | +| 7 seconds | `40 E0 00 00` | 7.0 | +| 8 seconds | `41 00 00 00` | 8.0 | +| 10 seconds | `41 20 00 00` | 10.0 | +| 13 seconds | `41 50 00 00` | 13.0 | + +**⚠️ Do NOT use absolute offset `+0x28` from page2 start for BE11529.** The total cfg length varies by ±1 byte depending on sample rate setting (see §7.6.3 DLE jitter note). Absolute offsets are unreliable; anchor search is the correct approach. + +**`0x0A` after "Extended Notes" label:** invariant across record time changes — not record time. + +> ✅ **`0x082A` (= 2090) — RESOLVED:** Fixed payload length of the E5 response block. Constant regardless of any setting. + +--- + +### 7.6.2 SUB 1A Multi-Frame Read Protocol + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture). + +SUB 1A (compliance config read) requires **four frames**, not the standard 2-step probe+fetch used by other SUBs. The Blastware TX frame format for these is ACK (`0x41`) + STX (`0x02`) + [DLE-stuffed body] + ETX (`0x03`) with CMD=`0x10`. + +**Frame sequence:** + +| Step | Name | BW offset param | Notes | +|---|---|---|---| +| A | Probe | `0x0000` | Triggers E5 response with page_key=`0x0000` (44-byte header) | +| B | Data B | `0x0400` | params: `00 00 00 00 00 00 00 64 00 00`; E5 page_key=`0x0000` (44 bytes) | +| C | Data C | `0x0400` | params: `00 00 04 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1027 bytes) | +| D | Data D | `0x002A` | params: `00 00 08 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1055 bytes, or 0x0000/44 bytes when BE11529 sends a duplicate) | + +**E5 response `page_key` field:** bytes `data[3:5]` of the E5 payload. `0x0000` = header/short chunk, `0x0010` = main config data. + +**Assembling cfg:** concatenate non-duplicate chunks in order (B+C+D). Track `(page_key, chunk_len)` pairs; drop any repeat to avoid mis-alignment. + +**Expected cfg lengths:** +- Frame D delivers page `0x0010` correctly: **44 + 1027 + 1055 = 2126 bytes** +- Frame D duplicates page `0x0000` (BE11529 occasional): **44 + 1027 = 1071 bytes** (still fully decodable) + +--- + +### 7.6.3 Sample Rate and DLE Jitter + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Validated across +> Normal (1024), Fast (2048), and Faster (4096) modes. + +**Location:** `uint16 BE` at **anchor − 6**, using the 6-byte stable anchor +`\xbe\x80\x00\x00\x00\x00` searched in `cfg[0:150]`. + +| Device Mode | uint16 BE value | Sa/s | +|---|---|---| +| Normal | `04 00` | 1024 | +| Fast | `08 00` | 2048 | +| Faster | `10 00` | 4096 | + +**DLE jitter (critical — explains the ±1 byte cfg length variation):** + +The sample rate bytes sit a few bytes before the anchor in the raw S3 frame. +For "Faster" mode (4096 = `0x1000`), the high byte `0x10` is itself a DLE +character and was historically escaped on the wire as `10 10`. After DLE +unstuffing: `10 10 00` → `10 00` (2 bytes). For Normal/Fast modes (high byte = +`0x04` / `0x08`), no escaping needed and the payload stays 3 bytes. Result: +"Faster" mode can produce a cfg that is **1 byte shorter** than Normal/Fast, +shifting any absolute offset by −1. + +**Why anchor search is required:** any decoder that uses fixed absolute offsets +for record_time or sample_rate will produce garbage values when the device is +set to "Faster" mode. The 6-byte anchor (start of the alarm-level floats +`\xbe\x80\x00\x00\x00\x00`) is past the DLE-affected bytes and is unaffected by +this shift. + +--- + +### 7.6.4 Recording Mode + +> ✅ **CONFIRMED — 2026-04-20** (BE11529 / firmware S338.17); offsets corrected +> 2026-04-21 after a write-cycle drift bug was traced to writing to the wrong +> byte. **`recording_mode` is at `anchor − 8` for BOTH read and write.** + +Recording mode is a **uint8** stored at a fixed anchor-relative position (using +the 6-byte stable anchor `\xbe\x80\x00\x00\x00\x00`): + +| Enum | Mode | +|---|---| +| `0x00` | Single Shot | +| `0x01` | Continuous | +| `0x02` | Unknown (not yet observed) | +| `0x03` | Histogram | +| `0x04` | Histogram + Continuous (combined mode) | + +**Layout around the anchor (same in E5 read response and SUB 71 write payload):** + +``` +buf[anchor − 9] = mode_prefix (uint8; 0x00 for Single Shot/Continuous, + 0x10 for Histogram (DLE prefix in E5 wire + encoding of 0x03) and for Histogram+Continuous + (actual stored byte)) +buf[anchor − 8] = recording_mode (uint8) ← SAME OFFSET IN READ AND WRITE +buf[anchor − 7] = 0x10 (constant; part of the sample-rate field area; + do NOT overwrite — see warning below) +buf[anchor − 6] = sample_rate_hi (uint8, MSB of uint16 BE) +buf[anchor − 5] = sample_rate_lo (uint8, LSB of uint16 BE) +buf[anchor − 4 : anchor − 2] = histogram_interval_sec (uint16 BE, seconds; + mode-gated to Histogram) +buf[anchor − 2 : anchor] = 0x00 0x00 (padding) +buf[anchor : anchor + 6] = \xbe\x80\x00\x00\x00\x00 (anchor) +buf[anchor + 6 : anchor + 10] = record_time (float32 BE) +``` + +> ⚠️ **Do NOT write to `anchor − 7`.** The byte there is a DLE marker that the +> device firmware re-generates on every read. Writing to it shifts the anchor +> position by +1 on every subsequent read, drifting compliance config offsets +> indefinitely. The CLAUDE.md note "write to anchor-7" was a known mistake — +> see the `_encode_compliance_config` comment block in `client.py:2062–2068`. + +**`compliance_raw` DLE encoding:** + +`compliance_raw` returned by `read_compliance_config()` is NOT purely logical +bytes — it is the wire-encoded payload where any logical `0x03` byte appears as +the literal pair `\x10\x03` (preserved by `S3FrameParser` as inner-frame +literal data). Consequences: + +- For `recording_mode = 0x03` (Histogram), `compliance_raw[anc − 9] = 0x10` + (the DLE prefix from the wire encoding of `0x03`) and + `compliance_raw[anc − 8] = 0x03` (the actual value). +- For Histogram + Continuous (`0x04`), `compliance_raw[anc − 9] = 0x10` is an + actual stored config byte (not a DLE prefix). +- The 6-byte anchor search (`buf.find(b'\xbe\x80...', 0, 150)`) locates the + anchor correctly regardless of these mode-dependent shifts. +- When SFM writes `recording_mode` and round-trips the rest verbatim, the byte + at `anc − 9` is preserved from the previous read. Transitioning + Histogram → other modes via SFM may leave a `0x10` at `anc − 9` — the device + stores it as a literal byte; it does not affect recording-mode operation + (which is at `anc − 8`) but is one byte different from what BW writes. + +**Decode path (`_decode_compliance_config_into`):** `data[anchor_pos − 8]`. +**Encode path (`_encode_compliance_config`):** `buf[anchor_pos − 8] = recording_mode`. + +--- + +### 7.7 Blastware `.set` File Format + +> 🔶 **INFERRED — 2026-03-01** from `Standard_Recording_Setup.set` cross-referenced against known wire payloads. + +Blastware's "save setup to disk" feature produces a binary `.set` file that is structurally identical to the wire protocol payload, but with **all multi-byte values in little-endian byte order** (Windows-native) rather than the big-endian order used on the wire. No DLE framing, no checksums — raw struct dump. + +**File layout (2522 bytes observed):** + +``` +0x0000 Header / metadata block (~40 bytes) — partially decoded +0x002A "Standard Recording Setup.set\0" — setup filename, null-padded +0x0078 Project strings block — same layout as SUB 71 wire payload + "Project:\0" + value, "Client:\0" + value, "User Name:\0" + value, + "Seis Loc:\0" + value, "Extended Notes\0" + value +0x06A0 Channel records block — one record per channel (geo×3 + mic×1 + duplicates) +0x0820 Device info block — serial number, firmware, model strings +0x08C0 Event index / timestamp block +0x0910 Histogram / reporting config +0x09D0 Trailer (10 bytes) +``` + +**Per-channel record layout (little-endian, ~46 bytes per channel):** + +``` +offset size type value (Tran example) meaning ++00 2 uint16 0x0001 channel type (1=geophone, 0=mic) ++02 4 char[4] "Tran" channel label ++06 2 uint16 0x0000 padding ++08 2 uint16 0x0001 unknown ++0A 2 uint16 0x0050 = 80 unknown (sensitivity? gain?) ++0C 2 uint16 0x000F = 15 unknown ++0E 2 uint16 0x0028 = 40 unknown ++10 2 uint16 0x0015 = 21 unknown ++12 4 bytes 03 02 04 01 flags (recording mode etc.) ++16 4 uint32 0x00000003 record time in seconds ✅ CONFIRMED ++1A 4 float32 6.206053 ✅ CONFIRMED 2026-04-17 — ADC-to-velocity scale factor (= 1/sensitivity = (in/s)/V). Interface Handbook §4.5: Range = 1.61133 V × 6.206053 = 10.000 in/s (Normal range). Firmware uses: PPV (in/s) = ADC_voltage × 6.206053. Hardware constant — identical on all tested units. Do NOT write. ++1E 2 00 00 padding ++20 4 float32 0.6000 trigger level ✅ CONFIRMED ++24 4 char[4] "in.\0" / "psi\0" unit string (geo vs mic) ++28 4 float32 2.0000 alarm level ✅ CONFIRMED ++2C 4 char[4] "/s\0\0" / varies unit string 2 +``` + +**MicL channel differences:** +- `channel_type` = 0 (vs 1 for geophones) +- trigger = 0.009, alarm = 0.021 (in psi) +- unit string = `"psi\0"` instead of `"in.\0"` — **confirms MicL units are psi** ✅ + +**Endianness summary:** + +| Context | Byte order | Example (0.6 in/s trigger) | +|---|---|---| +| `.set` file | Little-endian | `9A 99 19 3F` | +| Wire protocol (SUB 71 / E5) | Big-endian | `3F 19 99 9A` | + +> ❓ **`0x082A`** — still unidentified. Record time in the `.set` file = `0x00000003` (3 sec), which would be `00 00 00 03` on wire — not `0x082A`. The original sessions had record time = 2, which would be `00 00 00 02`. `0x082A` = 2090 doesn't match any obvious record time encoding. May correspond to one of the unknown uint16 fields at +0A through +10. A capture changing sample rate or histogram interval would help isolate it. + +--- + +### 7.8 Trigger / Advanced Config Write Frame (BW→S3 SUB `0x82`) + +> ✅ **CONFIRMED — 2026-03-09** from controlled BW-side capture diff (Trigger Sample Width 4→3). + +SUB `0x82` is the BW→S3 write command for the advanced trigger configuration block. It is the write counterpart to the S3→BW read response SUB `0xD1` (0xFF − 0x82 = 0x7D is a separate sub; the D1/2E read pair is distinct). The `0x82` write frame is only visible in `raw_bw.bin` — it does not appear in S3-side compliance dumps. + +**Destuffed BW write frame layout (47 raw bytes → 46 destuffed):** + +``` +offset value meaning +[00] 0x10 addr (literal 0x10 after destuffing) +[01] 0x00 unknown +[02] 0x82 SUB: advanced config write +[03] 0x00 unknown +[04] 0x00 unknown +[05] 0x1C length = 28 bytes (payload size) +[06..10] 00.. header/padding +[11..16] 00.. header/padding +[17] 0x1A unknown (constant 26 = 0x1A) +[18] 0xD5 unknown (constant) +[19] 0x00 unknown +[20] 0x00 unknown +[21] 0x10 literal 0x10 (stuffed in raw frame as 10 10) +[22] 0x04/0x03 Trigger Sample Width ✅ CONFIRMED (uint8, samples) +[23] 0x0A unknown (constant 10; NOT Auto Window) +[24..43] 0xFF.. padding +[44] 0x00 unknown +[45] checksum +``` + +**Confirmed Trigger Sample Width values:** + +| Width setting | Byte [22] | +|---|---| +| 4 samples | `0x04` | +| 3 samples | `0x03` | +| 2 samples (default) | `0x02` (expected — not yet captured) | + +**Known constants in this frame:** `[17]=0x1A`, `[18]=0xD5`, `[23]=0x0A`. These do not change with Trigger Sample Width changes. Byte `[23]` = 10 was initially a candidate for Auto Window (range 1–9) but cannot be Auto Window because 10 is outside the valid range. + +**Mode gating:** This write frame is only transmitted when Blastware performs a Send To Unit operation in Compliance / Single-Shot / Fixed Record Time mode. The frame is absent from other session types. + +--- + +### 7.9 Mode Gating — Protocol Architecture Note + +> ✅ **CONFIRMED — 2026-03-09** from controlled captures and null-change experiments. + +Several settings are **mode-gated**: the device only transmits (reads) or accepts (writes) certain fields when the appropriate operating mode is active. This is an architectural property of the protocol, not a gap in capture methodology. + +**Observed mode gating:** + +| Setting | Gate Condition | Evidence | +|---|---|---| +| Trigger Sample Width | Compliance / Single-Shot / Fixed Record Time mode | Not visible in S3-side reads; only in BW write frame (SUB `0x82`) when mode is active | +| Auto Window | Record Stop Mode = Auto | Capture of 3→9 change in Fixed mode produced zero wire change in all frames (F7, D1, E5 all identical) | + +**Implication for captures:** To map a mode-gated setting, you must first activate the gating mode on the device, then perform the compliance dump or write capture. Changing the setting value while in the wrong mode will produce no observable wire change. + +**Suspected mode-gated settings not yet captured:** +- Auto Window (requires Record Stop Mode = Auto) +- Auxiliary Trigger (unknown gate condition) + +--- + +### 7.5b Full Waveform Record (SUB F3) — 0xD2 bytes (210 bytes) + +> ✅ **Updated 2026-03-31** — Full layout confirmed. See §7.7.5 for the +> complete record structure including timestamp, record type, PPV float +> positions, and project strings. +> Section number changed to `7.5b` 2026-05-20 to disambiguate from §7.5 above. + +Peak values are found by searching for channel label strings `"Tran"`, +`"Vert"`, `"Long"`, `"MicL"` and reading `float32 BE` at `label_offset + 6`. +The floats are **not 4-byte aligned** — confirmed from 3-31-26 capture. + +Example peak values (event 1 from 3-31-26): +``` +Tran: 3D BB 45 7A = 0.0916 in/s +Vert: 3D B9 56 E1 = 0.0907 in/s +Long: 3D 75 C2 7C = 0.0605 in/s +MicL: 39 BE 18 B8 = 0.000145 psi ✅ units confirmed +``` + +Example peak values (event 2 from earlier capture): +``` +Tran: 3D 56 CB B9 = 0.0521 in/s +Vert: 3C F5 C2 7C = 0.0300 in/s +Long: 3C F5 C2 7C = 0.0300 in/s +MicL: 39 64 1D AA = 0.0000875 psi +``` + +> ⚠️ The record is delivered as `data_rsp.data[11:11+0xD2]` — the outer +> data section header (LENGTH_ECHO, KEY_ECHO) occupies data[0..10]. +> Callers of `read_waveform_record()` receive the 210-byte record directly. + +### 7.6 Bulk Waveform Stream (SUB A5) — Raw ADC Sample Records + +> ⛔ **§7.6 below describes the deprecated `0x0400`-step walk and is RETAINED FOR HISTORICAL CONTEXT ONLY.** +> The "A5[7] is metadata", "A5[9] is terminator", and chunk-counter frame-index claims in this section +> are all artifacts of the broken walk that was overrunning past event end by ~5×. +> +> **For the corrected protocol (v0.14.0+), use:** +> - **§7.8.5** — chunk addressing (probe at `start_offset`, samples step 0x0200, bounded by STRT `end_offset`) +> - **§7.8.6** — TERM frame formula +> - **§7.8.7** — fixed metadata pages 0x1002 / 0x1004 (this is where Project / Client / User Name / Seis Loc +> strings actually live — NOT in any sample-chunk frame) +> - **§7.8.8** — multi-event "Download All" sequence +> +> The waveform sample encoding described in §7.6.1 below (4-channel interleaved s16 LE, 8 bytes +> per sample-set) is **NOT actually verified** — see the retraction note at the top of §7.6.1. +> The frame-indexing claims and metadata-source claims in §7.6 are also wrong; use §7.8.5–§7.8.8. + +**Two distinct formats exist depending on recording mode. Both confirmed from captures.** + +--- + +#### 7.6.1 Blast / Waveform mode — 🟡 PARTIAL DECODE (2026-05-11) + +> ### 📌 CURRENT STATUS — read this first +> +> The body codec is **partially decoded** as of 2026-05-11. This +> section contains both current-truth spec AND historical retractions; +> when in doubt, the working summary lives at +> `docs/waveform_codec_re_status.md`. +> +> | Item | Status | +> |---|---| +> | Body has tagged variable-length blocks, NOT raw int16 LE | ✅ confirmed | +> | 5 block tag types (10/20/00/30/40 NN) with lengths | ✅ confirmed | +> | 7-byte preamble: `00 02 00` + Tran[0] + Tran[1] int16 BE | ✅ confirmed | +> | `00 NN` = RLE for zero deltas in the current channel | ✅ confirmed | +> | Tran channel, segment 0 (~482-510 samples / event) | ✅ byte-exact, 5/5 events | +> | Multi-segment Tran continuation | ❌ open (breaks at sample ~512) | +> | Vert / Long / MicL channel decoders | ❌ open | +> | `30 NN` block content (loud-from-start events) | ❌ open | +> | Earlier "raw int16 LE, 8 bytes per sample-set" claim | ❌ REFUTED | +> +> **Production code in `client.py:_decode_a5_waveform` still uses the +> broken int16 LE decoder.** The `.h5` sidecars SFM produces contain +> wrong sample values and must be treated as "unverified" downstream. +> The BW binary write path is unaffected (it's pure passthrough of the +> device's flash bytes, no decoding) and remains byte-perfect. + +The "4-channel interleaved s16 LE, 8 bytes per sample-set" claim that +appeared in earlier revisions of this section was never validated and +was wrong. No event in the project's archive ever came close to ADC +saturation, yet the int16 LE decoder consistently produced full-scale +±32K noise — that was the signature of mis-aligned encoded data, not +signal saturation. + +##### Body file layout + +A Blastware waveform-file body (the variable-length section between +the 21-byte STRT record and the 26-byte file footer) is composed of +**tagged variable-length blocks**, NOT raw int16 samples. + +``` +[preamble: 7 or 9 bytes] +[stream of tagged blocks] +[trailer: per-channel summary blocks] +``` + +**Preamble (CONFIRMED 2026-05-11 across 3+4 events):** + +``` +body[0:3] = 00 02 00 magic +body[3:5] = Tran[0] int16 BE first Tran sample (LSB = 0.005 in/s) +body[5:7] = Tran[1] int16 BE second Tran sample +``` + +The preamble is therefore 7 bytes long. Earlier observations of a +"9-byte preamble" on continuous-mode events were a misread — those +events still have a 7-byte preamble; the next 2 bytes are part of the +first ``10 NN`` or ``20 NN`` data block (its tag). + +Verified preamble decode for all 7 fixture events — Tran[0] and Tran[1] +from the preamble bytes exactly match the BW ASCII export (rounded to +0.005 in/s): + +| Event | Preamble [3:7] (hex) | T[0] decoded | T[0] truth | T[1] decoded | T[1] truth | +|---|---|---|---|---|---| +| event-a (May 8) | ``01 00 00 00`` | +1 | +1 (0.005) | 0 | 0 | +| event-b (May 8) | ``ff ff ff 00`` | -1 | -1 | -1 | -1 | +| event-c (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | +| event-d (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | +| SP0 (May 11) | ``00 04 00 04`` | +4 | +4 (0.020) | +4 | +4 | +| SS0 (May 11) | ``ff a7 ff a7`` | -89 | -89 (-0.445) | -89 | -89 | +| SV0 (May 11) | ``fd 17 fd 06`` | -745 | -745 (-3.725) | -762 | -762 | + +##### Block tags (CONFIRMED 2026-05-08) + +Every block starts with a 2-byte tag. Five tag types are confirmed: + +| Tag (hex) | Block type | On-wire length | +|-----------|-------------------------------------|-----------------------| +| ``10 NN`` | Small-delta data block | NN/2 + 2 bytes | +| ``20 NN`` | Literal data block (int8-shaped) | NN + 2 bytes | +| ``00 NN`` | RLE zero-delta run | 2 bytes | +| ``30 NN`` | Trailer summary block | NN × 4 bytes | +| ``40 NN`` | Segment header | 2 × NN + 16 bytes | + +NN is always a multiple of 4. ``10 NN`` and ``20 NN`` data blocks +alternate with ``00 NN`` markers — every ``10/20 NN`` block is +followed by a ``00 NN`` marker before the next data block. + +###### Wide-NN forms — ``0X NN`` (CONFIRMED 2026-08-25) + +The 12-bit wide-NN encoding already documented for ``1X NN`` / +``2X NN`` (low nibble of the tag byte carries the high nibble of NN, +so effective ``NN = ((tag & 0x0F) << 8) | NN``) **also applies to the +``00 NN`` RLE tag.** A narrow RLE run maxes out at NN = 0xFC, so a +quiet stretch longer than 252 samples must use the wide form. + +Confirmed against six production events, e.g. ``01 0c`` (NN = 268) in +``BE9558/K558LKOF.460W``. Before this was handled, the walker hit its +unknown-tag break at the first long quiet run and silently truncated +every channel decoded after that point. + +###### ``30 NN`` is not capped at NN = 0x10 (CONFIRMED 2026-08-25) + +Data-section ``30 NN`` blocks occur with NN up to at least 0x18 (24), +e.g. ``30 18`` in ``BE18193/T193LQ45.NN0W`` and ``30 14`` in +``BE18193/T193LQ9W.AF0W``. The data-section length formula +(``NN × 1.5 + 2``) holds for these; only the earlier ``NN ≤ 0x10`` +guard was wrong. + +###### ``40 NN`` segment headers are variable width (CONFIRMED 2026-08-25) + +``40 02`` is the common case, but **NN is the count of int16 BE +continuation deltas the header carries for the *previous* channel**, so +the header grows with NN and every field after the deltas shifts by +``2 × NN``: + +``` +length = 2 (tag) + 2 × NN (prev-channel deltas) + 14 (fixed tail) +``` + +``40 01`` (18 bytes) and ``40 03`` (22 bytes) both occur in production +files — see ``BE12599/N599LP1S.UO0W`` and ``BE18438/T438LO30.GA0W``. +In each case the constant ``02 00`` marker sits at ``data[2×NN+8]`` and +the following tag lands exactly on a valid block boundary. + +##### Segments + +The body is divided into segments separated by ``40 02`` segment headers. +**Segment size is variable** — bounded by a fixed device-flash byte +budget, not a fixed sample count. Quiet events fit more samples per +segment (RLE compacts zero deltas via ``00 NN`` markers); loud events +fit fewer. Observed first-segment sizes in the bundled fixtures: + +| Event | Segment 0 size (Tran samples) | +|---|---| +| SP0 (loud, 0.25s pretrig) | 510 | +| SV0 (loud-from-start) | 58 (stops at first ``30 NN``) | +| SS0 (loud-from-start) | 42 (stops at first ``30 04``) | +| JQ0 (Vert-heavy, quiet Tran) | 510 | +| V70 (Mic-heavy, quiet geos) | 510 | + +⚠️ Earlier drafts of this section claimed "~80 sample-sets per segment" +based on incomplete walks; that figure is wrong. Segments are +flash-page-sized in bytes, not sample-count-sized. + +The ``40 NN`` payload structure (offsets shown for the common NN=2 / +18-byte-payload case; add ``2 × (NN − 2)`` to every offset from ``[4:6]`` +onward for other widths): + +| Offset (NN=2) | Generic | Field | Status | +|---------------|------------------|----------------------------------------|-------------| +| [0:4] | [0 : 2NN] | NN × int16 BE continuation deltas for | ✅ confirmed| +| | | the PREVIOUS channel (16-count units) | | +| [4:6] | [2NN : 2NN+2] | Unknown (varies; possibly a checksum) | ❓ open | +| [6:8] | [2NN+2 : 2NN+4] | Byte length to next segment header − 2 | 🟡 likely | +| | | (uint16 BE; off by ±4 on some files) | | +| [8:12] | [2NN+4 : 2NN+8] | Monotonic uint32 LE counter | ✅ confirmed| +| | | (starts ~0x47, +1 per segment) | | +| [12:14] | [2NN+8 : 2NN+10] | Constant ``02 00`` | ✅ confirmed| +| [14:18] | [2NN+10 : 2NN+14]| THIS channel's 2-sample anchor pair | ✅ confirmed| +| | | (2 × int16 BE) | | + +⚠️ An earlier draft listed ``[14:18]`` as an "unknown 4-byte field" and +``[12:16]`` as a constant ``02 00 00 01``. Both were wrong: the constant +is only the 2-byte ``02 00``, and the four bytes after it are the anchor +pair the decoder needs. Corrected 2026-08-25. + +###### Tagless segment headers (CONFIRMED 2026-08-25) + +A segment header can appear with **no ``40 NN`` tag at all** — just the +14-byte tail: + +``` +[field2:2][len_to_next:2][channel_id:4][marker:2][anchors:4] +``` + +This is the NN=0 case: the previous channel needed no continuation +deltas, so there is no tag and no delta bytes. Detect it by the six +bytes at ``[4:10]`` — a known channel id, two zero bytes, a small +segment index, then the ``01 00`` / ``02 00`` marker. + +It is where the walk stopped in 7 of the 8 events that still truncated +after the wide-RLE / ``30 NN`` / variable-width-``40 NN`` fixes. + +###### The header "counter" is really a channel id (CONFIRMED 2026-08-25) + +The 4-byte field previously documented as a *"monotonic uint32 LE +counter (starts ~0x47, increments by 1 per segment)"* is actually: + +``` +[channel_id:1][00][00][segment_index:1] +``` + +| channel_id | channel | +|---|---| +| ``0x46`` | Tran | +| ``0x47`` | Vert | +| ``0x48`` | Long | +| ``0x49`` | MicL | + +Verified on **1697 of 1697** segment headers across the ground-truth +corpus — every one agrees with the channel the rotation would assign, +zero disagreements, no other id values observed. The old reading was +plausible because the id byte cycles 0x46→0x47→0x48→0x49 and the +segment index increments, which *looks* monotonic in LE. + +Decoders should take the channel from this field rather than from +rotation position: one missed or extra header (exactly what tagless +headers used to cause) desyncs rotation and corrupts every channel +after it. + +###### Geophone full scale is 32000 counts, not 32768 (CONFIRMED 2026-08-25) + +The body codec emits geo samples in 16-count units whose LSB is exactly +**0.005 in/s**. With the consumer-side ``×16`` to ADC counts, one ADC +count is ``0.005 / 16`` in/s, so Normal range (10.000 in/s) is + +``` +10.0 / (0.005 / 16) = 32000 counts +``` + +Dividing by 32768 scales every geophone sample and every derived peak +down by ``1 - 32000/32768`` = **2.34%**. Measured on 216 per-channel +comparisons against preserved Blastware ASCII exports: 32768 gave +151/216 exact (worst error 0.238 in/s on a 10 in/s event); 32000 gives +216/216 exact with a worst error of 0.005 in/s — exactly 1 LSB, i.e. +pure quantization. + +This also explains why Blastware reports geo peaks slightly above +nominal full scale (e.g. 10.14 in/s): the ADC has headroom past 32000. + +**Scope — this is not waveform-specific.** The scale is applied where +ADC counts become physical units, which every event passes through +regardless of which codec produced the samples. Verified after +re-deriving the whole production store: + +| source | median ratio ours/device, 32768 | with 32000 | +|---|---|---| +| series-3 waveform (vs ASCII sample table) | 0.9766 | **1.0000** | +| series-3 histogram (vs ASCII PPV, n=1137) | 0.9766 | **1.0000** | +| series-4 Thor IDF (vs device peak, n=1468) | 0.960 | **0.983** | + +The series-4 figure is closer to correct but not exact — the Thor +per-count LSB is its own open question (see §15). + +###### SUPERSEDED 2026-08-25 — the body is a RECORD CHAIN, not a tag stream + +Everything above about ``40 NN`` segment headers, tagless headers, variable +header widths and channel rotation describes a model that is **wrong**. It +produced nearly-correct output because the block table happens to tile the +data sections correctly, but the framing is not what the device writes. + +The body is a chain of **self-delimiting per-channel records**: + +``` +off+0 field2 uint16 purpose unknown (not a length, not a checksum) +off+2 len uint16 BE next_record = off + 2 + len <- authoritative +off+4 chan_id 0x46 Tran / 0x47 Vert / 0x48 Long / 0x49 MicL + 0x06 = END OF WAVEFORM STREAM +off+5 0x00 +off+6 0x00 +off+7 segment index +off+8 mode 2 bytes, a 3-valued enum +off+10 anchors 2 x int16 BE, ABSOLUTE -- present ONLY when mode == 02 00 +``` + +**Mode enum**, all three ground-truth verified: + +| mode | header | data section | +|---|---|---| +| ``02 00`` | 14 bytes | anchors emitted, then blocks are **cumulative deltas** | +| ``01 00`` | 10 bytes | no anchors, blocks carry **absolute** sample values | +| ``00 03`` | 10 bytes | **no tags at all** — raw 12-bit packed absolute samples | + +Census over the 1,388 production series-3 waveform binaries: +``02 00`` x 32,617, ``01 00`` x 74, ``00 03`` x 71. + +**``40 NN`` is an ordinary int16 BE data block** of length ``2*NN + 2`` +(1 <= NN <= 8), never a header. The superseded model read it as a header of +length ``2*NN + 16``, which is exactly why walks drifted: the "variable prefix" +of 0/2/4/6/8 bytes reported earlier was walker drift, precisely +``4 - (old_stop - true_record_start)``, on all 25 affected files. + +Block table for data sections (``NN = ((tag_hi & 0x0F) << 8) | tag_lo``): + +| tag | length | samples | +|---|---|---| +| ``0X NN`` | 2 | NN (RLE hold — holds the previous value in BOTH delta and absolute modes) | +| ``1X NN`` | NN/2 + 2 | NN (4-bit nibble) | +| ``2X NN`` | NN + 2 | NN (int8) | +| ``30 NN`` | NN*1.5 + 2 | NN (12-bit packed) | +| ``40 NN`` | 2*NN + 2 | NN (int16 BE) | + +The ``30 NN`` "trailer length = NN*4" fallback must NOT be applied inside a +record — it corrupts records whose ``30 NN`` sits near a boundary. + +**The preamble is segment 0's implicit Tran record.** ``body[1:3]`` carries +the same mode pair: ``00 02 00`` (1,387 of 1,388 files) means two int16 BE +anchors at ``body[3:7]`` then delta blocks; ``00 00 03`` (1 file, +``BE13121/O121L4L1.KF0W``) means raw 12-bit absolute from ``body[3]``, which +cannot be block-walked — the first record must be located by scanning. + +**Verification.** The length chain terminates on a ``0x06`` record in 1,387 of +1,388 files (the exception has an ambiguous footer signature inside its sample +stream). All four channels come out at identical length in **1,388/1,388**, +against 156/1,388 under the superseded model. Against the 75 events with a +preserved Blastware ASCII export: sample-count exact **72/75 -> 75/75**, fully +exact **70/75 -> 73/75** (the 2 remaining differ by exactly 1 LSB on samples +sitting at the +-10.000 in/s rail). Against device-reported PPVs on a live +decode: waveform **1306/1306** exact with mean absolute ratio error 0.00000; +histogram **4458/4459**. + +This also eliminated the walker-over-read class entirely. 24 of those 35 +"histogram" over-reads were histogram files that ``read_blastware_file`` fed to +the *waveform* codec first; the old walker accepted them and returned garbage +(one produced 98,923 "intervals"), while the record-chain decoder correctly +returns None so they fall through to ``histogram_codec``. + +##### Trailer + +The trailer (after the last segment's data) is a sequence of 32-byte +``30 08`` blocks plus a final ``30 04`` / ``20 04`` / ``40 02`` summary +ending in the constant 2-byte tail ``00 1A``. These contain +per-channel statistics (peak times, peak values, mean offsets — bytes +in the form ``f3/f4/f5`` near ``20 10`` markers strongly resemble +int8 channel-bias values around -12). Detailed decoding of the +trailer is outside the path needed for sample reconstruction. + +##### Tran channel codec — CONFIRMED 2026-05-11 (segment 0) + +After the 7-byte preamble, the body's segment 0 carries Tran deltas +via three block types: + +- ``10 NN``: ``NN/2`` bytes of payload. Each byte = two 4-bit signed + nibbles (high nibble first; 0..7 → 0..+7, 8..F → -8..-1). Each + nibble is one Tran delta in 16-count units (LSB = 0.005 in/s). + +- ``20 NN``: ``NN`` bytes of payload. Each byte = one int8 signed + delta in 16-count units. Used when deltas don't fit in 4 bits. + +- ``00 NN``: a 2-byte marker. Run-length-encoded zero deltas — append + NN copies of the current cumulative Tran value (no change). Used + heavily for silent stretches. + +Segment 0 ends at the first ``40 02`` segment header. Segment 0 typically +covers ~510 sample-sets for events with mostly-quiet Tran, fewer for +events with rapid Tran changes. + +Verified against all bundled fixture events (5-8 and 5-11 bundles): + +| Event | Tran character | Segment 0 size | Matches truth | +|---|---|---|---| +| SP0 (loud all-channels, pretrig=0.25s) | small near sample 0 | 510 | 510/510 ✓ | +| SS0 (loud-from-start) | big from sample 0 | 42* | 42/42 ✓ | +| SV0 (loud-from-start) | big from sample 0 | 58* | 58/58 ✓ | +| JQ0 (Vert-heavy) | near zero | 510 | 510/510 ✓ | +| V70 (Mic-heavy) | near zero | 510 | 510/510 ✓ | + +\* SS0 and SV0 decode stops early because their segment 0 contains +``30 04`` blocks whose internal format hasn't been decoded yet (likely +a channel-switch marker for the high-amplitude regime). The two events +where the codec is most complex stop at the first ``30 04``. + +Implementation: :func:`minimateplus.waveform_codec.decode_tran_initial`. + +##### Multi-segment Tran continuation — OPEN + +After segment 0 ends and the segment header's T_delta (bytes [0:2]) +is applied, the next segment's blocks produce values that diverge from +truth by sample ~512. The block structure inside segment 1 is +identical to segment 0 (alternating ``10 NN`` / ``20 NN`` data + +``00 NN`` RLE), and the per-segment delta budget exactly matches the +segment size — V70 segment 1 has 264 nibble-deltas + 244 RLE-zeros = +508 = the segment's sample count. Cumulative deltas are correct in +aggregate (V70 net-zero ≈ truth net-zero) but the per-sample trajectory +is wrong when applied as Tran continuation. + +The strongest unverified hypothesis is that **segments rotate +channels**: segment 0 = Tran, segment 1 = Vert, segment 2 = Long, +segment 3 = Mic, segment 4 = Tran continuation, … This would explain +the per-segment delta-budget match while also explaining why segment +1 isn't Tran continuation. Verification needs the per-channel anchor +to come from segment-header bytes [4:6] or [14:18], which are still +open. + +##### What's still open + +- **Tran past the first data block.** After the first block, the + body has more ``10 NN`` / ``20 NN`` blocks separated by ``00 NN`` + markers and occasionally ``30 NN`` blocks. Naive continuation + (treat all subsequent ``10/20 NN`` blocks as Tran) does NOT match + truth past the first block — the codec interleaves channels somehow. + ``30 04`` markers appearing in SS0 between blocks 1 and 5 look + like channel-switch tags, but the switching rule has not been + fully decoded. + +- **Vert / Long / MicL channel encodings.** No verified decoder + exists for these yet. Hypotheses tested without success: + V_init stored as int16 BE in ``30 NN`` block payload; V/L/M + blocks encoded in order after Tran with ``30 NN`` separators; + V encoded as ``V - T`` differential. None match truth. + +- **``30 NN`` block length.** In the trailer, ``30 NN`` blocks + are NN×4 bytes long. In the data section, ``30 NN`` blocks are + NN×2 bytes long (= 8 bytes for NN=4 in SS0). The walker tries + NN×2 first and falls back to NN×4 if needed. + +- **Walker correctness past offset ~427 in event-b.** The walker + bails out partway through event-b — there is at least one block + whose length doesn't fit the lengths confirmed for the other + events. This is a separate (now lower-priority) issue. + +##### Recommended next step + +A capture with a known external waveform (calibration tone of known +frequency and amplitude) would unlock the magnitude scaling and +disambiguate which channel a ``20 NN`` block belongs to. Multiple +captures of the same signal at different ``geo_range`` settings +(Normal 10 in/s vs Sensitive 1.25 in/s) would also pin down whether +sample values are scaled at the codec layer or only at the BW +display layer. + +##### Reference module + +``minimateplus/waveform_codec.py`` implements the verified block +walker (:func:`walk_body`, :func:`split_segments`, +:func:`parse_segment_header`). ``decode_waveform_v2`` is a stub that +returns ``None`` until a verified per-byte sample decoder is wired +up; production code (``minimateplus/client.py``) continues to use +the legacy int16 LE decoder, which produces wrong samples but stable +output shape — keep the ``.h5`` sidecars marked as +"sample-codec unverified" until the byte-to-sample mapping lands. + +##### History (do not re-derive) + +| Date | Note | +|---|---| +| 2026-05-11 | Tran channel codec cracked using a high-amplitude (PPV 6-7 in/s) event bundle. Preamble[3:7] = Tran[0]/Tran[1] as int16 BE in 16-count units (LSB = 0.005 in/s). First data block (``10 NN`` nibble-deltas or ``20 NN`` int8-deltas) carries Tran deltas from sample 2. Verified 22+42+46 = 110 samples across SP0/SS0/SV0 with 0 errors. Earlier 96-combination brute-force search on the quiet 5-8 bundle failed because Tran[0] = Tran[1] = 0 in those events made initial-value-from-preamble undetectable. | +| 2026-05-08 | Block tagging confirmed against the 4-event May 2026 bundle. All bodies parse cleanly through `walk_body` for events a/c/d. Event-b walks partway and stops at offset 427 (open issue). | +| 2026-05-08 | Earlier "4-channel interleaved s16 LE" claim formally retracted — never validated, produced full-scale ±32K noise on every event because the bytes are encoded, not raw samples. | +| 2026-04-02 | "Frame 7 metadata", "Frame 9 terminator", and `0x0400`-step chunk-counter claims documented as-was; later proved to be artifacts of an over-reading 5A walk (now superseded by §7.8.5–7.8.7). | + +--- + +#### 7.6.2 Noise monitoring / Histogram mode — ✅ CONFIRMED (3-31-26 capture) + +32-byte blocks with the following layout: + +``` +Offset Size Type Description + 0 2 uint16 LE block type: 0x0016=sync, 0x0000=data + 2 2 uint16 LE block counter (ctr) + 4 18 int16 LE × 9 ADC samples +22 10 bytes metadata: [00 01 43 VAR VAR 00 pretrig rectime 00 00] +``` + +- Sync blocks (type=0x0016) appear at the start of each A5 frame; ctr=0 in sync blocks. +- Data blocks (type=0x0000) carry actual sample data. First data block ctr=288 (empirical, + not yet decoded — likely related to a pre-trigger sample offset). +- Metadata fixed bytes: `00 01 43` then 2 variable bytes, then `00 [pretrig] [rectime] 00 00`. + Pretrig byte = 0x1E (30) and rectime byte = 0x0A (10) for the 3-31-26 capture. +- 9 samples per block (int16 LE, NOT big-endian). Noise floor ≈ 9–11 counts. +- **This is a different recording mode** from waveform/blast — the device firmware uses + 32-byte blocks for histogram/noise monitoring and 4-channel continuous for waveform events. + +> ❓ **Open:** The 9-sample-per-block structure does not divide evenly into 4 channels. +> Whether these represent a single channel, all channels in rotation, or downsampled +> aggregates is not yet determined. The first data block ctr=288 vs pretrig=30 is also +> unexplained — possibly counting in units other than sample-sets. + +--- + +--- + +### 7.7 Event Download Protocol — Confirmed from 3-31-26 Capture ✅ + +> **Added 2026-03-31.** All findings confirmed from live bridge capture +> `bridges/captures/3-31-26/raw_bw_20260331_200245.bin` + +> `raw_s3_20260331_200245.bin` (148 BW frames / 147 S3 frames). +> Analysis scripts: `parsers/analyze_3_31_26.py`. + +#### Overview + +Event download uses four SUBs in a key-driven iterator loop. The +"waveform key" is a 4-byte opaque record address that uniquely identifies +one histogram bin or waveform record on the device's internal storage. + +| Step | BW SUB | S3 Response | Purpose | +|---|---|---|---| +| 1 (once) | `1E` — EVENT_HEADER | `E1` | Get the first waveform key | +| 2 | `0A` — WAVEFORM_HEADER | `F5` | Check record type / confirm full bin | +| 3 | `0C` — WAVEFORM_RECORD | `F3` | Download 210-byte record (peaks, project, timestamp) | +| 4 | `1F` — EVENT_ADVANCE | `E0` | Advance iterator, get next key | +| ↑ repeat steps 2–4 until key == `00 00 00 00` | | | | + +**Blastware optimisation (confirmed):** Step 2 (0A) is only called for the +_first_ key. Subsequent keys come from `1F` with token `0xFE` (download +mode), which guarantees they are full records — so Blastware skips 0A and +jumps directly to 0C. Our implementation follows the same pattern. + +--- + +#### 7.7.1 Waveform Key + +The waveform key is a 4-byte opaque record address (`uint32`, likely +a flash sector offset or circular-buffer pointer internal to the S3 DSP). + +- First key: returned by `1E` at `data[11:15]` +- Subsequent keys: returned by `1F` at `data[11:15]` +- Terminator: `00 00 00 00` signals no more events + +Example keys from 3-31-26 capture (one Blastware "event"): +``` +01 11 00 16 ← first key (full record — see §7.7.3 for length disambiguation) +01 11 11 B6 ← intermediate boundary key +01 11 11 F6 ← intermediate boundary key +01 11 12 36 ← next real-event key +00 00 00 00 ← terminator +``` + +> ⚠️ The 3-31-26 capture was the only "events present" capture available at the +> time of original analysis and contained a single event. The "0x30 = full / +> 0x26 = partial" interpretation in earlier drafts was an artifact of that +> single-event capture; the canonical lengths are `0x46` (real event) and `0x2C` +> (boundary), confirmed across 5-1-26 multi-event captures. See §7.7.3 / §7.8.8. + +--- + +#### 7.7.2 Token Byte (SUB 1E / 1F) + +> ✅ **CORRECTED 2026-04-06** — token byte is at **`params[7]`** (not `params[6]`). +> Confirmed from raw params `00 00 00 00 00 00 00 FE 00 00` in both the 3-31-26 +> and 4-3-26 BW TX captures. With the wrong position the device silently ignores +> the token. + +A token byte at **`params[7]`** controls the 1E/1F behaviour: + +| Token | Mode | Behaviour | +|---|---|---| +| `0x00` | Browse | Advance one record across the full event chain (including boundary keys) | +| `0xFE` | Download (arm) | Used in the 5A bulk-stream arming sequence — see §6.1 | + +**Browse vs download is context-dependent:** + +- `count_events()` and the "Download All" pre-walk (§7.8.8) use **browse mode + (token=`0x00`)** to enumerate the full key chain and discriminate real events + from boundaries via SUB 0A's echoed length (§7.7.3). +- `get_events()` uses `0xFE` for the **arm step** between 0A and 0C (REQUIRED + to wake the 5A state machine — see §6.1) and after 1F to arm the bulk stream, + but then uses browse-mode 1F to advance to the next event key after a + successful 5A. + +Calling 1F with `0xFE` cold (without the preceding 0A and 1E-arm) returns the +null sentinel regardless of how many events are stored — an earlier observation +that token=0xFE "returns null" was the result of testing without those +prerequisite steps. + +--- + +#### 7.7.3 Variable DATA_LENGTH for SUB 0A (WAVEFORM_HEADER) + +> ✅ **CORRECTED 2026-05-01** — earlier values `0x30` / `0x26` came from the +> deprecated histogram-only walk. Confirmed values for triggered-event downloads +> are `0x46` / `0x2C` (see §5.1, §7.8.8). + +Unlike all other SUBs, `0A` does NOT have a fixed data length. The length +is echoed in the probe response at `data[5]` (and is also the value the +data-request step sends back as its offset): + +| Length | Meaning | +|---|---| +| `0x46` (70 bytes) | Full triggered-event waveform header — has a real event to download | +| `0x2C` (44 bytes) | Boundary marker / monitor-log partial record — no triggered event | + +Both the probe and data-request frames carry the same key in `params[4..7]`. +`read_waveform_header()` (protocol.py) reads the echoed length from the probe +response and uses it as the data-request offset, then returns +`(raw_data, length)` so callers (`get_events`, `get_monitor_log_entries`, +"Download All" walk) can decide whether to issue a 0C/5A download or just +advance the iterator. + +--- + +#### 7.7.4 Response Data Section Layout + +**All S3 event download responses** share this data section prefix: + +``` +data[0] LENGTH_ECHO — echoes the request DATA_LENGTH byte +data[1..4] 00 00 00 00 — four zero bytes +data[5..8] KEY_ECHO — echoes the 4-byte waveform key from the request +data[9..10] 00 00 — two zero bytes +data[11..] ACTUAL_DATA — real payload starts here +``` + +Actual data lengths: +- `1E` response (`E1`): `data[11:19]` — 8 bytes (`data[11:15]` = key4) +- `0A` probe response (`F5`): `data[4]` = variable length (0x30 or 0x26) +- `0A` data response (`F5`): `data[11:11+length]` — waveform header bytes +- `0C` data response (`F3`): `data[11:11+0xD2]` — 210-byte waveform record +- `1F` response (`E0`): `data[11:15]` = next key4; `data[8]` = token echo + +--- + +#### 7.7.5 Waveform Record Layout (210 bytes, SUB F3 → response F3) + +> ✅ **Updated 2026-04-01** — Full timestamp layout confirmed against Blastware +> event report (BE11529 thump event, "00:28:12 April 1, 2026"). Record type +> encoding corrected (byte[1], not ASCII string search). Peak Vector Sum field +> confirmed at fixed offset 87. + +The 210-byte record (`data_rsp.data[11:11+0xD2]`) contains: + +**Header / Timestamp** — two layouts exist; **detect via `byte[0]`** of the record header: + +- `byte[0] != 0x10` → **9-byte format** (sub_code=0x10, single-shot waveform) +- `byte[0] == 0x10` → **10-byte format** (sub_code=0x03, continuous waveform; same + layout as partial monitor-log records — see §7.10 / `_decode_0a_partial_header` in client.py) + +The auto-detect logic lives in `_decode_waveform_record_into` (client.py) and in +`_decode_0a_partial_header` for monitor log entries. + +**9-byte format — sub_code = 0x10 (Waveform single-shot) ✅ CONFIRMED 2026-04-01:** +``` +byte[0]: day (uint8) +byte[1]: sub_code 0x10 = Waveform single-shot +byte[2]: month (uint8) +bytes[3–4]: year (uint16 big-endian) +byte[5]: unknown (0x00 in all observed samples ❓) +byte[6]: hour (uint8) +byte[7]: minute (uint8) +byte[8]: second (uint8) +``` + +Thump event raw bytes (2026-04-01 00:28:12, single-shot): +``` +01 10 04 07 ea 00 00 1c 0c +↑ ↑ ↑ ↑──↑ ↑ ↑ ↑ ↑ +d=1 sub m=4 y=2026 ? h=0 m=28 s=12 +``` + +**10-byte format — sub_code = 0x03 (Waveform continuous) ✅ CONFIRMED 2026-04-03:** + +One byte wider than the single-shot layout. All subsequent fields shift +1. + +``` +byte[0]: 0x10 (marker byte; how the decoder distinguishes the two layouts) +byte[1]: day (uint8) +byte[2]: 0x10 (marker; reflects the wire-encoded sub_code=0x03) +byte[3]: month (uint8) +bytes[4–5]: year (uint16 big-endian) +byte[6]: unknown (0x00 ❓) +byte[7]: hour (uint8) +byte[8]: minute (uint8) +byte[9]: second (uint8) +``` + +Continuous event raw bytes (2026-04-03 15:20:17): +``` +10 03 10 04 07 ea 00 0f 14 11 +``` + +Cross-referenced against the `.MLG` file for a single-shot event, which stores an +8-byte timestamp at two offsets (trigger time and end time): +``` +MLG format: [day:1][month:1][year:2 LE][?:1][hour:1][min:1][sec:1] +01 04 ea 07 00 00 1c 0c → trigger at April 1, 2026 00:28:12 +01 04 ea 07 00 00 1c 0f → end time April 1, 2026 00:28:15 (3.0 s record time ✅) +``` + +**Record type** — encoded in `byte[1]` (single-shot) or `byte[0]/byte[2]` markers +(continuous), NOT as an ASCII string: +- `0x10` at `byte[1]` → Waveform single-shot ✅ +- `0x10` at `byte[0]` + `0x10` at `byte[2]` → Waveform continuous ✅ +- histogram sub_code: not yet confirmed in a 0C response (the monitor-log + 10-byte timestamp uses the same continuous-mode marker) + +**Peak particle velocity floats** (✅ CONFIRMED 2026-03-31, re-confirmed 2026-04-01): + +Channel labels `"Tran"`, `"Vert"`, `"Long"`, `"MicL"` are embedded as +ASCII strings at variable offsets within the record. The PPV float for +each channel is at `label_offset + 6` (IEEE 754 big-endian float32). + +The floats are **NOT 4-byte aligned** — Tran, Long, and MicL all fall at +non-aligned offsets. The previous heuristic step-4 scanner missed all three. + +Confirmed offsets from thump event (2026-04-01, cross-referenced vs Blastware): +``` +"Tran" at offset 99 → float at 105 = 0x3ED70A2D = 0.420 in/s ✅ Blastware: 0.420 +"Vert" at offset 114 → float at 120 = 0x4077AE01 = 3.870 in/s ✅ Blastware: 3.870 +"Long" at offset 129 → float at 135 = 0x3EFD7090 = 0.495 in/s ✅ Blastware: 0.495 +"MicL" at offset 144 → float at 150 = 0x3985114E = 0.000254 psi +``` + +Channel labels are separated by inner-frame bytes `10 03` (DLE ETX), +preserved as literal data by `S3FrameParser`. + +**Peak Vector Sum** (✅ CONFIRMED 2026-04-01; offset corrected 2026-04-03): + +``` +Location: tran_pos − 12 (label-relative; IEEE 754 big-endian float32) + = √(Tran² + Vert² + Long²) at the sample instant of maximum + combined geo motion + NOT the vector sum of the three per-channel peaks (those may + occur at different sample times) +``` + +> ⚠️ **Do NOT use fixed offset 87.** That value only happens to be correct for +> `sub_code = 0x10` (single-shot) records, where the 9-byte timestamp leaves the +> peak vector sum at byte 87. For `sub_code = 0x03` (continuous) records, the +> 10-byte timestamp pushes everything one byte later — `tran_pos − 12` is the +> canonical label-relative location and works for both record types. + +``` +Thump event (single-shot, tran_pos=99): + Value at tran_pos − 12 = byte 87 = 0x4079F6C5 = 3.906 in/s + ✅ matches Blastware "Peak Vector Sum: 3.906 in/s" +Near-ambient (single-shot): 0x3C75C28F = 0.015 in/s +``` + +**Project strings** — ASCII label-value pairs (search for label, read null-terminated value): +``` +"Project:" → project description (in 0C record ✅, also mirrored in metadata pages) +"Client:" → client name (in SUB 5A metadata pages ✅ — NOT in 0C) +"User Name:" → operator / user (in SUB 5A metadata pages ✅ — NOT in 0C) +"Seis Loc:" → sensor location (in SUB 5A metadata pages ✅ — NOT in 0C) +"Extended Notes"→ notes field (in SUB 5A metadata pages ✅) +``` + +> ✅ **UPDATED 2026-05-05:** `Client:`, `User Name:`, and `Seis Loc:` come from the +> dedicated **SUB 5A metadata pages at counter `0x1002` and `0x1004`** — see §7.8.7. +> They are NOT present in the 210-byte SUB 0C waveform record. +> +> An earlier draft of this doc claimed they came from "A5 frame 7" of the bulk waveform +> stream — that was an artifact of the deprecated `0x0400`-step walk where the broken +> chunk counter formula happened to land sample-chunk fi=7 on top of the 0x1002 metadata +> page. Under the corrected v0.14.0+ walk (§7.8.5), sample chunks at `0x1000` / `0x1200` +> contain ordinary waveform data, and the metadata pages are read separately. +> +> The strings reflect the compliance setup that was active when the *monitoring session* +> first started (not per-event). `get_events()` reads the metadata pages once at the start +> of the SFM session and the decoded values are stamped onto every event in that session. + +--- + +#### 7.7.6 Complete Download Loop (Python pseudocode) + +```python +key4, _ = proto.read_event_first() # SUB 1E +if key4 == b'\x00\x00\x00\x00': + return [] # no events + +events = [] +is_first = True + +while key4 != b'\x00\x00\x00\x00': + if is_first: + _header, rec_len = proto.read_waveform_header(key4) # SUB 0A + is_first = False + if rec_len < 0x30: + key4 = proto.advance_event() # skip partial first bin + continue + + record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) + events.append(decode(record)) + + key4 = proto.advance_event() # SUB 1F (token=0xFE) + +return events +``` + +--- + +### 7.7.7 Updated Download Loop with SUB 5A Metadata + +> ⛔ **The loop in this subsection is DEPRECATED — it uses the broken `stop_after_metadata=True` +> hack and the wrong sequence ordering.** See §7.8.5–§7.8.8 for the corrected protocol. +> The pseudocode below is preserved as historical record only. + +```python +key4, _ = proto.read_event_first() # SUB 1E +if key4 == b'\x00\x00\x00\x00': + return [] + +events = [] +is_first = True + +while key4 != b'\x00\x00\x00\x00': + if is_first: + _header, rec_len = proto.read_waveform_header(key4) # SUB 0A + is_first = False + if rec_len < 0x30: + key4 = proto.advance_event() + continue + + record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) + event = decode(record) + + a5_data = proto.read_bulk_waveform_stream( # SUB 5A → A5 frames + key4, stop_after_metadata=True) + client._decode_a5_metadata_into(a5_data, event) # overwrites project_info + + events.append(event) + key4 = proto.advance_event() # SUB 1F (token=0xFE) + +return events +``` + +--- + +### 7.8 SUB 5A — Bulk Waveform Stream (event-time metadata) + +> ✅ **§7.8.1 (frame format) — added 2026-04-02; v0.14.3 partial DLE stuffing finalized 2026-05-05.** +> Frame format confirmed by reproducing Blastware wire bytes byte-for-byte across the 1-2-26 +> capture (10 frames) and the 5-1-26 bwcap3sec capture (17 frames, all match including the +> DLE-stuffed `10 10 00` for counter=0x1000). + +SUB 5A initiates a bulk transfer of the raw sample data for a stored event. The response is +a sequence of A5 frames. Project-info ASCII strings (`Project:`, `Client:`, `User Name:`, +`Seis Loc:`, `Extended Notes`) live in the dedicated metadata pages at counter `0x1002` +and `0x1004` (see §7.8.7), not in the sample-chunk stream. + +**For the corrected protocol read in order:** +- §7.8.1 — frame format (raw `offset_hi`, DLE-aware checksum, partial DLE stuffing of params) +- §7.8.5 — chunk addressing (probe → metadata pages → samples → TERM, all bounded by `end_offset`) +- §7.8.6 — TERM frame formula +- §7.8.7 — fixed metadata pages 0x1002 / 0x1004 +- §7.8.8 — multi-event "Download All" sequence + +§7.8.2–§7.8.4 are retained as historical record of earlier (incorrect) understandings — +do not implement against them. + +#### 7.8.1 Frame Format + +SUB 5A uses a **non-standard frame layout** that differs from all other BW→S3 write commands. + +``` +[ACK][STX][10][10][00][5A][00][offset_hi][offset_lo][params...][chk][ETX] + 41 02 10 10 00 5A 00 ^^raw^^ ^^raw^^ ^^stuffed^^ +``` + +Three critical differences from `build_bw_frame`: + +1. **`offset_hi` is sent raw, not DLE-stuffed.** When `offset_hi = 0x10`, the wire carries + a bare `0x10` — NOT the stuffed `10 10` that `build_bw_frame` would produce. The device + ignores frames where this byte is incorrectly stuffed. + +2. **DLE-aware checksum.** Walking the full frame byte sequence: when a `10 XX` pair is seen, + only `XX` is added to the running sum; lone bytes are added normally. + +3. **Partial DLE stuffing of `0x10` bytes in the params region** (CONFIRMED 2026-05-05). + The device's de-stuffing rule for the params region is: + + - `10 10` → de-stuffs to `10` + - `10 02 / 03 / 04` → kept literal (these are inner-frame markers) + - `10 X` for other X → de-stuffs to just `X` (drops the leading `0x10`) + + Therefore any `0x10` byte in the *logical* params that is followed by a byte NOT in + `{0x02, 0x03, 0x04, 0x10}` MUST be doubled on the wire (`10 X` → `10 10 X`) so the + device's de-stuffer reproduces the original `10 X` pair. This applies most commonly + to counters with `0x10` in the high byte (e.g. counter=`0x1000` produces logical + params bytes `... 10 00 ...`, which BW encodes on the wire as `... 10 10 00 ...`). + Without this stuffing the device interprets counter=`0x1000` as `0x0000` and returns + the probe response (= a copy of the file header + STRT record); that STRT block then + ends up embedded in the assembled file body and Blastware refuses to open the file. + + `0x10` bytes in `offset_hi` are still written RAW per (1) above — only the params + region has this stuffing requirement. Metadata-page params for counter `0x1002` / + `0x1004` survive without stuffing because `10 02` / `10 04` fall in the "kept literal" + carve-out. + + Verified against BW 5-1-26 bwcap3sec frame 20: params logical bytes + `00 01 11 10 00 00 00 00 00 00 00` (counter=0x1000) are encoded on the wire as + `00 01 11 10 10 00 00 00 00 00 00 00` (12 wire bytes for 11 logical bytes). + +#### 7.8.2 Request Sequence — DEPRECATED 2026-05-01 (see §7.8.5–§7.8.7 for the corrected protocol) + +> ⛔ **The 0x0400-step / max(key4[2:4], 0x0400) formula in this section is WRONG.** Five new +> BW MITM captures (4-27-26 + 5-1-26) prove the actual chunk increment is **0x0200**, the +> chunk loop is bounded by `end_offset` from the STRT record (not by chunk count or by a +> device-side timeout), and the TERM frame's `offset_word=0x005A` magic is incorrect — the +> real TERM offset_word is computed from `end_offset` and the last chunk address. Under the +> deprecated formula SFM over-reads roughly 5× past the actual event end into post-event +> circular-buffer garbage, corrupting reconstructed Blastware files for any waveform ≥ 2 sec. +> +> The whole "stop_after_metadata + one extra chunk + 0e 08 footer" workaround in this +> section was compensating for the missing end_offset bound. It is obsoleted by the +> STRT-bounded walk in §7.8.5. +> +> **Read this section for historical context only.** For the correct protocol, jump to: +> - §7.8.5 — chunk addressing and the STRT end_offset +> - §7.8.6 — TERM frame formula +> - §7.8.7 — fixed metadata pages 0x1002 and 0x1004 + +| Frame | offset_word | counter | params | Purpose | +|---|---|---|---|---| +| Probe | `0x1004` | `0x0000` | 10 bytes (`bulk_waveform_params(0)`) | Initiate transfer | +| Chunk 1 | `0x1004` | `max(key4[2:4], 0x0400)` | 11 bytes | First data chunk | +| Chunk 2 | `0x1004` | `max(key4[2:4], 0x0400) + 0x0400` | 11 bytes | Second chunk | +| Chunk N | `0x1004` | `max(key4[2:4], 0x0400) + (N-1) * 0x0400` | 11 bytes | Nth chunk | +| … | … | … | … | … | +| Termination | `0x005A` | `max(key4[2:4], 0x0400) + N * 0x0400` | 10 bytes | End transfer | + +> Historical correction notes (left in place to deter re-derivation of the same wrong formula): +> the table above was the result of three iterative "corrections" between 2026-04-06 and +> 2026-04-26 that progressively narrowed in on the wrong answer because every test was on +> events with `key4[2:4]=0` and the device responds to whatever counter you ask for. The +> 5-1-26 captures with a non-zero start_key event (`01112238`) finally exposed the bug. + +The `stop_after_metadata=True` flag (deprecated as a primary loop-exit) scanned for +`b"Project:"` in the chunk stream because the metadata strings happened to be reachable +when the broken 0x0400-step walk passed the global metadata pages at 0x1002/0x1004. Under +the corrected walk, those strings come from explicit reads at counter=0x1002 and 0x1004, +not from the sample-chunk stream — see §7.8.7. + +#### 7.8.3 A5 Frame Layout — DEPRECATED 2026-05-01 + +> ⛔ **The "Frame 7 carries the compliance text block" claim below is WRONG.** It was +> an artifact of the deprecated `0x0400`-step walk where the broken counter formula +> happened to land sample-chunk fi=7 on top of the 0x1002 metadata page in flash. +> Under the corrected v0.14.0+ walk (§7.8.5), Frame 7 of the sample-chunk sequence is +> just sample-chunk #5 (counter=0x1000), and contains either ordinary waveform data or — +> critically when DLE-stuffing of params is wrong (§7.8.1.3) — a duplicate file header + +> STRT block when the device misinterprets counter=0x1000 as 0x0000. See §7.8.7 for the +> actual source of these strings. + +Historical claim (NOT TO BE IMPLEMENTED): each A5 response frame contains a chunk of raw +bulk data; Frame 7 of the stream carries the compliance text block with all project-info +label-value pairs: + +``` +"Project:" → null-terminated project name +"Client:" → null-terminated client name +"User Name:" → null-terminated operator name +"Seis Loc:" → null-terminated sensor location +"Extended Notes" → null-terminated notes +``` + +All five fields do reflect the **setup at event-record time**, not the current device +config. But the source is the metadata pages (§7.8.7), not "Frame 7" of the sample +stream. + +#### 7.8.4 End-of-Stream Behaviour and Chunk Timing — REINTERPRETED 2026-05-01 + +> The "1 raw byte then silence" pattern documented below was originally interpreted as +> "the device's natural end-of-event signal." The 5-1-26 captures show this is actually +> the device's response when the requester has walked **past** the addressable buffer +> region (i.e. ~5× past the actual event end under the deprecated 0x0400-step walk). +> Under the corrected STRT-bounded walk (§7.8.5), the stream ends cleanly with the TERM +> frame's response — no timeout, no 1-byte teaser. The fallback below remains useful as +> defensive handling for malformed events but should not be the primary loop-exit. + +**Defensive fallback handling in `read_bulk_waveform_stream`:** +``` +TimeoutError caught (rare under corrected walk): + if bytes_fed > 0 AND frames already collected: + → graceful end-of-stream; break loop; proceed to termination frame + else (bytes_fed == 0, no prior frames): + → genuine transport failure; re-raise +``` + +**Chunk timing (BE11529, 1024 sps, TCP/cellular) — total A5 frames per event:** + +| Metric | Observed value | +|---|---| +| Chunk response time | ~1 s per chunk | +| 2-sec event 1 (corrected walk) | ~15 frames (probe + 2 metadata pages + ~12 sample chunks + TERM) | +| 3-sec event 1 (corrected walk) | 16 frames (probe + 2 metadata pages + 13 sample chunks + TERM) | +| 2-sec continuation event (corrected walk) | 16 frames (~15 sample chunks + TERM; no metadata reread) | +| 3-sec continuation event (corrected walk) | ~15 frames (~14 sample chunks + TERM) | +| Same event under deprecated 0x0400 walk | ~37 frames (over-reads ~5× into post-event garbage) | +| Data per chunk (corrected, 0x0200 size) | ~540–575 bytes wire (= 0x0200 payload + framing) | +| Data per chunk (deprecated 0x0400 step) | 1,036–1,123 bytes wire (= 0x0400 payload + framing) | +| Safe recv timeout per chunk | **10 s** (10× typical) | +| Default transport timeout | 120 s → ~2-min stall at end-of-stream | + +**ADC count-to-physical conversion — ✅ CONFIRMED 2026-04-17:** + +Raw samples are signed 16-bit integers (−32,768 to +32,767). Source: Interface Handbook §4.5. + +**CONFIRMED 2026-04-17** — The `max_range_geo` field (float32 = 6.206053, bytes `40 C6 97 FD`) is the **ADC-to-velocity scale factor** (inverse sensitivity, (in/s)/V) for the standard Instantel geophone, confirmed from Interface Handbook §4.5. The correct conversion formula is: + +``` +PPV (in/s) = ADC_voltage (V) × 6.206053 + = counts × (1.61133 / 32767) × 6.206053 + = counts × 4.982e-5 (in/s per count at full scale) +``` + +where `geo_range = 1.61133 V × 6.206053 = 10.000 in/s` is the Normal (Gain=1) full-scale range. The earlier ~9× overread was caused by mistakenly using 6.206053 as the range directly — it is actually the scale factor, and the range itself is `ADC_fullscale × scale_factor = 1.61133 × 6.206053 = 10.000 in/s`. Mic channel uses psi units with its own range (still unresolved). + +**Decoder note — fi==9 hardcoded skip (FIXED 2026-04-06):** + +`_decode_a5_waveform()` previously had `elif fi == 9: continue` — a leftover from +the original 9-frame blast capture where frame 9 was assumed to be the device +terminator. Removed. Under the v0.14.0+ STRT-bounded walk the chunk loop never +encounters a "terminator frame index" anyway — it stops at `end_offset` +calculated from the STRT record (§7.8.5) and the TERM frame is sent explicitly +(§7.8.6). For other decoders, terminator detection should use +`frame.page_key == 0x0000`, not a hardcoded frame index. + +#### 7.8.5 Chunk addressing and the STRT end_offset (NEW 2026-05-01) ✅ + +> ✅ Confirmed across 3 events (4-27-26 + 5-1-26 captures). + +`params[0]` is always `0x00`. `params[1:5]` is a 4-byte absolute device flash-buffer +address — equivalently, "the key of the page being requested." The device returns 0x0200 +(= 512) bytes starting at that address. Increments between consecutive sample chunks are +**0x0200, NOT 0x0400** (the previous 0x0400 figure was a Blastware-side artifact / our +implementation's bug — see §7.8.2). + +##### STRT record (data layout in the first A5 response) + +The first A5 response (the probe response, or the first chunk for continuation events) +contains a **STRT record** at byte offset 17 of `data`: + +``` +data[ 0:14] echoes request: [chunk_size_hi=0x02 / 0x04 ...] [00] [01 11] [counter_hi counter_lo] [00 × 8] [00 12] +data[14:17] 10 03 00 ← inner DLE+ETX frame separator (preserved literally) +data[17:21] "STRT" ← magic +data[21:23] ff fe ← sentinel +data[23:27] end_key ← 4-byte key of where this event ENDS +data[27:31] start_key ← 4-byte key of where this event STARTS +data[31:33] uint16 BE ← ?? sample count or byte count, varies (not yet decoded) +data[33:35] uint16 BE ← ?? +data[35] 0x46 ← record type marker (waveform full record) +data[36:] additional pointers / first sample bytes — content varies by event +``` + +`end_offset = (end_key[2] << 8) | end_key[3]` is **the authoritative event-end pointer**. +Use it to bound the chunk loop and to compute the TERM frame. + +##### Chunk pattern by event location in buffer + +**Event 1 / start_key[2:4] = 0x0000** (first event after erase or wrap): + +``` +1. Probe at counter = 0x0000 (params[1:5] = full key) +2. Read fixed metadata pages counter = 0x1002, then 0x1004 +3. Walk sample chunks counter = 0x0600, 0x0800, …, by 0x0200, + up to but not including end_offset & 0xFE00 +4. TERM (see §7.8.6) +``` + +The range `[0x0046, 0x0600)` is skipped — likely some pre-event firmware-reserved area for +the first slot in a freshly-erased buffer. Harmless to skip; BW does the same. + +**Event 2+ / start_key[2:4] != 0x0000** (continuation events in a populated buffer): + +``` +1. First chunk at counter = start_key[2:4] ← acts as both probe and first + sample chunk; response carries STRT at byte 17 +2. Walk sample chunks counter += 0x0200 each +3. TERM +``` + +**`start_key` here is the off=0x46 WAVEHDR record key returned by 1F** (e.g. `01112238`), +NOT the off=0x2C boundary key that immediately precedes it. An earlier draft of this +spec described event-N as "probe at start + 0x46" — that formula was correct only if +"start" meant the boundary key (0x21F2 in the 5-1-26 event 2 case). In the iteration +walk used by SFM and BW, `cur_key` passed into the 5A flow is always the off=0x46 key, +so the probe counter equals `cur_key[2:4]` with no extra offset. Adding +0x46 places +the probe one WAVEHDR past the actual event start, the response no longer contains +STRT at byte 17, and the chunk loop falls back to the `max_chunks` cap. + +Confirmed: +- 5-1-26 "copy 2nd address" BW capture: probe counter=0x2238 with key=01112238; A5[0] + has STRT@17 with end_offset=0x417E. +- 5-4-26 BW 2-sec event capture: same probe counter=0x2238, same end_offset=0x417E. + +**No metadata-page reads.** Pages 0x1002/0x1004 are session-global and were already read +during event 1 in the same Blastware session. In SFM, treat metadata pages as a once- +per-`MiniMateClient.connect()` (or once-per-call-home) read, not per-event. + +##### Verified end_offset values + +| Capture | start_key | end_key | end_offset | event size | sample-chunk start | +|---|---|---|---|---|---| +| 4-27-26 "open 2sec" / "copy event to disk" | `01110000` | `01111ABE` | `0x1ABE` | 6,846 B | 0x0600 (event-1 case) | +| 5-1-26 "copy 3sec" / Download All event 1 | `01110000` | `011121F2` | `0x21F2` | 8,690 B | 0x0600 (event-1 case) | +| 5-1-26 "copy 2nd address" / DA event 2 | `01112238` (= 1F result) | `0111417E` | `0x417E`, span 0x1F8C = 8,076 B | 0x2238 (= cur_key[2:4]) | +| 5-4-26 BW 2-sec event | `01112238` | `0111417E` | `0x417E` | 0x2238 (= cur_key[2:4]) | + +#### 7.8.6 TERM Frame Formula (NEW 2026-05-01) ✅ + +> ✅ Confirmed across 3 events. Replaces the deprecated `offset_word=0x005A` / `params[2] = key4[2]` formula in §7.8.2. + +The TERM frame fetches the partial last chunk and the file footer. Its response payload +contains the bytes between the last full 0x0200-aligned chunk and `end_offset` — typically +20–520 B — and is **required for reconstructing the Blastware waveform file**. Append the +TERM response data to the chunk stream like any other A5 frame. + +``` +last_chunk_counter = address of last full 0x0200-byte chunk read +next_boundary = last_chunk_counter + 0x0200 +TERM offset_word = end_offset - next_boundary +TERM params[0] = key[0] (= 0x01 on every observed device) +TERM params[1] = key[1] (= 0x11) +TERM params[2] = (next_boundary >> 8) & 0xFF +TERM params[3] = next_boundary & 0xFF +TERM params[4:10] = zeros ← 10-byte params (not 11) + +Frame = build_5a_frame(offset_word, params) +``` + +The device receives `requested_address = (params[2] << 8) | offset_word` (where offset_word +contains both `offset_hi` and `offset_lo` of the 5A frame, with the high bit of offset_hi +being effectively `bit 0 of (end_offset >> 8)`). It reconstructs `end_offset` and replies +with `(end_offset - next_boundary)` bytes of waveform tail starting at `next_boundary`. + +##### Verification + +| Event | end_offset | last chunk | next_boundary | TERM offset_word | TERM params[2:4] | TERM response size | +|---|---|---|---|---|---|---| +| 2-sec | `0x1ABE` | `0x1800` | `0x1A00` | `0x00BE` ✓ | `1A 00` ✓ | 208 B | +| 3-sec | `0x21F2` | `0x1E00` | `0x2000` | `0x01F2` ✓ | `20 00` ✓ | 520 B | +| Event-2 | `0x417E` | `0x3E38` | `0x4038` | `0x0146` ✓ | `40 38` ✓ | (not measured directly; same pattern) | + +Equivalent way to write the formula: +- `offset_word = end_offset & 0x01FF` — low 9 bits of end_offset +- `params[2:4] = (end_offset & 0xFE00) BE` — high 7 bits of end_offset, low byte zeroed + +(The two forms are arithmetically identical to `end_offset - next_boundary` and +`next_boundary` because `next_boundary = end_offset & 0xFE00` whenever the chunk loop +stopped at the last full 0x0200 boundary below end_offset.) + +#### 7.8.7 Fixed Metadata Pages 0x1002 / 0x1004 (NEW 2026-05-01) 🔶 + +> 🔶 Inferred — observed in BW captures but page contents not yet byte-decoded. + +Two chunk addresses are **GLOBAL** device/session metadata, not event-specific: + +- `counter = 0x1002` — first metadata page +- `counter = 0x1004` — second metadata page + +These are at fixed absolute addresses in the device's flash buffer. They contain the +session-start compliance-setup ASCII strings — **Project**, **Client**, **User Name**, +**Seis Loc**, **Extended Notes** — that under the deprecated 0x0400-step walk used to be +discoverable in the sample-chunk stream as "A5 frame 7" content. Under the corrected +0x0200-step walk these strings come exclusively from the dedicated metadata-page reads, +not from sample chunks. + +##### Caching strategy + +BW reads them ONCE per Blastware session, during event 1's download, and caches them. +For SFM: +- Read once per `MiniMateClient.connect()` / once per call-home session. +- Subsequent events in the same session don't need to re-fetch them. +- Their content does not change while iterating events. They DO change when the user + applies a new compliance setup (SUB 71 write) — invalidate the cache then. + +##### Content layout — string-search decoder in place + +The full byte-for-byte structural layout of pages 0x1002 and 0x1004 has not been +mapped, but `_decode_a5_metadata_into` (`minimateplus/client.py`) successfully +extracts the user-facing strings via label scans: + +``` +b"Project:" → project description +b"Client:" → client name +b"User Name:" → operator +b"Seis Loc:" → sensor location +b"Extended Notes" → notes +``` + +This works across all observed captures (4-27-26, 5-1-26, 5-4-26). A future +project could dump the structural layout if additional session-global fields +need to be extracted — but the strings already decode correctly. + +#### 7.8.8 "Download All" Sequence (NEW 2026-05-01) ✅ + +> ✅ Confirmed from 5-1-26 "Download All" capture (`raw_*_171216_download_all_2events.bin`). + +Before any 5A traffic, BW's "Download All" pre-walks the entire event chain to map keys +and event boundaries: + +``` +SERIAL × 2 → CHCFG → EVT_KEY (1E, all-zero) → key0 + → WAVEHDR (0A, key0) → off=0x46 (real event start) + → EVT_NEXT (1F, all-zero) → key1 + → WAVEHDR (0A, key1) → off=0x2C (boundary) + → EVT_NEXT → key2 + → WAVEHDR (0A, key2) → off=0x46 (real event start) + → EVT_NEXT → key3 + → WAVEHDR (0A, key3) → off=0x2C (boundary) + → EVT_NEXT → null sentinel +``` + +The DATA_LENGTH at `data_rsp.data[5]` (echoed BW offset for the data fetch step) +disambiguates real events from boundary markers: + +| WAVEHDR offset | Meaning | +|---|---| +| `0x46` (= 70) | Real event start key — this key has event data behind it | +| `0x2C` (= 44) | Boundary marker — this key is the END of the previous event AND the start of the empty/header gap before the next event | + +Pairs: each real event spans `[real_key, next_real_key)` in the buffer. In the example +above: event 1 = `[01110000, 011121F2)`, event 2 = `[01112238, 0111417E)`. Note that the +"end of event 1" key (`011121F2`) is also the "boundary key" that comes BEFORE event 2's +real start key (`01112238`) — they differ by exactly 0x46 bytes (the event header size). + +After the pre-walk completes, BW downloads each `0x46`-keyed event in turn using the 5A +bulk stream protocol from §7.8.5. Use the `0x46` keys, not the `0x2C` keys, as input to +`read_bulk_waveform_stream`. + +--- + +## 7.9 Compliance Config Field Inventory (Blastware UI, 2026-04-08) ✅ + +Fields visible in the Blastware "Compliance Setup" dialog. ✅ = byte offset confirmed in code. ❓ = not yet located in raw bytes. + +### Recording Setup tab + +| Field | Values / Type | Status | +|---|---|---| +| Recording Mode | Single Shot (`0x00`) / Continuous (`0x01`) / Histogram (`0x03`) / Histogram+Continuous (`0x04`) | ✅ `recording_mode` — uint8 at **anchor − 8** (SAME offset in E5 read and SUB 71 write, using 6-byte anchor `\xbe\x80\x00\x00\x00\x00`) — confirmed 2026-04-21 | +| Record Stop Mode | Fixed Record Time / Auto / Manual Stop | ❓ Hint: `data[40]` in E5 sf1 changed `01 7F` → `00 00` alongside Continuous → Single Shot; may be related but unconfirmed independently | +| Sample Rate | Standard 1024 / Fast 2048 / Faster 4096 sps | ✅ `sample_rate` — uint16 BE at **anchor − 6** | +| Record Time | float, seconds (3, 5, 8, 10, 13…) | ✅ `record_time` — float32 BE at **anchor + 6** | +| Histogram Interval | `2s / 5s / 15s / 1m / 5m / 15m` (uint16 BE seconds; mode-gated to Histogram / Histogram+Continuous) | ✅ `histogram_interval_sec` — uint16 BE at **anchor − 4**, same in read and write — confirmed 2026-04-20 | +| Storage Mode | Save All Data / Save Triggered | ❓ | +| Geophone Type | Standard Triaxial / 4.5 Hz Geophone | ❓ | +| Geophone — Enable all | bool | ❓ | +| Geophone — Trigger Source | bool | ❓ | +| Chan 1-3 Trigger Level | float, in/s | ✅ `trigger_level_geo` | +| Chan 1-3 Maximum Range (range selector) | Normal 10.000 / 1.25 in/s | ✅ `geo_range` uint8 — **CONFIRMED 2026-04-20.** Offset = Tran+33 (same in E5 read and SUB 71 write — 2126-byte buffer is round-tripped verbatim). `0x00`=Normal 10 in/s, `0x01`=Sensitive 1.25 in/s. Applied to Tran/Vert/Long. **`Tran+20` is NOT this field** (constant 0x01 on all captures). | +| Chan 1-3 ADC Scale Factor | 6.206053 (in/s)/V | ✅ `geo_adc_scale` float32 — **CONFIRMED 2026-04-17.** Offset = Tran+28 (same in E5 read and SUB 71 write). Inverse sensitivity = 1/0.161133. Interface Handbook §4.5: 1.61133 V × 6.206053 = 10.000 in/s. Hardware constant — do NOT write. | +| Microphone — Enable all | bool | ❓ | +| Microphone — Trigger Source | bool | ❓ | +| Chan 4 Trigger Level | float, dB or psi | ❓ | + +### Notes tab + +| Field | Values / Type | Status | +|---|---|---| +| Enable User Notes | bool | ❓ | +| Project | ASCII string | ✅ (sourced from SUB 5A metadata pages at counter `0x1002` / `0x1004` — see §7.8.7) | +| Client | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| User Name | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| Seis Loc | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| Enable Extended Notes | bool | ❓ | +| Extended Notes | ASCII text | ❓ | +| Extended Notes Title | ASCII string | ❓ | +| Enable Job Number | bool | ❓ | +| Job Number | int | ❓ | +| Enable Scaled Distance | bool | ❓ | +| Distance from Blast | float | ❓ | +| Charge Weight | float | ❓ | + +### Special Setups tab + +| Field | Values / Type | Status | +|---|---|---| +| Unit Timer Mode | Off / On | ❓ | +| Start Date/Time | date+time | ❓ | +| Stop Date/Time | date+time | ❓ | +| Self Check Mode | Off / On | ❓ | +| Self Check Time | HH:MM | ❓ | +| **Sensor Check** | **Before monitoring / After each event / Disabled** | ❓ not yet located | +| Measurement Units | Imperial / Metric | ❓ | +| Show Mic units in dB | bool | ❓ | +| Time Format | 24 Hour / 12 Hour (AM/PM) | ❓ | +| Backlight on Time | int, seconds (0–255) | ✅ event index block +75 | +| Power Saving Timeout | int, minutes | ✅ event index block +83 | +| Monitoring LCD Cycle | int | ✅ event index block +84:86 (uint16 BE) | +| Set unit time with setup | bool | ❓ | + +**Note on Sensor Check:** The dropdown has three states — "Before monitoring", "After each event", "Disabled". The user's unit always runs "Before monitoring", so no enable/disable diff capture has been done yet. Finding this byte requires a capture with Disabled vs Before-monitoring with all other settings held constant. + +--- + +## 7.10 SUB 0x0E — Channel Sensor Data & SUB 0x98 — Trigger Test ✅ 2026-04-08 + +Both confirmed from 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). + +### SUB 0x0E — Channel Sensor Data + +Standard two-step read. Data length: **0x0A (10 bytes)** per channel. + +**Request params:** Channel selector in `params[6:8]` (bytes 6 and 7 of the 10-byte params field). + +| `params[6:8]` | Channel | +|---|---| +| `00 00` | Channel 0 (Transverse) | +| `00 01` | Channel 1 (Vertical) | +| `10 02` | Channel 2 (Longitudinal) — note `0x10` in params[6] | +| `00 03` | Channel 3 | +| `10 04` | Channel 4 — note `0x10` in params[6] | +| `00 05` | Channel 5 | +| `00 06` | Channel 6 | +| `00 07` | Channel 7 | + +Response SUB = 0xFF − 0x0E = **0xF1**. + +**Response data (10 bytes at section = data[11:]):** + +The data response payload for each channel is 10 bytes. From the sensor-check S3 capture, +channels 0 and 1 have non-zero data; channels 5–7 are all-zero (no sensors connected to those channels). Full byte-level field mapping NOT YET done — data includes overswing ratio, frequency, and amplitude per the Blastware "Unit Channel Test" dialog columns. + +Example (channel 0, first pass): +``` +data[11:] = 00 01 00 00 4A 00 25 10 02 0A (17 bytes including probe + data frames combined) +``` + +Probe frame response confirms data length in page bytes; data frame carries the 10-byte channel reading. + +**Blastware "Unit Channel Test" sequence (confirmed 4-8-26/sensor-check):** + +``` +SESSION_RESET + POLL × 3 (startup — SESSION_RESET required for monitoring unit) +SUB 0x08 (event index read) +POLL × 8 (Blastware polls while waiting; unit may be in sensor check during this window) +SUB 0x15 (serial number, data length 0x0A) +SUB 0x01 (device info, data length 0x98) +SUB 0x08 (event index again) +SUB 0x01 (device info again) +SUB 0x0E × 8 channels (pass 1 — channels 0–7, probe+data each) + [~40 second gap if unit is performing on-device sensor check] +SUB 0x0E × 8 channels (pass 2 — same channels, fresh ADC readings) +SUB 0x98 × 2 (trigger test) +``` + +### SUB 0x98 — Trigger Test + +Single probe frame only. No data step. + +**Request format:** `params[0] = 0xFF` (all other param bytes = 0x00). Sent as a single frame (probe step only, no data step). + +Response SUB = 0xFF − 0x98 = **0x67**. Response is a standard 17-byte zero-data S3 frame. + +Wire bytes for request (confirmed frame 52 of 4-8-26 BW capture): +``` +41 02 10 10 00 98 FF 00 00 00 00 00 00 00 00 00 00 00 00 A7 03 +``` + +Blastware sends SUB 0x98 twice per comms-check cycle. + +### SUB 0x01 — Device Info Block ❓ + +Observed in Blastware comms-check init sequence (before 0x0E channel reads). Standard two-step read with data length 0x98 (152 bytes). + +**Response SUB = 0xFE** (= 0xFF − 0x01 = 0xFE). + +⚠️ **Naming collision:** The existing SUB 0xFE (Full Config Read, RSP 0x01) and this SUB 0x01 (RSP 0xFE) are inverse commands. They are NOT the same command. SUB 0xFE is a full 166-byte config block used for firmware version, calibration date, etc. SUB 0x01 returns 152 bytes and appears to contain a subset of device identification data. + +Observed payload (data[11:], first ~40 bytes of 161 total): +``` +00 00 00 00 00 42 45 31 31 35 32 39 00 ... "BE11529\0" +``` +Contains serial number, firmware bytes, and floating-point calibration fields. Full field map NOT YET done. + +--- + +## 7.11 Erase-All Protocol (SUBs 0xA3 / 0xA2 / 0x06) ✅ 2026-04-11 + +> ✅ **Confirmed 2026-04-11** from MITM capture of a live Blastware ACH session +> (`bridges/captures/mitm/ach_mitm_20260411_001912/`). + +Blastware uses a 4-step sequence to erase all stored events from device memory. +All frames use standard `build_bw_frame` format (NOT write-format). + +### 7.11.1 Wire Sequence + +``` +BW → device: SUB 0xA3 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 +device → BW: SUB 0x5C (begin-erase ack) + +BW → device: SUB 0x1C offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) +device → BW: SUB 0xE3 (probe ack) +BW → device: SUB 0x1C offset=0x002C params=(same) (data) +device → BW: SUB 0xE3 (44-byte monitor status response) + +BW → device: SUB 0x06 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) +device → BW: SUB 0xF9 (probe ack) +BW → device: SUB 0x06 offset=0x0024 params=(same) (data) +device → BW: SUB 0xF9 (36-byte storage range response) + +BW → device: SUB 0xA2 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 +device → BW: SUB 0x5D (confirm-erase ack — device memory is now cleared) +``` + +All response SUBs follow the standard formula `0xFF − request_SUB`. No exceptions. +The `token=0xFE` at `params[7]` is required for 0xA3, 0x06, and 0xA2. + +### 7.11.2 SUB 0x06 Storage Range Response (36 bytes) + +The 36-byte response from the data step ends with two 4-byte event keys: + +| Offset (from response end) | Field | Notes | +|---|---|---| +| `[-8:-4]` | First stored event key | e.g. `0111ea60` before erase | +| `[-4:]` | Last stored event key | e.g. `0111eaa6` before erase | + +After a successful erase: +- Both keys read `01110000` (device-empty sentinel) +- The device's internal event counter has reset + +Example pre-erase: `... 0111ea60 0111eaa6` +Example post-erase: `... 01110000 01110000` + +### 7.11.3 Post-Erase Key Counter Reset + +After a successful erase the device resets its event counter. New events start +from key `0x01110000` — the same key as the very first event ever recorded on +the device. This means: + +- Any system using event keys for deduplication must clear its "seen keys" state + after an erase, or risk treating fresh events as already downloaded. +- Detection heuristic: if `max(device_keys) < historical_max_key`, the counter + was reset. All device keys should be treated as new regardless of prior state. + +The `ach_server.py` implementation stores `max_downloaded_key` in `ach_state.json` +and applies this heuristic on every call-home. + +### 7.11.4 Implementation Notes + +- `MiniMateClient.delete_all_events()` in `client.py` orchestrates the full sequence. +- `MiniMateProtocol` exposes `begin_erase_all()`, `confirm_erase_all()`, and + `read_event_storage_range()` as separate methods. +- The ACH server `--clear-after-download` flag calls `delete_all_events()` after a + successful event download and resets `ach_state.json` state for the unit. + +--- + +### 7.12 Auto Call Home Config (SUB 0x2C / 0x7E / 0x7F) — ✅ CONFIRMED 2026-04-20 + +> Confirmed from `bridges/captures/4-20-26/call home settings/` — 10 BW TX write frames +> diffed against the S3 read payload. Accessible in Blastware via Remote Access → Setup Unit. + +#### 7.12.1 Read Protocol — SUB 0x2C → Response 0xD3 + +Standard two-step read: + +| Step | Offset | Purpose | +|---|---|---| +| Probe | `0x0000` | Get ack (no data returned) | +| Data | `0x007C` (124) | Receive 125-byte raw payload | + +`DATA_LENGTHS[SUB_CALL_HOME] = 0x7C` + +The raw payload is accessed as `data_rsp.data[11:]` — this is 125 bytes (not 124) because +the device returns logical value 0x03 (num_retries=3) as the two-byte wire sequence +`\x10\x03`. S3FrameParser is in `STATE_IN_FRAME` when it sees `0x10`, transitions to +`STATE_AFTER_DLE`, and then on `0x03` (ETX qualifier) it would normally end the frame — +but in the `_IN_FRAME_DLE` state it instead appends **both** the `0x10` and the `0x03` +literally to the payload. The result: `raw[117] = 0x10`, `raw[118] = 0x03`, and all +subsequent fields are shifted +1 from their logical positions. + +#### 7.12.2 Raw Payload Field Map (125 bytes, from `data_rsp.data[11:]`) + +> All offsets are into the 125-byte raw array. Offsets ≥ 119 are shifted +1 from logical +> due to the DLE-escaped 0x03 at raw[117:119]. + +| Raw Offset | Field | Type | Notes | +|---|---|---|---| +| `[5]` | `auto_call_home_enabled` | uint8 | `0x00` = disabled, `0x01` = enabled | +| `[6:46]` | `dial_string` | ASCII | 40-byte null-padded, e.g. `"12345"` or phone number | +| `[87]` | `after_event_recorded` | uint8 | `0x00` = off, `0x01` = on | +| `[91]` | `at_specified_times` | uint8 | `0x00` = off, `0x01` = on | +| `[93]` | `time1_enabled` | uint8 | `0x00` = off, `0x01` = on | +| `[101]` | `time1_hour` | uint8 | 0–23 | +| `[102]` | `time1_min` | uint8 | 0–59 | +| `[95]` | `time2_enabled` | uint8 | `0x00` = off, `0x01` = on | +| `[105]` | `time2_hour` | uint8 | 0–23 | +| `[106]` | `time2_min` | uint8 | 0–59 | +| `[117]` | DLE prefix `0x10` | — | Part of `\x10\x03` wire encoding for num_retries value 3 | +| `[118]` | `num_retries` (value = 3) | uint8 | Logical value 0x03; check `raw[117] == 0x10` to detect DLE prefix | +| `[120]` | `time_between_retries_sec` | uint8 | Shift +1 from logical 119 | +| `[122]` | `wait_for_connection_sec` | uint8 | Shift +1 from logical 121 | +| `[124]` | `warm_up_time_sec` | uint8 | Shift +1 from logical 123 | + +**Unconfirmed fields** (offsets not yet mapped from captures): +- Time slots 3 and 4 (if they exist — Blastware UI only shows 2 time slots in observed sessions) +- `modem_power_relay_enabled` (bool) +- `storage_mode` (call home trigger on all events vs. triggered only?) + +#### 7.12.3 DLE-Escaped 0x03 — Critical Detail + +The `\x10\x03` sequence at raw[117:119] is **not** a DLE stuffing artifact in the usual +sense. Standard DLE stuffing escapes `\x10` → `\x10\x10`. But here the device is encoding +the integer value `3` in a position where the byte `\x03` would be indistinguishable from +the frame ETX terminator. The device therefore sends `\x10\x03` (DLE + ETX = "inner-frame +terminator" in S3 inner-frame syntax). S3FrameParser correctly handles this: in +`STATE_AFTER_DLE`, seeing `\x03` (ETX) while **inside** an outer frame causes it to +append both `\x10` and `\x03` as literal bytes rather than ending the frame. The outer +frame only terminates on a **bare** `\x03` (without the DLE prefix). + +The write frame sends these bytes verbatim — the device accepts `\x10\x03` in the write +payload and interprets it as the value 3. No transformation is needed in +`_encode_call_home_config()`. + +**Limitation:** Any field that needs to encode the value `3` (0x03) requires this DLE +prefix. The current encoder raises `ValueError` if any hour or minute field equals 3, +since the encoder does not yet implement DLE-prefixed writes for arbitrary field positions. +In practice, 3:00 AM / 3 minutes past are unlikely scheduled call times. + +#### 7.12.4 Write Protocol — SUB 0x7E → 0x7F + +Write format (same as other write commands — only BW_CMD `0x10` doubled on wire; +all other bytes written raw; DLE-aware checksum): + +| Step | SUB | Payload | Offset | Response | +|---|---|---|---|---| +| Data write | `0x7E` | 127 bytes (125-byte read payload + `\x00\x00`) | `data[1]+2 = 0x7E` (126) | `0x81` | +| Confirm | `0x7F` | empty | `0x00` | `0x80` | + +**Write payload construction:** +```python +write_payload = bytearray(raw_125_bytes) +write_payload.append(0x00) +write_payload.append(0x00) +# patch fields in-place, then pass bytes(write_payload) to build_bw_write_frame +``` + +**Offset formula:** `write_payload[1] = 0x7C` (same as DATA_LENGTH). +`offset = write_payload[1] + 2 = 0x7C + 2 = 0x7E = 126`. +This follows the identical pattern as SUB 0x68 (event index write) and SUB 0x69 (waveform write). + +**No preceding 0x2C read required** — Blastware sends SUB 0x7E directly using cached +state. The `seismo-relay` implementation always reads first (`get_call_home_config()`) +before writing for safety. + +#### 7.12.5 Implementation Notes + +- `MiniMateProtocol.read_call_home_config()` — standard two-step read; returns `data_rsp.data[11:]` (125 bytes raw) +- `MiniMateProtocol.write_call_home_config(data)` — sends SUB 0x7E (127-byte payload) then SUB 0x7F confirm +- `MiniMateClient.get_call_home_config()` → `CallHomeConfig` dataclass +- `MiniMateClient.set_call_home_config(...)` — reads current config, patches via `_encode_call_home_config()`, writes back +- `_decode_call_home_config(raw)` — handles DLE prefix detection at raw[117] +- `_encode_call_home_config(raw, ...)` — patches in-place, appends 2 trailing zeros; raises `ValueError` if any hour/min == 3 +- REST API: `GET /device/call_home` and `POST /device/call_home` in `sfm/server.py` +- Web UI: "Call Home" tab in `sfm/sfm_webapp.html` + +--- + +## 8. Timestamp Format + +Two timestamp wire formats are used: + +### 8.1 6-byte format (event index / 1E header) +> 🔶 **Updated 2026-02-26** — Year field resolved. Confidence upgraded. + +Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent. + +**Observed example:** +``` +01 07 CB 00 06 1E +``` + +| Byte(s) | Value | Meaning | Certainty | +|---|---|---|---| +| `01` | 1 | Record validity / type flag | 🔶 INFERRED | +| `07 CB` | 1995 | Year — 16-bit big-endian integer | ✅ CONFIRMED — 2026-02-26 | +| `00` | 0 | Unknown separator | ❓ | +| `06` | 6 | Month (June) | ✅ CONFIRMED | +| `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED | + +> ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly. + +### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10) +> ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report +> for BE11529 thump event: "00:28:12 April 1, 2026". + +Full date + time, including a sub_code byte. Used for **single-shot waveform** +recordings (`sub_code = 0x10`). + +**Observed example (thump event, 2026-04-01):** +``` +01 10 04 07 ea 00 00 1c 0c +``` + +| Byte(s) | Value | Meaning | Certainty | +|---|---|---|---| +| `01` | 1 | Day | ✅ | +| `10` | 0x10 | Sub_code: `0x10` = Waveform single-shot | ✅ | +| `04` | 4 | Month (April) | ✅ | +| `07 ea` | 2026 | Year — 16-bit big-endian integer | ✅ | +| `00` | 0 | Unknown separator | ❓ | +| `00` | 0 | Hour | ✅ | +| `1c` | 28 | Minute | ✅ | +| `0c` | 12 | Second | ✅ | + +### 8.3 10-byte format (Full Waveform Record / SUB 0C, sub_code=0x03; monitor-log partial records) +> ✅ **CONFIRMED 2026-04-03** — Cross-referenced against Blastware event report +> for BE11529 (15:20:17 April 3, 2026). Same layout is used for partial-record +> (monitor log, record type `0x2C`) entries — see §7.10 / `_decode_0a_partial_header`. + +Used for **continuous waveform** recordings (`sub_code = 0x03`). One byte +wider than the 9-byte layout — a leading `0x10` marker shifts every subsequent +field by +1. + +**Observed example (continuous event, 2026-04-03 15:20:17):** +``` +10 03 10 04 07 ea 00 0f 14 11 +``` + +| Byte | Value | Meaning | +|---|---|---| +| `10` | 0x10 | Marker; how the decoder distinguishes 10-byte from 9-byte layout | +| `03` | 3 | Day | +| `10` | 0x10 | Marker (reflects wire-encoded sub_code=0x03) | +| `04` | 4 | Month | +| `07 ea` | 2026 | Year — uint16 BE | +| `00` | 0 | Unknown separator | +| `0f` | 15 | Hour | +| `14` | 20 | Minute | +| `11` | 17 | Second | + +**Auto-detection rule:** if `record[0] == 0x10`, use the 10-byte layout; +otherwise use the 9-byte layout. + +The `.MLG` file for a single-shot event stores the timestamp in a different +binary representation (little-endian year, no sub_code byte), confirming the +waveform record and the saved file use distinct serialisation formats. + +--- + +## 9. Out-of-Band / Non-Frame Messages + +| Message | Direction | Trigger | Certainty | +|---|---|---|---| +| `"Operating System"` | S3 → BW | Device boot / UART init / RTC reset | ✅ CONFIRMED | + +> The device prints this boot string directly to the UART **before** switching to DLE-framed binary protocol mode. Your implementation should discard any non-`0x41`/non-`0x10 0x02` bytes during the connection phase. Wait for the first valid framed poll response before proceeding. + +--- + +## 10. DLE Byte Stuffing +> ✅ **CONFIRMED — 2026-02-26** (previously ❓ SPECULATIVE) + +This protocol uses standard **DLE (Data Link Escape) byte stuffing**, a classical technique used in protocols like IBM BISYNC dating to the 1970s. + +### Parser State Machine + +``` +IDLE: + receive 0x41 → emit ACK event, stay IDLE + receive 0x10 → goto WAIT_STX + +WAIT_STX: + receive 0x02 → frame started, goto IN_FRAME + receive anything → error, goto IDLE + +IN_FRAME: + receive 0x10 → goto ESCAPE + receive any byte → append to buffer, stay IN_FRAME + +ESCAPE: + receive 0x03 → frame complete — validate checksum, process buffer, goto IDLE + receive 0x10 → append single 0x10 to buffer, goto IN_FRAME (stuffed literal) + receive 0x02 → error (nested STX), goto IDLE + receive anything → error, goto IDLE +``` + +--- + +## 11. Checksum Reference Implementation +> ⚠️ **Updated 2026-03-12** — BW→S3 large-frame checksum algorithm confirmed. Two distinct formulas apply depending on frame direction and size. + +### Checksum Overview + +| Direction | Frame type | Formula | Coverage | +|---|---|---|---| +| S3→BW | All frames | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | +| BW→S3 | Small frames (POLL, read cmds) | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | +| BW→S3 | Large write frames (SUB `68`, `69`, `71`, `82`, `7E`, `1A`+data) | DLE-aware large-frame: `(sum(payload[2:] where b != 0x10) + 0x10) & 0xFF` | De-stuffed payload bytes `[2:]`, skipping `0x10` bytes, plus constant | +| BW→S3 | SUB 5A bulk waveform | DLE-aware over the **stuffed** wire bytes | For each `10 XX` pair in the stuffed section, count `XX`; lone bytes count as-is. See `build_5a_frame` in `minimateplus/framing.py`. | + +### BW→S3 Large-Frame Checksum Formula + +```python +def calc_checksum_bw_large(payload: bytes) -> int: + """ + Checksum for large BW→S3 write frames (SUB 68, 69, 71, 82, 1A with data). + + Formula: sum all bytes in payload[2:-1], skipping 0x10 bytes, add 0x10, mod 256. + Confirmed across 20 frames from two independent captures (2026-03-12). + """ + return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF +``` + +**Why this formula:** The CMD byte at `payload[0]` is always `0x10` (DLE). The byte at `payload[1]` is always `0x00`. Starting from `payload[2]` skips both. All `0x10` bytes in the data section are excluded from the sum, then `0x10` is added back as a constant — effectively treating DLE as a transparent/invisible byte in the checksum. This is consistent with `0x10` being a framing/control character in the protocol. + +**Consistency check:** For small frames, `payload[0]` = `0x10` and there are no other `0x10` bytes in the payload. The large-frame formula applied to a small frame would give `(sum(payload[2:-1]) + 0x10) = sum(payload[0:-1])` — identical to the plain SUM8. The two formulas converge for frames without embedded `0x10` data bytes. + +```python +DLE = 0x10 +STX = 0x02 +ETX = 0x03 +ACK = 0x41 + + +def stuff(data: bytes) -> bytes: + """Escape all 0x10 bytes in payload as 0x10 0x10 for transmission.""" + out = [] + for b in data: + out.append(b) + if b == DLE: + out.append(DLE) # double it + return bytes(out) + + +def destuff(data: bytes) -> bytes: + """Remove DLE stuffing from received payload bytes.""" + out = [] + i = 0 + while i < len(data): + if data[i] == DLE and i + 1 < len(data) and data[i + 1] == DLE: + out.append(DLE) + i += 2 + else: + out.append(data[i]) + i += 1 + return bytes(out) + + +def calc_checksum_s3(payload: bytes) -> int: + """ + Standard SUM8: used for all S3→BW frames and small BW→S3 frames. + Sum of all payload bytes (excluding the checksum byte itself), mod 256. + """ + return sum(payload) & 0xFF + + +def calc_checksum_bw_large(payload: bytes) -> int: + """ + Large BW→S3 write frame checksum (SUB 68, 69, 71, 82, 1A with data). + Sum payload[2:-1] skipping 0x10 bytes, add 0x10, mod 256. + """ + return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF + + +# Backwards-compatible alias +def calc_checksum(payload: bytes) -> int: + return calc_checksum_s3(payload) + + +def build_frame(payload: bytes) -> bytes: + """ + Build a complete on-wire frame from a raw payload. + Output: ACK + DLE+STX + stuffed_payload + checksum + DLE+ETX + """ + chk = calc_checksum(payload) + stuffed = stuff(payload) + return bytes([ACK, DLE, STX]) + stuffed + bytes([chk, DLE, ETX]) + + +def parse_frame(raw: bytes) -> bytes | None: + """ + Parse and validate a raw on-wire frame. + Accepts input starting with ACK (0x41) or DLE+STX (0x10 0x02). + Returns de-stuffed payload bytes on success, None on any error. + """ + # Strip optional leading ACK + if raw and raw[0] == ACK: + raw = raw[1:] + + # Validate frame delimiters + if len(raw) < 5: + return None + if raw[0] != DLE or raw[1] != STX: + return None + if raw[-2] != DLE or raw[-1] != ETX: + return None + + # Extract: everything between DLE+STX and DLE+ETX + inner = raw[2:-2] + chk_received = inner[-1] + stuffed_payload = inner[:-1] + + # De-stuff and validate checksum + payload = destuff(stuffed_payload) + if calc_checksum(payload) != chk_received: + return None + + return payload + + +# ── Example: build a POLL probe request (SUB 5B) ───────────────────────────── +# Layout per §3: BW_CMD=0x10, flags=0x00, SUB=0x5B, [0x00, 0x00], OFFSET=0x00, +# then 10 bytes of params — 16 bytes total payload. +poll_payload = bytes([ + 0x10, # [0] BW_CMD + 0x00, # [1] flags + 0x5B, # [2] SUB: POLL + 0x00, 0x00, # [3:5] always zero + 0x00, # [5] OFFSET (probe step) + 0x00, 0x00, 0x00, 0x00, 0x00, # [6:11] params + 0x00, 0x00, 0x00, 0x00, 0x00, # [11:16] params +]) +# checksum = SUM8 over payload[0:-1] for small read frames; here = (0x10 + 0x5B) & 0xFF = 0x6B +# Wire output (BW→S3): the leading 0x10 is DLE-stuffed to 0x10 0x10: +# 41 02 10 10 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 6B 03 +# ^ ^ ^^^^^ ^ ^ +# ACK STX (bare 0x02) chk bare ETX +# See `build_bw_frame()` in `minimateplus/framing.py` for the canonical builder. +``` + +--- + +## 12. Recommended Implementation Sequence + +Build in this order — each step is independently testable. **Don't try to +implement event download (step 8 onward) without reading §6.1 first** — the +1E-arm / POLL×3 / 5A walk has multiple device-side state-machine prerequisites +that are easy to miss. + +1. **DLE frame parser** — stateful byte-by-byte reader implementing the §10 state machine. Handles ACK, stuffing, de-stuffing, bare-ETX termination, checksum validation. +2. **`connect(port, baud=38400)`** — open port, flush buffer, discard ASCII boot strings (§9), send first POLL frame. +3. **`identify()`** — SUB `5B` two-step read → returns `{"manufacturer": "Instantel", "model": "MiniMate Plus"}`. +4. **`get_serial()`** — SUB `15` two-step read → returns serial number string. +5. **`get_config()`** — SUB `01` / SUB `FE` two-step read → returns full config dict (firmware, calibration date, aux trigger). +6. **`get_event_count()`** — SUB `08` event index read. +7. **`get_event_header(key)`** — SUB `1E` (browse mode, token=`0x00` at params[7]) → first event key; iterate with SUB `1F`. +8. **`get_event_record(key)`** — SUB `0C` paginated read → 210-byte waveform record (peaks, timestamp, project). Use the 9-byte / 10-byte timestamp auto-detect from §7.5b / §8. +9. **`download_waveform(key)`** — SUB `5A` bulk stream. **Requires the full arm sequence from §6.1:** 0A → 1E(arm) → 0C → 1F(arm) → POLL × 3 → 5A. Use the STRT-bounded chunk walk from §7.8.5, the TERM frame from §7.8.6, and the metadata pages from §7.8.7. +10. **Write commands** — see §5.3 for the frame format and SUB pairings. Compliance push, call-home setup, and erase-all are all confirmed (§7.11, §7.12). + +--- + +## 13. Devices Under Test + +Multiple units have contributed captures to this reference. Primary development +target is **BE11529** (firmware S338.17); earlier sessions used BE18189. + +| Field | Primary unit | Secondary unit(s) | +|---|---|---| +| Manufacturer | Instantel | — | +| Model | MiniMate Plus | — | +| Serial Number | **BE11529** | BE18189, BE6907, BE14036, BE17353, BE18003, BE18191, BE18676 (archive only) | +| Firmware | **S338.17** | S337.17 (BE18189); various S338.x for other units | +| DSP / Secondary FW | 10.72 | 10.72 | +| Channels | Tran, Vert, Long, MicL (4 channels) | — | +| Sample Rate | 1024 / 2048 / 4096 sps (selectable) | — | +| Bridge Config (RS-232) | direct or via Sierra Wireless RV50/RV55 modem, 38400,8N1 | — | +| Bridge Config (TCP) | port 12345 (configurable) | — | +| Capture Tool | s3_bridge v0.5.0+ | v0.4.0 used for 1-2-26 / 3-11-26 captures | + +--- + +## 14. TCP / Modem Transport +> ✅ **CONFIRMED — 2026-03-31** from Blastware Operator Manual 714U0301 Rev 22 §4.4 and ACEmanager Raven modem configuration screenshots. + +The MiniMate Plus protocol is **fully transport-agnostic at the byte level**. The same DLE-framed S3/BW frame stream that flows over RS-232 is transmitted unmodified over a TCP socket. No additional framing, handshake bytes, or session tokens are added at the application layer. + +--- + +### 14.1 Two Usage Modes + +**"Call Up" (Outbound TCP — SFM connects to modem)** + +Blastware or SFM opens a TCP connection to the modem's static IP address on its device port. The modem bridges the TCP socket to its RS-232 serial port, which is wired directly to the MiniMate Plus. From the protocol perspective this is identical to a direct serial connection. + +``` +SFM ──TCP──► Raven modem ──RS-232──► MiniMate Plus + (static IP, port N) (38400,8N1) +``` + +This is the mode implemented by `TcpTransport(host, port)`. Typical call: + +``` +GET /device/info?host=203.0.113.5&tcp_port=12345 +``` + +**"Call Home" / ACH (Inbound TCP — unit calls the server)** + +The MiniMate Plus is configured with an IP address and port. On an event trigger or scheduled time it powers up its modem, which establishes a TCP connection outbound to the server. Blastware (or a future SFM ACH listener) accepts the incoming connection. After the unit connects, the PC has a configurable "Wait for Connection" window to send the first command before the unit times out and hangs up. + +``` +MiniMate Plus ──RS-232──► Raven modem ──TCP──► ACH server (listening) + (static office IP, port N) +``` + +`TcpTransport` is a **client** (outbound connect only). A separate `AchServer` listener component is needed for this mode — not yet implemented. + +--- + +### 14.2 No Application-Layer Handshake on TCP Connect + +✅ **Confirmed from ACEmanager configuration screenshot:** + +``` +Enable ENQ on TCP Connect: 0-Disable +``` + +When a TCP connection is established (in either direction), **no ENQ byte or other handshake marker is sent** by the modem before the protocol stream starts. The first byte from either side is a raw protocol byte — for SFM-initiated call-up, SFM sends POLL_PROBE immediately after `connect()`. + +**Sierra Wireless RV50/RV55 note:** Even with Quiet Mode enabled, these modems send `\r\nRING\r\n\r\nCONNECT\r\n` over the TCP connection to the calling client at connect time. Quiet Mode only suppresses these strings on the *serial* port (protecting the MiniMate Plus). The TCP client must tolerate these prefix bytes — scan for DLE+STX (`0x10 0x02`) and discard everything before it. This is the same approach used for the `"Operating System"` boot string (§9). + +The Raven X (deprecated) did not exhibit this behaviour. The note below about "no CONNECT string" describes Raven X with ENQ-disable; it does **not** apply to RV50/RV55. + +No ENQ byte or other application-layer handshake is added. The Raven modem's TCP dialog is configured with: + +| ACEmanager Setting | Value | Meaning | +|---|---|---| +| TCP Auto Answer | 2 — Telnet Server | TCP mode (transparent pass-through, not actually Telnet) | +| Telnet Echo Mode | 0 — No Echo | No echo of received bytes | +| Enable ENQ on TCP Connect | 0 — Disable | No ENQ byte on connect | +| TCP Connect Response Delay | 0 | No delay before first byte | +| TCP Idle Timeout | **2** (minutes) | Prevents premature disconnect; must match §14.3 | + +--- + +### 14.3 Modem Serial Port Configuration + +> **Hardware note:** The Raven X modem shown in the Blastware manual is 3G-only and no longer operational (3G network shutdown). The current field hardware is the **Sierra Wireless RV55** (and newer RX55). Both run ALEOS firmware and have an identical ACEmanager web UI — the settings below apply to all three generations. + +The modem's RS-232 port (wired to the MiniMate Plus) must be configured as: + +| ACEmanager Setting | Value | +|---|---| +| Configure Serial Port | **38400,8N1** | +| Flow Control | None | +| DB9 Serial Echo | OFF | +| Data Forwarding Timeout | **`1` (= 0.1 s)** in ACEmanager units (1 tick = 0.1 s; see §14.3 RV50/RV55 table) | +| Data Forwarding Character | 0 (disabled) | + +The **Data Forwarding Timeout** is the most protocol-critical setting. The modem +accumulates bytes from the RS-232 port for up to the configured interval before +forwarding them as a TCP segment. This means: + +- A large S3 response frame may arrive as multiple TCP segments with up to 1-second gaps between them. +- A `read_until_idle` implementation with `idle_gap < 1.0 s` will **incorrectly declare the frame complete mid-stream**. +- `TcpTransport.read_until_idle` overrides the default `idle_gap=0.05 s` to `idle_gap=1.5 s` to compensate. + +If connecting to a unit via a direct Ethernet connection (no serial modem in the path), the 1.5 s idle gap will still work but will feel slower. In that case you can pass `idle_gap=0.1` explicitly. + +#### Sierra Wireless RV50 / RV55 Required Settings +> ✅ **CONFIRMED — 2026-03-31** from working RV50 field config vs misconfigured RV55. + +The following ACEmanager Serial settings are required for correct transparent operation. A single wrong setting is enough to break the protocol exchange (unit beeps on connect but never returns an S3 frame): + +| ACEmanager Setting | Required Value | Why | +|---|---|---| +| **Quiet Mode** | **Enable** | Disabling it causes the modem to inject `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time, corrupting the S3 handshake. | +| **Configure Serial Port** | `38400,8N1` | Must match MiniMate baud rate. | +| **Flow Control** | `None` | Hardware flow control (CTS/RTS) will block unit's serial TX if pins are not wired. | +| **Data Forwarding Timeout** | `1` (= 0.1 s) | Controls RS-232→TCP forwarding latency. `5` (0.5 s) works but is sluggish; `1` matches working field units. | +| **TCP Connect Response Delay** | `0` | Any non-zero value causes the modem to silently discard our POLL frame during the delay window. | +| **TCP Idle Timeout** | `2` (minutes) | Prevents premature disconnect. Too low and the modem drops the session before the unit responds. | +| **DB9 Serial Echo** | `Disable` | Echo would corrupt the S3 stream. | + +--- + +### 14.4 Connection Timeouts on the Unit Side + +The MiniMate Plus firmware has two relevant timeouts configurable via Blastware's Call Home Setup dialog: + +| Timeout | Description | Impact | +|---|---|---| +| **Wait for Connection** | Seconds after TCP connect during which the unit waits for the first BW frame. If nothing arrives, unit terminates the session. | SFM must send POLL_PROBE within this window after `connect()`. Default appears short (≈15–30 s). | +| **Serial Idle Time** | Seconds of inactivity after which the unit terminates the connection. | SFM must complete its work and disconnect cleanly — or send periodic keep-alive frames — within this window. | + +For our `TcpTransport` + `MiniMateProtocol` stack, both timeouts are satisfied automatically because `connect()` is immediately followed by `protocol.poll()` which sends POLL_PROBE, and the full session (POLL + read + disconnect) typically completes in < 30 seconds. + +--- + +### 14.5 Port Numbers + +The TCP port is **user-configurable** in both Blastware and the modem. There is no universally fixed port. + +| Setting location | Value in manual example | Value in user's install | +|---|---|---| +| Blastware TCP Communication dialog | 12335 | 12345 | +| Raven ACEmanager Destination Port | 12349 (UDP example) | varies | + +`TcpTransport` defaults to `DEFAULT_TCP_PORT = 12345` which matches the user's install. This can be overridden by the `port` argument or the `tcp_port` query parameter in the SFM server. + +--- + +### 14.6 ACH Session Lifecycle (Call Home Mode) ✅ IMPLEMENTED 2026-04-11 + +When the unit calls home under ACH, the session lifecycle from the unit's perspective is: + +1. Unit triggers (event or scheduled time) +2. Unit powers up modem, dials / connects TCP to server IP:port +3. Unit waits for "Wait for Connection" window for first BW frame from server +4. Server sends POLL_PROBE → unit responds with POLL_RESPONSE (same as serial) +5. Server reads serial number, full config, events as needed +6. (Optional) Server erases device memory: SUB 0xA3 → 0x1C → 0x06 → 0xA2 +7. Server disconnects (or unit disconnects on Serial Idle Time expiry) +8. Unit detects DCD/DTR going low (modem signals line drop), returns to monitor mode automatically + +Step 4 onward is **identical to the serial/call-up protocol**. The only difference +from our perspective is that we are the **listener** rather than the **connector**. + +**Implementation: `bridges/ach_server.py`** — run with `python bridges/ach_server.py`. +Key flags: +- `--clear-after-download` — erase device memory after a successful event download +- `--allow-ip IP` — restrict to specific unit IPs +- `--max-events N` — cap events per session for safety + +**State persistence: `ach_state.json`** — tracks `downloaded_keys` (set of event key +hex strings) and `max_downloaded_key` (high-water mark) per unit serial number. +Post-erase key reuse (`0x01110000` recycled) is detected via the high-water mark. + +**Note on DCD/DTR:** The MiniMate Plus monitors the RS-232 DCD line. When the TCP +connection closes, the Sierra Wireless modem drops DCD, which the unit interprets as +"serial connection ended" and automatically resumes monitoring. No `start_monitoring()` +(SUB 0x96) command is needed from the server. ⚠️ Newer RV55 firmware may not assert DCD +by default — known issue, not yet resolved. + +--- + +## Appendix A — s3_bridge Capture Format +> ✅ **CONFIRMED — 2026-02-26** + +> ⚠️ **This behavior is not part of the Instantel protocol. It is an artifact of the bridge logger implementation.** + +The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger makes one modification: + +| Wire sequence | In .bin file | Notes | +|---|---|---| +| `0x10 0x03` (DLE+ETX) | `0x03` | DLE stripped from end-of-frame marker | +| All other bytes | Unchanged | ACK, DLE+STX, stuffed payload, checksum all preserved verbatim | + +**Practical impact for parsing `.bin` files:** +- Frame end: scan for bare `0x03` (not `0x10 0x03`) +- Checksum: the byte immediately before the bare `0x03` is the checksum +- Everything else (ACK detection, DLE+STX, payload de-stuffing) works as documented in §10 + +> ⚠️ This means checksums cannot be verified on frames where the stuffed payload ends in `0x10` — that trailing `0x10` would normally be the DLE prefix of ETX, but the logger strips it, making the frame boundary ambiguous in that edge case. In practice this has not been observed in captured data. + +--- + +## 15. Open Questions / Still Needs Cracking + +| Question | Priority | Added | Notes | +|---|---|---|---| +| Timestamp 6-byte format byte[3] — purpose of the separator `0x00` byte | LOW | 2026-02-26 | Not blocking; 9-byte waveform record format (§8.2) fully confirmed without this byte. | +| `trail[0]` in serial number response — unit-specific byte, derivation unknown. `trail[1]` resolved as firmware minor version. | MEDIUM | 2026-02-26 | | +| ~~Full channel ID mapping in SUB `5A` stream~~ — **RESOLVED 2026-08-25 for the waveform body:** every `40 NN` segment header carries `[channel_id][00][00][segment_index]` at `data[2*NN+4]`, with `0x46`=Tran `0x47`=Vert `0x48`=Long `0x49`=MicL. Verified on 1697/1697 segment headers with zero disagreements against the decoded channel rotation. See §7.6.1. | RESOLVED | 2026-02-26 | Resolved 2026-08-25 | +| ~~Exact byte boundaries of project string fields in SUB `71` write frame~~ — **RESOLVED 2026-05-05:** project/client/operator/seis-loc/extended-notes come from SUB 5A metadata pages at counter `0x1002` / `0x1004` (§7.8.7), NOT from the SUB 71 write payload. `_decode_a5_metadata_into` locates them via ASCII label scans. | RESOLVED | 2026-02-26 | Resolved 2026-05-05 | +| Purpose of SUB `09` / response `F6` — 202-byte read block | MEDIUM | 2026-02-26 | | +| Purpose of SUB `2E` / response `D1` — 26-byte read block | MEDIUM | 2026-02-26 | | +| Full field mapping of SUB `1A` / response `E5` — channel scaling / compliance config block. **RESOLVED 2026-04-21:** Multi-frame sequence (§7.6.2), page_key chunking, duplicate-page detection, record_time at anchor+6 (§7.6.1), sample_rate at anchor−6 (§7.6.3), recording_mode at anchor−8 (§7.6.4), histogram_interval at anchor−4, trigger_level_geo and alarm_level_geo in channel block (§7.6), geo_range at channel_label+33 (§7.6), adc_scale_factor at channel_label+28, and project strings (via 5A metadata pages, §7.8.7) all confirmed. | RESOLVED | 2026-02-26 | Resolved 2026-04-21 | +| `0x082A` in channel config block — not trigger, alarm, or record time directly. **RESOLVED: fixed E5 payload length (2090 bytes).** Constant regardless of all settings. | RESOLVED | 2026-03-01 | Resolved 2026-03-09 | +| **Record time in wire protocol** — float32 BE, anchor-relative in cfg (see §7.6.1/§7.6.3). **RESOLVED.** Previous `+0x28` offset was unreliable due to DLE jitter — superseded by anchor search. Confirmed at 3, 5, 7, 8, 10, 13 seconds. | RESOLVED | 2026-03-09 | Confirmed 2026-03-09; anchor method confirmed 2026-04-01 | +| **Sample rate** — uint16 BE at anchor−2 in cfg. **RESOLVED.** Normal=1024, Fast=2048, Faster=4096. Anchor required to handle DLE jitter. See §7.6.3. | RESOLVED | 2026-04-01 | Confirmed 2026-04-01 | +| Unknown uint16 fields at channel block +0A (=80), +0C (=15), +0E (=40), +10 (=21) — manual describes "Sensitive (Gain=8) / Normal (Gain=1)" per-channel range; 80/15/40/21 might encode gain, sensitivity, or ADC config. | LOW | 2026-03-01 | | +| ~~Full trigger configuration field mapping (SUB `1C` / write `82`)~~ — **PARTIALLY RESOLVED:** SUB `1C` now confirmed as MONITOR STATUS READ (§5.1, §7.10) — not trigger config; the old "0x6E response" was misidentification. SUB `82` (trigger config write) layout partially mapped — Trigger Sample Width at `[22]`. Remaining unknowns: full per-channel structure of the 0x82 payload. | LOW | 2026-02-26 | Updated 2026-05-20 | +| Whether SUB `24`/`25` are distinct from SUB `5A` or redundant | LOW | 2026-02-26 | | +| **Meaning of `0x07 E7` field in config block — RESOLVED:** Calibration year. uint16 BE at destuffed payload offset 0x56–0x57. Confirmed via two-unit comparison: BE18189 (calibrated 2023) = `07 E7`; BE11529 (calibrated 2025) = `07 E9`. Adjacent bytes at 0x53–0x55 encode remaining calibration date (month confirmed as BCD October for both units; full layout 🔶 INFERRED). | RESOLVED | 2026-02-26 | Resolved 2026-03-31 | +| **Trigger Sample Width** — **RESOLVED:** BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Width=4 → `0x04`, Width=3 → `0x03`. Confirmed via BW-side capture diff. Only visible in `raw_bw.bin` write traffic, not in S3-side compliance reads. | RESOLVED | 2026-03-02 | Confirmed 2026-03-09 | +| **Auto Window** — "1 to 9 seconds" per manual (§3.13.1b). **Mode-gated:** only transmitted/active when Record Stop Mode = Auto. Capture attempted in Fixed mode (3→9 change) — no wire change observed in any frame. Deferred pending mode switch. | LOW | 2026-03-02 | Updated 2026-03-09 | +| **Auxiliary Trigger read location** — **RESOLVED:** SUB `FE` offset `0x0109`, uint8, `0x00`=disabled, `0x01`=enabled. Confirmed 2026-03-11 via controlled toggle capture. | RESOLVED | 2026-03-02 | Resolved 2026-03-11 | +| **Auxiliary Trigger write path** — Write command not yet captured in a clean session. Inner frame handshake visible in A4 (multiple WRITE_CONFIRM_RESPONSE SUBs appear, TRIGGER_CONFIG_RESPONSE removed), but the BW→S3 write command itself was in a partial session. Likely SUB `15` or similar. Deferred for clean capture. | LOW | 2026-03-11 | NEW | +| ~~**SUB `6E` response to SUB `1C`**~~ — ~~RESOLVED 2026-04-08: This was a misidentification.~~ The `1C → 6E` "exception" was misread — likely an inner A4 sub-frame. Confirmed from 4-8-26 capture (338 frames): SUB 0x1C always → 0xE3. No exceptions to the `0xFF − SUB` rule are known. | RESOLVED | 2026-04-08 | CLOSED | +| ~~**Max Geo Range float 6.2061**~~ — **RESOLVED 2026-04-17.** Confirmed as the **ADC-to-velocity scale factor** = inverse sensitivity = 1/0.161133 = **6.206053 (in/s)/V**. Source: Interface Handbook §4.5 formula `Range = 1.61133 V / Sensitivity`. For standard Instantel geo at Normal (Gain=1) range: Sensitivity = 1.61133/10 = 0.161133 V/(in/s), scale = 6.206053. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. The earlier ~9× overread was from using 6.206053 directly as range instead of as scale factor (range = 1.61133 V × 6.206053 = 10.000 in/s). Hardware constant — do NOT write. | RESOLVED | 2026-02-26 | Resolved 2026-04-17 | +| MicL channel units — **RESOLVED: psi**, confirmed from `.set` file unit string `"psi\0"` | RESOLVED | 2026-03-01 | | +| Backlight offset — **RESOLVED: +4B in event index data**, uint8, seconds | RESOLVED | 2026-03-02 | | +| Power save offset — **RESOLVED: +53 in event index data**, uint8, minutes | RESOLVED | 2026-03-02 | | +| Monitoring LCD Cycle — **RESOLVED: +54/+55 in event index data**, uint16 BE, seconds (65500 = disabled) | RESOLVED | 2026-03-02 | | +| **SUB 0x06 purpose — RESOLVED: event storage range.** Previously labeled "CHANNEL CONFIG READ". 4-11-26 MITM capture confirms it returns first/last stored event keys in the final 8 bytes of the 36-byte response. Used by Blastware as part of the erase-all verification step. | RESOLVED | 2026-04-11 | | +| **Erase-all command sequence — RESOLVED.** SUB 0xA3 (begin) + 0x1C (monitor status) + 0x06 (storage range) + 0xA2 (confirm). Confirmed from 4-11-26 MITM capture. All frames standard `build_bw_frame`, token=0xFE. | RESOLVED | 2026-04-11 | | +| **ACH inbound server — RESOLVED.** `bridges/ach_server.py` implements full inbound ACH pipeline. `--clear-after-download` flag for delete-after-upload workflow. Post-erase key-reuse detection via `max_downloaded_key` high-water mark. | RESOLVED | 2026-04-11 | | +| **Sensor Check dropdown byte location** — byte offset in 1A compliance config payload for the "Sensor Check: Before monitoring / After each event / Disabled" setting is NOT YET LOCATED. Confirmed: unit always runs with "Before monitoring" set. Need a capture with "Disabled" to diff. | MEDIUM | 2026-04-08 | Still open | +| **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open | +| ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | +| ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | +| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | +| **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open | +| **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open | + +--- + +--- + +## Appendix B — Operator Manual Cross-Reference (716U0101 Rev 15) + +> Added 2026-03-02. Cross-referencing confirms setting names, ranges, units, and behavior for fields found in protocol captures. The manual does NOT describe the wire protocol — it describes the user-facing device interface. Use to infer data types, ranges, and semantics of protocol fields. + +| Setting Name (Manual) | Manual Location | Protocol Location | Type | Range / Notes | +|---|---|---|---|---| +| Backlight On Time | §3.13.1e | Event Index +4B | uint8 | 0–255 seconds | +| Power Saving Timeout | §3.13.1f | Event Index +53 | uint8 | minutes (user sets 1–60+) | +| Monitoring LCD Cycle | §3.13.1g | Event Index +54/55 | uint16 BE | seconds; 0=off; 65500≈disabled | +| Trigger Level (Geo) | §3.8.6 | Channel block, float | float32 BE | 0.005–10.000 in/s | +| Alarm Level (Geo) | §3.9.9 | Channel block, float | float32 BE | higher than trigger level | +| Trigger Level (Mic) | §3.8.6 | Channel block, float | float32 BE | 100–148 dB in 1 dB steps | +| Alarm Level (Mic) | §3.9.10 | Channel block, float | float32 BE | higher than mic trigger | +| Record Time | §3.8.9 | cfg anchor+10, float32 BE (wire); `.set` +16, uint32 LE (file) | float32 BE (wire) | 1–105 s; confirmed 3→`40400000`, 5→`40A00000`, 8→`41000000`, 13→`41500000`. Use anchor §7.6.1/§7.6.3 — NOT fixed offset. | +| ADC Scale Factor (geo_adc_scale) | §3.8.4 / Interface Handbook §4.5 | Channel block, Tran+28 (same in E5 read and SUB 71 write), float32 BE | float32 BE = 6.206053 | ✅ CONFIRMED 2026-04-17 — inverse sensitivity (in/s)/V. `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant, identical on all units. Do NOT write. | +| Max Geo Range (geo_range) | §3.8.4 | Channel block, Tran+33 (same in E5 read and SUB 71 write), uint8; applied to Tran/Vert/Long | uint8 | ✅ CONFIRMED 2026-04-20 — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. **NOTE: `Tran+20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | +| Microphone Units | §3.9.7 | Inline unit string | char[4] | `"psi\0"`, `"pa.\0"`, `"dB\0\0"` | +| Sample Rate | §3.8.2 | cfg anchor−2, uint16 BE — anchor=`\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100] | uint16 BE | Normal=1024, Fast=2048, Faster=4096 ✅ CONFIRMED 2026-04-01 (BE11529 S338.17). Anchor required — see §7.6.3 DLE jitter. | +| Record Mode | §3.8.1 | Write: `cfg[anchor−3]`, uint8. Read (E5 sf1): `data[anchor−4]`, uint8. Note: extra `0x10` byte at read `data[anchor−3]` shifts offset by 1 vs write. | uint8 | `0x00`=Single Shot, `0x01`=Continuous, `0x02`=unknown, `0x03`=Histogram, `0x04`=Histogram+Continuous. ✅ CONFIRMED 2026-04-20 | +| Trigger Sample Width | §3.13.1h | BW→S3 SUB `0x82` write frame, destuffed `[22]`, uint8 | uint8 | Default=2; confirmed 4=`0x04`, 3=`0x03`. **BW-side write only** — not visible in S3 compliance reads. Mode-gated: only sent in Compliance/Single-Shot/Fixed mode. | +| Auto Window | §3.13.1b | **Mode-gated — NOT YET MAPPED** | uint8? | 1–9 seconds; only active when Record Stop Mode = Auto. Capture in Fixed mode produced no wire change. | +| Auxiliary Trigger | §3.13.1d | SUB `FE` (FULL_CONFIG_RESPONSE) offset `0x0109` (read); write path not yet isolated | uint8 (bool) | `0x00`=disabled, `0x01`=enabled; confirmed 2026-03-11 | +| Password | §3.13.1c | Unknown | — | 4-key sequence | +| Serial Connection | §3.9.11 | Unknown | — | Direct / Via Modem | +| Baud Rate | §3.9.12 | Unknown | — | 38400 for direct | + +--- + +## Appendix C — Logger & Parser Validation (2026-03-02) + +> Documents the logger integrity verification and parser refactor completed 2026-03-02. Tooling behavior only — not protocol semantics. + +### C.1 Logger Validation + +**Concern:** Earlier sessions noted that the `s3_bridge` logger may have been stripping `0x10` from `DLE ETX` sequences, producing bare `0x03` terminators in the capture file. + +**Resolution:** HxD inspection of a new capture produced by `s3_bridge v0.5.0` confirmed that `10 03` sequences are present intact inside S3→BW record payloads. The `forward_loop` function writes raw bytes to the `.bin` before any sniffer or framing logic runs — there is no ETX stripping in v0.5.0. + +The earlier stripping behavior applied to a previous logger version. v0.5.0 is confirmed lossless with respect to wire bytes. + +**Confirmed wire framing:** +- Frame start: `0x10 0x02` (DLE STX) ✅ +- Frame end: `0x10 0x03` (DLE ETX) ✅ +- DLE stuffing: `0x10 0x10` in payload = literal `0x10` ✅ + +### C.2 Capture Architecture (Current) + +As of 2026-03-02 the capture pipeline produces two flat raw wire dump files per session: + +| File | Contents | +|---|---| +| `raw_s3.bin` | All bytes transmitted by S3 (device → Blastware), in order | +| `raw_bw.bin` | All bytes transmitted by BW (Blastware → device), in order | + +No record headers, no timestamps, no framing logic applied by the dumper. Files are flat concatenations of `serial.read()` chunks. Frame boundaries must be recovered by the parser. + +### C.3 Parser Design — DLE State Machine + +A deterministic state machine replaces all prior heuristic scanning. + +**States:** + +``` +STATE_IDLE — scanning for frame start +STATE_IN_FRAME — consuming payload bytes +STATE_AFTER_DLE — last byte was 0x10, awaiting qualifier +``` + +**Transitions:** + +| Current State | Byte | Action | Next State | +|---|---|---|---| +| IDLE | `10 02` | Begin new frame | IN_FRAME | +| IDLE | any | Discard | IDLE | +| IN_FRAME | `!= 10` | Append to payload | IN_FRAME | +| IN_FRAME | `10` | — | AFTER_DLE | +| AFTER_DLE | `10` | Append literal `0x10` | IN_FRAME | +| AFTER_DLE | `03` | Frame complete, emit | IDLE | +| AFTER_DLE | other | Treat as payload (recovery) | IN_FRAME | + +**Properties:** +- Does not scan globally for `10 02` +- Only complete STX→ETX pairs are emitted as frames +- Incomplete trailing frames at EOF are discarded (expected at capture boundaries) +- DLE stuffing handled correctly + +### C.4 Observed Traffic (Validation Captures) + +**`raw_bw.bin`** (Blastware → S3): +- 7 complete frames via state machine +- Mostly small command/control frames, several zero-length payloads +- Bare `0x02` used as STX (asymmetric — BW does not use DLE STX) +- Contains project metadata strings: `"Standard Recording Setup.set"`, `"Claude test2"`, `"Location #1 - Brians House"` + +**`raw_s3.bin`** (S3 → Blastware): +- First frame payload ~3922 bytes (large structured response) +- Repeated `"Instantel"` / `"MiniMate Plus"` / `"BE18189"` strings throughout +- Multiple medium-length structured frames +- DLE+ETX confirmed intact + +### C.5 Key Lessons + +1. **Global byte counting ≠ frame counting.** `0x10 0x02` appears inside payloads. Only state machine transitions produce valid frame boundaries. +2. **STX count ≠ frame count.** Only STX→ETX pairs within proper state transitions count. +3. **EOF mid-frame is normal.** Capture termination during active traffic produces an incomplete trailing frame. Not an error. +4. **Layer separation.** The parser extracts frames only. Decoding block IDs, validating checksums, and interpreting semantics are responsibilities of a separate protocol decoder layer above it. + +### C.6 Parser Layer Architecture + +``` +raw_s3.bin / raw_bw.bin + ↓ +DLE Frame Parser (s3_parser.py) <- framing only + ↓ +Protocol Decoder (future) <- SUB IDs, block layout, checksums + ↓ +Semantic Interpretation <- settings, events, responses +``` + +--- + +--- + +## Appendix D — Blastware Binary File Formats (.N00 / .MLG / others) + +> ✅ CONFIRMED 2026-04-21 — all fields verified by binary diff of reconstructed vs reference +> files from the 4-3-26-multi_event capture (M529LIY6.N00, BE11529.MLG). +> +> ✅ **EXTENSION ENCODING FULLY DECODED 2026-04-22** — supersedes the earlier +> "extension encodes recording mode" hypothesis (which was wrong) AND the +> "extension encoding algorithm is unknown" note. Extensions encode a +> **timestamp** (seconds within a 21.6-minute window), NOT recording mode. +> See **D.5.2** for the full formula, confirmed against 3,248 files from a +> 10-year production archive. Cross-references throughout this appendix have +> been updated. + +### D.1 Common File Header (22 bytes) + +All Blastware files (regardless of type) share an 18-byte prefix followed by a 4-byte type tag. + +| Offset | Length | Value | Description | +|---|---|---|---| +| 0x00 | 6 | `10 00 01 80 00 00` | Fixed prefix | +| 0x06 | 10 | `Instantel\x00` | ASCII string | +| 0x10 | 2 | `07 2c` | Fixed suffix | +| 0x12 | 4 | varies | File type tag (see below) | + +**Total header: 22 bytes.** + +**Type tags:** + +| Extension | Type tag | Description | +|---|---|---| +| `AB0` / `AB0W` (Waveform) | `00 12 03 00` | Waveform event — extension encodes timestamp, see D.5.2/D.5.3 | +| `AB0H` (Histogram) | `00 12 03 00` | Histogram event — ACH only | +| `.N00` | `00 12 03 00` | Old-firmware placeholder (Waveform); `blastware_filename()` falls back to this for S338 firmware | +| `.MLG` | `22 01 0e a0` | Monitor log | + +**Extension encoding — new firmware (V10.72+) FULLY DECODED (confirmed 2026-04-22):** + +The extension differs depending on how the file was saved: + +| Download method | Extension format | Example | +|---|---|---| +| Manual / direct (Blastware connected to unit) | `AB0` (3 chars) | `.CE0` | +| Call-home / ACH | `AB0W` or `AB0H` (4 chars) | `.CE0H` | + +Where: +- `AB` = 2-char base-36 of `total_seconds % 1296`; `A = value // 36`, `B = value % 36` +- `total_seconds = (event_local_time − 1985-01-01T00:00:00_local)` in seconds +- `0` = always literal digit zero +- `W` = Full Waveform, `H` = Full Histogram (ACH only) + +Base-36 alphabet: `0–9` = 0–9, `A–Z` = 10–35. + +The 10-year production archive contains only ACH files (all end in W or H). Manual Blastware downloads produce the same `AB0` prefix but without the trailing type character. + +**3-day cycle property (confirmed 2026-04-22):** A unit recording at a fixed daily time cycles through exactly **3 different extensions** with a 3-day period. Each calendar day shifts `total_seconds % 1296` by 864 (since `86400 % 1296 = 864`). The cycle repeats every 3 days because `gcd(1296, 864) = 432`. Confirmed from archive: top 3 extensions `CE0H` (95), `0E0H` (93), `OE0H` (91) are the 3-day cycle of a 06:00:14 daily call-in (seconds-in-window = 446, 14, 878). + +**B character invariance:** `864 = 24 × 36`, so adding one day never changes `value % 36` — the second extension character is invariant for a fixed daily recording time. Only the first character cycles through 3 values. + +**Old firmware (S338):** 3-char extensions observed (`.N00`, `.EI0`, etc.) — may simply be manual downloads under the same AB0 scheme, or a different encoding. Not yet confirmed. + +**Micromate Series 4** uses a different extension format (observed: `IDFH`, `IDFW`). This formula does NOT apply to Micromate units. + +All waveform files share the same `00 12 03 00` type tag regardless of extension. Blastware identifies file type by extension, not by type tag alone. + +### D.2 Timestamp Encoding (Blastware files) + +All timestamps in N00 and MLG files use an **8-byte big-endian format**: + +| Byte | Field | +|---|---| +| 0 | day (uint8) | +| 1 | month (uint8) | +| 2–3 | year (uint16 BE) | +| 4 | `0x00` (reserved) | +| 5 | hour (uint8) | +| 6 | minute (uint8) | +| 7 | second (uint8) | + +Example: `01 04 07 ea 00 00 1c 08` → April 1, 2026, 00:28:08. + +Note: this differs from the 8-byte protocol timestamp (`[day][sub_code][month][year_HI][year_LO][0x00][hour][min][sec]` = 9 bytes) used in the device's on-wire 0C waveform records. The file format uses a compact 8-byte layout without the `sub_code` byte. + +### D.3 N00 File Format — Single-Shot Waveform Event + +**File layout:** `[22B header] [21B STRT record] [body bytes] [26B footer]` + +#### D.3.1 STRT Record (21 bytes) + +The STRT record immediately follows the 22-byte header. + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 4 | `STRT` | ASCII literal | +| 4 | 2 | `ff fe` | Fixed | +| 6 | 4 | event key (key4) | 4-byte waveform key | +| 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field | +| 14 | 6 | device-specific | NOT zero-padded — device-internal fields | +| 20 | 1 | rectime | uint8 seconds | + +**Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone. + +#### D.3.2 Body Bytes (variable) + +The body is reconstructed from the raw A5 bulk waveform stream frames by stripping DLE framing markers and taking the appropriate slice of each frame's data section. + +**Per-frame contribution (from `frame.data`):** + +| Frame | Skip amount | Notes | +|---|---|---| +| A5[0] (probe) | `7 + strt_pos_in_w0 + 21` | Skip frame.data prefix + STRT record | +| A5[1] | 13 | 7-byte prefix + 6-byte first-chunk header | +| A5[2..N] | 12 | 7-byte prefix + 5-byte chunk header | +| Terminator (page_key=0x0000) | 11 | 7-byte prefix + 4-byte terminator header | + +**DLE strip rule:** For each frame's contribution (`frame.data[skip:]`), strip any `0x10` byte immediately followed by `0x02`, `0x03`, or `0x04`. Only the `0x10` is stripped; the following byte is kept as payload. + +**Split-pair edge case:** When `frame.data[-1] == 0x10` AND `frame.chk_byte ∈ {0x02, 0x03, 0x04}`, the S3FrameParser split a DLE+XX pair at the payload/checksum boundary. Reunite the bytes before stripping (`relevant + bytes([chk_byte])`), then always remove the trailing chk_byte from the result (`stripped[:-1]`) — chk_byte is the wire checksum, never payload. + +**Body/footer split:** Accumulate all frame contributions (data frames + terminator) into `all_bytes`. Then: +- `body = all_bytes[:-26]` (variable length) +- `footer = all_bytes[-26:]` (always 26 bytes — extracted from terminator content) + +#### D.3.3 Footer (26 bytes) + +The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata. + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 2 | `0e 08` | Fixed marker | +| 2 | 8 | ts1 | Start timestamp (8B big-endian) | +| 10 | 8 | ts2 | Stop timestamp (8B big-endian) | +| 18 | 6 | `00 01 00 02 00 00` | Fixed | +| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed | + +**CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. + +### D.4 MLG File Format — Monitor Log + +**File layout:** `[308B header] [N × 292B records]` + +#### D.4.1 MLG Header (308 bytes) + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0x00 | 22 | common header | prefix + `22 01 0e a0` type tag | +| 0x16 | 16 | unknown | observed as zeros in BE11529.MLG | +| 0x2A | 8 | serial number | null-padded ASCII (e.g. `"BE11529"`) | +| 0x32 | remainder | zero pad | pads to 308 bytes total | + +#### D.4.2 MLG Record (292 bytes each) + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 2 | CRC | 2-byte CRC — algorithm unconfirmed; write as `00 00` | +| 2 | 4 | `22 01 0e 80` | Record marker | +| 6 | 8 | ts1 | Start timestamp (8B big-endian) | +| 14 | 8 | ts2 | Stop timestamp (8B big-endian); zeros if no stop | +| 22 | 4 | flags | Record type flags (see below) | +| 26 | 10 | serial | Null-padded ASCII serial number | +| 36 | variable | text | Type-dependent content | +| — | remainder | zero pad | pads to 292 bytes total | + +**Record flags:** + +| Value | Meaning | +|---|---| +| `ff ff 00 00` | Monitoring start with no stop recorded | +| `01 00 02 00` | Triggered event (has ts1 + ts2) | +| `02 00 00 00` | Monitoring interval (has ts1 + ts2) | + +**Text content for triggered events (`flags = 01 00 02 00`):** + +| Byte | Field | +|---|---| +| 0 | `0x08` | +| 1–8 | ts1 copy (8B big-endian) | +| 9+ | `"Geo: X.XXX in/s\x00"` ASCII geo threshold | + +#### D.4.3 MLG CRC + +The 2-byte CRC at record[0:2] uses an unconfirmed algorithm. Tested against CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), word sums, XOR variants, and 40+ polynomial/init combinations — none matched. The writer emits `00 00`. Blastware may reject files with incorrect CRCs (impact on import unknown — TODO: test). + +### D.5 Filename Encoding ✅ PARTIALLY CONFIRMED 2026-04-22 + +Blastware assigns waveform filenames of the form ``, where: + +#### D.5.1 Serial Prefix ✅ CONFIRMED 2026-04-22 + +The first 4 characters of the filename encode the full device serial number: + +``` +prefix_letter = chr(ord('B') + floor(serial_numeric / 1000)) +serial3 = f"{serial_numeric % 1000:03d}" (last 3 digits, zero-padded) +``` + +Where `serial_numeric` is the integer after the "BE" device-type prefix. + +Examples (all confirmed from archive): + +| Serial | serial_numeric / 1000 | prefix_letter | serial3 | Filename prefix | +|--------|----------------------|---------------|---------|-----------------| +| BE6907 | 6 | H | 907 | H907 | +| BE7145 | 7 | I | 145 | I145 | +| BE11529 | 11 | M | 529 | M529 | +| BE14036 | 14 | P | 036 | P036 | +| BE17353 | 17 | S | 353 | S353 | +| BE18003 | 18 | T | 003 | T003 | +| BE18191 | 18 | T | 191 | T191 | +| BE18676 | 18 | T | 676 | T676 | + +**Interpretation:** The prefix letter encodes the production generation (batch of 1000 units). B=generation 0 (serials 0–999), C=generation 1 (1000–1999), etc. No units with prefix A have been observed — the earliest known units start around serial 2000+ (prefix D). + +**Note:** The "BE" device-type prefix is implicit. The filename only encodes the numeric part of the serial. Other Instantel device types (Micromate, Blastmate) may use a different scheme. + +#### D.5.2 Stem + Extension — full timestamp encoding ✅ FULLY CONFIRMED 2026-04-22 + +The stem (4 chars) and AB extension (2 chars) together form a 6-digit base-36 number encoding a complete second-resolution timestamp: + +```python +total_seconds = stem_int * 1296 + ab_int +event_local_time = datetime(1985, 1, 1) + timedelta(seconds=total_seconds) +``` + +- **Epoch:** `1985-01-01 00:00:00` **device local time** ✅ CONFIRMED — verified against 3,248 files from a 10-year production archive; zero errors (only 2 mismatches were Micromate `IDFH`/`IDFW` files which use a completely different naming scheme) +- **Unit:** 1296 seconds = 36² ≈ 21.6 minutes per stem increment +- **Alphabet:** `"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"` (digits then uppercase letters) +- **Collision:** Events within the same 21.6-minute window share a stem; extension distinguishes them + +**Decoding example — `P036L318.C80H` (BE14036, Full Histogram):** +``` +stem L318 = 21×36³ + 3×36² + 1×36 + 8 = 983,708 +AB C8 = 12×36 + 8 = 440 +total_sec = 983,708 × 1296 + 440 = 1,274,886,008 +event_time = 1985-01-01 + 1,274,886,008s = 2025-05-26 15:00:08 local +``` + +**Note on local time:** The device's onboard clock is set to the local timezone of the deployment site. The epoch and all timestamps are in that same local time — there is no UTC conversion. Files moved between timezones will decode to the original deployment timezone. + +#### D.5.3 Extension taxonomy — historical rewrite (FULLY DECODED 2026-04-22) + +The extension third character is always `'0'`. The full encoding scheme is now +mapped — see **D.5.2** for the canonical formula. The earlier "recording-mode" +taxonomy in this section was wrong and has been removed. + +**Summary (new firmware V10.72+ via ACH download):** + +``` +Extension = AB0T + +AB = base-36 of (total_seconds % 1296) — seconds within the 21.6-min window +0 = literal digit zero (invariant third character) +T = W (Waveform) | H (Histogram) — present only for ACH downloads +``` + +Direct/manual Blastware downloads produce `.AB0` (3 chars, no trailing type +character). `blastware_filename()` in `minimateplus/blastware_file.py` +implements the formula; it falls back to `.N00` as a placeholder for +old-firmware units (S338) where the extension encoding has not been confirmed. + +The previously listed extensions `.9T0` / `.490` / `.5K0` / `.980` / `.ML0` +were the **same continuous-mode unit recording at different times of day**. +Their bytes were byte-for-byte identical except for header fields that change +per event — exactly what D.5.2 predicts: same firmware, same recording mode, +different timestamp → different extensions. No correlation with recording mode. + +| Extension type char (4-char ACH) | Meaning | +|---|---| +| `W` | Full Waveform | +| `H` | Full Histogram | + +**Micromate Series 4** uses a different scheme entirely (`IDFH`, `IDFW` +observed) and does NOT follow the AB0T formula. + +**DLE-shift offset note for reading recording_mode from N00/9T0 body:** + +The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: + +| 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) | +|---|---| +| `file[anc−7]` = recording_mode | `file[anc−8]` = recording_mode | +| `file[anc−6:anc−4]` = sample_rate | `file[anc−6:anc−4]` = sample_rate | + +For 1024 sps files, the expected file bytes around the anchor are: +``` +file[anc−9]: mode_prefix (0x00 for Single Shot/Continuous; 0x10 for Histogram) +file[anc−8]: 0x00 (was recording_mode, but shifted away — now reads 0x00 for mode_prefix) +file[anc−7]: recording_mode (0x00=Single Shot, 0x01=Continuous, etc.) +file[anc−6]: 0x04 (sample_rate_HI for 1024 sps) +file[anc−5]: 0x00 (sample_rate_LO) +file[anc−4]: histogram_interval_HI +file[anc−3]: histogram_interval_LO +``` + +--- + +*All findings reverse-engineered from live RS-232 bridge captures.* +*Cross-referenced from 2026-03-02 with Instantel MiniMate Plus Operator Manual (716U0101 Rev 15).* +*This is a living document — append changelog entries and timestamps as new findings are confirmed or corrected.* + +--- + +## Appendix E — Known Device Faults (field-observed, 2026-08-25) + +This appendix records *device* behaviour, not protocol. It exists +because these signatures are easy to mistake for decoder bugs — and one +of them was, for a while. + +### E.1 The "offset" fault + +> **The full investigation now lives in `docs/offset_investigation.md`** -- +> base rate, detector definition, per-unit case files, ruled-out hypotheses, +> and Instantel's own autozero procedure with its 2027-2069 acceptance +> window. This appendix is kept as the protocol-side summary. + +**Symptom.** One geophone channel's baseline steps away from zero and +stays there. The trace still carries the real AC signal, but it rides +on a DC pedestal of a few tenths of an in/s. Operators call this an +"offset"; it is a known recurring hardware fault, historically resolved +by returning the unit to Instantel, shelving it until calibration, or a +per-channel re-zero in an advanced/professional Blastware build. + +**Why it floods the queue.** The pedestal exceeds the unit's own geo +trigger level, so the channel sits permanently above threshold and the +unit retriggers as fast as it can rearm — one event every 3–7 minutes +for as long as the fault persists. In the surveyed snapshot the worst +episode produced 193 events in 38 hours. + +| unit | window | events | channel | pedestal | that unit's trigger level | +|---|---|---|---|---|---| +| BE9558 | 2026-05-15 → 05-16 | 193 | Long | +0.335 | 0.200 | +| BE18438 | 2026-02-25 → 02-26 | 64 | Vert | +0.327 | 0.200 | +| BE18438 | 2025-11-15 | 12 | Vert | +0.312 | 0.200 | +| BE9558 | 2026-04-14 / 04-29 / 05-04 | 5 total | Tran | +0.29…+0.44 | 0.200 | + +**It is NOT a decode artifact.** These events reproduce *exactly* in +Blastware's own ASCII export — e.g. `BE12599/N599LQD7.8E0W` Tran reads +mean +0.345, min +0.335, max +0.355 in both our decode and BW's. Any +shape-based false-trigger detector must treat this as a real device +condition, not corrupt data. + +**Detection rule that works:** + +``` +dominant geo axis: |mean| / peak > 0.7 + AND: |mean| >= 0.9 x that unit's geo trigger level +group hits into episodes by serial with a 12 h gap +``` + +A bare `|mean|/peak` threshold is useless — a quiet trace sitting at the +0.010 in/s noise floor clears any ratio test. On the surveyed store the +bare rule flagged 7,184 events; the rule above flags 274, all real. +Candidate list: `scratch/offset_candidates.csv`. + +**What the data rules out.** + +- *Not the geophone.* The on-device sensor check passes on every unit, + offset or not — test frequency 7.2–8.1 Hz, damping ratio 3.3–4.7, + zero failures fleet-wide, including mid-episode. The coil and its + mechanical response are healthy. +- *Not the battery.* 6.6–6.8 V on the affected units, same as the rest. +- *Not environmental.* Only 2 units of 21 ever show it. BE17353 logged + 395 waveform events over nine months with zero occurrences; BE7145, + 295 events, zero. Weather acts on all of them equally. +- *Not condensation.* BE18438's Vert held 0.179 → 0.189 for 34 hours + **including a 10-hour overnight gap**, then stepped to 0.33 at 13:24 + in the afternoon. Dew would peak overnight; it was flat overnight. + +**What the data shows.** The pedestal is *piecewise constant* — it +holds rock-steady, survives power-off gaps, and changes only in discrete +steps. A small common-mode diurnal wobble rides on top of it, but that +wobble is present on the healthy channels too (it is the unit's normal +thermal breathing) and is not the fault. + +**The fault is on the geophone side.** Operator report (2026-08-25): +*attaching a different geophone to an affected unit makes the offset go +away.* That is the channel-swap test, already run in the field many +times, and it rules out the unit's analog front-end and any stored +per-channel zero constant — a constant lives in the unit and would +survive a sensor swap. + +The stored data agrees. MicL — a separate transducer on its own cable — +shows no offset during either episode (`|mean|/peak` = 0.17 and 0.02), +while the geo channels on the same unit at the same moment are pinned. + +**Two distinct failure patterns**, both geophone-side: + +| unit | Tran | Vert | Long | MicL | reading | +|---|---|---|---|---|---| +| BE18438 | 0.16 | **0.97** | 0.18 | 0.02 | one element only | +| BE9558 | 0.90 | 0.81 | **0.99** | 0.17 | all three, Long dominant | + +(values are `\|mean\|/peak` on the dominant axis) + +BE18438 has a single faulted conductor pair with the other two clean. +BE9558 has all three geo channels offset by different amounts +(Long +0.340, Tran +0.037, Vert −0.020) — that points at a shared return +or ground path in the housing rather than one element. + +**Candidate mechanisms.** A geophone coil is passive and cannot +generate sustained DC on its own, so an offset originating on the sensor +side has to come from one of: + +1. *Galvanic corrosion at a connector or splice* — dissimilar metals + plus moisture form a literal cell. This generates DC directly, in + the tens-of-millivolts range that matches the measured offset + (0.29 in/s ÷ 6.206053 in/s per volt ≈ 46 mV referred to the ADC + input). Fits the discrete steps, surviving power cycles, and being + cured by swapping the sensor. +2. *A leakage path to shield or another conductor*, letting the unit's + own bias/reference divide into the signal pair. Best fit for the + BE9558 all-three-channels pattern. +3. *Changed coil DC resistance* (partial short or degraded winding) + interacting with the amplifier's input bias current — + `V_offset = I_bias × R_source`. Best fit for the BE18438 + single-element pattern. Note the on-device sensor check would not + catch this: it measures ring-down frequency and damping, not DC. + +**Caveat on the swap test.** Swapping a geophone requires stopping and +restarting monitoring, and these units run Sensor Check "Before +monitoring" — so the restart also re-zeros the channels. The swap +therefore does not cleanly separate *"new sensor"* from *"the restart +re-zeroed it"*. Two cheap controls settle it: restart monitoring +**without** swapping (if the offset clears, it was the re-zero), or swap +the **original** sensor back (if the offset returns, it is the sensor). +The operator's remedy being a swap rather than a restart is weak +evidence for the sensor, since a restart is the easier thing to try +first. + +**Best single measurement when it recurs:** DC voltage across the +suspect geophone's connector pins with the sensor **disconnected from +the unit**. A galvanic cell (mechanism 1) shows an open-circuit +voltage; mechanisms 2 and 3 do not. + +**Note:** the surveyed population is subject to survivorship bias — +flooded events were routinely deleted before this snapshot, so units +that look clean here may have had episodes that were scrubbed. diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index c1cbfbd..b0f02f2 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -354,6 +354,30 @@ Each safety piece arrives with its first real use, so nothing sits untested. Measured for Series 4: 1,016/1,016 watcher imports found by the lookup (2026-10-21). - a dropped reply, via `bridges/mm_link.py`-style fault injection. + + **First run, 2026-10-25, on BE9441** (S338.17, mic disabled, serial + cable). It found four bugs; all four are fixed with tests built on its + logged bytes (`a8cc516`, `352f694`, `75d79ec`, `36f4e5d`, `d73a27d`). + - ✅ **List: 20 events,** in order, with distinct keys. The header walk + advances. + - ❌→✅ **A non-first event:** stored 2 bytes short, so it decoded + truncated. The body builder assumed metadata pages in every stream. + Fixed. A Series-3 download is now checked against the unit's own + peaks, so this class of bug is refused rather than stored. + - ❌→✅ **The first request after the port opens failed.** The unit + boots on connect, and its banner came ~3 s after the POLL had already + gone out. Fixed: startup waits for a unit it sees booting. + - ❌→✅ **A reboot mid-download stored a partial event as a success.** + This was the dropped reply, occurring live. Fixed: a one-event + download is whole or it is an error. + - Still owed: + - a re-run with the fixes in place; + - a histogram event (this unit records single shot); + - an event that *spans* the 64 KB page boundary. Event 3 sits in page + `0x12`, but within that one page; + - the stale-id check; + - `already_stored` against Blastware's copy; + - start/stop through the new path. - **Download = fetch, check, store** in SFM's database, the same as Series 3's `blastware_file` route, and returns the stored row's id. The file and waveform are then served by the existing `/db/events/{id}/…` -- 2.54.1 From 151782365bac768c72a3fc44087afb8ade0a4ce3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:41:53 -0400 Subject: [PATCH 091/223] docs: restore the Series-III reference's CRLF line endings; the pre-trigger is 0.25 s 3898d03 rewrote docs/instantel_protocol_reference.md with LF endings (a 7,327-line diff for 3 added lines). CRLF restored; the file's real change is the 3 lines. Also: BE9441's 21,504 samples are 5 s record + 0.25 s pre-trigger at 4096 sps, not '+ 1 s' (reference row, fixture README, test comment). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- docs/instantel_protocol_reference.md | 7330 ++++++++--------- .../minimate-bench-10-25-26/README.md | 2 +- tests/test_minimate_body_no_metadata.py | 2 +- 3 files changed, 3667 insertions(+), 3667 deletions(-) diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 1212e70..618383a 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -1,3665 +1,3665 @@ -# Instantel MiniMate Plus — Blastware RS-232 Protocol Reference -### "The Rosetta Stone" -> Reverse-engineered via RS-232 serial bridge sniffing between Blastware software and an Instantel MiniMate Plus seismograph (S/N: BE18189). -> Cross-referenced against Instantel MiniMate Plus Operator Manual (716U0101 Rev 15) from v0.18 onward. -> **Certainty Ratings:** ✅ CONFIRMED | 🔶 INFERRED | ❓ SPECULATIVE -> Certainty ratings apply only to protocol semantics, not to capture tooling behavior. - ---- - -## Changelog - -| Date | Section | Change | -|---|---|---| -| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s plus 1 s pre-trigger), all three channels equal, peaks equal to the unit's own 0C values. | -| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | -| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | -| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | -| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | -| 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. | -| 2026-05-20 | §2, §3, §4.2, §5.1, §5.3, §6, §7.5b, §7.6.1, §7.6.3, §7.6.4, §7.7.2, §7.7.3, §7.7.5, §7.8.4, §7.8.7, §7.9, §8, §11, §12, §13, §14, §15, Appendix D | **DOC AUDIT PASS — accuracy sweep against `CLAUDE.md` + `minimateplus/` code.** Fixed: (1) S3 frames terminate on bare ETX, not DLE+ETX — §2/§3 rewritten. (2) §3 payload layout corrected — byte[1]=flags, byte[2]=SUB (was wrongly labelled DLE/ADDR). (3) §4.2 — probe responses do NOT carry data length; lengths are hardcoded `DATA_LENGTHS` constants. (4) §5.1 — removed stale duplicate "SUB 1C = TRIGGER CONFIG READ" row; SUB 0A lengths corrected from `0x30/0x26` to `0x46/0x2C` (real event / boundary marker). (5) §5.3 — added missing write-frame format (BW_CMD-only doubling, DLE-aware checksum, offset formula, ack format, SUB 71 chunk parameters). (6) §6 — fixed "SUB 06 → channel config read" → event storage range. (7) §7.5b / §8 — added the 10-byte `sub_code=0x03` continuous-mode timestamp variant alongside the 9-byte single-shot layout; peak vector sum location corrected from "fixed offset 87" to `tran_pos − 12` (label-relative). (8) §7.6 / §7.6.1 / §7.6.3 / §7.6.4 — switched compliance-anchor convention from the 10-byte form to the canonical 6-byte `\xbe\x80\x00\x00\x00\x00`; recording_mode confirmed at anchor−8 in BOTH read and write (was wrongly listed as anchor−3 write / anchor−4 read); sample_rate at anchor−6, histogram_interval at anchor−4, record_time at anchor+6; geo_range row added at channel_label+33. (9) §7.7.2 — token byte position corrected from `params[6]` to `params[7]`. (10) §7.8.4 — fi==9 skip marked FIXED (already removed from code); chunk-count totals updated. (11) §7.8.7 — TODO replaced with current state of `_decode_a5_metadata_into`. (12) §7.9 — Histogram Interval upgraded ❓ → ✅. (13) §11 — POLL example wire bytes corrected; SUB 5A row added to checksum table. (14) §13 — device-under-test updated for current primary unit (BE11529 / S338.17). (15) §14 — TCP Idle Timeout fixed (0→2 min); Data Forwarding Timeout units clarified. (16) §15 (renumbered from second §14) — open-question items already resolved in CLAUDE.md closed out. (17) Appendix D — extension taxonomy rewritten to reflect the AB0T timestamp encoding (D.5.2/D.5.3); EXTENSION REFUTED warning replaced with the resolved encoding. | -| 2026-05-08 | §7.6.1 (RETRACTION) | **❌ RETRACTED — "raw int16 LE 8 bytes/sample-set" body codec was never validated.** The original 4-2-26 confirmation was based on misreading broken-decoder output (full-scale ±32K noise) as evidence the signal had saturated. BW's own 0C peaks for that capture (Tran=0.420 / Vert=3.870 / Long=0.495 in/s) prove the signal was NOT saturated — none of those exceed 13K ADC counts. No event in the project's archive has ever come close to saturation, yet the decoder consistently produces ±32K noise on every event. Conclusion: the body codec is not raw int16 LE; the actual encoding is open. Body byte distribution is heavily skewed (24% `0x00`, 10.5% `0x10`, lots of `10 XX` pairs) — likely a delta encoding with `0x10` as escape, but unverified. Retraction box added at top of §7.6.1; "fully-saturating event" claim removed from channel-identification note. The histogram codec in §7.6.2 IS verified and decoded correctly (different recording mode, 32-byte blocks); use it as a structural hint when reverse-engineering the waveform codec. | -| 2026-02-26 | Initial | Document created from first hex dump analysis | -| 2026-02-26 | §2 Frame Structure | **CORRECTED:** Frame uses DLE-STX (`0x10 0x02`) and DLE-ETX (`0x10 0x03`), not bare `0x02`/`0x03`. `0x41` confirmed as ACK not STX. DLE stuffing rule added. | -| 2026-02-26 | §8 Timestamp | **UPDATED:** Year `0x07CB = 1995` confirmed as MiniMate hardware default date when RTC battery is disconnected. Not an encoding error. Confidence upgraded from ❓ to 🔶. | -| 2026-02-26 | §10 DLE Stuffing | **UPGRADED:** Section upgraded from ❓ SPECULATIVE to ✅ CONFIRMED. Full stuffing rules and parser state machine documented. | -| 2026-02-26 | §11 Checksum | **UPDATED:** Frame builder and parser rewritten to handle DLE framing and byte stuffing correctly. | -| 2026-02-26 | §14 Open Questions | DLE question removed (resolved). Timestamp year question removed (resolved). | -| 2026-02-26 | §7.2 Serial Number Response | **CORRECTED:** Trailing bytes are `0x79 0x11` only (2 bytes, not 3). `0x20` was misidentified as a trailing byte — it is the frame checksum. | -| 2026-02-26 | §7.2 Serial Number Response | **UPDATED:** Two-unit comparison confirms `0x11` = firmware minor version (S337.**17** → `0x11` = 17). Byte 0 is unit-specific, derivation unknown. | -| 2026-02-26 | §15 Binary Log Format | **NEW:** `.bin` logger format strips DLE from ETX (`0x10 0x03` → `0x03`). Not raw wire bytes. | -| 2026-02-26 | §5.1 Request Commands | **ADDED:** Three new read commands confirmed: SUB `09`, `1A`, `2E`. | -| 2026-02-26 | §5.3 Write Commands | **NEW SECTION:** Full write command family documented from compliance setup capture. SUBs `68`–`83`. | -| 2026-02-26 | §7.5 Full Waveform Record | **UPDATED:** Project strings field layout fully mapped from write payload diff. Client field confirmed at byte +230 in SUB `71` frame. | -| 2026-02-26 | §14 Open Questions | Write commands question resolved. Session `152427` had swapped port labels — superseded by sessions `184518` and `185019`. | -| 2026-02-26 | Global | **CORRECTED:** Firmware version `S338.17` → `S337.17` everywhere, including hex encoding at config offset `0x34`. | -| 2026-02-26 | §3 Payload Structure | **DOWNGRADED:** ADDR field certainty `🔶 INFERRED` → `❓ SPECULATIVE`. Added note that bytes 1–2 purpose is unconfirmed. | -| 2026-02-26 | §5.2 Response SUBs | **STRENGTHENED:** `0xFF - SUB` rule wording clarified — high confidence, no counterexample, not yet formally proven. | -| 2026-02-26 | §15 → Appendix A | **RENAMED:** Binary log format section moved to Appendix A with explicit note that it describes tooling behavior, not protocol. | -| 2026-02-26 | Header | **ADDED:** Certainty legend clarification — ratings apply to protocol semantics only, not tooling behavior. | -| 2026-02-26 | §7.6 Channel Config Float Layout | **NEW SECTION:** Trigger level confirmed as IEEE 754 BE float in in/s. Alarm level identified as adjacent float = 1.0 in/s. Unit string `"in./s"` embedded inline. `0x082A` removed as trigger level candidate. | -| 2026-03-01 | §7.6 Channel Config Float Layout | **UPGRADED:** Alarm level offset fully confirmed via controlled capture (alarm 1.0→2.0, trigger 0.5→0.6). Complete per-channel layout documented. Three-channel repetition confirmed (Tran, Vert, Long). Certainty upgraded to ✅ CONFIRMED. | -| 2026-03-01 | §7.7 `.set` File Format | **NEW SECTION:** Blastware save-to-disk format decoded. Little-endian binary struct matching wire protocol payload. Full per-channel block layout mapped. Record time confirmed as uint32 at +16. MicL unit string confirmed as `"psi\0"`. `0x082A` mystery noted — not obviously record time, needs one more capture to resolve. | -| 2026-03-02 | §7.4 Event Index Block | **CONFIRMED:** Backlight and power save offsets independently confirmed via device-set capture (backlight=100=0x64 at +75, power-save=30=0x1E at +83). On-device change visible in S3→BW read response — no Blastware write involved. Offsets are ✅ CONFIRMED. | -| 2026-03-02 | §7.4 Event Index Block | **NEW:** `Monitoring LCD Cycle` identified at offsets +84/+85 as uint16 BE. Default value = 65500 (0xFFDC) = effectively disabled / maximum. Confirmed from operator manual §3.13.1g. | -| 2026-03-02 | §7.4 Event Index Block | **UPDATED:** Backlight confirmed as uint8 range 0–255 seconds per operator manual §3.13.1e ("adjustable timer, 0 to 255 seconds"). Power save unit confirmed as minutes per operator manual §3.13.1f. | -| 2026-03-02 | Global | **NEW SOURCE:** Operator manual (716U0101 Rev 15) added as reference. Cross-referencing settings definitions, ranges, and units. Header updated. | -| 2026-03-02 | §14 Open Questions | Float 6.2061 in/s mystery: manual confirms only two geo ranges (1.25 in/s and 10.0 in/s). 6.2061 is NOT a user-selectable range → originally speculated as internal ADC full-scale constant, but was NOT confirmed at this time. Using it directly as the range produces ~9× PPV overread. Meaning unknown. Downgraded to LOW 2026-03-02, re-escalated to HIGH 2026-04-16. **RESOLVED 2026-04-17 — see §7.6.2 and changelog entry.** | -| 2026-03-02 | §14 Open Questions | `0x082A` hypothesis refined: 2090 decimal. At 1024 sps, 2 sec record = 2048 samples. Possible that 0x082A = total samples including 0.25s pre-trigger (256 samples) at some adjusted rate. Needs capture with different record time. | -| 2026-03-02 | §14 Open Questions | **NEW items added:** Trigger sample width (default=2), Auto Window (1-9 sec), Aux Trigger (enabled/disabled) — all confirmed settings from operator manual not yet mapped in protocol. | -| 2026-03-02 | §14 Open Questions | Monitoring LCD Cycle resolved — removed from open questions. | -| 2026-03-02 | Appendix A | **CORRECTED:** Previous entry stated logger strips DLE from ETX. This was wrong — it applied to an older logger version. `s3_bridge v0.5.0` confirmed to preserve raw wire bytes including `0x10 0x03` intact. HxD inspection of new capture confirmed `10 03` present in S3→BW record payloads. | -| 2026-03-02 | Appendix A | **UPDATED:** New capture architecture: two flat raw wire dumps per session (`raw_s3.bin`, `raw_bw.bin`), one per direction, no record wrapper. Replaces structured `.bin` format for parser input. | -| 2026-03-02 | Appendix A | **PARSER:** Deterministic DLE state machine implemented (`s3_parser.py`). Three states: `IDLE → IN_FRAME → AFTER_DLE`. Replaces heuristic global scanning. Properly handles DLE stuffing (`10 10` → literal `10`). Only complete STX→ETX pairs counted as frames. | -| 2026-03-02 | Appendix A | **VALIDATED:** `raw_bw.bin` yields 7 complete frames via state machine. `raw_s3.bin` contains large structured responses (first frame payload ~3922 bytes). Both files confirmed lossless. BW bare `0x02` pattern confirmed as asymmetric framing (BW sends bare STX, S3 sends DLE+STX). | -| 2026-03-09 | §7.6, §Appendix B | **CONFIRMED:** Record time located in SUB E5 data page2 at payload offset `+0x28` as **float32 BE**. Confirmed via two controlled captures: 7 sec = `40 E0 00 00`, 13 sec = `41 50 00 00`. Geo range (only 1.25 or 10.0 in/s) eliminates ambiguity — 7 and 13 are not valid geo range values. | -| 2026-03-09 | §7.5, §14 | **CORRECTED:** The byte `0x0A` appearing after the "Extended Notes" null-padded label in the E5 payload is **NOT** record time. It is an unknown field that equals 10 and does not change when record time changes. False lead closed. | -| 2026-03-09 | §14 | **RESOLVED:** `0x082A` mystery closed — confirmed as fixed-size E5 payload length (2090 bytes), not a record-time-derived sample count. Value is constant regardless of record time or other settings. | -| 2026-03-09 | §7.8, §14, Appendix B | **NEW — Trigger Sample Width confirmed:** Located in BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Confirmed via BW-side capture (`raw_bw.bin`) diffing two sessions: Width=4 → `0x04`, Width=3 → `0x03`. Setting is **transmitted only on BW→S3 write** (SUB `0x82`), invisible in S3-side compliance dumps. | -| 2026-03-09 | §14, Appendix B | **CONFIRMED — Mode gating is a real protocol behavior:** Several settings are only transmitted (and possibly only interpreted by the device) when the required mode is active. Trigger Sample Width is only sent when in Compliance/Single-Shot/Fixed Record Time mode. Auto Window is only relevant when Record Stop Mode = Auto — attempting to capture it in Fixed mode produced no change on the wire (F7 and D1 blocks identical before/after). This is an architectural property, not a gap in the capture methodology. Future capture attempts for mode-gated settings must first activate the appropriate mode. | -| 2026-03-09 | §14 | **UPDATED — Auto Window:** Capture attempted (Auto Window 3→9) in Fixed record time mode. No change observed in any S3-side frame (F7, D1, E5 all identical). Confirmed mode-gated behind Record Stop Mode = Auto. Not capturable without switching modes — deferred. | -| 2026-03-11 | §14, Appendix B | **CONFIRMED — Aux Trigger read location:** SUB `FE` (FULL_CONFIG_RESPONSE), destuffed payload offset `0x0109`, uint8. `0x00` = disabled, `0x01` = enabled. Confirmed via controlled capture: changed Aux Trigger in Blastware, sent to unit, re-read config. FE diff showed clean isolated flip at `0x0109` with only 3 other bytes changing (likely counters/checksums at `0x0033`, `0x00C0`, `0x04ED`). | -| 2026-03-11 | §14, Appendix B | **PARTIAL — Aux Trigger write path:** Write command not yet isolated. The BW→S3 write appears to occur inside the A4 (POLL_RESPONSE) stream via inner frame handshaking — multiple WRITE_CONFIRM_RESPONSE inner frames (SUBs `7C`, `7D`, `8B`, `8C`, `8D`, `8E`, `96`, `97`) appeared in A4 after the write, and the TRIGGER_CONFIG_RESPONSE (SUB `E3`) inner frames were removed. Write command itself not yet captured in a clean session — likely SUB `15` or embedded in the partial session 0. Write path deferred for a future clean capture. | -| 2026-03-11 | §4, §14 | **NEW — SUB A4 is a composite container frame:** A4 (POLL_RESPONSE) payload contains multiple embedded inner frames using the same DLE framing (10 02 start, 10 03 end, 10 10 stuffing). Phase-shift diffing issue resolved in s3_analyzer.py by adding `_extract_a4_inner_frames()` and `_diff_a4_payloads()` — diff count reduced from 2300 → 17 meaningful entries. | -| 2026-03-11 | §14 | **NEW — SUB `6E` response anomaly:** BW sends SUB `1C` (TRIGGER_CONFIG_READ) and S3 responds with SUB `6E` — does NOT follow the `0xFF - SUB` rule (`0xFF - 0x1C = 0xE3`). Only known exception to the response pairing rule observed to date. SUB `6E` payload starts with ASCII string `"Long2"`. ~~CORRECTION 2026-04-08: This "exception" was a misidentification. The `1C` in that capture was BW→S3 (a monitor status poll), and the `6E` response was from an inner A4 sub-frame misread as a top-level S3 frame. Confirmed from 4-8-26/2ndtry capture (338 BW TX frames): SUB 0x1C always receives response SUB 0xE3 (= 0xFF − 0x1C). No exceptions to the response pairing rule are known.~~ | -| 2026-03-12 | §11 | **CONFIRMED — BW→S3 large-frame checksum algorithm:** SUBs `68`, `69`, `71`, `82`, and `1A` (with data) use: `chk = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) % 256` — SUM8 of payload bytes `[2:-1]` skipping all `0x10` bytes, plus `0x10` as a constant, mod 256. Validated across 20 frames from two independent captures with differing string content (checksums differ between sessions, both validate correctly). Small frames (POLL, read commands) continue to use plain SUM8 of `payload[0:-1]`. The two formulas are consistent: small frames have exactly one `0x10` (CMD at `[0]`), which the large-frame formula's `[2:]` start and `+0x10` constant account for. | -| 2026-03-12 | §11 | **RESOLVED — BAD CHK false positives on BW POLL frames:** Parser bug — BW frame terminator (`03 41`, ETX+ACK) was being included in the de-stuffed payload instead of being stripped as framing. BW frames end with bare `0x03` (not `10 03`). Fix: strip trailing `03 41` from BW payloads before checksum computation. | -| 2026-03-30 | §3, §5.1 | **CONFIRMED — BW→S3 two-step read offset is at payload[5], NOT payload[3:4].** All BW read-command frames have `payload[3] = 0x00` and `payload[4] = 0x00` unconditionally. The two-step offset byte lives at `payload[5]`: `0x00` for the length-probe step, `DATA_LEN` for the data-fetch step. Validated against all captured frames in `bridges/captures/3-11-26/raw_bw_*.bin` — every frame is an exact bit-for-bit match when built with offset at `[5]`. The `page_hi`/`page_lo` framing in the docstring was a misattribution from the S3-side response layout (where `[3]`/`[4]` ARE page bytes). | -| 2026-03-30 | §4, §5.2 | **CONFIRMED — S3 probe response page_key is always 0x0000.** The S3 response to a length-probe step does NOT carry the data length back in `page_hi`/`page_lo`. Both bytes are `0x00` in every observed probe response. Data lengths for each SUB are fixed constants (see §5.1 table). The `minimateplus` library now uses a hardcoded `DATA_LENGTHS` dict rather than trying to read the length from the probe response. | -| 2026-03-31 | §12 TCP Transport | **NEW SECTION — TCP/modem transport confirmed transparent from Blastware Operator Manual (714U0301 Rev 22).** Key facts confirmed: (1) Protocol bytes over TCP are bit-for-bit identical to RS-232 — no handshake framing. (2) No ENQ byte on TCP connect (`Enable ENQ on TCP Connect: 0-Disable` in Raven ACEmanager). (3) Raven modem `Data Forwarding Timeout = 1 second` — modem buffers serial bytes up to 1s before forwarding over TCP; `TcpTransport.read_until_idle` uses `idle_gap=1.5s` to compensate. (4) TCP port is user-configurable (12335 in manual example; user's install uses 12345). (5) Baud rate over serial link to modem is 38400,8N1 regardless of TCP path. (6) ACH (Auto Call Home) = INBOUND to server (unit calls home); "call up" = OUTBOUND from client (Blastware/SFM connects to modem IP). `TcpTransport` implements outbound (call-up) mode. | -| 2026-03-31 | §14.3 | **NEW — Sierra Wireless RV50/RV55 Quiet Mode requirement confirmed.** Quiet Mode (ATQ) must be **enabled** on the serial port. When disabled (+ Verbose mode on), the modem injects `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time — MiniMate receives unexpected bytes, loses protocol sync, and never responds to POLL (unit beeps but returns no S3 frame). Working RV50 field config: Quiet Mode enabled, Data Forwarding Timeout=1, TCP Connect Response Delay=0. Misconfigured RV55 had all three wrong. | -| 2026-03-31 | §14.2 | **CORRECTED — Sierra Wireless RV50/RV55 sends `RING`/`CONNECT` over TCP to caller even with Quiet Mode enabled.** Quiet Mode suppresses these only on the serial port (protecting the MiniMate). TCP client still receives `\r\nRING\r\n\r\nCONNECT\r\n` prefixed before the first S3 frame bytes. Parser handles correctly by scanning for DLE+STX (`0x10 0x02`) and discarding prefix bytes. Previous note "no CONNECT string" described Raven X ENQ-disable behaviour; RV50/RV55 differ. | -| 2026-03-31 | §7.3 | **NEW — Calibration date field confirmed** at Full Config (SUB FE) destuffed payload offsets 0x53–0x57. Two-unit comparison: BE18189 (calibrated 2023) has `07 E7` at 0x56–0x57; BE11529 (calibrated 2025) has `07 E9`. Bytes 0x56–0x57 = uint16 BE calibration year ✅ CONFIRMED. Adjacent bytes at 0x53–0x55 likely encode month/day (both units show `0x10` at offset 0x54 = BCD October; 0x53 and 0x55 differ between units). Full date layout 🔶 INFERRED — pending third-unit capture or recalibration diff. Resolves open question. | -| 2026-03-31 | §9 | **CONFIRMED via Console cold-start capture** — `"Operating System"` (16 B: `4f 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d`) arrives as first TCP bytes on cold-connect before unit enters DLE-framed mode. `TcpTransport` + retry logic handles gracefully: first attempt times out waiting for SUB A4; second connect (after unit fully booted) succeeds. | -| 2026-04-01 | §7.7.5, §8 | **CONFIRMED — Full waveform record (0C) timestamp layout** cross-referenced against Blastware event report for BE11529 thump event ("00:28:12 April 1, 2026"). 9-byte format at bytes[0–8]: `[day][sub_code][month][year:2 BE][unknown][hour][min][sec]`. All fields verified. Sub_code `0x10` = Waveform (continuous/single-shot). **Previous 7-byte format doc was wrong** — replaced with confirmed 9-byte layout. | -| 2026-04-01 | §7.7.5 | **CONFIRMED — Record type** encoded in byte[1] (sub_code), not as ASCII string. `0x10` = Waveform ✅. Histogram sub_code not yet captured. ASCII string search approach removed. | -| 2026-04-01 | §7.7.5, §14 | **CONFIRMED — Per-channel PPV** at label+6 (✅ all four channels), cross-referenced vs Blastware: Tran=0.420, Vert=3.870, Long=0.495 in/s. **CONFIRMED — Peak Vector Sum** at fixed offset 87 = 3.906 in/s ✅ matches Blastware "Peak Vector Sum". Is √(Tran²+Vert²+Long²) at max instantaneous vector moment, not vector sum of per-channel peaks. Open question "offset 87 purpose" closed. | -| 2026-04-01 | §8 | **RESOLVED — §8 unknown byte at offset 3.** Field is confirmed absent in the 9-byte waveform record format (no such field). The 6-byte event-index format has a separator byte at [3] whose purpose remains ❓ but is no longer actively blocking anything. | -| 2026-04-01 | §7.6.2 (NEW) | **NEW — SUB 1A multi-frame read protocol documented.** SUB 1A (compliance config read) requires a 4-frame sequence, not a simple 2-step probe+fetch. Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture, ACK+STX/ETX format, BW CMD=0x10). Sequence: (A) probe `offset=0x0000, params=...00 64 00 00`; (B) data request `offset=0x0400, params=...00 64 00 00`; (C) data request `offset=0x0400, params=...04 00 00 64 00 00`; (D) data request `offset=0x002A, params=...08 00 00 64 00 00`. E5 response to each frame carries a `page_key` field (bytes `data[3:5]`): page `0x0000` = 44-byte header chunk, page `0x0010` = main config data (~1027+1055 bytes across C and D). | -| 2026-04-01 | §7.6.2 | **NEW — BE11529 duplicate-page behaviour.** BE11529 (firmware S338.17) sometimes responds to frame D with page `0x0000` (44 bytes) instead of page `0x0010` (~1055 bytes). When this happens, frame D is an exact duplicate of frame B and must be dropped to prevent cfg mis-alignment. Detection: track `(page_key, chunk_len)` pairs and skip repeats. When frame D delivers page `0x0010` correctly, total cfg = 44 + 1027 + 1055 = 2126 bytes; with duplicate D, cfg = 44 + 1027 = 1071 bytes. Both are valid inputs to the decoder. | -| 2026-04-01 | §7.6.1 | **CORRECTED — Record time offset.** Previous doc (`+0x28` from E5 data page2 start) was correct for single-frame reads but unreliable for BE11529 due to a 1-byte DLE jitter (see §7.6.3). The `minimateplus` library now uses an anchor-based approach: search for `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100]; record time float32 BE is at anchor+10. Validated at 3.0, 5.0, and 8.0 seconds. | -| 2026-04-01 | §7.6.3 (NEW) | **NEW — Sample rate confirmed and documented.** Sample rate (Normal=1024 / Fast=2048 / Faster=4096 Sa/s) is stored as uint16 BE at anchor−2, where anchor is the 10-byte sequence `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00`. DLE jitter root cause: 4096 = 0x1000, so in the raw S3 frame the sample-rate bytes are sent as `10 10 00` (DLE-escaped `10`); after DLE unstuffing → `10 00` (2 bytes instead of 3 for 1024/2048), making frame C 1 byte shorter and shifting all subsequent offsets by −1. Anchor search is immune to this shift. All three modes confirmed on BE11529 firmware S338.17. | -| 2026-04-01 | §5.1 | **CONFIRMED — `_pending_frames` buffer and `reset_parser=False` parameter.** `MiniMateProtocol._recv_one()` now supports `reset_parser=False` to preserve parser state between consecutive reads within a multi-frame sequence. A `_pending_frames: list[S3Frame]` buffer stores extra frames parsed from a single TCP chunk when multiple E5 responses arrive together. Required for reliable SUB 1A frame B/C/D sequence on BE11529. | -| 2026-04-02 | §7.8 (NEW) | **CONFIRMED — SUB 5A frame format.** `offset_hi` byte (`0x10`) must be sent **raw, not DLE-stuffed** — standard `build_bw_frame` incorrectly stuffs it to `10 10` on the wire; device ignores the frame. BW sends it as bare `10`. Checksum is **DLE-aware**: when walking the byte sequence, `10 XX` pairs contribute only `XX` to the sum; lone bytes contribute normally. `build_5a_frame()` reproduces BW's exact wire format. | -| 2026-04-02 | §7.8 | **CONFIRMED — SUB 5A params are 11 bytes (not 10) for chunk frames.** Extra trailing `0x00` confirmed from 1-2-26 BW wire capture. Probe frame and termination frame differ — see `bulk_waveform_params()` in `framing.py`. | -| 2026-04-02 | §7.7.5 | **CONFIRMED — Event-time metadata source.** `Client:`, `User Name:`, and `Seis Loc:` strings are present in **A5 frame 7** of the SUB 5A bulk waveform stream — they are NOT in the 210-byte SUB 0C waveform record. They reflect the compliance setup active when the event was stored on the device (not the current setup). `get_events()` now issues SUB 5A after each 0C download. Sequence: `1E → 0A → 0C → 5A → 1F`. | -| 2026-04-02 | §7.6.2 | **FIXED — Compliance config orphaned send bug.** An extra `self._send(SUB_COMPLIANCE / 0x2A / DATA_PARAMS)` before the B/C/D receive loop had no corresponding `recv_one()`. Every receive in the loop was consuming the previous send's response, leaving frame D's channel block unread. Bug removed. Total config bytes now ~2126 (was ~1071 due to truncation). `trigger_level_geo`, `alarm_level_geo`, `max_range_geo` are now correctly populated. | -| 2026-04-02 | §7.6.1 | **CORRECTED — Anchor search range.** Previous doc stated anchor search range `cfg[40:100]`. With the orphaned-send bug fixed, the 44-byte header padding is gone and the anchor now appears at `cfg[11]`. Corrected to `cfg[0:150]`. | -| 2026-04-03 | §7.6 | **CONFIRMED — Blast waveform format (4-2-26 capture).** Blast/waveform-mode SUB 5A stream uses 4-channel interleaved signed int16 LE, 8 bytes per sample-set [T,V,L,M]. NOT the 32-byte block format (which is noise/histogram mode only). Frame sizes are NOT multiples of 8 — cross-frame alignment correction required (track global byte offset mod 8; skip `(8-align)%8` bytes at each frame start). A5[0] STRT record confirmed: 21 bytes at db[7:]+11; waveform starts at strt_pos+27 (after 2-byte null pad + 4-byte 0xFF sentinel). Frame index 7 = metadata only, no ADC data. Full §7.6 rewritten. | -| 2026-04-03 | §7.6 | **CONFIRMED — Noise block format details.** 32-byte blocks: LE uint16 type + LE uint16 ctr + 9×int16 LE samples + 10B metadata. Samples are little-endian (previous doc said big-endian — WRONG). Type: 0x0016=sync (appears at start of each A5 frame), 0x0000=data. Noise floor ≈ 9–11 counts. Metadata fixed pattern `00 01 43 [2B var] 00 [pretrig] [rectime] 00 00` confirmed. | -| 2026-04-03 | client.py | **NEW — `_decode_a5_waveform()` and `download_waveform()` implemented.** `_decode_a5_waveform(frames_data, event)` decodes full A5 waveform stream into `event.raw_samples = {"Tran":[…], "Vert":[…], "Long":[…], "Mic":[…]}`. Populates `event.total_samples`, `event.pretrig_samples`, `event.rectime_seconds` from STRT record. Handles cross-frame alignment. `MiniMateClient.download_waveform(event)` calls `read_bulk_waveform_stream(stop_after_metadata=False)` then invokes the decoder. Waveform key stored on Event as `_waveform_key` during `get_events()`. | -| 2026-04-03 | §7.7.5 | **CONFIRMED — sub_code=0x03 (Waveform continuous) uses 10-byte timestamp header** — one byte wider than sub_code=0x10 layout. Cross-referenced against Blastware event report for BE11529 (15:20:17 Apr 3 2026). Raw header: `10 03 10 04 07 ea 00 0f 14 11` = [unknown_a][day][unknown_b][month][year:2 BE][unknown][hour][min][sec]. Peak Vector Sum is at `tran_label − 12` (label-relative, NOT fixed offset 87 — fixed offset only incidentally correct for sub_code=0x10). | -| 2026-04-05 | §7.8 | **CONFIRMED — 5A "Project:" string is session-start config, NOT per-event.** The "Project:" value in A5 frame 7 reflects the compliance setup active when the monitoring session started, not when the individual event was recorded. `_decode_a5_metadata_into()` only sets `project` from 5A when 0C did not already supply one. "Client:", "User Name:", "Seis Loc:", and "Extended Notes" are NOT in the 0C record and are set unconditionally from 5A. | -| 2026-04-06 | §5.1 | **CORRECTED — SUB 1F token position is params[7], NOT params[6].** Both 3-31-26 and 4-3-26 BW TX captures confirm: raw params `00 00 00 00 00 00 00 FE 00 00`, token byte at index 7. Previous doc (params[6]) was wrong — with wrong position the device ignores the token and 1F returns null immediately. | -| 2026-04-06 | §6.1 | **NEW — Full event download sequence documented** (§6.1). Sequence confirmed from 4-2-26 and 4-3-26 BW TX captures: `1E(all-zero) → [per event: 0A → 1E(arm/0xFE) → 0C → 1F(arm/0xFE) → POLL×3 → 5A → 1F(browse)]`. Each step documented with confirmed requirements. | -| 2026-04-06 | §6.1 | **CONFIRMED — 1E(token=0xFE) arm step required.** Device silently ignores all 5A probe frames unless a second 1E with token=0xFE is sent between 0A and 0C. Present in every download cycle in the 4-2-26 and 4-3-26 captures. | -| 2026-04-06 | §6.1 | **CONFIRMED — SUB 1F(token=0xFE) must precede POLL×3 before 5A.** BW always sends 1F(0xFE) before the 3 POLL cycles before 5A. 5A still uses the pre-advance key (set by 0A+1E-arm+0C); 1F only arms the device's 5A state machine. | -| 2026-04-06 | §6.1 | **CONFIRMED — browse 1F must be conditional.** Calling 1F(browse=True/all-zero) after a FAILED 5A disrupts device state and causes the next event's 5A probe to time out with 0 bytes received. Browse 1F is only called after a SUCCESSFUL 5A. Failure fallback: use the key returned by the prior 1F(arm/0xFE) call. | -| 2026-04-06 | §7.8 | **ADDED — `bytes_fed` diagnostic counter on S3FrameParser.** Counts raw bytes fed to the parser since last `reset()`. Logged at WARNING when 5A probe times out — distinguishes "device sent no bytes at all" from "device responded but frame was malformed or had wrong SUB". | -| 2026-04-06 | §7.8.2 | **CORRECTED — SUB 5A chunk counter is monotonic for ALL chunks.** Previous doc hard-coded chunk 1 counter as `0x1004` (from 4-2-26 BW TX capture). This was a Blastware artifact. Empirically confirmed: `counter = chunk_num * 0x0400` works (device responds immediately); counter=0x1004 for chunk 1 causes 120 s timeout. BW's true internal formula appears to be `key4[2:4] + n * 0x0400` — for event 1 (key `01110000`) this equals `n * 0x0400`. The device does not strictly validate counter values. | -| 2026-04-06 | §7.8.4 | **NEW — 5A end-of-stream signalling confirmed.** After streaming all waveform chunks, the device sends exactly **1 raw byte** in response to the next chunk request, then goes silent for the full recv timeout. This byte is NOT a complete DLE-framed A5 response — the frame parser accumulates it as `bytes_fed=1` and never assembles a frame. This is the device's natural end-of-stream signal. Handling: on TimeoutError, if `bytes_fed > 0` AND prior chunks were received, treat as graceful end and proceed to the termination frame. A `bytes_fed=0` timeout with no prior chunks is a genuine transport failure and must still raise. | -| 2026-04-06 | §7.8.4 | **NEW — 5A chunk timing and count (empirical, BE11529 at 1024 sps).** Each chunk response arrives within ~1 second over TCP/cellular. A 9,306-sample event (≈9.1 s at 1024 sps) produces **35 chunks** before end-of-stream. Chunks 1–16 have varying data lengths (1036–1123 bytes); chunks 17–35 are uniformly 1036 bytes each (post-event silence, all-zero ADC samples). Safe recv timeout for chunk loop: **10 s** (10× typical response time). Default transport timeout (120 s) results in a ~2-minute stall per event at end-of-stream. | -| 2026-04-06 | §7.8.3 | **KNOWN ISSUE — `_decode_a5_waveform` hardcoded fi==9 skip.** The decoder contains `elif fi == 9: continue` which was written for the 9-frame original blast capture where frame 9 was a device terminator. For streams with >9 frames (current device produces 35+), frame index 9 is live waveform data — this skip discards ~1,070 bytes (~133 sample-sets) per event. The terminator is now detected via `page_key == 0x0000`, not by frame index. The fi==9 skip should be removed. | -| 2026-04-06 | §7.8 | **⚠ PARTIALLY INVALIDATED — ADC count-to-physical-unit conversion.** Raw waveform samples are signed 16-bit integers (counts). Conversion formula `value = counts × (range / 32767)` is believed correct, but the `range` value was UNKNOWN at time of writing. **UPDATED 2026-04-17:** `max_range_geo` = 6.206053 is confirmed as the ADC-to-velocity scale factor (inverse sensitivity, (in/s)/V). The correct conversion is therefore: `PPV (in/s) = counts × (1.61133 / 32767) × 6.206053` = `counts × 4.982e-5` in/s per count. The earlier ~9× overread from using 6.206053 directly as the range was because the range IS 1.61133 × 6.206053 = 10.000 in/s, not 6.206053. See §7.6.2 for the confirmed field layout. | -| 2026-04-08 | §5.1, §7.10, §12 | **NEW — Monitoring commands confirmed.** SUB 0x1C (monitor status), 0x96 (start monitoring), 0x97 (stop monitoring) all confirmed from 4-8-26/2ndtry capture. SESSION_RESET (`41 03`) required before POLL to wake a monitoring unit. | -| 2026-04-09 | §7.10 | **CORRECTED — monitoring flag and battery/memory offsets.** `section[1] == 0x10` is the monitoring flag (100% accurate across 144 data frames in 2ndtry capture). Previous note claiming `section[6]` was wrong — section[6] has device-specific non-binary values (0xea/0x07). Battery/memory offsets corrected: `section[-10:-8]` (battery×100), `section[-8:-4]` (memory_total), `section[-4:]` (memory_free). NOTE: `frame.data` has checksum stripped by parser — earlier offsets of `[-11:-9]`/`[-9:-5]`/`[-5:-1]` were wrong because they assumed a trailing checksum byte that isn't there. | -| 2026-04-08 | §7.10 | **NEW — SUBs 0x0E (channel sensor data) and 0x98 (trigger test) observed** in 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). SUB 0x0E: 2-step read with channel selector in `params[6:8]`, data length 0x0A per channel, RSP SUB = 0xF1. SUB 0x98: single probe frame with `params[0] = 0xFF`, RSP SUB = 0x67; sent twice per test cycle. Not yet implemented in SFM. | -| 2026-04-08 | §7.10 | **NEW — SUBs 0x15 and 0x01 observed in sensor-check capture.** SUB 0x15 (serial number short form, data length 0x0A, RSP 0xEA) and SUB 0x01 (device info block, data length 0x98 = 152 bytes, RSP 0xFE) seen in Blastware's "Unit Channel Test" init sequence. Note: SUB 0x01 response SUB 0xFE collides with the existing SUB 0xFE → RSP 0x01 naming convention — they are inverse commands. | -| 2026-04-08 | §12 | **CONFIRMED — Unit partially reachable during on-device sensor check.** 4-8-26/sensor-check capture shows: POLL responds normally throughout; SUB 0x0E channel reads partially served (channels 0–4 responded), then ~40s silent gap while sensor check ran, then channels 5–7 responded. On-device sensor check duration ≈ 40 s. SFM `_pollMonitorConfirm()` polls status every 5 s for up to 60 s after start_monitoring. | -| 2026-04-08 | §7.9 (NEW) | **NEW — Compliance config field inventory captured from Blastware UI.** See §7.9 for full field list (Recording Setup, Notes, Special Setups tabs). Most fields NOT yet mapped to raw byte offsets. Confirmed decoded: sample_rate, record_time, trigger_level_geo, alarm_level_geo, max_range_geo, backlight_on_time, power_saving_timeout, monitoring_lcd_cycle, project/client/operator/sensor_location/notes. Sensor Check dropdown (Before monitoring / After each event / Disabled) NOT YET LOCATED in raw config bytes. | -| 2026-04-11 | §5.1, §5.2 | **NEW — Erase-all command sequence confirmed from MITM capture.** SUB 0xA3 (begin erase, token=0xFE → ack 0x5C) + SUB 0xA2 (confirm erase, token=0xFE → ack 0x5D). Standard `build_bw_frame` format (not write-format). Required intermediate steps: 0x1C probe+data (monitor status read) + 0x06 probe+data (event storage range). All response SUBs follow the standard 0xFF−SUB formula with no exceptions. | -| 2026-04-11 | §5.1 | **CONFIRMED — SUB 0x06 (CHANNEL CONFIG READ) now confirmed as event storage range.** Two-step read, data offset = 0x24 (36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (bytes −8:−4) and last stored event key (bytes −4:). Both equal `01110000` when device memory is empty. Used by Blastware to verify erase completion. | -| 2026-04-11 | §7.11 (NEW) | **NEW — §7.11 Erase-All Protocol added.** Full wire sequence, SUB 0x06 storage range payload layout, post-erase key counter reset (resets to `0x01110000`). Confirmed from 4-11-26 MITM capture of live Blastware ACH session. | -| 2026-04-11 | §14.6 | **RESOLVED — ACH Session Lifecycle is no longer "Future".** `bridges/ach_server.py` fully implements inbound ACH: POLL handshake, device info, event download. State tracked via `ach_state.json` (key-based, with `max_downloaded_key` for post-erase detection). `--clear-after-download` flag added for the standard delete-after-upload workflow. | -| 2026-04-17 | §7.6.2, §14 | **RESOLVED — Float 6.206053 at channel_label+28 is the ADC-to-velocity scale factor.** Confirmed from Series III Interface Handbook §4.5 formula: `Range (×1) = 1.61133 V / Sensitivity (V/unit)`. For the standard Instantel geophone at Normal range (10.000 in/s): Sensitivity = 1.61133 / 10 = 0.161133 V/(in/s). The stored value is the **inverse sensitivity** = 1/0.161133 = **6.206053 (in/s)/V**. Cross-check: 1.61133 V × 6.206053 = 10.000 in/s ✅. The firmware uses it as: `PPV (in/s) = ADC_voltage (V) × 6.206053`. Value is identical on all Instantel standard geophones — it is a hardware/firmware constant, NOT a user-configurable setting. Do NOT write this field. Open question §14 item "Max Geo Range float 6.2061" is now **RESOLVED**. | -| 2026-04-20 | §7.6.4 (NEW), §7.9, Appendix B | **CONFIRMED — Recording Mode byte location.** Three targeted captures (4-20-26) confirmed `recording_mode` at anchor−8 in both the E5 read payload and the BW write payload (6-byte anchor `\xbe\x80\x00\x00\x00\x00`). BW write payload and E5 read payload are **byte-identical** around the anchor region — Blastware round-trips the wire-encoded E5 bytes verbatim with only the target field modified. Anchor position varies by ±1 depending on whether recording_mode = 0x03 (Histogram), because E5 wire-encodes `0x03` as the inner DLE+ETX pair `\x10\x03` (2 bytes), which S3FrameParser preserves as two literal bytes in `compliance_raw`. Enum: `0x00`=Single Shot, `0x01`=Continuous, `0x03`=Histogram, `0x04`=Histogram+Continuous. `0x02` value not yet observed. The byte at anchor−9 is `0x00` for Single Shot / Continuous, and `0x10` for Histogram (DLE prefix from E5 encoding) and Histogram+Continuous (actual config byte). See §7.6.4 for full details. | -| 2026-04-21 | Appendix D (NEW) | **NEW — Blastware .N00 and .MLG file formats fully decoded.** `minimateplus/blastware_file.py` implements `write_n00()` and `write_mlg()`. N00 file format confirmed: 22B header + 21B STRT record + variable body + 26B footer. Body reconstructed from A5 bulk waveform stream frames with per-frame skip amounts (probe=7+strt_pos+21, A5[1]=13, A5[2+]=12, terminator=11) and DLE strip rule (strip `0x10` before `{0x02,0x03,0x04}`, keep following byte). Footer extracted verbatim from terminator frame's last 26 bytes. Split-pair edge case: when `frame.data[-1]==0x10` and `chk_byte∈{0x02,0x03,0x04}`, reunite both bytes before stripping and always remove trailing chk_byte (`stripped[:-1]`) — chk_byte is checksum, not payload. STRT record must be copied verbatim from A5[0]; bytes [10:20] are device-specific and cannot be reconstructed from Event fields. `write_n00` verified byte-perfect against `M529LIY6.N00` from 4-3-26-multi_event capture. MLG format: 308B header + N×292B records; CRC algorithm unknown (write as 0x0000). | -| 2026-04-21 | Appendix D §D.5 (NEW) | **NEW — Blastware filename encoding fully decoded.** Serial prefix: `chr(ord('B') + floor(serial/1000))` + last 3 digits zero-padded. Stem: 4-char base-36 of `floor(total_seconds/1296)`. Extension: `AB0` for manual/direct downloads (3 chars), `AB0W` or `AB0H` for ACH/call-home downloads (4 chars), where `AB` = 2-char base-36 of `total_seconds % 1296` and W/H = waveform/histogram. Epoch = 1985-01-01 00:00:00 device local time. Confirmed against 3,248 files from 10-year production archive with zero errors. 3-day cycle property: same daily recording time cycles through 3 extensions (864s/day shift, period=3 days). `blastware_filename(event, serial, ach=False)` implements full formula. | -| 2026-04-21 | §7.6.2, §5.3 | **CORRECTED — compliance_raw contains wire-encoded bytes, NOT logical bytes.** S3FrameParser appends DLE+ETX inner-frame pairs as two literal bytes to the frame body. Any `0x03` values in the compliance config appear in `compliance_raw` as `\x10\x03` (two bytes), not as a single `0x03`. The previous claim "S3FrameParser handles this transparently so compliance_raw contains logical (destuffed) bytes" was wrong. Consequence: `compliance_raw` is the wire-encoded E5 payload; anchor-relative reads work correctly because the anchor position automatically accounts for any DLE-encoded bytes before it. For write-back, round-tripping `compliance_raw` verbatim sends the correct wire bytes to the device. **DLE ETX escaping in write frames:** Blastware escapes `0x03` bytes in write frame data as `\x10\x03` on wire; our `build_bw_write_frame` does not (writes data raw). Device is confirmed to accept raw writes for all tested modes — likely uses the offset/length field for write frame framing, not ETX scanning. | -| 2026-04-20 | §7.6.2, §7.9, Appendix B | **CONFIRMED — Geophone maximum range / sensitivity selector byte location.** Two targeted captures (4-20-26, geo sensitivity folder): one at Normal 10.000 in/s, one at Sensitive 1.250 in/s. E5 read payload diff: exactly 3 bytes differ at channel_label+33 for Tran/Vert/Long. Values: `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Same offset applies to the SUB 71 write payload (which is the same 2126-byte E5-format buffer round-tripped verbatim). **`channel_label+20` reads `0x01` in ALL captures regardless of range setting — it is NOT this field.** Previous hypothesis (uint8 at Tran+20, 0x01=Normal) was WRONG. Stored as `geo_range` in `ComplianceConfig`. Encoded to all three geo channel blocks (Tran/Vert/Long) at label+33. | -| 2026-04-20 | §5.1, §5.3, §7.12 (NEW) | **NEW — Auto Call Home config protocol confirmed from 4-20-26 call home settings captures.** SUB 0x2C (Call Home Config READ, response 0xD3, data offset 0x7C=124) and SUB 0x7E/0x7F (WRITE + CONFIRM, response 0x81/0x80) confirmed. Write payload = read payload (125 bytes) + `\x00\x00` (127 bytes total). **DLE-escaped ETX at raw[117:119]:** the device returns logical value 0x03 (num_retries=3) as `\x10\x03` on the wire — S3FrameParser preserves both bytes as two literals, causing a +1 byte shift for all subsequent fields. Write frame sends these bytes verbatim (device interprets `\x10\x03` as literal value 3). Field map confirmed from 10-frame BW TX diff. See §7.12 for full layout. | -| 2026-05-01 | §7.8.2, §7.8.5 (NEW), §7.8.6 (NEW), §7.8.7 (NEW) | **REWRITTEN — SUB 5A bulk waveform stream protocol.** Five BW MITM captures (4-27-26 "open 2sec waveform" + "copy event to disk", 5-1-26 BW 3-sec + 2nd-event + Download All) prove that the previous chunk-counter formula `max(key4[2:4], 0x0400) + (chunk_num-1) * 0x0400` over-reads 5× past the actual event end. BW reads ~12-16 chunks per event at **0x0200 increments (NOT 0x0400)**, bounded by `end_offset` extracted from the STRT record at `data[23:27]` of the first A5 response. **TERM frame formula corrected:** `offset_word = end_offset - next_boundary`, `params[2:4] = next_boundary BE` where `next_boundary = last_chunk_counter + 0x0200`. Verified across 3 events (offsets 0x1ABE, 0x21F2, 0x417E). **Metadata pages 0x1002 / 0x1004** are global, fixed-address device pages containing Project/Client/User Name/Seis Loc/Extended Notes — read ONCE per Blastware session (not per event). **Event-1 vs event-N split:** events at start_key[2:4]=0 use probe@0x0000 + metadata pages + sample chunks at 0x0600 onward; continuation events skip metadata and start at start_key+0x0046. **WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundary markers** — the "Download All" pattern walks 1E/0A/1F to map all event keys+lengths upfront, then downloads each `0x46`-keyed event in turn. Old `stop_after_metadata=True` knob is a workaround for the missing end_offset bound and becomes obsolete under the new walk. See new §7.8.5 / §7.8.6 / §7.8.7 for full details. | -| 2026-05-04 | §7.8.5, §7.8.8 | **CORRECTED — Event-N probe counter is just `start_offset`, NOT `start_offset + 0x0046`.** The `+0x46` formula in the original §7.8.5 was based on calling the off=0x2C boundary key the "start_key", but in the iteration walk `cur_key` passed into `read_bulk_waveform_stream` is always the off=0x46 WAVEHDR record key from 1F (the partial-record skip path in `get_events` re-runs 1F to advance past 0x2C boundary records). Adding +0x46 placed the probe one WAVEHDR past the actual event start; the response no longer contained STRT at byte 17, `parse_strt_end_offset` returned None, and the chunk loop fell back to the `max_chunks=128` cap, walking ~110 chunks of post-event circular-buffer garbage. Confirmed against both the 5-1-26 "copy 2nd address" capture (probe at counter=0x2238 with key=01112238) and the 5-4-26 BW 2-sec event capture. Fixed in protocol.py `read_bulk_waveform_stream` v0.14.1. | -| 2026-05-05 | §7.8.1 (rule #3 added) | **CONFIRMED — Partial DLE stuffing of `0x10` bytes in 5A params region.** The device's de-stuffing rule for the SUB 5A params region is: `10 10` → `10`, `10 02/03/04` → kept literal (inner-frame markers), `10 X` for any other X → de-stuffs to just `X` (drops the `0x10`). Therefore any `0x10` byte in the logical params followed by a byte NOT in {0x02, 0x03, 0x04, 0x10} MUST be doubled on the wire. This affects counters with `0x10` in the high byte — most importantly counter=`0x1000`, where logical params bytes `... 10 00 ...` were being sent raw and the device de-stuffed `10 00` to just `00`, returning the response for counter=0x0000 (= the file header + STRT). That STRT block then ended up embedded in the assembled file body at file offset `0x1016` and Blastware refused to open the file. This was the root cause of the long-standing ">1-sec event 0 won't open in BW" pattern (1-sec events worked because their `end_offset < 0x1000`, so no chunk request ever needed counter `0x10__`). All 17 5A request frames in the 5-1-26 bwcap3sec capture (probe + 2 meta + 13 samples + TERM) now match BW byte-for-byte after the fix. Fixed in framing.py `build_5a_frame` v0.14.3. | -| 2026-05-05 | §7.8 / Blastware file format | **CONFIRMED — File body assembly is contiguous concatenation, no de-duplication.** The "duplicate header+STRT strip" hack from v0.13.x was actively destroying valid waveform data — sample chunks at counter `0x1000` and beyond often coincidentally contain the byte sequence `00 12 03 00 STRT` in their delta-encoded ADC stream, and the strip was zeroing 25 bytes per match. Removed in v0.14.2. The correct file body is: probe contribution + meta@0x1002 + meta@0x1004 + sample contributions in stream order + TERM contribution. Verified byte-perfect against BW reference `M529LKIQ.G10` (8708 bytes, 0 differences) when fed the same A5 frames as the BW capture. | - ---- - -## 1. Physical Layer - -| Parameter | Value | Certainty | -|---|---|---| -| Interface | RS-232 serial | ✅ CONFIRMED | -| Baud rate | 38400 | ✅ CONFIRMED (from bridge log header) | -| Data bits | 8 | ✅ CONFIRMED (standard for this baud/era) | -| Parity | None | 🔶 INFERRED (no parity errors observed) | -| Stop bits | 1 | 🔶 INFERRED (standard assumption) | -| Flow control | None (no RTS/CTS activity) | 🔶 INFERRED | - ---- - -## 2. Frame Structure -> ⚠️ **2026-02-26 — CORRECTED:** Previous version incorrectly identified `0x41` as STX and `0x02`/`0x03` as bare frame delimiters. The protocol uses proper **DLE framing**. See below. - -Frame structure is asymmetric — BW→S3 (requests we send) and S3→BW (device replies) -use slightly different framing markers, both terminated by a **bare** `0x03` ETX: - -``` -BW→S3 (our requests): [ACK=0x41] [STX=0x02] [stuffed payload + chk] [ETX=0x03] -S3→BW (device replies): [DLE=0x10] [STX=0x02] [stuffed payload + chk] [ETX=0x03] -``` - -**Critical:** The outer frame terminator is a **bare ETX (`0x03`), not `DLE+ETX`.** S3 -responses contain inner sub-frames (notably inside SUB A4 POLL_RESPONSE and SUB E5 -compliance reads) that use `DLE+ETX` (`0x10 0x03`) as *inner-frame* terminators — the -outer parser preserves both bytes as literal payload data when it sees `DLE+ETX` and -only ends the frame on a bare ETX. See §10 (parser state machine) and the -`S3FrameParser` docstring in `minimateplus/framing.py`. - -### Special Byte Definitions - -| Token | Raw Bytes | Meaning | Certainty | -|---|---|---|---| -| ACK | `0x41` (ASCII `'A'`) | Acknowledgment / ready token. Standalone single byte; often precedes frames. | ✅ CONFIRMED | -| DLE | `0x10` | Data Link Escape. Prefixes the next byte to give it special meaning. | ✅ CONFIRMED — 2026-02-26 | -| STX (BW→S3) | `0x02` (bare) | BW-side start marker — preceded by ACK, not by DLE | ✅ CONFIRMED | -| STX (S3→BW) | `0x10 0x02` | DLE+STX device-side start-of-frame | ✅ CONFIRMED | -| ETX | `0x03` (bare) | End-of-frame terminator in BOTH directions; `DLE+ETX` inside a frame body is an inner sub-frame terminator preserved as literal payload | ✅ CONFIRMED | -| CHECKSUM | 1 byte | Sits between payload and the bare ETX. Two variants — see §11 (standard SUM8 for reads, DLE-aware large-frame for writes / SUB 5A). | ✅ CONFIRMED | - -### DLE Byte Stuffing Rule -> ✅ CONFIRMED — 2026-02-26 - -Any `0x10` byte appearing **naturally in the payload data** is escaped by doubling it: `0x10` → `0x10 0x10`. This prevents the parser from confusing real data with frame control sequences. - -- **Transmit:** Replace every `0x10` in payload with `0x10 0x10` -- **Receive:** Replace every `0x10 0x10` in the frame body with a single `0x10` - -| Sequence on wire | Meaning | -|---|---| -| `0x10 0x02` | Frame START — only valid at beginning | -| `0x10 0x03` | Frame END | -| `0x10 0x10` | Escaped literal `0x10` byte in payload data | -| Any other `0x10 0xXX` | Protocol error / undefined | - -### Frame Parser Notes - -- The `0x41` ACK **may arrive in a separate `read()` call** before the frame body due to RS-232 inter-byte timing or TCP segmentation. The S3 parser treats stray ACK bytes as no-ops while idle. -- Your parser must be **stateful and buffered** — read byte by byte, accumulate after STX, terminate on a bare ETX. Never assume one `read()` = one frame. -- `DLE+ETX` inside a frame body is treated as inner-frame data and appended literally; only a bare ETX ends the outer frame. -- Checksum is computed on the **de-stuffed** payload for standard reads. SUB 5A and write frames use a DLE-aware variant (see §11). -- ACK and the STX bytes are **not** included in the checksum. - -### Checksum Verification Example - -Raw S3→BW POLL probe response wire bytes: -``` -10 02 | 10 00 A4 00 00 00 ... [stuffed payload + chk] ... | 03 -^STX^ ^ETX^ -``` - -After de-stuffing (`0x10 0x10` → `0x10`), the payload is checksum-validated using -the formula from §11. The bare ETX terminates the frame. - ---- - -## 3. Payload Structure - -> ✅ **CONFIRMED 2026-03-30** — field positions verified bit-for-bit against -> `bridges/captures/3-11-26/raw_bw_*.bin`. The earlier "[CMD][DLE][ADDR]…" layout -> that called bytes [1] and [2] both `0x10` was wrong — byte [1] is `flags` -> (`0x00` for BW requests, `0x10` for S3 responses) and byte [2] is the SUB byte. - -The payload (between STX and the checksum, after de-stuffing) is a 16-byte fixed -header for read commands. BW→S3 and S3→BW use the **same field layout** but -swap the values in bytes [0] and [1]: - -``` -BW→S3 (request): S3→BW (response): - [0] BW_CMD 0x10 [0] CMD 0x00 - [1] flags 0x00 [1] flags 0x10 - [2] SUB command [2] SUB 0xFF − request_SUB - [3] 0x00 always [3] PAGE_HI (probe responses: 0x00) - [4] 0x00 always [4] PAGE_LO (probe responses: 0x00) - [5] OFFSET probe:0x00; data:DATA_LENGTH - [5+] data response body - [6:16] params 10-byte field -``` - -| Field | Position | Notes | Certainty | -|---|---|---|---| -| BW_CMD / CMD | byte 0 | `0x10` in BW→S3 requests; `0x00` in S3→BW responses. The `0x10` is the only byte DLE-stuffed in write frames. | ✅ CONFIRMED | -| flags | byte 1 | `0x00` in BW→S3; `0x10` in S3→BW. The byte pattern that earlier docs read as "ADDR" was actually flags. | ✅ CONFIRMED — 2026-03-30 | -| SUB | byte 2 | Command/response selector. Response SUB = `0xFF − request SUB`. | ✅ CONFIRMED | -| OFFSET (requests) | byte 5 | `0x00` for the probe step; `DATA_LENGTH` (hardcoded constant — see §4.2 and §5.1) for the data fetch step. Bytes [3] and [4] are always `0x00` in requests. | ✅ CONFIRMED — 2026-03-30 | -| PAGE_HI / PAGE_LO (responses) | bytes 3–4 | Observed as `0x00 0x00` in probe responses. For chunked data reads (SUB E5, SUB A5) carries the page key / chunk address. | ✅ CONFIRMED | -| params (requests) | bytes 6–15 | 10-byte parameter field; per-SUB structure (event keys, tokens, channel selectors, chunk addresses). | ✅ CONFIRMED | -| data (responses) | bytes 5+ | Response body. For two-step data fetches the actual record begins at `data[11]` after a fixed 11-byte echo header — see §7.7.4. | ✅ CONFIRMED | - -> The only `0x10` byte in a BW request payload is `BW_CMD` at `[0]`. Other `0x10` -> bytes may appear in the `OFFSET` field (e.g. offset_hi=0x10 for compliance writes) -> or in `params` (notably SUB 5A chunk counters). DLE-stuffing of these `0x10` bytes -> on the wire varies by command — see §5.3 (write frames) and §7.8.1 (SUB 5A). - ---- - -## 4. Communication Pattern - -### 4.1 ACK Handshake (Every Transaction) - -``` -Side A → 0x41 (ACK: "ready / received") -Side A → 10 02 [payload] [chk] 10 03 (frame) -Side B → 0x41 (ACK) -Side B → 10 02 [payload] [chk] 10 03 (response frame) -``` - -### 4.2 Two-Step Paged Read Pattern - -> ✅ **CORRECTED 2026-03-30** — earlier description claimed the probe response carries -> the data length in `PAGE_HI`/`PAGE_LO`. It does NOT. The S3 probe response has both -> bytes `0x00`. **Data lengths are hardcoded constants per SUB** — see the `DATA_LENGTHS` -> dict in `minimateplus/protocol.py` and the per-SUB column in §5.1. - -All data reads use a two-step pattern. It is not optional — sending the data -fetch without the probe causes the device to ignore the request. - -``` -Step 1 — Probe (BW: offset=0 in payload[5]): - BW → 41 02 10 10 00 [SUB] 00 00 00 00 [params×10] [chk] 03 - S3 → 10 02 00 10 [RSP] 00 00 [zeroed body] [chk] 03 - (probe ack — PAGE_HI=PAGE_LO=0x00, no length info) - -Step 2 — Data fetch (BW: offset=DATA_LENGTH in payload[5]): - BW → 41 02 10 10 00 [SUB] 00 00 [DATA_LENGTH] [params×10] [chk] 03 - S3 → 10 02 00 10 [RSP] 00 00 [DATA…] [chk] 03 -``` - -Implementations must use the per-SUB `DATA_LENGTH` constant (see §5.1) — there is -no length negotiation step. The two-step nature serves an arming purpose on the -device side, not length discovery. - ---- - -## 5. Command Reference Table - -### 5.1 Request Commands (Blastware → S3) - -| SUB Byte | Name | Description | Certainty | -|---|---|---|---| -| `5B` | **POLL / KEEPALIVE** | Sent continuously (~every 80ms). Requests device identity/status. | ✅ CONFIRMED | -| `15` | **SERIAL NUMBER REQUEST** | Requests device serial number. | ✅ CONFIRMED | -| `01` | **FULL CONFIG READ** | Requests complete device configuration block (~0x98 bytes). Firmware, model, serial, channel config, scaling factors. | ✅ CONFIRMED | -| `08` | **EVENT INDEX READ** | Requests the event record index (0x58 bytes). Event count and record pointers. | ✅ CONFIRMED | -| `06` | **EVENT STORAGE RANGE READ** | Requests event storage range block (0x24 = 36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (`[-8:-4]`) and last stored event key (`[-4:]`). Both equal `01110000` when device is empty. Used by Blastware as part of the erase-all verification step. Previously labelled "CHANNEL CONFIG READ" — function now confirmed from 4-11-26 MITM capture. | ✅ CONFIRMED 2026-04-11 | -| `1E` | **EVENT HEADER READ** | Gets first waveform key. Token byte at params[7] (0x00=browse, 0xFE=download-arm). Key at data[11:15]; trailing offset at data[15:19] (0 = only one event). Two uses: (1) all-zero to get key0; (2) token=0xFE after 0A, before 0C — REQUIRED to arm device for SUB 5A. | ✅ CONFIRMED 2026-04-06 | -| `0A` | **WAVEFORM HEADER READ** | Checks record type for a given waveform key. Variable DATA_LENGTH at `data_rsp.data[5]`: **`0x46` (= 70 bytes) = real triggered event start**; **`0x2C` (= 44 bytes) = boundary marker / monitor-log partial record**. Key at params[4..7]. Required before every 1F call to establish device waveform context. Used by the "Download All" walk (§7.8.8) to map real events vs boundary keys. | ✅ CONFIRMED 2026-05-01 | -| `0C` | **FULL WAVEFORM RECORD** | Downloads 210-byte waveform/histogram record. Sub_code at byte[1]: 0x10=Waveform (9-byte timestamp hdr), 0x03=Waveform-continuous (10-byte hdr, 1-byte shift). PPV floats at label+6 (search "Tran"/"Vert"/"Long"/"MicL"). Peak Vector Sum at tran_label−12 (NOT fixed offset). Key at params[4..7], DATA_LENGTH=0xD2. | ✅ CONFIRMED 2026-04-03 | -| `1F` | **EVENT ADVANCE** | Advances to next waveform key. Token byte at params[7] (⚠️ NOT params[6]): 0x00=browse (all-zero params), 0xFE=download (arm 5A state machine). Returns next key at data[11:15]; null sentinel when data[15:19]=0x00000000. Requires preceding 0A to establish context. Browse 1F must ONLY be called after successful 5A — calling it after a failed 5A disrupts device state for the next event's 5A probe. | ✅ CONFIRMED 2026-04-06 | -| `5A` | **BULK WAVEFORM STREAM** | Bulk download of raw ADC sample data. Non-standard frame format: offset_hi=0x10 sent raw (not DLE-stuffed), DLE-aware checksum, **partial DLE stuffing of 0x10 in params** (`10 X` where X∉{02,03,04,10} must be doubled to `10 10 X` — see §7.8). Requires 1E-arm + 0C + 1F(0xFE) + POLL×3 before first probe. Walk: probe at counter=`start_offset` (event 1: 0x0000) → metadata pages 0x1002 + 0x1004 (event 1 only) → sample chunks at 0x0600, 0x0800, …, step 0x0200, bounded by `end_offset` parsed from STRT@data[17] of probe response → TERM frame at residual offset_word. Project:/Client:/User Name:/Seis Loc: live in the metadata pages, NOT in the sample-chunk stream. | ✅ CONFIRMED 2026-05-05 (BYTE-PERFECT vs BW capture) | -| `24` | **WAVEFORM PAGE A?** | Paged waveform read, possibly channel group A. | 🔶 INFERRED | -| `25` | **WAVEFORM PAGE B?** | Paged waveform read, possibly channel group B. | 🔶 INFERRED | -| `09` | **UNKNOWN READ A** | Read command, response (`F6`) returns 0xCA (202) bytes. Purpose unknown. | 🔶 INFERRED | -| `1A` | **COMPLIANCE CONFIG READ** | Multi-step sequence (A+B+C+D frames). Response (E5) carries recording_mode (uint8 at **anchor − 8** — same offset in read AND write, confirmed 2026-04-21), sample_rate (uint16 BE at anchor − 6), histogram_interval_sec (uint16 BE at anchor − 4), record_time (float32 BE at anchor + 6), trigger/alarm/max_range floats, and project strings. **Anchor: 6-byte `\xbe\x80\x00\x00\x00\x00`**, search `cfg[0:150]`. Total ~2126 cfg bytes. See §7.6.4 for recording_mode enum. | ✅ CONFIRMED 2026-04-02; recording_mode offset corrected 2026-04-21 | -| `2E` | **UNKNOWN READ B** | Read command, response (`D1`) returns 0x1A (26) bytes. Purpose unknown. | 🔶 INFERRED | -| `0E` | **CHANNEL SENSOR DATA** | Real-time sensor reading for one channel. Two-step read, data length 0x0A (10 bytes). Channel selector in params[6:8] (0x0000–0x0007 for 8 channels). Response (F1) carries amplitude, frequency, overswing data for that channel. Used by Blastware "Unit Channel Test" comms check. | ✅ CONFIRMED 2026-04-08 | -| `98` | **TRIGGER TEST** | Trigger-test command. Single probe frame; `params[0] = 0xFF`. Response (0x67) is all-zero data. Sent twice per Blastware comms-check cycle. Not a full POLL, no monitor state change. | ✅ CONFIRMED 2026-04-08 | -| `1C` | **MONITOR STATUS READ** | Two-step read, data offset 0x2C (44 bytes). `section[1] == 0x10` → monitoring; `0x00` → idle (CONFIRMED 2026-04-09, 100% accuracy on 144 frames). Payload length: 46–47 bytes IDLE, 48–49 bytes MONITORING. `frame.data` has checksum stripped — no trailing byte to skip. Battery/memory at end: `section[-10:-8]` = battery×100 (uint16 BE), `section[-8:-4]` = memory_total (uint32 BE), `section[-4:]` = memory_free (uint32 BE). | ✅ CONFIRMED 2026-04-09 | -| `96` | **START MONITORING** | Single write frame, no data payload. Transitions unit from idle to monitoring mode (after optional on-device sensor check ~40 s). | ✅ CONFIRMED 2026-04-08 | -| `97` | **STOP MONITORING** | Single write frame, no data payload. Stops monitoring, unit returns to idle. | ✅ CONFIRMED 2026-04-08 | -| `2C` | **CALL HOME CONFIG READ** | Two-step read, data offset 0x7C (124 bytes + 1-byte DLE artefact = 125 raw bytes). Returns Auto Call Home configuration: enable flag, dial string, scheduled call times, retry settings, modem timing. Response SUB = 0xD3. **DLE note:** logical value 0x03 (num_retries) is returned as `\x10\x03` on the wire, which S3FrameParser preserves as two literal bytes — this shifts all subsequent field positions by +1. See §7.12 for full field map. | ✅ CONFIRMED 2026-04-20 | -| `A3` | **ERASE ALL BEGIN** | Single frame, token=0xFE at params[7]. Initiates device memory erase. Must be followed by 0x1C probe+data + 0x06 probe+data + 0xA2 to complete. Standard `build_bw_frame` (not write-format). Response ack SUB = 0x5C. | ✅ CONFIRMED 2026-04-11 | -| `A2` | **ERASE ALL CONFIRM** | Single frame, token=0xFE at params[7]. Commits the erase initiated by 0xA3. After this ack (SUB 0x5D), device memory is cleared and the event counter resets to `0x01110000`. | ✅ CONFIRMED 2026-04-11 | - -All requests use CMD byte `0x02`. All responses use CMD byte `0x10 0x02` (which, after de-stuffing, is just the DLE+CMD combination — see §3). - -### 5.2 Response SUB Bytes (S3 → Blastware) - -> 🔶 **INFERRED pattern:** Response SUB = `0xFF - Request SUB`. Verified on all observed pairs to date — no counterexample has been observed across read commands, write commands, or either unit. Confidence is high but not formally proven across the full command space. - -| Request SUB | Response SUB | Certainty | -|---|---|---| -| `5B` | `A4` | ✅ CONFIRMED | -| `15` | `EA` | ✅ CONFIRMED | -| `01` | `FE` | ✅ CONFIRMED | -| `08` | `F7` | ✅ CONFIRMED | -| `06` | `F9` | ✅ CONFIRMED 2026-04-11 | -| `1C` | `E3` | ✅ CONFIRMED 2026-04-08 | -| `1E` | `E1` | ✅ CONFIRMED | -| `0A` | `F5` | ✅ CONFIRMED | -| `0C` | `F3` | ✅ CONFIRMED | -| `5A` | `A5` | ✅ CONFIRMED | -| `1F` | `E0` | ✅ CONFIRMED 2026-03-31 | -| `09` | `F6` | ✅ CONFIRMED | -| `1A` | `E5` | ✅ CONFIRMED | -| `2E` | `D1` | ✅ CONFIRMED | -| `0E` | `F1` | ✅ CONFIRMED 2026-04-08 | -| `98` | `67` | ✅ CONFIRMED 2026-04-08 | -| `96` | `69` | ✅ CONFIRMED 2026-04-08 | -| `97` | `68` | ✅ CONFIRMED 2026-04-08 | -| `2C` | `D3` | ✅ CONFIRMED 2026-04-20 | -| `A3` | `5C` | ✅ CONFIRMED 2026-04-11 | -| `A2` | `5D` | ✅ CONFIRMED 2026-04-11 | - ---- - -### 5.3 Write Commands (Blastware → Device) - -> ✅ **CONFIRMED — 2026-02-26** from compliance setup capture (session `185019`); -> framing mechanics confirmed 2026-04-07 from `bridges/captures/3-11-26/raw_bw_*_170151.bin`. - -Write commands are initiated by Blastware (`BW→S3`) and use SUB bytes in the `0x60`–`0x83` range. The device acknowledges each write with a short response frame containing no data payload (17 bytes total wire including framing). - -**Pattern:** Write SUB = Read SUB + `0x60` (e.g. `0x08` EVENT INDEX READ → `0x68` EVENT INDEX WRITE). - -#### Write frame format — minimal DLE stuffing - -Write frames do **NOT** use the full DLE stuffing that read frames do. Only the -`BW_CMD` byte at payload position `[0]` is doubled on the wire — all other bytes -(flags, SUB, offset, params, data, checksum) are written **raw**, even when they -contain `0x10`. See `build_bw_write_frame()` in `minimateplus/framing.py`. - -``` -Wire layout: - [41] ACK - [02] STX - [10 10] BW_CMD doubled (the ONLY DLE stuffing applied) - [00] flags - [SUB] write command byte (0x68–0x83) - [00] always zero - [hi][lo] offset uint16 BE — RAW (not stuffed even if hi=0x10) - [params] 10 bytes — RAW - [data] variable-length write payload — RAW (0x10 bytes not stuffed) - [chk] checksum — RAW (not stuffed even if 0x10) - [03] ETX -``` - -Total wire length = `21 + len(data)` bytes. - -#### Write frame checksum - -All write frames use the **large-frame DLE-aware checksum**: - -```python -chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) & 0xFF -``` - -This sums payload bytes from `SUB` onward, skipping every `0x10` byte, then adds -`0x10` as a constant. The same formula is used for confirm frames (data=`b""`), -since they contain no embedded `0x10` bytes and degrade to the standard SUM8. - -#### Single-chunk write offset formula - -For write payloads that fit in one frame (SUBs `0x68`, `0x69`, `0x82`, `0x7E`): - -``` -offset = data[1] + 2 -``` - -`data[0:2]` is a 2-byte header `[0x00][length]`. The offset on the wire encodes -that embedded length + 2. Confirmed across all single-chunk writes in the -3-11-26 capture (`0x68`: 0x5A, `0x82`: 0x1C, `0x69`: 0xCA, `0x7E`: 0x7E). - -#### Write ack response format - -Every device ack for a write command is a **17-byte zero-data S3 frame**: - -``` -[DLE=0x10] [STX=0x02] [stuffed header + chk] [bare ETX=0x03] -``` - -Data section is zeros; `RSP_SUB = 0xFF − write_request_SUB`. - -#### SUB 71 — multi-chunk compliance write - -The compliance config payload (~2128 bytes) is split into **exactly 3 chunks**. -Confirmed from 3-11-26 BW TX frames 104–108: - -| Chunk | Size | `offset` | `params` (10 bytes hex) | -|---|---|---|---| -| 1 (first) | 1027 bytes | `0x1004` | `00 00 00 00 00 00 00 00 00 00` | -| 2 (middle) | 1055 bytes | `0x1004` | `00 00 00 10 04 00 00 00 00 00` | -| 3 (last) | remainder | `0x002C` | `00 00 08 00 00 00 00 00 00 00` | - -After all three chunks are acked (`0x8E` each), send SUB `72` confirm → device acks `0x8D`. - -#### Full write sequences - -``` -Compliance setup push: 68 → 73 | 71 ×3 → 72 | 82 → 83 | 69 → 74 → 72 -Auto Call Home push: 7E → 7F -``` - -| SUB | Name | Description | Response SUB | Certainty | -|---|---|---|---|---| -| `68` | **EVENT INDEX WRITE** | Writes event index block (mirrors SUB `08` read). Contains event count and timestamps. | `97` | ✅ CONFIRMED | -| `69` | **WAVEFORM DATA WRITE** | Writes large waveform/channel data block (0xCA bytes, mirrors SUB `09`). | `96` | ✅ CONFIRMED | -| `71` | **COMPLIANCE / PROJECT STRINGS WRITE** | Writes compliance config and all project string fields. Contains setup name, project, client, operator, sensor location, and extended notes. Also contains channel scaling floats and `0x082A` threshold value. | `8E` | ✅ CONFIRMED | -| `72` | **WRITE CONFIRM A** | Short frame, no data. Likely commit/confirm step after `71`. | `8D` | ✅ CONFIRMED | -| `73` | **WRITE CONFIRM B** | Short frame, no data. | `8C` | ✅ CONFIRMED | -| `74` | **WRITE CONFIRM C** | Short frame, no data. | `8B` | ✅ CONFIRMED | -| `7E` | **CALL HOME CONFIG WRITE** | Writes Auto Call Home configuration (127 bytes: 125-byte read payload + `\x00\x00`). Offset = data[1]+2 = 0x7E. Write format (DLE-aware checksum, only BW_CMD `0x10` doubled on wire). Response SUB = 0x81. Must be followed by SUB 0x7F confirm. | `81` | ✅ CONFIRMED 2026-04-20 | -| `7F` | **CALL HOME WRITE CONFIRM** | Short frame, no data. Commits call home config write from SUB 0x7E. Response SUB = 0x80. | `80` | ✅ CONFIRMED 2026-04-20 | -| `82` | **TRIGGER CONFIG WRITE** | Writes trigger config block (0x1C bytes, mirrors SUB `1C` read). | `7D` | ✅ CONFIRMED | -| `83` | **TRIGGER WRITE CONFIRM** | Short frame, no data. Likely commit step after `82`. | `7C` | ✅ CONFIRMED | - -**Write response SUB pairs** follow the same `0xFF - request` rule: - -| Write SUB | Response SUB | -|---|---| -| `68` | `97` | -| `69` | `96` | -| `71` | `8E` | -| `72` | `8D` | -| `73` | `8C` | -| `74` | `8B` | -| `7E` | `81` | -| `7F` | `80` | -| `82` | `7D` | -| `83` | `7C` | - ---- - -## 6. Session Startup Sequence - -``` -1. Device powers on / resets -2. S3 → "Operating System" (raw ASCII, no DLE framing — UART boot string) -3. BW → 0x41 + POLL frame (SUB 5B) -4. S3 → 0x41 + POLL RESPONSE (SUB A4, reports data length = 0x30) -5. BW → 0x41 + POLL frame (SUB 5B, offset = 0x30) -6. S3 → 0x41 + POLL RESPONSE with data: "Instantel" + "MiniMate Plus" -7. BW → SUB 15 → serial number -8. BW → SUB 01 → full config block -9. BW → SUB 1A → compliance config (4-frame sequence: A+B+C+D) -10. BW → SUB 08 → event index -11. BW → SUB 06 → event storage range (used during erase verification; see §7.11) -``` - -### 6.1 Event Download Sequence (per-event, confirmed from 4-2-26 + 4-3-26 BW captures) - -``` -# Once per session: -BW → SUB 1E (all-zero params) → key0, trailing0 - -# Per event (repeat until null sentinel data[15:19]=0x00000000): -BW → SUB 0A (key) ← REQUIRED before every 1F; establishes device context -BW → SUB 1E (token=0xFE) ← REQUIRED arm step; must be BETWEEN 0A and 0C -BW → SUB 0C (key) ← read waveform record (peaks, timestamp, project) -BW → SUB 1F (token=0xFE) ← arm 5A state machine; do NOT use returned key -BW → SUB 5B × 3 ← REQUIRED: 3 full POLL probe+data cycles before 5A -BW → SUB 5A (key) ← bulk waveform stream (A5 frames) -# IF 5A succeeded: -BW → SUB 1F (all-zero) → next_key ← use this for loop iteration -# IF 5A failed/timed out: -# Do NOT send 1F(browse) — use cached key from 1F(token=0xFE) above instead -``` - -**Null sentinel:** `data[15:19] == b"\x00\x00\x00\x00"` in both 1E and 1F responses. -Do NOT use `data[11:15]` (key) as sentinel — event 0 has key=0x00000000. - ---- - -## 7. Known Data Payloads - -> 📑 **Navigation note (2026-05-20):** §7 grew organically and contains some -> duplicate section numbers — most notably **§7.5 / §7.5b** (waveform record), -> **§7.6 / §7.7 / §7.8 / §7.9** appear twice each. Sections that re-use a -> number are clearly banner-marked as either DEPRECATED (the old `0x0400`-step -> SUB 5A protocol) or as alternate-context views of the same SUB. **Always -> consult the most recent dated subsection when sections appear to conflict.** -> Canonical SUB 5A walk is in §7.8.5–§7.8.8; canonical compliance config layout -> is in §7.6 / §7.6.1 / §7.6.3 / §7.6.4. - -### 7.1 Poll Response (SUB A4) — Device Identity Block / Composite Container - -> ⚠️ **SUB A4 is a composite container frame.** The large A4 payload (~3600+ bytes) contains multiple embedded inner sub-frames using the same DLE framing as the outer protocol (`10 02` start, `10 03` end, `10 10` stuffing). Inner frames carry WRITE_CONFIRM_RESPONSE and TRIGGER_CONFIG_RESPONSE sub-frames among others. Flat byte-by-byte diffing of A4 is unreliable due to phase shifting — use inner-frame-aware diffing (`_diff_a4_payloads()` in s3_analyzer.py). Confirmed 2026-03-11. - -Two-step read. Data payload = 0x30 bytes. - -``` -Offset 0x00: 0x08 — string length prefix -Offset 0x01: "Instantel" — manufacturer (null-padded to ~20 bytes) -Offset 0x15: "MiniMate Plus" — model name (null-padded to ~20 bytes) -``` - -Raw payload (after de-stuffing): -``` -00 00 00 08 49 6E 73 74 61 6E 74 65 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 -4D 69 6E 69 4D 61 74 65 20 50 6C 75 73 00 00 00 00 00 00 00 00 00 -``` - -### 7.2 Serial Number Response (SUB EA) - -Data payload = 0x0A bytes: -``` -"BE18189\x00" — 7 ASCII bytes + null terminator (8 bytes) -79 11 — 2 trailing bytes -``` - -| Trailing Byte | Value (Unit 1) | Value (Unit 2) | Meaning | Certainty | -|---|---|---|---|---| -| `trail[0]` | `0x79` | `0x70` | Unit-specific — factory calibration ID or HW stamp? | ❓ SPECULATIVE | -| `trail[1]` | `0x11` | `0x11` | Firmware minor version — `0x11` = 17 = `S337.**17**` | ✅ CONFIRMED — 2026-02-26 | - -Two-unit comparison data: -``` -Unit 1: serial="BE18189" trail=79 11 firmware=S337.17 -Unit 2: serial="BE11529" trail=70 11 firmware=S337.17 -``` - -> ✅ **2026-02-26 — CORRECTED:** Previously documented as `79 11 20` (3 bytes). `0x20` is the **frame checksum**, not payload data. Actual data block is exactly 10 bytes (`0x0A`). - -> ✅ **2026-02-26 — CONFIRMED:** `trail[1]` = firmware minor version. Both units share firmware `S337.17` → minor = 17 = `0x11`. Will change if firmware differs between units. - -> ❓ **Still unknown:** `trail[0]` is unit-specific. Does not derive from serial string via sum, XOR, or modulo. Possibly written at factory calibration. Needs a third unit or write-command capture to determine. - -> ⚠ **2026-10-25 — AMENDED (measured, BE9441).** The 8-byte serial field is a **C string, not null-padded**. A six-character serial leaves a stray byte after its terminator: BE9441 sends `42 45 39 34 34 31 00 3f` = `"BE9441\x00?"`. Stripping trailing NULs alone keeps the `?`; cut at the first NUL. Every unit seen before had a seven-character serial, which fills the field exactly to the terminator. - -### 7.3 Full Config Response (SUB FE) — 0x98 bytes - -| Offset | Raw | Decoded | Certainty | -|---|---|---|---| -| 0x00 | `42 45 31 38 31 38 39 00` | `"BE18189\x00"` — Serial number | ✅ CONFIRMED | -| 0x08 | `79 11` | Unknown — possibly HW revision or calibration stamp | ❓ SPECULATIVE | -| 0x0A | `00 01` | Unknown flags | ❓ SPECULATIVE | -| 0x14 | `3F 80 00 00` | IEEE 754 float = **1.0** (Tran scale factor) | 🔶 INFERRED | -| 0x18 | `41 00 00 00` | IEEE 754 float = **8.0** (unknown — MicL range?) | 🔶 INFERRED | -| 0x1C | `3F 80 00 00` ×6 | IEEE 754 float = **1.0** ×6 (remaining channel scales) | 🔶 INFERRED | -| 0x34 | `53 33 33 37 2E 31 37 00` | `"S337.17\x00"` — Firmware version | ✅ CONFIRMED | -| 0x3C | `31 30 2E 37 32 00` | `"10.72\x00"` — DSP / secondary firmware version | ✅ CONFIRMED | -| 0x53 | varies | Likely calibration day or time field — 0x15 (BE18189), 0x1D (BE11529) | 🔶 INFERRED | -| 0x54 | `10` | Calibration month — BCD `0x10` = October (both units) | 🔶 INFERRED | -| 0x55 | varies | Calibration day — `0x02` (BE18189), `0x04` (BE11529) | 🔶 INFERRED | -| 0x56–0x57 | `07 E7` / `07 E9` | Calibration year — uint16 BE. `0x07E7`=2023, `0x07E9`=2025 | ✅ CONFIRMED — 2026-03-31 | -| 0x44 | `49 6E 73 74 61 6E 74 65 6C...` | `"Instantel"` — Manufacturer (repeated) | ✅ CONFIRMED | -| 0x6D | `4D 69 6E 69 4D 61 74 65 20 50 6C 75 73` | `"MiniMate Plus"` — Model name | ✅ CONFIRMED | - -### 7.4 Event Index Response (SUB F7) — 0x58 bytes - -> ✅ **2026-03-02 — CONFIRMED:** Backlight and power save offsets confirmed via two independent captures with device-set values. Offsets are from the start of the **data section** (after the 16-byte protocol header). - -**Layout (offsets relative to data section start):** - -``` -Offset +00: 00 58 09 — Total index size or record count ❓ -Offset +03: 00 00 00 01 — Possibly stored event count = 1 ❓ -Offset +07: 01 07 CB 00 06 1E — Timestamp of event 1 (see §8) -Offset +0D: 01 07 CB 00 14 00 — Timestamp of event 2 (see §8) -Offset +13: 00 00 00 17 3B — Unknown ❓ -Offset +4B: [backlight] — BACKLIGHT ON TIME ✅ CONFIRMED -Offset +4C: 00 — padding (backlight is uint8, not uint16) -Offset +53: [power_save] — POWER SAVING TIMEOUT ✅ CONFIRMED -Offset +54: [lcd_hi] [lcd_lo] — MONITORING LCD CYCLE (uint16 BE) ✅ CONFIRMED -``` - -| Offset | Size | Type | Known values | Meaning | Certainty | -|---|---|---|---|---|---| -| +4B | 1 | uint8 | 250, 100 | **BACKLIGHT ON TIME** (0–255 seconds per manual) | ✅ CONFIRMED | -| +4C | 1 | — | 0x00 | Padding / high byte of potential uint16 | 🔶 INFERRED | -| +53 | 1 | uint8 | 10, 30 | **POWER SAVING TIMEOUT** (minutes) | ✅ CONFIRMED | -| +54..+55 | 2 | uint16 BE | 0xFFDC = 65500 | **MONITORING LCD CYCLE** (seconds; 65500 ≈ disabled/max) | ✅ CONFIRMED | - -**Confirmation captures:** - -| Capture | Backlight (+4B) | Power Save (+53) | LCD Cycle (+54/55) | -|---|---|---|---| -| `20260301_160702` (BW-written) | `0xFA` = 250 | `0x0A` = 10 min | `0xFF 0xDC` = 65500 | -| `20260302_144606` (device-set) | `0x64` = 100 | `0x1E` = 30 min | `0xFF 0xDC` = 65500 | - -> 📖 **Manual cross-reference (716U0101 Rev 15, §3.13.1):** -> - Backlight On Time: "adjustable timer, from 0 to 255 seconds" (§3.13.1e) -> - Power Saving Timeout: "automatically turns the Minimate Plus off" — stored in minutes (§3.13.1f) -> - Monitoring LCD Cycle: "cycles off for the time period... set to zero to turn off" — 65500 = effectively disabled (§3.13.1g) - -### 7.5 Full Waveform Record (SUB F3) — 0xD2 bytes × 2 pages - -> ✅ **2026-02-26 — UPDATED:** Project strings field layout confirmed by diffing compliance setup write payload (SUB `71`). Client field change `"Hello Claude"` → `"Claude test2"` isolated exact byte position. - -**Project strings field layout** (confirmed from SUB `71` write frame, offset +230 from frame start): - -``` -Offset Field label (null-padded, ~16 bytes) Field value (null-padded, ~32 bytes) ------- ------------------------------------ ------------------------------------ -+0x00 "Standard Recording Setup" ← setup name (no label) -+0x28 "Project:" project description string -+0x50 "Client:" client name string ← confirmed at +230 -+0x78 "User Name:" operator name string -+0xA0 "Seis Loc:" sensor location string -+0xC8 "Extended Notes" notes string -``` - -> 🔶 Offsets are approximate — exact byte boundaries need one more targeted capture with a known-length string change to pin down padding rules. - -Confirmed ASCII strings extracted from payload: - -``` -"Project:" -"I-70 at SR 51-75978 - Loc 1 - 4256 SR51 " ← project description -"BE18189" ← serial number -"Histogram" ← record type -"Standard Recording Setup" ← setup name -"Client:" -"Golden Triangle" ← client name -"User Name:" -"Terra-Mechanics Inc. - B. Harrison" ← operator -"Seis Loc:" -"Location #1 - 4256 SR 51 - Intec" ← sensor location -"Extended Notes" -"Tran" ← Transverse channel -"Vert" ← Vertical channel -"Long" ← Longitudinal channel -"MicL" ← Microphone / air overpressure -``` - -### 7.6 Channel Config Float Layout (SUB E5 / SUB 71) - -> ✅ **CONFIRMED — 2026-03-01** from controlled captures (sessions `193237` and `151147`). Trigger changed `0.500 → 0.200`, then `0.200 → 0.600`. Alarm changed `1.0 → 2.0`. All positions confirmed. - -The SUB `1A` read response (`E5`) and SUB `71` write block contain per-channel threshold and scaling values packed as **IEEE 754 big-endian floats**, with inline unit strings. This layout repeats **once per geophone channel** (Tran, Vert, Long — 3×): - -``` -[00 00] [max_range float] [00 00] [trigger float] ["in.\0"] [alarm float] ["/s\0\0"] [00 01] [chan_label...] - 40 C6 97 FD 3F 19 99 9A 69 6E 2E 40 00 00 00 2F 73 00 00 - = 6.206 = 0.600 in/s "in." = 2.000 in/s "/s" -``` - -| Field | Example bytes | Decoded | Certainty | -|---|---|---|---| -| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | -| ADC scale factor | `40 C6 97 FD` | **6.206053 (in/s)/V — CONFIRMED 2026-04-17.** This is the inverse sensitivity of the standard Instantel geophone = 1/0.161133. Interface Handbook §4.5: `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Used by firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant — do NOT write. Offset = **channel_label + 28** (same in E5 read and SUB 71 write). | ✅ CONFIRMED | -| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | -| **Trigger level** | `3F 19 99 9A` | **0.600 in/s** — IEEE 754 BE float | ✅ CONFIRMED | -| Unit string | `69 6E 2E 00` | `"in.\0"` | ✅ CONFIRMED | -| **Alarm level** | `40 00 00 00` | **2.000 in/s** — IEEE 754 BE float | ✅ CONFIRMED | -| Unit string | `2F 73 00 00` | `"/s\0\0"` | ✅ CONFIRMED | -| `[00 01]` | `00 01` | Unknown flag / separator | 🔶 INFERRED | -| Channel label | e.g. `56 65 72 74` | `"Vert"` — identifies which channel | ✅ CONFIRMED | -| **Geo range (sensitivity selector)** | `00` or `01` | **uint8** — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Offset = **channel_label + 33** (same in E5 read and SUB 71 write). Applied to all three geo channel blocks (Tran/Vert/Long). **Note: `channel_label + 20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | ✅ CONFIRMED 2026-04-20 | - -**State transitions observed across captures:** - -| Capture | Trigger | Alarm | Notes | -|---|---|---|---| -| `193237` (read) | `3F000000` = 0.500 | `3F800000` = 1.000 | Device state before any change | -| `193237` (write 1) | `3E4CCCCD` = 0.200 | `3F800000` = 1.000 | Trigger changed only | -| `151147` (write 1) | `3E4CCCCD` = 0.200 | `40000000` = 2.000 | Alarm changed, trigger carried over | -| `151147` (write 2) | `3F19999A` = 0.600 | `40000000` = 2.000 | Trigger changed, alarm carried over | - -Values are stored natively in **imperial units (in/s)** — unit strings `"in."` and `"/s"` embedded inline confirm this regardless of display locale. - -### 7.6.1 Record Time - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Anchor convention -> updated 2026-04-21 — search for the 6-byte stable anchor, not the 10-byte form. - -Record time is stored as a **32-bit IEEE 754 float, big-endian**, located via an -anchor pattern (see §7.6.3 / §7.6.4 for the rest of the anchor-relative fields). - -**Anchor:** search for the 6-byte sequence `\xbe\x80\x00\x00\x00\x00` in -`cfg[0:150]`. **Record time is at anchor + 6** (i.e. 6 bytes past the start of -the anchor). - -> ⚠️ **The earlier "10-byte anchor" form `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` -> is NOT stable.** Its leading two bytes `\x01\x2c` (= 300) are the -> `histogram_interval_sec` field, which changes when the histogram interval is -> reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant. -> Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`. - -> 🔶 **2026-10-17 — the 6-byte suffix may not be constant either (INFERRED from Series IV).** -> On a Micromate the same position holds `[pre-trigger f32 BE, negative seconds][record stop mode]`, -> measured setting by setting: `be 80 00 00` = −0.25 s, and `00 00` = Fixed (Auto reads `00 01`). -> Every S3 unit this anchor was confirmed on would have been at those defaults. If S3 shares the layout, -> a unit in **Record Stop Mode = Auto** returns `be 80 00 00 00 01`, `find()` returns −1, and the four -> anchor-relative fields silently go undecoded. **Not yet measured on S3** — one BW capture in Auto -> mode settles it. Until then, treat a missing anchor as this, not as DLE jitter. - -> ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the -> compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental -> header padding is gone and the anchor now appears at `cfg[11]`. Search range -> widened to `cfg[0:150]`. - -| Record Time | float32 BE bytes | Decoded | -|---|---|---| -| 3 seconds | `40 40 00 00` | 3.0 | -| 5 seconds | `40 A0 00 00` | 5.0 | -| 7 seconds | `40 E0 00 00` | 7.0 | -| 8 seconds | `41 00 00 00` | 8.0 | -| 10 seconds | `41 20 00 00` | 10.0 | -| 13 seconds | `41 50 00 00` | 13.0 | - -**⚠️ Do NOT use absolute offset `+0x28` from page2 start for BE11529.** The total cfg length varies by ±1 byte depending on sample rate setting (see §7.6.3 DLE jitter note). Absolute offsets are unreliable; anchor search is the correct approach. - -**`0x0A` after "Extended Notes" label:** invariant across record time changes — not record time. - -> ✅ **`0x082A` (= 2090) — RESOLVED:** Fixed payload length of the E5 response block. Constant regardless of any setting. - ---- - -### 7.6.2 SUB 1A Multi-Frame Read Protocol - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture). - -SUB 1A (compliance config read) requires **four frames**, not the standard 2-step probe+fetch used by other SUBs. The Blastware TX frame format for these is ACK (`0x41`) + STX (`0x02`) + [DLE-stuffed body] + ETX (`0x03`) with CMD=`0x10`. - -**Frame sequence:** - -| Step | Name | BW offset param | Notes | -|---|---|---|---| -| A | Probe | `0x0000` | Triggers E5 response with page_key=`0x0000` (44-byte header) | -| B | Data B | `0x0400` | params: `00 00 00 00 00 00 00 64 00 00`; E5 page_key=`0x0000` (44 bytes) | -| C | Data C | `0x0400` | params: `00 00 04 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1027 bytes) | -| D | Data D | `0x002A` | params: `00 00 08 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1055 bytes, or 0x0000/44 bytes when BE11529 sends a duplicate) | - -**E5 response `page_key` field:** bytes `data[3:5]` of the E5 payload. `0x0000` = header/short chunk, `0x0010` = main config data. - -**Assembling cfg:** concatenate non-duplicate chunks in order (B+C+D). Track `(page_key, chunk_len)` pairs; drop any repeat to avoid mis-alignment. - -**Expected cfg lengths:** -- Frame D delivers page `0x0010` correctly: **44 + 1027 + 1055 = 2126 bytes** -- Frame D duplicates page `0x0000` (BE11529 occasional): **44 + 1027 = 1071 bytes** (still fully decodable) - ---- - -### 7.6.3 Sample Rate and DLE Jitter - -> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Validated across -> Normal (1024), Fast (2048), and Faster (4096) modes. - -**Location:** `uint16 BE` at **anchor − 6**, using the 6-byte stable anchor -`\xbe\x80\x00\x00\x00\x00` searched in `cfg[0:150]`. - -| Device Mode | uint16 BE value | Sa/s | -|---|---|---| -| Normal | `04 00` | 1024 | -| Fast | `08 00` | 2048 | -| Faster | `10 00` | 4096 | - -**DLE jitter (critical — explains the ±1 byte cfg length variation):** - -The sample rate bytes sit a few bytes before the anchor in the raw S3 frame. -For "Faster" mode (4096 = `0x1000`), the high byte `0x10` is itself a DLE -character and was historically escaped on the wire as `10 10`. After DLE -unstuffing: `10 10 00` → `10 00` (2 bytes). For Normal/Fast modes (high byte = -`0x04` / `0x08`), no escaping needed and the payload stays 3 bytes. Result: -"Faster" mode can produce a cfg that is **1 byte shorter** than Normal/Fast, -shifting any absolute offset by −1. - -**Why anchor search is required:** any decoder that uses fixed absolute offsets -for record_time or sample_rate will produce garbage values when the device is -set to "Faster" mode. The 6-byte anchor (start of the alarm-level floats -`\xbe\x80\x00\x00\x00\x00`) is past the DLE-affected bytes and is unaffected by -this shift. - ---- - -### 7.6.4 Recording Mode - -> ✅ **CONFIRMED — 2026-04-20** (BE11529 / firmware S338.17); offsets corrected -> 2026-04-21 after a write-cycle drift bug was traced to writing to the wrong -> byte. **`recording_mode` is at `anchor − 8` for BOTH read and write.** - -Recording mode is a **uint8** stored at a fixed anchor-relative position (using -the 6-byte stable anchor `\xbe\x80\x00\x00\x00\x00`): - -| Enum | Mode | -|---|---| -| `0x00` | Single Shot | -| `0x01` | Continuous | -| `0x02` | Unknown (not yet observed) | -| `0x03` | Histogram | -| `0x04` | Histogram + Continuous (combined mode) | - -**Layout around the anchor (same in E5 read response and SUB 71 write payload):** - -``` -buf[anchor − 9] = mode_prefix (uint8; 0x00 for Single Shot/Continuous, - 0x10 for Histogram (DLE prefix in E5 wire - encoding of 0x03) and for Histogram+Continuous - (actual stored byte)) -buf[anchor − 8] = recording_mode (uint8) ← SAME OFFSET IN READ AND WRITE -buf[anchor − 7] = 0x10 (constant; part of the sample-rate field area; - do NOT overwrite — see warning below) -buf[anchor − 6] = sample_rate_hi (uint8, MSB of uint16 BE) -buf[anchor − 5] = sample_rate_lo (uint8, LSB of uint16 BE) -buf[anchor − 4 : anchor − 2] = histogram_interval_sec (uint16 BE, seconds; - mode-gated to Histogram) -buf[anchor − 2 : anchor] = 0x00 0x00 (padding) -buf[anchor : anchor + 6] = \xbe\x80\x00\x00\x00\x00 (anchor) -buf[anchor + 6 : anchor + 10] = record_time (float32 BE) -``` - -> ⚠️ **Do NOT write to `anchor − 7`.** The byte there is a DLE marker that the -> device firmware re-generates on every read. Writing to it shifts the anchor -> position by +1 on every subsequent read, drifting compliance config offsets -> indefinitely. The CLAUDE.md note "write to anchor-7" was a known mistake — -> see the `_encode_compliance_config` comment block in `client.py:2062–2068`. - -**`compliance_raw` DLE encoding:** - -`compliance_raw` returned by `read_compliance_config()` is NOT purely logical -bytes — it is the wire-encoded payload where any logical `0x03` byte appears as -the literal pair `\x10\x03` (preserved by `S3FrameParser` as inner-frame -literal data). Consequences: - -- For `recording_mode = 0x03` (Histogram), `compliance_raw[anc − 9] = 0x10` - (the DLE prefix from the wire encoding of `0x03`) and - `compliance_raw[anc − 8] = 0x03` (the actual value). -- For Histogram + Continuous (`0x04`), `compliance_raw[anc − 9] = 0x10` is an - actual stored config byte (not a DLE prefix). -- The 6-byte anchor search (`buf.find(b'\xbe\x80...', 0, 150)`) locates the - anchor correctly regardless of these mode-dependent shifts. -- When SFM writes `recording_mode` and round-trips the rest verbatim, the byte - at `anc − 9` is preserved from the previous read. Transitioning - Histogram → other modes via SFM may leave a `0x10` at `anc − 9` — the device - stores it as a literal byte; it does not affect recording-mode operation - (which is at `anc − 8`) but is one byte different from what BW writes. - -**Decode path (`_decode_compliance_config_into`):** `data[anchor_pos − 8]`. -**Encode path (`_encode_compliance_config`):** `buf[anchor_pos − 8] = recording_mode`. - ---- - -### 7.7 Blastware `.set` File Format - -> 🔶 **INFERRED — 2026-03-01** from `Standard_Recording_Setup.set` cross-referenced against known wire payloads. - -Blastware's "save setup to disk" feature produces a binary `.set` file that is structurally identical to the wire protocol payload, but with **all multi-byte values in little-endian byte order** (Windows-native) rather than the big-endian order used on the wire. No DLE framing, no checksums — raw struct dump. - -**File layout (2522 bytes observed):** - -``` -0x0000 Header / metadata block (~40 bytes) — partially decoded -0x002A "Standard Recording Setup.set\0" — setup filename, null-padded -0x0078 Project strings block — same layout as SUB 71 wire payload - "Project:\0" + value, "Client:\0" + value, "User Name:\0" + value, - "Seis Loc:\0" + value, "Extended Notes\0" + value -0x06A0 Channel records block — one record per channel (geo×3 + mic×1 + duplicates) -0x0820 Device info block — serial number, firmware, model strings -0x08C0 Event index / timestamp block -0x0910 Histogram / reporting config -0x09D0 Trailer (10 bytes) -``` - -**Per-channel record layout (little-endian, ~46 bytes per channel):** - -``` -offset size type value (Tran example) meaning -+00 2 uint16 0x0001 channel type (1=geophone, 0=mic) -+02 4 char[4] "Tran" channel label -+06 2 uint16 0x0000 padding -+08 2 uint16 0x0001 unknown -+0A 2 uint16 0x0050 = 80 unknown (sensitivity? gain?) -+0C 2 uint16 0x000F = 15 unknown -+0E 2 uint16 0x0028 = 40 unknown -+10 2 uint16 0x0015 = 21 unknown -+12 4 bytes 03 02 04 01 flags (recording mode etc.) -+16 4 uint32 0x00000003 record time in seconds ✅ CONFIRMED -+1A 4 float32 6.206053 ✅ CONFIRMED 2026-04-17 — ADC-to-velocity scale factor (= 1/sensitivity = (in/s)/V). Interface Handbook §4.5: Range = 1.61133 V × 6.206053 = 10.000 in/s (Normal range). Firmware uses: PPV (in/s) = ADC_voltage × 6.206053. Hardware constant — identical on all tested units. Do NOT write. -+1E 2 00 00 padding -+20 4 float32 0.6000 trigger level ✅ CONFIRMED -+24 4 char[4] "in.\0" / "psi\0" unit string (geo vs mic) -+28 4 float32 2.0000 alarm level ✅ CONFIRMED -+2C 4 char[4] "/s\0\0" / varies unit string 2 -``` - -**MicL channel differences:** -- `channel_type` = 0 (vs 1 for geophones) -- trigger = 0.009, alarm = 0.021 (in psi) -- unit string = `"psi\0"` instead of `"in.\0"` — **confirms MicL units are psi** ✅ - -**Endianness summary:** - -| Context | Byte order | Example (0.6 in/s trigger) | -|---|---|---| -| `.set` file | Little-endian | `9A 99 19 3F` | -| Wire protocol (SUB 71 / E5) | Big-endian | `3F 19 99 9A` | - -> ❓ **`0x082A`** — still unidentified. Record time in the `.set` file = `0x00000003` (3 sec), which would be `00 00 00 03` on wire — not `0x082A`. The original sessions had record time = 2, which would be `00 00 00 02`. `0x082A` = 2090 doesn't match any obvious record time encoding. May correspond to one of the unknown uint16 fields at +0A through +10. A capture changing sample rate or histogram interval would help isolate it. - ---- - -### 7.8 Trigger / Advanced Config Write Frame (BW→S3 SUB `0x82`) - -> ✅ **CONFIRMED — 2026-03-09** from controlled BW-side capture diff (Trigger Sample Width 4→3). - -SUB `0x82` is the BW→S3 write command for the advanced trigger configuration block. It is the write counterpart to the S3→BW read response SUB `0xD1` (0xFF − 0x82 = 0x7D is a separate sub; the D1/2E read pair is distinct). The `0x82` write frame is only visible in `raw_bw.bin` — it does not appear in S3-side compliance dumps. - -**Destuffed BW write frame layout (47 raw bytes → 46 destuffed):** - -``` -offset value meaning -[00] 0x10 addr (literal 0x10 after destuffing) -[01] 0x00 unknown -[02] 0x82 SUB: advanced config write -[03] 0x00 unknown -[04] 0x00 unknown -[05] 0x1C length = 28 bytes (payload size) -[06..10] 00.. header/padding -[11..16] 00.. header/padding -[17] 0x1A unknown (constant 26 = 0x1A) -[18] 0xD5 unknown (constant) -[19] 0x00 unknown -[20] 0x00 unknown -[21] 0x10 literal 0x10 (stuffed in raw frame as 10 10) -[22] 0x04/0x03 Trigger Sample Width ✅ CONFIRMED (uint8, samples) -[23] 0x0A unknown (constant 10; NOT Auto Window) -[24..43] 0xFF.. padding -[44] 0x00 unknown -[45] checksum -``` - -**Confirmed Trigger Sample Width values:** - -| Width setting | Byte [22] | -|---|---| -| 4 samples | `0x04` | -| 3 samples | `0x03` | -| 2 samples (default) | `0x02` (expected — not yet captured) | - -**Known constants in this frame:** `[17]=0x1A`, `[18]=0xD5`, `[23]=0x0A`. These do not change with Trigger Sample Width changes. Byte `[23]` = 10 was initially a candidate for Auto Window (range 1–9) but cannot be Auto Window because 10 is outside the valid range. - -**Mode gating:** This write frame is only transmitted when Blastware performs a Send To Unit operation in Compliance / Single-Shot / Fixed Record Time mode. The frame is absent from other session types. - ---- - -### 7.9 Mode Gating — Protocol Architecture Note - -> ✅ **CONFIRMED — 2026-03-09** from controlled captures and null-change experiments. - -Several settings are **mode-gated**: the device only transmits (reads) or accepts (writes) certain fields when the appropriate operating mode is active. This is an architectural property of the protocol, not a gap in capture methodology. - -**Observed mode gating:** - -| Setting | Gate Condition | Evidence | -|---|---|---| -| Trigger Sample Width | Compliance / Single-Shot / Fixed Record Time mode | Not visible in S3-side reads; only in BW write frame (SUB `0x82`) when mode is active | -| Auto Window | Record Stop Mode = Auto | Capture of 3→9 change in Fixed mode produced zero wire change in all frames (F7, D1, E5 all identical) | - -**Implication for captures:** To map a mode-gated setting, you must first activate the gating mode on the device, then perform the compliance dump or write capture. Changing the setting value while in the wrong mode will produce no observable wire change. - -**Suspected mode-gated settings not yet captured:** -- Auto Window (requires Record Stop Mode = Auto) -- Auxiliary Trigger (unknown gate condition) - ---- - -### 7.5b Full Waveform Record (SUB F3) — 0xD2 bytes (210 bytes) - -> ✅ **Updated 2026-03-31** — Full layout confirmed. See §7.7.5 for the -> complete record structure including timestamp, record type, PPV float -> positions, and project strings. -> Section number changed to `7.5b` 2026-05-20 to disambiguate from §7.5 above. - -Peak values are found by searching for channel label strings `"Tran"`, -`"Vert"`, `"Long"`, `"MicL"` and reading `float32 BE` at `label_offset + 6`. -The floats are **not 4-byte aligned** — confirmed from 3-31-26 capture. - -Example peak values (event 1 from 3-31-26): -``` -Tran: 3D BB 45 7A = 0.0916 in/s -Vert: 3D B9 56 E1 = 0.0907 in/s -Long: 3D 75 C2 7C = 0.0605 in/s -MicL: 39 BE 18 B8 = 0.000145 psi ✅ units confirmed -``` - -Example peak values (event 2 from earlier capture): -``` -Tran: 3D 56 CB B9 = 0.0521 in/s -Vert: 3C F5 C2 7C = 0.0300 in/s -Long: 3C F5 C2 7C = 0.0300 in/s -MicL: 39 64 1D AA = 0.0000875 psi -``` - -> ⚠️ The record is delivered as `data_rsp.data[11:11+0xD2]` — the outer -> data section header (LENGTH_ECHO, KEY_ECHO) occupies data[0..10]. -> Callers of `read_waveform_record()` receive the 210-byte record directly. - -### 7.6 Bulk Waveform Stream (SUB A5) — Raw ADC Sample Records - -> ⛔ **§7.6 below describes the deprecated `0x0400`-step walk and is RETAINED FOR HISTORICAL CONTEXT ONLY.** -> The "A5[7] is metadata", "A5[9] is terminator", and chunk-counter frame-index claims in this section -> are all artifacts of the broken walk that was overrunning past event end by ~5×. -> -> **For the corrected protocol (v0.14.0+), use:** -> - **§7.8.5** — chunk addressing (probe at `start_offset`, samples step 0x0200, bounded by STRT `end_offset`) -> - **§7.8.6** — TERM frame formula -> - **§7.8.7** — fixed metadata pages 0x1002 / 0x1004 (this is where Project / Client / User Name / Seis Loc -> strings actually live — NOT in any sample-chunk frame) -> - **§7.8.8** — multi-event "Download All" sequence -> -> The waveform sample encoding described in §7.6.1 below (4-channel interleaved s16 LE, 8 bytes -> per sample-set) is **NOT actually verified** — see the retraction note at the top of §7.6.1. -> The frame-indexing claims and metadata-source claims in §7.6 are also wrong; use §7.8.5–§7.8.8. - -**Two distinct formats exist depending on recording mode. Both confirmed from captures.** - ---- - -#### 7.6.1 Blast / Waveform mode — 🟡 PARTIAL DECODE (2026-05-11) - -> ### 📌 CURRENT STATUS — read this first -> -> The body codec is **partially decoded** as of 2026-05-11. This -> section contains both current-truth spec AND historical retractions; -> when in doubt, the working summary lives at -> `docs/waveform_codec_re_status.md`. -> -> | Item | Status | -> |---|---| -> | Body has tagged variable-length blocks, NOT raw int16 LE | ✅ confirmed | -> | 5 block tag types (10/20/00/30/40 NN) with lengths | ✅ confirmed | -> | 7-byte preamble: `00 02 00` + Tran[0] + Tran[1] int16 BE | ✅ confirmed | -> | `00 NN` = RLE for zero deltas in the current channel | ✅ confirmed | -> | Tran channel, segment 0 (~482-510 samples / event) | ✅ byte-exact, 5/5 events | -> | Multi-segment Tran continuation | ❌ open (breaks at sample ~512) | -> | Vert / Long / MicL channel decoders | ❌ open | -> | `30 NN` block content (loud-from-start events) | ❌ open | -> | Earlier "raw int16 LE, 8 bytes per sample-set" claim | ❌ REFUTED | -> -> **Production code in `client.py:_decode_a5_waveform` still uses the -> broken int16 LE decoder.** The `.h5` sidecars SFM produces contain -> wrong sample values and must be treated as "unverified" downstream. -> The BW binary write path is unaffected (it's pure passthrough of the -> device's flash bytes, no decoding) and remains byte-perfect. - -The "4-channel interleaved s16 LE, 8 bytes per sample-set" claim that -appeared in earlier revisions of this section was never validated and -was wrong. No event in the project's archive ever came close to ADC -saturation, yet the int16 LE decoder consistently produced full-scale -±32K noise — that was the signature of mis-aligned encoded data, not -signal saturation. - -##### Body file layout - -A Blastware waveform-file body (the variable-length section between -the 21-byte STRT record and the 26-byte file footer) is composed of -**tagged variable-length blocks**, NOT raw int16 samples. - -``` -[preamble: 7 or 9 bytes] -[stream of tagged blocks] -[trailer: per-channel summary blocks] -``` - -**Preamble (CONFIRMED 2026-05-11 across 3+4 events):** - -``` -body[0:3] = 00 02 00 magic -body[3:5] = Tran[0] int16 BE first Tran sample (LSB = 0.005 in/s) -body[5:7] = Tran[1] int16 BE second Tran sample -``` - -The preamble is therefore 7 bytes long. Earlier observations of a -"9-byte preamble" on continuous-mode events were a misread — those -events still have a 7-byte preamble; the next 2 bytes are part of the -first ``10 NN`` or ``20 NN`` data block (its tag). - -Verified preamble decode for all 7 fixture events — Tran[0] and Tran[1] -from the preamble bytes exactly match the BW ASCII export (rounded to -0.005 in/s): - -| Event | Preamble [3:7] (hex) | T[0] decoded | T[0] truth | T[1] decoded | T[1] truth | -|---|---|---|---|---|---| -| event-a (May 8) | ``01 00 00 00`` | +1 | +1 (0.005) | 0 | 0 | -| event-b (May 8) | ``ff ff ff 00`` | -1 | -1 | -1 | -1 | -| event-c (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | -| event-d (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | -| SP0 (May 11) | ``00 04 00 04`` | +4 | +4 (0.020) | +4 | +4 | -| SS0 (May 11) | ``ff a7 ff a7`` | -89 | -89 (-0.445) | -89 | -89 | -| SV0 (May 11) | ``fd 17 fd 06`` | -745 | -745 (-3.725) | -762 | -762 | - -##### Block tags (CONFIRMED 2026-05-08) - -Every block starts with a 2-byte tag. Five tag types are confirmed: - -| Tag (hex) | Block type | On-wire length | -|-----------|-------------------------------------|-----------------------| -| ``10 NN`` | Small-delta data block | NN/2 + 2 bytes | -| ``20 NN`` | Literal data block (int8-shaped) | NN + 2 bytes | -| ``00 NN`` | RLE zero-delta run | 2 bytes | -| ``30 NN`` | Trailer summary block | NN × 4 bytes | -| ``40 NN`` | Segment header | 2 × NN + 16 bytes | - -NN is always a multiple of 4. ``10 NN`` and ``20 NN`` data blocks -alternate with ``00 NN`` markers — every ``10/20 NN`` block is -followed by a ``00 NN`` marker before the next data block. - -###### Wide-NN forms — ``0X NN`` (CONFIRMED 2026-08-25) - -The 12-bit wide-NN encoding already documented for ``1X NN`` / -``2X NN`` (low nibble of the tag byte carries the high nibble of NN, -so effective ``NN = ((tag & 0x0F) << 8) | NN``) **also applies to the -``00 NN`` RLE tag.** A narrow RLE run maxes out at NN = 0xFC, so a -quiet stretch longer than 252 samples must use the wide form. - -Confirmed against six production events, e.g. ``01 0c`` (NN = 268) in -``BE9558/K558LKOF.460W``. Before this was handled, the walker hit its -unknown-tag break at the first long quiet run and silently truncated -every channel decoded after that point. - -###### ``30 NN`` is not capped at NN = 0x10 (CONFIRMED 2026-08-25) - -Data-section ``30 NN`` blocks occur with NN up to at least 0x18 (24), -e.g. ``30 18`` in ``BE18193/T193LQ45.NN0W`` and ``30 14`` in -``BE18193/T193LQ9W.AF0W``. The data-section length formula -(``NN × 1.5 + 2``) holds for these; only the earlier ``NN ≤ 0x10`` -guard was wrong. - -###### ``40 NN`` segment headers are variable width (CONFIRMED 2026-08-25) - -``40 02`` is the common case, but **NN is the count of int16 BE -continuation deltas the header carries for the *previous* channel**, so -the header grows with NN and every field after the deltas shifts by -``2 × NN``: - -``` -length = 2 (tag) + 2 × NN (prev-channel deltas) + 14 (fixed tail) -``` - -``40 01`` (18 bytes) and ``40 03`` (22 bytes) both occur in production -files — see ``BE12599/N599LP1S.UO0W`` and ``BE18438/T438LO30.GA0W``. -In each case the constant ``02 00`` marker sits at ``data[2×NN+8]`` and -the following tag lands exactly on a valid block boundary. - -##### Segments - -The body is divided into segments separated by ``40 02`` segment headers. -**Segment size is variable** — bounded by a fixed device-flash byte -budget, not a fixed sample count. Quiet events fit more samples per -segment (RLE compacts zero deltas via ``00 NN`` markers); loud events -fit fewer. Observed first-segment sizes in the bundled fixtures: - -| Event | Segment 0 size (Tran samples) | -|---|---| -| SP0 (loud, 0.25s pretrig) | 510 | -| SV0 (loud-from-start) | 58 (stops at first ``30 NN``) | -| SS0 (loud-from-start) | 42 (stops at first ``30 04``) | -| JQ0 (Vert-heavy, quiet Tran) | 510 | -| V70 (Mic-heavy, quiet geos) | 510 | - -⚠️ Earlier drafts of this section claimed "~80 sample-sets per segment" -based on incomplete walks; that figure is wrong. Segments are -flash-page-sized in bytes, not sample-count-sized. - -The ``40 NN`` payload structure (offsets shown for the common NN=2 / -18-byte-payload case; add ``2 × (NN − 2)`` to every offset from ``[4:6]`` -onward for other widths): - -| Offset (NN=2) | Generic | Field | Status | -|---------------|------------------|----------------------------------------|-------------| -| [0:4] | [0 : 2NN] | NN × int16 BE continuation deltas for | ✅ confirmed| -| | | the PREVIOUS channel (16-count units) | | -| [4:6] | [2NN : 2NN+2] | Unknown (varies; possibly a checksum) | ❓ open | -| [6:8] | [2NN+2 : 2NN+4] | Byte length to next segment header − 2 | 🟡 likely | -| | | (uint16 BE; off by ±4 on some files) | | -| [8:12] | [2NN+4 : 2NN+8] | Monotonic uint32 LE counter | ✅ confirmed| -| | | (starts ~0x47, +1 per segment) | | -| [12:14] | [2NN+8 : 2NN+10] | Constant ``02 00`` | ✅ confirmed| -| [14:18] | [2NN+10 : 2NN+14]| THIS channel's 2-sample anchor pair | ✅ confirmed| -| | | (2 × int16 BE) | | - -⚠️ An earlier draft listed ``[14:18]`` as an "unknown 4-byte field" and -``[12:16]`` as a constant ``02 00 00 01``. Both were wrong: the constant -is only the 2-byte ``02 00``, and the four bytes after it are the anchor -pair the decoder needs. Corrected 2026-08-25. - -###### Tagless segment headers (CONFIRMED 2026-08-25) - -A segment header can appear with **no ``40 NN`` tag at all** — just the -14-byte tail: - -``` -[field2:2][len_to_next:2][channel_id:4][marker:2][anchors:4] -``` - -This is the NN=0 case: the previous channel needed no continuation -deltas, so there is no tag and no delta bytes. Detect it by the six -bytes at ``[4:10]`` — a known channel id, two zero bytes, a small -segment index, then the ``01 00`` / ``02 00`` marker. - -It is where the walk stopped in 7 of the 8 events that still truncated -after the wide-RLE / ``30 NN`` / variable-width-``40 NN`` fixes. - -###### The header "counter" is really a channel id (CONFIRMED 2026-08-25) - -The 4-byte field previously documented as a *"monotonic uint32 LE -counter (starts ~0x47, increments by 1 per segment)"* is actually: - -``` -[channel_id:1][00][00][segment_index:1] -``` - -| channel_id | channel | -|---|---| -| ``0x46`` | Tran | -| ``0x47`` | Vert | -| ``0x48`` | Long | -| ``0x49`` | MicL | - -Verified on **1697 of 1697** segment headers across the ground-truth -corpus — every one agrees with the channel the rotation would assign, -zero disagreements, no other id values observed. The old reading was -plausible because the id byte cycles 0x46→0x47→0x48→0x49 and the -segment index increments, which *looks* monotonic in LE. - -Decoders should take the channel from this field rather than from -rotation position: one missed or extra header (exactly what tagless -headers used to cause) desyncs rotation and corrupts every channel -after it. - -###### Geophone full scale is 32000 counts, not 32768 (CONFIRMED 2026-08-25) - -The body codec emits geo samples in 16-count units whose LSB is exactly -**0.005 in/s**. With the consumer-side ``×16`` to ADC counts, one ADC -count is ``0.005 / 16`` in/s, so Normal range (10.000 in/s) is - -``` -10.0 / (0.005 / 16) = 32000 counts -``` - -Dividing by 32768 scales every geophone sample and every derived peak -down by ``1 - 32000/32768`` = **2.34%**. Measured on 216 per-channel -comparisons against preserved Blastware ASCII exports: 32768 gave -151/216 exact (worst error 0.238 in/s on a 10 in/s event); 32000 gives -216/216 exact with a worst error of 0.005 in/s — exactly 1 LSB, i.e. -pure quantization. - -This also explains why Blastware reports geo peaks slightly above -nominal full scale (e.g. 10.14 in/s): the ADC has headroom past 32000. - -**Scope — this is not waveform-specific.** The scale is applied where -ADC counts become physical units, which every event passes through -regardless of which codec produced the samples. Verified after -re-deriving the whole production store: - -| source | median ratio ours/device, 32768 | with 32000 | -|---|---|---| -| series-3 waveform (vs ASCII sample table) | 0.9766 | **1.0000** | -| series-3 histogram (vs ASCII PPV, n=1137) | 0.9766 | **1.0000** | -| series-4 Thor IDF (vs device peak, n=1468) | 0.960 | **0.983** | - -The series-4 figure is closer to correct but not exact — the Thor -per-count LSB is its own open question (see §15). - -###### SUPERSEDED 2026-08-25 — the body is a RECORD CHAIN, not a tag stream - -Everything above about ``40 NN`` segment headers, tagless headers, variable -header widths and channel rotation describes a model that is **wrong**. It -produced nearly-correct output because the block table happens to tile the -data sections correctly, but the framing is not what the device writes. - -The body is a chain of **self-delimiting per-channel records**: - -``` -off+0 field2 uint16 purpose unknown (not a length, not a checksum) -off+2 len uint16 BE next_record = off + 2 + len <- authoritative -off+4 chan_id 0x46 Tran / 0x47 Vert / 0x48 Long / 0x49 MicL - 0x06 = END OF WAVEFORM STREAM -off+5 0x00 -off+6 0x00 -off+7 segment index -off+8 mode 2 bytes, a 3-valued enum -off+10 anchors 2 x int16 BE, ABSOLUTE -- present ONLY when mode == 02 00 -``` - -**Mode enum**, all three ground-truth verified: - -| mode | header | data section | -|---|---|---| -| ``02 00`` | 14 bytes | anchors emitted, then blocks are **cumulative deltas** | -| ``01 00`` | 10 bytes | no anchors, blocks carry **absolute** sample values | -| ``00 03`` | 10 bytes | **no tags at all** — raw 12-bit packed absolute samples | - -Census over the 1,388 production series-3 waveform binaries: -``02 00`` x 32,617, ``01 00`` x 74, ``00 03`` x 71. - -**``40 NN`` is an ordinary int16 BE data block** of length ``2*NN + 2`` -(1 <= NN <= 8), never a header. The superseded model read it as a header of -length ``2*NN + 16``, which is exactly why walks drifted: the "variable prefix" -of 0/2/4/6/8 bytes reported earlier was walker drift, precisely -``4 - (old_stop - true_record_start)``, on all 25 affected files. - -Block table for data sections (``NN = ((tag_hi & 0x0F) << 8) | tag_lo``): - -| tag | length | samples | -|---|---|---| -| ``0X NN`` | 2 | NN (RLE hold — holds the previous value in BOTH delta and absolute modes) | -| ``1X NN`` | NN/2 + 2 | NN (4-bit nibble) | -| ``2X NN`` | NN + 2 | NN (int8) | -| ``30 NN`` | NN*1.5 + 2 | NN (12-bit packed) | -| ``40 NN`` | 2*NN + 2 | NN (int16 BE) | - -The ``30 NN`` "trailer length = NN*4" fallback must NOT be applied inside a -record — it corrupts records whose ``30 NN`` sits near a boundary. - -**The preamble is segment 0's implicit Tran record.** ``body[1:3]`` carries -the same mode pair: ``00 02 00`` (1,387 of 1,388 files) means two int16 BE -anchors at ``body[3:7]`` then delta blocks; ``00 00 03`` (1 file, -``BE13121/O121L4L1.KF0W``) means raw 12-bit absolute from ``body[3]``, which -cannot be block-walked — the first record must be located by scanning. - -**Verification.** The length chain terminates on a ``0x06`` record in 1,387 of -1,388 files (the exception has an ambiguous footer signature inside its sample -stream). All four channels come out at identical length in **1,388/1,388**, -against 156/1,388 under the superseded model. Against the 75 events with a -preserved Blastware ASCII export: sample-count exact **72/75 -> 75/75**, fully -exact **70/75 -> 73/75** (the 2 remaining differ by exactly 1 LSB on samples -sitting at the +-10.000 in/s rail). Against device-reported PPVs on a live -decode: waveform **1306/1306** exact with mean absolute ratio error 0.00000; -histogram **4458/4459**. - -This also eliminated the walker-over-read class entirely. 24 of those 35 -"histogram" over-reads were histogram files that ``read_blastware_file`` fed to -the *waveform* codec first; the old walker accepted them and returned garbage -(one produced 98,923 "intervals"), while the record-chain decoder correctly -returns None so they fall through to ``histogram_codec``. - -##### Trailer - -The trailer (after the last segment's data) is a sequence of 32-byte -``30 08`` blocks plus a final ``30 04`` / ``20 04`` / ``40 02`` summary -ending in the constant 2-byte tail ``00 1A``. These contain -per-channel statistics (peak times, peak values, mean offsets — bytes -in the form ``f3/f4/f5`` near ``20 10`` markers strongly resemble -int8 channel-bias values around -12). Detailed decoding of the -trailer is outside the path needed for sample reconstruction. - -##### Tran channel codec — CONFIRMED 2026-05-11 (segment 0) - -After the 7-byte preamble, the body's segment 0 carries Tran deltas -via three block types: - -- ``10 NN``: ``NN/2`` bytes of payload. Each byte = two 4-bit signed - nibbles (high nibble first; 0..7 → 0..+7, 8..F → -8..-1). Each - nibble is one Tran delta in 16-count units (LSB = 0.005 in/s). - -- ``20 NN``: ``NN`` bytes of payload. Each byte = one int8 signed - delta in 16-count units. Used when deltas don't fit in 4 bits. - -- ``00 NN``: a 2-byte marker. Run-length-encoded zero deltas — append - NN copies of the current cumulative Tran value (no change). Used - heavily for silent stretches. - -Segment 0 ends at the first ``40 02`` segment header. Segment 0 typically -covers ~510 sample-sets for events with mostly-quiet Tran, fewer for -events with rapid Tran changes. - -Verified against all bundled fixture events (5-8 and 5-11 bundles): - -| Event | Tran character | Segment 0 size | Matches truth | -|---|---|---|---| -| SP0 (loud all-channels, pretrig=0.25s) | small near sample 0 | 510 | 510/510 ✓ | -| SS0 (loud-from-start) | big from sample 0 | 42* | 42/42 ✓ | -| SV0 (loud-from-start) | big from sample 0 | 58* | 58/58 ✓ | -| JQ0 (Vert-heavy) | near zero | 510 | 510/510 ✓ | -| V70 (Mic-heavy) | near zero | 510 | 510/510 ✓ | - -\* SS0 and SV0 decode stops early because their segment 0 contains -``30 04`` blocks whose internal format hasn't been decoded yet (likely -a channel-switch marker for the high-amplitude regime). The two events -where the codec is most complex stop at the first ``30 04``. - -Implementation: :func:`minimateplus.waveform_codec.decode_tran_initial`. - -##### Multi-segment Tran continuation — OPEN - -After segment 0 ends and the segment header's T_delta (bytes [0:2]) -is applied, the next segment's blocks produce values that diverge from -truth by sample ~512. The block structure inside segment 1 is -identical to segment 0 (alternating ``10 NN`` / ``20 NN`` data + -``00 NN`` RLE), and the per-segment delta budget exactly matches the -segment size — V70 segment 1 has 264 nibble-deltas + 244 RLE-zeros = -508 = the segment's sample count. Cumulative deltas are correct in -aggregate (V70 net-zero ≈ truth net-zero) but the per-sample trajectory -is wrong when applied as Tran continuation. - -The strongest unverified hypothesis is that **segments rotate -channels**: segment 0 = Tran, segment 1 = Vert, segment 2 = Long, -segment 3 = Mic, segment 4 = Tran continuation, … This would explain -the per-segment delta-budget match while also explaining why segment -1 isn't Tran continuation. Verification needs the per-channel anchor -to come from segment-header bytes [4:6] or [14:18], which are still -open. - -##### What's still open - -- **Tran past the first data block.** After the first block, the - body has more ``10 NN`` / ``20 NN`` blocks separated by ``00 NN`` - markers and occasionally ``30 NN`` blocks. Naive continuation - (treat all subsequent ``10/20 NN`` blocks as Tran) does NOT match - truth past the first block — the codec interleaves channels somehow. - ``30 04`` markers appearing in SS0 between blocks 1 and 5 look - like channel-switch tags, but the switching rule has not been - fully decoded. - -- **Vert / Long / MicL channel encodings.** No verified decoder - exists for these yet. Hypotheses tested without success: - V_init stored as int16 BE in ``30 NN`` block payload; V/L/M - blocks encoded in order after Tran with ``30 NN`` separators; - V encoded as ``V - T`` differential. None match truth. - -- **``30 NN`` block length.** In the trailer, ``30 NN`` blocks - are NN×4 bytes long. In the data section, ``30 NN`` blocks are - NN×2 bytes long (= 8 bytes for NN=4 in SS0). The walker tries - NN×2 first and falls back to NN×4 if needed. - -- **Walker correctness past offset ~427 in event-b.** The walker - bails out partway through event-b — there is at least one block - whose length doesn't fit the lengths confirmed for the other - events. This is a separate (now lower-priority) issue. - -##### Recommended next step - -A capture with a known external waveform (calibration tone of known -frequency and amplitude) would unlock the magnitude scaling and -disambiguate which channel a ``20 NN`` block belongs to. Multiple -captures of the same signal at different ``geo_range`` settings -(Normal 10 in/s vs Sensitive 1.25 in/s) would also pin down whether -sample values are scaled at the codec layer or only at the BW -display layer. - -##### Reference module - -``minimateplus/waveform_codec.py`` implements the verified block -walker (:func:`walk_body`, :func:`split_segments`, -:func:`parse_segment_header`). ``decode_waveform_v2`` is a stub that -returns ``None`` until a verified per-byte sample decoder is wired -up; production code (``minimateplus/client.py``) continues to use -the legacy int16 LE decoder, which produces wrong samples but stable -output shape — keep the ``.h5`` sidecars marked as -"sample-codec unverified" until the byte-to-sample mapping lands. - -##### History (do not re-derive) - -| Date | Note | -|---|---| -| 2026-05-11 | Tran channel codec cracked using a high-amplitude (PPV 6-7 in/s) event bundle. Preamble[3:7] = Tran[0]/Tran[1] as int16 BE in 16-count units (LSB = 0.005 in/s). First data block (``10 NN`` nibble-deltas or ``20 NN`` int8-deltas) carries Tran deltas from sample 2. Verified 22+42+46 = 110 samples across SP0/SS0/SV0 with 0 errors. Earlier 96-combination brute-force search on the quiet 5-8 bundle failed because Tran[0] = Tran[1] = 0 in those events made initial-value-from-preamble undetectable. | -| 2026-05-08 | Block tagging confirmed against the 4-event May 2026 bundle. All bodies parse cleanly through `walk_body` for events a/c/d. Event-b walks partway and stops at offset 427 (open issue). | -| 2026-05-08 | Earlier "4-channel interleaved s16 LE" claim formally retracted — never validated, produced full-scale ±32K noise on every event because the bytes are encoded, not raw samples. | -| 2026-04-02 | "Frame 7 metadata", "Frame 9 terminator", and `0x0400`-step chunk-counter claims documented as-was; later proved to be artifacts of an over-reading 5A walk (now superseded by §7.8.5–7.8.7). | - ---- - -#### 7.6.2 Noise monitoring / Histogram mode — ✅ CONFIRMED (3-31-26 capture) - -32-byte blocks with the following layout: - -``` -Offset Size Type Description - 0 2 uint16 LE block type: 0x0016=sync, 0x0000=data - 2 2 uint16 LE block counter (ctr) - 4 18 int16 LE × 9 ADC samples -22 10 bytes metadata: [00 01 43 VAR VAR 00 pretrig rectime 00 00] -``` - -- Sync blocks (type=0x0016) appear at the start of each A5 frame; ctr=0 in sync blocks. -- Data blocks (type=0x0000) carry actual sample data. First data block ctr=288 (empirical, - not yet decoded — likely related to a pre-trigger sample offset). -- Metadata fixed bytes: `00 01 43` then 2 variable bytes, then `00 [pretrig] [rectime] 00 00`. - Pretrig byte = 0x1E (30) and rectime byte = 0x0A (10) for the 3-31-26 capture. -- 9 samples per block (int16 LE, NOT big-endian). Noise floor ≈ 9–11 counts. -- **This is a different recording mode** from waveform/blast — the device firmware uses - 32-byte blocks for histogram/noise monitoring and 4-channel continuous for waveform events. - -> ❓ **Open:** The 9-sample-per-block structure does not divide evenly into 4 channels. -> Whether these represent a single channel, all channels in rotation, or downsampled -> aggregates is not yet determined. The first data block ctr=288 vs pretrig=30 is also -> unexplained — possibly counting in units other than sample-sets. - ---- - ---- - -### 7.7 Event Download Protocol — Confirmed from 3-31-26 Capture ✅ - -> **Added 2026-03-31.** All findings confirmed from live bridge capture -> `bridges/captures/3-31-26/raw_bw_20260331_200245.bin` + -> `raw_s3_20260331_200245.bin` (148 BW frames / 147 S3 frames). -> Analysis scripts: `parsers/analyze_3_31_26.py`. - -#### Overview - -Event download uses four SUBs in a key-driven iterator loop. The -"waveform key" is a 4-byte opaque record address that uniquely identifies -one histogram bin or waveform record on the device's internal storage. - -| Step | BW SUB | S3 Response | Purpose | -|---|---|---|---| -| 1 (once) | `1E` — EVENT_HEADER | `E1` | Get the first waveform key | -| 2 | `0A` — WAVEFORM_HEADER | `F5` | Check record type / confirm full bin | -| 3 | `0C` — WAVEFORM_RECORD | `F3` | Download 210-byte record (peaks, project, timestamp) | -| 4 | `1F` — EVENT_ADVANCE | `E0` | Advance iterator, get next key | -| ↑ repeat steps 2–4 until key == `00 00 00 00` | | | | - -**Blastware optimisation (confirmed):** Step 2 (0A) is only called for the -_first_ key. Subsequent keys come from `1F` with token `0xFE` (download -mode), which guarantees they are full records — so Blastware skips 0A and -jumps directly to 0C. Our implementation follows the same pattern. - ---- - -#### 7.7.1 Waveform Key - -The waveform key is a 4-byte opaque record address (`uint32`, likely -a flash sector offset or circular-buffer pointer internal to the S3 DSP). - -- First key: returned by `1E` at `data[11:15]` -- Subsequent keys: returned by `1F` at `data[11:15]` -- Terminator: `00 00 00 00` signals no more events - -Example keys from 3-31-26 capture (one Blastware "event"): -``` -01 11 00 16 ← first key (full record — see §7.7.3 for length disambiguation) -01 11 11 B6 ← intermediate boundary key -01 11 11 F6 ← intermediate boundary key -01 11 12 36 ← next real-event key -00 00 00 00 ← terminator -``` - -> ⚠️ The 3-31-26 capture was the only "events present" capture available at the -> time of original analysis and contained a single event. The "0x30 = full / -> 0x26 = partial" interpretation in earlier drafts was an artifact of that -> single-event capture; the canonical lengths are `0x46` (real event) and `0x2C` -> (boundary), confirmed across 5-1-26 multi-event captures. See §7.7.3 / §7.8.8. - ---- - -#### 7.7.2 Token Byte (SUB 1E / 1F) - -> ✅ **CORRECTED 2026-04-06** — token byte is at **`params[7]`** (not `params[6]`). -> Confirmed from raw params `00 00 00 00 00 00 00 FE 00 00` in both the 3-31-26 -> and 4-3-26 BW TX captures. With the wrong position the device silently ignores -> the token. - -A token byte at **`params[7]`** controls the 1E/1F behaviour: - -| Token | Mode | Behaviour | -|---|---|---| -| `0x00` | Browse | Advance one record across the full event chain (including boundary keys) | -| `0xFE` | Download (arm) | Used in the 5A bulk-stream arming sequence — see §6.1 | - -**Browse vs download is context-dependent:** - -- `count_events()` and the "Download All" pre-walk (§7.8.8) use **browse mode - (token=`0x00`)** to enumerate the full key chain and discriminate real events - from boundaries via SUB 0A's echoed length (§7.7.3). -- `get_events()` uses `0xFE` for the **arm step** between 0A and 0C (REQUIRED - to wake the 5A state machine — see §6.1) and after 1F to arm the bulk stream, - but then uses browse-mode 1F to advance to the next event key after a - successful 5A. - -Calling 1F with `0xFE` cold (without the preceding 0A and 1E-arm) returns the -null sentinel regardless of how many events are stored — an earlier observation -that token=0xFE "returns null" was the result of testing without those -prerequisite steps. - ---- - -#### 7.7.3 Variable DATA_LENGTH for SUB 0A (WAVEFORM_HEADER) - -> ✅ **CORRECTED 2026-05-01** — earlier values `0x30` / `0x26` came from the -> deprecated histogram-only walk. Confirmed values for triggered-event downloads -> are `0x46` / `0x2C` (see §5.1, §7.8.8). - -Unlike all other SUBs, `0A` does NOT have a fixed data length. The length -is echoed in the probe response at `data[5]` (and is also the value the -data-request step sends back as its offset): - -| Length | Meaning | -|---|---| -| `0x46` (70 bytes) | Full triggered-event waveform header — has a real event to download | -| `0x2C` (44 bytes) | Boundary marker / monitor-log partial record — no triggered event | - -Both the probe and data-request frames carry the same key in `params[4..7]`. -`read_waveform_header()` (protocol.py) reads the echoed length from the probe -response and uses it as the data-request offset, then returns -`(raw_data, length)` so callers (`get_events`, `get_monitor_log_entries`, -"Download All" walk) can decide whether to issue a 0C/5A download or just -advance the iterator. - ---- - -#### 7.7.4 Response Data Section Layout - -**All S3 event download responses** share this data section prefix: - -``` -data[0] LENGTH_ECHO — echoes the request DATA_LENGTH byte -data[1..4] 00 00 00 00 — four zero bytes -data[5..8] KEY_ECHO — echoes the 4-byte waveform key from the request -data[9..10] 00 00 — two zero bytes -data[11..] ACTUAL_DATA — real payload starts here -``` - -Actual data lengths: -- `1E` response (`E1`): `data[11:19]` — 8 bytes (`data[11:15]` = key4) -- `0A` probe response (`F5`): `data[4]` = variable length (0x30 or 0x26) -- `0A` data response (`F5`): `data[11:11+length]` — waveform header bytes -- `0C` data response (`F3`): `data[11:11+0xD2]` — 210-byte waveform record -- `1F` response (`E0`): `data[11:15]` = next key4; `data[8]` = token echo - ---- - -#### 7.7.5 Waveform Record Layout (210 bytes, SUB F3 → response F3) - -> ✅ **Updated 2026-04-01** — Full timestamp layout confirmed against Blastware -> event report (BE11529 thump event, "00:28:12 April 1, 2026"). Record type -> encoding corrected (byte[1], not ASCII string search). Peak Vector Sum field -> confirmed at fixed offset 87. - -The 210-byte record (`data_rsp.data[11:11+0xD2]`) contains: - -**Header / Timestamp** — two layouts exist; **detect via `byte[0]`** of the record header: - -- `byte[0] != 0x10` → **9-byte format** (sub_code=0x10, single-shot waveform) -- `byte[0] == 0x10` → **10-byte format** (sub_code=0x03, continuous waveform; same - layout as partial monitor-log records — see §7.10 / `_decode_0a_partial_header` in client.py) - -The auto-detect logic lives in `_decode_waveform_record_into` (client.py) and in -`_decode_0a_partial_header` for monitor log entries. - -**9-byte format — sub_code = 0x10 (Waveform single-shot) ✅ CONFIRMED 2026-04-01:** -``` -byte[0]: day (uint8) -byte[1]: sub_code 0x10 = Waveform single-shot -byte[2]: month (uint8) -bytes[3–4]: year (uint16 big-endian) -byte[5]: unknown (0x00 in all observed samples ❓) -byte[6]: hour (uint8) -byte[7]: minute (uint8) -byte[8]: second (uint8) -``` - -Thump event raw bytes (2026-04-01 00:28:12, single-shot): -``` -01 10 04 07 ea 00 00 1c 0c -↑ ↑ ↑ ↑──↑ ↑ ↑ ↑ ↑ -d=1 sub m=4 y=2026 ? h=0 m=28 s=12 -``` - -**10-byte format — sub_code = 0x03 (Waveform continuous) ✅ CONFIRMED 2026-04-03:** - -One byte wider than the single-shot layout. All subsequent fields shift +1. - -``` -byte[0]: 0x10 (marker byte; how the decoder distinguishes the two layouts) -byte[1]: day (uint8) -byte[2]: 0x10 (marker; reflects the wire-encoded sub_code=0x03) -byte[3]: month (uint8) -bytes[4–5]: year (uint16 big-endian) -byte[6]: unknown (0x00 ❓) -byte[7]: hour (uint8) -byte[8]: minute (uint8) -byte[9]: second (uint8) -``` - -Continuous event raw bytes (2026-04-03 15:20:17): -``` -10 03 10 04 07 ea 00 0f 14 11 -``` - -Cross-referenced against the `.MLG` file for a single-shot event, which stores an -8-byte timestamp at two offsets (trigger time and end time): -``` -MLG format: [day:1][month:1][year:2 LE][?:1][hour:1][min:1][sec:1] -01 04 ea 07 00 00 1c 0c → trigger at April 1, 2026 00:28:12 -01 04 ea 07 00 00 1c 0f → end time April 1, 2026 00:28:15 (3.0 s record time ✅) -``` - -**Record type** — encoded in `byte[1]` (single-shot) or `byte[0]/byte[2]` markers -(continuous), NOT as an ASCII string: -- `0x10` at `byte[1]` → Waveform single-shot ✅ -- `0x10` at `byte[0]` + `0x10` at `byte[2]` → Waveform continuous ✅ -- histogram sub_code: not yet confirmed in a 0C response (the monitor-log - 10-byte timestamp uses the same continuous-mode marker) - -**Peak particle velocity floats** (✅ CONFIRMED 2026-03-31, re-confirmed 2026-04-01): - -Channel labels `"Tran"`, `"Vert"`, `"Long"`, `"MicL"` are embedded as -ASCII strings at variable offsets within the record. The PPV float for -each channel is at `label_offset + 6` (IEEE 754 big-endian float32). - -The floats are **NOT 4-byte aligned** — Tran, Long, and MicL all fall at -non-aligned offsets. The previous heuristic step-4 scanner missed all three. - -Confirmed offsets from thump event (2026-04-01, cross-referenced vs Blastware): -``` -"Tran" at offset 99 → float at 105 = 0x3ED70A2D = 0.420 in/s ✅ Blastware: 0.420 -"Vert" at offset 114 → float at 120 = 0x4077AE01 = 3.870 in/s ✅ Blastware: 3.870 -"Long" at offset 129 → float at 135 = 0x3EFD7090 = 0.495 in/s ✅ Blastware: 0.495 -"MicL" at offset 144 → float at 150 = 0x3985114E = 0.000254 psi -``` - -Channel labels are separated by inner-frame bytes `10 03` (DLE ETX), -preserved as literal data by `S3FrameParser`. - -**Peak Vector Sum** (✅ CONFIRMED 2026-04-01; offset corrected 2026-04-03): - -``` -Location: tran_pos − 12 (label-relative; IEEE 754 big-endian float32) - = √(Tran² + Vert² + Long²) at the sample instant of maximum - combined geo motion - NOT the vector sum of the three per-channel peaks (those may - occur at different sample times) -``` - -> ⚠️ **Do NOT use fixed offset 87.** That value only happens to be correct for -> `sub_code = 0x10` (single-shot) records, where the 9-byte timestamp leaves the -> peak vector sum at byte 87. For `sub_code = 0x03` (continuous) records, the -> 10-byte timestamp pushes everything one byte later — `tran_pos − 12` is the -> canonical label-relative location and works for both record types. - -``` -Thump event (single-shot, tran_pos=99): - Value at tran_pos − 12 = byte 87 = 0x4079F6C5 = 3.906 in/s - ✅ matches Blastware "Peak Vector Sum: 3.906 in/s" -Near-ambient (single-shot): 0x3C75C28F = 0.015 in/s -``` - -**Project strings** — ASCII label-value pairs (search for label, read null-terminated value): -``` -"Project:" → project description (in 0C record ✅, also mirrored in metadata pages) -"Client:" → client name (in SUB 5A metadata pages ✅ — NOT in 0C) -"User Name:" → operator / user (in SUB 5A metadata pages ✅ — NOT in 0C) -"Seis Loc:" → sensor location (in SUB 5A metadata pages ✅ — NOT in 0C) -"Extended Notes"→ notes field (in SUB 5A metadata pages ✅) -``` - -> ✅ **UPDATED 2026-05-05:** `Client:`, `User Name:`, and `Seis Loc:` come from the -> dedicated **SUB 5A metadata pages at counter `0x1002` and `0x1004`** — see §7.8.7. -> They are NOT present in the 210-byte SUB 0C waveform record. -> -> An earlier draft of this doc claimed they came from "A5 frame 7" of the bulk waveform -> stream — that was an artifact of the deprecated `0x0400`-step walk where the broken -> chunk counter formula happened to land sample-chunk fi=7 on top of the 0x1002 metadata -> page. Under the corrected v0.14.0+ walk (§7.8.5), sample chunks at `0x1000` / `0x1200` -> contain ordinary waveform data, and the metadata pages are read separately. -> -> The strings reflect the compliance setup that was active when the *monitoring session* -> first started (not per-event). `get_events()` reads the metadata pages once at the start -> of the SFM session and the decoded values are stamped onto every event in that session. - ---- - -#### 7.7.6 Complete Download Loop (Python pseudocode) - -```python -key4, _ = proto.read_event_first() # SUB 1E -if key4 == b'\x00\x00\x00\x00': - return [] # no events - -events = [] -is_first = True - -while key4 != b'\x00\x00\x00\x00': - if is_first: - _header, rec_len = proto.read_waveform_header(key4) # SUB 0A - is_first = False - if rec_len < 0x30: - key4 = proto.advance_event() # skip partial first bin - continue - - record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) - events.append(decode(record)) - - key4 = proto.advance_event() # SUB 1F (token=0xFE) - -return events -``` - ---- - -### 7.7.7 Updated Download Loop with SUB 5A Metadata - -> ⛔ **The loop in this subsection is DEPRECATED — it uses the broken `stop_after_metadata=True` -> hack and the wrong sequence ordering.** See §7.8.5–§7.8.8 for the corrected protocol. -> The pseudocode below is preserved as historical record only. - -```python -key4, _ = proto.read_event_first() # SUB 1E -if key4 == b'\x00\x00\x00\x00': - return [] - -events = [] -is_first = True - -while key4 != b'\x00\x00\x00\x00': - if is_first: - _header, rec_len = proto.read_waveform_header(key4) # SUB 0A - is_first = False - if rec_len < 0x30: - key4 = proto.advance_event() - continue - - record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) - event = decode(record) - - a5_data = proto.read_bulk_waveform_stream( # SUB 5A → A5 frames - key4, stop_after_metadata=True) - client._decode_a5_metadata_into(a5_data, event) # overwrites project_info - - events.append(event) - key4 = proto.advance_event() # SUB 1F (token=0xFE) - -return events -``` - ---- - -### 7.8 SUB 5A — Bulk Waveform Stream (event-time metadata) - -> ✅ **§7.8.1 (frame format) — added 2026-04-02; v0.14.3 partial DLE stuffing finalized 2026-05-05.** -> Frame format confirmed by reproducing Blastware wire bytes byte-for-byte across the 1-2-26 -> capture (10 frames) and the 5-1-26 bwcap3sec capture (17 frames, all match including the -> DLE-stuffed `10 10 00` for counter=0x1000). - -SUB 5A initiates a bulk transfer of the raw sample data for a stored event. The response is -a sequence of A5 frames. Project-info ASCII strings (`Project:`, `Client:`, `User Name:`, -`Seis Loc:`, `Extended Notes`) live in the dedicated metadata pages at counter `0x1002` -and `0x1004` (see §7.8.7), not in the sample-chunk stream. - -**For the corrected protocol read in order:** -- §7.8.1 — frame format (raw `offset_hi`, DLE-aware checksum, partial DLE stuffing of params) -- §7.8.5 — chunk addressing (probe → metadata pages → samples → TERM, all bounded by `end_offset`) -- §7.8.6 — TERM frame formula -- §7.8.7 — fixed metadata pages 0x1002 / 0x1004 -- §7.8.8 — multi-event "Download All" sequence - -§7.8.2–§7.8.4 are retained as historical record of earlier (incorrect) understandings — -do not implement against them. - -#### 7.8.1 Frame Format - -SUB 5A uses a **non-standard frame layout** that differs from all other BW→S3 write commands. - -``` -[ACK][STX][10][10][00][5A][00][offset_hi][offset_lo][params...][chk][ETX] - 41 02 10 10 00 5A 00 ^^raw^^ ^^raw^^ ^^stuffed^^ -``` - -Three critical differences from `build_bw_frame`: - -1. **`offset_hi` is sent raw, not DLE-stuffed.** When `offset_hi = 0x10`, the wire carries - a bare `0x10` — NOT the stuffed `10 10` that `build_bw_frame` would produce. The device - ignores frames where this byte is incorrectly stuffed. - -2. **DLE-aware checksum.** Walking the full frame byte sequence: when a `10 XX` pair is seen, - only `XX` is added to the running sum; lone bytes are added normally. - -3. **Partial DLE stuffing of `0x10` bytes in the params region** (CONFIRMED 2026-05-05). - The device's de-stuffing rule for the params region is: - - - `10 10` → de-stuffs to `10` - - `10 02 / 03 / 04` → kept literal (these are inner-frame markers) - - `10 X` for other X → de-stuffs to just `X` (drops the leading `0x10`) - - Therefore any `0x10` byte in the *logical* params that is followed by a byte NOT in - `{0x02, 0x03, 0x04, 0x10}` MUST be doubled on the wire (`10 X` → `10 10 X`) so the - device's de-stuffer reproduces the original `10 X` pair. This applies most commonly - to counters with `0x10` in the high byte (e.g. counter=`0x1000` produces logical - params bytes `... 10 00 ...`, which BW encodes on the wire as `... 10 10 00 ...`). - Without this stuffing the device interprets counter=`0x1000` as `0x0000` and returns - the probe response (= a copy of the file header + STRT record); that STRT block then - ends up embedded in the assembled file body and Blastware refuses to open the file. - - `0x10` bytes in `offset_hi` are still written RAW per (1) above — only the params - region has this stuffing requirement. Metadata-page params for counter `0x1002` / - `0x1004` survive without stuffing because `10 02` / `10 04` fall in the "kept literal" - carve-out. - - Verified against BW 5-1-26 bwcap3sec frame 20: params logical bytes - `00 01 11 10 00 00 00 00 00 00 00` (counter=0x1000) are encoded on the wire as - `00 01 11 10 10 00 00 00 00 00 00 00` (12 wire bytes for 11 logical bytes). - -#### 7.8.2 Request Sequence — DEPRECATED 2026-05-01 (see §7.8.5–§7.8.7 for the corrected protocol) - -> ⛔ **The 0x0400-step / max(key4[2:4], 0x0400) formula in this section is WRONG.** Five new -> BW MITM captures (4-27-26 + 5-1-26) prove the actual chunk increment is **0x0200**, the -> chunk loop is bounded by `end_offset` from the STRT record (not by chunk count or by a -> device-side timeout), and the TERM frame's `offset_word=0x005A` magic is incorrect — the -> real TERM offset_word is computed from `end_offset` and the last chunk address. Under the -> deprecated formula SFM over-reads roughly 5× past the actual event end into post-event -> circular-buffer garbage, corrupting reconstructed Blastware files for any waveform ≥ 2 sec. -> -> The whole "stop_after_metadata + one extra chunk + 0e 08 footer" workaround in this -> section was compensating for the missing end_offset bound. It is obsoleted by the -> STRT-bounded walk in §7.8.5. -> -> **Read this section for historical context only.** For the correct protocol, jump to: -> - §7.8.5 — chunk addressing and the STRT end_offset -> - §7.8.6 — TERM frame formula -> - §7.8.7 — fixed metadata pages 0x1002 and 0x1004 - -| Frame | offset_word | counter | params | Purpose | -|---|---|---|---|---| -| Probe | `0x1004` | `0x0000` | 10 bytes (`bulk_waveform_params(0)`) | Initiate transfer | -| Chunk 1 | `0x1004` | `max(key4[2:4], 0x0400)` | 11 bytes | First data chunk | -| Chunk 2 | `0x1004` | `max(key4[2:4], 0x0400) + 0x0400` | 11 bytes | Second chunk | -| Chunk N | `0x1004` | `max(key4[2:4], 0x0400) + (N-1) * 0x0400` | 11 bytes | Nth chunk | -| … | … | … | … | … | -| Termination | `0x005A` | `max(key4[2:4], 0x0400) + N * 0x0400` | 10 bytes | End transfer | - -> Historical correction notes (left in place to deter re-derivation of the same wrong formula): -> the table above was the result of three iterative "corrections" between 2026-04-06 and -> 2026-04-26 that progressively narrowed in on the wrong answer because every test was on -> events with `key4[2:4]=0` and the device responds to whatever counter you ask for. The -> 5-1-26 captures with a non-zero start_key event (`01112238`) finally exposed the bug. - -The `stop_after_metadata=True` flag (deprecated as a primary loop-exit) scanned for -`b"Project:"` in the chunk stream because the metadata strings happened to be reachable -when the broken 0x0400-step walk passed the global metadata pages at 0x1002/0x1004. Under -the corrected walk, those strings come from explicit reads at counter=0x1002 and 0x1004, -not from the sample-chunk stream — see §7.8.7. - -#### 7.8.3 A5 Frame Layout — DEPRECATED 2026-05-01 - -> ⛔ **The "Frame 7 carries the compliance text block" claim below is WRONG.** It was -> an artifact of the deprecated `0x0400`-step walk where the broken counter formula -> happened to land sample-chunk fi=7 on top of the 0x1002 metadata page in flash. -> Under the corrected v0.14.0+ walk (§7.8.5), Frame 7 of the sample-chunk sequence is -> just sample-chunk #5 (counter=0x1000), and contains either ordinary waveform data or — -> critically when DLE-stuffing of params is wrong (§7.8.1.3) — a duplicate file header + -> STRT block when the device misinterprets counter=0x1000 as 0x0000. See §7.8.7 for the -> actual source of these strings. - -Historical claim (NOT TO BE IMPLEMENTED): each A5 response frame contains a chunk of raw -bulk data; Frame 7 of the stream carries the compliance text block with all project-info -label-value pairs: - -``` -"Project:" → null-terminated project name -"Client:" → null-terminated client name -"User Name:" → null-terminated operator name -"Seis Loc:" → null-terminated sensor location -"Extended Notes" → null-terminated notes -``` - -All five fields do reflect the **setup at event-record time**, not the current device -config. But the source is the metadata pages (§7.8.7), not "Frame 7" of the sample -stream. - -#### 7.8.4 End-of-Stream Behaviour and Chunk Timing — REINTERPRETED 2026-05-01 - -> The "1 raw byte then silence" pattern documented below was originally interpreted as -> "the device's natural end-of-event signal." The 5-1-26 captures show this is actually -> the device's response when the requester has walked **past** the addressable buffer -> region (i.e. ~5× past the actual event end under the deprecated 0x0400-step walk). -> Under the corrected STRT-bounded walk (§7.8.5), the stream ends cleanly with the TERM -> frame's response — no timeout, no 1-byte teaser. The fallback below remains useful as -> defensive handling for malformed events but should not be the primary loop-exit. - -**Defensive fallback handling in `read_bulk_waveform_stream`:** -``` -TimeoutError caught (rare under corrected walk): - if bytes_fed > 0 AND frames already collected: - → graceful end-of-stream; break loop; proceed to termination frame - else (bytes_fed == 0, no prior frames): - → genuine transport failure; re-raise -``` - -**Chunk timing (BE11529, 1024 sps, TCP/cellular) — total A5 frames per event:** - -| Metric | Observed value | -|---|---| -| Chunk response time | ~1 s per chunk | -| 2-sec event 1 (corrected walk) | ~15 frames (probe + 2 metadata pages + ~12 sample chunks + TERM) | -| 3-sec event 1 (corrected walk) | 16 frames (probe + 2 metadata pages + 13 sample chunks + TERM) | -| 2-sec continuation event (corrected walk) | 16 frames (~15 sample chunks + TERM; no metadata reread) | -| 3-sec continuation event (corrected walk) | ~15 frames (~14 sample chunks + TERM) | -| Same event under deprecated 0x0400 walk | ~37 frames (over-reads ~5× into post-event garbage) | -| Data per chunk (corrected, 0x0200 size) | ~540–575 bytes wire (= 0x0200 payload + framing) | -| Data per chunk (deprecated 0x0400 step) | 1,036–1,123 bytes wire (= 0x0400 payload + framing) | -| Safe recv timeout per chunk | **10 s** (10× typical) | -| Default transport timeout | 120 s → ~2-min stall at end-of-stream | - -**ADC count-to-physical conversion — ✅ CONFIRMED 2026-04-17:** - -Raw samples are signed 16-bit integers (−32,768 to +32,767). Source: Interface Handbook §4.5. - -**CONFIRMED 2026-04-17** — The `max_range_geo` field (float32 = 6.206053, bytes `40 C6 97 FD`) is the **ADC-to-velocity scale factor** (inverse sensitivity, (in/s)/V) for the standard Instantel geophone, confirmed from Interface Handbook §4.5. The correct conversion formula is: - -``` -PPV (in/s) = ADC_voltage (V) × 6.206053 - = counts × (1.61133 / 32767) × 6.206053 - = counts × 4.982e-5 (in/s per count at full scale) -``` - -where `geo_range = 1.61133 V × 6.206053 = 10.000 in/s` is the Normal (Gain=1) full-scale range. The earlier ~9× overread was caused by mistakenly using 6.206053 as the range directly — it is actually the scale factor, and the range itself is `ADC_fullscale × scale_factor = 1.61133 × 6.206053 = 10.000 in/s`. Mic channel uses psi units with its own range (still unresolved). - -**Decoder note — fi==9 hardcoded skip (FIXED 2026-04-06):** - -`_decode_a5_waveform()` previously had `elif fi == 9: continue` — a leftover from -the original 9-frame blast capture where frame 9 was assumed to be the device -terminator. Removed. Under the v0.14.0+ STRT-bounded walk the chunk loop never -encounters a "terminator frame index" anyway — it stops at `end_offset` -calculated from the STRT record (§7.8.5) and the TERM frame is sent explicitly -(§7.8.6). For other decoders, terminator detection should use -`frame.page_key == 0x0000`, not a hardcoded frame index. - -#### 7.8.5 Chunk addressing and the STRT end_offset (NEW 2026-05-01) ✅ - -> ✅ Confirmed across 3 events (4-27-26 + 5-1-26 captures). - -`params[0]` is always `0x00`. `params[1:5]` is a 4-byte absolute device flash-buffer -address — equivalently, "the key of the page being requested." The device returns 0x0200 -(= 512) bytes starting at that address. Increments between consecutive sample chunks are -**0x0200, NOT 0x0400** (the previous 0x0400 figure was a Blastware-side artifact / our -implementation's bug — see §7.8.2). - -##### STRT record (data layout in the first A5 response) - -The first A5 response (the probe response, or the first chunk for continuation events) -contains a **STRT record** at byte offset 17 of `data`: - -``` -data[ 0:14] echoes request: [chunk_size_hi=0x02 / 0x04 ...] [00] [01 11] [counter_hi counter_lo] [00 × 8] [00 12] -data[14:17] 10 03 00 ← inner DLE+ETX frame separator (preserved literally) -data[17:21] "STRT" ← magic -data[21:23] ff fe ← sentinel -data[23:27] end_key ← 4-byte key of where this event ENDS -data[27:31] start_key ← 4-byte key of where this event STARTS -data[31:33] uint16 BE ← ?? sample count or byte count, varies (not yet decoded) -data[33:35] uint16 BE ← ?? -data[35] 0x46 ← record type marker (waveform full record) -data[36:] additional pointers / first sample bytes — content varies by event -``` - -`end_offset = (end_key[2] << 8) | end_key[3]` is **the authoritative event-end pointer**. -Use it to bound the chunk loop and to compute the TERM frame. - -##### Chunk pattern by event location in buffer - -**Event 1 / start_key[2:4] = 0x0000** (first event after erase or wrap): - -``` -1. Probe at counter = 0x0000 (params[1:5] = full key) -2. Read fixed metadata pages counter = 0x1002, then 0x1004 -3. Walk sample chunks counter = 0x0600, 0x0800, …, by 0x0200, - up to but not including end_offset & 0xFE00 -4. TERM (see §7.8.6) -``` - -The range `[0x0046, 0x0600)` is skipped — likely some pre-event firmware-reserved area for -the first slot in a freshly-erased buffer. Harmless to skip; BW does the same. - -**Event 2+ / start_key[2:4] != 0x0000** (continuation events in a populated buffer): - -``` -1. First chunk at counter = start_key[2:4] ← acts as both probe and first - sample chunk; response carries STRT at byte 17 -2. Walk sample chunks counter += 0x0200 each -3. TERM -``` - -**`start_key` here is the off=0x46 WAVEHDR record key returned by 1F** (e.g. `01112238`), -NOT the off=0x2C boundary key that immediately precedes it. An earlier draft of this -spec described event-N as "probe at start + 0x46" — that formula was correct only if -"start" meant the boundary key (0x21F2 in the 5-1-26 event 2 case). In the iteration -walk used by SFM and BW, `cur_key` passed into the 5A flow is always the off=0x46 key, -so the probe counter equals `cur_key[2:4]` with no extra offset. Adding +0x46 places -the probe one WAVEHDR past the actual event start, the response no longer contains -STRT at byte 17, and the chunk loop falls back to the `max_chunks` cap. - -Confirmed: -- 5-1-26 "copy 2nd address" BW capture: probe counter=0x2238 with key=01112238; A5[0] - has STRT@17 with end_offset=0x417E. -- 5-4-26 BW 2-sec event capture: same probe counter=0x2238, same end_offset=0x417E. - -**No metadata-page reads.** Pages 0x1002/0x1004 are session-global and were already read -during event 1 in the same Blastware session. In SFM, treat metadata pages as a once- -per-`MiniMateClient.connect()` (or once-per-call-home) read, not per-event. - -##### Verified end_offset values - -| Capture | start_key | end_key | end_offset | event size | sample-chunk start | -|---|---|---|---|---|---| -| 4-27-26 "open 2sec" / "copy event to disk" | `01110000` | `01111ABE` | `0x1ABE` | 6,846 B | 0x0600 (event-1 case) | -| 5-1-26 "copy 3sec" / Download All event 1 | `01110000` | `011121F2` | `0x21F2` | 8,690 B | 0x0600 (event-1 case) | -| 5-1-26 "copy 2nd address" / DA event 2 | `01112238` (= 1F result) | `0111417E` | `0x417E`, span 0x1F8C = 8,076 B | 0x2238 (= cur_key[2:4]) | -| 5-4-26 BW 2-sec event | `01112238` | `0111417E` | `0x417E` | 0x2238 (= cur_key[2:4]) | - -#### 7.8.6 TERM Frame Formula (NEW 2026-05-01) ✅ - -> ✅ Confirmed across 3 events. Replaces the deprecated `offset_word=0x005A` / `params[2] = key4[2]` formula in §7.8.2. - -The TERM frame fetches the partial last chunk and the file footer. Its response payload -contains the bytes between the last full 0x0200-aligned chunk and `end_offset` — typically -20–520 B — and is **required for reconstructing the Blastware waveform file**. Append the -TERM response data to the chunk stream like any other A5 frame. - -``` -last_chunk_counter = address of last full 0x0200-byte chunk read -next_boundary = last_chunk_counter + 0x0200 -TERM offset_word = end_offset - next_boundary -TERM params[0] = key[0] (= 0x01 on every observed device) -TERM params[1] = key[1] (= 0x11) -TERM params[2] = (next_boundary >> 8) & 0xFF -TERM params[3] = next_boundary & 0xFF -TERM params[4:10] = zeros ← 10-byte params (not 11) - -Frame = build_5a_frame(offset_word, params) -``` - -The device receives `requested_address = (params[2] << 8) | offset_word` (where offset_word -contains both `offset_hi` and `offset_lo` of the 5A frame, with the high bit of offset_hi -being effectively `bit 0 of (end_offset >> 8)`). It reconstructs `end_offset` and replies -with `(end_offset - next_boundary)` bytes of waveform tail starting at `next_boundary`. - -##### Verification - -| Event | end_offset | last chunk | next_boundary | TERM offset_word | TERM params[2:4] | TERM response size | -|---|---|---|---|---|---|---| -| 2-sec | `0x1ABE` | `0x1800` | `0x1A00` | `0x00BE` ✓ | `1A 00` ✓ | 208 B | -| 3-sec | `0x21F2` | `0x1E00` | `0x2000` | `0x01F2` ✓ | `20 00` ✓ | 520 B | -| Event-2 | `0x417E` | `0x3E38` | `0x4038` | `0x0146` ✓ | `40 38` ✓ | (not measured directly; same pattern) | - -Equivalent way to write the formula: -- `offset_word = end_offset & 0x01FF` — low 9 bits of end_offset -- `params[2:4] = (end_offset & 0xFE00) BE` — high 7 bits of end_offset, low byte zeroed - -(The two forms are arithmetically identical to `end_offset - next_boundary` and -`next_boundary` because `next_boundary = end_offset & 0xFE00` whenever the chunk loop -stopped at the last full 0x0200 boundary below end_offset.) - -#### 7.8.7 Fixed Metadata Pages 0x1002 / 0x1004 (NEW 2026-05-01) 🔶 - -> 🔶 Inferred — observed in BW captures but page contents not yet byte-decoded. - -Two chunk addresses are **GLOBAL** device/session metadata, not event-specific: - -- `counter = 0x1002` — first metadata page -- `counter = 0x1004` — second metadata page - -These are at fixed absolute addresses in the device's flash buffer. They contain the -session-start compliance-setup ASCII strings — **Project**, **Client**, **User Name**, -**Seis Loc**, **Extended Notes** — that under the deprecated 0x0400-step walk used to be -discoverable in the sample-chunk stream as "A5 frame 7" content. Under the corrected -0x0200-step walk these strings come exclusively from the dedicated metadata-page reads, -not from sample chunks. - -##### Caching strategy - -BW reads them ONCE per Blastware session, during event 1's download, and caches them. -For SFM: -- Read once per `MiniMateClient.connect()` / once per call-home session. -- Subsequent events in the same session don't need to re-fetch them. -- Their content does not change while iterating events. They DO change when the user - applies a new compliance setup (SUB 71 write) — invalidate the cache then. - -##### Content layout — string-search decoder in place - -The full byte-for-byte structural layout of pages 0x1002 and 0x1004 has not been -mapped, but `_decode_a5_metadata_into` (`minimateplus/client.py`) successfully -extracts the user-facing strings via label scans: - -``` -b"Project:" → project description -b"Client:" → client name -b"User Name:" → operator -b"Seis Loc:" → sensor location -b"Extended Notes" → notes -``` - -This works across all observed captures (4-27-26, 5-1-26, 5-4-26). A future -project could dump the structural layout if additional session-global fields -need to be extracted — but the strings already decode correctly. - -#### 7.8.8 "Download All" Sequence (NEW 2026-05-01) ✅ - -> ✅ Confirmed from 5-1-26 "Download All" capture (`raw_*_171216_download_all_2events.bin`). - -Before any 5A traffic, BW's "Download All" pre-walks the entire event chain to map keys -and event boundaries: - -``` -SERIAL × 2 → CHCFG → EVT_KEY (1E, all-zero) → key0 - → WAVEHDR (0A, key0) → off=0x46 (real event start) - → EVT_NEXT (1F, all-zero) → key1 - → WAVEHDR (0A, key1) → off=0x2C (boundary) - → EVT_NEXT → key2 - → WAVEHDR (0A, key2) → off=0x46 (real event start) - → EVT_NEXT → key3 - → WAVEHDR (0A, key3) → off=0x2C (boundary) - → EVT_NEXT → null sentinel -``` - -The DATA_LENGTH at `data_rsp.data[5]` (echoed BW offset for the data fetch step) -disambiguates real events from boundary markers: - -| WAVEHDR offset | Meaning | -|---|---| -| `0x46` (= 70) | Real event start key — this key has event data behind it | -| `0x2C` (= 44) | Boundary marker — this key is the END of the previous event AND the start of the empty/header gap before the next event | - -Pairs: each real event spans `[real_key, next_real_key)` in the buffer. In the example -above: event 1 = `[01110000, 011121F2)`, event 2 = `[01112238, 0111417E)`. Note that the -"end of event 1" key (`011121F2`) is also the "boundary key" that comes BEFORE event 2's -real start key (`01112238`) — they differ by exactly 0x46 bytes (the event header size). - -After the pre-walk completes, BW downloads each `0x46`-keyed event in turn using the 5A -bulk stream protocol from §7.8.5. Use the `0x46` keys, not the `0x2C` keys, as input to -`read_bulk_waveform_stream`. - ---- - -## 7.9 Compliance Config Field Inventory (Blastware UI, 2026-04-08) ✅ - -Fields visible in the Blastware "Compliance Setup" dialog. ✅ = byte offset confirmed in code. ❓ = not yet located in raw bytes. - -### Recording Setup tab - -| Field | Values / Type | Status | -|---|---|---| -| Recording Mode | Single Shot (`0x00`) / Continuous (`0x01`) / Histogram (`0x03`) / Histogram+Continuous (`0x04`) | ✅ `recording_mode` — uint8 at **anchor − 8** (SAME offset in E5 read and SUB 71 write, using 6-byte anchor `\xbe\x80\x00\x00\x00\x00`) — confirmed 2026-04-21 | -| Record Stop Mode | Fixed Record Time / Auto / Manual Stop | ❓ Hint: `data[40]` in E5 sf1 changed `01 7F` → `00 00` alongside Continuous → Single Shot; may be related but unconfirmed independently | -| Sample Rate | Standard 1024 / Fast 2048 / Faster 4096 sps | ✅ `sample_rate` — uint16 BE at **anchor − 6** | -| Record Time | float, seconds (3, 5, 8, 10, 13…) | ✅ `record_time` — float32 BE at **anchor + 6** | -| Histogram Interval | `2s / 5s / 15s / 1m / 5m / 15m` (uint16 BE seconds; mode-gated to Histogram / Histogram+Continuous) | ✅ `histogram_interval_sec` — uint16 BE at **anchor − 4**, same in read and write — confirmed 2026-04-20 | -| Storage Mode | Save All Data / Save Triggered | ❓ | -| Geophone Type | Standard Triaxial / 4.5 Hz Geophone | ❓ | -| Geophone — Enable all | bool | ❓ | -| Geophone — Trigger Source | bool | ❓ | -| Chan 1-3 Trigger Level | float, in/s | ✅ `trigger_level_geo` | -| Chan 1-3 Maximum Range (range selector) | Normal 10.000 / 1.25 in/s | ✅ `geo_range` uint8 — **CONFIRMED 2026-04-20.** Offset = Tran+33 (same in E5 read and SUB 71 write — 2126-byte buffer is round-tripped verbatim). `0x00`=Normal 10 in/s, `0x01`=Sensitive 1.25 in/s. Applied to Tran/Vert/Long. **`Tran+20` is NOT this field** (constant 0x01 on all captures). | -| Chan 1-3 ADC Scale Factor | 6.206053 (in/s)/V | ✅ `geo_adc_scale` float32 — **CONFIRMED 2026-04-17.** Offset = Tran+28 (same in E5 read and SUB 71 write). Inverse sensitivity = 1/0.161133. Interface Handbook §4.5: 1.61133 V × 6.206053 = 10.000 in/s. Hardware constant — do NOT write. | -| Microphone — Enable all | bool | ❓ | -| Microphone — Trigger Source | bool | ❓ | -| Chan 4 Trigger Level | float, dB or psi | ❓ | - -### Notes tab - -| Field | Values / Type | Status | -|---|---|---| -| Enable User Notes | bool | ❓ | -| Project | ASCII string | ✅ (sourced from SUB 5A metadata pages at counter `0x1002` / `0x1004` — see §7.8.7) | -| Client | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| User Name | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| Seis Loc | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | -| Enable Extended Notes | bool | ❓ | -| Extended Notes | ASCII text | ❓ | -| Extended Notes Title | ASCII string | ❓ | -| Enable Job Number | bool | ❓ | -| Job Number | int | ❓ | -| Enable Scaled Distance | bool | ❓ | -| Distance from Blast | float | ❓ | -| Charge Weight | float | ❓ | - -### Special Setups tab - -| Field | Values / Type | Status | -|---|---|---| -| Unit Timer Mode | Off / On | ❓ | -| Start Date/Time | date+time | ❓ | -| Stop Date/Time | date+time | ❓ | -| Self Check Mode | Off / On | ❓ | -| Self Check Time | HH:MM | ❓ | -| **Sensor Check** | **Before monitoring / After each event / Disabled** | ❓ not yet located | -| Measurement Units | Imperial / Metric | ❓ | -| Show Mic units in dB | bool | ❓ | -| Time Format | 24 Hour / 12 Hour (AM/PM) | ❓ | -| Backlight on Time | int, seconds (0–255) | ✅ event index block +75 | -| Power Saving Timeout | int, minutes | ✅ event index block +83 | -| Monitoring LCD Cycle | int | ✅ event index block +84:86 (uint16 BE) | -| Set unit time with setup | bool | ❓ | - -**Note on Sensor Check:** The dropdown has three states — "Before monitoring", "After each event", "Disabled". The user's unit always runs "Before monitoring", so no enable/disable diff capture has been done yet. Finding this byte requires a capture with Disabled vs Before-monitoring with all other settings held constant. - ---- - -## 7.10 SUB 0x0E — Channel Sensor Data & SUB 0x98 — Trigger Test ✅ 2026-04-08 - -Both confirmed from 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). - -### SUB 0x0E — Channel Sensor Data - -Standard two-step read. Data length: **0x0A (10 bytes)** per channel. - -**Request params:** Channel selector in `params[6:8]` (bytes 6 and 7 of the 10-byte params field). - -| `params[6:8]` | Channel | -|---|---| -| `00 00` | Channel 0 (Transverse) | -| `00 01` | Channel 1 (Vertical) | -| `10 02` | Channel 2 (Longitudinal) — note `0x10` in params[6] | -| `00 03` | Channel 3 | -| `10 04` | Channel 4 — note `0x10` in params[6] | -| `00 05` | Channel 5 | -| `00 06` | Channel 6 | -| `00 07` | Channel 7 | - -Response SUB = 0xFF − 0x0E = **0xF1**. - -**Response data (10 bytes at section = data[11:]):** - -The data response payload for each channel is 10 bytes. From the sensor-check S3 capture, -channels 0 and 1 have non-zero data; channels 5–7 are all-zero (no sensors connected to those channels). Full byte-level field mapping NOT YET done — data includes overswing ratio, frequency, and amplitude per the Blastware "Unit Channel Test" dialog columns. - -Example (channel 0, first pass): -``` -data[11:] = 00 01 00 00 4A 00 25 10 02 0A (17 bytes including probe + data frames combined) -``` - -Probe frame response confirms data length in page bytes; data frame carries the 10-byte channel reading. - -**Blastware "Unit Channel Test" sequence (confirmed 4-8-26/sensor-check):** - -``` -SESSION_RESET + POLL × 3 (startup — SESSION_RESET required for monitoring unit) -SUB 0x08 (event index read) -POLL × 8 (Blastware polls while waiting; unit may be in sensor check during this window) -SUB 0x15 (serial number, data length 0x0A) -SUB 0x01 (device info, data length 0x98) -SUB 0x08 (event index again) -SUB 0x01 (device info again) -SUB 0x0E × 8 channels (pass 1 — channels 0–7, probe+data each) - [~40 second gap if unit is performing on-device sensor check] -SUB 0x0E × 8 channels (pass 2 — same channels, fresh ADC readings) -SUB 0x98 × 2 (trigger test) -``` - -### SUB 0x98 — Trigger Test - -Single probe frame only. No data step. - -**Request format:** `params[0] = 0xFF` (all other param bytes = 0x00). Sent as a single frame (probe step only, no data step). - -Response SUB = 0xFF − 0x98 = **0x67**. Response is a standard 17-byte zero-data S3 frame. - -Wire bytes for request (confirmed frame 52 of 4-8-26 BW capture): -``` -41 02 10 10 00 98 FF 00 00 00 00 00 00 00 00 00 00 00 00 A7 03 -``` - -Blastware sends SUB 0x98 twice per comms-check cycle. - -### SUB 0x01 — Device Info Block ❓ - -Observed in Blastware comms-check init sequence (before 0x0E channel reads). Standard two-step read with data length 0x98 (152 bytes). - -**Response SUB = 0xFE** (= 0xFF − 0x01 = 0xFE). - -⚠️ **Naming collision:** The existing SUB 0xFE (Full Config Read, RSP 0x01) and this SUB 0x01 (RSP 0xFE) are inverse commands. They are NOT the same command. SUB 0xFE is a full 166-byte config block used for firmware version, calibration date, etc. SUB 0x01 returns 152 bytes and appears to contain a subset of device identification data. - -Observed payload (data[11:], first ~40 bytes of 161 total): -``` -00 00 00 00 00 42 45 31 31 35 32 39 00 ... "BE11529\0" -``` -Contains serial number, firmware bytes, and floating-point calibration fields. Full field map NOT YET done. - ---- - -## 7.11 Erase-All Protocol (SUBs 0xA3 / 0xA2 / 0x06) ✅ 2026-04-11 - -> ✅ **Confirmed 2026-04-11** from MITM capture of a live Blastware ACH session -> (`bridges/captures/mitm/ach_mitm_20260411_001912/`). - -Blastware uses a 4-step sequence to erase all stored events from device memory. -All frames use standard `build_bw_frame` format (NOT write-format). - -### 7.11.1 Wire Sequence - -``` -BW → device: SUB 0xA3 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 -device → BW: SUB 0x5C (begin-erase ack) - -BW → device: SUB 0x1C offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) -device → BW: SUB 0xE3 (probe ack) -BW → device: SUB 0x1C offset=0x002C params=(same) (data) -device → BW: SUB 0xE3 (44-byte monitor status response) - -BW → device: SUB 0x06 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) -device → BW: SUB 0xF9 (probe ack) -BW → device: SUB 0x06 offset=0x0024 params=(same) (data) -device → BW: SUB 0xF9 (36-byte storage range response) - -BW → device: SUB 0xA2 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 -device → BW: SUB 0x5D (confirm-erase ack — device memory is now cleared) -``` - -All response SUBs follow the standard formula `0xFF − request_SUB`. No exceptions. -The `token=0xFE` at `params[7]` is required for 0xA3, 0x06, and 0xA2. - -### 7.11.2 SUB 0x06 Storage Range Response (36 bytes) - -The 36-byte response from the data step ends with two 4-byte event keys: - -| Offset (from response end) | Field | Notes | -|---|---|---| -| `[-8:-4]` | First stored event key | e.g. `0111ea60` before erase | -| `[-4:]` | Last stored event key | e.g. `0111eaa6` before erase | - -After a successful erase: -- Both keys read `01110000` (device-empty sentinel) -- The device's internal event counter has reset - -Example pre-erase: `... 0111ea60 0111eaa6` -Example post-erase: `... 01110000 01110000` - -### 7.11.3 Post-Erase Key Counter Reset - -After a successful erase the device resets its event counter. New events start -from key `0x01110000` — the same key as the very first event ever recorded on -the device. This means: - -- Any system using event keys for deduplication must clear its "seen keys" state - after an erase, or risk treating fresh events as already downloaded. -- Detection heuristic: if `max(device_keys) < historical_max_key`, the counter - was reset. All device keys should be treated as new regardless of prior state. - -The `ach_server.py` implementation stores `max_downloaded_key` in `ach_state.json` -and applies this heuristic on every call-home. - -### 7.11.4 Implementation Notes - -- `MiniMateClient.delete_all_events()` in `client.py` orchestrates the full sequence. -- `MiniMateProtocol` exposes `begin_erase_all()`, `confirm_erase_all()`, and - `read_event_storage_range()` as separate methods. -- The ACH server `--clear-after-download` flag calls `delete_all_events()` after a - successful event download and resets `ach_state.json` state for the unit. - ---- - -### 7.12 Auto Call Home Config (SUB 0x2C / 0x7E / 0x7F) — ✅ CONFIRMED 2026-04-20 - -> Confirmed from `bridges/captures/4-20-26/call home settings/` — 10 BW TX write frames -> diffed against the S3 read payload. Accessible in Blastware via Remote Access → Setup Unit. - -#### 7.12.1 Read Protocol — SUB 0x2C → Response 0xD3 - -Standard two-step read: - -| Step | Offset | Purpose | -|---|---|---| -| Probe | `0x0000` | Get ack (no data returned) | -| Data | `0x007C` (124) | Receive 125-byte raw payload | - -`DATA_LENGTHS[SUB_CALL_HOME] = 0x7C` - -The raw payload is accessed as `data_rsp.data[11:]` — this is 125 bytes (not 124) because -the device returns logical value 0x03 (num_retries=3) as the two-byte wire sequence -`\x10\x03`. S3FrameParser is in `STATE_IN_FRAME` when it sees `0x10`, transitions to -`STATE_AFTER_DLE`, and then on `0x03` (ETX qualifier) it would normally end the frame — -but in the `_IN_FRAME_DLE` state it instead appends **both** the `0x10` and the `0x03` -literally to the payload. The result: `raw[117] = 0x10`, `raw[118] = 0x03`, and all -subsequent fields are shifted +1 from their logical positions. - -#### 7.12.2 Raw Payload Field Map (125 bytes, from `data_rsp.data[11:]`) - -> All offsets are into the 125-byte raw array. Offsets ≥ 119 are shifted +1 from logical -> due to the DLE-escaped 0x03 at raw[117:119]. - -| Raw Offset | Field | Type | Notes | -|---|---|---|---| -| `[5]` | `auto_call_home_enabled` | uint8 | `0x00` = disabled, `0x01` = enabled | -| `[6:46]` | `dial_string` | ASCII | 40-byte null-padded, e.g. `"12345"` or phone number | -| `[87]` | `after_event_recorded` | uint8 | `0x00` = off, `0x01` = on | -| `[91]` | `at_specified_times` | uint8 | `0x00` = off, `0x01` = on | -| `[93]` | `time1_enabled` | uint8 | `0x00` = off, `0x01` = on | -| `[101]` | `time1_hour` | uint8 | 0–23 | -| `[102]` | `time1_min` | uint8 | 0–59 | -| `[95]` | `time2_enabled` | uint8 | `0x00` = off, `0x01` = on | -| `[105]` | `time2_hour` | uint8 | 0–23 | -| `[106]` | `time2_min` | uint8 | 0–59 | -| `[117]` | DLE prefix `0x10` | — | Part of `\x10\x03` wire encoding for num_retries value 3 | -| `[118]` | `num_retries` (value = 3) | uint8 | Logical value 0x03; check `raw[117] == 0x10` to detect DLE prefix | -| `[120]` | `time_between_retries_sec` | uint8 | Shift +1 from logical 119 | -| `[122]` | `wait_for_connection_sec` | uint8 | Shift +1 from logical 121 | -| `[124]` | `warm_up_time_sec` | uint8 | Shift +1 from logical 123 | - -**Unconfirmed fields** (offsets not yet mapped from captures): -- Time slots 3 and 4 (if they exist — Blastware UI only shows 2 time slots in observed sessions) -- `modem_power_relay_enabled` (bool) -- `storage_mode` (call home trigger on all events vs. triggered only?) - -#### 7.12.3 DLE-Escaped 0x03 — Critical Detail - -The `\x10\x03` sequence at raw[117:119] is **not** a DLE stuffing artifact in the usual -sense. Standard DLE stuffing escapes `\x10` → `\x10\x10`. But here the device is encoding -the integer value `3` in a position where the byte `\x03` would be indistinguishable from -the frame ETX terminator. The device therefore sends `\x10\x03` (DLE + ETX = "inner-frame -terminator" in S3 inner-frame syntax). S3FrameParser correctly handles this: in -`STATE_AFTER_DLE`, seeing `\x03` (ETX) while **inside** an outer frame causes it to -append both `\x10` and `\x03` as literal bytes rather than ending the frame. The outer -frame only terminates on a **bare** `\x03` (without the DLE prefix). - -The write frame sends these bytes verbatim — the device accepts `\x10\x03` in the write -payload and interprets it as the value 3. No transformation is needed in -`_encode_call_home_config()`. - -**Limitation:** Any field that needs to encode the value `3` (0x03) requires this DLE -prefix. The current encoder raises `ValueError` if any hour or minute field equals 3, -since the encoder does not yet implement DLE-prefixed writes for arbitrary field positions. -In practice, 3:00 AM / 3 minutes past are unlikely scheduled call times. - -#### 7.12.4 Write Protocol — SUB 0x7E → 0x7F - -Write format (same as other write commands — only BW_CMD `0x10` doubled on wire; -all other bytes written raw; DLE-aware checksum): - -| Step | SUB | Payload | Offset | Response | -|---|---|---|---|---| -| Data write | `0x7E` | 127 bytes (125-byte read payload + `\x00\x00`) | `data[1]+2 = 0x7E` (126) | `0x81` | -| Confirm | `0x7F` | empty | `0x00` | `0x80` | - -**Write payload construction:** -```python -write_payload = bytearray(raw_125_bytes) -write_payload.append(0x00) -write_payload.append(0x00) -# patch fields in-place, then pass bytes(write_payload) to build_bw_write_frame -``` - -**Offset formula:** `write_payload[1] = 0x7C` (same as DATA_LENGTH). -`offset = write_payload[1] + 2 = 0x7C + 2 = 0x7E = 126`. -This follows the identical pattern as SUB 0x68 (event index write) and SUB 0x69 (waveform write). - -**No preceding 0x2C read required** — Blastware sends SUB 0x7E directly using cached -state. The `seismo-relay` implementation always reads first (`get_call_home_config()`) -before writing for safety. - -#### 7.12.5 Implementation Notes - -- `MiniMateProtocol.read_call_home_config()` — standard two-step read; returns `data_rsp.data[11:]` (125 bytes raw) -- `MiniMateProtocol.write_call_home_config(data)` — sends SUB 0x7E (127-byte payload) then SUB 0x7F confirm -- `MiniMateClient.get_call_home_config()` → `CallHomeConfig` dataclass -- `MiniMateClient.set_call_home_config(...)` — reads current config, patches via `_encode_call_home_config()`, writes back -- `_decode_call_home_config(raw)` — handles DLE prefix detection at raw[117] -- `_encode_call_home_config(raw, ...)` — patches in-place, appends 2 trailing zeros; raises `ValueError` if any hour/min == 3 -- REST API: `GET /device/call_home` and `POST /device/call_home` in `sfm/server.py` -- Web UI: "Call Home" tab in `sfm/sfm_webapp.html` - ---- - -## 8. Timestamp Format - -Two timestamp wire formats are used: - -### 8.1 6-byte format (event index / 1E header) -> 🔶 **Updated 2026-02-26** — Year field resolved. Confidence upgraded. - -Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent. - -**Observed example:** -``` -01 07 CB 00 06 1E -``` - -| Byte(s) | Value | Meaning | Certainty | -|---|---|---|---| -| `01` | 1 | Record validity / type flag | 🔶 INFERRED | -| `07 CB` | 1995 | Year — 16-bit big-endian integer | ✅ CONFIRMED — 2026-02-26 | -| `00` | 0 | Unknown separator | ❓ | -| `06` | 6 | Month (June) | ✅ CONFIRMED | -| `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED | - -> ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly. - -### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10) -> ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report -> for BE11529 thump event: "00:28:12 April 1, 2026". - -Full date + time, including a sub_code byte. Used for **single-shot waveform** -recordings (`sub_code = 0x10`). - -**Observed example (thump event, 2026-04-01):** -``` -01 10 04 07 ea 00 00 1c 0c -``` - -| Byte(s) | Value | Meaning | Certainty | -|---|---|---|---| -| `01` | 1 | Day | ✅ | -| `10` | 0x10 | Sub_code: `0x10` = Waveform single-shot | ✅ | -| `04` | 4 | Month (April) | ✅ | -| `07 ea` | 2026 | Year — 16-bit big-endian integer | ✅ | -| `00` | 0 | Unknown separator | ❓ | -| `00` | 0 | Hour | ✅ | -| `1c` | 28 | Minute | ✅ | -| `0c` | 12 | Second | ✅ | - -### 8.3 10-byte format (Full Waveform Record / SUB 0C, sub_code=0x03; monitor-log partial records) -> ✅ **CONFIRMED 2026-04-03** — Cross-referenced against Blastware event report -> for BE11529 (15:20:17 April 3, 2026). Same layout is used for partial-record -> (monitor log, record type `0x2C`) entries — see §7.10 / `_decode_0a_partial_header`. - -Used for **continuous waveform** recordings (`sub_code = 0x03`). One byte -wider than the 9-byte layout — a leading `0x10` marker shifts every subsequent -field by +1. - -**Observed example (continuous event, 2026-04-03 15:20:17):** -``` -10 03 10 04 07 ea 00 0f 14 11 -``` - -| Byte | Value | Meaning | -|---|---|---| -| `10` | 0x10 | Marker; how the decoder distinguishes 10-byte from 9-byte layout | -| `03` | 3 | Day | -| `10` | 0x10 | Marker (reflects wire-encoded sub_code=0x03) | -| `04` | 4 | Month | -| `07 ea` | 2026 | Year — uint16 BE | -| `00` | 0 | Unknown separator | -| `0f` | 15 | Hour | -| `14` | 20 | Minute | -| `11` | 17 | Second | - -**Auto-detection rule:** if `record[0] == 0x10`, use the 10-byte layout; -otherwise use the 9-byte layout. - -The `.MLG` file for a single-shot event stores the timestamp in a different -binary representation (little-endian year, no sub_code byte), confirming the -waveform record and the saved file use distinct serialisation formats. - ---- - -## 9. Out-of-Band / Non-Frame Messages - -| Message | Direction | Trigger | Certainty | -|---|---|---|---| -| `"Operating System"` | S3 → BW | Device boot / UART init / RTC reset | ✅ CONFIRMED | - -> The device prints this boot string directly to the UART **before** switching to DLE-framed binary protocol mode. Your implementation should discard any non-`0x41`/non-`0x10 0x02` bytes during the connection phase. Wait for the first valid framed poll response before proceeding. - ---- - -## 10. DLE Byte Stuffing -> ✅ **CONFIRMED — 2026-02-26** (previously ❓ SPECULATIVE) - -This protocol uses standard **DLE (Data Link Escape) byte stuffing**, a classical technique used in protocols like IBM BISYNC dating to the 1970s. - -### Parser State Machine - -``` -IDLE: - receive 0x41 → emit ACK event, stay IDLE - receive 0x10 → goto WAIT_STX - -WAIT_STX: - receive 0x02 → frame started, goto IN_FRAME - receive anything → error, goto IDLE - -IN_FRAME: - receive 0x10 → goto ESCAPE - receive any byte → append to buffer, stay IN_FRAME - -ESCAPE: - receive 0x03 → frame complete — validate checksum, process buffer, goto IDLE - receive 0x10 → append single 0x10 to buffer, goto IN_FRAME (stuffed literal) - receive 0x02 → error (nested STX), goto IDLE - receive anything → error, goto IDLE -``` - ---- - -## 11. Checksum Reference Implementation -> ⚠️ **Updated 2026-03-12** — BW→S3 large-frame checksum algorithm confirmed. Two distinct formulas apply depending on frame direction and size. - -### Checksum Overview - -| Direction | Frame type | Formula | Coverage | -|---|---|---|---| -| S3→BW | All frames | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | -| BW→S3 | Small frames (POLL, read cmds) | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | -| BW→S3 | Large write frames (SUB `68`, `69`, `71`, `82`, `7E`, `1A`+data) | DLE-aware large-frame: `(sum(payload[2:] where b != 0x10) + 0x10) & 0xFF` | De-stuffed payload bytes `[2:]`, skipping `0x10` bytes, plus constant | -| BW→S3 | SUB 5A bulk waveform | DLE-aware over the **stuffed** wire bytes | For each `10 XX` pair in the stuffed section, count `XX`; lone bytes count as-is. See `build_5a_frame` in `minimateplus/framing.py`. | - -### BW→S3 Large-Frame Checksum Formula - -```python -def calc_checksum_bw_large(payload: bytes) -> int: - """ - Checksum for large BW→S3 write frames (SUB 68, 69, 71, 82, 1A with data). - - Formula: sum all bytes in payload[2:-1], skipping 0x10 bytes, add 0x10, mod 256. - Confirmed across 20 frames from two independent captures (2026-03-12). - """ - return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF -``` - -**Why this formula:** The CMD byte at `payload[0]` is always `0x10` (DLE). The byte at `payload[1]` is always `0x00`. Starting from `payload[2]` skips both. All `0x10` bytes in the data section are excluded from the sum, then `0x10` is added back as a constant — effectively treating DLE as a transparent/invisible byte in the checksum. This is consistent with `0x10` being a framing/control character in the protocol. - -**Consistency check:** For small frames, `payload[0]` = `0x10` and there are no other `0x10` bytes in the payload. The large-frame formula applied to a small frame would give `(sum(payload[2:-1]) + 0x10) = sum(payload[0:-1])` — identical to the plain SUM8. The two formulas converge for frames without embedded `0x10` data bytes. - -```python -DLE = 0x10 -STX = 0x02 -ETX = 0x03 -ACK = 0x41 - - -def stuff(data: bytes) -> bytes: - """Escape all 0x10 bytes in payload as 0x10 0x10 for transmission.""" - out = [] - for b in data: - out.append(b) - if b == DLE: - out.append(DLE) # double it - return bytes(out) - - -def destuff(data: bytes) -> bytes: - """Remove DLE stuffing from received payload bytes.""" - out = [] - i = 0 - while i < len(data): - if data[i] == DLE and i + 1 < len(data) and data[i + 1] == DLE: - out.append(DLE) - i += 2 - else: - out.append(data[i]) - i += 1 - return bytes(out) - - -def calc_checksum_s3(payload: bytes) -> int: - """ - Standard SUM8: used for all S3→BW frames and small BW→S3 frames. - Sum of all payload bytes (excluding the checksum byte itself), mod 256. - """ - return sum(payload) & 0xFF - - -def calc_checksum_bw_large(payload: bytes) -> int: - """ - Large BW→S3 write frame checksum (SUB 68, 69, 71, 82, 1A with data). - Sum payload[2:-1] skipping 0x10 bytes, add 0x10, mod 256. - """ - return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF - - -# Backwards-compatible alias -def calc_checksum(payload: bytes) -> int: - return calc_checksum_s3(payload) - - -def build_frame(payload: bytes) -> bytes: - """ - Build a complete on-wire frame from a raw payload. - Output: ACK + DLE+STX + stuffed_payload + checksum + DLE+ETX - """ - chk = calc_checksum(payload) - stuffed = stuff(payload) - return bytes([ACK, DLE, STX]) + stuffed + bytes([chk, DLE, ETX]) - - -def parse_frame(raw: bytes) -> bytes | None: - """ - Parse and validate a raw on-wire frame. - Accepts input starting with ACK (0x41) or DLE+STX (0x10 0x02). - Returns de-stuffed payload bytes on success, None on any error. - """ - # Strip optional leading ACK - if raw and raw[0] == ACK: - raw = raw[1:] - - # Validate frame delimiters - if len(raw) < 5: - return None - if raw[0] != DLE or raw[1] != STX: - return None - if raw[-2] != DLE or raw[-1] != ETX: - return None - - # Extract: everything between DLE+STX and DLE+ETX - inner = raw[2:-2] - chk_received = inner[-1] - stuffed_payload = inner[:-1] - - # De-stuff and validate checksum - payload = destuff(stuffed_payload) - if calc_checksum(payload) != chk_received: - return None - - return payload - - -# ── Example: build a POLL probe request (SUB 5B) ───────────────────────────── -# Layout per §3: BW_CMD=0x10, flags=0x00, SUB=0x5B, [0x00, 0x00], OFFSET=0x00, -# then 10 bytes of params — 16 bytes total payload. -poll_payload = bytes([ - 0x10, # [0] BW_CMD - 0x00, # [1] flags - 0x5B, # [2] SUB: POLL - 0x00, 0x00, # [3:5] always zero - 0x00, # [5] OFFSET (probe step) - 0x00, 0x00, 0x00, 0x00, 0x00, # [6:11] params - 0x00, 0x00, 0x00, 0x00, 0x00, # [11:16] params -]) -# checksum = SUM8 over payload[0:-1] for small read frames; here = (0x10 + 0x5B) & 0xFF = 0x6B -# Wire output (BW→S3): the leading 0x10 is DLE-stuffed to 0x10 0x10: -# 41 02 10 10 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 6B 03 -# ^ ^ ^^^^^ ^ ^ -# ACK STX (bare 0x02) chk bare ETX -# See `build_bw_frame()` in `minimateplus/framing.py` for the canonical builder. -``` - ---- - -## 12. Recommended Implementation Sequence - -Build in this order — each step is independently testable. **Don't try to -implement event download (step 8 onward) without reading §6.1 first** — the -1E-arm / POLL×3 / 5A walk has multiple device-side state-machine prerequisites -that are easy to miss. - -1. **DLE frame parser** — stateful byte-by-byte reader implementing the §10 state machine. Handles ACK, stuffing, de-stuffing, bare-ETX termination, checksum validation. -2. **`connect(port, baud=38400)`** — open port, flush buffer, discard ASCII boot strings (§9), send first POLL frame. -3. **`identify()`** — SUB `5B` two-step read → returns `{"manufacturer": "Instantel", "model": "MiniMate Plus"}`. -4. **`get_serial()`** — SUB `15` two-step read → returns serial number string. -5. **`get_config()`** — SUB `01` / SUB `FE` two-step read → returns full config dict (firmware, calibration date, aux trigger). -6. **`get_event_count()`** — SUB `08` event index read. -7. **`get_event_header(key)`** — SUB `1E` (browse mode, token=`0x00` at params[7]) → first event key; iterate with SUB `1F`. -8. **`get_event_record(key)`** — SUB `0C` paginated read → 210-byte waveform record (peaks, timestamp, project). Use the 9-byte / 10-byte timestamp auto-detect from §7.5b / §8. -9. **`download_waveform(key)`** — SUB `5A` bulk stream. **Requires the full arm sequence from §6.1:** 0A → 1E(arm) → 0C → 1F(arm) → POLL × 3 → 5A. Use the STRT-bounded chunk walk from §7.8.5, the TERM frame from §7.8.6, and the metadata pages from §7.8.7. -10. **Write commands** — see §5.3 for the frame format and SUB pairings. Compliance push, call-home setup, and erase-all are all confirmed (§7.11, §7.12). - ---- - -## 13. Devices Under Test - -Multiple units have contributed captures to this reference. Primary development -target is **BE11529** (firmware S338.17); earlier sessions used BE18189. - -| Field | Primary unit | Secondary unit(s) | -|---|---|---| -| Manufacturer | Instantel | — | -| Model | MiniMate Plus | — | -| Serial Number | **BE11529** | BE18189, BE6907, BE14036, BE17353, BE18003, BE18191, BE18676 (archive only) | -| Firmware | **S338.17** | S337.17 (BE18189); various S338.x for other units | -| DSP / Secondary FW | 10.72 | 10.72 | -| Channels | Tran, Vert, Long, MicL (4 channels) | — | -| Sample Rate | 1024 / 2048 / 4096 sps (selectable) | — | -| Bridge Config (RS-232) | direct or via Sierra Wireless RV50/RV55 modem, 38400,8N1 | — | -| Bridge Config (TCP) | port 12345 (configurable) | — | -| Capture Tool | s3_bridge v0.5.0+ | v0.4.0 used for 1-2-26 / 3-11-26 captures | - ---- - -## 14. TCP / Modem Transport -> ✅ **CONFIRMED — 2026-03-31** from Blastware Operator Manual 714U0301 Rev 22 §4.4 and ACEmanager Raven modem configuration screenshots. - -The MiniMate Plus protocol is **fully transport-agnostic at the byte level**. The same DLE-framed S3/BW frame stream that flows over RS-232 is transmitted unmodified over a TCP socket. No additional framing, handshake bytes, or session tokens are added at the application layer. - ---- - -### 14.1 Two Usage Modes - -**"Call Up" (Outbound TCP — SFM connects to modem)** - -Blastware or SFM opens a TCP connection to the modem's static IP address on its device port. The modem bridges the TCP socket to its RS-232 serial port, which is wired directly to the MiniMate Plus. From the protocol perspective this is identical to a direct serial connection. - -``` -SFM ──TCP──► Raven modem ──RS-232──► MiniMate Plus - (static IP, port N) (38400,8N1) -``` - -This is the mode implemented by `TcpTransport(host, port)`. Typical call: - -``` -GET /device/info?host=203.0.113.5&tcp_port=12345 -``` - -**"Call Home" / ACH (Inbound TCP — unit calls the server)** - -The MiniMate Plus is configured with an IP address and port. On an event trigger or scheduled time it powers up its modem, which establishes a TCP connection outbound to the server. Blastware (or a future SFM ACH listener) accepts the incoming connection. After the unit connects, the PC has a configurable "Wait for Connection" window to send the first command before the unit times out and hangs up. - -``` -MiniMate Plus ──RS-232──► Raven modem ──TCP──► ACH server (listening) - (static office IP, port N) -``` - -`TcpTransport` is a **client** (outbound connect only). A separate `AchServer` listener component is needed for this mode — not yet implemented. - ---- - -### 14.2 No Application-Layer Handshake on TCP Connect - -✅ **Confirmed from ACEmanager configuration screenshot:** - -``` -Enable ENQ on TCP Connect: 0-Disable -``` - -When a TCP connection is established (in either direction), **no ENQ byte or other handshake marker is sent** by the modem before the protocol stream starts. The first byte from either side is a raw protocol byte — for SFM-initiated call-up, SFM sends POLL_PROBE immediately after `connect()`. - -**Sierra Wireless RV50/RV55 note:** Even with Quiet Mode enabled, these modems send `\r\nRING\r\n\r\nCONNECT\r\n` over the TCP connection to the calling client at connect time. Quiet Mode only suppresses these strings on the *serial* port (protecting the MiniMate Plus). The TCP client must tolerate these prefix bytes — scan for DLE+STX (`0x10 0x02`) and discard everything before it. This is the same approach used for the `"Operating System"` boot string (§9). - -The Raven X (deprecated) did not exhibit this behaviour. The note below about "no CONNECT string" describes Raven X with ENQ-disable; it does **not** apply to RV50/RV55. - -No ENQ byte or other application-layer handshake is added. The Raven modem's TCP dialog is configured with: - -| ACEmanager Setting | Value | Meaning | -|---|---|---| -| TCP Auto Answer | 2 — Telnet Server | TCP mode (transparent pass-through, not actually Telnet) | -| Telnet Echo Mode | 0 — No Echo | No echo of received bytes | -| Enable ENQ on TCP Connect | 0 — Disable | No ENQ byte on connect | -| TCP Connect Response Delay | 0 | No delay before first byte | -| TCP Idle Timeout | **2** (minutes) | Prevents premature disconnect; must match §14.3 | - ---- - -### 14.3 Modem Serial Port Configuration - -> **Hardware note:** The Raven X modem shown in the Blastware manual is 3G-only and no longer operational (3G network shutdown). The current field hardware is the **Sierra Wireless RV55** (and newer RX55). Both run ALEOS firmware and have an identical ACEmanager web UI — the settings below apply to all three generations. - -The modem's RS-232 port (wired to the MiniMate Plus) must be configured as: - -| ACEmanager Setting | Value | -|---|---| -| Configure Serial Port | **38400,8N1** | -| Flow Control | None | -| DB9 Serial Echo | OFF | -| Data Forwarding Timeout | **`1` (= 0.1 s)** in ACEmanager units (1 tick = 0.1 s; see §14.3 RV50/RV55 table) | -| Data Forwarding Character | 0 (disabled) | - -The **Data Forwarding Timeout** is the most protocol-critical setting. The modem -accumulates bytes from the RS-232 port for up to the configured interval before -forwarding them as a TCP segment. This means: - -- A large S3 response frame may arrive as multiple TCP segments with up to 1-second gaps between them. -- A `read_until_idle` implementation with `idle_gap < 1.0 s` will **incorrectly declare the frame complete mid-stream**. -- `TcpTransport.read_until_idle` overrides the default `idle_gap=0.05 s` to `idle_gap=1.5 s` to compensate. - -If connecting to a unit via a direct Ethernet connection (no serial modem in the path), the 1.5 s idle gap will still work but will feel slower. In that case you can pass `idle_gap=0.1` explicitly. - -#### Sierra Wireless RV50 / RV55 Required Settings -> ✅ **CONFIRMED — 2026-03-31** from working RV50 field config vs misconfigured RV55. - -The following ACEmanager Serial settings are required for correct transparent operation. A single wrong setting is enough to break the protocol exchange (unit beeps on connect but never returns an S3 frame): - -| ACEmanager Setting | Required Value | Why | -|---|---|---| -| **Quiet Mode** | **Enable** | Disabling it causes the modem to inject `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time, corrupting the S3 handshake. | -| **Configure Serial Port** | `38400,8N1` | Must match MiniMate baud rate. | -| **Flow Control** | `None` | Hardware flow control (CTS/RTS) will block unit's serial TX if pins are not wired. | -| **Data Forwarding Timeout** | `1` (= 0.1 s) | Controls RS-232→TCP forwarding latency. `5` (0.5 s) works but is sluggish; `1` matches working field units. | -| **TCP Connect Response Delay** | `0` | Any non-zero value causes the modem to silently discard our POLL frame during the delay window. | -| **TCP Idle Timeout** | `2` (minutes) | Prevents premature disconnect. Too low and the modem drops the session before the unit responds. | -| **DB9 Serial Echo** | `Disable` | Echo would corrupt the S3 stream. | - ---- - -### 14.4 Connection Timeouts on the Unit Side - -The MiniMate Plus firmware has two relevant timeouts configurable via Blastware's Call Home Setup dialog: - -| Timeout | Description | Impact | -|---|---|---| -| **Wait for Connection** | Seconds after TCP connect during which the unit waits for the first BW frame. If nothing arrives, unit terminates the session. | SFM must send POLL_PROBE within this window after `connect()`. Default appears short (≈15–30 s). | -| **Serial Idle Time** | Seconds of inactivity after which the unit terminates the connection. | SFM must complete its work and disconnect cleanly — or send periodic keep-alive frames — within this window. | - -For our `TcpTransport` + `MiniMateProtocol` stack, both timeouts are satisfied automatically because `connect()` is immediately followed by `protocol.poll()` which sends POLL_PROBE, and the full session (POLL + read + disconnect) typically completes in < 30 seconds. - ---- - -### 14.5 Port Numbers - -The TCP port is **user-configurable** in both Blastware and the modem. There is no universally fixed port. - -| Setting location | Value in manual example | Value in user's install | -|---|---|---| -| Blastware TCP Communication dialog | 12335 | 12345 | -| Raven ACEmanager Destination Port | 12349 (UDP example) | varies | - -`TcpTransport` defaults to `DEFAULT_TCP_PORT = 12345` which matches the user's install. This can be overridden by the `port` argument or the `tcp_port` query parameter in the SFM server. - ---- - -### 14.6 ACH Session Lifecycle (Call Home Mode) ✅ IMPLEMENTED 2026-04-11 - -When the unit calls home under ACH, the session lifecycle from the unit's perspective is: - -1. Unit triggers (event or scheduled time) -2. Unit powers up modem, dials / connects TCP to server IP:port -3. Unit waits for "Wait for Connection" window for first BW frame from server -4. Server sends POLL_PROBE → unit responds with POLL_RESPONSE (same as serial) -5. Server reads serial number, full config, events as needed -6. (Optional) Server erases device memory: SUB 0xA3 → 0x1C → 0x06 → 0xA2 -7. Server disconnects (or unit disconnects on Serial Idle Time expiry) -8. Unit detects DCD/DTR going low (modem signals line drop), returns to monitor mode automatically - -Step 4 onward is **identical to the serial/call-up protocol**. The only difference -from our perspective is that we are the **listener** rather than the **connector**. - -**Implementation: `bridges/ach_server.py`** — run with `python bridges/ach_server.py`. -Key flags: -- `--clear-after-download` — erase device memory after a successful event download -- `--allow-ip IP` — restrict to specific unit IPs -- `--max-events N` — cap events per session for safety - -**State persistence: `ach_state.json`** — tracks `downloaded_keys` (set of event key -hex strings) and `max_downloaded_key` (high-water mark) per unit serial number. -Post-erase key reuse (`0x01110000` recycled) is detected via the high-water mark. - -**Note on DCD/DTR:** The MiniMate Plus monitors the RS-232 DCD line. When the TCP -connection closes, the Sierra Wireless modem drops DCD, which the unit interprets as -"serial connection ended" and automatically resumes monitoring. No `start_monitoring()` -(SUB 0x96) command is needed from the server. ⚠️ Newer RV55 firmware may not assert DCD -by default — known issue, not yet resolved. - ---- - -## Appendix A — s3_bridge Capture Format -> ✅ **CONFIRMED — 2026-02-26** - -> ⚠️ **This behavior is not part of the Instantel protocol. It is an artifact of the bridge logger implementation.** - -The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger makes one modification: - -| Wire sequence | In .bin file | Notes | -|---|---|---| -| `0x10 0x03` (DLE+ETX) | `0x03` | DLE stripped from end-of-frame marker | -| All other bytes | Unchanged | ACK, DLE+STX, stuffed payload, checksum all preserved verbatim | - -**Practical impact for parsing `.bin` files:** -- Frame end: scan for bare `0x03` (not `0x10 0x03`) -- Checksum: the byte immediately before the bare `0x03` is the checksum -- Everything else (ACK detection, DLE+STX, payload de-stuffing) works as documented in §10 - -> ⚠️ This means checksums cannot be verified on frames where the stuffed payload ends in `0x10` — that trailing `0x10` would normally be the DLE prefix of ETX, but the logger strips it, making the frame boundary ambiguous in that edge case. In practice this has not been observed in captured data. - ---- - -## 15. Open Questions / Still Needs Cracking - -| Question | Priority | Added | Notes | -|---|---|---|---| -| Timestamp 6-byte format byte[3] — purpose of the separator `0x00` byte | LOW | 2026-02-26 | Not blocking; 9-byte waveform record format (§8.2) fully confirmed without this byte. | -| `trail[0]` in serial number response — unit-specific byte, derivation unknown. `trail[1]` resolved as firmware minor version. | MEDIUM | 2026-02-26 | | -| ~~Full channel ID mapping in SUB `5A` stream~~ — **RESOLVED 2026-08-25 for the waveform body:** every `40 NN` segment header carries `[channel_id][00][00][segment_index]` at `data[2*NN+4]`, with `0x46`=Tran `0x47`=Vert `0x48`=Long `0x49`=MicL. Verified on 1697/1697 segment headers with zero disagreements against the decoded channel rotation. See §7.6.1. | RESOLVED | 2026-02-26 | Resolved 2026-08-25 | -| ~~Exact byte boundaries of project string fields in SUB `71` write frame~~ — **RESOLVED 2026-05-05:** project/client/operator/seis-loc/extended-notes come from SUB 5A metadata pages at counter `0x1002` / `0x1004` (§7.8.7), NOT from the SUB 71 write payload. `_decode_a5_metadata_into` locates them via ASCII label scans. | RESOLVED | 2026-02-26 | Resolved 2026-05-05 | -| Purpose of SUB `09` / response `F6` — 202-byte read block | MEDIUM | 2026-02-26 | | -| Purpose of SUB `2E` / response `D1` — 26-byte read block | MEDIUM | 2026-02-26 | | -| Full field mapping of SUB `1A` / response `E5` — channel scaling / compliance config block. **RESOLVED 2026-04-21:** Multi-frame sequence (§7.6.2), page_key chunking, duplicate-page detection, record_time at anchor+6 (§7.6.1), sample_rate at anchor−6 (§7.6.3), recording_mode at anchor−8 (§7.6.4), histogram_interval at anchor−4, trigger_level_geo and alarm_level_geo in channel block (§7.6), geo_range at channel_label+33 (§7.6), adc_scale_factor at channel_label+28, and project strings (via 5A metadata pages, §7.8.7) all confirmed. | RESOLVED | 2026-02-26 | Resolved 2026-04-21 | -| `0x082A` in channel config block — not trigger, alarm, or record time directly. **RESOLVED: fixed E5 payload length (2090 bytes).** Constant regardless of all settings. | RESOLVED | 2026-03-01 | Resolved 2026-03-09 | -| **Record time in wire protocol** — float32 BE, anchor-relative in cfg (see §7.6.1/§7.6.3). **RESOLVED.** Previous `+0x28` offset was unreliable due to DLE jitter — superseded by anchor search. Confirmed at 3, 5, 7, 8, 10, 13 seconds. | RESOLVED | 2026-03-09 | Confirmed 2026-03-09; anchor method confirmed 2026-04-01 | -| **Sample rate** — uint16 BE at anchor−2 in cfg. **RESOLVED.** Normal=1024, Fast=2048, Faster=4096. Anchor required to handle DLE jitter. See §7.6.3. | RESOLVED | 2026-04-01 | Confirmed 2026-04-01 | -| Unknown uint16 fields at channel block +0A (=80), +0C (=15), +0E (=40), +10 (=21) — manual describes "Sensitive (Gain=8) / Normal (Gain=1)" per-channel range; 80/15/40/21 might encode gain, sensitivity, or ADC config. | LOW | 2026-03-01 | | -| ~~Full trigger configuration field mapping (SUB `1C` / write `82`)~~ — **PARTIALLY RESOLVED:** SUB `1C` now confirmed as MONITOR STATUS READ (§5.1, §7.10) — not trigger config; the old "0x6E response" was misidentification. SUB `82` (trigger config write) layout partially mapped — Trigger Sample Width at `[22]`. Remaining unknowns: full per-channel structure of the 0x82 payload. | LOW | 2026-02-26 | Updated 2026-05-20 | -| Whether SUB `24`/`25` are distinct from SUB `5A` or redundant | LOW | 2026-02-26 | | -| **Meaning of `0x07 E7` field in config block — RESOLVED:** Calibration year. uint16 BE at destuffed payload offset 0x56–0x57. Confirmed via two-unit comparison: BE18189 (calibrated 2023) = `07 E7`; BE11529 (calibrated 2025) = `07 E9`. Adjacent bytes at 0x53–0x55 encode remaining calibration date (month confirmed as BCD October for both units; full layout 🔶 INFERRED). | RESOLVED | 2026-02-26 | Resolved 2026-03-31 | -| **Trigger Sample Width** — **RESOLVED:** BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Width=4 → `0x04`, Width=3 → `0x03`. Confirmed via BW-side capture diff. Only visible in `raw_bw.bin` write traffic, not in S3-side compliance reads. | RESOLVED | 2026-03-02 | Confirmed 2026-03-09 | -| **Auto Window** — "1 to 9 seconds" per manual (§3.13.1b). **Mode-gated:** only transmitted/active when Record Stop Mode = Auto. Capture attempted in Fixed mode (3→9 change) — no wire change observed in any frame. Deferred pending mode switch. | LOW | 2026-03-02 | Updated 2026-03-09 | -| **Auxiliary Trigger read location** — **RESOLVED:** SUB `FE` offset `0x0109`, uint8, `0x00`=disabled, `0x01`=enabled. Confirmed 2026-03-11 via controlled toggle capture. | RESOLVED | 2026-03-02 | Resolved 2026-03-11 | -| **Auxiliary Trigger write path** — Write command not yet captured in a clean session. Inner frame handshake visible in A4 (multiple WRITE_CONFIRM_RESPONSE SUBs appear, TRIGGER_CONFIG_RESPONSE removed), but the BW→S3 write command itself was in a partial session. Likely SUB `15` or similar. Deferred for clean capture. | LOW | 2026-03-11 | NEW | -| ~~**SUB `6E` response to SUB `1C`**~~ — ~~RESOLVED 2026-04-08: This was a misidentification.~~ The `1C → 6E` "exception" was misread — likely an inner A4 sub-frame. Confirmed from 4-8-26 capture (338 frames): SUB 0x1C always → 0xE3. No exceptions to the `0xFF − SUB` rule are known. | RESOLVED | 2026-04-08 | CLOSED | -| ~~**Max Geo Range float 6.2061**~~ — **RESOLVED 2026-04-17.** Confirmed as the **ADC-to-velocity scale factor** = inverse sensitivity = 1/0.161133 = **6.206053 (in/s)/V**. Source: Interface Handbook §4.5 formula `Range = 1.61133 V / Sensitivity`. For standard Instantel geo at Normal (Gain=1) range: Sensitivity = 1.61133/10 = 0.161133 V/(in/s), scale = 6.206053. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. The earlier ~9× overread was from using 6.206053 directly as range instead of as scale factor (range = 1.61133 V × 6.206053 = 10.000 in/s). Hardware constant — do NOT write. | RESOLVED | 2026-02-26 | Resolved 2026-04-17 | -| MicL channel units — **RESOLVED: psi**, confirmed from `.set` file unit string `"psi\0"` | RESOLVED | 2026-03-01 | | -| Backlight offset — **RESOLVED: +4B in event index data**, uint8, seconds | RESOLVED | 2026-03-02 | | -| Power save offset — **RESOLVED: +53 in event index data**, uint8, minutes | RESOLVED | 2026-03-02 | | -| Monitoring LCD Cycle — **RESOLVED: +54/+55 in event index data**, uint16 BE, seconds (65500 = disabled) | RESOLVED | 2026-03-02 | | -| **SUB 0x06 purpose — RESOLVED: event storage range.** Previously labeled "CHANNEL CONFIG READ". 4-11-26 MITM capture confirms it returns first/last stored event keys in the final 8 bytes of the 36-byte response. Used by Blastware as part of the erase-all verification step. | RESOLVED | 2026-04-11 | | -| **Erase-all command sequence — RESOLVED.** SUB 0xA3 (begin) + 0x1C (monitor status) + 0x06 (storage range) + 0xA2 (confirm). Confirmed from 4-11-26 MITM capture. All frames standard `build_bw_frame`, token=0xFE. | RESOLVED | 2026-04-11 | | -| **ACH inbound server — RESOLVED.** `bridges/ach_server.py` implements full inbound ACH pipeline. `--clear-after-download` flag for delete-after-upload workflow. Post-erase key-reuse detection via `max_downloaded_key` high-water mark. | RESOLVED | 2026-04-11 | | -| **Sensor Check dropdown byte location** — byte offset in 1A compliance config payload for the "Sensor Check: Before monitoring / After each event / Disabled" setting is NOT YET LOCATED. Confirmed: unit always runs with "Before monitoring" set. Need a capture with "Disabled" to diff. | MEDIUM | 2026-04-08 | Still open | -| **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open | -| ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | -| ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | -| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | -| **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open | -| **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open | - ---- - ---- - -## Appendix B — Operator Manual Cross-Reference (716U0101 Rev 15) - -> Added 2026-03-02. Cross-referencing confirms setting names, ranges, units, and behavior for fields found in protocol captures. The manual does NOT describe the wire protocol — it describes the user-facing device interface. Use to infer data types, ranges, and semantics of protocol fields. - -| Setting Name (Manual) | Manual Location | Protocol Location | Type | Range / Notes | -|---|---|---|---|---| -| Backlight On Time | §3.13.1e | Event Index +4B | uint8 | 0–255 seconds | -| Power Saving Timeout | §3.13.1f | Event Index +53 | uint8 | minutes (user sets 1–60+) | -| Monitoring LCD Cycle | §3.13.1g | Event Index +54/55 | uint16 BE | seconds; 0=off; 65500≈disabled | -| Trigger Level (Geo) | §3.8.6 | Channel block, float | float32 BE | 0.005–10.000 in/s | -| Alarm Level (Geo) | §3.9.9 | Channel block, float | float32 BE | higher than trigger level | -| Trigger Level (Mic) | §3.8.6 | Channel block, float | float32 BE | 100–148 dB in 1 dB steps | -| Alarm Level (Mic) | §3.9.10 | Channel block, float | float32 BE | higher than mic trigger | -| Record Time | §3.8.9 | cfg anchor+10, float32 BE (wire); `.set` +16, uint32 LE (file) | float32 BE (wire) | 1–105 s; confirmed 3→`40400000`, 5→`40A00000`, 8→`41000000`, 13→`41500000`. Use anchor §7.6.1/§7.6.3 — NOT fixed offset. | -| ADC Scale Factor (geo_adc_scale) | §3.8.4 / Interface Handbook §4.5 | Channel block, Tran+28 (same in E5 read and SUB 71 write), float32 BE | float32 BE = 6.206053 | ✅ CONFIRMED 2026-04-17 — inverse sensitivity (in/s)/V. `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant, identical on all units. Do NOT write. | -| Max Geo Range (geo_range) | §3.8.4 | Channel block, Tran+33 (same in E5 read and SUB 71 write), uint8; applied to Tran/Vert/Long | uint8 | ✅ CONFIRMED 2026-04-20 — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. **NOTE: `Tran+20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | -| Microphone Units | §3.9.7 | Inline unit string | char[4] | `"psi\0"`, `"pa.\0"`, `"dB\0\0"` | -| Sample Rate | §3.8.2 | cfg anchor−2, uint16 BE — anchor=`\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100] | uint16 BE | Normal=1024, Fast=2048, Faster=4096 ✅ CONFIRMED 2026-04-01 (BE11529 S338.17). Anchor required — see §7.6.3 DLE jitter. | -| Record Mode | §3.8.1 | Write: `cfg[anchor−3]`, uint8. Read (E5 sf1): `data[anchor−4]`, uint8. Note: extra `0x10` byte at read `data[anchor−3]` shifts offset by 1 vs write. | uint8 | `0x00`=Single Shot, `0x01`=Continuous, `0x02`=unknown, `0x03`=Histogram, `0x04`=Histogram+Continuous. ✅ CONFIRMED 2026-04-20 | -| Trigger Sample Width | §3.13.1h | BW→S3 SUB `0x82` write frame, destuffed `[22]`, uint8 | uint8 | Default=2; confirmed 4=`0x04`, 3=`0x03`. **BW-side write only** — not visible in S3 compliance reads. Mode-gated: only sent in Compliance/Single-Shot/Fixed mode. | -| Auto Window | §3.13.1b | **Mode-gated — NOT YET MAPPED** | uint8? | 1–9 seconds; only active when Record Stop Mode = Auto. Capture in Fixed mode produced no wire change. | -| Auxiliary Trigger | §3.13.1d | SUB `FE` (FULL_CONFIG_RESPONSE) offset `0x0109` (read); write path not yet isolated | uint8 (bool) | `0x00`=disabled, `0x01`=enabled; confirmed 2026-03-11 | -| Password | §3.13.1c | Unknown | — | 4-key sequence | -| Serial Connection | §3.9.11 | Unknown | — | Direct / Via Modem | -| Baud Rate | §3.9.12 | Unknown | — | 38400 for direct | - ---- - -## Appendix C — Logger & Parser Validation (2026-03-02) - -> Documents the logger integrity verification and parser refactor completed 2026-03-02. Tooling behavior only — not protocol semantics. - -### C.1 Logger Validation - -**Concern:** Earlier sessions noted that the `s3_bridge` logger may have been stripping `0x10` from `DLE ETX` sequences, producing bare `0x03` terminators in the capture file. - -**Resolution:** HxD inspection of a new capture produced by `s3_bridge v0.5.0` confirmed that `10 03` sequences are present intact inside S3→BW record payloads. The `forward_loop` function writes raw bytes to the `.bin` before any sniffer or framing logic runs — there is no ETX stripping in v0.5.0. - -The earlier stripping behavior applied to a previous logger version. v0.5.0 is confirmed lossless with respect to wire bytes. - -**Confirmed wire framing:** -- Frame start: `0x10 0x02` (DLE STX) ✅ -- Frame end: `0x10 0x03` (DLE ETX) ✅ -- DLE stuffing: `0x10 0x10` in payload = literal `0x10` ✅ - -### C.2 Capture Architecture (Current) - -As of 2026-03-02 the capture pipeline produces two flat raw wire dump files per session: - -| File | Contents | -|---|---| -| `raw_s3.bin` | All bytes transmitted by S3 (device → Blastware), in order | -| `raw_bw.bin` | All bytes transmitted by BW (Blastware → device), in order | - -No record headers, no timestamps, no framing logic applied by the dumper. Files are flat concatenations of `serial.read()` chunks. Frame boundaries must be recovered by the parser. - -### C.3 Parser Design — DLE State Machine - -A deterministic state machine replaces all prior heuristic scanning. - -**States:** - -``` -STATE_IDLE — scanning for frame start -STATE_IN_FRAME — consuming payload bytes -STATE_AFTER_DLE — last byte was 0x10, awaiting qualifier -``` - -**Transitions:** - -| Current State | Byte | Action | Next State | -|---|---|---|---| -| IDLE | `10 02` | Begin new frame | IN_FRAME | -| IDLE | any | Discard | IDLE | -| IN_FRAME | `!= 10` | Append to payload | IN_FRAME | -| IN_FRAME | `10` | — | AFTER_DLE | -| AFTER_DLE | `10` | Append literal `0x10` | IN_FRAME | -| AFTER_DLE | `03` | Frame complete, emit | IDLE | -| AFTER_DLE | other | Treat as payload (recovery) | IN_FRAME | - -**Properties:** -- Does not scan globally for `10 02` -- Only complete STX→ETX pairs are emitted as frames -- Incomplete trailing frames at EOF are discarded (expected at capture boundaries) -- DLE stuffing handled correctly - -### C.4 Observed Traffic (Validation Captures) - -**`raw_bw.bin`** (Blastware → S3): -- 7 complete frames via state machine -- Mostly small command/control frames, several zero-length payloads -- Bare `0x02` used as STX (asymmetric — BW does not use DLE STX) -- Contains project metadata strings: `"Standard Recording Setup.set"`, `"Claude test2"`, `"Location #1 - Brians House"` - -**`raw_s3.bin`** (S3 → Blastware): -- First frame payload ~3922 bytes (large structured response) -- Repeated `"Instantel"` / `"MiniMate Plus"` / `"BE18189"` strings throughout -- Multiple medium-length structured frames -- DLE+ETX confirmed intact - -### C.5 Key Lessons - -1. **Global byte counting ≠ frame counting.** `0x10 0x02` appears inside payloads. Only state machine transitions produce valid frame boundaries. -2. **STX count ≠ frame count.** Only STX→ETX pairs within proper state transitions count. -3. **EOF mid-frame is normal.** Capture termination during active traffic produces an incomplete trailing frame. Not an error. -4. **Layer separation.** The parser extracts frames only. Decoding block IDs, validating checksums, and interpreting semantics are responsibilities of a separate protocol decoder layer above it. - -### C.6 Parser Layer Architecture - -``` -raw_s3.bin / raw_bw.bin - ↓ -DLE Frame Parser (s3_parser.py) <- framing only - ↓ -Protocol Decoder (future) <- SUB IDs, block layout, checksums - ↓ -Semantic Interpretation <- settings, events, responses -``` - ---- - ---- - -## Appendix D — Blastware Binary File Formats (.N00 / .MLG / others) - -> ✅ CONFIRMED 2026-04-21 — all fields verified by binary diff of reconstructed vs reference -> files from the 4-3-26-multi_event capture (M529LIY6.N00, BE11529.MLG). -> -> ✅ **EXTENSION ENCODING FULLY DECODED 2026-04-22** — supersedes the earlier -> "extension encodes recording mode" hypothesis (which was wrong) AND the -> "extension encoding algorithm is unknown" note. Extensions encode a -> **timestamp** (seconds within a 21.6-minute window), NOT recording mode. -> See **D.5.2** for the full formula, confirmed against 3,248 files from a -> 10-year production archive. Cross-references throughout this appendix have -> been updated. - -### D.1 Common File Header (22 bytes) - -All Blastware files (regardless of type) share an 18-byte prefix followed by a 4-byte type tag. - -| Offset | Length | Value | Description | -|---|---|---|---| -| 0x00 | 6 | `10 00 01 80 00 00` | Fixed prefix | -| 0x06 | 10 | `Instantel\x00` | ASCII string | -| 0x10 | 2 | `07 2c` | Fixed suffix | -| 0x12 | 4 | varies | File type tag (see below) | - -**Total header: 22 bytes.** - -**Type tags:** - -| Extension | Type tag | Description | -|---|---|---| -| `AB0` / `AB0W` (Waveform) | `00 12 03 00` | Waveform event — extension encodes timestamp, see D.5.2/D.5.3 | -| `AB0H` (Histogram) | `00 12 03 00` | Histogram event — ACH only | -| `.N00` | `00 12 03 00` | Old-firmware placeholder (Waveform); `blastware_filename()` falls back to this for S338 firmware | -| `.MLG` | `22 01 0e a0` | Monitor log | - -**Extension encoding — new firmware (V10.72+) FULLY DECODED (confirmed 2026-04-22):** - -The extension differs depending on how the file was saved: - -| Download method | Extension format | Example | -|---|---|---| -| Manual / direct (Blastware connected to unit) | `AB0` (3 chars) | `.CE0` | -| Call-home / ACH | `AB0W` or `AB0H` (4 chars) | `.CE0H` | - -Where: -- `AB` = 2-char base-36 of `total_seconds % 1296`; `A = value // 36`, `B = value % 36` -- `total_seconds = (event_local_time − 1985-01-01T00:00:00_local)` in seconds -- `0` = always literal digit zero -- `W` = Full Waveform, `H` = Full Histogram (ACH only) - -Base-36 alphabet: `0–9` = 0–9, `A–Z` = 10–35. - -The 10-year production archive contains only ACH files (all end in W or H). Manual Blastware downloads produce the same `AB0` prefix but without the trailing type character. - -**3-day cycle property (confirmed 2026-04-22):** A unit recording at a fixed daily time cycles through exactly **3 different extensions** with a 3-day period. Each calendar day shifts `total_seconds % 1296` by 864 (since `86400 % 1296 = 864`). The cycle repeats every 3 days because `gcd(1296, 864) = 432`. Confirmed from archive: top 3 extensions `CE0H` (95), `0E0H` (93), `OE0H` (91) are the 3-day cycle of a 06:00:14 daily call-in (seconds-in-window = 446, 14, 878). - -**B character invariance:** `864 = 24 × 36`, so adding one day never changes `value % 36` — the second extension character is invariant for a fixed daily recording time. Only the first character cycles through 3 values. - -**Old firmware (S338):** 3-char extensions observed (`.N00`, `.EI0`, etc.) — may simply be manual downloads under the same AB0 scheme, or a different encoding. Not yet confirmed. - -**Micromate Series 4** uses a different extension format (observed: `IDFH`, `IDFW`). This formula does NOT apply to Micromate units. - -All waveform files share the same `00 12 03 00` type tag regardless of extension. Blastware identifies file type by extension, not by type tag alone. - -### D.2 Timestamp Encoding (Blastware files) - -All timestamps in N00 and MLG files use an **8-byte big-endian format**: - -| Byte | Field | -|---|---| -| 0 | day (uint8) | -| 1 | month (uint8) | -| 2–3 | year (uint16 BE) | -| 4 | `0x00` (reserved) | -| 5 | hour (uint8) | -| 6 | minute (uint8) | -| 7 | second (uint8) | - -Example: `01 04 07 ea 00 00 1c 08` → April 1, 2026, 00:28:08. - -Note: this differs from the 8-byte protocol timestamp (`[day][sub_code][month][year_HI][year_LO][0x00][hour][min][sec]` = 9 bytes) used in the device's on-wire 0C waveform records. The file format uses a compact 8-byte layout without the `sub_code` byte. - -### D.3 N00 File Format — Single-Shot Waveform Event - -**File layout:** `[22B header] [21B STRT record] [body bytes] [26B footer]` - -#### D.3.1 STRT Record (21 bytes) - -The STRT record immediately follows the 22-byte header. - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 4 | `STRT` | ASCII literal | -| 4 | 2 | `ff fe` | Fixed | -| 6 | 4 | event key (key4) | 4-byte waveform key | -| 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field | -| 14 | 6 | device-specific | NOT zero-padded — device-internal fields | -| 20 | 1 | rectime | uint8 seconds | - -**Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone. - -#### D.3.2 Body Bytes (variable) - -The body is reconstructed from the raw A5 bulk waveform stream frames by stripping DLE framing markers and taking the appropriate slice of each frame's data section. - -**Per-frame contribution (from `frame.data`):** - -| Frame | Skip amount | Notes | -|---|---|---| -| A5[0] (probe) | `7 + strt_pos_in_w0 + 21` | Skip frame.data prefix + STRT record | -| A5[1] | 13 | 7-byte prefix + 6-byte first-chunk header | -| A5[2..N] | 12 | 7-byte prefix + 5-byte chunk header | -| Terminator (page_key=0x0000) | 11 | 7-byte prefix + 4-byte terminator header | - -**DLE strip rule:** For each frame's contribution (`frame.data[skip:]`), strip any `0x10` byte immediately followed by `0x02`, `0x03`, or `0x04`. Only the `0x10` is stripped; the following byte is kept as payload. - -**Split-pair edge case:** When `frame.data[-1] == 0x10` AND `frame.chk_byte ∈ {0x02, 0x03, 0x04}`, the S3FrameParser split a DLE+XX pair at the payload/checksum boundary. Reunite the bytes before stripping (`relevant + bytes([chk_byte])`), then always remove the trailing chk_byte from the result (`stripped[:-1]`) — chk_byte is the wire checksum, never payload. - -**Body/footer split:** Accumulate all frame contributions (data frames + terminator) into `all_bytes`. Then: -- `body = all_bytes[:-26]` (variable length) -- `footer = all_bytes[-26:]` (always 26 bytes — extracted from terminator content) - -#### D.3.3 Footer (26 bytes) - -The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata. - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 2 | `0e 08` | Fixed marker | -| 2 | 8 | ts1 | Start timestamp (8B big-endian) | -| 10 | 8 | ts2 | Stop timestamp (8B big-endian) | -| 18 | 6 | `00 01 00 02 00 00` | Fixed | -| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed | - -**CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. - -### D.4 MLG File Format — Monitor Log - -**File layout:** `[308B header] [N × 292B records]` - -#### D.4.1 MLG Header (308 bytes) - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0x00 | 22 | common header | prefix + `22 01 0e a0` type tag | -| 0x16 | 16 | unknown | observed as zeros in BE11529.MLG | -| 0x2A | 8 | serial number | null-padded ASCII (e.g. `"BE11529"`) | -| 0x32 | remainder | zero pad | pads to 308 bytes total | - -#### D.4.2 MLG Record (292 bytes each) - -| Offset | Length | Field | Notes | -|---|---|---|---| -| 0 | 2 | CRC | 2-byte CRC — algorithm unconfirmed; write as `00 00` | -| 2 | 4 | `22 01 0e 80` | Record marker | -| 6 | 8 | ts1 | Start timestamp (8B big-endian) | -| 14 | 8 | ts2 | Stop timestamp (8B big-endian); zeros if no stop | -| 22 | 4 | flags | Record type flags (see below) | -| 26 | 10 | serial | Null-padded ASCII serial number | -| 36 | variable | text | Type-dependent content | -| — | remainder | zero pad | pads to 292 bytes total | - -**Record flags:** - -| Value | Meaning | -|---|---| -| `ff ff 00 00` | Monitoring start with no stop recorded | -| `01 00 02 00` | Triggered event (has ts1 + ts2) | -| `02 00 00 00` | Monitoring interval (has ts1 + ts2) | - -**Text content for triggered events (`flags = 01 00 02 00`):** - -| Byte | Field | -|---|---| -| 0 | `0x08` | -| 1–8 | ts1 copy (8B big-endian) | -| 9+ | `"Geo: X.XXX in/s\x00"` ASCII geo threshold | - -#### D.4.3 MLG CRC - -The 2-byte CRC at record[0:2] uses an unconfirmed algorithm. Tested against CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), word sums, XOR variants, and 40+ polynomial/init combinations — none matched. The writer emits `00 00`. Blastware may reject files with incorrect CRCs (impact on import unknown — TODO: test). - -### D.5 Filename Encoding ✅ PARTIALLY CONFIRMED 2026-04-22 - -Blastware assigns waveform filenames of the form ``, where: - -#### D.5.1 Serial Prefix ✅ CONFIRMED 2026-04-22 - -The first 4 characters of the filename encode the full device serial number: - -``` -prefix_letter = chr(ord('B') + floor(serial_numeric / 1000)) -serial3 = f"{serial_numeric % 1000:03d}" (last 3 digits, zero-padded) -``` - -Where `serial_numeric` is the integer after the "BE" device-type prefix. - -Examples (all confirmed from archive): - -| Serial | serial_numeric / 1000 | prefix_letter | serial3 | Filename prefix | -|--------|----------------------|---------------|---------|-----------------| -| BE6907 | 6 | H | 907 | H907 | -| BE7145 | 7 | I | 145 | I145 | -| BE11529 | 11 | M | 529 | M529 | -| BE14036 | 14 | P | 036 | P036 | -| BE17353 | 17 | S | 353 | S353 | -| BE18003 | 18 | T | 003 | T003 | -| BE18191 | 18 | T | 191 | T191 | -| BE18676 | 18 | T | 676 | T676 | - -**Interpretation:** The prefix letter encodes the production generation (batch of 1000 units). B=generation 0 (serials 0–999), C=generation 1 (1000–1999), etc. No units with prefix A have been observed — the earliest known units start around serial 2000+ (prefix D). - -**Note:** The "BE" device-type prefix is implicit. The filename only encodes the numeric part of the serial. Other Instantel device types (Micromate, Blastmate) may use a different scheme. - -#### D.5.2 Stem + Extension — full timestamp encoding ✅ FULLY CONFIRMED 2026-04-22 - -The stem (4 chars) and AB extension (2 chars) together form a 6-digit base-36 number encoding a complete second-resolution timestamp: - -```python -total_seconds = stem_int * 1296 + ab_int -event_local_time = datetime(1985, 1, 1) + timedelta(seconds=total_seconds) -``` - -- **Epoch:** `1985-01-01 00:00:00` **device local time** ✅ CONFIRMED — verified against 3,248 files from a 10-year production archive; zero errors (only 2 mismatches were Micromate `IDFH`/`IDFW` files which use a completely different naming scheme) -- **Unit:** 1296 seconds = 36² ≈ 21.6 minutes per stem increment -- **Alphabet:** `"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"` (digits then uppercase letters) -- **Collision:** Events within the same 21.6-minute window share a stem; extension distinguishes them - -**Decoding example — `P036L318.C80H` (BE14036, Full Histogram):** -``` -stem L318 = 21×36³ + 3×36² + 1×36 + 8 = 983,708 -AB C8 = 12×36 + 8 = 440 -total_sec = 983,708 × 1296 + 440 = 1,274,886,008 -event_time = 1985-01-01 + 1,274,886,008s = 2025-05-26 15:00:08 local -``` - -**Note on local time:** The device's onboard clock is set to the local timezone of the deployment site. The epoch and all timestamps are in that same local time — there is no UTC conversion. Files moved between timezones will decode to the original deployment timezone. - -#### D.5.3 Extension taxonomy — historical rewrite (FULLY DECODED 2026-04-22) - -The extension third character is always `'0'`. The full encoding scheme is now -mapped — see **D.5.2** for the canonical formula. The earlier "recording-mode" -taxonomy in this section was wrong and has been removed. - -**Summary (new firmware V10.72+ via ACH download):** - -``` -Extension = AB0T - -AB = base-36 of (total_seconds % 1296) — seconds within the 21.6-min window -0 = literal digit zero (invariant third character) -T = W (Waveform) | H (Histogram) — present only for ACH downloads -``` - -Direct/manual Blastware downloads produce `.AB0` (3 chars, no trailing type -character). `blastware_filename()` in `minimateplus/blastware_file.py` -implements the formula; it falls back to `.N00` as a placeholder for -old-firmware units (S338) where the extension encoding has not been confirmed. - -The previously listed extensions `.9T0` / `.490` / `.5K0` / `.980` / `.ML0` -were the **same continuous-mode unit recording at different times of day**. -Their bytes were byte-for-byte identical except for header fields that change -per event — exactly what D.5.2 predicts: same firmware, same recording mode, -different timestamp → different extensions. No correlation with recording mode. - -| Extension type char (4-char ACH) | Meaning | -|---|---| -| `W` | Full Waveform | -| `H` | Full Histogram | - -**Micromate Series 4** uses a different scheme entirely (`IDFH`, `IDFW` -observed) and does NOT follow the AB0T formula. - -**DLE-shift offset note for reading recording_mode from N00/9T0 body:** - -The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: - -| 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) | -|---|---| -| `file[anc−7]` = recording_mode | `file[anc−8]` = recording_mode | -| `file[anc−6:anc−4]` = sample_rate | `file[anc−6:anc−4]` = sample_rate | - -For 1024 sps files, the expected file bytes around the anchor are: -``` -file[anc−9]: mode_prefix (0x00 for Single Shot/Continuous; 0x10 for Histogram) -file[anc−8]: 0x00 (was recording_mode, but shifted away — now reads 0x00 for mode_prefix) -file[anc−7]: recording_mode (0x00=Single Shot, 0x01=Continuous, etc.) -file[anc−6]: 0x04 (sample_rate_HI for 1024 sps) -file[anc−5]: 0x00 (sample_rate_LO) -file[anc−4]: histogram_interval_HI -file[anc−3]: histogram_interval_LO -``` - ---- - -*All findings reverse-engineered from live RS-232 bridge captures.* -*Cross-referenced from 2026-03-02 with Instantel MiniMate Plus Operator Manual (716U0101 Rev 15).* -*This is a living document — append changelog entries and timestamps as new findings are confirmed or corrected.* - ---- - -## Appendix E — Known Device Faults (field-observed, 2026-08-25) - -This appendix records *device* behaviour, not protocol. It exists -because these signatures are easy to mistake for decoder bugs — and one -of them was, for a while. - -### E.1 The "offset" fault - -> **The full investigation now lives in `docs/offset_investigation.md`** -- -> base rate, detector definition, per-unit case files, ruled-out hypotheses, -> and Instantel's own autozero procedure with its 2027-2069 acceptance -> window. This appendix is kept as the protocol-side summary. - -**Symptom.** One geophone channel's baseline steps away from zero and -stays there. The trace still carries the real AC signal, but it rides -on a DC pedestal of a few tenths of an in/s. Operators call this an -"offset"; it is a known recurring hardware fault, historically resolved -by returning the unit to Instantel, shelving it until calibration, or a -per-channel re-zero in an advanced/professional Blastware build. - -**Why it floods the queue.** The pedestal exceeds the unit's own geo -trigger level, so the channel sits permanently above threshold and the -unit retriggers as fast as it can rearm — one event every 3–7 minutes -for as long as the fault persists. In the surveyed snapshot the worst -episode produced 193 events in 38 hours. - -| unit | window | events | channel | pedestal | that unit's trigger level | -|---|---|---|---|---|---| -| BE9558 | 2026-05-15 → 05-16 | 193 | Long | +0.335 | 0.200 | -| BE18438 | 2026-02-25 → 02-26 | 64 | Vert | +0.327 | 0.200 | -| BE18438 | 2025-11-15 | 12 | Vert | +0.312 | 0.200 | -| BE9558 | 2026-04-14 / 04-29 / 05-04 | 5 total | Tran | +0.29…+0.44 | 0.200 | - -**It is NOT a decode artifact.** These events reproduce *exactly* in -Blastware's own ASCII export — e.g. `BE12599/N599LQD7.8E0W` Tran reads -mean +0.345, min +0.335, max +0.355 in both our decode and BW's. Any -shape-based false-trigger detector must treat this as a real device -condition, not corrupt data. - -**Detection rule that works:** - -``` -dominant geo axis: |mean| / peak > 0.7 - AND: |mean| >= 0.9 x that unit's geo trigger level -group hits into episodes by serial with a 12 h gap -``` - -A bare `|mean|/peak` threshold is useless — a quiet trace sitting at the -0.010 in/s noise floor clears any ratio test. On the surveyed store the -bare rule flagged 7,184 events; the rule above flags 274, all real. -Candidate list: `scratch/offset_candidates.csv`. - -**What the data rules out.** - -- *Not the geophone.* The on-device sensor check passes on every unit, - offset or not — test frequency 7.2–8.1 Hz, damping ratio 3.3–4.7, - zero failures fleet-wide, including mid-episode. The coil and its - mechanical response are healthy. -- *Not the battery.* 6.6–6.8 V on the affected units, same as the rest. -- *Not environmental.* Only 2 units of 21 ever show it. BE17353 logged - 395 waveform events over nine months with zero occurrences; BE7145, - 295 events, zero. Weather acts on all of them equally. -- *Not condensation.* BE18438's Vert held 0.179 → 0.189 for 34 hours - **including a 10-hour overnight gap**, then stepped to 0.33 at 13:24 - in the afternoon. Dew would peak overnight; it was flat overnight. - -**What the data shows.** The pedestal is *piecewise constant* — it -holds rock-steady, survives power-off gaps, and changes only in discrete -steps. A small common-mode diurnal wobble rides on top of it, but that -wobble is present on the healthy channels too (it is the unit's normal -thermal breathing) and is not the fault. - -**The fault is on the geophone side.** Operator report (2026-08-25): -*attaching a different geophone to an affected unit makes the offset go -away.* That is the channel-swap test, already run in the field many -times, and it rules out the unit's analog front-end and any stored -per-channel zero constant — a constant lives in the unit and would -survive a sensor swap. - -The stored data agrees. MicL — a separate transducer on its own cable — -shows no offset during either episode (`|mean|/peak` = 0.17 and 0.02), -while the geo channels on the same unit at the same moment are pinned. - -**Two distinct failure patterns**, both geophone-side: - -| unit | Tran | Vert | Long | MicL | reading | -|---|---|---|---|---|---| -| BE18438 | 0.16 | **0.97** | 0.18 | 0.02 | one element only | -| BE9558 | 0.90 | 0.81 | **0.99** | 0.17 | all three, Long dominant | - -(values are `\|mean\|/peak` on the dominant axis) - -BE18438 has a single faulted conductor pair with the other two clean. -BE9558 has all three geo channels offset by different amounts -(Long +0.340, Tran +0.037, Vert −0.020) — that points at a shared return -or ground path in the housing rather than one element. - -**Candidate mechanisms.** A geophone coil is passive and cannot -generate sustained DC on its own, so an offset originating on the sensor -side has to come from one of: - -1. *Galvanic corrosion at a connector or splice* — dissimilar metals - plus moisture form a literal cell. This generates DC directly, in - the tens-of-millivolts range that matches the measured offset - (0.29 in/s ÷ 6.206053 in/s per volt ≈ 46 mV referred to the ADC - input). Fits the discrete steps, surviving power cycles, and being - cured by swapping the sensor. -2. *A leakage path to shield or another conductor*, letting the unit's - own bias/reference divide into the signal pair. Best fit for the - BE9558 all-three-channels pattern. -3. *Changed coil DC resistance* (partial short or degraded winding) - interacting with the amplifier's input bias current — - `V_offset = I_bias × R_source`. Best fit for the BE18438 - single-element pattern. Note the on-device sensor check would not - catch this: it measures ring-down frequency and damping, not DC. - -**Caveat on the swap test.** Swapping a geophone requires stopping and -restarting monitoring, and these units run Sensor Check "Before -monitoring" — so the restart also re-zeros the channels. The swap -therefore does not cleanly separate *"new sensor"* from *"the restart -re-zeroed it"*. Two cheap controls settle it: restart monitoring -**without** swapping (if the offset clears, it was the re-zero), or swap -the **original** sensor back (if the offset returns, it is the sensor). -The operator's remedy being a swap rather than a restart is weak -evidence for the sensor, since a restart is the easier thing to try -first. - -**Best single measurement when it recurs:** DC voltage across the -suspect geophone's connector pins with the sensor **disconnected from -the unit**. A galvanic cell (mechanism 1) shows an open-circuit -voltage; mechanisms 2 and 3 do not. - -**Note:** the surveyed population is subject to survivorship bias — -flooded events were routinely deleted before this snapshot, so units -that look clean here may have had episodes that were scrubbed. +# Instantel MiniMate Plus — Blastware RS-232 Protocol Reference +### "The Rosetta Stone" +> Reverse-engineered via RS-232 serial bridge sniffing between Blastware software and an Instantel MiniMate Plus seismograph (S/N: BE18189). +> Cross-referenced against Instantel MiniMate Plus Operator Manual (716U0101 Rev 15) from v0.18 onward. +> **Certainty Ratings:** ✅ CONFIRMED | 🔶 INFERRED | ❓ SPECULATIVE +> Certainty ratings apply only to protocol semantics, not to capture tooling behavior. + +--- + +## Changelog + +| Date | Section | Change | +|---|---|---| +| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | +| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | +| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | +| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | +| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | +| 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. | +| 2026-05-20 | §2, §3, §4.2, §5.1, §5.3, §6, §7.5b, §7.6.1, §7.6.3, §7.6.4, §7.7.2, §7.7.3, §7.7.5, §7.8.4, §7.8.7, §7.9, §8, §11, §12, §13, §14, §15, Appendix D | **DOC AUDIT PASS — accuracy sweep against `CLAUDE.md` + `minimateplus/` code.** Fixed: (1) S3 frames terminate on bare ETX, not DLE+ETX — §2/§3 rewritten. (2) §3 payload layout corrected — byte[1]=flags, byte[2]=SUB (was wrongly labelled DLE/ADDR). (3) §4.2 — probe responses do NOT carry data length; lengths are hardcoded `DATA_LENGTHS` constants. (4) §5.1 — removed stale duplicate "SUB 1C = TRIGGER CONFIG READ" row; SUB 0A lengths corrected from `0x30/0x26` to `0x46/0x2C` (real event / boundary marker). (5) §5.3 — added missing write-frame format (BW_CMD-only doubling, DLE-aware checksum, offset formula, ack format, SUB 71 chunk parameters). (6) §6 — fixed "SUB 06 → channel config read" → event storage range. (7) §7.5b / §8 — added the 10-byte `sub_code=0x03` continuous-mode timestamp variant alongside the 9-byte single-shot layout; peak vector sum location corrected from "fixed offset 87" to `tran_pos − 12` (label-relative). (8) §7.6 / §7.6.1 / §7.6.3 / §7.6.4 — switched compliance-anchor convention from the 10-byte form to the canonical 6-byte `\xbe\x80\x00\x00\x00\x00`; recording_mode confirmed at anchor−8 in BOTH read and write (was wrongly listed as anchor−3 write / anchor−4 read); sample_rate at anchor−6, histogram_interval at anchor−4, record_time at anchor+6; geo_range row added at channel_label+33. (9) §7.7.2 — token byte position corrected from `params[6]` to `params[7]`. (10) §7.8.4 — fi==9 skip marked FIXED (already removed from code); chunk-count totals updated. (11) §7.8.7 — TODO replaced with current state of `_decode_a5_metadata_into`. (12) §7.9 — Histogram Interval upgraded ❓ → ✅. (13) §11 — POLL example wire bytes corrected; SUB 5A row added to checksum table. (14) §13 — device-under-test updated for current primary unit (BE11529 / S338.17). (15) §14 — TCP Idle Timeout fixed (0→2 min); Data Forwarding Timeout units clarified. (16) §15 (renumbered from second §14) — open-question items already resolved in CLAUDE.md closed out. (17) Appendix D — extension taxonomy rewritten to reflect the AB0T timestamp encoding (D.5.2/D.5.3); EXTENSION REFUTED warning replaced with the resolved encoding. | +| 2026-05-08 | §7.6.1 (RETRACTION) | **❌ RETRACTED — "raw int16 LE 8 bytes/sample-set" body codec was never validated.** The original 4-2-26 confirmation was based on misreading broken-decoder output (full-scale ±32K noise) as evidence the signal had saturated. BW's own 0C peaks for that capture (Tran=0.420 / Vert=3.870 / Long=0.495 in/s) prove the signal was NOT saturated — none of those exceed 13K ADC counts. No event in the project's archive has ever come close to saturation, yet the decoder consistently produces ±32K noise on every event. Conclusion: the body codec is not raw int16 LE; the actual encoding is open. Body byte distribution is heavily skewed (24% `0x00`, 10.5% `0x10`, lots of `10 XX` pairs) — likely a delta encoding with `0x10` as escape, but unverified. Retraction box added at top of §7.6.1; "fully-saturating event" claim removed from channel-identification note. The histogram codec in §7.6.2 IS verified and decoded correctly (different recording mode, 32-byte blocks); use it as a structural hint when reverse-engineering the waveform codec. | +| 2026-02-26 | Initial | Document created from first hex dump analysis | +| 2026-02-26 | §2 Frame Structure | **CORRECTED:** Frame uses DLE-STX (`0x10 0x02`) and DLE-ETX (`0x10 0x03`), not bare `0x02`/`0x03`. `0x41` confirmed as ACK not STX. DLE stuffing rule added. | +| 2026-02-26 | §8 Timestamp | **UPDATED:** Year `0x07CB = 1995` confirmed as MiniMate hardware default date when RTC battery is disconnected. Not an encoding error. Confidence upgraded from ❓ to 🔶. | +| 2026-02-26 | §10 DLE Stuffing | **UPGRADED:** Section upgraded from ❓ SPECULATIVE to ✅ CONFIRMED. Full stuffing rules and parser state machine documented. | +| 2026-02-26 | §11 Checksum | **UPDATED:** Frame builder and parser rewritten to handle DLE framing and byte stuffing correctly. | +| 2026-02-26 | §14 Open Questions | DLE question removed (resolved). Timestamp year question removed (resolved). | +| 2026-02-26 | §7.2 Serial Number Response | **CORRECTED:** Trailing bytes are `0x79 0x11` only (2 bytes, not 3). `0x20` was misidentified as a trailing byte — it is the frame checksum. | +| 2026-02-26 | §7.2 Serial Number Response | **UPDATED:** Two-unit comparison confirms `0x11` = firmware minor version (S337.**17** → `0x11` = 17). Byte 0 is unit-specific, derivation unknown. | +| 2026-02-26 | §15 Binary Log Format | **NEW:** `.bin` logger format strips DLE from ETX (`0x10 0x03` → `0x03`). Not raw wire bytes. | +| 2026-02-26 | §5.1 Request Commands | **ADDED:** Three new read commands confirmed: SUB `09`, `1A`, `2E`. | +| 2026-02-26 | §5.3 Write Commands | **NEW SECTION:** Full write command family documented from compliance setup capture. SUBs `68`–`83`. | +| 2026-02-26 | §7.5 Full Waveform Record | **UPDATED:** Project strings field layout fully mapped from write payload diff. Client field confirmed at byte +230 in SUB `71` frame. | +| 2026-02-26 | §14 Open Questions | Write commands question resolved. Session `152427` had swapped port labels — superseded by sessions `184518` and `185019`. | +| 2026-02-26 | Global | **CORRECTED:** Firmware version `S338.17` → `S337.17` everywhere, including hex encoding at config offset `0x34`. | +| 2026-02-26 | §3 Payload Structure | **DOWNGRADED:** ADDR field certainty `🔶 INFERRED` → `❓ SPECULATIVE`. Added note that bytes 1–2 purpose is unconfirmed. | +| 2026-02-26 | §5.2 Response SUBs | **STRENGTHENED:** `0xFF - SUB` rule wording clarified — high confidence, no counterexample, not yet formally proven. | +| 2026-02-26 | §15 → Appendix A | **RENAMED:** Binary log format section moved to Appendix A with explicit note that it describes tooling behavior, not protocol. | +| 2026-02-26 | Header | **ADDED:** Certainty legend clarification — ratings apply to protocol semantics only, not tooling behavior. | +| 2026-02-26 | §7.6 Channel Config Float Layout | **NEW SECTION:** Trigger level confirmed as IEEE 754 BE float in in/s. Alarm level identified as adjacent float = 1.0 in/s. Unit string `"in./s"` embedded inline. `0x082A` removed as trigger level candidate. | +| 2026-03-01 | §7.6 Channel Config Float Layout | **UPGRADED:** Alarm level offset fully confirmed via controlled capture (alarm 1.0→2.0, trigger 0.5→0.6). Complete per-channel layout documented. Three-channel repetition confirmed (Tran, Vert, Long). Certainty upgraded to ✅ CONFIRMED. | +| 2026-03-01 | §7.7 `.set` File Format | **NEW SECTION:** Blastware save-to-disk format decoded. Little-endian binary struct matching wire protocol payload. Full per-channel block layout mapped. Record time confirmed as uint32 at +16. MicL unit string confirmed as `"psi\0"`. `0x082A` mystery noted — not obviously record time, needs one more capture to resolve. | +| 2026-03-02 | §7.4 Event Index Block | **CONFIRMED:** Backlight and power save offsets independently confirmed via device-set capture (backlight=100=0x64 at +75, power-save=30=0x1E at +83). On-device change visible in S3→BW read response — no Blastware write involved. Offsets are ✅ CONFIRMED. | +| 2026-03-02 | §7.4 Event Index Block | **NEW:** `Monitoring LCD Cycle` identified at offsets +84/+85 as uint16 BE. Default value = 65500 (0xFFDC) = effectively disabled / maximum. Confirmed from operator manual §3.13.1g. | +| 2026-03-02 | §7.4 Event Index Block | **UPDATED:** Backlight confirmed as uint8 range 0–255 seconds per operator manual §3.13.1e ("adjustable timer, 0 to 255 seconds"). Power save unit confirmed as minutes per operator manual §3.13.1f. | +| 2026-03-02 | Global | **NEW SOURCE:** Operator manual (716U0101 Rev 15) added as reference. Cross-referencing settings definitions, ranges, and units. Header updated. | +| 2026-03-02 | §14 Open Questions | Float 6.2061 in/s mystery: manual confirms only two geo ranges (1.25 in/s and 10.0 in/s). 6.2061 is NOT a user-selectable range → originally speculated as internal ADC full-scale constant, but was NOT confirmed at this time. Using it directly as the range produces ~9× PPV overread. Meaning unknown. Downgraded to LOW 2026-03-02, re-escalated to HIGH 2026-04-16. **RESOLVED 2026-04-17 — see §7.6.2 and changelog entry.** | +| 2026-03-02 | §14 Open Questions | `0x082A` hypothesis refined: 2090 decimal. At 1024 sps, 2 sec record = 2048 samples. Possible that 0x082A = total samples including 0.25s pre-trigger (256 samples) at some adjusted rate. Needs capture with different record time. | +| 2026-03-02 | §14 Open Questions | **NEW items added:** Trigger sample width (default=2), Auto Window (1-9 sec), Aux Trigger (enabled/disabled) — all confirmed settings from operator manual not yet mapped in protocol. | +| 2026-03-02 | §14 Open Questions | Monitoring LCD Cycle resolved — removed from open questions. | +| 2026-03-02 | Appendix A | **CORRECTED:** Previous entry stated logger strips DLE from ETX. This was wrong — it applied to an older logger version. `s3_bridge v0.5.0` confirmed to preserve raw wire bytes including `0x10 0x03` intact. HxD inspection of new capture confirmed `10 03` present in S3→BW record payloads. | +| 2026-03-02 | Appendix A | **UPDATED:** New capture architecture: two flat raw wire dumps per session (`raw_s3.bin`, `raw_bw.bin`), one per direction, no record wrapper. Replaces structured `.bin` format for parser input. | +| 2026-03-02 | Appendix A | **PARSER:** Deterministic DLE state machine implemented (`s3_parser.py`). Three states: `IDLE → IN_FRAME → AFTER_DLE`. Replaces heuristic global scanning. Properly handles DLE stuffing (`10 10` → literal `10`). Only complete STX→ETX pairs counted as frames. | +| 2026-03-02 | Appendix A | **VALIDATED:** `raw_bw.bin` yields 7 complete frames via state machine. `raw_s3.bin` contains large structured responses (first frame payload ~3922 bytes). Both files confirmed lossless. BW bare `0x02` pattern confirmed as asymmetric framing (BW sends bare STX, S3 sends DLE+STX). | +| 2026-03-09 | §7.6, §Appendix B | **CONFIRMED:** Record time located in SUB E5 data page2 at payload offset `+0x28` as **float32 BE**. Confirmed via two controlled captures: 7 sec = `40 E0 00 00`, 13 sec = `41 50 00 00`. Geo range (only 1.25 or 10.0 in/s) eliminates ambiguity — 7 and 13 are not valid geo range values. | +| 2026-03-09 | §7.5, §14 | **CORRECTED:** The byte `0x0A` appearing after the "Extended Notes" null-padded label in the E5 payload is **NOT** record time. It is an unknown field that equals 10 and does not change when record time changes. False lead closed. | +| 2026-03-09 | §14 | **RESOLVED:** `0x082A` mystery closed — confirmed as fixed-size E5 payload length (2090 bytes), not a record-time-derived sample count. Value is constant regardless of record time or other settings. | +| 2026-03-09 | §7.8, §14, Appendix B | **NEW — Trigger Sample Width confirmed:** Located in BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Confirmed via BW-side capture (`raw_bw.bin`) diffing two sessions: Width=4 → `0x04`, Width=3 → `0x03`. Setting is **transmitted only on BW→S3 write** (SUB `0x82`), invisible in S3-side compliance dumps. | +| 2026-03-09 | §14, Appendix B | **CONFIRMED — Mode gating is a real protocol behavior:** Several settings are only transmitted (and possibly only interpreted by the device) when the required mode is active. Trigger Sample Width is only sent when in Compliance/Single-Shot/Fixed Record Time mode. Auto Window is only relevant when Record Stop Mode = Auto — attempting to capture it in Fixed mode produced no change on the wire (F7 and D1 blocks identical before/after). This is an architectural property, not a gap in the capture methodology. Future capture attempts for mode-gated settings must first activate the appropriate mode. | +| 2026-03-09 | §14 | **UPDATED — Auto Window:** Capture attempted (Auto Window 3→9) in Fixed record time mode. No change observed in any S3-side frame (F7, D1, E5 all identical). Confirmed mode-gated behind Record Stop Mode = Auto. Not capturable without switching modes — deferred. | +| 2026-03-11 | §14, Appendix B | **CONFIRMED — Aux Trigger read location:** SUB `FE` (FULL_CONFIG_RESPONSE), destuffed payload offset `0x0109`, uint8. `0x00` = disabled, `0x01` = enabled. Confirmed via controlled capture: changed Aux Trigger in Blastware, sent to unit, re-read config. FE diff showed clean isolated flip at `0x0109` with only 3 other bytes changing (likely counters/checksums at `0x0033`, `0x00C0`, `0x04ED`). | +| 2026-03-11 | §14, Appendix B | **PARTIAL — Aux Trigger write path:** Write command not yet isolated. The BW→S3 write appears to occur inside the A4 (POLL_RESPONSE) stream via inner frame handshaking — multiple WRITE_CONFIRM_RESPONSE inner frames (SUBs `7C`, `7D`, `8B`, `8C`, `8D`, `8E`, `96`, `97`) appeared in A4 after the write, and the TRIGGER_CONFIG_RESPONSE (SUB `E3`) inner frames were removed. Write command itself not yet captured in a clean session — likely SUB `15` or embedded in the partial session 0. Write path deferred for a future clean capture. | +| 2026-03-11 | §4, §14 | **NEW — SUB A4 is a composite container frame:** A4 (POLL_RESPONSE) payload contains multiple embedded inner frames using the same DLE framing (10 02 start, 10 03 end, 10 10 stuffing). Phase-shift diffing issue resolved in s3_analyzer.py by adding `_extract_a4_inner_frames()` and `_diff_a4_payloads()` — diff count reduced from 2300 → 17 meaningful entries. | +| 2026-03-11 | §14 | **NEW — SUB `6E` response anomaly:** BW sends SUB `1C` (TRIGGER_CONFIG_READ) and S3 responds with SUB `6E` — does NOT follow the `0xFF - SUB` rule (`0xFF - 0x1C = 0xE3`). Only known exception to the response pairing rule observed to date. SUB `6E` payload starts with ASCII string `"Long2"`. ~~CORRECTION 2026-04-08: This "exception" was a misidentification. The `1C` in that capture was BW→S3 (a monitor status poll), and the `6E` response was from an inner A4 sub-frame misread as a top-level S3 frame. Confirmed from 4-8-26/2ndtry capture (338 BW TX frames): SUB 0x1C always receives response SUB 0xE3 (= 0xFF − 0x1C). No exceptions to the response pairing rule are known.~~ | +| 2026-03-12 | §11 | **CONFIRMED — BW→S3 large-frame checksum algorithm:** SUBs `68`, `69`, `71`, `82`, and `1A` (with data) use: `chk = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) % 256` — SUM8 of payload bytes `[2:-1]` skipping all `0x10` bytes, plus `0x10` as a constant, mod 256. Validated across 20 frames from two independent captures with differing string content (checksums differ between sessions, both validate correctly). Small frames (POLL, read commands) continue to use plain SUM8 of `payload[0:-1]`. The two formulas are consistent: small frames have exactly one `0x10` (CMD at `[0]`), which the large-frame formula's `[2:]` start and `+0x10` constant account for. | +| 2026-03-12 | §11 | **RESOLVED — BAD CHK false positives on BW POLL frames:** Parser bug — BW frame terminator (`03 41`, ETX+ACK) was being included in the de-stuffed payload instead of being stripped as framing. BW frames end with bare `0x03` (not `10 03`). Fix: strip trailing `03 41` from BW payloads before checksum computation. | +| 2026-03-30 | §3, §5.1 | **CONFIRMED — BW→S3 two-step read offset is at payload[5], NOT payload[3:4].** All BW read-command frames have `payload[3] = 0x00` and `payload[4] = 0x00` unconditionally. The two-step offset byte lives at `payload[5]`: `0x00` for the length-probe step, `DATA_LEN` for the data-fetch step. Validated against all captured frames in `bridges/captures/3-11-26/raw_bw_*.bin` — every frame is an exact bit-for-bit match when built with offset at `[5]`. The `page_hi`/`page_lo` framing in the docstring was a misattribution from the S3-side response layout (where `[3]`/`[4]` ARE page bytes). | +| 2026-03-30 | §4, §5.2 | **CONFIRMED — S3 probe response page_key is always 0x0000.** The S3 response to a length-probe step does NOT carry the data length back in `page_hi`/`page_lo`. Both bytes are `0x00` in every observed probe response. Data lengths for each SUB are fixed constants (see §5.1 table). The `minimateplus` library now uses a hardcoded `DATA_LENGTHS` dict rather than trying to read the length from the probe response. | +| 2026-03-31 | §12 TCP Transport | **NEW SECTION — TCP/modem transport confirmed transparent from Blastware Operator Manual (714U0301 Rev 22).** Key facts confirmed: (1) Protocol bytes over TCP are bit-for-bit identical to RS-232 — no handshake framing. (2) No ENQ byte on TCP connect (`Enable ENQ on TCP Connect: 0-Disable` in Raven ACEmanager). (3) Raven modem `Data Forwarding Timeout = 1 second` — modem buffers serial bytes up to 1s before forwarding over TCP; `TcpTransport.read_until_idle` uses `idle_gap=1.5s` to compensate. (4) TCP port is user-configurable (12335 in manual example; user's install uses 12345). (5) Baud rate over serial link to modem is 38400,8N1 regardless of TCP path. (6) ACH (Auto Call Home) = INBOUND to server (unit calls home); "call up" = OUTBOUND from client (Blastware/SFM connects to modem IP). `TcpTransport` implements outbound (call-up) mode. | +| 2026-03-31 | §14.3 | **NEW — Sierra Wireless RV50/RV55 Quiet Mode requirement confirmed.** Quiet Mode (ATQ) must be **enabled** on the serial port. When disabled (+ Verbose mode on), the modem injects `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time — MiniMate receives unexpected bytes, loses protocol sync, and never responds to POLL (unit beeps but returns no S3 frame). Working RV50 field config: Quiet Mode enabled, Data Forwarding Timeout=1, TCP Connect Response Delay=0. Misconfigured RV55 had all three wrong. | +| 2026-03-31 | §14.2 | **CORRECTED — Sierra Wireless RV50/RV55 sends `RING`/`CONNECT` over TCP to caller even with Quiet Mode enabled.** Quiet Mode suppresses these only on the serial port (protecting the MiniMate). TCP client still receives `\r\nRING\r\n\r\nCONNECT\r\n` prefixed before the first S3 frame bytes. Parser handles correctly by scanning for DLE+STX (`0x10 0x02`) and discarding prefix bytes. Previous note "no CONNECT string" described Raven X ENQ-disable behaviour; RV50/RV55 differ. | +| 2026-03-31 | §7.3 | **NEW — Calibration date field confirmed** at Full Config (SUB FE) destuffed payload offsets 0x53–0x57. Two-unit comparison: BE18189 (calibrated 2023) has `07 E7` at 0x56–0x57; BE11529 (calibrated 2025) has `07 E9`. Bytes 0x56–0x57 = uint16 BE calibration year ✅ CONFIRMED. Adjacent bytes at 0x53–0x55 likely encode month/day (both units show `0x10` at offset 0x54 = BCD October; 0x53 and 0x55 differ between units). Full date layout 🔶 INFERRED — pending third-unit capture or recalibration diff. Resolves open question. | +| 2026-03-31 | §9 | **CONFIRMED via Console cold-start capture** — `"Operating System"` (16 B: `4f 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d`) arrives as first TCP bytes on cold-connect before unit enters DLE-framed mode. `TcpTransport` + retry logic handles gracefully: first attempt times out waiting for SUB A4; second connect (after unit fully booted) succeeds. | +| 2026-04-01 | §7.7.5, §8 | **CONFIRMED — Full waveform record (0C) timestamp layout** cross-referenced against Blastware event report for BE11529 thump event ("00:28:12 April 1, 2026"). 9-byte format at bytes[0–8]: `[day][sub_code][month][year:2 BE][unknown][hour][min][sec]`. All fields verified. Sub_code `0x10` = Waveform (continuous/single-shot). **Previous 7-byte format doc was wrong** — replaced with confirmed 9-byte layout. | +| 2026-04-01 | §7.7.5 | **CONFIRMED — Record type** encoded in byte[1] (sub_code), not as ASCII string. `0x10` = Waveform ✅. Histogram sub_code not yet captured. ASCII string search approach removed. | +| 2026-04-01 | §7.7.5, §14 | **CONFIRMED — Per-channel PPV** at label+6 (✅ all four channels), cross-referenced vs Blastware: Tran=0.420, Vert=3.870, Long=0.495 in/s. **CONFIRMED — Peak Vector Sum** at fixed offset 87 = 3.906 in/s ✅ matches Blastware "Peak Vector Sum". Is √(Tran²+Vert²+Long²) at max instantaneous vector moment, not vector sum of per-channel peaks. Open question "offset 87 purpose" closed. | +| 2026-04-01 | §8 | **RESOLVED — §8 unknown byte at offset 3.** Field is confirmed absent in the 9-byte waveform record format (no such field). The 6-byte event-index format has a separator byte at [3] whose purpose remains ❓ but is no longer actively blocking anything. | +| 2026-04-01 | §7.6.2 (NEW) | **NEW — SUB 1A multi-frame read protocol documented.** SUB 1A (compliance config read) requires a 4-frame sequence, not a simple 2-step probe+fetch. Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture, ACK+STX/ETX format, BW CMD=0x10). Sequence: (A) probe `offset=0x0000, params=...00 64 00 00`; (B) data request `offset=0x0400, params=...00 64 00 00`; (C) data request `offset=0x0400, params=...04 00 00 64 00 00`; (D) data request `offset=0x002A, params=...08 00 00 64 00 00`. E5 response to each frame carries a `page_key` field (bytes `data[3:5]`): page `0x0000` = 44-byte header chunk, page `0x0010` = main config data (~1027+1055 bytes across C and D). | +| 2026-04-01 | §7.6.2 | **NEW — BE11529 duplicate-page behaviour.** BE11529 (firmware S338.17) sometimes responds to frame D with page `0x0000` (44 bytes) instead of page `0x0010` (~1055 bytes). When this happens, frame D is an exact duplicate of frame B and must be dropped to prevent cfg mis-alignment. Detection: track `(page_key, chunk_len)` pairs and skip repeats. When frame D delivers page `0x0010` correctly, total cfg = 44 + 1027 + 1055 = 2126 bytes; with duplicate D, cfg = 44 + 1027 = 1071 bytes. Both are valid inputs to the decoder. | +| 2026-04-01 | §7.6.1 | **CORRECTED — Record time offset.** Previous doc (`+0x28` from E5 data page2 start) was correct for single-frame reads but unreliable for BE11529 due to a 1-byte DLE jitter (see §7.6.3). The `minimateplus` library now uses an anchor-based approach: search for `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100]; record time float32 BE is at anchor+10. Validated at 3.0, 5.0, and 8.0 seconds. | +| 2026-04-01 | §7.6.3 (NEW) | **NEW — Sample rate confirmed and documented.** Sample rate (Normal=1024 / Fast=2048 / Faster=4096 Sa/s) is stored as uint16 BE at anchor−2, where anchor is the 10-byte sequence `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00`. DLE jitter root cause: 4096 = 0x1000, so in the raw S3 frame the sample-rate bytes are sent as `10 10 00` (DLE-escaped `10`); after DLE unstuffing → `10 00` (2 bytes instead of 3 for 1024/2048), making frame C 1 byte shorter and shifting all subsequent offsets by −1. Anchor search is immune to this shift. All three modes confirmed on BE11529 firmware S338.17. | +| 2026-04-01 | §5.1 | **CONFIRMED — `_pending_frames` buffer and `reset_parser=False` parameter.** `MiniMateProtocol._recv_one()` now supports `reset_parser=False` to preserve parser state between consecutive reads within a multi-frame sequence. A `_pending_frames: list[S3Frame]` buffer stores extra frames parsed from a single TCP chunk when multiple E5 responses arrive together. Required for reliable SUB 1A frame B/C/D sequence on BE11529. | +| 2026-04-02 | §7.8 (NEW) | **CONFIRMED — SUB 5A frame format.** `offset_hi` byte (`0x10`) must be sent **raw, not DLE-stuffed** — standard `build_bw_frame` incorrectly stuffs it to `10 10` on the wire; device ignores the frame. BW sends it as bare `10`. Checksum is **DLE-aware**: when walking the byte sequence, `10 XX` pairs contribute only `XX` to the sum; lone bytes contribute normally. `build_5a_frame()` reproduces BW's exact wire format. | +| 2026-04-02 | §7.8 | **CONFIRMED — SUB 5A params are 11 bytes (not 10) for chunk frames.** Extra trailing `0x00` confirmed from 1-2-26 BW wire capture. Probe frame and termination frame differ — see `bulk_waveform_params()` in `framing.py`. | +| 2026-04-02 | §7.7.5 | **CONFIRMED — Event-time metadata source.** `Client:`, `User Name:`, and `Seis Loc:` strings are present in **A5 frame 7** of the SUB 5A bulk waveform stream — they are NOT in the 210-byte SUB 0C waveform record. They reflect the compliance setup active when the event was stored on the device (not the current setup). `get_events()` now issues SUB 5A after each 0C download. Sequence: `1E → 0A → 0C → 5A → 1F`. | +| 2026-04-02 | §7.6.2 | **FIXED — Compliance config orphaned send bug.** An extra `self._send(SUB_COMPLIANCE / 0x2A / DATA_PARAMS)` before the B/C/D receive loop had no corresponding `recv_one()`. Every receive in the loop was consuming the previous send's response, leaving frame D's channel block unread. Bug removed. Total config bytes now ~2126 (was ~1071 due to truncation). `trigger_level_geo`, `alarm_level_geo`, `max_range_geo` are now correctly populated. | +| 2026-04-02 | §7.6.1 | **CORRECTED — Anchor search range.** Previous doc stated anchor search range `cfg[40:100]`. With the orphaned-send bug fixed, the 44-byte header padding is gone and the anchor now appears at `cfg[11]`. Corrected to `cfg[0:150]`. | +| 2026-04-03 | §7.6 | **CONFIRMED — Blast waveform format (4-2-26 capture).** Blast/waveform-mode SUB 5A stream uses 4-channel interleaved signed int16 LE, 8 bytes per sample-set [T,V,L,M]. NOT the 32-byte block format (which is noise/histogram mode only). Frame sizes are NOT multiples of 8 — cross-frame alignment correction required (track global byte offset mod 8; skip `(8-align)%8` bytes at each frame start). A5[0] STRT record confirmed: 21 bytes at db[7:]+11; waveform starts at strt_pos+27 (after 2-byte null pad + 4-byte 0xFF sentinel). Frame index 7 = metadata only, no ADC data. Full §7.6 rewritten. | +| 2026-04-03 | §7.6 | **CONFIRMED — Noise block format details.** 32-byte blocks: LE uint16 type + LE uint16 ctr + 9×int16 LE samples + 10B metadata. Samples are little-endian (previous doc said big-endian — WRONG). Type: 0x0016=sync (appears at start of each A5 frame), 0x0000=data. Noise floor ≈ 9–11 counts. Metadata fixed pattern `00 01 43 [2B var] 00 [pretrig] [rectime] 00 00` confirmed. | +| 2026-04-03 | client.py | **NEW — `_decode_a5_waveform()` and `download_waveform()` implemented.** `_decode_a5_waveform(frames_data, event)` decodes full A5 waveform stream into `event.raw_samples = {"Tran":[…], "Vert":[…], "Long":[…], "Mic":[…]}`. Populates `event.total_samples`, `event.pretrig_samples`, `event.rectime_seconds` from STRT record. Handles cross-frame alignment. `MiniMateClient.download_waveform(event)` calls `read_bulk_waveform_stream(stop_after_metadata=False)` then invokes the decoder. Waveform key stored on Event as `_waveform_key` during `get_events()`. | +| 2026-04-03 | §7.7.5 | **CONFIRMED — sub_code=0x03 (Waveform continuous) uses 10-byte timestamp header** — one byte wider than sub_code=0x10 layout. Cross-referenced against Blastware event report for BE11529 (15:20:17 Apr 3 2026). Raw header: `10 03 10 04 07 ea 00 0f 14 11` = [unknown_a][day][unknown_b][month][year:2 BE][unknown][hour][min][sec]. Peak Vector Sum is at `tran_label − 12` (label-relative, NOT fixed offset 87 — fixed offset only incidentally correct for sub_code=0x10). | +| 2026-04-05 | §7.8 | **CONFIRMED — 5A "Project:" string is session-start config, NOT per-event.** The "Project:" value in A5 frame 7 reflects the compliance setup active when the monitoring session started, not when the individual event was recorded. `_decode_a5_metadata_into()` only sets `project` from 5A when 0C did not already supply one. "Client:", "User Name:", "Seis Loc:", and "Extended Notes" are NOT in the 0C record and are set unconditionally from 5A. | +| 2026-04-06 | §5.1 | **CORRECTED — SUB 1F token position is params[7], NOT params[6].** Both 3-31-26 and 4-3-26 BW TX captures confirm: raw params `00 00 00 00 00 00 00 FE 00 00`, token byte at index 7. Previous doc (params[6]) was wrong — with wrong position the device ignores the token and 1F returns null immediately. | +| 2026-04-06 | §6.1 | **NEW — Full event download sequence documented** (§6.1). Sequence confirmed from 4-2-26 and 4-3-26 BW TX captures: `1E(all-zero) → [per event: 0A → 1E(arm/0xFE) → 0C → 1F(arm/0xFE) → POLL×3 → 5A → 1F(browse)]`. Each step documented with confirmed requirements. | +| 2026-04-06 | §6.1 | **CONFIRMED — 1E(token=0xFE) arm step required.** Device silently ignores all 5A probe frames unless a second 1E with token=0xFE is sent between 0A and 0C. Present in every download cycle in the 4-2-26 and 4-3-26 captures. | +| 2026-04-06 | §6.1 | **CONFIRMED — SUB 1F(token=0xFE) must precede POLL×3 before 5A.** BW always sends 1F(0xFE) before the 3 POLL cycles before 5A. 5A still uses the pre-advance key (set by 0A+1E-arm+0C); 1F only arms the device's 5A state machine. | +| 2026-04-06 | §6.1 | **CONFIRMED — browse 1F must be conditional.** Calling 1F(browse=True/all-zero) after a FAILED 5A disrupts device state and causes the next event's 5A probe to time out with 0 bytes received. Browse 1F is only called after a SUCCESSFUL 5A. Failure fallback: use the key returned by the prior 1F(arm/0xFE) call. | +| 2026-04-06 | §7.8 | **ADDED — `bytes_fed` diagnostic counter on S3FrameParser.** Counts raw bytes fed to the parser since last `reset()`. Logged at WARNING when 5A probe times out — distinguishes "device sent no bytes at all" from "device responded but frame was malformed or had wrong SUB". | +| 2026-04-06 | §7.8.2 | **CORRECTED — SUB 5A chunk counter is monotonic for ALL chunks.** Previous doc hard-coded chunk 1 counter as `0x1004` (from 4-2-26 BW TX capture). This was a Blastware artifact. Empirically confirmed: `counter = chunk_num * 0x0400` works (device responds immediately); counter=0x1004 for chunk 1 causes 120 s timeout. BW's true internal formula appears to be `key4[2:4] + n * 0x0400` — for event 1 (key `01110000`) this equals `n * 0x0400`. The device does not strictly validate counter values. | +| 2026-04-06 | §7.8.4 | **NEW — 5A end-of-stream signalling confirmed.** After streaming all waveform chunks, the device sends exactly **1 raw byte** in response to the next chunk request, then goes silent for the full recv timeout. This byte is NOT a complete DLE-framed A5 response — the frame parser accumulates it as `bytes_fed=1` and never assembles a frame. This is the device's natural end-of-stream signal. Handling: on TimeoutError, if `bytes_fed > 0` AND prior chunks were received, treat as graceful end and proceed to the termination frame. A `bytes_fed=0` timeout with no prior chunks is a genuine transport failure and must still raise. | +| 2026-04-06 | §7.8.4 | **NEW — 5A chunk timing and count (empirical, BE11529 at 1024 sps).** Each chunk response arrives within ~1 second over TCP/cellular. A 9,306-sample event (≈9.1 s at 1024 sps) produces **35 chunks** before end-of-stream. Chunks 1–16 have varying data lengths (1036–1123 bytes); chunks 17–35 are uniformly 1036 bytes each (post-event silence, all-zero ADC samples). Safe recv timeout for chunk loop: **10 s** (10× typical response time). Default transport timeout (120 s) results in a ~2-minute stall per event at end-of-stream. | +| 2026-04-06 | §7.8.3 | **KNOWN ISSUE — `_decode_a5_waveform` hardcoded fi==9 skip.** The decoder contains `elif fi == 9: continue` which was written for the 9-frame original blast capture where frame 9 was a device terminator. For streams with >9 frames (current device produces 35+), frame index 9 is live waveform data — this skip discards ~1,070 bytes (~133 sample-sets) per event. The terminator is now detected via `page_key == 0x0000`, not by frame index. The fi==9 skip should be removed. | +| 2026-04-06 | §7.8 | **⚠ PARTIALLY INVALIDATED — ADC count-to-physical-unit conversion.** Raw waveform samples are signed 16-bit integers (counts). Conversion formula `value = counts × (range / 32767)` is believed correct, but the `range` value was UNKNOWN at time of writing. **UPDATED 2026-04-17:** `max_range_geo` = 6.206053 is confirmed as the ADC-to-velocity scale factor (inverse sensitivity, (in/s)/V). The correct conversion is therefore: `PPV (in/s) = counts × (1.61133 / 32767) × 6.206053` = `counts × 4.982e-5` in/s per count. The earlier ~9× overread from using 6.206053 directly as the range was because the range IS 1.61133 × 6.206053 = 10.000 in/s, not 6.206053. See §7.6.2 for the confirmed field layout. | +| 2026-04-08 | §5.1, §7.10, §12 | **NEW — Monitoring commands confirmed.** SUB 0x1C (monitor status), 0x96 (start monitoring), 0x97 (stop monitoring) all confirmed from 4-8-26/2ndtry capture. SESSION_RESET (`41 03`) required before POLL to wake a monitoring unit. | +| 2026-04-09 | §7.10 | **CORRECTED — monitoring flag and battery/memory offsets.** `section[1] == 0x10` is the monitoring flag (100% accurate across 144 data frames in 2ndtry capture). Previous note claiming `section[6]` was wrong — section[6] has device-specific non-binary values (0xea/0x07). Battery/memory offsets corrected: `section[-10:-8]` (battery×100), `section[-8:-4]` (memory_total), `section[-4:]` (memory_free). NOTE: `frame.data` has checksum stripped by parser — earlier offsets of `[-11:-9]`/`[-9:-5]`/`[-5:-1]` were wrong because they assumed a trailing checksum byte that isn't there. | +| 2026-04-08 | §7.10 | **NEW — SUBs 0x0E (channel sensor data) and 0x98 (trigger test) observed** in 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). SUB 0x0E: 2-step read with channel selector in `params[6:8]`, data length 0x0A per channel, RSP SUB = 0xF1. SUB 0x98: single probe frame with `params[0] = 0xFF`, RSP SUB = 0x67; sent twice per test cycle. Not yet implemented in SFM. | +| 2026-04-08 | §7.10 | **NEW — SUBs 0x15 and 0x01 observed in sensor-check capture.** SUB 0x15 (serial number short form, data length 0x0A, RSP 0xEA) and SUB 0x01 (device info block, data length 0x98 = 152 bytes, RSP 0xFE) seen in Blastware's "Unit Channel Test" init sequence. Note: SUB 0x01 response SUB 0xFE collides with the existing SUB 0xFE → RSP 0x01 naming convention — they are inverse commands. | +| 2026-04-08 | §12 | **CONFIRMED — Unit partially reachable during on-device sensor check.** 4-8-26/sensor-check capture shows: POLL responds normally throughout; SUB 0x0E channel reads partially served (channels 0–4 responded), then ~40s silent gap while sensor check ran, then channels 5–7 responded. On-device sensor check duration ≈ 40 s. SFM `_pollMonitorConfirm()` polls status every 5 s for up to 60 s after start_monitoring. | +| 2026-04-08 | §7.9 (NEW) | **NEW — Compliance config field inventory captured from Blastware UI.** See §7.9 for full field list (Recording Setup, Notes, Special Setups tabs). Most fields NOT yet mapped to raw byte offsets. Confirmed decoded: sample_rate, record_time, trigger_level_geo, alarm_level_geo, max_range_geo, backlight_on_time, power_saving_timeout, monitoring_lcd_cycle, project/client/operator/sensor_location/notes. Sensor Check dropdown (Before monitoring / After each event / Disabled) NOT YET LOCATED in raw config bytes. | +| 2026-04-11 | §5.1, §5.2 | **NEW — Erase-all command sequence confirmed from MITM capture.** SUB 0xA3 (begin erase, token=0xFE → ack 0x5C) + SUB 0xA2 (confirm erase, token=0xFE → ack 0x5D). Standard `build_bw_frame` format (not write-format). Required intermediate steps: 0x1C probe+data (monitor status read) + 0x06 probe+data (event storage range). All response SUBs follow the standard 0xFF−SUB formula with no exceptions. | +| 2026-04-11 | §5.1 | **CONFIRMED — SUB 0x06 (CHANNEL CONFIG READ) now confirmed as event storage range.** Two-step read, data offset = 0x24 (36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (bytes −8:−4) and last stored event key (bytes −4:). Both equal `01110000` when device memory is empty. Used by Blastware to verify erase completion. | +| 2026-04-11 | §7.11 (NEW) | **NEW — §7.11 Erase-All Protocol added.** Full wire sequence, SUB 0x06 storage range payload layout, post-erase key counter reset (resets to `0x01110000`). Confirmed from 4-11-26 MITM capture of live Blastware ACH session. | +| 2026-04-11 | §14.6 | **RESOLVED — ACH Session Lifecycle is no longer "Future".** `bridges/ach_server.py` fully implements inbound ACH: POLL handshake, device info, event download. State tracked via `ach_state.json` (key-based, with `max_downloaded_key` for post-erase detection). `--clear-after-download` flag added for the standard delete-after-upload workflow. | +| 2026-04-17 | §7.6.2, §14 | **RESOLVED — Float 6.206053 at channel_label+28 is the ADC-to-velocity scale factor.** Confirmed from Series III Interface Handbook §4.5 formula: `Range (×1) = 1.61133 V / Sensitivity (V/unit)`. For the standard Instantel geophone at Normal range (10.000 in/s): Sensitivity = 1.61133 / 10 = 0.161133 V/(in/s). The stored value is the **inverse sensitivity** = 1/0.161133 = **6.206053 (in/s)/V**. Cross-check: 1.61133 V × 6.206053 = 10.000 in/s ✅. The firmware uses it as: `PPV (in/s) = ADC_voltage (V) × 6.206053`. Value is identical on all Instantel standard geophones — it is a hardware/firmware constant, NOT a user-configurable setting. Do NOT write this field. Open question §14 item "Max Geo Range float 6.2061" is now **RESOLVED**. | +| 2026-04-20 | §7.6.4 (NEW), §7.9, Appendix B | **CONFIRMED — Recording Mode byte location.** Three targeted captures (4-20-26) confirmed `recording_mode` at anchor−8 in both the E5 read payload and the BW write payload (6-byte anchor `\xbe\x80\x00\x00\x00\x00`). BW write payload and E5 read payload are **byte-identical** around the anchor region — Blastware round-trips the wire-encoded E5 bytes verbatim with only the target field modified. Anchor position varies by ±1 depending on whether recording_mode = 0x03 (Histogram), because E5 wire-encodes `0x03` as the inner DLE+ETX pair `\x10\x03` (2 bytes), which S3FrameParser preserves as two literal bytes in `compliance_raw`. Enum: `0x00`=Single Shot, `0x01`=Continuous, `0x03`=Histogram, `0x04`=Histogram+Continuous. `0x02` value not yet observed. The byte at anchor−9 is `0x00` for Single Shot / Continuous, and `0x10` for Histogram (DLE prefix from E5 encoding) and Histogram+Continuous (actual config byte). See §7.6.4 for full details. | +| 2026-04-21 | Appendix D (NEW) | **NEW — Blastware .N00 and .MLG file formats fully decoded.** `minimateplus/blastware_file.py` implements `write_n00()` and `write_mlg()`. N00 file format confirmed: 22B header + 21B STRT record + variable body + 26B footer. Body reconstructed from A5 bulk waveform stream frames with per-frame skip amounts (probe=7+strt_pos+21, A5[1]=13, A5[2+]=12, terminator=11) and DLE strip rule (strip `0x10` before `{0x02,0x03,0x04}`, keep following byte). Footer extracted verbatim from terminator frame's last 26 bytes. Split-pair edge case: when `frame.data[-1]==0x10` and `chk_byte∈{0x02,0x03,0x04}`, reunite both bytes before stripping and always remove trailing chk_byte (`stripped[:-1]`) — chk_byte is checksum, not payload. STRT record must be copied verbatim from A5[0]; bytes [10:20] are device-specific and cannot be reconstructed from Event fields. `write_n00` verified byte-perfect against `M529LIY6.N00` from 4-3-26-multi_event capture. MLG format: 308B header + N×292B records; CRC algorithm unknown (write as 0x0000). | +| 2026-04-21 | Appendix D §D.5 (NEW) | **NEW — Blastware filename encoding fully decoded.** Serial prefix: `chr(ord('B') + floor(serial/1000))` + last 3 digits zero-padded. Stem: 4-char base-36 of `floor(total_seconds/1296)`. Extension: `AB0` for manual/direct downloads (3 chars), `AB0W` or `AB0H` for ACH/call-home downloads (4 chars), where `AB` = 2-char base-36 of `total_seconds % 1296` and W/H = waveform/histogram. Epoch = 1985-01-01 00:00:00 device local time. Confirmed against 3,248 files from 10-year production archive with zero errors. 3-day cycle property: same daily recording time cycles through 3 extensions (864s/day shift, period=3 days). `blastware_filename(event, serial, ach=False)` implements full formula. | +| 2026-04-21 | §7.6.2, §5.3 | **CORRECTED — compliance_raw contains wire-encoded bytes, NOT logical bytes.** S3FrameParser appends DLE+ETX inner-frame pairs as two literal bytes to the frame body. Any `0x03` values in the compliance config appear in `compliance_raw` as `\x10\x03` (two bytes), not as a single `0x03`. The previous claim "S3FrameParser handles this transparently so compliance_raw contains logical (destuffed) bytes" was wrong. Consequence: `compliance_raw` is the wire-encoded E5 payload; anchor-relative reads work correctly because the anchor position automatically accounts for any DLE-encoded bytes before it. For write-back, round-tripping `compliance_raw` verbatim sends the correct wire bytes to the device. **DLE ETX escaping in write frames:** Blastware escapes `0x03` bytes in write frame data as `\x10\x03` on wire; our `build_bw_write_frame` does not (writes data raw). Device is confirmed to accept raw writes for all tested modes — likely uses the offset/length field for write frame framing, not ETX scanning. | +| 2026-04-20 | §7.6.2, §7.9, Appendix B | **CONFIRMED — Geophone maximum range / sensitivity selector byte location.** Two targeted captures (4-20-26, geo sensitivity folder): one at Normal 10.000 in/s, one at Sensitive 1.250 in/s. E5 read payload diff: exactly 3 bytes differ at channel_label+33 for Tran/Vert/Long. Values: `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Same offset applies to the SUB 71 write payload (which is the same 2126-byte E5-format buffer round-tripped verbatim). **`channel_label+20` reads `0x01` in ALL captures regardless of range setting — it is NOT this field.** Previous hypothesis (uint8 at Tran+20, 0x01=Normal) was WRONG. Stored as `geo_range` in `ComplianceConfig`. Encoded to all three geo channel blocks (Tran/Vert/Long) at label+33. | +| 2026-04-20 | §5.1, §5.3, §7.12 (NEW) | **NEW — Auto Call Home config protocol confirmed from 4-20-26 call home settings captures.** SUB 0x2C (Call Home Config READ, response 0xD3, data offset 0x7C=124) and SUB 0x7E/0x7F (WRITE + CONFIRM, response 0x81/0x80) confirmed. Write payload = read payload (125 bytes) + `\x00\x00` (127 bytes total). **DLE-escaped ETX at raw[117:119]:** the device returns logical value 0x03 (num_retries=3) as `\x10\x03` on the wire — S3FrameParser preserves both bytes as two literals, causing a +1 byte shift for all subsequent fields. Write frame sends these bytes verbatim (device interprets `\x10\x03` as literal value 3). Field map confirmed from 10-frame BW TX diff. See §7.12 for full layout. | +| 2026-05-01 | §7.8.2, §7.8.5 (NEW), §7.8.6 (NEW), §7.8.7 (NEW) | **REWRITTEN — SUB 5A bulk waveform stream protocol.** Five BW MITM captures (4-27-26 "open 2sec waveform" + "copy event to disk", 5-1-26 BW 3-sec + 2nd-event + Download All) prove that the previous chunk-counter formula `max(key4[2:4], 0x0400) + (chunk_num-1) * 0x0400` over-reads 5× past the actual event end. BW reads ~12-16 chunks per event at **0x0200 increments (NOT 0x0400)**, bounded by `end_offset` extracted from the STRT record at `data[23:27]` of the first A5 response. **TERM frame formula corrected:** `offset_word = end_offset - next_boundary`, `params[2:4] = next_boundary BE` where `next_boundary = last_chunk_counter + 0x0200`. Verified across 3 events (offsets 0x1ABE, 0x21F2, 0x417E). **Metadata pages 0x1002 / 0x1004** are global, fixed-address device pages containing Project/Client/User Name/Seis Loc/Extended Notes — read ONCE per Blastware session (not per event). **Event-1 vs event-N split:** events at start_key[2:4]=0 use probe@0x0000 + metadata pages + sample chunks at 0x0600 onward; continuation events skip metadata and start at start_key+0x0046. **WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundary markers** — the "Download All" pattern walks 1E/0A/1F to map all event keys+lengths upfront, then downloads each `0x46`-keyed event in turn. Old `stop_after_metadata=True` knob is a workaround for the missing end_offset bound and becomes obsolete under the new walk. See new §7.8.5 / §7.8.6 / §7.8.7 for full details. | +| 2026-05-04 | §7.8.5, §7.8.8 | **CORRECTED — Event-N probe counter is just `start_offset`, NOT `start_offset + 0x0046`.** The `+0x46` formula in the original §7.8.5 was based on calling the off=0x2C boundary key the "start_key", but in the iteration walk `cur_key` passed into `read_bulk_waveform_stream` is always the off=0x46 WAVEHDR record key from 1F (the partial-record skip path in `get_events` re-runs 1F to advance past 0x2C boundary records). Adding +0x46 placed the probe one WAVEHDR past the actual event start; the response no longer contained STRT at byte 17, `parse_strt_end_offset` returned None, and the chunk loop fell back to the `max_chunks=128` cap, walking ~110 chunks of post-event circular-buffer garbage. Confirmed against both the 5-1-26 "copy 2nd address" capture (probe at counter=0x2238 with key=01112238) and the 5-4-26 BW 2-sec event capture. Fixed in protocol.py `read_bulk_waveform_stream` v0.14.1. | +| 2026-05-05 | §7.8.1 (rule #3 added) | **CONFIRMED — Partial DLE stuffing of `0x10` bytes in 5A params region.** The device's de-stuffing rule for the SUB 5A params region is: `10 10` → `10`, `10 02/03/04` → kept literal (inner-frame markers), `10 X` for any other X → de-stuffs to just `X` (drops the `0x10`). Therefore any `0x10` byte in the logical params followed by a byte NOT in {0x02, 0x03, 0x04, 0x10} MUST be doubled on the wire. This affects counters with `0x10` in the high byte — most importantly counter=`0x1000`, where logical params bytes `... 10 00 ...` were being sent raw and the device de-stuffed `10 00` to just `00`, returning the response for counter=0x0000 (= the file header + STRT). That STRT block then ended up embedded in the assembled file body at file offset `0x1016` and Blastware refused to open the file. This was the root cause of the long-standing ">1-sec event 0 won't open in BW" pattern (1-sec events worked because their `end_offset < 0x1000`, so no chunk request ever needed counter `0x10__`). All 17 5A request frames in the 5-1-26 bwcap3sec capture (probe + 2 meta + 13 samples + TERM) now match BW byte-for-byte after the fix. Fixed in framing.py `build_5a_frame` v0.14.3. | +| 2026-05-05 | §7.8 / Blastware file format | **CONFIRMED — File body assembly is contiguous concatenation, no de-duplication.** The "duplicate header+STRT strip" hack from v0.13.x was actively destroying valid waveform data — sample chunks at counter `0x1000` and beyond often coincidentally contain the byte sequence `00 12 03 00 STRT` in their delta-encoded ADC stream, and the strip was zeroing 25 bytes per match. Removed in v0.14.2. The correct file body is: probe contribution + meta@0x1002 + meta@0x1004 + sample contributions in stream order + TERM contribution. Verified byte-perfect against BW reference `M529LKIQ.G10` (8708 bytes, 0 differences) when fed the same A5 frames as the BW capture. | + +--- + +## 1. Physical Layer + +| Parameter | Value | Certainty | +|---|---|---| +| Interface | RS-232 serial | ✅ CONFIRMED | +| Baud rate | 38400 | ✅ CONFIRMED (from bridge log header) | +| Data bits | 8 | ✅ CONFIRMED (standard for this baud/era) | +| Parity | None | 🔶 INFERRED (no parity errors observed) | +| Stop bits | 1 | 🔶 INFERRED (standard assumption) | +| Flow control | None (no RTS/CTS activity) | 🔶 INFERRED | + +--- + +## 2. Frame Structure +> ⚠️ **2026-02-26 — CORRECTED:** Previous version incorrectly identified `0x41` as STX and `0x02`/`0x03` as bare frame delimiters. The protocol uses proper **DLE framing**. See below. + +Frame structure is asymmetric — BW→S3 (requests we send) and S3→BW (device replies) +use slightly different framing markers, both terminated by a **bare** `0x03` ETX: + +``` +BW→S3 (our requests): [ACK=0x41] [STX=0x02] [stuffed payload + chk] [ETX=0x03] +S3→BW (device replies): [DLE=0x10] [STX=0x02] [stuffed payload + chk] [ETX=0x03] +``` + +**Critical:** The outer frame terminator is a **bare ETX (`0x03`), not `DLE+ETX`.** S3 +responses contain inner sub-frames (notably inside SUB A4 POLL_RESPONSE and SUB E5 +compliance reads) that use `DLE+ETX` (`0x10 0x03`) as *inner-frame* terminators — the +outer parser preserves both bytes as literal payload data when it sees `DLE+ETX` and +only ends the frame on a bare ETX. See §10 (parser state machine) and the +`S3FrameParser` docstring in `minimateplus/framing.py`. + +### Special Byte Definitions + +| Token | Raw Bytes | Meaning | Certainty | +|---|---|---|---| +| ACK | `0x41` (ASCII `'A'`) | Acknowledgment / ready token. Standalone single byte; often precedes frames. | ✅ CONFIRMED | +| DLE | `0x10` | Data Link Escape. Prefixes the next byte to give it special meaning. | ✅ CONFIRMED — 2026-02-26 | +| STX (BW→S3) | `0x02` (bare) | BW-side start marker — preceded by ACK, not by DLE | ✅ CONFIRMED | +| STX (S3→BW) | `0x10 0x02` | DLE+STX device-side start-of-frame | ✅ CONFIRMED | +| ETX | `0x03` (bare) | End-of-frame terminator in BOTH directions; `DLE+ETX` inside a frame body is an inner sub-frame terminator preserved as literal payload | ✅ CONFIRMED | +| CHECKSUM | 1 byte | Sits between payload and the bare ETX. Two variants — see §11 (standard SUM8 for reads, DLE-aware large-frame for writes / SUB 5A). | ✅ CONFIRMED | + +### DLE Byte Stuffing Rule +> ✅ CONFIRMED — 2026-02-26 + +Any `0x10` byte appearing **naturally in the payload data** is escaped by doubling it: `0x10` → `0x10 0x10`. This prevents the parser from confusing real data with frame control sequences. + +- **Transmit:** Replace every `0x10` in payload with `0x10 0x10` +- **Receive:** Replace every `0x10 0x10` in the frame body with a single `0x10` + +| Sequence on wire | Meaning | +|---|---| +| `0x10 0x02` | Frame START — only valid at beginning | +| `0x10 0x03` | Frame END | +| `0x10 0x10` | Escaped literal `0x10` byte in payload data | +| Any other `0x10 0xXX` | Protocol error / undefined | + +### Frame Parser Notes + +- The `0x41` ACK **may arrive in a separate `read()` call** before the frame body due to RS-232 inter-byte timing or TCP segmentation. The S3 parser treats stray ACK bytes as no-ops while idle. +- Your parser must be **stateful and buffered** — read byte by byte, accumulate after STX, terminate on a bare ETX. Never assume one `read()` = one frame. +- `DLE+ETX` inside a frame body is treated as inner-frame data and appended literally; only a bare ETX ends the outer frame. +- Checksum is computed on the **de-stuffed** payload for standard reads. SUB 5A and write frames use a DLE-aware variant (see §11). +- ACK and the STX bytes are **not** included in the checksum. + +### Checksum Verification Example + +Raw S3→BW POLL probe response wire bytes: +``` +10 02 | 10 00 A4 00 00 00 ... [stuffed payload + chk] ... | 03 +^STX^ ^ETX^ +``` + +After de-stuffing (`0x10 0x10` → `0x10`), the payload is checksum-validated using +the formula from §11. The bare ETX terminates the frame. + +--- + +## 3. Payload Structure + +> ✅ **CONFIRMED 2026-03-30** — field positions verified bit-for-bit against +> `bridges/captures/3-11-26/raw_bw_*.bin`. The earlier "[CMD][DLE][ADDR]…" layout +> that called bytes [1] and [2] both `0x10` was wrong — byte [1] is `flags` +> (`0x00` for BW requests, `0x10` for S3 responses) and byte [2] is the SUB byte. + +The payload (between STX and the checksum, after de-stuffing) is a 16-byte fixed +header for read commands. BW→S3 and S3→BW use the **same field layout** but +swap the values in bytes [0] and [1]: + +``` +BW→S3 (request): S3→BW (response): + [0] BW_CMD 0x10 [0] CMD 0x00 + [1] flags 0x00 [1] flags 0x10 + [2] SUB command [2] SUB 0xFF − request_SUB + [3] 0x00 always [3] PAGE_HI (probe responses: 0x00) + [4] 0x00 always [4] PAGE_LO (probe responses: 0x00) + [5] OFFSET probe:0x00; data:DATA_LENGTH + [5+] data response body + [6:16] params 10-byte field +``` + +| Field | Position | Notes | Certainty | +|---|---|---|---| +| BW_CMD / CMD | byte 0 | `0x10` in BW→S3 requests; `0x00` in S3→BW responses. The `0x10` is the only byte DLE-stuffed in write frames. | ✅ CONFIRMED | +| flags | byte 1 | `0x00` in BW→S3; `0x10` in S3→BW. The byte pattern that earlier docs read as "ADDR" was actually flags. | ✅ CONFIRMED — 2026-03-30 | +| SUB | byte 2 | Command/response selector. Response SUB = `0xFF − request SUB`. | ✅ CONFIRMED | +| OFFSET (requests) | byte 5 | `0x00` for the probe step; `DATA_LENGTH` (hardcoded constant — see §4.2 and §5.1) for the data fetch step. Bytes [3] and [4] are always `0x00` in requests. | ✅ CONFIRMED — 2026-03-30 | +| PAGE_HI / PAGE_LO (responses) | bytes 3–4 | Observed as `0x00 0x00` in probe responses. For chunked data reads (SUB E5, SUB A5) carries the page key / chunk address. | ✅ CONFIRMED | +| params (requests) | bytes 6–15 | 10-byte parameter field; per-SUB structure (event keys, tokens, channel selectors, chunk addresses). | ✅ CONFIRMED | +| data (responses) | bytes 5+ | Response body. For two-step data fetches the actual record begins at `data[11]` after a fixed 11-byte echo header — see §7.7.4. | ✅ CONFIRMED | + +> The only `0x10` byte in a BW request payload is `BW_CMD` at `[0]`. Other `0x10` +> bytes may appear in the `OFFSET` field (e.g. offset_hi=0x10 for compliance writes) +> or in `params` (notably SUB 5A chunk counters). DLE-stuffing of these `0x10` bytes +> on the wire varies by command — see §5.3 (write frames) and §7.8.1 (SUB 5A). + +--- + +## 4. Communication Pattern + +### 4.1 ACK Handshake (Every Transaction) + +``` +Side A → 0x41 (ACK: "ready / received") +Side A → 10 02 [payload] [chk] 10 03 (frame) +Side B → 0x41 (ACK) +Side B → 10 02 [payload] [chk] 10 03 (response frame) +``` + +### 4.2 Two-Step Paged Read Pattern + +> ✅ **CORRECTED 2026-03-30** — earlier description claimed the probe response carries +> the data length in `PAGE_HI`/`PAGE_LO`. It does NOT. The S3 probe response has both +> bytes `0x00`. **Data lengths are hardcoded constants per SUB** — see the `DATA_LENGTHS` +> dict in `minimateplus/protocol.py` and the per-SUB column in §5.1. + +All data reads use a two-step pattern. It is not optional — sending the data +fetch without the probe causes the device to ignore the request. + +``` +Step 1 — Probe (BW: offset=0 in payload[5]): + BW → 41 02 10 10 00 [SUB] 00 00 00 00 [params×10] [chk] 03 + S3 → 10 02 00 10 [RSP] 00 00 [zeroed body] [chk] 03 + (probe ack — PAGE_HI=PAGE_LO=0x00, no length info) + +Step 2 — Data fetch (BW: offset=DATA_LENGTH in payload[5]): + BW → 41 02 10 10 00 [SUB] 00 00 [DATA_LENGTH] [params×10] [chk] 03 + S3 → 10 02 00 10 [RSP] 00 00 [DATA…] [chk] 03 +``` + +Implementations must use the per-SUB `DATA_LENGTH` constant (see §5.1) — there is +no length negotiation step. The two-step nature serves an arming purpose on the +device side, not length discovery. + +--- + +## 5. Command Reference Table + +### 5.1 Request Commands (Blastware → S3) + +| SUB Byte | Name | Description | Certainty | +|---|---|---|---| +| `5B` | **POLL / KEEPALIVE** | Sent continuously (~every 80ms). Requests device identity/status. | ✅ CONFIRMED | +| `15` | **SERIAL NUMBER REQUEST** | Requests device serial number. | ✅ CONFIRMED | +| `01` | **FULL CONFIG READ** | Requests complete device configuration block (~0x98 bytes). Firmware, model, serial, channel config, scaling factors. | ✅ CONFIRMED | +| `08` | **EVENT INDEX READ** | Requests the event record index (0x58 bytes). Event count and record pointers. | ✅ CONFIRMED | +| `06` | **EVENT STORAGE RANGE READ** | Requests event storage range block (0x24 = 36 bytes). Token=0xFE at params[7]. Last 8 bytes of response: first stored event key (`[-8:-4]`) and last stored event key (`[-4:]`). Both equal `01110000` when device is empty. Used by Blastware as part of the erase-all verification step. Previously labelled "CHANNEL CONFIG READ" — function now confirmed from 4-11-26 MITM capture. | ✅ CONFIRMED 2026-04-11 | +| `1E` | **EVENT HEADER READ** | Gets first waveform key. Token byte at params[7] (0x00=browse, 0xFE=download-arm). Key at data[11:15]; trailing offset at data[15:19] (0 = only one event). Two uses: (1) all-zero to get key0; (2) token=0xFE after 0A, before 0C — REQUIRED to arm device for SUB 5A. | ✅ CONFIRMED 2026-04-06 | +| `0A` | **WAVEFORM HEADER READ** | Checks record type for a given waveform key. Variable DATA_LENGTH at `data_rsp.data[5]`: **`0x46` (= 70 bytes) = real triggered event start**; **`0x2C` (= 44 bytes) = boundary marker / monitor-log partial record**. Key at params[4..7]. Required before every 1F call to establish device waveform context. Used by the "Download All" walk (§7.8.8) to map real events vs boundary keys. | ✅ CONFIRMED 2026-05-01 | +| `0C` | **FULL WAVEFORM RECORD** | Downloads 210-byte waveform/histogram record. Sub_code at byte[1]: 0x10=Waveform (9-byte timestamp hdr), 0x03=Waveform-continuous (10-byte hdr, 1-byte shift). PPV floats at label+6 (search "Tran"/"Vert"/"Long"/"MicL"). Peak Vector Sum at tran_label−12 (NOT fixed offset). Key at params[4..7], DATA_LENGTH=0xD2. | ✅ CONFIRMED 2026-04-03 | +| `1F` | **EVENT ADVANCE** | Advances to next waveform key. Token byte at params[7] (⚠️ NOT params[6]): 0x00=browse (all-zero params), 0xFE=download (arm 5A state machine). Returns next key at data[11:15]; null sentinel when data[15:19]=0x00000000. Requires preceding 0A to establish context. Browse 1F must ONLY be called after successful 5A — calling it after a failed 5A disrupts device state for the next event's 5A probe. | ✅ CONFIRMED 2026-04-06 | +| `5A` | **BULK WAVEFORM STREAM** | Bulk download of raw ADC sample data. Non-standard frame format: offset_hi=0x10 sent raw (not DLE-stuffed), DLE-aware checksum, **partial DLE stuffing of 0x10 in params** (`10 X` where X∉{02,03,04,10} must be doubled to `10 10 X` — see §7.8). Requires 1E-arm + 0C + 1F(0xFE) + POLL×3 before first probe. Walk: probe at counter=`start_offset` (event 1: 0x0000) → metadata pages 0x1002 + 0x1004 (event 1 only) → sample chunks at 0x0600, 0x0800, …, step 0x0200, bounded by `end_offset` parsed from STRT@data[17] of probe response → TERM frame at residual offset_word. Project:/Client:/User Name:/Seis Loc: live in the metadata pages, NOT in the sample-chunk stream. | ✅ CONFIRMED 2026-05-05 (BYTE-PERFECT vs BW capture) | +| `24` | **WAVEFORM PAGE A?** | Paged waveform read, possibly channel group A. | 🔶 INFERRED | +| `25` | **WAVEFORM PAGE B?** | Paged waveform read, possibly channel group B. | 🔶 INFERRED | +| `09` | **UNKNOWN READ A** | Read command, response (`F6`) returns 0xCA (202) bytes. Purpose unknown. | 🔶 INFERRED | +| `1A` | **COMPLIANCE CONFIG READ** | Multi-step sequence (A+B+C+D frames). Response (E5) carries recording_mode (uint8 at **anchor − 8** — same offset in read AND write, confirmed 2026-04-21), sample_rate (uint16 BE at anchor − 6), histogram_interval_sec (uint16 BE at anchor − 4), record_time (float32 BE at anchor + 6), trigger/alarm/max_range floats, and project strings. **Anchor: 6-byte `\xbe\x80\x00\x00\x00\x00`**, search `cfg[0:150]`. Total ~2126 cfg bytes. See §7.6.4 for recording_mode enum. | ✅ CONFIRMED 2026-04-02; recording_mode offset corrected 2026-04-21 | +| `2E` | **UNKNOWN READ B** | Read command, response (`D1`) returns 0x1A (26) bytes. Purpose unknown. | 🔶 INFERRED | +| `0E` | **CHANNEL SENSOR DATA** | Real-time sensor reading for one channel. Two-step read, data length 0x0A (10 bytes). Channel selector in params[6:8] (0x0000–0x0007 for 8 channels). Response (F1) carries amplitude, frequency, overswing data for that channel. Used by Blastware "Unit Channel Test" comms check. | ✅ CONFIRMED 2026-04-08 | +| `98` | **TRIGGER TEST** | Trigger-test command. Single probe frame; `params[0] = 0xFF`. Response (0x67) is all-zero data. Sent twice per Blastware comms-check cycle. Not a full POLL, no monitor state change. | ✅ CONFIRMED 2026-04-08 | +| `1C` | **MONITOR STATUS READ** | Two-step read, data offset 0x2C (44 bytes). `section[1] == 0x10` → monitoring; `0x00` → idle (CONFIRMED 2026-04-09, 100% accuracy on 144 frames). Payload length: 46–47 bytes IDLE, 48–49 bytes MONITORING. `frame.data` has checksum stripped — no trailing byte to skip. Battery/memory at end: `section[-10:-8]` = battery×100 (uint16 BE), `section[-8:-4]` = memory_total (uint32 BE), `section[-4:]` = memory_free (uint32 BE). | ✅ CONFIRMED 2026-04-09 | +| `96` | **START MONITORING** | Single write frame, no data payload. Transitions unit from idle to monitoring mode (after optional on-device sensor check ~40 s). | ✅ CONFIRMED 2026-04-08 | +| `97` | **STOP MONITORING** | Single write frame, no data payload. Stops monitoring, unit returns to idle. | ✅ CONFIRMED 2026-04-08 | +| `2C` | **CALL HOME CONFIG READ** | Two-step read, data offset 0x7C (124 bytes + 1-byte DLE artefact = 125 raw bytes). Returns Auto Call Home configuration: enable flag, dial string, scheduled call times, retry settings, modem timing. Response SUB = 0xD3. **DLE note:** logical value 0x03 (num_retries) is returned as `\x10\x03` on the wire, which S3FrameParser preserves as two literal bytes — this shifts all subsequent field positions by +1. See §7.12 for full field map. | ✅ CONFIRMED 2026-04-20 | +| `A3` | **ERASE ALL BEGIN** | Single frame, token=0xFE at params[7]. Initiates device memory erase. Must be followed by 0x1C probe+data + 0x06 probe+data + 0xA2 to complete. Standard `build_bw_frame` (not write-format). Response ack SUB = 0x5C. | ✅ CONFIRMED 2026-04-11 | +| `A2` | **ERASE ALL CONFIRM** | Single frame, token=0xFE at params[7]. Commits the erase initiated by 0xA3. After this ack (SUB 0x5D), device memory is cleared and the event counter resets to `0x01110000`. | ✅ CONFIRMED 2026-04-11 | + +All requests use CMD byte `0x02`. All responses use CMD byte `0x10 0x02` (which, after de-stuffing, is just the DLE+CMD combination — see §3). + +### 5.2 Response SUB Bytes (S3 → Blastware) + +> 🔶 **INFERRED pattern:** Response SUB = `0xFF - Request SUB`. Verified on all observed pairs to date — no counterexample has been observed across read commands, write commands, or either unit. Confidence is high but not formally proven across the full command space. + +| Request SUB | Response SUB | Certainty | +|---|---|---| +| `5B` | `A4` | ✅ CONFIRMED | +| `15` | `EA` | ✅ CONFIRMED | +| `01` | `FE` | ✅ CONFIRMED | +| `08` | `F7` | ✅ CONFIRMED | +| `06` | `F9` | ✅ CONFIRMED 2026-04-11 | +| `1C` | `E3` | ✅ CONFIRMED 2026-04-08 | +| `1E` | `E1` | ✅ CONFIRMED | +| `0A` | `F5` | ✅ CONFIRMED | +| `0C` | `F3` | ✅ CONFIRMED | +| `5A` | `A5` | ✅ CONFIRMED | +| `1F` | `E0` | ✅ CONFIRMED 2026-03-31 | +| `09` | `F6` | ✅ CONFIRMED | +| `1A` | `E5` | ✅ CONFIRMED | +| `2E` | `D1` | ✅ CONFIRMED | +| `0E` | `F1` | ✅ CONFIRMED 2026-04-08 | +| `98` | `67` | ✅ CONFIRMED 2026-04-08 | +| `96` | `69` | ✅ CONFIRMED 2026-04-08 | +| `97` | `68` | ✅ CONFIRMED 2026-04-08 | +| `2C` | `D3` | ✅ CONFIRMED 2026-04-20 | +| `A3` | `5C` | ✅ CONFIRMED 2026-04-11 | +| `A2` | `5D` | ✅ CONFIRMED 2026-04-11 | + +--- + +### 5.3 Write Commands (Blastware → Device) + +> ✅ **CONFIRMED — 2026-02-26** from compliance setup capture (session `185019`); +> framing mechanics confirmed 2026-04-07 from `bridges/captures/3-11-26/raw_bw_*_170151.bin`. + +Write commands are initiated by Blastware (`BW→S3`) and use SUB bytes in the `0x60`–`0x83` range. The device acknowledges each write with a short response frame containing no data payload (17 bytes total wire including framing). + +**Pattern:** Write SUB = Read SUB + `0x60` (e.g. `0x08` EVENT INDEX READ → `0x68` EVENT INDEX WRITE). + +#### Write frame format — minimal DLE stuffing + +Write frames do **NOT** use the full DLE stuffing that read frames do. Only the +`BW_CMD` byte at payload position `[0]` is doubled on the wire — all other bytes +(flags, SUB, offset, params, data, checksum) are written **raw**, even when they +contain `0x10`. See `build_bw_write_frame()` in `minimateplus/framing.py`. + +``` +Wire layout: + [41] ACK + [02] STX + [10 10] BW_CMD doubled (the ONLY DLE stuffing applied) + [00] flags + [SUB] write command byte (0x68–0x83) + [00] always zero + [hi][lo] offset uint16 BE — RAW (not stuffed even if hi=0x10) + [params] 10 bytes — RAW + [data] variable-length write payload — RAW (0x10 bytes not stuffed) + [chk] checksum — RAW (not stuffed even if 0x10) + [03] ETX +``` + +Total wire length = `21 + len(data)` bytes. + +#### Write frame checksum + +All write frames use the **large-frame DLE-aware checksum**: + +```python +chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) & 0xFF +``` + +This sums payload bytes from `SUB` onward, skipping every `0x10` byte, then adds +`0x10` as a constant. The same formula is used for confirm frames (data=`b""`), +since they contain no embedded `0x10` bytes and degrade to the standard SUM8. + +#### Single-chunk write offset formula + +For write payloads that fit in one frame (SUBs `0x68`, `0x69`, `0x82`, `0x7E`): + +``` +offset = data[1] + 2 +``` + +`data[0:2]` is a 2-byte header `[0x00][length]`. The offset on the wire encodes +that embedded length + 2. Confirmed across all single-chunk writes in the +3-11-26 capture (`0x68`: 0x5A, `0x82`: 0x1C, `0x69`: 0xCA, `0x7E`: 0x7E). + +#### Write ack response format + +Every device ack for a write command is a **17-byte zero-data S3 frame**: + +``` +[DLE=0x10] [STX=0x02] [stuffed header + chk] [bare ETX=0x03] +``` + +Data section is zeros; `RSP_SUB = 0xFF − write_request_SUB`. + +#### SUB 71 — multi-chunk compliance write + +The compliance config payload (~2128 bytes) is split into **exactly 3 chunks**. +Confirmed from 3-11-26 BW TX frames 104–108: + +| Chunk | Size | `offset` | `params` (10 bytes hex) | +|---|---|---|---| +| 1 (first) | 1027 bytes | `0x1004` | `00 00 00 00 00 00 00 00 00 00` | +| 2 (middle) | 1055 bytes | `0x1004` | `00 00 00 10 04 00 00 00 00 00` | +| 3 (last) | remainder | `0x002C` | `00 00 08 00 00 00 00 00 00 00` | + +After all three chunks are acked (`0x8E` each), send SUB `72` confirm → device acks `0x8D`. + +#### Full write sequences + +``` +Compliance setup push: 68 → 73 | 71 ×3 → 72 | 82 → 83 | 69 → 74 → 72 +Auto Call Home push: 7E → 7F +``` + +| SUB | Name | Description | Response SUB | Certainty | +|---|---|---|---|---| +| `68` | **EVENT INDEX WRITE** | Writes event index block (mirrors SUB `08` read). Contains event count and timestamps. | `97` | ✅ CONFIRMED | +| `69` | **WAVEFORM DATA WRITE** | Writes large waveform/channel data block (0xCA bytes, mirrors SUB `09`). | `96` | ✅ CONFIRMED | +| `71` | **COMPLIANCE / PROJECT STRINGS WRITE** | Writes compliance config and all project string fields. Contains setup name, project, client, operator, sensor location, and extended notes. Also contains channel scaling floats and `0x082A` threshold value. | `8E` | ✅ CONFIRMED | +| `72` | **WRITE CONFIRM A** | Short frame, no data. Likely commit/confirm step after `71`. | `8D` | ✅ CONFIRMED | +| `73` | **WRITE CONFIRM B** | Short frame, no data. | `8C` | ✅ CONFIRMED | +| `74` | **WRITE CONFIRM C** | Short frame, no data. | `8B` | ✅ CONFIRMED | +| `7E` | **CALL HOME CONFIG WRITE** | Writes Auto Call Home configuration (127 bytes: 125-byte read payload + `\x00\x00`). Offset = data[1]+2 = 0x7E. Write format (DLE-aware checksum, only BW_CMD `0x10` doubled on wire). Response SUB = 0x81. Must be followed by SUB 0x7F confirm. | `81` | ✅ CONFIRMED 2026-04-20 | +| `7F` | **CALL HOME WRITE CONFIRM** | Short frame, no data. Commits call home config write from SUB 0x7E. Response SUB = 0x80. | `80` | ✅ CONFIRMED 2026-04-20 | +| `82` | **TRIGGER CONFIG WRITE** | Writes trigger config block (0x1C bytes, mirrors SUB `1C` read). | `7D` | ✅ CONFIRMED | +| `83` | **TRIGGER WRITE CONFIRM** | Short frame, no data. Likely commit step after `82`. | `7C` | ✅ CONFIRMED | + +**Write response SUB pairs** follow the same `0xFF - request` rule: + +| Write SUB | Response SUB | +|---|---| +| `68` | `97` | +| `69` | `96` | +| `71` | `8E` | +| `72` | `8D` | +| `73` | `8C` | +| `74` | `8B` | +| `7E` | `81` | +| `7F` | `80` | +| `82` | `7D` | +| `83` | `7C` | + +--- + +## 6. Session Startup Sequence + +``` +1. Device powers on / resets +2. S3 → "Operating System" (raw ASCII, no DLE framing — UART boot string) +3. BW → 0x41 + POLL frame (SUB 5B) +4. S3 → 0x41 + POLL RESPONSE (SUB A4, reports data length = 0x30) +5. BW → 0x41 + POLL frame (SUB 5B, offset = 0x30) +6. S3 → 0x41 + POLL RESPONSE with data: "Instantel" + "MiniMate Plus" +7. BW → SUB 15 → serial number +8. BW → SUB 01 → full config block +9. BW → SUB 1A → compliance config (4-frame sequence: A+B+C+D) +10. BW → SUB 08 → event index +11. BW → SUB 06 → event storage range (used during erase verification; see §7.11) +``` + +### 6.1 Event Download Sequence (per-event, confirmed from 4-2-26 + 4-3-26 BW captures) + +``` +# Once per session: +BW → SUB 1E (all-zero params) → key0, trailing0 + +# Per event (repeat until null sentinel data[15:19]=0x00000000): +BW → SUB 0A (key) ← REQUIRED before every 1F; establishes device context +BW → SUB 1E (token=0xFE) ← REQUIRED arm step; must be BETWEEN 0A and 0C +BW → SUB 0C (key) ← read waveform record (peaks, timestamp, project) +BW → SUB 1F (token=0xFE) ← arm 5A state machine; do NOT use returned key +BW → SUB 5B × 3 ← REQUIRED: 3 full POLL probe+data cycles before 5A +BW → SUB 5A (key) ← bulk waveform stream (A5 frames) +# IF 5A succeeded: +BW → SUB 1F (all-zero) → next_key ← use this for loop iteration +# IF 5A failed/timed out: +# Do NOT send 1F(browse) — use cached key from 1F(token=0xFE) above instead +``` + +**Null sentinel:** `data[15:19] == b"\x00\x00\x00\x00"` in both 1E and 1F responses. +Do NOT use `data[11:15]` (key) as sentinel — event 0 has key=0x00000000. + +--- + +## 7. Known Data Payloads + +> 📑 **Navigation note (2026-05-20):** §7 grew organically and contains some +> duplicate section numbers — most notably **§7.5 / §7.5b** (waveform record), +> **§7.6 / §7.7 / §7.8 / §7.9** appear twice each. Sections that re-use a +> number are clearly banner-marked as either DEPRECATED (the old `0x0400`-step +> SUB 5A protocol) or as alternate-context views of the same SUB. **Always +> consult the most recent dated subsection when sections appear to conflict.** +> Canonical SUB 5A walk is in §7.8.5–§7.8.8; canonical compliance config layout +> is in §7.6 / §7.6.1 / §7.6.3 / §7.6.4. + +### 7.1 Poll Response (SUB A4) — Device Identity Block / Composite Container + +> ⚠️ **SUB A4 is a composite container frame.** The large A4 payload (~3600+ bytes) contains multiple embedded inner sub-frames using the same DLE framing as the outer protocol (`10 02` start, `10 03` end, `10 10` stuffing). Inner frames carry WRITE_CONFIRM_RESPONSE and TRIGGER_CONFIG_RESPONSE sub-frames among others. Flat byte-by-byte diffing of A4 is unreliable due to phase shifting — use inner-frame-aware diffing (`_diff_a4_payloads()` in s3_analyzer.py). Confirmed 2026-03-11. + +Two-step read. Data payload = 0x30 bytes. + +``` +Offset 0x00: 0x08 — string length prefix +Offset 0x01: "Instantel" — manufacturer (null-padded to ~20 bytes) +Offset 0x15: "MiniMate Plus" — model name (null-padded to ~20 bytes) +``` + +Raw payload (after de-stuffing): +``` +00 00 00 08 49 6E 73 74 61 6E 74 65 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 +4D 69 6E 69 4D 61 74 65 20 50 6C 75 73 00 00 00 00 00 00 00 00 00 +``` + +### 7.2 Serial Number Response (SUB EA) + +Data payload = 0x0A bytes: +``` +"BE18189\x00" — 7 ASCII bytes + null terminator (8 bytes) +79 11 — 2 trailing bytes +``` + +| Trailing Byte | Value (Unit 1) | Value (Unit 2) | Meaning | Certainty | +|---|---|---|---|---| +| `trail[0]` | `0x79` | `0x70` | Unit-specific — factory calibration ID or HW stamp? | ❓ SPECULATIVE | +| `trail[1]` | `0x11` | `0x11` | Firmware minor version — `0x11` = 17 = `S337.**17**` | ✅ CONFIRMED — 2026-02-26 | + +Two-unit comparison data: +``` +Unit 1: serial="BE18189" trail=79 11 firmware=S337.17 +Unit 2: serial="BE11529" trail=70 11 firmware=S337.17 +``` + +> ✅ **2026-02-26 — CORRECTED:** Previously documented as `79 11 20` (3 bytes). `0x20` is the **frame checksum**, not payload data. Actual data block is exactly 10 bytes (`0x0A`). + +> ✅ **2026-02-26 — CONFIRMED:** `trail[1]` = firmware minor version. Both units share firmware `S337.17` → minor = 17 = `0x11`. Will change if firmware differs between units. + +> ❓ **Still unknown:** `trail[0]` is unit-specific. Does not derive from serial string via sum, XOR, or modulo. Possibly written at factory calibration. Needs a third unit or write-command capture to determine. + +> ⚠ **2026-10-25 — AMENDED (measured, BE9441).** The 8-byte serial field is a **C string, not null-padded**. A six-character serial leaves a stray byte after its terminator: BE9441 sends `42 45 39 34 34 31 00 3f` = `"BE9441\x00?"`. Stripping trailing NULs alone keeps the `?`; cut at the first NUL. Every unit seen before had a seven-character serial, which fills the field exactly to the terminator. + +### 7.3 Full Config Response (SUB FE) — 0x98 bytes + +| Offset | Raw | Decoded | Certainty | +|---|---|---|---| +| 0x00 | `42 45 31 38 31 38 39 00` | `"BE18189\x00"` — Serial number | ✅ CONFIRMED | +| 0x08 | `79 11` | Unknown — possibly HW revision or calibration stamp | ❓ SPECULATIVE | +| 0x0A | `00 01` | Unknown flags | ❓ SPECULATIVE | +| 0x14 | `3F 80 00 00` | IEEE 754 float = **1.0** (Tran scale factor) | 🔶 INFERRED | +| 0x18 | `41 00 00 00` | IEEE 754 float = **8.0** (unknown — MicL range?) | 🔶 INFERRED | +| 0x1C | `3F 80 00 00` ×6 | IEEE 754 float = **1.0** ×6 (remaining channel scales) | 🔶 INFERRED | +| 0x34 | `53 33 33 37 2E 31 37 00` | `"S337.17\x00"` — Firmware version | ✅ CONFIRMED | +| 0x3C | `31 30 2E 37 32 00` | `"10.72\x00"` — DSP / secondary firmware version | ✅ CONFIRMED | +| 0x53 | varies | Likely calibration day or time field — 0x15 (BE18189), 0x1D (BE11529) | 🔶 INFERRED | +| 0x54 | `10` | Calibration month — BCD `0x10` = October (both units) | 🔶 INFERRED | +| 0x55 | varies | Calibration day — `0x02` (BE18189), `0x04` (BE11529) | 🔶 INFERRED | +| 0x56–0x57 | `07 E7` / `07 E9` | Calibration year — uint16 BE. `0x07E7`=2023, `0x07E9`=2025 | ✅ CONFIRMED — 2026-03-31 | +| 0x44 | `49 6E 73 74 61 6E 74 65 6C...` | `"Instantel"` — Manufacturer (repeated) | ✅ CONFIRMED | +| 0x6D | `4D 69 6E 69 4D 61 74 65 20 50 6C 75 73` | `"MiniMate Plus"` — Model name | ✅ CONFIRMED | + +### 7.4 Event Index Response (SUB F7) — 0x58 bytes + +> ✅ **2026-03-02 — CONFIRMED:** Backlight and power save offsets confirmed via two independent captures with device-set values. Offsets are from the start of the **data section** (after the 16-byte protocol header). + +**Layout (offsets relative to data section start):** + +``` +Offset +00: 00 58 09 — Total index size or record count ❓ +Offset +03: 00 00 00 01 — Possibly stored event count = 1 ❓ +Offset +07: 01 07 CB 00 06 1E — Timestamp of event 1 (see §8) +Offset +0D: 01 07 CB 00 14 00 — Timestamp of event 2 (see §8) +Offset +13: 00 00 00 17 3B — Unknown ❓ +Offset +4B: [backlight] — BACKLIGHT ON TIME ✅ CONFIRMED +Offset +4C: 00 — padding (backlight is uint8, not uint16) +Offset +53: [power_save] — POWER SAVING TIMEOUT ✅ CONFIRMED +Offset +54: [lcd_hi] [lcd_lo] — MONITORING LCD CYCLE (uint16 BE) ✅ CONFIRMED +``` + +| Offset | Size | Type | Known values | Meaning | Certainty | +|---|---|---|---|---|---| +| +4B | 1 | uint8 | 250, 100 | **BACKLIGHT ON TIME** (0–255 seconds per manual) | ✅ CONFIRMED | +| +4C | 1 | — | 0x00 | Padding / high byte of potential uint16 | 🔶 INFERRED | +| +53 | 1 | uint8 | 10, 30 | **POWER SAVING TIMEOUT** (minutes) | ✅ CONFIRMED | +| +54..+55 | 2 | uint16 BE | 0xFFDC = 65500 | **MONITORING LCD CYCLE** (seconds; 65500 ≈ disabled/max) | ✅ CONFIRMED | + +**Confirmation captures:** + +| Capture | Backlight (+4B) | Power Save (+53) | LCD Cycle (+54/55) | +|---|---|---|---| +| `20260301_160702` (BW-written) | `0xFA` = 250 | `0x0A` = 10 min | `0xFF 0xDC` = 65500 | +| `20260302_144606` (device-set) | `0x64` = 100 | `0x1E` = 30 min | `0xFF 0xDC` = 65500 | + +> 📖 **Manual cross-reference (716U0101 Rev 15, §3.13.1):** +> - Backlight On Time: "adjustable timer, from 0 to 255 seconds" (§3.13.1e) +> - Power Saving Timeout: "automatically turns the Minimate Plus off" — stored in minutes (§3.13.1f) +> - Monitoring LCD Cycle: "cycles off for the time period... set to zero to turn off" — 65500 = effectively disabled (§3.13.1g) + +### 7.5 Full Waveform Record (SUB F3) — 0xD2 bytes × 2 pages + +> ✅ **2026-02-26 — UPDATED:** Project strings field layout confirmed by diffing compliance setup write payload (SUB `71`). Client field change `"Hello Claude"` → `"Claude test2"` isolated exact byte position. + +**Project strings field layout** (confirmed from SUB `71` write frame, offset +230 from frame start): + +``` +Offset Field label (null-padded, ~16 bytes) Field value (null-padded, ~32 bytes) +------ ------------------------------------ ------------------------------------ ++0x00 "Standard Recording Setup" ← setup name (no label) ++0x28 "Project:" project description string ++0x50 "Client:" client name string ← confirmed at +230 ++0x78 "User Name:" operator name string ++0xA0 "Seis Loc:" sensor location string ++0xC8 "Extended Notes" notes string +``` + +> 🔶 Offsets are approximate — exact byte boundaries need one more targeted capture with a known-length string change to pin down padding rules. + +Confirmed ASCII strings extracted from payload: + +``` +"Project:" +"I-70 at SR 51-75978 - Loc 1 - 4256 SR51 " ← project description +"BE18189" ← serial number +"Histogram" ← record type +"Standard Recording Setup" ← setup name +"Client:" +"Golden Triangle" ← client name +"User Name:" +"Terra-Mechanics Inc. - B. Harrison" ← operator +"Seis Loc:" +"Location #1 - 4256 SR 51 - Intec" ← sensor location +"Extended Notes" +"Tran" ← Transverse channel +"Vert" ← Vertical channel +"Long" ← Longitudinal channel +"MicL" ← Microphone / air overpressure +``` + +### 7.6 Channel Config Float Layout (SUB E5 / SUB 71) + +> ✅ **CONFIRMED — 2026-03-01** from controlled captures (sessions `193237` and `151147`). Trigger changed `0.500 → 0.200`, then `0.200 → 0.600`. Alarm changed `1.0 → 2.0`. All positions confirmed. + +The SUB `1A` read response (`E5`) and SUB `71` write block contain per-channel threshold and scaling values packed as **IEEE 754 big-endian floats**, with inline unit strings. This layout repeats **once per geophone channel** (Tran, Vert, Long — 3×): + +``` +[00 00] [max_range float] [00 00] [trigger float] ["in.\0"] [alarm float] ["/s\0\0"] [00 01] [chan_label...] + 40 C6 97 FD 3F 19 99 9A 69 6E 2E 40 00 00 00 2F 73 00 00 + = 6.206 = 0.600 in/s "in." = 2.000 in/s "/s" +``` + +| Field | Example bytes | Decoded | Certainty | +|---|---|---|---| +| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | +| ADC scale factor | `40 C6 97 FD` | **6.206053 (in/s)/V — CONFIRMED 2026-04-17.** This is the inverse sensitivity of the standard Instantel geophone = 1/0.161133. Interface Handbook §4.5: `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Used by firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant — do NOT write. Offset = **channel_label + 28** (same in E5 read and SUB 71 write). | ✅ CONFIRMED | +| `[00 00]` | `00 00` | Separator / padding | 🔶 INFERRED | +| **Trigger level** | `3F 19 99 9A` | **0.600 in/s** — IEEE 754 BE float | ✅ CONFIRMED | +| Unit string | `69 6E 2E 00` | `"in.\0"` | ✅ CONFIRMED | +| **Alarm level** | `40 00 00 00` | **2.000 in/s** — IEEE 754 BE float | ✅ CONFIRMED | +| Unit string | `2F 73 00 00` | `"/s\0\0"` | ✅ CONFIRMED | +| `[00 01]` | `00 01` | Unknown flag / separator | 🔶 INFERRED | +| Channel label | e.g. `56 65 72 74` | `"Vert"` — identifies which channel | ✅ CONFIRMED | +| **Geo range (sensitivity selector)** | `00` or `01` | **uint8** — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. Offset = **channel_label + 33** (same in E5 read and SUB 71 write). Applied to all three geo channel blocks (Tran/Vert/Long). **Note: `channel_label + 20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | ✅ CONFIRMED 2026-04-20 | + +**State transitions observed across captures:** + +| Capture | Trigger | Alarm | Notes | +|---|---|---|---| +| `193237` (read) | `3F000000` = 0.500 | `3F800000` = 1.000 | Device state before any change | +| `193237` (write 1) | `3E4CCCCD` = 0.200 | `3F800000` = 1.000 | Trigger changed only | +| `151147` (write 1) | `3E4CCCCD` = 0.200 | `40000000` = 2.000 | Alarm changed, trigger carried over | +| `151147` (write 2) | `3F19999A` = 0.600 | `40000000` = 2.000 | Trigger changed, alarm carried over | + +Values are stored natively in **imperial units (in/s)** — unit strings `"in."` and `"/s"` embedded inline confirm this regardless of display locale. + +### 7.6.1 Record Time + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Anchor convention +> updated 2026-04-21 — search for the 6-byte stable anchor, not the 10-byte form. + +Record time is stored as a **32-bit IEEE 754 float, big-endian**, located via an +anchor pattern (see §7.6.3 / §7.6.4 for the rest of the anchor-relative fields). + +**Anchor:** search for the 6-byte sequence `\xbe\x80\x00\x00\x00\x00` in +`cfg[0:150]`. **Record time is at anchor + 6** (i.e. 6 bytes past the start of +the anchor). + +> ⚠️ **The earlier "10-byte anchor" form `\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` +> is NOT stable.** Its leading two bytes `\x01\x2c` (= 300) are the +> `histogram_interval_sec` field, which changes when the histogram interval is +> reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant. +> Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`. + +> 🔶 **2026-10-17 — the 6-byte suffix may not be constant either (INFERRED from Series IV).** +> On a Micromate the same position holds `[pre-trigger f32 BE, negative seconds][record stop mode]`, +> measured setting by setting: `be 80 00 00` = −0.25 s, and `00 00` = Fixed (Auto reads `00 01`). +> Every S3 unit this anchor was confirmed on would have been at those defaults. If S3 shares the layout, +> a unit in **Record Stop Mode = Auto** returns `be 80 00 00 00 01`, `find()` returns −1, and the four +> anchor-relative fields silently go undecoded. **Not yet measured on S3** — one BW capture in Auto +> mode settles it. Until then, treat a missing anchor as this, not as DLE jitter. + +> ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the +> compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental +> header padding is gone and the anchor now appears at `cfg[11]`. Search range +> widened to `cfg[0:150]`. + +| Record Time | float32 BE bytes | Decoded | +|---|---|---| +| 3 seconds | `40 40 00 00` | 3.0 | +| 5 seconds | `40 A0 00 00` | 5.0 | +| 7 seconds | `40 E0 00 00` | 7.0 | +| 8 seconds | `41 00 00 00` | 8.0 | +| 10 seconds | `41 20 00 00` | 10.0 | +| 13 seconds | `41 50 00 00` | 13.0 | + +**⚠️ Do NOT use absolute offset `+0x28` from page2 start for BE11529.** The total cfg length varies by ±1 byte depending on sample rate setting (see §7.6.3 DLE jitter note). Absolute offsets are unreliable; anchor search is the correct approach. + +**`0x0A` after "Extended Notes" label:** invariant across record time changes — not record time. + +> ✅ **`0x082A` (= 2090) — RESOLVED:** Fixed payload length of the E5 response block. Constant regardless of any setting. + +--- + +### 7.6.2 SUB 1A Multi-Frame Read Protocol + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Reverse-engineered from `raw_bw_20260311_155355.bin` (Blastware TX capture). + +SUB 1A (compliance config read) requires **four frames**, not the standard 2-step probe+fetch used by other SUBs. The Blastware TX frame format for these is ACK (`0x41`) + STX (`0x02`) + [DLE-stuffed body] + ETX (`0x03`) with CMD=`0x10`. + +**Frame sequence:** + +| Step | Name | BW offset param | Notes | +|---|---|---|---| +| A | Probe | `0x0000` | Triggers E5 response with page_key=`0x0000` (44-byte header) | +| B | Data B | `0x0400` | params: `00 00 00 00 00 00 00 64 00 00`; E5 page_key=`0x0000` (44 bytes) | +| C | Data C | `0x0400` | params: `00 00 04 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1027 bytes) | +| D | Data D | `0x002A` | params: `00 00 08 00 00 00 00 64 00 00`; E5 page_key=`0x0010` (~1055 bytes, or 0x0000/44 bytes when BE11529 sends a duplicate) | + +**E5 response `page_key` field:** bytes `data[3:5]` of the E5 payload. `0x0000` = header/short chunk, `0x0010` = main config data. + +**Assembling cfg:** concatenate non-duplicate chunks in order (B+C+D). Track `(page_key, chunk_len)` pairs; drop any repeat to avoid mis-alignment. + +**Expected cfg lengths:** +- Frame D delivers page `0x0010` correctly: **44 + 1027 + 1055 = 2126 bytes** +- Frame D duplicates page `0x0000` (BE11529 occasional): **44 + 1027 = 1071 bytes** (still fully decodable) + +--- + +### 7.6.3 Sample Rate and DLE Jitter + +> ✅ **CONFIRMED — 2026-04-01** (BE11529 / firmware S338.17). Validated across +> Normal (1024), Fast (2048), and Faster (4096) modes. + +**Location:** `uint16 BE` at **anchor − 6**, using the 6-byte stable anchor +`\xbe\x80\x00\x00\x00\x00` searched in `cfg[0:150]`. + +| Device Mode | uint16 BE value | Sa/s | +|---|---|---| +| Normal | `04 00` | 1024 | +| Fast | `08 00` | 2048 | +| Faster | `10 00` | 4096 | + +**DLE jitter (critical — explains the ±1 byte cfg length variation):** + +The sample rate bytes sit a few bytes before the anchor in the raw S3 frame. +For "Faster" mode (4096 = `0x1000`), the high byte `0x10` is itself a DLE +character and was historically escaped on the wire as `10 10`. After DLE +unstuffing: `10 10 00` → `10 00` (2 bytes). For Normal/Fast modes (high byte = +`0x04` / `0x08`), no escaping needed and the payload stays 3 bytes. Result: +"Faster" mode can produce a cfg that is **1 byte shorter** than Normal/Fast, +shifting any absolute offset by −1. + +**Why anchor search is required:** any decoder that uses fixed absolute offsets +for record_time or sample_rate will produce garbage values when the device is +set to "Faster" mode. The 6-byte anchor (start of the alarm-level floats +`\xbe\x80\x00\x00\x00\x00`) is past the DLE-affected bytes and is unaffected by +this shift. + +--- + +### 7.6.4 Recording Mode + +> ✅ **CONFIRMED — 2026-04-20** (BE11529 / firmware S338.17); offsets corrected +> 2026-04-21 after a write-cycle drift bug was traced to writing to the wrong +> byte. **`recording_mode` is at `anchor − 8` for BOTH read and write.** + +Recording mode is a **uint8** stored at a fixed anchor-relative position (using +the 6-byte stable anchor `\xbe\x80\x00\x00\x00\x00`): + +| Enum | Mode | +|---|---| +| `0x00` | Single Shot | +| `0x01` | Continuous | +| `0x02` | Unknown (not yet observed) | +| `0x03` | Histogram | +| `0x04` | Histogram + Continuous (combined mode) | + +**Layout around the anchor (same in E5 read response and SUB 71 write payload):** + +``` +buf[anchor − 9] = mode_prefix (uint8; 0x00 for Single Shot/Continuous, + 0x10 for Histogram (DLE prefix in E5 wire + encoding of 0x03) and for Histogram+Continuous + (actual stored byte)) +buf[anchor − 8] = recording_mode (uint8) ← SAME OFFSET IN READ AND WRITE +buf[anchor − 7] = 0x10 (constant; part of the sample-rate field area; + do NOT overwrite — see warning below) +buf[anchor − 6] = sample_rate_hi (uint8, MSB of uint16 BE) +buf[anchor − 5] = sample_rate_lo (uint8, LSB of uint16 BE) +buf[anchor − 4 : anchor − 2] = histogram_interval_sec (uint16 BE, seconds; + mode-gated to Histogram) +buf[anchor − 2 : anchor] = 0x00 0x00 (padding) +buf[anchor : anchor + 6] = \xbe\x80\x00\x00\x00\x00 (anchor) +buf[anchor + 6 : anchor + 10] = record_time (float32 BE) +``` + +> ⚠️ **Do NOT write to `anchor − 7`.** The byte there is a DLE marker that the +> device firmware re-generates on every read. Writing to it shifts the anchor +> position by +1 on every subsequent read, drifting compliance config offsets +> indefinitely. The CLAUDE.md note "write to anchor-7" was a known mistake — +> see the `_encode_compliance_config` comment block in `client.py:2062–2068`. + +**`compliance_raw` DLE encoding:** + +`compliance_raw` returned by `read_compliance_config()` is NOT purely logical +bytes — it is the wire-encoded payload where any logical `0x03` byte appears as +the literal pair `\x10\x03` (preserved by `S3FrameParser` as inner-frame +literal data). Consequences: + +- For `recording_mode = 0x03` (Histogram), `compliance_raw[anc − 9] = 0x10` + (the DLE prefix from the wire encoding of `0x03`) and + `compliance_raw[anc − 8] = 0x03` (the actual value). +- For Histogram + Continuous (`0x04`), `compliance_raw[anc − 9] = 0x10` is an + actual stored config byte (not a DLE prefix). +- The 6-byte anchor search (`buf.find(b'\xbe\x80...', 0, 150)`) locates the + anchor correctly regardless of these mode-dependent shifts. +- When SFM writes `recording_mode` and round-trips the rest verbatim, the byte + at `anc − 9` is preserved from the previous read. Transitioning + Histogram → other modes via SFM may leave a `0x10` at `anc − 9` — the device + stores it as a literal byte; it does not affect recording-mode operation + (which is at `anc − 8`) but is one byte different from what BW writes. + +**Decode path (`_decode_compliance_config_into`):** `data[anchor_pos − 8]`. +**Encode path (`_encode_compliance_config`):** `buf[anchor_pos − 8] = recording_mode`. + +--- + +### 7.7 Blastware `.set` File Format + +> 🔶 **INFERRED — 2026-03-01** from `Standard_Recording_Setup.set` cross-referenced against known wire payloads. + +Blastware's "save setup to disk" feature produces a binary `.set` file that is structurally identical to the wire protocol payload, but with **all multi-byte values in little-endian byte order** (Windows-native) rather than the big-endian order used on the wire. No DLE framing, no checksums — raw struct dump. + +**File layout (2522 bytes observed):** + +``` +0x0000 Header / metadata block (~40 bytes) — partially decoded +0x002A "Standard Recording Setup.set\0" — setup filename, null-padded +0x0078 Project strings block — same layout as SUB 71 wire payload + "Project:\0" + value, "Client:\0" + value, "User Name:\0" + value, + "Seis Loc:\0" + value, "Extended Notes\0" + value +0x06A0 Channel records block — one record per channel (geo×3 + mic×1 + duplicates) +0x0820 Device info block — serial number, firmware, model strings +0x08C0 Event index / timestamp block +0x0910 Histogram / reporting config +0x09D0 Trailer (10 bytes) +``` + +**Per-channel record layout (little-endian, ~46 bytes per channel):** + +``` +offset size type value (Tran example) meaning ++00 2 uint16 0x0001 channel type (1=geophone, 0=mic) ++02 4 char[4] "Tran" channel label ++06 2 uint16 0x0000 padding ++08 2 uint16 0x0001 unknown ++0A 2 uint16 0x0050 = 80 unknown (sensitivity? gain?) ++0C 2 uint16 0x000F = 15 unknown ++0E 2 uint16 0x0028 = 40 unknown ++10 2 uint16 0x0015 = 21 unknown ++12 4 bytes 03 02 04 01 flags (recording mode etc.) ++16 4 uint32 0x00000003 record time in seconds ✅ CONFIRMED ++1A 4 float32 6.206053 ✅ CONFIRMED 2026-04-17 — ADC-to-velocity scale factor (= 1/sensitivity = (in/s)/V). Interface Handbook §4.5: Range = 1.61133 V × 6.206053 = 10.000 in/s (Normal range). Firmware uses: PPV (in/s) = ADC_voltage × 6.206053. Hardware constant — identical on all tested units. Do NOT write. ++1E 2 00 00 padding ++20 4 float32 0.6000 trigger level ✅ CONFIRMED ++24 4 char[4] "in.\0" / "psi\0" unit string (geo vs mic) ++28 4 float32 2.0000 alarm level ✅ CONFIRMED ++2C 4 char[4] "/s\0\0" / varies unit string 2 +``` + +**MicL channel differences:** +- `channel_type` = 0 (vs 1 for geophones) +- trigger = 0.009, alarm = 0.021 (in psi) +- unit string = `"psi\0"` instead of `"in.\0"` — **confirms MicL units are psi** ✅ + +**Endianness summary:** + +| Context | Byte order | Example (0.6 in/s trigger) | +|---|---|---| +| `.set` file | Little-endian | `9A 99 19 3F` | +| Wire protocol (SUB 71 / E5) | Big-endian | `3F 19 99 9A` | + +> ❓ **`0x082A`** — still unidentified. Record time in the `.set` file = `0x00000003` (3 sec), which would be `00 00 00 03` on wire — not `0x082A`. The original sessions had record time = 2, which would be `00 00 00 02`. `0x082A` = 2090 doesn't match any obvious record time encoding. May correspond to one of the unknown uint16 fields at +0A through +10. A capture changing sample rate or histogram interval would help isolate it. + +--- + +### 7.8 Trigger / Advanced Config Write Frame (BW→S3 SUB `0x82`) + +> ✅ **CONFIRMED — 2026-03-09** from controlled BW-side capture diff (Trigger Sample Width 4→3). + +SUB `0x82` is the BW→S3 write command for the advanced trigger configuration block. It is the write counterpart to the S3→BW read response SUB `0xD1` (0xFF − 0x82 = 0x7D is a separate sub; the D1/2E read pair is distinct). The `0x82` write frame is only visible in `raw_bw.bin` — it does not appear in S3-side compliance dumps. + +**Destuffed BW write frame layout (47 raw bytes → 46 destuffed):** + +``` +offset value meaning +[00] 0x10 addr (literal 0x10 after destuffing) +[01] 0x00 unknown +[02] 0x82 SUB: advanced config write +[03] 0x00 unknown +[04] 0x00 unknown +[05] 0x1C length = 28 bytes (payload size) +[06..10] 00.. header/padding +[11..16] 00.. header/padding +[17] 0x1A unknown (constant 26 = 0x1A) +[18] 0xD5 unknown (constant) +[19] 0x00 unknown +[20] 0x00 unknown +[21] 0x10 literal 0x10 (stuffed in raw frame as 10 10) +[22] 0x04/0x03 Trigger Sample Width ✅ CONFIRMED (uint8, samples) +[23] 0x0A unknown (constant 10; NOT Auto Window) +[24..43] 0xFF.. padding +[44] 0x00 unknown +[45] checksum +``` + +**Confirmed Trigger Sample Width values:** + +| Width setting | Byte [22] | +|---|---| +| 4 samples | `0x04` | +| 3 samples | `0x03` | +| 2 samples (default) | `0x02` (expected — not yet captured) | + +**Known constants in this frame:** `[17]=0x1A`, `[18]=0xD5`, `[23]=0x0A`. These do not change with Trigger Sample Width changes. Byte `[23]` = 10 was initially a candidate for Auto Window (range 1–9) but cannot be Auto Window because 10 is outside the valid range. + +**Mode gating:** This write frame is only transmitted when Blastware performs a Send To Unit operation in Compliance / Single-Shot / Fixed Record Time mode. The frame is absent from other session types. + +--- + +### 7.9 Mode Gating — Protocol Architecture Note + +> ✅ **CONFIRMED — 2026-03-09** from controlled captures and null-change experiments. + +Several settings are **mode-gated**: the device only transmits (reads) or accepts (writes) certain fields when the appropriate operating mode is active. This is an architectural property of the protocol, not a gap in capture methodology. + +**Observed mode gating:** + +| Setting | Gate Condition | Evidence | +|---|---|---| +| Trigger Sample Width | Compliance / Single-Shot / Fixed Record Time mode | Not visible in S3-side reads; only in BW write frame (SUB `0x82`) when mode is active | +| Auto Window | Record Stop Mode = Auto | Capture of 3→9 change in Fixed mode produced zero wire change in all frames (F7, D1, E5 all identical) | + +**Implication for captures:** To map a mode-gated setting, you must first activate the gating mode on the device, then perform the compliance dump or write capture. Changing the setting value while in the wrong mode will produce no observable wire change. + +**Suspected mode-gated settings not yet captured:** +- Auto Window (requires Record Stop Mode = Auto) +- Auxiliary Trigger (unknown gate condition) + +--- + +### 7.5b Full Waveform Record (SUB F3) — 0xD2 bytes (210 bytes) + +> ✅ **Updated 2026-03-31** — Full layout confirmed. See §7.7.5 for the +> complete record structure including timestamp, record type, PPV float +> positions, and project strings. +> Section number changed to `7.5b` 2026-05-20 to disambiguate from §7.5 above. + +Peak values are found by searching for channel label strings `"Tran"`, +`"Vert"`, `"Long"`, `"MicL"` and reading `float32 BE` at `label_offset + 6`. +The floats are **not 4-byte aligned** — confirmed from 3-31-26 capture. + +Example peak values (event 1 from 3-31-26): +``` +Tran: 3D BB 45 7A = 0.0916 in/s +Vert: 3D B9 56 E1 = 0.0907 in/s +Long: 3D 75 C2 7C = 0.0605 in/s +MicL: 39 BE 18 B8 = 0.000145 psi ✅ units confirmed +``` + +Example peak values (event 2 from earlier capture): +``` +Tran: 3D 56 CB B9 = 0.0521 in/s +Vert: 3C F5 C2 7C = 0.0300 in/s +Long: 3C F5 C2 7C = 0.0300 in/s +MicL: 39 64 1D AA = 0.0000875 psi +``` + +> ⚠️ The record is delivered as `data_rsp.data[11:11+0xD2]` — the outer +> data section header (LENGTH_ECHO, KEY_ECHO) occupies data[0..10]. +> Callers of `read_waveform_record()` receive the 210-byte record directly. + +### 7.6 Bulk Waveform Stream (SUB A5) — Raw ADC Sample Records + +> ⛔ **§7.6 below describes the deprecated `0x0400`-step walk and is RETAINED FOR HISTORICAL CONTEXT ONLY.** +> The "A5[7] is metadata", "A5[9] is terminator", and chunk-counter frame-index claims in this section +> are all artifacts of the broken walk that was overrunning past event end by ~5×. +> +> **For the corrected protocol (v0.14.0+), use:** +> - **§7.8.5** — chunk addressing (probe at `start_offset`, samples step 0x0200, bounded by STRT `end_offset`) +> - **§7.8.6** — TERM frame formula +> - **§7.8.7** — fixed metadata pages 0x1002 / 0x1004 (this is where Project / Client / User Name / Seis Loc +> strings actually live — NOT in any sample-chunk frame) +> - **§7.8.8** — multi-event "Download All" sequence +> +> The waveform sample encoding described in §7.6.1 below (4-channel interleaved s16 LE, 8 bytes +> per sample-set) is **NOT actually verified** — see the retraction note at the top of §7.6.1. +> The frame-indexing claims and metadata-source claims in §7.6 are also wrong; use §7.8.5–§7.8.8. + +**Two distinct formats exist depending on recording mode. Both confirmed from captures.** + +--- + +#### 7.6.1 Blast / Waveform mode — 🟡 PARTIAL DECODE (2026-05-11) + +> ### 📌 CURRENT STATUS — read this first +> +> The body codec is **partially decoded** as of 2026-05-11. This +> section contains both current-truth spec AND historical retractions; +> when in doubt, the working summary lives at +> `docs/waveform_codec_re_status.md`. +> +> | Item | Status | +> |---|---| +> | Body has tagged variable-length blocks, NOT raw int16 LE | ✅ confirmed | +> | 5 block tag types (10/20/00/30/40 NN) with lengths | ✅ confirmed | +> | 7-byte preamble: `00 02 00` + Tran[0] + Tran[1] int16 BE | ✅ confirmed | +> | `00 NN` = RLE for zero deltas in the current channel | ✅ confirmed | +> | Tran channel, segment 0 (~482-510 samples / event) | ✅ byte-exact, 5/5 events | +> | Multi-segment Tran continuation | ❌ open (breaks at sample ~512) | +> | Vert / Long / MicL channel decoders | ❌ open | +> | `30 NN` block content (loud-from-start events) | ❌ open | +> | Earlier "raw int16 LE, 8 bytes per sample-set" claim | ❌ REFUTED | +> +> **Production code in `client.py:_decode_a5_waveform` still uses the +> broken int16 LE decoder.** The `.h5` sidecars SFM produces contain +> wrong sample values and must be treated as "unverified" downstream. +> The BW binary write path is unaffected (it's pure passthrough of the +> device's flash bytes, no decoding) and remains byte-perfect. + +The "4-channel interleaved s16 LE, 8 bytes per sample-set" claim that +appeared in earlier revisions of this section was never validated and +was wrong. No event in the project's archive ever came close to ADC +saturation, yet the int16 LE decoder consistently produced full-scale +±32K noise — that was the signature of mis-aligned encoded data, not +signal saturation. + +##### Body file layout + +A Blastware waveform-file body (the variable-length section between +the 21-byte STRT record and the 26-byte file footer) is composed of +**tagged variable-length blocks**, NOT raw int16 samples. + +``` +[preamble: 7 or 9 bytes] +[stream of tagged blocks] +[trailer: per-channel summary blocks] +``` + +**Preamble (CONFIRMED 2026-05-11 across 3+4 events):** + +``` +body[0:3] = 00 02 00 magic +body[3:5] = Tran[0] int16 BE first Tran sample (LSB = 0.005 in/s) +body[5:7] = Tran[1] int16 BE second Tran sample +``` + +The preamble is therefore 7 bytes long. Earlier observations of a +"9-byte preamble" on continuous-mode events were a misread — those +events still have a 7-byte preamble; the next 2 bytes are part of the +first ``10 NN`` or ``20 NN`` data block (its tag). + +Verified preamble decode for all 7 fixture events — Tran[0] and Tran[1] +from the preamble bytes exactly match the BW ASCII export (rounded to +0.005 in/s): + +| Event | Preamble [3:7] (hex) | T[0] decoded | T[0] truth | T[1] decoded | T[1] truth | +|---|---|---|---|---|---| +| event-a (May 8) | ``01 00 00 00`` | +1 | +1 (0.005) | 0 | 0 | +| event-b (May 8) | ``ff ff ff 00`` | -1 | -1 | -1 | -1 | +| event-c (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | +| event-d (May 8) | ``00 00 00 00`` | 0 | 0 | 0 | 0 | +| SP0 (May 11) | ``00 04 00 04`` | +4 | +4 (0.020) | +4 | +4 | +| SS0 (May 11) | ``ff a7 ff a7`` | -89 | -89 (-0.445) | -89 | -89 | +| SV0 (May 11) | ``fd 17 fd 06`` | -745 | -745 (-3.725) | -762 | -762 | + +##### Block tags (CONFIRMED 2026-05-08) + +Every block starts with a 2-byte tag. Five tag types are confirmed: + +| Tag (hex) | Block type | On-wire length | +|-----------|-------------------------------------|-----------------------| +| ``10 NN`` | Small-delta data block | NN/2 + 2 bytes | +| ``20 NN`` | Literal data block (int8-shaped) | NN + 2 bytes | +| ``00 NN`` | RLE zero-delta run | 2 bytes | +| ``30 NN`` | Trailer summary block | NN × 4 bytes | +| ``40 NN`` | Segment header | 2 × NN + 16 bytes | + +NN is always a multiple of 4. ``10 NN`` and ``20 NN`` data blocks +alternate with ``00 NN`` markers — every ``10/20 NN`` block is +followed by a ``00 NN`` marker before the next data block. + +###### Wide-NN forms — ``0X NN`` (CONFIRMED 2026-08-25) + +The 12-bit wide-NN encoding already documented for ``1X NN`` / +``2X NN`` (low nibble of the tag byte carries the high nibble of NN, +so effective ``NN = ((tag & 0x0F) << 8) | NN``) **also applies to the +``00 NN`` RLE tag.** A narrow RLE run maxes out at NN = 0xFC, so a +quiet stretch longer than 252 samples must use the wide form. + +Confirmed against six production events, e.g. ``01 0c`` (NN = 268) in +``BE9558/K558LKOF.460W``. Before this was handled, the walker hit its +unknown-tag break at the first long quiet run and silently truncated +every channel decoded after that point. + +###### ``30 NN`` is not capped at NN = 0x10 (CONFIRMED 2026-08-25) + +Data-section ``30 NN`` blocks occur with NN up to at least 0x18 (24), +e.g. ``30 18`` in ``BE18193/T193LQ45.NN0W`` and ``30 14`` in +``BE18193/T193LQ9W.AF0W``. The data-section length formula +(``NN × 1.5 + 2``) holds for these; only the earlier ``NN ≤ 0x10`` +guard was wrong. + +###### ``40 NN`` segment headers are variable width (CONFIRMED 2026-08-25) + +``40 02`` is the common case, but **NN is the count of int16 BE +continuation deltas the header carries for the *previous* channel**, so +the header grows with NN and every field after the deltas shifts by +``2 × NN``: + +``` +length = 2 (tag) + 2 × NN (prev-channel deltas) + 14 (fixed tail) +``` + +``40 01`` (18 bytes) and ``40 03`` (22 bytes) both occur in production +files — see ``BE12599/N599LP1S.UO0W`` and ``BE18438/T438LO30.GA0W``. +In each case the constant ``02 00`` marker sits at ``data[2×NN+8]`` and +the following tag lands exactly on a valid block boundary. + +##### Segments + +The body is divided into segments separated by ``40 02`` segment headers. +**Segment size is variable** — bounded by a fixed device-flash byte +budget, not a fixed sample count. Quiet events fit more samples per +segment (RLE compacts zero deltas via ``00 NN`` markers); loud events +fit fewer. Observed first-segment sizes in the bundled fixtures: + +| Event | Segment 0 size (Tran samples) | +|---|---| +| SP0 (loud, 0.25s pretrig) | 510 | +| SV0 (loud-from-start) | 58 (stops at first ``30 NN``) | +| SS0 (loud-from-start) | 42 (stops at first ``30 04``) | +| JQ0 (Vert-heavy, quiet Tran) | 510 | +| V70 (Mic-heavy, quiet geos) | 510 | + +⚠️ Earlier drafts of this section claimed "~80 sample-sets per segment" +based on incomplete walks; that figure is wrong. Segments are +flash-page-sized in bytes, not sample-count-sized. + +The ``40 NN`` payload structure (offsets shown for the common NN=2 / +18-byte-payload case; add ``2 × (NN − 2)`` to every offset from ``[4:6]`` +onward for other widths): + +| Offset (NN=2) | Generic | Field | Status | +|---------------|------------------|----------------------------------------|-------------| +| [0:4] | [0 : 2NN] | NN × int16 BE continuation deltas for | ✅ confirmed| +| | | the PREVIOUS channel (16-count units) | | +| [4:6] | [2NN : 2NN+2] | Unknown (varies; possibly a checksum) | ❓ open | +| [6:8] | [2NN+2 : 2NN+4] | Byte length to next segment header − 2 | 🟡 likely | +| | | (uint16 BE; off by ±4 on some files) | | +| [8:12] | [2NN+4 : 2NN+8] | Monotonic uint32 LE counter | ✅ confirmed| +| | | (starts ~0x47, +1 per segment) | | +| [12:14] | [2NN+8 : 2NN+10] | Constant ``02 00`` | ✅ confirmed| +| [14:18] | [2NN+10 : 2NN+14]| THIS channel's 2-sample anchor pair | ✅ confirmed| +| | | (2 × int16 BE) | | + +⚠️ An earlier draft listed ``[14:18]`` as an "unknown 4-byte field" and +``[12:16]`` as a constant ``02 00 00 01``. Both were wrong: the constant +is only the 2-byte ``02 00``, and the four bytes after it are the anchor +pair the decoder needs. Corrected 2026-08-25. + +###### Tagless segment headers (CONFIRMED 2026-08-25) + +A segment header can appear with **no ``40 NN`` tag at all** — just the +14-byte tail: + +``` +[field2:2][len_to_next:2][channel_id:4][marker:2][anchors:4] +``` + +This is the NN=0 case: the previous channel needed no continuation +deltas, so there is no tag and no delta bytes. Detect it by the six +bytes at ``[4:10]`` — a known channel id, two zero bytes, a small +segment index, then the ``01 00`` / ``02 00`` marker. + +It is where the walk stopped in 7 of the 8 events that still truncated +after the wide-RLE / ``30 NN`` / variable-width-``40 NN`` fixes. + +###### The header "counter" is really a channel id (CONFIRMED 2026-08-25) + +The 4-byte field previously documented as a *"monotonic uint32 LE +counter (starts ~0x47, increments by 1 per segment)"* is actually: + +``` +[channel_id:1][00][00][segment_index:1] +``` + +| channel_id | channel | +|---|---| +| ``0x46`` | Tran | +| ``0x47`` | Vert | +| ``0x48`` | Long | +| ``0x49`` | MicL | + +Verified on **1697 of 1697** segment headers across the ground-truth +corpus — every one agrees with the channel the rotation would assign, +zero disagreements, no other id values observed. The old reading was +plausible because the id byte cycles 0x46→0x47→0x48→0x49 and the +segment index increments, which *looks* monotonic in LE. + +Decoders should take the channel from this field rather than from +rotation position: one missed or extra header (exactly what tagless +headers used to cause) desyncs rotation and corrupts every channel +after it. + +###### Geophone full scale is 32000 counts, not 32768 (CONFIRMED 2026-08-25) + +The body codec emits geo samples in 16-count units whose LSB is exactly +**0.005 in/s**. With the consumer-side ``×16`` to ADC counts, one ADC +count is ``0.005 / 16`` in/s, so Normal range (10.000 in/s) is + +``` +10.0 / (0.005 / 16) = 32000 counts +``` + +Dividing by 32768 scales every geophone sample and every derived peak +down by ``1 - 32000/32768`` = **2.34%**. Measured on 216 per-channel +comparisons against preserved Blastware ASCII exports: 32768 gave +151/216 exact (worst error 0.238 in/s on a 10 in/s event); 32000 gives +216/216 exact with a worst error of 0.005 in/s — exactly 1 LSB, i.e. +pure quantization. + +This also explains why Blastware reports geo peaks slightly above +nominal full scale (e.g. 10.14 in/s): the ADC has headroom past 32000. + +**Scope — this is not waveform-specific.** The scale is applied where +ADC counts become physical units, which every event passes through +regardless of which codec produced the samples. Verified after +re-deriving the whole production store: + +| source | median ratio ours/device, 32768 | with 32000 | +|---|---|---| +| series-3 waveform (vs ASCII sample table) | 0.9766 | **1.0000** | +| series-3 histogram (vs ASCII PPV, n=1137) | 0.9766 | **1.0000** | +| series-4 Thor IDF (vs device peak, n=1468) | 0.960 | **0.983** | + +The series-4 figure is closer to correct but not exact — the Thor +per-count LSB is its own open question (see §15). + +###### SUPERSEDED 2026-08-25 — the body is a RECORD CHAIN, not a tag stream + +Everything above about ``40 NN`` segment headers, tagless headers, variable +header widths and channel rotation describes a model that is **wrong**. It +produced nearly-correct output because the block table happens to tile the +data sections correctly, but the framing is not what the device writes. + +The body is a chain of **self-delimiting per-channel records**: + +``` +off+0 field2 uint16 purpose unknown (not a length, not a checksum) +off+2 len uint16 BE next_record = off + 2 + len <- authoritative +off+4 chan_id 0x46 Tran / 0x47 Vert / 0x48 Long / 0x49 MicL + 0x06 = END OF WAVEFORM STREAM +off+5 0x00 +off+6 0x00 +off+7 segment index +off+8 mode 2 bytes, a 3-valued enum +off+10 anchors 2 x int16 BE, ABSOLUTE -- present ONLY when mode == 02 00 +``` + +**Mode enum**, all three ground-truth verified: + +| mode | header | data section | +|---|---|---| +| ``02 00`` | 14 bytes | anchors emitted, then blocks are **cumulative deltas** | +| ``01 00`` | 10 bytes | no anchors, blocks carry **absolute** sample values | +| ``00 03`` | 10 bytes | **no tags at all** — raw 12-bit packed absolute samples | + +Census over the 1,388 production series-3 waveform binaries: +``02 00`` x 32,617, ``01 00`` x 74, ``00 03`` x 71. + +**``40 NN`` is an ordinary int16 BE data block** of length ``2*NN + 2`` +(1 <= NN <= 8), never a header. The superseded model read it as a header of +length ``2*NN + 16``, which is exactly why walks drifted: the "variable prefix" +of 0/2/4/6/8 bytes reported earlier was walker drift, precisely +``4 - (old_stop - true_record_start)``, on all 25 affected files. + +Block table for data sections (``NN = ((tag_hi & 0x0F) << 8) | tag_lo``): + +| tag | length | samples | +|---|---|---| +| ``0X NN`` | 2 | NN (RLE hold — holds the previous value in BOTH delta and absolute modes) | +| ``1X NN`` | NN/2 + 2 | NN (4-bit nibble) | +| ``2X NN`` | NN + 2 | NN (int8) | +| ``30 NN`` | NN*1.5 + 2 | NN (12-bit packed) | +| ``40 NN`` | 2*NN + 2 | NN (int16 BE) | + +The ``30 NN`` "trailer length = NN*4" fallback must NOT be applied inside a +record — it corrupts records whose ``30 NN`` sits near a boundary. + +**The preamble is segment 0's implicit Tran record.** ``body[1:3]`` carries +the same mode pair: ``00 02 00`` (1,387 of 1,388 files) means two int16 BE +anchors at ``body[3:7]`` then delta blocks; ``00 00 03`` (1 file, +``BE13121/O121L4L1.KF0W``) means raw 12-bit absolute from ``body[3]``, which +cannot be block-walked — the first record must be located by scanning. + +**Verification.** The length chain terminates on a ``0x06`` record in 1,387 of +1,388 files (the exception has an ambiguous footer signature inside its sample +stream). All four channels come out at identical length in **1,388/1,388**, +against 156/1,388 under the superseded model. Against the 75 events with a +preserved Blastware ASCII export: sample-count exact **72/75 -> 75/75**, fully +exact **70/75 -> 73/75** (the 2 remaining differ by exactly 1 LSB on samples +sitting at the +-10.000 in/s rail). Against device-reported PPVs on a live +decode: waveform **1306/1306** exact with mean absolute ratio error 0.00000; +histogram **4458/4459**. + +This also eliminated the walker-over-read class entirely. 24 of those 35 +"histogram" over-reads were histogram files that ``read_blastware_file`` fed to +the *waveform* codec first; the old walker accepted them and returned garbage +(one produced 98,923 "intervals"), while the record-chain decoder correctly +returns None so they fall through to ``histogram_codec``. + +##### Trailer + +The trailer (after the last segment's data) is a sequence of 32-byte +``30 08`` blocks plus a final ``30 04`` / ``20 04`` / ``40 02`` summary +ending in the constant 2-byte tail ``00 1A``. These contain +per-channel statistics (peak times, peak values, mean offsets — bytes +in the form ``f3/f4/f5`` near ``20 10`` markers strongly resemble +int8 channel-bias values around -12). Detailed decoding of the +trailer is outside the path needed for sample reconstruction. + +##### Tran channel codec — CONFIRMED 2026-05-11 (segment 0) + +After the 7-byte preamble, the body's segment 0 carries Tran deltas +via three block types: + +- ``10 NN``: ``NN/2`` bytes of payload. Each byte = two 4-bit signed + nibbles (high nibble first; 0..7 → 0..+7, 8..F → -8..-1). Each + nibble is one Tran delta in 16-count units (LSB = 0.005 in/s). + +- ``20 NN``: ``NN`` bytes of payload. Each byte = one int8 signed + delta in 16-count units. Used when deltas don't fit in 4 bits. + +- ``00 NN``: a 2-byte marker. Run-length-encoded zero deltas — append + NN copies of the current cumulative Tran value (no change). Used + heavily for silent stretches. + +Segment 0 ends at the first ``40 02`` segment header. Segment 0 typically +covers ~510 sample-sets for events with mostly-quiet Tran, fewer for +events with rapid Tran changes. + +Verified against all bundled fixture events (5-8 and 5-11 bundles): + +| Event | Tran character | Segment 0 size | Matches truth | +|---|---|---|---| +| SP0 (loud all-channels, pretrig=0.25s) | small near sample 0 | 510 | 510/510 ✓ | +| SS0 (loud-from-start) | big from sample 0 | 42* | 42/42 ✓ | +| SV0 (loud-from-start) | big from sample 0 | 58* | 58/58 ✓ | +| JQ0 (Vert-heavy) | near zero | 510 | 510/510 ✓ | +| V70 (Mic-heavy) | near zero | 510 | 510/510 ✓ | + +\* SS0 and SV0 decode stops early because their segment 0 contains +``30 04`` blocks whose internal format hasn't been decoded yet (likely +a channel-switch marker for the high-amplitude regime). The two events +where the codec is most complex stop at the first ``30 04``. + +Implementation: :func:`minimateplus.waveform_codec.decode_tran_initial`. + +##### Multi-segment Tran continuation — OPEN + +After segment 0 ends and the segment header's T_delta (bytes [0:2]) +is applied, the next segment's blocks produce values that diverge from +truth by sample ~512. The block structure inside segment 1 is +identical to segment 0 (alternating ``10 NN`` / ``20 NN`` data + +``00 NN`` RLE), and the per-segment delta budget exactly matches the +segment size — V70 segment 1 has 264 nibble-deltas + 244 RLE-zeros = +508 = the segment's sample count. Cumulative deltas are correct in +aggregate (V70 net-zero ≈ truth net-zero) but the per-sample trajectory +is wrong when applied as Tran continuation. + +The strongest unverified hypothesis is that **segments rotate +channels**: segment 0 = Tran, segment 1 = Vert, segment 2 = Long, +segment 3 = Mic, segment 4 = Tran continuation, … This would explain +the per-segment delta-budget match while also explaining why segment +1 isn't Tran continuation. Verification needs the per-channel anchor +to come from segment-header bytes [4:6] or [14:18], which are still +open. + +##### What's still open + +- **Tran past the first data block.** After the first block, the + body has more ``10 NN`` / ``20 NN`` blocks separated by ``00 NN`` + markers and occasionally ``30 NN`` blocks. Naive continuation + (treat all subsequent ``10/20 NN`` blocks as Tran) does NOT match + truth past the first block — the codec interleaves channels somehow. + ``30 04`` markers appearing in SS0 between blocks 1 and 5 look + like channel-switch tags, but the switching rule has not been + fully decoded. + +- **Vert / Long / MicL channel encodings.** No verified decoder + exists for these yet. Hypotheses tested without success: + V_init stored as int16 BE in ``30 NN`` block payload; V/L/M + blocks encoded in order after Tran with ``30 NN`` separators; + V encoded as ``V - T`` differential. None match truth. + +- **``30 NN`` block length.** In the trailer, ``30 NN`` blocks + are NN×4 bytes long. In the data section, ``30 NN`` blocks are + NN×2 bytes long (= 8 bytes for NN=4 in SS0). The walker tries + NN×2 first and falls back to NN×4 if needed. + +- **Walker correctness past offset ~427 in event-b.** The walker + bails out partway through event-b — there is at least one block + whose length doesn't fit the lengths confirmed for the other + events. This is a separate (now lower-priority) issue. + +##### Recommended next step + +A capture with a known external waveform (calibration tone of known +frequency and amplitude) would unlock the magnitude scaling and +disambiguate which channel a ``20 NN`` block belongs to. Multiple +captures of the same signal at different ``geo_range`` settings +(Normal 10 in/s vs Sensitive 1.25 in/s) would also pin down whether +sample values are scaled at the codec layer or only at the BW +display layer. + +##### Reference module + +``minimateplus/waveform_codec.py`` implements the verified block +walker (:func:`walk_body`, :func:`split_segments`, +:func:`parse_segment_header`). ``decode_waveform_v2`` is a stub that +returns ``None`` until a verified per-byte sample decoder is wired +up; production code (``minimateplus/client.py``) continues to use +the legacy int16 LE decoder, which produces wrong samples but stable +output shape — keep the ``.h5`` sidecars marked as +"sample-codec unverified" until the byte-to-sample mapping lands. + +##### History (do not re-derive) + +| Date | Note | +|---|---| +| 2026-05-11 | Tran channel codec cracked using a high-amplitude (PPV 6-7 in/s) event bundle. Preamble[3:7] = Tran[0]/Tran[1] as int16 BE in 16-count units (LSB = 0.005 in/s). First data block (``10 NN`` nibble-deltas or ``20 NN`` int8-deltas) carries Tran deltas from sample 2. Verified 22+42+46 = 110 samples across SP0/SS0/SV0 with 0 errors. Earlier 96-combination brute-force search on the quiet 5-8 bundle failed because Tran[0] = Tran[1] = 0 in those events made initial-value-from-preamble undetectable. | +| 2026-05-08 | Block tagging confirmed against the 4-event May 2026 bundle. All bodies parse cleanly through `walk_body` for events a/c/d. Event-b walks partway and stops at offset 427 (open issue). | +| 2026-05-08 | Earlier "4-channel interleaved s16 LE" claim formally retracted — never validated, produced full-scale ±32K noise on every event because the bytes are encoded, not raw samples. | +| 2026-04-02 | "Frame 7 metadata", "Frame 9 terminator", and `0x0400`-step chunk-counter claims documented as-was; later proved to be artifacts of an over-reading 5A walk (now superseded by §7.8.5–7.8.7). | + +--- + +#### 7.6.2 Noise monitoring / Histogram mode — ✅ CONFIRMED (3-31-26 capture) + +32-byte blocks with the following layout: + +``` +Offset Size Type Description + 0 2 uint16 LE block type: 0x0016=sync, 0x0000=data + 2 2 uint16 LE block counter (ctr) + 4 18 int16 LE × 9 ADC samples +22 10 bytes metadata: [00 01 43 VAR VAR 00 pretrig rectime 00 00] +``` + +- Sync blocks (type=0x0016) appear at the start of each A5 frame; ctr=0 in sync blocks. +- Data blocks (type=0x0000) carry actual sample data. First data block ctr=288 (empirical, + not yet decoded — likely related to a pre-trigger sample offset). +- Metadata fixed bytes: `00 01 43` then 2 variable bytes, then `00 [pretrig] [rectime] 00 00`. + Pretrig byte = 0x1E (30) and rectime byte = 0x0A (10) for the 3-31-26 capture. +- 9 samples per block (int16 LE, NOT big-endian). Noise floor ≈ 9–11 counts. +- **This is a different recording mode** from waveform/blast — the device firmware uses + 32-byte blocks for histogram/noise monitoring and 4-channel continuous for waveform events. + +> ❓ **Open:** The 9-sample-per-block structure does not divide evenly into 4 channels. +> Whether these represent a single channel, all channels in rotation, or downsampled +> aggregates is not yet determined. The first data block ctr=288 vs pretrig=30 is also +> unexplained — possibly counting in units other than sample-sets. + +--- + +--- + +### 7.7 Event Download Protocol — Confirmed from 3-31-26 Capture ✅ + +> **Added 2026-03-31.** All findings confirmed from live bridge capture +> `bridges/captures/3-31-26/raw_bw_20260331_200245.bin` + +> `raw_s3_20260331_200245.bin` (148 BW frames / 147 S3 frames). +> Analysis scripts: `parsers/analyze_3_31_26.py`. + +#### Overview + +Event download uses four SUBs in a key-driven iterator loop. The +"waveform key" is a 4-byte opaque record address that uniquely identifies +one histogram bin or waveform record on the device's internal storage. + +| Step | BW SUB | S3 Response | Purpose | +|---|---|---|---| +| 1 (once) | `1E` — EVENT_HEADER | `E1` | Get the first waveform key | +| 2 | `0A` — WAVEFORM_HEADER | `F5` | Check record type / confirm full bin | +| 3 | `0C` — WAVEFORM_RECORD | `F3` | Download 210-byte record (peaks, project, timestamp) | +| 4 | `1F` — EVENT_ADVANCE | `E0` | Advance iterator, get next key | +| ↑ repeat steps 2–4 until key == `00 00 00 00` | | | | + +**Blastware optimisation (confirmed):** Step 2 (0A) is only called for the +_first_ key. Subsequent keys come from `1F` with token `0xFE` (download +mode), which guarantees they are full records — so Blastware skips 0A and +jumps directly to 0C. Our implementation follows the same pattern. + +--- + +#### 7.7.1 Waveform Key + +The waveform key is a 4-byte opaque record address (`uint32`, likely +a flash sector offset or circular-buffer pointer internal to the S3 DSP). + +- First key: returned by `1E` at `data[11:15]` +- Subsequent keys: returned by `1F` at `data[11:15]` +- Terminator: `00 00 00 00` signals no more events + +Example keys from 3-31-26 capture (one Blastware "event"): +``` +01 11 00 16 ← first key (full record — see §7.7.3 for length disambiguation) +01 11 11 B6 ← intermediate boundary key +01 11 11 F6 ← intermediate boundary key +01 11 12 36 ← next real-event key +00 00 00 00 ← terminator +``` + +> ⚠️ The 3-31-26 capture was the only "events present" capture available at the +> time of original analysis and contained a single event. The "0x30 = full / +> 0x26 = partial" interpretation in earlier drafts was an artifact of that +> single-event capture; the canonical lengths are `0x46` (real event) and `0x2C` +> (boundary), confirmed across 5-1-26 multi-event captures. See §7.7.3 / §7.8.8. + +--- + +#### 7.7.2 Token Byte (SUB 1E / 1F) + +> ✅ **CORRECTED 2026-04-06** — token byte is at **`params[7]`** (not `params[6]`). +> Confirmed from raw params `00 00 00 00 00 00 00 FE 00 00` in both the 3-31-26 +> and 4-3-26 BW TX captures. With the wrong position the device silently ignores +> the token. + +A token byte at **`params[7]`** controls the 1E/1F behaviour: + +| Token | Mode | Behaviour | +|---|---|---| +| `0x00` | Browse | Advance one record across the full event chain (including boundary keys) | +| `0xFE` | Download (arm) | Used in the 5A bulk-stream arming sequence — see §6.1 | + +**Browse vs download is context-dependent:** + +- `count_events()` and the "Download All" pre-walk (§7.8.8) use **browse mode + (token=`0x00`)** to enumerate the full key chain and discriminate real events + from boundaries via SUB 0A's echoed length (§7.7.3). +- `get_events()` uses `0xFE` for the **arm step** between 0A and 0C (REQUIRED + to wake the 5A state machine — see §6.1) and after 1F to arm the bulk stream, + but then uses browse-mode 1F to advance to the next event key after a + successful 5A. + +Calling 1F with `0xFE` cold (without the preceding 0A and 1E-arm) returns the +null sentinel regardless of how many events are stored — an earlier observation +that token=0xFE "returns null" was the result of testing without those +prerequisite steps. + +--- + +#### 7.7.3 Variable DATA_LENGTH for SUB 0A (WAVEFORM_HEADER) + +> ✅ **CORRECTED 2026-05-01** — earlier values `0x30` / `0x26` came from the +> deprecated histogram-only walk. Confirmed values for triggered-event downloads +> are `0x46` / `0x2C` (see §5.1, §7.8.8). + +Unlike all other SUBs, `0A` does NOT have a fixed data length. The length +is echoed in the probe response at `data[5]` (and is also the value the +data-request step sends back as its offset): + +| Length | Meaning | +|---|---| +| `0x46` (70 bytes) | Full triggered-event waveform header — has a real event to download | +| `0x2C` (44 bytes) | Boundary marker / monitor-log partial record — no triggered event | + +Both the probe and data-request frames carry the same key in `params[4..7]`. +`read_waveform_header()` (protocol.py) reads the echoed length from the probe +response and uses it as the data-request offset, then returns +`(raw_data, length)` so callers (`get_events`, `get_monitor_log_entries`, +"Download All" walk) can decide whether to issue a 0C/5A download or just +advance the iterator. + +--- + +#### 7.7.4 Response Data Section Layout + +**All S3 event download responses** share this data section prefix: + +``` +data[0] LENGTH_ECHO — echoes the request DATA_LENGTH byte +data[1..4] 00 00 00 00 — four zero bytes +data[5..8] KEY_ECHO — echoes the 4-byte waveform key from the request +data[9..10] 00 00 — two zero bytes +data[11..] ACTUAL_DATA — real payload starts here +``` + +Actual data lengths: +- `1E` response (`E1`): `data[11:19]` — 8 bytes (`data[11:15]` = key4) +- `0A` probe response (`F5`): `data[4]` = variable length (0x30 or 0x26) +- `0A` data response (`F5`): `data[11:11+length]` — waveform header bytes +- `0C` data response (`F3`): `data[11:11+0xD2]` — 210-byte waveform record +- `1F` response (`E0`): `data[11:15]` = next key4; `data[8]` = token echo + +--- + +#### 7.7.5 Waveform Record Layout (210 bytes, SUB F3 → response F3) + +> ✅ **Updated 2026-04-01** — Full timestamp layout confirmed against Blastware +> event report (BE11529 thump event, "00:28:12 April 1, 2026"). Record type +> encoding corrected (byte[1], not ASCII string search). Peak Vector Sum field +> confirmed at fixed offset 87. + +The 210-byte record (`data_rsp.data[11:11+0xD2]`) contains: + +**Header / Timestamp** — two layouts exist; **detect via `byte[0]`** of the record header: + +- `byte[0] != 0x10` → **9-byte format** (sub_code=0x10, single-shot waveform) +- `byte[0] == 0x10` → **10-byte format** (sub_code=0x03, continuous waveform; same + layout as partial monitor-log records — see §7.10 / `_decode_0a_partial_header` in client.py) + +The auto-detect logic lives in `_decode_waveform_record_into` (client.py) and in +`_decode_0a_partial_header` for monitor log entries. + +**9-byte format — sub_code = 0x10 (Waveform single-shot) ✅ CONFIRMED 2026-04-01:** +``` +byte[0]: day (uint8) +byte[1]: sub_code 0x10 = Waveform single-shot +byte[2]: month (uint8) +bytes[3–4]: year (uint16 big-endian) +byte[5]: unknown (0x00 in all observed samples ❓) +byte[6]: hour (uint8) +byte[7]: minute (uint8) +byte[8]: second (uint8) +``` + +Thump event raw bytes (2026-04-01 00:28:12, single-shot): +``` +01 10 04 07 ea 00 00 1c 0c +↑ ↑ ↑ ↑──↑ ↑ ↑ ↑ ↑ +d=1 sub m=4 y=2026 ? h=0 m=28 s=12 +``` + +**10-byte format — sub_code = 0x03 (Waveform continuous) ✅ CONFIRMED 2026-04-03:** + +One byte wider than the single-shot layout. All subsequent fields shift +1. + +``` +byte[0]: 0x10 (marker byte; how the decoder distinguishes the two layouts) +byte[1]: day (uint8) +byte[2]: 0x10 (marker; reflects the wire-encoded sub_code=0x03) +byte[3]: month (uint8) +bytes[4–5]: year (uint16 big-endian) +byte[6]: unknown (0x00 ❓) +byte[7]: hour (uint8) +byte[8]: minute (uint8) +byte[9]: second (uint8) +``` + +Continuous event raw bytes (2026-04-03 15:20:17): +``` +10 03 10 04 07 ea 00 0f 14 11 +``` + +Cross-referenced against the `.MLG` file for a single-shot event, which stores an +8-byte timestamp at two offsets (trigger time and end time): +``` +MLG format: [day:1][month:1][year:2 LE][?:1][hour:1][min:1][sec:1] +01 04 ea 07 00 00 1c 0c → trigger at April 1, 2026 00:28:12 +01 04 ea 07 00 00 1c 0f → end time April 1, 2026 00:28:15 (3.0 s record time ✅) +``` + +**Record type** — encoded in `byte[1]` (single-shot) or `byte[0]/byte[2]` markers +(continuous), NOT as an ASCII string: +- `0x10` at `byte[1]` → Waveform single-shot ✅ +- `0x10` at `byte[0]` + `0x10` at `byte[2]` → Waveform continuous ✅ +- histogram sub_code: not yet confirmed in a 0C response (the monitor-log + 10-byte timestamp uses the same continuous-mode marker) + +**Peak particle velocity floats** (✅ CONFIRMED 2026-03-31, re-confirmed 2026-04-01): + +Channel labels `"Tran"`, `"Vert"`, `"Long"`, `"MicL"` are embedded as +ASCII strings at variable offsets within the record. The PPV float for +each channel is at `label_offset + 6` (IEEE 754 big-endian float32). + +The floats are **NOT 4-byte aligned** — Tran, Long, and MicL all fall at +non-aligned offsets. The previous heuristic step-4 scanner missed all three. + +Confirmed offsets from thump event (2026-04-01, cross-referenced vs Blastware): +``` +"Tran" at offset 99 → float at 105 = 0x3ED70A2D = 0.420 in/s ✅ Blastware: 0.420 +"Vert" at offset 114 → float at 120 = 0x4077AE01 = 3.870 in/s ✅ Blastware: 3.870 +"Long" at offset 129 → float at 135 = 0x3EFD7090 = 0.495 in/s ✅ Blastware: 0.495 +"MicL" at offset 144 → float at 150 = 0x3985114E = 0.000254 psi +``` + +Channel labels are separated by inner-frame bytes `10 03` (DLE ETX), +preserved as literal data by `S3FrameParser`. + +**Peak Vector Sum** (✅ CONFIRMED 2026-04-01; offset corrected 2026-04-03): + +``` +Location: tran_pos − 12 (label-relative; IEEE 754 big-endian float32) + = √(Tran² + Vert² + Long²) at the sample instant of maximum + combined geo motion + NOT the vector sum of the three per-channel peaks (those may + occur at different sample times) +``` + +> ⚠️ **Do NOT use fixed offset 87.** That value only happens to be correct for +> `sub_code = 0x10` (single-shot) records, where the 9-byte timestamp leaves the +> peak vector sum at byte 87. For `sub_code = 0x03` (continuous) records, the +> 10-byte timestamp pushes everything one byte later — `tran_pos − 12` is the +> canonical label-relative location and works for both record types. + +``` +Thump event (single-shot, tran_pos=99): + Value at tran_pos − 12 = byte 87 = 0x4079F6C5 = 3.906 in/s + ✅ matches Blastware "Peak Vector Sum: 3.906 in/s" +Near-ambient (single-shot): 0x3C75C28F = 0.015 in/s +``` + +**Project strings** — ASCII label-value pairs (search for label, read null-terminated value): +``` +"Project:" → project description (in 0C record ✅, also mirrored in metadata pages) +"Client:" → client name (in SUB 5A metadata pages ✅ — NOT in 0C) +"User Name:" → operator / user (in SUB 5A metadata pages ✅ — NOT in 0C) +"Seis Loc:" → sensor location (in SUB 5A metadata pages ✅ — NOT in 0C) +"Extended Notes"→ notes field (in SUB 5A metadata pages ✅) +``` + +> ✅ **UPDATED 2026-05-05:** `Client:`, `User Name:`, and `Seis Loc:` come from the +> dedicated **SUB 5A metadata pages at counter `0x1002` and `0x1004`** — see §7.8.7. +> They are NOT present in the 210-byte SUB 0C waveform record. +> +> An earlier draft of this doc claimed they came from "A5 frame 7" of the bulk waveform +> stream — that was an artifact of the deprecated `0x0400`-step walk where the broken +> chunk counter formula happened to land sample-chunk fi=7 on top of the 0x1002 metadata +> page. Under the corrected v0.14.0+ walk (§7.8.5), sample chunks at `0x1000` / `0x1200` +> contain ordinary waveform data, and the metadata pages are read separately. +> +> The strings reflect the compliance setup that was active when the *monitoring session* +> first started (not per-event). `get_events()` reads the metadata pages once at the start +> of the SFM session and the decoded values are stamped onto every event in that session. + +--- + +#### 7.7.6 Complete Download Loop (Python pseudocode) + +```python +key4, _ = proto.read_event_first() # SUB 1E +if key4 == b'\x00\x00\x00\x00': + return [] # no events + +events = [] +is_first = True + +while key4 != b'\x00\x00\x00\x00': + if is_first: + _header, rec_len = proto.read_waveform_header(key4) # SUB 0A + is_first = False + if rec_len < 0x30: + key4 = proto.advance_event() # skip partial first bin + continue + + record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) + events.append(decode(record)) + + key4 = proto.advance_event() # SUB 1F (token=0xFE) + +return events +``` + +--- + +### 7.7.7 Updated Download Loop with SUB 5A Metadata + +> ⛔ **The loop in this subsection is DEPRECATED — it uses the broken `stop_after_metadata=True` +> hack and the wrong sequence ordering.** See §7.8.5–§7.8.8 for the corrected protocol. +> The pseudocode below is preserved as historical record only. + +```python +key4, _ = proto.read_event_first() # SUB 1E +if key4 == b'\x00\x00\x00\x00': + return [] + +events = [] +is_first = True + +while key4 != b'\x00\x00\x00\x00': + if is_first: + _header, rec_len = proto.read_waveform_header(key4) # SUB 0A + is_first = False + if rec_len < 0x30: + key4 = proto.advance_event() + continue + + record = proto.read_waveform_record(key4) # SUB 0C (0xD2 bytes) + event = decode(record) + + a5_data = proto.read_bulk_waveform_stream( # SUB 5A → A5 frames + key4, stop_after_metadata=True) + client._decode_a5_metadata_into(a5_data, event) # overwrites project_info + + events.append(event) + key4 = proto.advance_event() # SUB 1F (token=0xFE) + +return events +``` + +--- + +### 7.8 SUB 5A — Bulk Waveform Stream (event-time metadata) + +> ✅ **§7.8.1 (frame format) — added 2026-04-02; v0.14.3 partial DLE stuffing finalized 2026-05-05.** +> Frame format confirmed by reproducing Blastware wire bytes byte-for-byte across the 1-2-26 +> capture (10 frames) and the 5-1-26 bwcap3sec capture (17 frames, all match including the +> DLE-stuffed `10 10 00` for counter=0x1000). + +SUB 5A initiates a bulk transfer of the raw sample data for a stored event. The response is +a sequence of A5 frames. Project-info ASCII strings (`Project:`, `Client:`, `User Name:`, +`Seis Loc:`, `Extended Notes`) live in the dedicated metadata pages at counter `0x1002` +and `0x1004` (see §7.8.7), not in the sample-chunk stream. + +**For the corrected protocol read in order:** +- §7.8.1 — frame format (raw `offset_hi`, DLE-aware checksum, partial DLE stuffing of params) +- §7.8.5 — chunk addressing (probe → metadata pages → samples → TERM, all bounded by `end_offset`) +- §7.8.6 — TERM frame formula +- §7.8.7 — fixed metadata pages 0x1002 / 0x1004 +- §7.8.8 — multi-event "Download All" sequence + +§7.8.2–§7.8.4 are retained as historical record of earlier (incorrect) understandings — +do not implement against them. + +#### 7.8.1 Frame Format + +SUB 5A uses a **non-standard frame layout** that differs from all other BW→S3 write commands. + +``` +[ACK][STX][10][10][00][5A][00][offset_hi][offset_lo][params...][chk][ETX] + 41 02 10 10 00 5A 00 ^^raw^^ ^^raw^^ ^^stuffed^^ +``` + +Three critical differences from `build_bw_frame`: + +1. **`offset_hi` is sent raw, not DLE-stuffed.** When `offset_hi = 0x10`, the wire carries + a bare `0x10` — NOT the stuffed `10 10` that `build_bw_frame` would produce. The device + ignores frames where this byte is incorrectly stuffed. + +2. **DLE-aware checksum.** Walking the full frame byte sequence: when a `10 XX` pair is seen, + only `XX` is added to the running sum; lone bytes are added normally. + +3. **Partial DLE stuffing of `0x10` bytes in the params region** (CONFIRMED 2026-05-05). + The device's de-stuffing rule for the params region is: + + - `10 10` → de-stuffs to `10` + - `10 02 / 03 / 04` → kept literal (these are inner-frame markers) + - `10 X` for other X → de-stuffs to just `X` (drops the leading `0x10`) + + Therefore any `0x10` byte in the *logical* params that is followed by a byte NOT in + `{0x02, 0x03, 0x04, 0x10}` MUST be doubled on the wire (`10 X` → `10 10 X`) so the + device's de-stuffer reproduces the original `10 X` pair. This applies most commonly + to counters with `0x10` in the high byte (e.g. counter=`0x1000` produces logical + params bytes `... 10 00 ...`, which BW encodes on the wire as `... 10 10 00 ...`). + Without this stuffing the device interprets counter=`0x1000` as `0x0000` and returns + the probe response (= a copy of the file header + STRT record); that STRT block then + ends up embedded in the assembled file body and Blastware refuses to open the file. + + `0x10` bytes in `offset_hi` are still written RAW per (1) above — only the params + region has this stuffing requirement. Metadata-page params for counter `0x1002` / + `0x1004` survive without stuffing because `10 02` / `10 04` fall in the "kept literal" + carve-out. + + Verified against BW 5-1-26 bwcap3sec frame 20: params logical bytes + `00 01 11 10 00 00 00 00 00 00 00` (counter=0x1000) are encoded on the wire as + `00 01 11 10 10 00 00 00 00 00 00 00` (12 wire bytes for 11 logical bytes). + +#### 7.8.2 Request Sequence — DEPRECATED 2026-05-01 (see §7.8.5–§7.8.7 for the corrected protocol) + +> ⛔ **The 0x0400-step / max(key4[2:4], 0x0400) formula in this section is WRONG.** Five new +> BW MITM captures (4-27-26 + 5-1-26) prove the actual chunk increment is **0x0200**, the +> chunk loop is bounded by `end_offset` from the STRT record (not by chunk count or by a +> device-side timeout), and the TERM frame's `offset_word=0x005A` magic is incorrect — the +> real TERM offset_word is computed from `end_offset` and the last chunk address. Under the +> deprecated formula SFM over-reads roughly 5× past the actual event end into post-event +> circular-buffer garbage, corrupting reconstructed Blastware files for any waveform ≥ 2 sec. +> +> The whole "stop_after_metadata + one extra chunk + 0e 08 footer" workaround in this +> section was compensating for the missing end_offset bound. It is obsoleted by the +> STRT-bounded walk in §7.8.5. +> +> **Read this section for historical context only.** For the correct protocol, jump to: +> - §7.8.5 — chunk addressing and the STRT end_offset +> - §7.8.6 — TERM frame formula +> - §7.8.7 — fixed metadata pages 0x1002 and 0x1004 + +| Frame | offset_word | counter | params | Purpose | +|---|---|---|---|---| +| Probe | `0x1004` | `0x0000` | 10 bytes (`bulk_waveform_params(0)`) | Initiate transfer | +| Chunk 1 | `0x1004` | `max(key4[2:4], 0x0400)` | 11 bytes | First data chunk | +| Chunk 2 | `0x1004` | `max(key4[2:4], 0x0400) + 0x0400` | 11 bytes | Second chunk | +| Chunk N | `0x1004` | `max(key4[2:4], 0x0400) + (N-1) * 0x0400` | 11 bytes | Nth chunk | +| … | … | … | … | … | +| Termination | `0x005A` | `max(key4[2:4], 0x0400) + N * 0x0400` | 10 bytes | End transfer | + +> Historical correction notes (left in place to deter re-derivation of the same wrong formula): +> the table above was the result of three iterative "corrections" between 2026-04-06 and +> 2026-04-26 that progressively narrowed in on the wrong answer because every test was on +> events with `key4[2:4]=0` and the device responds to whatever counter you ask for. The +> 5-1-26 captures with a non-zero start_key event (`01112238`) finally exposed the bug. + +The `stop_after_metadata=True` flag (deprecated as a primary loop-exit) scanned for +`b"Project:"` in the chunk stream because the metadata strings happened to be reachable +when the broken 0x0400-step walk passed the global metadata pages at 0x1002/0x1004. Under +the corrected walk, those strings come from explicit reads at counter=0x1002 and 0x1004, +not from the sample-chunk stream — see §7.8.7. + +#### 7.8.3 A5 Frame Layout — DEPRECATED 2026-05-01 + +> ⛔ **The "Frame 7 carries the compliance text block" claim below is WRONG.** It was +> an artifact of the deprecated `0x0400`-step walk where the broken counter formula +> happened to land sample-chunk fi=7 on top of the 0x1002 metadata page in flash. +> Under the corrected v0.14.0+ walk (§7.8.5), Frame 7 of the sample-chunk sequence is +> just sample-chunk #5 (counter=0x1000), and contains either ordinary waveform data or — +> critically when DLE-stuffing of params is wrong (§7.8.1.3) — a duplicate file header + +> STRT block when the device misinterprets counter=0x1000 as 0x0000. See §7.8.7 for the +> actual source of these strings. + +Historical claim (NOT TO BE IMPLEMENTED): each A5 response frame contains a chunk of raw +bulk data; Frame 7 of the stream carries the compliance text block with all project-info +label-value pairs: + +``` +"Project:" → null-terminated project name +"Client:" → null-terminated client name +"User Name:" → null-terminated operator name +"Seis Loc:" → null-terminated sensor location +"Extended Notes" → null-terminated notes +``` + +All five fields do reflect the **setup at event-record time**, not the current device +config. But the source is the metadata pages (§7.8.7), not "Frame 7" of the sample +stream. + +#### 7.8.4 End-of-Stream Behaviour and Chunk Timing — REINTERPRETED 2026-05-01 + +> The "1 raw byte then silence" pattern documented below was originally interpreted as +> "the device's natural end-of-event signal." The 5-1-26 captures show this is actually +> the device's response when the requester has walked **past** the addressable buffer +> region (i.e. ~5× past the actual event end under the deprecated 0x0400-step walk). +> Under the corrected STRT-bounded walk (§7.8.5), the stream ends cleanly with the TERM +> frame's response — no timeout, no 1-byte teaser. The fallback below remains useful as +> defensive handling for malformed events but should not be the primary loop-exit. + +**Defensive fallback handling in `read_bulk_waveform_stream`:** +``` +TimeoutError caught (rare under corrected walk): + if bytes_fed > 0 AND frames already collected: + → graceful end-of-stream; break loop; proceed to termination frame + else (bytes_fed == 0, no prior frames): + → genuine transport failure; re-raise +``` + +**Chunk timing (BE11529, 1024 sps, TCP/cellular) — total A5 frames per event:** + +| Metric | Observed value | +|---|---| +| Chunk response time | ~1 s per chunk | +| 2-sec event 1 (corrected walk) | ~15 frames (probe + 2 metadata pages + ~12 sample chunks + TERM) | +| 3-sec event 1 (corrected walk) | 16 frames (probe + 2 metadata pages + 13 sample chunks + TERM) | +| 2-sec continuation event (corrected walk) | 16 frames (~15 sample chunks + TERM; no metadata reread) | +| 3-sec continuation event (corrected walk) | ~15 frames (~14 sample chunks + TERM) | +| Same event under deprecated 0x0400 walk | ~37 frames (over-reads ~5× into post-event garbage) | +| Data per chunk (corrected, 0x0200 size) | ~540–575 bytes wire (= 0x0200 payload + framing) | +| Data per chunk (deprecated 0x0400 step) | 1,036–1,123 bytes wire (= 0x0400 payload + framing) | +| Safe recv timeout per chunk | **10 s** (10× typical) | +| Default transport timeout | 120 s → ~2-min stall at end-of-stream | + +**ADC count-to-physical conversion — ✅ CONFIRMED 2026-04-17:** + +Raw samples are signed 16-bit integers (−32,768 to +32,767). Source: Interface Handbook §4.5. + +**CONFIRMED 2026-04-17** — The `max_range_geo` field (float32 = 6.206053, bytes `40 C6 97 FD`) is the **ADC-to-velocity scale factor** (inverse sensitivity, (in/s)/V) for the standard Instantel geophone, confirmed from Interface Handbook §4.5. The correct conversion formula is: + +``` +PPV (in/s) = ADC_voltage (V) × 6.206053 + = counts × (1.61133 / 32767) × 6.206053 + = counts × 4.982e-5 (in/s per count at full scale) +``` + +where `geo_range = 1.61133 V × 6.206053 = 10.000 in/s` is the Normal (Gain=1) full-scale range. The earlier ~9× overread was caused by mistakenly using 6.206053 as the range directly — it is actually the scale factor, and the range itself is `ADC_fullscale × scale_factor = 1.61133 × 6.206053 = 10.000 in/s`. Mic channel uses psi units with its own range (still unresolved). + +**Decoder note — fi==9 hardcoded skip (FIXED 2026-04-06):** + +`_decode_a5_waveform()` previously had `elif fi == 9: continue` — a leftover from +the original 9-frame blast capture where frame 9 was assumed to be the device +terminator. Removed. Under the v0.14.0+ STRT-bounded walk the chunk loop never +encounters a "terminator frame index" anyway — it stops at `end_offset` +calculated from the STRT record (§7.8.5) and the TERM frame is sent explicitly +(§7.8.6). For other decoders, terminator detection should use +`frame.page_key == 0x0000`, not a hardcoded frame index. + +#### 7.8.5 Chunk addressing and the STRT end_offset (NEW 2026-05-01) ✅ + +> ✅ Confirmed across 3 events (4-27-26 + 5-1-26 captures). + +`params[0]` is always `0x00`. `params[1:5]` is a 4-byte absolute device flash-buffer +address — equivalently, "the key of the page being requested." The device returns 0x0200 +(= 512) bytes starting at that address. Increments between consecutive sample chunks are +**0x0200, NOT 0x0400** (the previous 0x0400 figure was a Blastware-side artifact / our +implementation's bug — see §7.8.2). + +##### STRT record (data layout in the first A5 response) + +The first A5 response (the probe response, or the first chunk for continuation events) +contains a **STRT record** at byte offset 17 of `data`: + +``` +data[ 0:14] echoes request: [chunk_size_hi=0x02 / 0x04 ...] [00] [01 11] [counter_hi counter_lo] [00 × 8] [00 12] +data[14:17] 10 03 00 ← inner DLE+ETX frame separator (preserved literally) +data[17:21] "STRT" ← magic +data[21:23] ff fe ← sentinel +data[23:27] end_key ← 4-byte key of where this event ENDS +data[27:31] start_key ← 4-byte key of where this event STARTS +data[31:33] uint16 BE ← ?? sample count or byte count, varies (not yet decoded) +data[33:35] uint16 BE ← ?? +data[35] 0x46 ← record type marker (waveform full record) +data[36:] additional pointers / first sample bytes — content varies by event +``` + +`end_offset = (end_key[2] << 8) | end_key[3]` is **the authoritative event-end pointer**. +Use it to bound the chunk loop and to compute the TERM frame. + +##### Chunk pattern by event location in buffer + +**Event 1 / start_key[2:4] = 0x0000** (first event after erase or wrap): + +``` +1. Probe at counter = 0x0000 (params[1:5] = full key) +2. Read fixed metadata pages counter = 0x1002, then 0x1004 +3. Walk sample chunks counter = 0x0600, 0x0800, …, by 0x0200, + up to but not including end_offset & 0xFE00 +4. TERM (see §7.8.6) +``` + +The range `[0x0046, 0x0600)` is skipped — likely some pre-event firmware-reserved area for +the first slot in a freshly-erased buffer. Harmless to skip; BW does the same. + +**Event 2+ / start_key[2:4] != 0x0000** (continuation events in a populated buffer): + +``` +1. First chunk at counter = start_key[2:4] ← acts as both probe and first + sample chunk; response carries STRT at byte 17 +2. Walk sample chunks counter += 0x0200 each +3. TERM +``` + +**`start_key` here is the off=0x46 WAVEHDR record key returned by 1F** (e.g. `01112238`), +NOT the off=0x2C boundary key that immediately precedes it. An earlier draft of this +spec described event-N as "probe at start + 0x46" — that formula was correct only if +"start" meant the boundary key (0x21F2 in the 5-1-26 event 2 case). In the iteration +walk used by SFM and BW, `cur_key` passed into the 5A flow is always the off=0x46 key, +so the probe counter equals `cur_key[2:4]` with no extra offset. Adding +0x46 places +the probe one WAVEHDR past the actual event start, the response no longer contains +STRT at byte 17, and the chunk loop falls back to the `max_chunks` cap. + +Confirmed: +- 5-1-26 "copy 2nd address" BW capture: probe counter=0x2238 with key=01112238; A5[0] + has STRT@17 with end_offset=0x417E. +- 5-4-26 BW 2-sec event capture: same probe counter=0x2238, same end_offset=0x417E. + +**No metadata-page reads.** Pages 0x1002/0x1004 are session-global and were already read +during event 1 in the same Blastware session. In SFM, treat metadata pages as a once- +per-`MiniMateClient.connect()` (or once-per-call-home) read, not per-event. + +##### Verified end_offset values + +| Capture | start_key | end_key | end_offset | event size | sample-chunk start | +|---|---|---|---|---|---| +| 4-27-26 "open 2sec" / "copy event to disk" | `01110000` | `01111ABE` | `0x1ABE` | 6,846 B | 0x0600 (event-1 case) | +| 5-1-26 "copy 3sec" / Download All event 1 | `01110000` | `011121F2` | `0x21F2` | 8,690 B | 0x0600 (event-1 case) | +| 5-1-26 "copy 2nd address" / DA event 2 | `01112238` (= 1F result) | `0111417E` | `0x417E`, span 0x1F8C = 8,076 B | 0x2238 (= cur_key[2:4]) | +| 5-4-26 BW 2-sec event | `01112238` | `0111417E` | `0x417E` | 0x2238 (= cur_key[2:4]) | + +#### 7.8.6 TERM Frame Formula (NEW 2026-05-01) ✅ + +> ✅ Confirmed across 3 events. Replaces the deprecated `offset_word=0x005A` / `params[2] = key4[2]` formula in §7.8.2. + +The TERM frame fetches the partial last chunk and the file footer. Its response payload +contains the bytes between the last full 0x0200-aligned chunk and `end_offset` — typically +20–520 B — and is **required for reconstructing the Blastware waveform file**. Append the +TERM response data to the chunk stream like any other A5 frame. + +``` +last_chunk_counter = address of last full 0x0200-byte chunk read +next_boundary = last_chunk_counter + 0x0200 +TERM offset_word = end_offset - next_boundary +TERM params[0] = key[0] (= 0x01 on every observed device) +TERM params[1] = key[1] (= 0x11) +TERM params[2] = (next_boundary >> 8) & 0xFF +TERM params[3] = next_boundary & 0xFF +TERM params[4:10] = zeros ← 10-byte params (not 11) + +Frame = build_5a_frame(offset_word, params) +``` + +The device receives `requested_address = (params[2] << 8) | offset_word` (where offset_word +contains both `offset_hi` and `offset_lo` of the 5A frame, with the high bit of offset_hi +being effectively `bit 0 of (end_offset >> 8)`). It reconstructs `end_offset` and replies +with `(end_offset - next_boundary)` bytes of waveform tail starting at `next_boundary`. + +##### Verification + +| Event | end_offset | last chunk | next_boundary | TERM offset_word | TERM params[2:4] | TERM response size | +|---|---|---|---|---|---|---| +| 2-sec | `0x1ABE` | `0x1800` | `0x1A00` | `0x00BE` ✓ | `1A 00` ✓ | 208 B | +| 3-sec | `0x21F2` | `0x1E00` | `0x2000` | `0x01F2` ✓ | `20 00` ✓ | 520 B | +| Event-2 | `0x417E` | `0x3E38` | `0x4038` | `0x0146` ✓ | `40 38` ✓ | (not measured directly; same pattern) | + +Equivalent way to write the formula: +- `offset_word = end_offset & 0x01FF` — low 9 bits of end_offset +- `params[2:4] = (end_offset & 0xFE00) BE` — high 7 bits of end_offset, low byte zeroed + +(The two forms are arithmetically identical to `end_offset - next_boundary` and +`next_boundary` because `next_boundary = end_offset & 0xFE00` whenever the chunk loop +stopped at the last full 0x0200 boundary below end_offset.) + +#### 7.8.7 Fixed Metadata Pages 0x1002 / 0x1004 (NEW 2026-05-01) 🔶 + +> 🔶 Inferred — observed in BW captures but page contents not yet byte-decoded. + +Two chunk addresses are **GLOBAL** device/session metadata, not event-specific: + +- `counter = 0x1002` — first metadata page +- `counter = 0x1004` — second metadata page + +These are at fixed absolute addresses in the device's flash buffer. They contain the +session-start compliance-setup ASCII strings — **Project**, **Client**, **User Name**, +**Seis Loc**, **Extended Notes** — that under the deprecated 0x0400-step walk used to be +discoverable in the sample-chunk stream as "A5 frame 7" content. Under the corrected +0x0200-step walk these strings come exclusively from the dedicated metadata-page reads, +not from sample chunks. + +##### Caching strategy + +BW reads them ONCE per Blastware session, during event 1's download, and caches them. +For SFM: +- Read once per `MiniMateClient.connect()` / once per call-home session. +- Subsequent events in the same session don't need to re-fetch them. +- Their content does not change while iterating events. They DO change when the user + applies a new compliance setup (SUB 71 write) — invalidate the cache then. + +##### Content layout — string-search decoder in place + +The full byte-for-byte structural layout of pages 0x1002 and 0x1004 has not been +mapped, but `_decode_a5_metadata_into` (`minimateplus/client.py`) successfully +extracts the user-facing strings via label scans: + +``` +b"Project:" → project description +b"Client:" → client name +b"User Name:" → operator +b"Seis Loc:" → sensor location +b"Extended Notes" → notes +``` + +This works across all observed captures (4-27-26, 5-1-26, 5-4-26). A future +project could dump the structural layout if additional session-global fields +need to be extracted — but the strings already decode correctly. + +#### 7.8.8 "Download All" Sequence (NEW 2026-05-01) ✅ + +> ✅ Confirmed from 5-1-26 "Download All" capture (`raw_*_171216_download_all_2events.bin`). + +Before any 5A traffic, BW's "Download All" pre-walks the entire event chain to map keys +and event boundaries: + +``` +SERIAL × 2 → CHCFG → EVT_KEY (1E, all-zero) → key0 + → WAVEHDR (0A, key0) → off=0x46 (real event start) + → EVT_NEXT (1F, all-zero) → key1 + → WAVEHDR (0A, key1) → off=0x2C (boundary) + → EVT_NEXT → key2 + → WAVEHDR (0A, key2) → off=0x46 (real event start) + → EVT_NEXT → key3 + → WAVEHDR (0A, key3) → off=0x2C (boundary) + → EVT_NEXT → null sentinel +``` + +The DATA_LENGTH at `data_rsp.data[5]` (echoed BW offset for the data fetch step) +disambiguates real events from boundary markers: + +| WAVEHDR offset | Meaning | +|---|---| +| `0x46` (= 70) | Real event start key — this key has event data behind it | +| `0x2C` (= 44) | Boundary marker — this key is the END of the previous event AND the start of the empty/header gap before the next event | + +Pairs: each real event spans `[real_key, next_real_key)` in the buffer. In the example +above: event 1 = `[01110000, 011121F2)`, event 2 = `[01112238, 0111417E)`. Note that the +"end of event 1" key (`011121F2`) is also the "boundary key" that comes BEFORE event 2's +real start key (`01112238`) — they differ by exactly 0x46 bytes (the event header size). + +After the pre-walk completes, BW downloads each `0x46`-keyed event in turn using the 5A +bulk stream protocol from §7.8.5. Use the `0x46` keys, not the `0x2C` keys, as input to +`read_bulk_waveform_stream`. + +--- + +## 7.9 Compliance Config Field Inventory (Blastware UI, 2026-04-08) ✅ + +Fields visible in the Blastware "Compliance Setup" dialog. ✅ = byte offset confirmed in code. ❓ = not yet located in raw bytes. + +### Recording Setup tab + +| Field | Values / Type | Status | +|---|---|---| +| Recording Mode | Single Shot (`0x00`) / Continuous (`0x01`) / Histogram (`0x03`) / Histogram+Continuous (`0x04`) | ✅ `recording_mode` — uint8 at **anchor − 8** (SAME offset in E5 read and SUB 71 write, using 6-byte anchor `\xbe\x80\x00\x00\x00\x00`) — confirmed 2026-04-21 | +| Record Stop Mode | Fixed Record Time / Auto / Manual Stop | ❓ Hint: `data[40]` in E5 sf1 changed `01 7F` → `00 00` alongside Continuous → Single Shot; may be related but unconfirmed independently | +| Sample Rate | Standard 1024 / Fast 2048 / Faster 4096 sps | ✅ `sample_rate` — uint16 BE at **anchor − 6** | +| Record Time | float, seconds (3, 5, 8, 10, 13…) | ✅ `record_time` — float32 BE at **anchor + 6** | +| Histogram Interval | `2s / 5s / 15s / 1m / 5m / 15m` (uint16 BE seconds; mode-gated to Histogram / Histogram+Continuous) | ✅ `histogram_interval_sec` — uint16 BE at **anchor − 4**, same in read and write — confirmed 2026-04-20 | +| Storage Mode | Save All Data / Save Triggered | ❓ | +| Geophone Type | Standard Triaxial / 4.5 Hz Geophone | ❓ | +| Geophone — Enable all | bool | ❓ | +| Geophone — Trigger Source | bool | ❓ | +| Chan 1-3 Trigger Level | float, in/s | ✅ `trigger_level_geo` | +| Chan 1-3 Maximum Range (range selector) | Normal 10.000 / 1.25 in/s | ✅ `geo_range` uint8 — **CONFIRMED 2026-04-20.** Offset = Tran+33 (same in E5 read and SUB 71 write — 2126-byte buffer is round-tripped verbatim). `0x00`=Normal 10 in/s, `0x01`=Sensitive 1.25 in/s. Applied to Tran/Vert/Long. **`Tran+20` is NOT this field** (constant 0x01 on all captures). | +| Chan 1-3 ADC Scale Factor | 6.206053 (in/s)/V | ✅ `geo_adc_scale` float32 — **CONFIRMED 2026-04-17.** Offset = Tran+28 (same in E5 read and SUB 71 write). Inverse sensitivity = 1/0.161133. Interface Handbook §4.5: 1.61133 V × 6.206053 = 10.000 in/s. Hardware constant — do NOT write. | +| Microphone — Enable all | bool | ❓ | +| Microphone — Trigger Source | bool | ❓ | +| Chan 4 Trigger Level | float, dB or psi | ❓ | + +### Notes tab + +| Field | Values / Type | Status | +|---|---|---| +| Enable User Notes | bool | ❓ | +| Project | ASCII string | ✅ (sourced from SUB 5A metadata pages at counter `0x1002` / `0x1004` — see §7.8.7) | +| Client | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| User Name | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| Seis Loc | ASCII string | ✅ (sourced from SUB 5A metadata pages — see §7.8.7) | +| Enable Extended Notes | bool | ❓ | +| Extended Notes | ASCII text | ❓ | +| Extended Notes Title | ASCII string | ❓ | +| Enable Job Number | bool | ❓ | +| Job Number | int | ❓ | +| Enable Scaled Distance | bool | ❓ | +| Distance from Blast | float | ❓ | +| Charge Weight | float | ❓ | + +### Special Setups tab + +| Field | Values / Type | Status | +|---|---|---| +| Unit Timer Mode | Off / On | ❓ | +| Start Date/Time | date+time | ❓ | +| Stop Date/Time | date+time | ❓ | +| Self Check Mode | Off / On | ❓ | +| Self Check Time | HH:MM | ❓ | +| **Sensor Check** | **Before monitoring / After each event / Disabled** | ❓ not yet located | +| Measurement Units | Imperial / Metric | ❓ | +| Show Mic units in dB | bool | ❓ | +| Time Format | 24 Hour / 12 Hour (AM/PM) | ❓ | +| Backlight on Time | int, seconds (0–255) | ✅ event index block +75 | +| Power Saving Timeout | int, minutes | ✅ event index block +83 | +| Monitoring LCD Cycle | int | ✅ event index block +84:86 (uint16 BE) | +| Set unit time with setup | bool | ❓ | + +**Note on Sensor Check:** The dropdown has three states — "Before monitoring", "After each event", "Disabled". The user's unit always runs "Before monitoring", so no enable/disable diff capture has been done yet. Finding this byte requires a capture with Disabled vs Before-monitoring with all other settings held constant. + +--- + +## 7.10 SUB 0x0E — Channel Sensor Data & SUB 0x98 — Trigger Test ✅ 2026-04-08 + +Both confirmed from 4-8-26/sensor-check capture (Blastware "Unit Channel Test" comms check). + +### SUB 0x0E — Channel Sensor Data + +Standard two-step read. Data length: **0x0A (10 bytes)** per channel. + +**Request params:** Channel selector in `params[6:8]` (bytes 6 and 7 of the 10-byte params field). + +| `params[6:8]` | Channel | +|---|---| +| `00 00` | Channel 0 (Transverse) | +| `00 01` | Channel 1 (Vertical) | +| `10 02` | Channel 2 (Longitudinal) — note `0x10` in params[6] | +| `00 03` | Channel 3 | +| `10 04` | Channel 4 — note `0x10` in params[6] | +| `00 05` | Channel 5 | +| `00 06` | Channel 6 | +| `00 07` | Channel 7 | + +Response SUB = 0xFF − 0x0E = **0xF1**. + +**Response data (10 bytes at section = data[11:]):** + +The data response payload for each channel is 10 bytes. From the sensor-check S3 capture, +channels 0 and 1 have non-zero data; channels 5–7 are all-zero (no sensors connected to those channels). Full byte-level field mapping NOT YET done — data includes overswing ratio, frequency, and amplitude per the Blastware "Unit Channel Test" dialog columns. + +Example (channel 0, first pass): +``` +data[11:] = 00 01 00 00 4A 00 25 10 02 0A (17 bytes including probe + data frames combined) +``` + +Probe frame response confirms data length in page bytes; data frame carries the 10-byte channel reading. + +**Blastware "Unit Channel Test" sequence (confirmed 4-8-26/sensor-check):** + +``` +SESSION_RESET + POLL × 3 (startup — SESSION_RESET required for monitoring unit) +SUB 0x08 (event index read) +POLL × 8 (Blastware polls while waiting; unit may be in sensor check during this window) +SUB 0x15 (serial number, data length 0x0A) +SUB 0x01 (device info, data length 0x98) +SUB 0x08 (event index again) +SUB 0x01 (device info again) +SUB 0x0E × 8 channels (pass 1 — channels 0–7, probe+data each) + [~40 second gap if unit is performing on-device sensor check] +SUB 0x0E × 8 channels (pass 2 — same channels, fresh ADC readings) +SUB 0x98 × 2 (trigger test) +``` + +### SUB 0x98 — Trigger Test + +Single probe frame only. No data step. + +**Request format:** `params[0] = 0xFF` (all other param bytes = 0x00). Sent as a single frame (probe step only, no data step). + +Response SUB = 0xFF − 0x98 = **0x67**. Response is a standard 17-byte zero-data S3 frame. + +Wire bytes for request (confirmed frame 52 of 4-8-26 BW capture): +``` +41 02 10 10 00 98 FF 00 00 00 00 00 00 00 00 00 00 00 00 A7 03 +``` + +Blastware sends SUB 0x98 twice per comms-check cycle. + +### SUB 0x01 — Device Info Block ❓ + +Observed in Blastware comms-check init sequence (before 0x0E channel reads). Standard two-step read with data length 0x98 (152 bytes). + +**Response SUB = 0xFE** (= 0xFF − 0x01 = 0xFE). + +⚠️ **Naming collision:** The existing SUB 0xFE (Full Config Read, RSP 0x01) and this SUB 0x01 (RSP 0xFE) are inverse commands. They are NOT the same command. SUB 0xFE is a full 166-byte config block used for firmware version, calibration date, etc. SUB 0x01 returns 152 bytes and appears to contain a subset of device identification data. + +Observed payload (data[11:], first ~40 bytes of 161 total): +``` +00 00 00 00 00 42 45 31 31 35 32 39 00 ... "BE11529\0" +``` +Contains serial number, firmware bytes, and floating-point calibration fields. Full field map NOT YET done. + +--- + +## 7.11 Erase-All Protocol (SUBs 0xA3 / 0xA2 / 0x06) ✅ 2026-04-11 + +> ✅ **Confirmed 2026-04-11** from MITM capture of a live Blastware ACH session +> (`bridges/captures/mitm/ach_mitm_20260411_001912/`). + +Blastware uses a 4-step sequence to erase all stored events from device memory. +All frames use standard `build_bw_frame` format (NOT write-format). + +### 7.11.1 Wire Sequence + +``` +BW → device: SUB 0xA3 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 +device → BW: SUB 0x5C (begin-erase ack) + +BW → device: SUB 0x1C offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) +device → BW: SUB 0xE3 (probe ack) +BW → device: SUB 0x1C offset=0x002C params=(same) (data) +device → BW: SUB 0xE3 (44-byte monitor status response) + +BW → device: SUB 0x06 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 (probe) +device → BW: SUB 0xF9 (probe ack) +BW → device: SUB 0x06 offset=0x0024 params=(same) (data) +device → BW: SUB 0xF9 (36-byte storage range response) + +BW → device: SUB 0xA2 offset=0x0000 params=00 00 00 00 00 00 00 FE 00 00 +device → BW: SUB 0x5D (confirm-erase ack — device memory is now cleared) +``` + +All response SUBs follow the standard formula `0xFF − request_SUB`. No exceptions. +The `token=0xFE` at `params[7]` is required for 0xA3, 0x06, and 0xA2. + +### 7.11.2 SUB 0x06 Storage Range Response (36 bytes) + +The 36-byte response from the data step ends with two 4-byte event keys: + +| Offset (from response end) | Field | Notes | +|---|---|---| +| `[-8:-4]` | First stored event key | e.g. `0111ea60` before erase | +| `[-4:]` | Last stored event key | e.g. `0111eaa6` before erase | + +After a successful erase: +- Both keys read `01110000` (device-empty sentinel) +- The device's internal event counter has reset + +Example pre-erase: `... 0111ea60 0111eaa6` +Example post-erase: `... 01110000 01110000` + +### 7.11.3 Post-Erase Key Counter Reset + +After a successful erase the device resets its event counter. New events start +from key `0x01110000` — the same key as the very first event ever recorded on +the device. This means: + +- Any system using event keys for deduplication must clear its "seen keys" state + after an erase, or risk treating fresh events as already downloaded. +- Detection heuristic: if `max(device_keys) < historical_max_key`, the counter + was reset. All device keys should be treated as new regardless of prior state. + +The `ach_server.py` implementation stores `max_downloaded_key` in `ach_state.json` +and applies this heuristic on every call-home. + +### 7.11.4 Implementation Notes + +- `MiniMateClient.delete_all_events()` in `client.py` orchestrates the full sequence. +- `MiniMateProtocol` exposes `begin_erase_all()`, `confirm_erase_all()`, and + `read_event_storage_range()` as separate methods. +- The ACH server `--clear-after-download` flag calls `delete_all_events()` after a + successful event download and resets `ach_state.json` state for the unit. + +--- + +### 7.12 Auto Call Home Config (SUB 0x2C / 0x7E / 0x7F) — ✅ CONFIRMED 2026-04-20 + +> Confirmed from `bridges/captures/4-20-26/call home settings/` — 10 BW TX write frames +> diffed against the S3 read payload. Accessible in Blastware via Remote Access → Setup Unit. + +#### 7.12.1 Read Protocol — SUB 0x2C → Response 0xD3 + +Standard two-step read: + +| Step | Offset | Purpose | +|---|---|---| +| Probe | `0x0000` | Get ack (no data returned) | +| Data | `0x007C` (124) | Receive 125-byte raw payload | + +`DATA_LENGTHS[SUB_CALL_HOME] = 0x7C` + +The raw payload is accessed as `data_rsp.data[11:]` — this is 125 bytes (not 124) because +the device returns logical value 0x03 (num_retries=3) as the two-byte wire sequence +`\x10\x03`. S3FrameParser is in `STATE_IN_FRAME` when it sees `0x10`, transitions to +`STATE_AFTER_DLE`, and then on `0x03` (ETX qualifier) it would normally end the frame — +but in the `_IN_FRAME_DLE` state it instead appends **both** the `0x10` and the `0x03` +literally to the payload. The result: `raw[117] = 0x10`, `raw[118] = 0x03`, and all +subsequent fields are shifted +1 from their logical positions. + +#### 7.12.2 Raw Payload Field Map (125 bytes, from `data_rsp.data[11:]`) + +> All offsets are into the 125-byte raw array. Offsets ≥ 119 are shifted +1 from logical +> due to the DLE-escaped 0x03 at raw[117:119]. + +| Raw Offset | Field | Type | Notes | +|---|---|---|---| +| `[5]` | `auto_call_home_enabled` | uint8 | `0x00` = disabled, `0x01` = enabled | +| `[6:46]` | `dial_string` | ASCII | 40-byte null-padded, e.g. `"12345"` or phone number | +| `[87]` | `after_event_recorded` | uint8 | `0x00` = off, `0x01` = on | +| `[91]` | `at_specified_times` | uint8 | `0x00` = off, `0x01` = on | +| `[93]` | `time1_enabled` | uint8 | `0x00` = off, `0x01` = on | +| `[101]` | `time1_hour` | uint8 | 0–23 | +| `[102]` | `time1_min` | uint8 | 0–59 | +| `[95]` | `time2_enabled` | uint8 | `0x00` = off, `0x01` = on | +| `[105]` | `time2_hour` | uint8 | 0–23 | +| `[106]` | `time2_min` | uint8 | 0–59 | +| `[117]` | DLE prefix `0x10` | — | Part of `\x10\x03` wire encoding for num_retries value 3 | +| `[118]` | `num_retries` (value = 3) | uint8 | Logical value 0x03; check `raw[117] == 0x10` to detect DLE prefix | +| `[120]` | `time_between_retries_sec` | uint8 | Shift +1 from logical 119 | +| `[122]` | `wait_for_connection_sec` | uint8 | Shift +1 from logical 121 | +| `[124]` | `warm_up_time_sec` | uint8 | Shift +1 from logical 123 | + +**Unconfirmed fields** (offsets not yet mapped from captures): +- Time slots 3 and 4 (if they exist — Blastware UI only shows 2 time slots in observed sessions) +- `modem_power_relay_enabled` (bool) +- `storage_mode` (call home trigger on all events vs. triggered only?) + +#### 7.12.3 DLE-Escaped 0x03 — Critical Detail + +The `\x10\x03` sequence at raw[117:119] is **not** a DLE stuffing artifact in the usual +sense. Standard DLE stuffing escapes `\x10` → `\x10\x10`. But here the device is encoding +the integer value `3` in a position where the byte `\x03` would be indistinguishable from +the frame ETX terminator. The device therefore sends `\x10\x03` (DLE + ETX = "inner-frame +terminator" in S3 inner-frame syntax). S3FrameParser correctly handles this: in +`STATE_AFTER_DLE`, seeing `\x03` (ETX) while **inside** an outer frame causes it to +append both `\x10` and `\x03` as literal bytes rather than ending the frame. The outer +frame only terminates on a **bare** `\x03` (without the DLE prefix). + +The write frame sends these bytes verbatim — the device accepts `\x10\x03` in the write +payload and interprets it as the value 3. No transformation is needed in +`_encode_call_home_config()`. + +**Limitation:** Any field that needs to encode the value `3` (0x03) requires this DLE +prefix. The current encoder raises `ValueError` if any hour or minute field equals 3, +since the encoder does not yet implement DLE-prefixed writes for arbitrary field positions. +In practice, 3:00 AM / 3 minutes past are unlikely scheduled call times. + +#### 7.12.4 Write Protocol — SUB 0x7E → 0x7F + +Write format (same as other write commands — only BW_CMD `0x10` doubled on wire; +all other bytes written raw; DLE-aware checksum): + +| Step | SUB | Payload | Offset | Response | +|---|---|---|---|---| +| Data write | `0x7E` | 127 bytes (125-byte read payload + `\x00\x00`) | `data[1]+2 = 0x7E` (126) | `0x81` | +| Confirm | `0x7F` | empty | `0x00` | `0x80` | + +**Write payload construction:** +```python +write_payload = bytearray(raw_125_bytes) +write_payload.append(0x00) +write_payload.append(0x00) +# patch fields in-place, then pass bytes(write_payload) to build_bw_write_frame +``` + +**Offset formula:** `write_payload[1] = 0x7C` (same as DATA_LENGTH). +`offset = write_payload[1] + 2 = 0x7C + 2 = 0x7E = 126`. +This follows the identical pattern as SUB 0x68 (event index write) and SUB 0x69 (waveform write). + +**No preceding 0x2C read required** — Blastware sends SUB 0x7E directly using cached +state. The `seismo-relay` implementation always reads first (`get_call_home_config()`) +before writing for safety. + +#### 7.12.5 Implementation Notes + +- `MiniMateProtocol.read_call_home_config()` — standard two-step read; returns `data_rsp.data[11:]` (125 bytes raw) +- `MiniMateProtocol.write_call_home_config(data)` — sends SUB 0x7E (127-byte payload) then SUB 0x7F confirm +- `MiniMateClient.get_call_home_config()` → `CallHomeConfig` dataclass +- `MiniMateClient.set_call_home_config(...)` — reads current config, patches via `_encode_call_home_config()`, writes back +- `_decode_call_home_config(raw)` — handles DLE prefix detection at raw[117] +- `_encode_call_home_config(raw, ...)` — patches in-place, appends 2 trailing zeros; raises `ValueError` if any hour/min == 3 +- REST API: `GET /device/call_home` and `POST /device/call_home` in `sfm/server.py` +- Web UI: "Call Home" tab in `sfm/sfm_webapp.html` + +--- + +## 8. Timestamp Format + +Two timestamp wire formats are used: + +### 8.1 6-byte format (event index / 1E header) +> 🔶 **Updated 2026-02-26** — Year field resolved. Confidence upgraded. + +Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent. + +**Observed example:** +``` +01 07 CB 00 06 1E +``` + +| Byte(s) | Value | Meaning | Certainty | +|---|---|---|---| +| `01` | 1 | Record validity / type flag | 🔶 INFERRED | +| `07 CB` | 1995 | Year — 16-bit big-endian integer | ✅ CONFIRMED — 2026-02-26 | +| `00` | 0 | Unknown separator | ❓ | +| `06` | 6 | Month (June) | ✅ CONFIRMED | +| `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED | + +> ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly. + +### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10) +> ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report +> for BE11529 thump event: "00:28:12 April 1, 2026". + +Full date + time, including a sub_code byte. Used for **single-shot waveform** +recordings (`sub_code = 0x10`). + +**Observed example (thump event, 2026-04-01):** +``` +01 10 04 07 ea 00 00 1c 0c +``` + +| Byte(s) | Value | Meaning | Certainty | +|---|---|---|---| +| `01` | 1 | Day | ✅ | +| `10` | 0x10 | Sub_code: `0x10` = Waveform single-shot | ✅ | +| `04` | 4 | Month (April) | ✅ | +| `07 ea` | 2026 | Year — 16-bit big-endian integer | ✅ | +| `00` | 0 | Unknown separator | ❓ | +| `00` | 0 | Hour | ✅ | +| `1c` | 28 | Minute | ✅ | +| `0c` | 12 | Second | ✅ | + +### 8.3 10-byte format (Full Waveform Record / SUB 0C, sub_code=0x03; monitor-log partial records) +> ✅ **CONFIRMED 2026-04-03** — Cross-referenced against Blastware event report +> for BE11529 (15:20:17 April 3, 2026). Same layout is used for partial-record +> (monitor log, record type `0x2C`) entries — see §7.10 / `_decode_0a_partial_header`. + +Used for **continuous waveform** recordings (`sub_code = 0x03`). One byte +wider than the 9-byte layout — a leading `0x10` marker shifts every subsequent +field by +1. + +**Observed example (continuous event, 2026-04-03 15:20:17):** +``` +10 03 10 04 07 ea 00 0f 14 11 +``` + +| Byte | Value | Meaning | +|---|---|---| +| `10` | 0x10 | Marker; how the decoder distinguishes 10-byte from 9-byte layout | +| `03` | 3 | Day | +| `10` | 0x10 | Marker (reflects wire-encoded sub_code=0x03) | +| `04` | 4 | Month | +| `07 ea` | 2026 | Year — uint16 BE | +| `00` | 0 | Unknown separator | +| `0f` | 15 | Hour | +| `14` | 20 | Minute | +| `11` | 17 | Second | + +**Auto-detection rule:** if `record[0] == 0x10`, use the 10-byte layout; +otherwise use the 9-byte layout. + +The `.MLG` file for a single-shot event stores the timestamp in a different +binary representation (little-endian year, no sub_code byte), confirming the +waveform record and the saved file use distinct serialisation formats. + +--- + +## 9. Out-of-Band / Non-Frame Messages + +| Message | Direction | Trigger | Certainty | +|---|---|---|---| +| `"Operating System"` | S3 → BW | Device boot / UART init / RTC reset | ✅ CONFIRMED | + +> The device prints this boot string directly to the UART **before** switching to DLE-framed binary protocol mode. Your implementation should discard any non-`0x41`/non-`0x10 0x02` bytes during the connection phase. Wait for the first valid framed poll response before proceeding. + +--- + +## 10. DLE Byte Stuffing +> ✅ **CONFIRMED — 2026-02-26** (previously ❓ SPECULATIVE) + +This protocol uses standard **DLE (Data Link Escape) byte stuffing**, a classical technique used in protocols like IBM BISYNC dating to the 1970s. + +### Parser State Machine + +``` +IDLE: + receive 0x41 → emit ACK event, stay IDLE + receive 0x10 → goto WAIT_STX + +WAIT_STX: + receive 0x02 → frame started, goto IN_FRAME + receive anything → error, goto IDLE + +IN_FRAME: + receive 0x10 → goto ESCAPE + receive any byte → append to buffer, stay IN_FRAME + +ESCAPE: + receive 0x03 → frame complete — validate checksum, process buffer, goto IDLE + receive 0x10 → append single 0x10 to buffer, goto IN_FRAME (stuffed literal) + receive 0x02 → error (nested STX), goto IDLE + receive anything → error, goto IDLE +``` + +--- + +## 11. Checksum Reference Implementation +> ⚠️ **Updated 2026-03-12** — BW→S3 large-frame checksum algorithm confirmed. Two distinct formulas apply depending on frame direction and size. + +### Checksum Overview + +| Direction | Frame type | Formula | Coverage | +|---|---|---|---| +| S3→BW | All frames | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | +| BW→S3 | Small frames (POLL, read cmds) | `sum(payload) & 0xFF` | All de-stuffed payload bytes `[0:-1]` | +| BW→S3 | Large write frames (SUB `68`, `69`, `71`, `82`, `7E`, `1A`+data) | DLE-aware large-frame: `(sum(payload[2:] where b != 0x10) + 0x10) & 0xFF` | De-stuffed payload bytes `[2:]`, skipping `0x10` bytes, plus constant | +| BW→S3 | SUB 5A bulk waveform | DLE-aware over the **stuffed** wire bytes | For each `10 XX` pair in the stuffed section, count `XX`; lone bytes count as-is. See `build_5a_frame` in `minimateplus/framing.py`. | + +### BW→S3 Large-Frame Checksum Formula + +```python +def calc_checksum_bw_large(payload: bytes) -> int: + """ + Checksum for large BW→S3 write frames (SUB 68, 69, 71, 82, 1A with data). + + Formula: sum all bytes in payload[2:-1], skipping 0x10 bytes, add 0x10, mod 256. + Confirmed across 20 frames from two independent captures (2026-03-12). + """ + return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF +``` + +**Why this formula:** The CMD byte at `payload[0]` is always `0x10` (DLE). The byte at `payload[1]` is always `0x00`. Starting from `payload[2]` skips both. All `0x10` bytes in the data section are excluded from the sum, then `0x10` is added back as a constant — effectively treating DLE as a transparent/invisible byte in the checksum. This is consistent with `0x10` being a framing/control character in the protocol. + +**Consistency check:** For small frames, `payload[0]` = `0x10` and there are no other `0x10` bytes in the payload. The large-frame formula applied to a small frame would give `(sum(payload[2:-1]) + 0x10) = sum(payload[0:-1])` — identical to the plain SUM8. The two formulas converge for frames without embedded `0x10` data bytes. + +```python +DLE = 0x10 +STX = 0x02 +ETX = 0x03 +ACK = 0x41 + + +def stuff(data: bytes) -> bytes: + """Escape all 0x10 bytes in payload as 0x10 0x10 for transmission.""" + out = [] + for b in data: + out.append(b) + if b == DLE: + out.append(DLE) # double it + return bytes(out) + + +def destuff(data: bytes) -> bytes: + """Remove DLE stuffing from received payload bytes.""" + out = [] + i = 0 + while i < len(data): + if data[i] == DLE and i + 1 < len(data) and data[i + 1] == DLE: + out.append(DLE) + i += 2 + else: + out.append(data[i]) + i += 1 + return bytes(out) + + +def calc_checksum_s3(payload: bytes) -> int: + """ + Standard SUM8: used for all S3→BW frames and small BW→S3 frames. + Sum of all payload bytes (excluding the checksum byte itself), mod 256. + """ + return sum(payload) & 0xFF + + +def calc_checksum_bw_large(payload: bytes) -> int: + """ + Large BW→S3 write frame checksum (SUB 68, 69, 71, 82, 1A with data). + Sum payload[2:-1] skipping 0x10 bytes, add 0x10, mod 256. + """ + return (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF + + +# Backwards-compatible alias +def calc_checksum(payload: bytes) -> int: + return calc_checksum_s3(payload) + + +def build_frame(payload: bytes) -> bytes: + """ + Build a complete on-wire frame from a raw payload. + Output: ACK + DLE+STX + stuffed_payload + checksum + DLE+ETX + """ + chk = calc_checksum(payload) + stuffed = stuff(payload) + return bytes([ACK, DLE, STX]) + stuffed + bytes([chk, DLE, ETX]) + + +def parse_frame(raw: bytes) -> bytes | None: + """ + Parse and validate a raw on-wire frame. + Accepts input starting with ACK (0x41) or DLE+STX (0x10 0x02). + Returns de-stuffed payload bytes on success, None on any error. + """ + # Strip optional leading ACK + if raw and raw[0] == ACK: + raw = raw[1:] + + # Validate frame delimiters + if len(raw) < 5: + return None + if raw[0] != DLE or raw[1] != STX: + return None + if raw[-2] != DLE or raw[-1] != ETX: + return None + + # Extract: everything between DLE+STX and DLE+ETX + inner = raw[2:-2] + chk_received = inner[-1] + stuffed_payload = inner[:-1] + + # De-stuff and validate checksum + payload = destuff(stuffed_payload) + if calc_checksum(payload) != chk_received: + return None + + return payload + + +# ── Example: build a POLL probe request (SUB 5B) ───────────────────────────── +# Layout per §3: BW_CMD=0x10, flags=0x00, SUB=0x5B, [0x00, 0x00], OFFSET=0x00, +# then 10 bytes of params — 16 bytes total payload. +poll_payload = bytes([ + 0x10, # [0] BW_CMD + 0x00, # [1] flags + 0x5B, # [2] SUB: POLL + 0x00, 0x00, # [3:5] always zero + 0x00, # [5] OFFSET (probe step) + 0x00, 0x00, 0x00, 0x00, 0x00, # [6:11] params + 0x00, 0x00, 0x00, 0x00, 0x00, # [11:16] params +]) +# checksum = SUM8 over payload[0:-1] for small read frames; here = (0x10 + 0x5B) & 0xFF = 0x6B +# Wire output (BW→S3): the leading 0x10 is DLE-stuffed to 0x10 0x10: +# 41 02 10 10 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 6B 03 +# ^ ^ ^^^^^ ^ ^ +# ACK STX (bare 0x02) chk bare ETX +# See `build_bw_frame()` in `minimateplus/framing.py` for the canonical builder. +``` + +--- + +## 12. Recommended Implementation Sequence + +Build in this order — each step is independently testable. **Don't try to +implement event download (step 8 onward) without reading §6.1 first** — the +1E-arm / POLL×3 / 5A walk has multiple device-side state-machine prerequisites +that are easy to miss. + +1. **DLE frame parser** — stateful byte-by-byte reader implementing the §10 state machine. Handles ACK, stuffing, de-stuffing, bare-ETX termination, checksum validation. +2. **`connect(port, baud=38400)`** — open port, flush buffer, discard ASCII boot strings (§9), send first POLL frame. +3. **`identify()`** — SUB `5B` two-step read → returns `{"manufacturer": "Instantel", "model": "MiniMate Plus"}`. +4. **`get_serial()`** — SUB `15` two-step read → returns serial number string. +5. **`get_config()`** — SUB `01` / SUB `FE` two-step read → returns full config dict (firmware, calibration date, aux trigger). +6. **`get_event_count()`** — SUB `08` event index read. +7. **`get_event_header(key)`** — SUB `1E` (browse mode, token=`0x00` at params[7]) → first event key; iterate with SUB `1F`. +8. **`get_event_record(key)`** — SUB `0C` paginated read → 210-byte waveform record (peaks, timestamp, project). Use the 9-byte / 10-byte timestamp auto-detect from §7.5b / §8. +9. **`download_waveform(key)`** — SUB `5A` bulk stream. **Requires the full arm sequence from §6.1:** 0A → 1E(arm) → 0C → 1F(arm) → POLL × 3 → 5A. Use the STRT-bounded chunk walk from §7.8.5, the TERM frame from §7.8.6, and the metadata pages from §7.8.7. +10. **Write commands** — see §5.3 for the frame format and SUB pairings. Compliance push, call-home setup, and erase-all are all confirmed (§7.11, §7.12). + +--- + +## 13. Devices Under Test + +Multiple units have contributed captures to this reference. Primary development +target is **BE11529** (firmware S338.17); earlier sessions used BE18189. + +| Field | Primary unit | Secondary unit(s) | +|---|---|---| +| Manufacturer | Instantel | — | +| Model | MiniMate Plus | — | +| Serial Number | **BE11529** | BE18189, BE6907, BE14036, BE17353, BE18003, BE18191, BE18676 (archive only) | +| Firmware | **S338.17** | S337.17 (BE18189); various S338.x for other units | +| DSP / Secondary FW | 10.72 | 10.72 | +| Channels | Tran, Vert, Long, MicL (4 channels) | — | +| Sample Rate | 1024 / 2048 / 4096 sps (selectable) | — | +| Bridge Config (RS-232) | direct or via Sierra Wireless RV50/RV55 modem, 38400,8N1 | — | +| Bridge Config (TCP) | port 12345 (configurable) | — | +| Capture Tool | s3_bridge v0.5.0+ | v0.4.0 used for 1-2-26 / 3-11-26 captures | + +--- + +## 14. TCP / Modem Transport +> ✅ **CONFIRMED — 2026-03-31** from Blastware Operator Manual 714U0301 Rev 22 §4.4 and ACEmanager Raven modem configuration screenshots. + +The MiniMate Plus protocol is **fully transport-agnostic at the byte level**. The same DLE-framed S3/BW frame stream that flows over RS-232 is transmitted unmodified over a TCP socket. No additional framing, handshake bytes, or session tokens are added at the application layer. + +--- + +### 14.1 Two Usage Modes + +**"Call Up" (Outbound TCP — SFM connects to modem)** + +Blastware or SFM opens a TCP connection to the modem's static IP address on its device port. The modem bridges the TCP socket to its RS-232 serial port, which is wired directly to the MiniMate Plus. From the protocol perspective this is identical to a direct serial connection. + +``` +SFM ──TCP──► Raven modem ──RS-232──► MiniMate Plus + (static IP, port N) (38400,8N1) +``` + +This is the mode implemented by `TcpTransport(host, port)`. Typical call: + +``` +GET /device/info?host=203.0.113.5&tcp_port=12345 +``` + +**"Call Home" / ACH (Inbound TCP — unit calls the server)** + +The MiniMate Plus is configured with an IP address and port. On an event trigger or scheduled time it powers up its modem, which establishes a TCP connection outbound to the server. Blastware (or a future SFM ACH listener) accepts the incoming connection. After the unit connects, the PC has a configurable "Wait for Connection" window to send the first command before the unit times out and hangs up. + +``` +MiniMate Plus ──RS-232──► Raven modem ──TCP──► ACH server (listening) + (static office IP, port N) +``` + +`TcpTransport` is a **client** (outbound connect only). A separate `AchServer` listener component is needed for this mode — not yet implemented. + +--- + +### 14.2 No Application-Layer Handshake on TCP Connect + +✅ **Confirmed from ACEmanager configuration screenshot:** + +``` +Enable ENQ on TCP Connect: 0-Disable +``` + +When a TCP connection is established (in either direction), **no ENQ byte or other handshake marker is sent** by the modem before the protocol stream starts. The first byte from either side is a raw protocol byte — for SFM-initiated call-up, SFM sends POLL_PROBE immediately after `connect()`. + +**Sierra Wireless RV50/RV55 note:** Even with Quiet Mode enabled, these modems send `\r\nRING\r\n\r\nCONNECT\r\n` over the TCP connection to the calling client at connect time. Quiet Mode only suppresses these strings on the *serial* port (protecting the MiniMate Plus). The TCP client must tolerate these prefix bytes — scan for DLE+STX (`0x10 0x02`) and discard everything before it. This is the same approach used for the `"Operating System"` boot string (§9). + +The Raven X (deprecated) did not exhibit this behaviour. The note below about "no CONNECT string" describes Raven X with ENQ-disable; it does **not** apply to RV50/RV55. + +No ENQ byte or other application-layer handshake is added. The Raven modem's TCP dialog is configured with: + +| ACEmanager Setting | Value | Meaning | +|---|---|---| +| TCP Auto Answer | 2 — Telnet Server | TCP mode (transparent pass-through, not actually Telnet) | +| Telnet Echo Mode | 0 — No Echo | No echo of received bytes | +| Enable ENQ on TCP Connect | 0 — Disable | No ENQ byte on connect | +| TCP Connect Response Delay | 0 | No delay before first byte | +| TCP Idle Timeout | **2** (minutes) | Prevents premature disconnect; must match §14.3 | + +--- + +### 14.3 Modem Serial Port Configuration + +> **Hardware note:** The Raven X modem shown in the Blastware manual is 3G-only and no longer operational (3G network shutdown). The current field hardware is the **Sierra Wireless RV55** (and newer RX55). Both run ALEOS firmware and have an identical ACEmanager web UI — the settings below apply to all three generations. + +The modem's RS-232 port (wired to the MiniMate Plus) must be configured as: + +| ACEmanager Setting | Value | +|---|---| +| Configure Serial Port | **38400,8N1** | +| Flow Control | None | +| DB9 Serial Echo | OFF | +| Data Forwarding Timeout | **`1` (= 0.1 s)** in ACEmanager units (1 tick = 0.1 s; see §14.3 RV50/RV55 table) | +| Data Forwarding Character | 0 (disabled) | + +The **Data Forwarding Timeout** is the most protocol-critical setting. The modem +accumulates bytes from the RS-232 port for up to the configured interval before +forwarding them as a TCP segment. This means: + +- A large S3 response frame may arrive as multiple TCP segments with up to 1-second gaps between them. +- A `read_until_idle` implementation with `idle_gap < 1.0 s` will **incorrectly declare the frame complete mid-stream**. +- `TcpTransport.read_until_idle` overrides the default `idle_gap=0.05 s` to `idle_gap=1.5 s` to compensate. + +If connecting to a unit via a direct Ethernet connection (no serial modem in the path), the 1.5 s idle gap will still work but will feel slower. In that case you can pass `idle_gap=0.1` explicitly. + +#### Sierra Wireless RV50 / RV55 Required Settings +> ✅ **CONFIRMED — 2026-03-31** from working RV50 field config vs misconfigured RV55. + +The following ACEmanager Serial settings are required for correct transparent operation. A single wrong setting is enough to break the protocol exchange (unit beeps on connect but never returns an S3 frame): + +| ACEmanager Setting | Required Value | Why | +|---|---|---| +| **Quiet Mode** | **Enable** | Disabling it causes the modem to inject `RING\r\nCONNECT\r\n` onto the RS-232 serial line at connection time, corrupting the S3 handshake. | +| **Configure Serial Port** | `38400,8N1` | Must match MiniMate baud rate. | +| **Flow Control** | `None` | Hardware flow control (CTS/RTS) will block unit's serial TX if pins are not wired. | +| **Data Forwarding Timeout** | `1` (= 0.1 s) | Controls RS-232→TCP forwarding latency. `5` (0.5 s) works but is sluggish; `1` matches working field units. | +| **TCP Connect Response Delay** | `0` | Any non-zero value causes the modem to silently discard our POLL frame during the delay window. | +| **TCP Idle Timeout** | `2` (minutes) | Prevents premature disconnect. Too low and the modem drops the session before the unit responds. | +| **DB9 Serial Echo** | `Disable` | Echo would corrupt the S3 stream. | + +--- + +### 14.4 Connection Timeouts on the Unit Side + +The MiniMate Plus firmware has two relevant timeouts configurable via Blastware's Call Home Setup dialog: + +| Timeout | Description | Impact | +|---|---|---| +| **Wait for Connection** | Seconds after TCP connect during which the unit waits for the first BW frame. If nothing arrives, unit terminates the session. | SFM must send POLL_PROBE within this window after `connect()`. Default appears short (≈15–30 s). | +| **Serial Idle Time** | Seconds of inactivity after which the unit terminates the connection. | SFM must complete its work and disconnect cleanly — or send periodic keep-alive frames — within this window. | + +For our `TcpTransport` + `MiniMateProtocol` stack, both timeouts are satisfied automatically because `connect()` is immediately followed by `protocol.poll()` which sends POLL_PROBE, and the full session (POLL + read + disconnect) typically completes in < 30 seconds. + +--- + +### 14.5 Port Numbers + +The TCP port is **user-configurable** in both Blastware and the modem. There is no universally fixed port. + +| Setting location | Value in manual example | Value in user's install | +|---|---|---| +| Blastware TCP Communication dialog | 12335 | 12345 | +| Raven ACEmanager Destination Port | 12349 (UDP example) | varies | + +`TcpTransport` defaults to `DEFAULT_TCP_PORT = 12345` which matches the user's install. This can be overridden by the `port` argument or the `tcp_port` query parameter in the SFM server. + +--- + +### 14.6 ACH Session Lifecycle (Call Home Mode) ✅ IMPLEMENTED 2026-04-11 + +When the unit calls home under ACH, the session lifecycle from the unit's perspective is: + +1. Unit triggers (event or scheduled time) +2. Unit powers up modem, dials / connects TCP to server IP:port +3. Unit waits for "Wait for Connection" window for first BW frame from server +4. Server sends POLL_PROBE → unit responds with POLL_RESPONSE (same as serial) +5. Server reads serial number, full config, events as needed +6. (Optional) Server erases device memory: SUB 0xA3 → 0x1C → 0x06 → 0xA2 +7. Server disconnects (or unit disconnects on Serial Idle Time expiry) +8. Unit detects DCD/DTR going low (modem signals line drop), returns to monitor mode automatically + +Step 4 onward is **identical to the serial/call-up protocol**. The only difference +from our perspective is that we are the **listener** rather than the **connector**. + +**Implementation: `bridges/ach_server.py`** — run with `python bridges/ach_server.py`. +Key flags: +- `--clear-after-download` — erase device memory after a successful event download +- `--allow-ip IP` — restrict to specific unit IPs +- `--max-events N` — cap events per session for safety + +**State persistence: `ach_state.json`** — tracks `downloaded_keys` (set of event key +hex strings) and `max_downloaded_key` (high-water mark) per unit serial number. +Post-erase key reuse (`0x01110000` recycled) is detected via the high-water mark. + +**Note on DCD/DTR:** The MiniMate Plus monitors the RS-232 DCD line. When the TCP +connection closes, the Sierra Wireless modem drops DCD, which the unit interprets as +"serial connection ended" and automatically resumes monitoring. No `start_monitoring()` +(SUB 0x96) command is needed from the server. ⚠️ Newer RV55 firmware may not assert DCD +by default — known issue, not yet resolved. + +--- + +## Appendix A — s3_bridge Capture Format +> ✅ **CONFIRMED — 2026-02-26** + +> ⚠️ **This behavior is not part of the Instantel protocol. It is an artifact of the bridge logger implementation.** + +The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger makes one modification: + +| Wire sequence | In .bin file | Notes | +|---|---|---| +| `0x10 0x03` (DLE+ETX) | `0x03` | DLE stripped from end-of-frame marker | +| All other bytes | Unchanged | ACK, DLE+STX, stuffed payload, checksum all preserved verbatim | + +**Practical impact for parsing `.bin` files:** +- Frame end: scan for bare `0x03` (not `0x10 0x03`) +- Checksum: the byte immediately before the bare `0x03` is the checksum +- Everything else (ACK detection, DLE+STX, payload de-stuffing) works as documented in §10 + +> ⚠️ This means checksums cannot be verified on frames where the stuffed payload ends in `0x10` — that trailing `0x10` would normally be the DLE prefix of ETX, but the logger strips it, making the frame boundary ambiguous in that edge case. In practice this has not been observed in captured data. + +--- + +## 15. Open Questions / Still Needs Cracking + +| Question | Priority | Added | Notes | +|---|---|---|---| +| Timestamp 6-byte format byte[3] — purpose of the separator `0x00` byte | LOW | 2026-02-26 | Not blocking; 9-byte waveform record format (§8.2) fully confirmed without this byte. | +| `trail[0]` in serial number response — unit-specific byte, derivation unknown. `trail[1]` resolved as firmware minor version. | MEDIUM | 2026-02-26 | | +| ~~Full channel ID mapping in SUB `5A` stream~~ — **RESOLVED 2026-08-25 for the waveform body:** every `40 NN` segment header carries `[channel_id][00][00][segment_index]` at `data[2*NN+4]`, with `0x46`=Tran `0x47`=Vert `0x48`=Long `0x49`=MicL. Verified on 1697/1697 segment headers with zero disagreements against the decoded channel rotation. See §7.6.1. | RESOLVED | 2026-02-26 | Resolved 2026-08-25 | +| ~~Exact byte boundaries of project string fields in SUB `71` write frame~~ — **RESOLVED 2026-05-05:** project/client/operator/seis-loc/extended-notes come from SUB 5A metadata pages at counter `0x1002` / `0x1004` (§7.8.7), NOT from the SUB 71 write payload. `_decode_a5_metadata_into` locates them via ASCII label scans. | RESOLVED | 2026-02-26 | Resolved 2026-05-05 | +| Purpose of SUB `09` / response `F6` — 202-byte read block | MEDIUM | 2026-02-26 | | +| Purpose of SUB `2E` / response `D1` — 26-byte read block | MEDIUM | 2026-02-26 | | +| Full field mapping of SUB `1A` / response `E5` — channel scaling / compliance config block. **RESOLVED 2026-04-21:** Multi-frame sequence (§7.6.2), page_key chunking, duplicate-page detection, record_time at anchor+6 (§7.6.1), sample_rate at anchor−6 (§7.6.3), recording_mode at anchor−8 (§7.6.4), histogram_interval at anchor−4, trigger_level_geo and alarm_level_geo in channel block (§7.6), geo_range at channel_label+33 (§7.6), adc_scale_factor at channel_label+28, and project strings (via 5A metadata pages, §7.8.7) all confirmed. | RESOLVED | 2026-02-26 | Resolved 2026-04-21 | +| `0x082A` in channel config block — not trigger, alarm, or record time directly. **RESOLVED: fixed E5 payload length (2090 bytes).** Constant regardless of all settings. | RESOLVED | 2026-03-01 | Resolved 2026-03-09 | +| **Record time in wire protocol** — float32 BE, anchor-relative in cfg (see §7.6.1/§7.6.3). **RESOLVED.** Previous `+0x28` offset was unreliable due to DLE jitter — superseded by anchor search. Confirmed at 3, 5, 7, 8, 10, 13 seconds. | RESOLVED | 2026-03-09 | Confirmed 2026-03-09; anchor method confirmed 2026-04-01 | +| **Sample rate** — uint16 BE at anchor−2 in cfg. **RESOLVED.** Normal=1024, Fast=2048, Faster=4096. Anchor required to handle DLE jitter. See §7.6.3. | RESOLVED | 2026-04-01 | Confirmed 2026-04-01 | +| Unknown uint16 fields at channel block +0A (=80), +0C (=15), +0E (=40), +10 (=21) — manual describes "Sensitive (Gain=8) / Normal (Gain=1)" per-channel range; 80/15/40/21 might encode gain, sensitivity, or ADC config. | LOW | 2026-03-01 | | +| ~~Full trigger configuration field mapping (SUB `1C` / write `82`)~~ — **PARTIALLY RESOLVED:** SUB `1C` now confirmed as MONITOR STATUS READ (§5.1, §7.10) — not trigger config; the old "0x6E response" was misidentification. SUB `82` (trigger config write) layout partially mapped — Trigger Sample Width at `[22]`. Remaining unknowns: full per-channel structure of the 0x82 payload. | LOW | 2026-02-26 | Updated 2026-05-20 | +| Whether SUB `24`/`25` are distinct from SUB `5A` or redundant | LOW | 2026-02-26 | | +| **Meaning of `0x07 E7` field in config block — RESOLVED:** Calibration year. uint16 BE at destuffed payload offset 0x56–0x57. Confirmed via two-unit comparison: BE18189 (calibrated 2023) = `07 E7`; BE11529 (calibrated 2025) = `07 E9`. Adjacent bytes at 0x53–0x55 encode remaining calibration date (month confirmed as BCD October for both units; full layout 🔶 INFERRED). | RESOLVED | 2026-02-26 | Resolved 2026-03-31 | +| **Trigger Sample Width** — **RESOLVED:** BW→S3 write frame SUB `0x82`, destuffed payload offset `[22]`, uint8. Width=4 → `0x04`, Width=3 → `0x03`. Confirmed via BW-side capture diff. Only visible in `raw_bw.bin` write traffic, not in S3-side compliance reads. | RESOLVED | 2026-03-02 | Confirmed 2026-03-09 | +| **Auto Window** — "1 to 9 seconds" per manual (§3.13.1b). **Mode-gated:** only transmitted/active when Record Stop Mode = Auto. Capture attempted in Fixed mode (3→9 change) — no wire change observed in any frame. Deferred pending mode switch. | LOW | 2026-03-02 | Updated 2026-03-09 | +| **Auxiliary Trigger read location** — **RESOLVED:** SUB `FE` offset `0x0109`, uint8, `0x00`=disabled, `0x01`=enabled. Confirmed 2026-03-11 via controlled toggle capture. | RESOLVED | 2026-03-02 | Resolved 2026-03-11 | +| **Auxiliary Trigger write path** — Write command not yet captured in a clean session. Inner frame handshake visible in A4 (multiple WRITE_CONFIRM_RESPONSE SUBs appear, TRIGGER_CONFIG_RESPONSE removed), but the BW→S3 write command itself was in a partial session. Likely SUB `15` or similar. Deferred for clean capture. | LOW | 2026-03-11 | NEW | +| ~~**SUB `6E` response to SUB `1C`**~~ — ~~RESOLVED 2026-04-08: This was a misidentification.~~ The `1C → 6E` "exception" was misread — likely an inner A4 sub-frame. Confirmed from 4-8-26 capture (338 frames): SUB 0x1C always → 0xE3. No exceptions to the `0xFF − SUB` rule are known. | RESOLVED | 2026-04-08 | CLOSED | +| ~~**Max Geo Range float 6.2061**~~ — **RESOLVED 2026-04-17.** Confirmed as the **ADC-to-velocity scale factor** = inverse sensitivity = 1/0.161133 = **6.206053 (in/s)/V**. Source: Interface Handbook §4.5 formula `Range = 1.61133 V / Sensitivity`. For standard Instantel geo at Normal (Gain=1) range: Sensitivity = 1.61133/10 = 0.161133 V/(in/s), scale = 6.206053. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. The earlier ~9× overread was from using 6.206053 directly as range instead of as scale factor (range = 1.61133 V × 6.206053 = 10.000 in/s). Hardware constant — do NOT write. | RESOLVED | 2026-02-26 | Resolved 2026-04-17 | +| MicL channel units — **RESOLVED: psi**, confirmed from `.set` file unit string `"psi\0"` | RESOLVED | 2026-03-01 | | +| Backlight offset — **RESOLVED: +4B in event index data**, uint8, seconds | RESOLVED | 2026-03-02 | | +| Power save offset — **RESOLVED: +53 in event index data**, uint8, minutes | RESOLVED | 2026-03-02 | | +| Monitoring LCD Cycle — **RESOLVED: +54/+55 in event index data**, uint16 BE, seconds (65500 = disabled) | RESOLVED | 2026-03-02 | | +| **SUB 0x06 purpose — RESOLVED: event storage range.** Previously labeled "CHANNEL CONFIG READ". 4-11-26 MITM capture confirms it returns first/last stored event keys in the final 8 bytes of the 36-byte response. Used by Blastware as part of the erase-all verification step. | RESOLVED | 2026-04-11 | | +| **Erase-all command sequence — RESOLVED.** SUB 0xA3 (begin) + 0x1C (monitor status) + 0x06 (storage range) + 0xA2 (confirm). Confirmed from 4-11-26 MITM capture. All frames standard `build_bw_frame`, token=0xFE. | RESOLVED | 2026-04-11 | | +| **ACH inbound server — RESOLVED.** `bridges/ach_server.py` implements full inbound ACH pipeline. `--clear-after-download` flag for delete-after-upload workflow. Post-erase key-reuse detection via `max_downloaded_key` high-water mark. | RESOLVED | 2026-04-11 | | +| **Sensor Check dropdown byte location** — byte offset in 1A compliance config payload for the "Sensor Check: Before monitoring / After each event / Disabled" setting is NOT YET LOCATED. Confirmed: unit always runs with "Before monitoring" set. Need a capture with "Disabled" to diff. | MEDIUM | 2026-04-08 | Still open | +| **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open | +| ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | +| ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | +| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | +| **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open | +| **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open | + +--- + +--- + +## Appendix B — Operator Manual Cross-Reference (716U0101 Rev 15) + +> Added 2026-03-02. Cross-referencing confirms setting names, ranges, units, and behavior for fields found in protocol captures. The manual does NOT describe the wire protocol — it describes the user-facing device interface. Use to infer data types, ranges, and semantics of protocol fields. + +| Setting Name (Manual) | Manual Location | Protocol Location | Type | Range / Notes | +|---|---|---|---|---| +| Backlight On Time | §3.13.1e | Event Index +4B | uint8 | 0–255 seconds | +| Power Saving Timeout | §3.13.1f | Event Index +53 | uint8 | minutes (user sets 1–60+) | +| Monitoring LCD Cycle | §3.13.1g | Event Index +54/55 | uint16 BE | seconds; 0=off; 65500≈disabled | +| Trigger Level (Geo) | §3.8.6 | Channel block, float | float32 BE | 0.005–10.000 in/s | +| Alarm Level (Geo) | §3.9.9 | Channel block, float | float32 BE | higher than trigger level | +| Trigger Level (Mic) | §3.8.6 | Channel block, float | float32 BE | 100–148 dB in 1 dB steps | +| Alarm Level (Mic) | §3.9.10 | Channel block, float | float32 BE | higher than mic trigger | +| Record Time | §3.8.9 | cfg anchor+10, float32 BE (wire); `.set` +16, uint32 LE (file) | float32 BE (wire) | 1–105 s; confirmed 3→`40400000`, 5→`40A00000`, 8→`41000000`, 13→`41500000`. Use anchor §7.6.1/§7.6.3 — NOT fixed offset. | +| ADC Scale Factor (geo_adc_scale) | §3.8.4 / Interface Handbook §4.5 | Channel block, Tran+28 (same in E5 read and SUB 71 write), float32 BE | float32 BE = 6.206053 | ✅ CONFIRMED 2026-04-17 — inverse sensitivity (in/s)/V. `Range = 1.61133 V × 6.206053 = 10.000 in/s`. Firmware: `PPV (in/s) = ADC_voltage × 6.206053`. Hardware constant, identical on all units. Do NOT write. | +| Max Geo Range (geo_range) | §3.8.4 | Channel block, Tran+33 (same in E5 read and SUB 71 write), uint8; applied to Tran/Vert/Long | uint8 | ✅ CONFIRMED 2026-04-20 — `0x00`=Normal 10.000 in/s, `0x01`=Sensitive 1.250 in/s. **NOTE: `Tran+20` reads `0x01` on ALL captures regardless of range — it is NOT this field.** | +| Microphone Units | §3.9.7 | Inline unit string | char[4] | `"psi\0"`, `"pa.\0"`, `"dB\0\0"` | +| Sample Rate | §3.8.2 | cfg anchor−2, uint16 BE — anchor=`\x01\x2c\x00\x00\xbe\x80\x00\x00\x00\x00` in cfg[40:100] | uint16 BE | Normal=1024, Fast=2048, Faster=4096 ✅ CONFIRMED 2026-04-01 (BE11529 S338.17). Anchor required — see §7.6.3 DLE jitter. | +| Record Mode | §3.8.1 | Write: `cfg[anchor−3]`, uint8. Read (E5 sf1): `data[anchor−4]`, uint8. Note: extra `0x10` byte at read `data[anchor−3]` shifts offset by 1 vs write. | uint8 | `0x00`=Single Shot, `0x01`=Continuous, `0x02`=unknown, `0x03`=Histogram, `0x04`=Histogram+Continuous. ✅ CONFIRMED 2026-04-20 | +| Trigger Sample Width | §3.13.1h | BW→S3 SUB `0x82` write frame, destuffed `[22]`, uint8 | uint8 | Default=2; confirmed 4=`0x04`, 3=`0x03`. **BW-side write only** — not visible in S3 compliance reads. Mode-gated: only sent in Compliance/Single-Shot/Fixed mode. | +| Auto Window | §3.13.1b | **Mode-gated — NOT YET MAPPED** | uint8? | 1–9 seconds; only active when Record Stop Mode = Auto. Capture in Fixed mode produced no wire change. | +| Auxiliary Trigger | §3.13.1d | SUB `FE` (FULL_CONFIG_RESPONSE) offset `0x0109` (read); write path not yet isolated | uint8 (bool) | `0x00`=disabled, `0x01`=enabled; confirmed 2026-03-11 | +| Password | §3.13.1c | Unknown | — | 4-key sequence | +| Serial Connection | §3.9.11 | Unknown | — | Direct / Via Modem | +| Baud Rate | §3.9.12 | Unknown | — | 38400 for direct | + +--- + +## Appendix C — Logger & Parser Validation (2026-03-02) + +> Documents the logger integrity verification and parser refactor completed 2026-03-02. Tooling behavior only — not protocol semantics. + +### C.1 Logger Validation + +**Concern:** Earlier sessions noted that the `s3_bridge` logger may have been stripping `0x10` from `DLE ETX` sequences, producing bare `0x03` terminators in the capture file. + +**Resolution:** HxD inspection of a new capture produced by `s3_bridge v0.5.0` confirmed that `10 03` sequences are present intact inside S3→BW record payloads. The `forward_loop` function writes raw bytes to the `.bin` before any sniffer or framing logic runs — there is no ETX stripping in v0.5.0. + +The earlier stripping behavior applied to a previous logger version. v0.5.0 is confirmed lossless with respect to wire bytes. + +**Confirmed wire framing:** +- Frame start: `0x10 0x02` (DLE STX) ✅ +- Frame end: `0x10 0x03` (DLE ETX) ✅ +- DLE stuffing: `0x10 0x10` in payload = literal `0x10` ✅ + +### C.2 Capture Architecture (Current) + +As of 2026-03-02 the capture pipeline produces two flat raw wire dump files per session: + +| File | Contents | +|---|---| +| `raw_s3.bin` | All bytes transmitted by S3 (device → Blastware), in order | +| `raw_bw.bin` | All bytes transmitted by BW (Blastware → device), in order | + +No record headers, no timestamps, no framing logic applied by the dumper. Files are flat concatenations of `serial.read()` chunks. Frame boundaries must be recovered by the parser. + +### C.3 Parser Design — DLE State Machine + +A deterministic state machine replaces all prior heuristic scanning. + +**States:** + +``` +STATE_IDLE — scanning for frame start +STATE_IN_FRAME — consuming payload bytes +STATE_AFTER_DLE — last byte was 0x10, awaiting qualifier +``` + +**Transitions:** + +| Current State | Byte | Action | Next State | +|---|---|---|---| +| IDLE | `10 02` | Begin new frame | IN_FRAME | +| IDLE | any | Discard | IDLE | +| IN_FRAME | `!= 10` | Append to payload | IN_FRAME | +| IN_FRAME | `10` | — | AFTER_DLE | +| AFTER_DLE | `10` | Append literal `0x10` | IN_FRAME | +| AFTER_DLE | `03` | Frame complete, emit | IDLE | +| AFTER_DLE | other | Treat as payload (recovery) | IN_FRAME | + +**Properties:** +- Does not scan globally for `10 02` +- Only complete STX→ETX pairs are emitted as frames +- Incomplete trailing frames at EOF are discarded (expected at capture boundaries) +- DLE stuffing handled correctly + +### C.4 Observed Traffic (Validation Captures) + +**`raw_bw.bin`** (Blastware → S3): +- 7 complete frames via state machine +- Mostly small command/control frames, several zero-length payloads +- Bare `0x02` used as STX (asymmetric — BW does not use DLE STX) +- Contains project metadata strings: `"Standard Recording Setup.set"`, `"Claude test2"`, `"Location #1 - Brians House"` + +**`raw_s3.bin`** (S3 → Blastware): +- First frame payload ~3922 bytes (large structured response) +- Repeated `"Instantel"` / `"MiniMate Plus"` / `"BE18189"` strings throughout +- Multiple medium-length structured frames +- DLE+ETX confirmed intact + +### C.5 Key Lessons + +1. **Global byte counting ≠ frame counting.** `0x10 0x02` appears inside payloads. Only state machine transitions produce valid frame boundaries. +2. **STX count ≠ frame count.** Only STX→ETX pairs within proper state transitions count. +3. **EOF mid-frame is normal.** Capture termination during active traffic produces an incomplete trailing frame. Not an error. +4. **Layer separation.** The parser extracts frames only. Decoding block IDs, validating checksums, and interpreting semantics are responsibilities of a separate protocol decoder layer above it. + +### C.6 Parser Layer Architecture + +``` +raw_s3.bin / raw_bw.bin + ↓ +DLE Frame Parser (s3_parser.py) <- framing only + ↓ +Protocol Decoder (future) <- SUB IDs, block layout, checksums + ↓ +Semantic Interpretation <- settings, events, responses +``` + +--- + +--- + +## Appendix D — Blastware Binary File Formats (.N00 / .MLG / others) + +> ✅ CONFIRMED 2026-04-21 — all fields verified by binary diff of reconstructed vs reference +> files from the 4-3-26-multi_event capture (M529LIY6.N00, BE11529.MLG). +> +> ✅ **EXTENSION ENCODING FULLY DECODED 2026-04-22** — supersedes the earlier +> "extension encodes recording mode" hypothesis (which was wrong) AND the +> "extension encoding algorithm is unknown" note. Extensions encode a +> **timestamp** (seconds within a 21.6-minute window), NOT recording mode. +> See **D.5.2** for the full formula, confirmed against 3,248 files from a +> 10-year production archive. Cross-references throughout this appendix have +> been updated. + +### D.1 Common File Header (22 bytes) + +All Blastware files (regardless of type) share an 18-byte prefix followed by a 4-byte type tag. + +| Offset | Length | Value | Description | +|---|---|---|---| +| 0x00 | 6 | `10 00 01 80 00 00` | Fixed prefix | +| 0x06 | 10 | `Instantel\x00` | ASCII string | +| 0x10 | 2 | `07 2c` | Fixed suffix | +| 0x12 | 4 | varies | File type tag (see below) | + +**Total header: 22 bytes.** + +**Type tags:** + +| Extension | Type tag | Description | +|---|---|---| +| `AB0` / `AB0W` (Waveform) | `00 12 03 00` | Waveform event — extension encodes timestamp, see D.5.2/D.5.3 | +| `AB0H` (Histogram) | `00 12 03 00` | Histogram event — ACH only | +| `.N00` | `00 12 03 00` | Old-firmware placeholder (Waveform); `blastware_filename()` falls back to this for S338 firmware | +| `.MLG` | `22 01 0e a0` | Monitor log | + +**Extension encoding — new firmware (V10.72+) FULLY DECODED (confirmed 2026-04-22):** + +The extension differs depending on how the file was saved: + +| Download method | Extension format | Example | +|---|---|---| +| Manual / direct (Blastware connected to unit) | `AB0` (3 chars) | `.CE0` | +| Call-home / ACH | `AB0W` or `AB0H` (4 chars) | `.CE0H` | + +Where: +- `AB` = 2-char base-36 of `total_seconds % 1296`; `A = value // 36`, `B = value % 36` +- `total_seconds = (event_local_time − 1985-01-01T00:00:00_local)` in seconds +- `0` = always literal digit zero +- `W` = Full Waveform, `H` = Full Histogram (ACH only) + +Base-36 alphabet: `0–9` = 0–9, `A–Z` = 10–35. + +The 10-year production archive contains only ACH files (all end in W or H). Manual Blastware downloads produce the same `AB0` prefix but without the trailing type character. + +**3-day cycle property (confirmed 2026-04-22):** A unit recording at a fixed daily time cycles through exactly **3 different extensions** with a 3-day period. Each calendar day shifts `total_seconds % 1296` by 864 (since `86400 % 1296 = 864`). The cycle repeats every 3 days because `gcd(1296, 864) = 432`. Confirmed from archive: top 3 extensions `CE0H` (95), `0E0H` (93), `OE0H` (91) are the 3-day cycle of a 06:00:14 daily call-in (seconds-in-window = 446, 14, 878). + +**B character invariance:** `864 = 24 × 36`, so adding one day never changes `value % 36` — the second extension character is invariant for a fixed daily recording time. Only the first character cycles through 3 values. + +**Old firmware (S338):** 3-char extensions observed (`.N00`, `.EI0`, etc.) — may simply be manual downloads under the same AB0 scheme, or a different encoding. Not yet confirmed. + +**Micromate Series 4** uses a different extension format (observed: `IDFH`, `IDFW`). This formula does NOT apply to Micromate units. + +All waveform files share the same `00 12 03 00` type tag regardless of extension. Blastware identifies file type by extension, not by type tag alone. + +### D.2 Timestamp Encoding (Blastware files) + +All timestamps in N00 and MLG files use an **8-byte big-endian format**: + +| Byte | Field | +|---|---| +| 0 | day (uint8) | +| 1 | month (uint8) | +| 2–3 | year (uint16 BE) | +| 4 | `0x00` (reserved) | +| 5 | hour (uint8) | +| 6 | minute (uint8) | +| 7 | second (uint8) | + +Example: `01 04 07 ea 00 00 1c 08` → April 1, 2026, 00:28:08. + +Note: this differs from the 8-byte protocol timestamp (`[day][sub_code][month][year_HI][year_LO][0x00][hour][min][sec]` = 9 bytes) used in the device's on-wire 0C waveform records. The file format uses a compact 8-byte layout without the `sub_code` byte. + +### D.3 N00 File Format — Single-Shot Waveform Event + +**File layout:** `[22B header] [21B STRT record] [body bytes] [26B footer]` + +#### D.3.1 STRT Record (21 bytes) + +The STRT record immediately follows the 22-byte header. + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 4 | `STRT` | ASCII literal | +| 4 | 2 | `ff fe` | Fixed | +| 6 | 4 | event key (key4) | 4-byte waveform key | +| 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field | +| 14 | 6 | device-specific | NOT zero-padded — device-internal fields | +| 20 | 1 | rectime | uint8 seconds | + +**Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone. + +#### D.3.2 Body Bytes (variable) + +The body is reconstructed from the raw A5 bulk waveform stream frames by stripping DLE framing markers and taking the appropriate slice of each frame's data section. + +**Per-frame contribution (from `frame.data`):** + +| Frame | Skip amount | Notes | +|---|---|---| +| A5[0] (probe) | `7 + strt_pos_in_w0 + 21` | Skip frame.data prefix + STRT record | +| A5[1] | 13 | 7-byte prefix + 6-byte first-chunk header | +| A5[2..N] | 12 | 7-byte prefix + 5-byte chunk header | +| Terminator (page_key=0x0000) | 11 | 7-byte prefix + 4-byte terminator header | + +**DLE strip rule:** For each frame's contribution (`frame.data[skip:]`), strip any `0x10` byte immediately followed by `0x02`, `0x03`, or `0x04`. Only the `0x10` is stripped; the following byte is kept as payload. + +**Split-pair edge case:** When `frame.data[-1] == 0x10` AND `frame.chk_byte ∈ {0x02, 0x03, 0x04}`, the S3FrameParser split a DLE+XX pair at the payload/checksum boundary. Reunite the bytes before stripping (`relevant + bytes([chk_byte])`), then always remove the trailing chk_byte from the result (`stripped[:-1]`) — chk_byte is the wire checksum, never payload. + +**Body/footer split:** Accumulate all frame contributions (data frames + terminator) into `all_bytes`. Then: +- `body = all_bytes[:-26]` (variable length) +- `footer = all_bytes[-26:]` (always 26 bytes — extracted from terminator content) + +#### D.3.3 Footer (26 bytes) + +The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata. + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 2 | `0e 08` | Fixed marker | +| 2 | 8 | ts1 | Start timestamp (8B big-endian) | +| 10 | 8 | ts2 | Stop timestamp (8B big-endian) | +| 18 | 6 | `00 01 00 02 00 00` | Fixed | +| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed | + +**CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. + +### D.4 MLG File Format — Monitor Log + +**File layout:** `[308B header] [N × 292B records]` + +#### D.4.1 MLG Header (308 bytes) + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0x00 | 22 | common header | prefix + `22 01 0e a0` type tag | +| 0x16 | 16 | unknown | observed as zeros in BE11529.MLG | +| 0x2A | 8 | serial number | null-padded ASCII (e.g. `"BE11529"`) | +| 0x32 | remainder | zero pad | pads to 308 bytes total | + +#### D.4.2 MLG Record (292 bytes each) + +| Offset | Length | Field | Notes | +|---|---|---|---| +| 0 | 2 | CRC | 2-byte CRC — algorithm unconfirmed; write as `00 00` | +| 2 | 4 | `22 01 0e 80` | Record marker | +| 6 | 8 | ts1 | Start timestamp (8B big-endian) | +| 14 | 8 | ts2 | Stop timestamp (8B big-endian); zeros if no stop | +| 22 | 4 | flags | Record type flags (see below) | +| 26 | 10 | serial | Null-padded ASCII serial number | +| 36 | variable | text | Type-dependent content | +| — | remainder | zero pad | pads to 292 bytes total | + +**Record flags:** + +| Value | Meaning | +|---|---| +| `ff ff 00 00` | Monitoring start with no stop recorded | +| `01 00 02 00` | Triggered event (has ts1 + ts2) | +| `02 00 00 00` | Monitoring interval (has ts1 + ts2) | + +**Text content for triggered events (`flags = 01 00 02 00`):** + +| Byte | Field | +|---|---| +| 0 | `0x08` | +| 1–8 | ts1 copy (8B big-endian) | +| 9+ | `"Geo: X.XXX in/s\x00"` ASCII geo threshold | + +#### D.4.3 MLG CRC + +The 2-byte CRC at record[0:2] uses an unconfirmed algorithm. Tested against CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), word sums, XOR variants, and 40+ polynomial/init combinations — none matched. The writer emits `00 00`. Blastware may reject files with incorrect CRCs (impact on import unknown — TODO: test). + +### D.5 Filename Encoding ✅ PARTIALLY CONFIRMED 2026-04-22 + +Blastware assigns waveform filenames of the form ``, where: + +#### D.5.1 Serial Prefix ✅ CONFIRMED 2026-04-22 + +The first 4 characters of the filename encode the full device serial number: + +``` +prefix_letter = chr(ord('B') + floor(serial_numeric / 1000)) +serial3 = f"{serial_numeric % 1000:03d}" (last 3 digits, zero-padded) +``` + +Where `serial_numeric` is the integer after the "BE" device-type prefix. + +Examples (all confirmed from archive): + +| Serial | serial_numeric / 1000 | prefix_letter | serial3 | Filename prefix | +|--------|----------------------|---------------|---------|-----------------| +| BE6907 | 6 | H | 907 | H907 | +| BE7145 | 7 | I | 145 | I145 | +| BE11529 | 11 | M | 529 | M529 | +| BE14036 | 14 | P | 036 | P036 | +| BE17353 | 17 | S | 353 | S353 | +| BE18003 | 18 | T | 003 | T003 | +| BE18191 | 18 | T | 191 | T191 | +| BE18676 | 18 | T | 676 | T676 | + +**Interpretation:** The prefix letter encodes the production generation (batch of 1000 units). B=generation 0 (serials 0–999), C=generation 1 (1000–1999), etc. No units with prefix A have been observed — the earliest known units start around serial 2000+ (prefix D). + +**Note:** The "BE" device-type prefix is implicit. The filename only encodes the numeric part of the serial. Other Instantel device types (Micromate, Blastmate) may use a different scheme. + +#### D.5.2 Stem + Extension — full timestamp encoding ✅ FULLY CONFIRMED 2026-04-22 + +The stem (4 chars) and AB extension (2 chars) together form a 6-digit base-36 number encoding a complete second-resolution timestamp: + +```python +total_seconds = stem_int * 1296 + ab_int +event_local_time = datetime(1985, 1, 1) + timedelta(seconds=total_seconds) +``` + +- **Epoch:** `1985-01-01 00:00:00` **device local time** ✅ CONFIRMED — verified against 3,248 files from a 10-year production archive; zero errors (only 2 mismatches were Micromate `IDFH`/`IDFW` files which use a completely different naming scheme) +- **Unit:** 1296 seconds = 36² ≈ 21.6 minutes per stem increment +- **Alphabet:** `"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"` (digits then uppercase letters) +- **Collision:** Events within the same 21.6-minute window share a stem; extension distinguishes them + +**Decoding example — `P036L318.C80H` (BE14036, Full Histogram):** +``` +stem L318 = 21×36³ + 3×36² + 1×36 + 8 = 983,708 +AB C8 = 12×36 + 8 = 440 +total_sec = 983,708 × 1296 + 440 = 1,274,886,008 +event_time = 1985-01-01 + 1,274,886,008s = 2025-05-26 15:00:08 local +``` + +**Note on local time:** The device's onboard clock is set to the local timezone of the deployment site. The epoch and all timestamps are in that same local time — there is no UTC conversion. Files moved between timezones will decode to the original deployment timezone. + +#### D.5.3 Extension taxonomy — historical rewrite (FULLY DECODED 2026-04-22) + +The extension third character is always `'0'`. The full encoding scheme is now +mapped — see **D.5.2** for the canonical formula. The earlier "recording-mode" +taxonomy in this section was wrong and has been removed. + +**Summary (new firmware V10.72+ via ACH download):** + +``` +Extension = AB0T + +AB = base-36 of (total_seconds % 1296) — seconds within the 21.6-min window +0 = literal digit zero (invariant third character) +T = W (Waveform) | H (Histogram) — present only for ACH downloads +``` + +Direct/manual Blastware downloads produce `.AB0` (3 chars, no trailing type +character). `blastware_filename()` in `minimateplus/blastware_file.py` +implements the formula; it falls back to `.N00` as a placeholder for +old-firmware units (S338) where the extension encoding has not been confirmed. + +The previously listed extensions `.9T0` / `.490` / `.5K0` / `.980` / `.ML0` +were the **same continuous-mode unit recording at different times of day**. +Their bytes were byte-for-byte identical except for header fields that change +per event — exactly what D.5.2 predicts: same firmware, same recording mode, +different timestamp → different extensions. No correlation with recording mode. + +| Extension type char (4-char ACH) | Meaning | +|---|---| +| `W` | Full Waveform | +| `H` | Full Histogram | + +**Micromate Series 4** uses a different scheme entirely (`IDFH`, `IDFW` +observed) and does NOT follow the AB0T formula. + +**DLE-shift offset note for reading recording_mode from N00/9T0 body:** + +The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: + +| 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) | +|---|---| +| `file[anc−7]` = recording_mode | `file[anc−8]` = recording_mode | +| `file[anc−6:anc−4]` = sample_rate | `file[anc−6:anc−4]` = sample_rate | + +For 1024 sps files, the expected file bytes around the anchor are: +``` +file[anc−9]: mode_prefix (0x00 for Single Shot/Continuous; 0x10 for Histogram) +file[anc−8]: 0x00 (was recording_mode, but shifted away — now reads 0x00 for mode_prefix) +file[anc−7]: recording_mode (0x00=Single Shot, 0x01=Continuous, etc.) +file[anc−6]: 0x04 (sample_rate_HI for 1024 sps) +file[anc−5]: 0x00 (sample_rate_LO) +file[anc−4]: histogram_interval_HI +file[anc−3]: histogram_interval_LO +``` + +--- + +*All findings reverse-engineered from live RS-232 bridge captures.* +*Cross-referenced from 2026-03-02 with Instantel MiniMate Plus Operator Manual (716U0101 Rev 15).* +*This is a living document — append changelog entries and timestamps as new findings are confirmed or corrected.* + +--- + +## Appendix E — Known Device Faults (field-observed, 2026-08-25) + +This appendix records *device* behaviour, not protocol. It exists +because these signatures are easy to mistake for decoder bugs — and one +of them was, for a while. + +### E.1 The "offset" fault + +> **The full investigation now lives in `docs/offset_investigation.md`** -- +> base rate, detector definition, per-unit case files, ruled-out hypotheses, +> and Instantel's own autozero procedure with its 2027-2069 acceptance +> window. This appendix is kept as the protocol-side summary. + +**Symptom.** One geophone channel's baseline steps away from zero and +stays there. The trace still carries the real AC signal, but it rides +on a DC pedestal of a few tenths of an in/s. Operators call this an +"offset"; it is a known recurring hardware fault, historically resolved +by returning the unit to Instantel, shelving it until calibration, or a +per-channel re-zero in an advanced/professional Blastware build. + +**Why it floods the queue.** The pedestal exceeds the unit's own geo +trigger level, so the channel sits permanently above threshold and the +unit retriggers as fast as it can rearm — one event every 3–7 minutes +for as long as the fault persists. In the surveyed snapshot the worst +episode produced 193 events in 38 hours. + +| unit | window | events | channel | pedestal | that unit's trigger level | +|---|---|---|---|---|---| +| BE9558 | 2026-05-15 → 05-16 | 193 | Long | +0.335 | 0.200 | +| BE18438 | 2026-02-25 → 02-26 | 64 | Vert | +0.327 | 0.200 | +| BE18438 | 2025-11-15 | 12 | Vert | +0.312 | 0.200 | +| BE9558 | 2026-04-14 / 04-29 / 05-04 | 5 total | Tran | +0.29…+0.44 | 0.200 | + +**It is NOT a decode artifact.** These events reproduce *exactly* in +Blastware's own ASCII export — e.g. `BE12599/N599LQD7.8E0W` Tran reads +mean +0.345, min +0.335, max +0.355 in both our decode and BW's. Any +shape-based false-trigger detector must treat this as a real device +condition, not corrupt data. + +**Detection rule that works:** + +``` +dominant geo axis: |mean| / peak > 0.7 + AND: |mean| >= 0.9 x that unit's geo trigger level +group hits into episodes by serial with a 12 h gap +``` + +A bare `|mean|/peak` threshold is useless — a quiet trace sitting at the +0.010 in/s noise floor clears any ratio test. On the surveyed store the +bare rule flagged 7,184 events; the rule above flags 274, all real. +Candidate list: `scratch/offset_candidates.csv`. + +**What the data rules out.** + +- *Not the geophone.* The on-device sensor check passes on every unit, + offset or not — test frequency 7.2–8.1 Hz, damping ratio 3.3–4.7, + zero failures fleet-wide, including mid-episode. The coil and its + mechanical response are healthy. +- *Not the battery.* 6.6–6.8 V on the affected units, same as the rest. +- *Not environmental.* Only 2 units of 21 ever show it. BE17353 logged + 395 waveform events over nine months with zero occurrences; BE7145, + 295 events, zero. Weather acts on all of them equally. +- *Not condensation.* BE18438's Vert held 0.179 → 0.189 for 34 hours + **including a 10-hour overnight gap**, then stepped to 0.33 at 13:24 + in the afternoon. Dew would peak overnight; it was flat overnight. + +**What the data shows.** The pedestal is *piecewise constant* — it +holds rock-steady, survives power-off gaps, and changes only in discrete +steps. A small common-mode diurnal wobble rides on top of it, but that +wobble is present on the healthy channels too (it is the unit's normal +thermal breathing) and is not the fault. + +**The fault is on the geophone side.** Operator report (2026-08-25): +*attaching a different geophone to an affected unit makes the offset go +away.* That is the channel-swap test, already run in the field many +times, and it rules out the unit's analog front-end and any stored +per-channel zero constant — a constant lives in the unit and would +survive a sensor swap. + +The stored data agrees. MicL — a separate transducer on its own cable — +shows no offset during either episode (`|mean|/peak` = 0.17 and 0.02), +while the geo channels on the same unit at the same moment are pinned. + +**Two distinct failure patterns**, both geophone-side: + +| unit | Tran | Vert | Long | MicL | reading | +|---|---|---|---|---|---| +| BE18438 | 0.16 | **0.97** | 0.18 | 0.02 | one element only | +| BE9558 | 0.90 | 0.81 | **0.99** | 0.17 | all three, Long dominant | + +(values are `\|mean\|/peak` on the dominant axis) + +BE18438 has a single faulted conductor pair with the other two clean. +BE9558 has all three geo channels offset by different amounts +(Long +0.340, Tran +0.037, Vert −0.020) — that points at a shared return +or ground path in the housing rather than one element. + +**Candidate mechanisms.** A geophone coil is passive and cannot +generate sustained DC on its own, so an offset originating on the sensor +side has to come from one of: + +1. *Galvanic corrosion at a connector or splice* — dissimilar metals + plus moisture form a literal cell. This generates DC directly, in + the tens-of-millivolts range that matches the measured offset + (0.29 in/s ÷ 6.206053 in/s per volt ≈ 46 mV referred to the ADC + input). Fits the discrete steps, surviving power cycles, and being + cured by swapping the sensor. +2. *A leakage path to shield or another conductor*, letting the unit's + own bias/reference divide into the signal pair. Best fit for the + BE9558 all-three-channels pattern. +3. *Changed coil DC resistance* (partial short or degraded winding) + interacting with the amplifier's input bias current — + `V_offset = I_bias × R_source`. Best fit for the BE18438 + single-element pattern. Note the on-device sensor check would not + catch this: it measures ring-down frequency and damping, not DC. + +**Caveat on the swap test.** Swapping a geophone requires stopping and +restarting monitoring, and these units run Sensor Check "Before +monitoring" — so the restart also re-zeros the channels. The swap +therefore does not cleanly separate *"new sensor"* from *"the restart +re-zeroed it"*. Two cheap controls settle it: restart monitoring +**without** swapping (if the offset clears, it was the re-zero), or swap +the **original** sensor back (if the offset returns, it is the sensor). +The operator's remedy being a swap rather than a restart is weak +evidence for the sensor, since a restart is the easier thing to try +first. + +**Best single measurement when it recurs:** DC voltage across the +suspect geophone's connector pins with the sensor **disconnected from +the unit**. A galvanic cell (mechanism 1) shows an open-circuit +voltage; mechanisms 2 and 3 do not. + +**Note:** the surveyed population is subject to survivorship bias — +flooded events were routinely deleted before this snapshot, so units +that look clean here may have had episodes that were scrubbed. diff --git a/tests/fixtures/minimate-bench-10-25-26/README.md b/tests/fixtures/minimate-bench-10-25-26/README.md index 7983416..57ebf6a 100644 --- a/tests/fixtures/minimate-bench-10-25-26/README.md +++ b/tests/fixtures/minimate-bench-10-25-26/README.md @@ -10,6 +10,6 @@ the `0xA5` frames. | `BE9441_event0_01110000_rx.bin` | 0 (first) | `01110000` | probe, metadata pages `0x1002` `0x1004`, samples, TERM | 0.020 / 0.060 / 0.015 | | `BE9441_event1_0111646a_rx.bin` | 1 | `0111646a` | probe, samples, TERM — no metadata pages | 0.030 / 0.095 / 0.020 | -Both events: single shot, 4096 sps, 5 s record + 1 s pre-trigger = 21,504 samples per channel. +Both events: single shot, 4096 sps, 5 s record + 0.25 s pre-trigger = 5.25 s = 21,504 samples per channel. Event 1 is the case that showed the body builder skipping 13 bytes on its second and third frames as if they were metadata pages (2 bytes lost, decode truncated at 1,024 / 2,782 / 512). diff --git a/tests/test_minimate_body_no_metadata.py b/tests/test_minimate_body_no_metadata.py index befb939..f9992d5 100644 --- a/tests/test_minimate_body_no_metadata.py +++ b/tests/test_minimate_body_no_metadata.py @@ -24,7 +24,7 @@ from minimateplus.models import Event from minimateplus.waveform_codec import decode_waveform_v2 # noqa: E402 FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" -SAMPLES = 21_504 # 5 s record + 1 s pre-trigger at 4096 sps +SAMPLES = 21_504 # 5 s record + 0.25 s pre-trigger, at 4096 sps UNIT_PEAKS = { # the unit's own 0C peaks, in/s "event0": {"Tran": 0.020, "Vert": 0.060, "Long": 0.015}, "event1": {"Tran": 0.030, "Vert": 0.095, "Long": 0.020}, -- 2.54.1 From f6166b4b041514279cbcb695125d86fde274b7da Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:43:49 -0400 Subject: [PATCH 092/223] fix(minimateplus): the boot-aware first POLL resets the parser; a drained or long-trailed banner is seen Review of d73a27d: _await_poll_or_boot no longer reset the parser and pending frames the way _recv_one(reset_parser=True) did, so a reused protocol object with half a frame left over failed startup (UnexpectedResponse A4 vs A5). Restored. Also: the banner check now runs before the tail is trimmed (a read carrying >48 bytes after the banner lost it), and a banner caught during the 200 ms drain is reported, so startup goes straight to the re-poll loop instead of the full timeout. Tests for all three. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/protocol.py | 26 +++++++++++++++++---- tests/test_minimate_boot_on_connect.py | 32 ++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 9b7aadb..07f1a06 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -212,7 +212,7 @@ class MiniMateProtocol: ProtocolError: if either POLL step fails. """ log.debug("startup: draining boot string") - self._drain_boot_string() + booting = self._drain_boot_string() # Send session-reset signal (ACK+ETX) before the first POLL probe. # Confirmed from 4-8-26 BW TX captures: Blastware always sends this @@ -223,7 +223,15 @@ class MiniMateProtocol: log.debug("startup: POLL probe") self._send(POLL_PROBE) - probe_rsp = self._await_poll_or_boot(self._recv_timeout) + try: + # A banner already drained means the unit is booting: a short wait, + # then the re-poll loop, rather than the full timeout. + probe_rsp = self._await_poll_or_boot( + self._BOOT_POLL_S if booting else self._recv_timeout) + except TimeoutError: + if not booting: + raise + probe_rsp = None if probe_rsp is None: probe_rsp = self._poll_until_booted() log.debug( @@ -1581,6 +1589,8 @@ class MiniMateProtocol: """The first POLL probe's reply -- or None the moment the unit sends its boot banner, because a POLL sent before the banner is never answered.""" expected = _expected_rsp_sub(SUB_POLL) + self._parser.reset() # as _recv_one(reset_parser=True) did here + self._pending_frames.clear() deadline = time.monotonic() + timeout tail = b"" while time.monotonic() < deadline: @@ -1594,9 +1604,10 @@ class MiniMateProtocol: self._pending_frames.extend(frames[1:]) self._validate_frame(frames[0], expected) return frames[0] - tail = (tail + chunk)[-64:] + tail += chunk if self._BOOT_BANNER in tail: return None + tail = tail[-64:] # trimmed after the check, so a long read keeps it raise TimeoutError( f"No S3 frame received within {timeout:.1f}s (expected SUB 0x{expected:02X})") @@ -1618,7 +1629,7 @@ class MiniMateProtocol: f"the unit sent its boot message but did not answer a POLL within " f"{self._BOOT_GRACE_S:.0f} s") - def _drain_boot_string(self, drain_ms: int = 200) -> None: + def _drain_boot_string(self, drain_ms: int = 200) -> bool: """ Read and discard any boot-string bytes ("Operating System") the device may send before entering binary protocol mode. @@ -1626,14 +1637,21 @@ class MiniMateProtocol: We simply read with a short timeout and throw the bytes away. The S3FrameParser's IDLE state already handles non-frame bytes gracefully, but it's cleaner to drain them explicitly before the first real frame. + + Returns whether the boot banner was among them (the unit is booting). """ deadline = time.monotonic() + (drain_ms / 1000) discarded = 0 + tail, saw_banner = b"", False while time.monotonic() < deadline: chunk = self._transport.read(256) if chunk: discarded += len(chunk) + tail += chunk + saw_banner = saw_banner or self._BOOT_BANNER in tail + tail = tail[-len(self._BOOT_BANNER):] # a banner split across reads still matches else: time.sleep(0.005) if discarded: log.debug("drain_boot_string: discarded %d bytes", discarded) + return saw_banner diff --git a/tests/test_minimate_boot_on_connect.py b/tests/test_minimate_boot_on_connect.py index 010b4a9..ba1b313 100644 --- a/tests/test_minimate_boot_on_connect.py +++ b/tests/test_minimate_boot_on_connect.py @@ -33,9 +33,12 @@ class Booting(SessionReplay): """Banner instead of an answer to the first POLL; then `deaf` more POLL probes go unanswered (still booting); after that, the recorded session as normal.""" - def __init__(self, replies, deaf=2, banner=True): + def __init__(self, replies, deaf=2, banner=True, banner_on_open=False, noise_after=0): super().__init__(replies) self.deaf, self.banner, self.polls = deaf, banner, 0 + self.noise_after = noise_after # non-frame bytes sent after the banner + if banner_on_open: # the banner lands inside the drain window + self._buf, self.banner = BANNER, False def write(self, data): data = bytes(data) @@ -43,7 +46,7 @@ class Booting(SessionReplay): self.polls += 1 if self.polls == 1: if self.banner: - self._buf += BANNER + self._buf += BANNER + b"." * self.noise_after return if self.polls <= 1 + self.deaf: return @@ -75,3 +78,28 @@ def test_a_silent_unit_without_a_banner_fails_as_before(): connect(t) assert "boot" not in str(e.value) assert t.polls == 1 # no re-polling without the banner + + +def test_startup_on_a_reused_protocol_ignores_leftover_bytes(): + replies = recorded_replies() + p = mp.MiniMateProtocol(SessionReplay(replies)) + a5 = next(raw for sub, raw in replies if sub == 0xA5) + p._parser.feed(a5[:20]) # half a frame left over from an earlier exchange + assert p.startup().sub == 0xA4 + + +def test_a_banner_followed_by_more_text_in_the_same_read_is_still_seen(): + t = Booting(recorded_replies(), deaf=1, noise_after=200) + assert connect(t)[1].serial == "BE9441" + + +def test_a_banner_caught_while_draining_is_acted_on(monkeypatch): + t_now = [0.0] + + def fine(): # fine enough that the 200 ms drain really reads + t_now[0] += 0.01 + return t_now[0] + monkeypatch.setattr(mp.time, "monotonic", fine) + t = Booting(recorded_replies(), deaf=1, banner_on_open=True) + assert connect(t)[1].serial == "BE9441" + assert t._buf == b"" # the drain consumed the banner -- 2.54.1 From ac34f80daa6309f9b5d0f0be985c45c6e80c33b2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:45:44 -0400 Subject: [PATCH 093/223] fix(minimateplus): every A5 header is 12 bytes once inner DLE pairs count as one -- the general rule Review of 352f694: the metadata-page detection fixed every observed stream but was one case of a general rule. An A5 header is 12 bytes in the stripped sense (TERM's 11); its raw length is 13 whenever the echoed address carries an inner DLE pair -- the metadata pages at 0x1002 / 0x1004, but equally a sample chunk or TERM boundary that lands there (inferred: ~1 in 128 events spanning 0x1000-0x1200, not in any capture). _raw_skip() counts it per frame, the way probe_skip already did; _has_metadata_pages is gone. The reviewer measured the rule reproducing the shipped bodies byte for byte on all 26 current-walk streams on this box. Test: a chunk moved to 0x1002 yields the same body. No DB or schema change; TOOL_VERSION not bumped (the file builder changed, the .h5 decode did not). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/blastware_file.py | 67 ++++++++++++------------- tests/test_device_access_s3_verify.py | 8 ++- tests/test_minimate_body_no_metadata.py | 14 ++++++ 3 files changed, 54 insertions(+), 35 deletions(-) diff --git a/minimateplus/blastware_file.py b/minimateplus/blastware_file.py index d10eab6..d8b68e3 100644 --- a/minimateplus/blastware_file.py +++ b/minimateplus/blastware_file.py @@ -552,19 +552,29 @@ def classify_frame(frame: S3Frame) -> str: # ── Waveform file writer ─────────────────────────────────────────────────────────── -def _has_metadata_pages(a5_frames) -> bool: - """Whether A5 frames 1 and 2 are the global metadata pages. +_A5_HEADER = 12 # every A5 reply's header after the probe, in stripped bytes +_A5_TERM_HEADER = 11 # the TERM reply's header - Only the event-1 walk (start_key[2:4] == 0) fetches them, at 0x1002 and - 0x1004; a non-first event's stream goes straight from the probe to sample - chunks. Each A5 reply echoes its address at data[2:6], so the frames say - which they are. Both must match: a sample chunk can sit at 0x1002, but then - the next one is at 0x1202, never 0x1004. (Assuming metadata pages in every - stream lost two bytes from every non-first event -- BE9441, 2026-10-25.) + +def _raw_skip(data, stripped_len: int) -> int: + """Raw bytes of `data` covering its first `stripped_len` bytes, an inner DLE + pair (10 02 / 10 03 / 10 04) counting as one -- the rule `probe_skip` and + `_strip_inner_frame_dles` already use. + + Every A5 header is 12 bytes in that sense (the TERM's 11), but its raw length + varies with the address it echoes: 13 for the metadata pages at 0x1002 and + 0x1004, and for a sample chunk that lands there; 12 otherwise. A fixed + "frames 1 and 2 are metadata pages, skip 13" cut two bytes from every + non-first event, which has no metadata pages (BE9441, 2026-10-25). """ - return (len(a5_frames) > 2 - and bytes(a5_frames[1].data[4:6]) == b"\x10\x02" - and bytes(a5_frames[2].data[4:6]) == b"\x10\x04") + raw_i = stripped = 0 + while stripped < stripped_len and raw_i < len(data): + if data[raw_i] == 0x10 and raw_i + 1 < len(data) and data[raw_i + 1] in (0x02, 0x03, 0x04): + raw_i += 2 + else: + raw_i += 1 + stripped += 1 + return raw_i def extract_body_bytes(a5_frames): @@ -627,19 +637,13 @@ def extract_body_bytes(a5_frames): body_frames = a5_frames term_frame = None - meta = _has_metadata_pages(body_frames) all_bytes = bytearray() for fi, frame in enumerate(body_frames): - if fi == 0: - skip = probe_skip - elif fi in (1, 2) and meta: - skip = 13 # metadata pages - else: - skip = 12 # sample chunks + skip = probe_skip if fi == 0 else _raw_skip(frame.data, _A5_HEADER) all_bytes.extend(_frame_body_bytes(frame, skip)) if term_frame is not None: - all_bytes.extend(_frame_body_bytes(term_frame, 11)) + all_bytes.extend(_frame_body_bytes(term_frame, _raw_skip(term_frame.data, _A5_TERM_HEADER))) # Find the first valid `0e 08` footer marker. footer_pos = -1 @@ -802,9 +806,9 @@ def write_blastware_file( # Frame contribution loop (v0.14.0 BW-exact walk). # Skip values: # probe (fi=0): probe_skip - # meta@0x1002 (fi=1): 13 (6-byte inner header) -- event-1 walk only - # meta@0x1004 (fi=2): 13 (6-byte inner header) -- event-1 walk only - # sample chunks (fi=3+): 12 (5-byte inner header) + # every later frame: 12 stripped bytes (_raw_skip): 13 raw for an + # address with an inner DLE pair (the metadata + # pages 0x1002 / 0x1004, or a chunk there), else 12 last_fi = len(body_frames) - 1 log.debug( @@ -812,16 +816,10 @@ def write_blastware_file( len(body_frames), last_fi, ) - meta = _has_metadata_pages(body_frames) all_bytes = bytearray() for fi, frame in enumerate(body_frames): - if fi == 0: - skip = probe_skip - elif fi in (1, 2) and meta: - skip = 13 # metadata pages (event-1 walk only) - else: - skip = 12 # sample chunks + skip = probe_skip if fi == 0 else _raw_skip(frame.data, _A5_HEADER) contribution = _frame_body_bytes(frame, skip) log.debug("write_blastware_file: fi=%d skip=%d raw_data=%d contribution=%d", @@ -829,14 +827,15 @@ def write_blastware_file( all_bytes.extend(contribution) # Terminator contributes its content, which ends with the 26-byte footer. - # skip=11 (not 12) because the terminator's inner frame header is 4 bytes, - # one shorter than chunk frames' 5-byte inner header. Confirmed 2026-04-21. + # 11 stripped bytes (not 12): the terminator's inner frame header is one + # shorter than a chunk's. Confirmed 2026-04-21. if term_frame is not None: - term_contribution = _frame_body_bytes(term_frame, 11) + term_skip = _raw_skip(term_frame.data, _A5_TERM_HEADER) + term_contribution = _frame_body_bytes(term_frame, term_skip) log.debug( - "write_blastware_file: term_frame data_len=%d skip=11 " + "write_blastware_file: term_frame data_len=%d skip=%d " "contribution_len=%d first8=%s", - len(term_frame.data), + len(term_frame.data), term_skip, len(term_contribution), term_contribution[:8].hex() if len(term_contribution) >= 8 else term_contribution.hex(), ) diff --git a/tests/test_device_access_s3_verify.py b/tests/test_device_access_s3_verify.py index a4f5ee4..77b2315 100644 --- a/tests/test_device_access_s3_verify.py +++ b/tests/test_device_access_s3_verify.py @@ -90,6 +90,12 @@ def test_be9441_event_1_downloads_verified(): def test_the_check_refuses_the_file_the_metadata_page_bug_produced(monkeypatch): - monkeypatch.setattr(bw, "_has_metadata_pages", lambda frames: True) # the bug, back + real = bw._frame_body_bytes + calls = [] + + def old_rule(frame, skip): # the bug, back: frames 1 and 2 cut as metadata pages + calls.append(1) + return real(frame, skip + 1 if len(calls) in (2, 3) and skip == 12 else skip) + monkeypatch.setattr(bw, "_frame_body_bytes", old_rule) with pytest.raises(MalformedReply, match="not saved"): adapter().download_event(CABLE, "BE9441", KEY, "20261025141049") diff --git a/tests/test_minimate_body_no_metadata.py b/tests/test_minimate_body_no_metadata.py index f9992d5..1796504 100644 --- a/tests/test_minimate_body_no_metadata.py +++ b/tests/test_minimate_body_no_metadata.py @@ -60,3 +60,17 @@ def test_the_written_file_reads_back_whole(which, tmp_path): pv = read_blastware_file(path).peak_values got = {"Tran": pv.tran, "Vert": pv.vert, "Long": pv.long} assert got == pytest.approx(UNIT_PEAKS[which], abs=1e-6) + + +def test_a_sample_chunk_at_0x1002_is_not_mistaken_for_a_header_byte(): + """Every A5 header is 12 bytes once inner DLE pairs (10 02/03/04) count as one; + the TERM's is 11. A sample chunk echoing address 0x1002 carries 13 raw header + bytes, like a metadata page -- the general rule handles both.""" + frames = a5_frames("event1") + _s, want, _f = extract_body_bytes(frames) + one = frames[1] + hdr, payload = bytes(one.data[:12]), bytes(one.data[12:]) + assert hdr[4:6] != b"\x10\x02" + moved = type(one)(**{**vars(one), "data": hdr[:4] + b"\x10\x02" + b"\x00" + hdr[6:] + payload}) + _s, got, _f = extract_body_bytes([frames[0], moved] + frames[2:]) + assert got == want -- 2.54.1 From c32a9e7851751ee6708278b37c0ae9c24db800f1 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:47:39 -0400 Subject: [PATCH 094/223] fix(sfm): a MiniMate download that decodes as nothing is refused, not stored as a histogram Review of 36f4e5d (measured): with the metadata-page bug put back, 4 of 7 BE12599 non-first waveforms decoded to nothing, and the check stored them unverified as 'a histogram' -- the worst form of the bug it was built for. Now: no waveform decode must decode as a histogram (stored unverified) or it is refused; a waveform's record chain must end on its END record (0x06), as the file reader requires -- cut-short streams have none; the structure checks run for every unit and only the peak comparison is limited to a unit confirmed in normal range (geo_range == 0; an unread range is no longer assumed normal); a clipped blast at full scale on both sides counts as a match. Tests pin the one-step tolerance, both ranges, the END record and the neither case. No DB or schema change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 59 +++++++++++++++++++++------ tests/test_device_access_s3_verify.py | 55 +++++++++++++++++++++---- 2 files changed, 94 insertions(+), 20 deletions(-) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index cc8b6d5..c47a95e 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -102,34 +102,67 @@ _GEO_FULL_SCALE_IPS = 10.0 # normal range; one decoder step = 0.005 in/s _PEAK_TOLERANCE_IPS = 0.0051 # one 0.005 in/s step, plus the 0C's float32 slop -def verify_s3_download(ev: Any, compliance: Any) -> tuple: - """Check a downloaded waveform against the unit's own 0C peaks: (verified, why). +def verify_s3_download(ev: Any, compliance: Any, body: Optional[bytes] = None) -> tuple: + """Check a downloaded event against itself and the unit's own 0C record: (verified, why). - True: all three geophone channels decode to the same length and each - channel's peak is the unit's own to one 0.005 in/s step. None: nothing to - check against -- no waveform decode (a histogram: none of ~430 fixture - histograms decodes as a waveform) or a sensitive-range unit, whose scale is - still open (the 8x discrepancy). Raises MalformedReply ("not saved") - otherwise: a short or misassembled event must not reach the store. BE9441's - bench (2026-10-25) stored two such events as successes before this existed. + A short or misassembled event must not reach the store -- BE9441's bench + (2026-10-25) stored two as successes before this existed. `body` is the + event's 5A body (taken from `ev._a5_frames` when not given). In order: + + * No waveform decode: it must decode as a histogram (stored unverified -- + its peaks are not compared yet), or it is refused. 0 of ~430 fixture + histograms decode as a waveform; a corrupted waveform decodes as neither. + * A waveform's record chain must end on its END record (0x06), as the + file reader requires; a cut-short stream does not. + * All three geophone channels must be the same length. + * Each channel's peak must be the unit's own to one 0.005 in/s step (a + clipped blast -- both at full scale -- counts as a match). Only for a + unit confirmed in normal range: a sensitive-range unit's scale is still + open (the 8x discrepancy), and an unread range is not assumed. + + Raises MalformedReply ("not saved") on any failure. """ + from minimateplus.blastware_file import extract_body_bytes + from minimateplus.histogram_codec import decode_histogram_body + from minimateplus.waveform_codec import STREAM_END_ID, walk_records + + if body is None: + frames = getattr(ev, "_a5_frames", None) + body = extract_body_bytes(frames)[1] if frames else b"" samples = getattr(ev, "raw_samples", None) or {} chans = ("Tran", "Vert", "Long") if not all(samples.get(c) for c in chans): - return None, "no waveform decode to check (a histogram, or no codec for it)" - if getattr(compliance, "geo_range", 0) not in (0, None): - return None, "sensitive range: the sample scale is not settled, so not checked" + if body and decode_histogram_body(body): + return None, "a histogram: stored unverified (its peaks are not compared yet)" + raise MalformedReply( + "the downloaded event decodes as neither a waveform nor a histogram -- the " + "download is incomplete or misassembled; not saved") + try: + recs = walk_records(body) + except Exception: # noqa: BLE001 -- treated as no chain + recs = [] + tail = recs[-1]["end"] if recs else None + if tail is None or tail + 5 > len(body) or body[tail + 4] != STREAM_END_ID: + raise MalformedReply( + "the downloaded waveform's record chain has no end record -- the download is " + "cut short; not saved") lengths = {c: len(samples[c]) for c in chans} if len(set(lengths.values())) != 1: raise MalformedReply( f"the downloaded waveform's channels have different lengths {lengths} -- the " "download is incomplete or misassembled; not saved") + if getattr(compliance, "geo_range", None) != 0: + return None, ("whole, but peaks not checked: the unit is not confirmed in normal " + "range (a sensitive-range scale is not settled)") pv = ev.peak_values unit = {"Tran": pv.tran, "Vert": pv.vert, "Long": pv.long} if pv else {} + clip = _GEO_FULL_SCALE_IPS - _PEAK_TOLERANCE_IPS for c in chans: if unit.get(c) is None: - return None, f"the unit's record gives no {c} peak to check against" + return None, f"whole, but the unit's record gives no {c} peak to check against" decoded = max(abs(x) for x in samples[c]) * _GEO_FULL_SCALE_IPS / _GEO_INT16_FS + if decoded >= clip and unit[c] >= clip: + continue # both at full scale: a clipped blast if abs(decoded - unit[c]) > _PEAK_TOLERANCE_IPS: raise MalformedReply( f"the downloaded {c} peak is {decoded:.4f} in/s but the unit's own record says " diff --git a/tests/test_device_access_s3_verify.py b/tests/test_device_access_s3_verify.py index 77b2315..153a365 100644 --- a/tests/test_device_access_s3_verify.py +++ b/tests/test_device_access_s3_verify.py @@ -19,6 +19,8 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import minimateplus.blastware_file as bw # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 +from minimate_replay import FIX # noqa: E402 import minimateplus.client as mc # noqa: E402 from minimate_replay import KEY, SessionReplay, fast_clock, recorded_replies # noqa: E402 from minimateplus.models import ComplianceConfig, Event, PeakValues # noqa: E402 @@ -47,35 +49,74 @@ def flat(n, peak_ips): NORMAL = ComplianceConfig(geo_range=0) +GOOD = bw.extract_body_bytes( # BE9441 event 1, whole + [f for f in S3FrameParser().feed(FIX.read_bytes()) if f.sub == 0xA5])[1] +_H = (FIX.parent.parent / "ts-fix" / "K441LKZU.C30H").read_bytes() # BE9441's own histogram +HISTOGRAM = _H[bw._WAVEFORM_HEADER_SIZE + 21:-26] def test_matching_peaks_and_lengths_verify(): ev = event({c: flat(100, p) for c, p in zip(("Tran", "Vert", "Long"), (0.03, 0.095, 0.02))}, (0.02999996, 0.09499989, 0.01999998)) - assert verify_s3_download(ev, NORMAL)[0] is True + assert verify_s3_download(ev, NORMAL, body=GOOD)[0] is True def test_a_peak_that_disagrees_is_refused(): ev = event({c: flat(100, p) for c, p in zip(("Tran", "Vert", "Long"), (0.01, 0.01, 0.005))}, (0.03, 0.095, 0.02)) with pytest.raises(MalformedReply, match="Tran peak is 0.0100.*not saved"): - verify_s3_download(ev, NORMAL) + verify_s3_download(ev, NORMAL, body=GOOD) def test_unequal_channel_lengths_are_refused(): ev = event({"Tran": flat(100, 0.03), "Vert": flat(100, 0.095), "Long": flat(90, 0.02)}, (0.03, 0.095, 0.02)) with pytest.raises(MalformedReply, match="lengths.*not saved"): - verify_s3_download(ev, NORMAL) + verify_s3_download(ev, NORMAL, body=GOOD) -def test_no_waveform_decode_is_stored_unverified(): - assert verify_s3_download(event(None, (0.03, 0.095, 0.02)), NORMAL)[0] is None +def test_a_histogram_is_stored_unverified(): + ok, why = verify_s3_download(event(None, (0.03, 0.095, 0.02)), NORMAL, body=HISTOGRAM) + assert ok is None and "histogram" in why -def test_a_sensitive_range_unit_is_stored_unverified(): +def test_a_body_that_decodes_as_neither_is_refused(): + with pytest.raises(MalformedReply, match="neither a waveform nor a histogram.*not saved"): + verify_s3_download(event(None, (0.03, 0.095, 0.02)), NORMAL, body=GOOD[:4000]) + + +def test_a_waveform_without_its_end_record_is_refused(): + ev = event({c: flat(100, p) for c, p in zip(("Tran", "Vert", "Long"), (0.03, 0.095, 0.02))}, + (0.03, 0.095, 0.02)) + with pytest.raises(MalformedReply, match="end record.*not saved"): + verify_s3_download(ev, NORMAL, body=GOOD[:20_000]) + + +def test_a_sensitive_range_unit_is_structure_checked_but_not_peak_checked(): ev = event({c: flat(100, 0.5) for c in ("Tran", "Vert", "Long")}, (0.03, 0.095, 0.02)) - assert verify_s3_download(ev, ComplianceConfig(geo_range=1))[0] is None + assert verify_s3_download(ev, ComplianceConfig(geo_range=1), body=GOOD)[0] is None + short = event({"Tran": flat(100, 0.5), "Vert": flat(100, 0.5), "Long": flat(90, 0.5)}, + (0.03, 0.095, 0.02)) + with pytest.raises(MalformedReply, match="lengths"): + verify_s3_download(short, ComplianceConfig(geo_range=1), body=GOOD) + + +def test_an_unknown_range_is_not_peak_checked(): + ev = event({c: flat(100, 0.5) for c in ("Tran", "Vert", "Long")}, (0.03, 0.095, 0.02)) + assert verify_s3_download(ev, ComplianceConfig(), body=GOOD)[0] is None + + +def test_a_clipped_blast_is_not_refused(): + ev = event({c: [0] * 99 + [32016] for c in ("Tran", "Vert", "Long")}, (10.0, 10.0, 10.0)) + assert verify_s3_download(ev, NORMAL, body=GOOD)[0] is True + + +def test_the_tolerance_is_one_step(): + near = event({c: flat(100, 0.095) for c in ("Tran", "Vert", "Long")}, (0.095 + 0.005,) * 3) + assert verify_s3_download(near, NORMAL, body=GOOD)[0] is True + far = event({c: flat(100, 0.095) for c in ("Tran", "Vert", "Long")}, (0.095 + 0.0055,) * 3) + with pytest.raises(MalformedReply): + verify_s3_download(far, NORMAL, body=GOOD) def adapter(): -- 2.54.1 From a7214c50dee6844ccbd1bd1f9d9a13aca4fe26a4 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:49:44 -0400 Subject: [PATCH 095/223] test: the Series-3 fake downloads a real event -- c32a9e7 was pushed with 4 tests failing c32a9e7 made the download check read the 5A body; the Series-3 fake handed back placeholder frames (['frame']), so 4 plumbing tests in test_device_access_s3_events.py and test_device_access_event_dispatch.py failed with "'str' object has no attribute 'data'" -- and that commit was pushed without the failure set being read. The fake's one-event download now carries what a real one does: BE9441 event 1's recorded frames, their decoded waveform and the unit's own peaks for it. Those tests now see verified=True on a whole event. Suite back to the 16 known fixture failures. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/device_access_fakes.py | 23 ++++++++++++++++++++++ tests/test_device_access_event_dispatch.py | 2 +- tests/test_device_access_s3_events.py | 5 +++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 01a2b89..08fe44c 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -148,11 +148,34 @@ class FakeMiniMateClient(_Base): if expected_timestamp is not None and _iso(ev) != expected_timestamp: ev = copy.copy(ev) ev._a5_frames = None + elif ev._a5_frames: + _as_downloaded(ev) self.last_download = ev return ev return None +_REAL = {} + + +def _as_downloaded(ev): + """Give a fake event what a real one-event download carries: BE9441 event 1's + recorded A5 frames, their decoded waveform, and the unit's own 0C peaks for it + -- so the download check sees a whole, matching event.""" + if not _REAL: + from minimateplus.framing import S3FrameParser + from minimateplus.waveform_codec import decode_a5_frames + raw = (Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" + / "BE9441_event1_0111646a_rx.bin").read_bytes() + _REAL["frames"] = [f for f in S3FrameParser().feed(raw) if f.sub == 0xA5] + _REAL["samples"] = decode_a5_frames(_REAL["frames"]) + ev._a5_frames = _REAL["frames"] + ev.raw_samples = _REAL["samples"] + pv = ev.peak_values + ev.peak_values = PeakValues(tran=0.030, vert=0.095, long=0.020, micl=pv.micl if pv else None, + peak_vector_sum=pv.peak_vector_sum if pv else None) + + def s4_ref(index, key_hex, when, record_type, *, pvs=0.2): """Fixture-backed: the filename it produces names a real file in thor-idf/.""" ref = MicromateEventRef(index=index, key=bytes.fromhex(key_hex), size=0, serial="UM20147", diff --git a/tests/test_device_access_event_dispatch.py b/tests/test_device_access_event_dispatch.py index cef297f..a306bb4 100644 --- a/tests/test_device_access_event_dispatch.py +++ b/tests/test_device_access_event_dispatch.py @@ -61,7 +61,7 @@ def test_an_id_from_another_unit_is_refused_before_any_io(): def test_a_minimate_download_goes_through_the_series3_adapter(): dl = access(s3=[FakeMiniMateClient()]).download_event(ADDR, "BE18193", "BE18193:01110000:-") - assert dl.series == 3 and dl.a5_frames == ["frame"] + assert dl.series == 3 and dl.a5_frames and all(f.sub == 0xA5 for f in dl.a5_frames) def test_a_ring_mid_download_releases_the_line_and_downloads_nothing(): diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index 680e8ad..e4ac8b7 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -70,8 +70,9 @@ def test_listing_refuses_a_different_unit(): def test_download_returns_the_event_its_frames_and_the_settings(): fake = FakeMiniMateClient() dl = adapter(fake).download_event(TCP, "BE18193", FIRST, "20261001080000") - assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", None) - assert dl.event is fake.events[0] and dl.a5_frames == ["frame"] + assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", True) + assert dl.event is fake.events[0] and dl.a5_frames is fake.events[0]._a5_frames + assert dl.a5_frames and all(f.sub == 0xA5 for f in dl.a5_frames) assert dl.compliance is fake.compliance and dl.filename.startswith("T193") assert dl.timestamp == datetime.datetime(2026, 10, 1, 8, 0, 0) -- 2.54.1 From 78617d47cef82631acfc71a1575b790570a90edf Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:52:23 -0400 Subject: [PATCH 096/223] test(minimateplus): each strict-stream refusal has its own test; a re-poll always follows a SESSION_RESET Review of 75d79ec / d73a27d (mutation): removing the chunk-timeout raise went unnoticed because the TERM raise also said 'ended early', and the no-STRT, metadata-page, mid-stream-terminator and chunk-cap raises had no test at all; a re-poll without SESSION_RESET passed because the test double ignored it. Each refusal is now pinned by its own message, each verified by removing it (bytecode caching off -- same-second, same-size rewrites reuse a stale .pyc). The strict tests use the shared replay helpers, which load either fixture. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/minimate_replay.py | 8 ++- tests/test_minimate_5a_strict.py | 98 ++++++++++++++------------ tests/test_minimate_boot_on_connect.py | 4 ++ 3 files changed, 60 insertions(+), 50 deletions(-) diff --git a/tests/minimate_replay.py b/tests/minimate_replay.py index 8e75391..cb7b956 100644 --- a/tests/minimate_replay.py +++ b/tests/minimate_replay.py @@ -10,16 +10,18 @@ from pathlib import Path import minimateplus.protocol as mp from minimateplus.framing import S3FrameParser -FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" +_DIR = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" +FIX = _DIR / "BE9441_event1_0111646a_rx.bin" # event 1 (non-first): no metadata pages +FIX_EVENT0 = _DIR / "BE9441_event0_01110000_rx.bin" # event 0: metadata pages 0x1002 / 0x1004 KEY = bytes.fromhex("0111646a") STAMP = "2026-10-25T14:10:49" UNIT_PEAKS = {"Tran": 0.030, "Vert": 0.095, "Long": 0.020} # the unit's own 0C peaks, in/s SESSION_RESET = b"\x41\x03" -def recorded_replies(): +def recorded_replies(path=None): """[(sub, raw_bytes)] for every frame of the session, in order.""" - raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() + raw, out, start, p = (path or FIX).read_bytes(), [], 0, S3FrameParser() for i in range(len(raw)): for f in p.feed(raw[i:i + 1]): out.append((f.sub, raw[start:i + 1])) diff --git a/tests/test_minimate_5a_strict.py b/tests/test_minimate_5a_strict.py index 7d085d1..325cc40 100644 --- a/tests/test_minimate_5a_strict.py +++ b/tests/test_minimate_5a_strict.py @@ -1,42 +1,41 @@ """A one-event download must not keep an event whose 5A stream ended early. BE9441 rebooted mid-download at the bench (2026-10-25): the chunk at 0x7D06 got -no reply, the loop logged "unexpected end-of-stream -- proceeding to TERM", the -TERM got no reply either, and the short event was stored as a success. In -strict mode (the one-event download) every early end now raises; the legacy -full walk keeps its tolerance. Driven by BE9441's recorded replies for event 1. +one stray byte and then silence, the loop logged "unexpected end-of-stream -- +proceeding to TERM", the TERM got no reply either, and the short event was +stored as a success. In strict mode (the one-event download) every early end +now raises, each with its own message; the legacy full walk keeps its +tolerance. Driven by BE9441's recorded A5 replies. """ from __future__ import annotations import os import sys -from pathlib import Path import pytest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -import minimateplus.protocol as mp # noqa: E402 -from minimateplus.framing import S3FrameParser # noqa: E402 +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import FIX, FIX_EVENT0, fast_clock, recorded_replies # noqa: E402 -FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin" KEY = bytes.fromhex("0111646a") +KEY0 = bytes.fromhex("01110000") -def a5_replies() -> list: - """The raw bytes of each A5 reply, in order (the parser fed one byte at a time).""" - raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser() - for i in range(len(raw)): - for f in p.feed(raw[i:i + 1]): - if f.sub == 0xA5: - out.append(raw[start:i + 1]) - start = i + 1 - return out +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +def a5_replies(path=FIX) -> list: + return [raw for sub, raw in recorded_replies(path) if sub == 0xA5] class Replay: - """One recorded reply per 5A request; from request number `silent_from` on, one - stray 0x41 and then silence -- what BE9441 sent as it rebooted.""" + """One recorded A5 reply per 5A request, in order. From request `silent_from` + on: one stray 0x41 and then silence -- what BE9441 sent as it rebooted.""" def __init__(self, replies, silent_from=None): self.replies, self.silent_from, self.sent, self._buf = list(replies), silent_from, 0, b"" @@ -53,45 +52,50 @@ class Replay: return out -@pytest.fixture(autouse=True) -def fast_clock(monkeypatch): - t = [0.0] - - def tick(): - t[0] += 0.5 - return t[0] - monkeypatch.setattr(mp.time, "monotonic", tick) - monkeypatch.setattr(mp.time, "sleep", lambda s: None) - - -def proto(silent_from=None): - replies = a5_replies() +def stream(replies, key=KEY, silent_from=None, **kw): p = mp.MiniMateProtocol(Replay(replies, silent_from)) - return p, len(replies) + return p.read_bulk_waveform_stream(key, stop_after_metadata=False, include_terminator=True, **kw) def test_the_recorded_stream_replays_whole(): - p, n = proto() - frames = p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, - strict=True) - assert len(frames) == n == 51 + assert len(stream(a5_replies(), strict=True)) == 51 def test_strict_raises_when_a_chunk_gets_no_reply(): - p, _ = proto(silent_from=40) - with pytest.raises(mp.ProtocolError, match="ended early"): - p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, - strict=True) + with pytest.raises(mp.ProtocolError, match="no reply for the chunk at 0x"): + stream(a5_replies(), silent_from=40, strict=True) def test_strict_raises_when_the_term_gets_no_reply(): - p, n = proto(silent_from=50) # every chunk answered, the TERM not - with pytest.raises(mp.ProtocolError, match="TERM"): - p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, - strict=True) + with pytest.raises(mp.ProtocolError, match="no reply to the TERM request"): + stream(a5_replies(), silent_from=50, strict=True) # every chunk answered, the TERM not + + +def test_strict_raises_when_a_metadata_page_gets_no_reply(): + with pytest.raises(mp.ProtocolError, match="metadata page 0x1002 got no reply"): + stream(a5_replies(FIX_EVENT0), key=KEY0, silent_from=1, strict=True) + + +def test_strict_raises_on_a_terminator_mid_stream(): + r = a5_replies() + r[10] = r[-1] # the TERM reply in place of chunk 10 + with pytest.raises(mp.ProtocolError, match="sent its terminator"): + stream(r, strict=True) + + +def test_strict_raises_at_the_chunk_cap(): + with pytest.raises(mp.ProtocolError, match="chunk cap"): + stream(a5_replies(), max_chunks=5, strict=True) + + +def test_strict_raises_when_the_probe_has_no_strt(): + r = a5_replies() + assert b"STRT" in r[0] + r[0] = r[0].replace(b"STRT", b"XXXX") + with pytest.raises(mp.ProtocolError, match="no STRT record"): + stream(r, strict=True) def test_the_legacy_walk_keeps_its_tolerance(): - p, _ = proto(silent_from=40) - frames = p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True) + frames = stream(a5_replies(), silent_from=40) assert 0 < len(frames) < 51 # short, returned, not raised -- as before diff --git a/tests/test_minimate_boot_on_connect.py b/tests/test_minimate_boot_on_connect.py index ba1b313..ed39de2 100644 --- a/tests/test_minimate_boot_on_connect.py +++ b/tests/test_minimate_boot_on_connect.py @@ -42,6 +42,7 @@ class Booting(SessionReplay): def write(self, data): data = bytes(data) + self.log = getattr(self, "log", []) + [data] if data[:2] == b"\x41\x02" and data[5] == 0x5B and data[8] == 0x00: # the POLL probe self.polls += 1 if self.polls == 1: @@ -64,6 +65,9 @@ def test_a_unit_booting_on_connect_is_waited_for(): _client, info = connect(t) assert info.serial == "BE9441" assert t.polls == 4 # the lost one, two while booting, the answered one + probes = [i for i, w in enumerate(t.log) if w[5:6] == b"\x5b" and w[8] == 0x00] + assert all(t.log[i - 1] == b"\x41\x03" for i in probes) # every POLL follows a SESSION_RESET + assert {w[5] for w in t.log if w[:2] == b"\x41\x02"} <= {0x5B, 0x15, 0x01, 0x1A, 0x08} # reads only def test_a_unit_that_boots_but_never_answers_says_so(): -- 2.54.1 From 64273c07d35b8c2ccf325089238e787e8b6e0d67 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 18:52:42 -0400 Subject: [PATCH 097/223] docs(spec): the MiniMate fixes' review -- the changelog's operational note, a behaviour change, a bench-first item Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index b0f02f2..37f558b 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -612,6 +612,26 @@ items were left for later on purpose: - **For the merge to dev.** The changelog states: a new `device_commands` table (`CREATE TABLE IF NOT EXISTS`) plus a `_migrate` step that adds `sent` and `states` to tables created from this branch. Prod: no migration, no backfill. +- **The MiniMate bench fixes, for the changelog** (2026-10-25, reviewed). + - **The body builder changed in the codec library** (`blastware_file.py`). + `TOOL_VERSION` was not bumped, because the `.h5` decode did not change. + - **Operational consequence: none.** Measured: the dev store holds 0 + `.a5.pkl` files. Inferred: prod runs no SFM receivers, and it ingests + Blastware's own files, which these functions never touch. + - The commit `352f694` says ".a5.pkl sidecars can rebuild them". That is + wrong: no tool rewrites the event file. + - **Behaviour change.** A probe timeout in a one-event download was + `502 "no waveform data received"`. It is now `NoAnswer` 504, and over TCP + it is retried once as a whole new session. That is a read, so it is + acceptable. + - **Orphaned diagnostic rows.** `be12599-diag`'s `ach_state.json` and its DB + key BE9557 as `'BE9557\x00G'`, the old serial bug. That is diagnostic data + only. SQLite `GLOB` stops at the NUL, so search with `hex()`. +- **Bench-test first, then decide.** A unit that answers a re-poll more than + 2 s late, or answers polls it buffered while booting, could leave an extra A4 + that is taken as `POLL_DATA`'s reply. `connect()` then fails at the `0x15` + check: an error, never corruption. A short drain after the re-poll would fix + it if a bench shows it happens. ## Table 2: to be added later (both series) -- 2.54.1 From f34f5c3376e9c17b7c66d24f1e2451699011ab2c Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 25 Oct 2026 19:01:36 -0400 Subject: [PATCH 098/223] test(minimateplus): pin the BE9441 bodies and files byte for byte, and the TERM's header skip Re-review of 64273c0: nothing pinned the TERM skip -- a TERM cut one byte off loses a byte after the END record, invisible to every decode and peak check. Golden sha256 of both fixtures' bodies and written files (event 0's file is byte-identical to the one SFM stored at the bench before any fix; event 1's is the bench's 25,810 bytes plus the 2 recovered), and a TERM moved to 0x1002. The clipped-blast test now sits two steps past full scale (32032 counts), so it needs the carve-out. Spec: the TOOL_VERSION reason corrected (no stored file is affected); a MicL-only waveform is now refused -- failing safe, bench-check. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 11 +++++- tests/test_device_access_s3_verify.py | 2 +- tests/test_minimate_body_no_metadata.py | 38 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 37f558b..f2f3610 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -614,7 +614,9 @@ items were left for later on purpose: `states` to tables created from this branch. Prod: no migration, no backfill. - **The MiniMate bench fixes, for the changelog** (2026-10-25, reviewed). - **The body builder changed in the codec library** (`blastware_file.py`). - `TOOL_VERSION` was not bumped, because the `.h5` decode did not change. + `TOOL_VERSION` is not bumped, because no stored file is affected, so nothing + is owed. The `.h5` regenerated from an `.a5.pkl` *would* change for a + non-first event, but no store holds one (below). - **Operational consequence: none.** Measured: the dev store holds 0 `.a5.pkl` files. Inferred: prod runs no SFM receivers, and it ingests Blastware's own files, which these functions never touch. @@ -632,6 +634,13 @@ items were left for later on purpose: that is taken as `POLL_DATA`'s reply. `connect()` then fails at the `0x15` check: an error, never corruption. A short drain after the re-poll would fix it if a bench shows it happens. +- **The download check refuses what it cannot classify** (inferred, untested + configurations). A waveform with the geophones disabled (MicL only) leaves + Tran/Vert/Long empty, takes the histogram path and is refused; before + `c32a9e7` it was stored unverified. Histogram+Continuous events have never + been downloaded over 5A either. That is failing safe by design. A bench + check on such a unit decides whether a MicL-only branch (END check, no peaks) + is needed. ## Table 2: to be added later (both series) diff --git a/tests/test_device_access_s3_verify.py b/tests/test_device_access_s3_verify.py index 153a365..69e28d1 100644 --- a/tests/test_device_access_s3_verify.py +++ b/tests/test_device_access_s3_verify.py @@ -107,7 +107,7 @@ def test_an_unknown_range_is_not_peak_checked(): def test_a_clipped_blast_is_not_refused(): - ev = event({c: [0] * 99 + [32016] for c in ("Tran", "Vert", "Long")}, (10.0, 10.0, 10.0)) + ev = event({c: [0] * 99 + [32032] for c in ("Tran", "Vert", "Long")}, (10.0, 10.0, 10.0)) # 10.010 in/s: two steps past assert verify_s3_download(ev, NORMAL, body=GOOD)[0] is True diff --git a/tests/test_minimate_body_no_metadata.py b/tests/test_minimate_body_no_metadata.py index 1796504..d21554c 100644 --- a/tests/test_minimate_body_no_metadata.py +++ b/tests/test_minimate_body_no_metadata.py @@ -74,3 +74,41 @@ def test_a_sample_chunk_at_0x1002_is_not_mistaken_for_a_header_byte(): moved = type(one)(**{**vars(one), "data": hdr[:4] + b"\x10\x02" + b"\x00" + hdr[6:] + payload}) _s, got, _f = extract_body_bytes([frames[0], moved] + frames[2:]) assert got == want + + +GOLDEN = { # sha256 of STRT + body + footer, and of the written file + # event 0's file is byte-identical to the one SFM stored at the bench before any fix + "event0": ("29beabfe46a858587b8cdc6ee3f484473c07f96485e404f68c42c6aa1e298aa7", + "589073a096d4f867c5ab8c697c82c4b635c7757fcfdd618b460f3b647c32ed7f"), + # event 1's is the bench's 25,810 bytes plus the 2 the metadata-page bug cut + "event1": ("25026e6f27b0e9e9508ceb49dcb0c44df688ee4f71c05b91826b088d4de68031", + "e74c664daaf22d5ae4a7b2464bf6d7aca432f2a10e00fd20c8f6b176999e71b3"), +} + + +@pytest.mark.parametrize("which", ["event0", "event1"]) +def test_the_body_and_file_are_byte_exact(which, tmp_path): + """Pins every header skip, the TERM's included: a TERM cut one byte off loses + a byte after the END record, which no decode and no peak check can see.""" + import hashlib + frames = a5_frames(which) + strt, body, footer = extract_body_bytes(frames) + ev = Event(index=0) + ev.timestamp = None + path = tmp_path / "x.P00" + write_blastware_file(ev, frames, path) + assert hashlib.sha256(strt + body + footer).hexdigest() == GOLDEN[which][0] + assert hashlib.sha256(path.read_bytes()).hexdigest() == GOLDEN[which][1] + + +def test_a_term_at_0x1002_is_not_mistaken_for_a_header_byte(): + """The TERM's header (11 stripped bytes: one byte, its 4-byte address, zeros) + takes 12 raw bytes when the address it echoes carries an inner DLE pair.""" + frames = a5_frames("event1") + _s, want, _f = extract_body_bytes(frames) + term = frames[-1] + d = bytes(term.data) + assert d[1:3] == b"\x01\x11" and d[3:5] != b"\x10\x02" + moved = type(term)(**{**vars(term), "data": d[:3] + b"\x10\x02" + b"\x00" + d[5:]}) + _s, got, _f = extract_body_bytes(frames[:-1] + [moved]) + assert got == want -- 2.54.1 From d56dde768d3a2d6a9805fc1a1f3f11d38c4007d6 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 01:14:42 -0400 Subject: [PATCH 099/223] fix(minimateplus): a 5A request's checksum is DLE-escaped when it is a framing byte BE9441 never answered 5A chunk 0x7D06 of event 01122f06 -- twice (bench 2026-10-25 and 2026-10-26), each time rebooting ~11 s later. The request ended '... 02 03': build_5a_frame wrote the checksum bare, and 0x02 is STX. Sent with the checksum escaped ('10 02 03') the unit answered in 28 ms; so did chunk 0x7F06 (checksum 0x04) and 0x8B06 (0x10, which bare reads as DLE+ETX), and the event downloaded whole and verified (21,504 x 3, peaks equal to the unit's). Escape set {02, 03, 04, 10}: a Micromate's, measured on 251/251 THOR requests; the MiniMate's own de-stuffing keeps 10 02/03/04 literal. About 1 chunk request in 64 has such a checksum, so roughly half of all multi-chunk downloads hit one. Not changed (no evidence either way): build_bw_frame escapes only 0x10 in its checksum; a keyed read whose checksum is 02/03/04 is untested. The BW 5A byte-perfect tests skip on this box (captures absent) -- worth running where they exist. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/framing.py | 9 +++++++- tests/test_5a_checksum_escape.py | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/test_5a_checksum_escape.py diff --git a/minimateplus/framing.py b/minimateplus/framing.py index e513e23..be0b57e 100644 --- a/minimateplus/framing.py +++ b/minimateplus/framing.py @@ -183,7 +183,14 @@ def build_5a_frame(offset_word: int, raw_params: bytes) -> bytes: chk = (chk + s[i]) & 0xFF i += 1 - return bytes([ACK, STX]) + bytes(s) + bytes([chk, ETX]) + # A checksum that is itself a framing byte is DLE-escaped. Sent bare, a + # 0x02 before ETX reads as a new STX: BE9441 never answered chunk 0x7D06 + # (`... 02 03`) and rebooted ~11 s later, twice; escaped (`10 02 03`) it + # answered in 28 ms, as did checksums 0x04 and 0x10 (bench, 2026-10-26). + # The set is a Micromate's escape set (251/251 THOR requests); the MiniMate's + # de-stuffing keeps `10 02/03/04` literal and turns `10 10` into 0x10. + tail = bytes([DLE, chk]) if chk in (STX, ETX, 0x04, DLE) else bytes([chk]) + return bytes([ACK, STX]) + bytes(s) + tail + bytes([ETX]) def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes: diff --git a/tests/test_5a_checksum_escape.py b/tests/test_5a_checksum_escape.py new file mode 100644 index 0000000..9c4ec74 --- /dev/null +++ b/tests/test_5a_checksum_escape.py @@ -0,0 +1,39 @@ +"""A 5A request's checksum is DLE-escaped when it lands on 02 / 03 / 04 / 10. + +BE9441 (bench, 2026-10-25/26) never answered the request for chunk 0x7D06 of +event 01122f06 -- twice, each time rebooting ~11 s later -- because the frame +ended `... 02 03`: a bare 0x02 checksum, the STX byte, before ETX. Sent with +the checksum escaped (`10 02 03`) it answered in 28 ms, as did chunks 0x7F06 +(checksum 0x04) and 0x8B06 (0x10), and the event downloaded whole and verified. +The escape set is the one a Micromate uses for every byte (measured on 251/251 +THOR requests); the MiniMate's own de-stuffing keeps `10 02/03/04` literal. +""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from minimateplus.framing import build_5a_frame, bulk_waveform_params # noqa: E402 + +KEY = bytes.fromhex("01122f06") +CHUNK_OFFSET = 0x1002 + + +def chunk(counter: int) -> str: + return build_5a_frame(CHUNK_OFFSET, bulk_waveform_params(KEY, counter)).hex() + + +@pytest.mark.parametrize("counter,wire", [ + # the wire bytes BE9441 answered, checksum escaped + (0x7D06, "41021010005a0010020001127d06000000000000100203"), # checksum 0x02 + (0x7F06, "41021010005a0010020001127f06000000000000100403"), # checksum 0x04 + (0x8B06, "41021010005a0010020001128b06000000000000101003"), # checksum 0x10 + # an ordinary checksum is untouched + (0x7B06, "41021010005a0010020001127b060000000000000003"), +]) +def test_the_checksum_is_escaped_only_when_it_is_a_framing_byte(counter, wire): + assert chunk(counter) == wire -- 2.54.1 From bf9e32cfc031b49e6db6047c427164cdd7f94fb8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 01:16:12 -0400 Subject: [PATCH 100/223] fix(minimateplus): a one-event download names an event that crosses the 64 KB page boundary Bench re-run 2026-10-26: BE9441 events 2 (0111c92c) and 19 (0118a4ca) end in the next page, so STRT's 16-bit end offset reads lower than the start. The walk then failed in bulk_waveform_term_v2 with a ValueError ('end_offset 0x2F06 must be > last_chunk_counter 0xC92C') that the adapter's struct.error mapping did not catch: a generic 500. Strict mode now refuses such an event by name right after the probe -- 'crosses the unit's 64 KB page boundary ... the known 5A page bug; not saved' -- before any chunk is sent. Not stored either way. The page bug itself is unchanged (CLAUDE.md: needs a BW capture of a spanning event). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/protocol.py | 10 ++++++++++ tests/test_minimate_5a_strict.py | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 07f1a06..1e2b55d 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -664,6 +664,16 @@ class MiniMateProtocol: raise ProtocolError( f"5A probe for {key4.hex()} carried no STRT record, so the event's end " "is unknown -- not downloaded") + if strict and end_offset is not None and end_offset < start_offset: + # The known 5A page bug: parse_strt_end_offset keeps only the low 16 + # bits, so an event that ends in the next 64 KB page reads as ending + # before it starts, and the walk cannot follow it yet. BE9441's + # events 2 and 19 (bench 2026-10-26) -- named here, before any chunk. + raise ProtocolError( + f"event {key4.hex()} crosses the unit's 64 KB page boundary (starts at " + f"0x{start_offset:04X} in page 0x{key4[1]:02X}, ends at 0x{end_offset:04X} in " + "the next) -- SFM cannot download such an event yet (the known 5A page bug); " + "not saved") if end_offset is None: log.warning( "5A probe response did not contain a STRT record; " diff --git a/tests/test_minimate_5a_strict.py b/tests/test_minimate_5a_strict.py index 325cc40..397739c 100644 --- a/tests/test_minimate_5a_strict.py +++ b/tests/test_minimate_5a_strict.py @@ -99,3 +99,17 @@ def test_strict_raises_when_the_probe_has_no_strt(): def test_the_legacy_walk_keeps_its_tolerance(): frames = stream(a5_replies(), silent_from=40) assert 0 < len(frames) < 51 # short, returned, not raised -- as before + + +def test_strict_names_an_event_that_crosses_the_64kb_page_boundary(): + """BE9441 events 2 and 19 end in the next page (end offset < start offset); + the walk cannot follow them yet. Refused by name, before any chunk is sent.""" + r = a5_replies() + i = r[0].find(b"STRT") + assert r[0][i + 6:i + 10] == bytes.fromhex("0111c92c") # the end key: same page + r[0] = r[0][:i + 6] + bytes.fromhex("01122f06") + r[0][i + 10:] # ... now the next page + p = mp.MiniMateProtocol(Replay(r)) + with pytest.raises(mp.ProtocolError, match="crosses the unit's 64 KB page boundary"): + p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, + strict=True) + assert p._transport.sent == 1 # the probe, and nothing after -- 2.54.1 From 1ded70fcd9987c9904d7518a46f5d35ab0aa2118 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 01:19:46 -0400 Subject: [PATCH 101/223] docs: the MiniMate re-run -- every in-page event verifies; the 'reboot' was our bare 0x02 checksum Series-III reference: a 2026-10-26 row (5A checksum escape, measured), and the 2026-10-25 row's guessed cause of the mid-download reboot (battery, firmware) retracted in place -- it was our request. CRLF kept. Spec: the re-run, item by item, and what is still owed. CLAUDE.md: the phase-1b bullet brought up to date. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 13 +++++++--- docs/instantel_protocol_reference.md | 3 ++- .../2026-10-20-sfm-series4-parity-design.md | 26 ++++++++++++++----- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 935bb40..f02d795 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,15 +141,20 @@ Read this first when picking the project back up. `get_events` and `ach_server.py` files. Blastware's own files were not affected. 2. **A reboot mid-download stored a partial event as a success.** A strict - 5A stream now raises on any early end. + 5A stream now raises on any early end. The reboot itself was ours: the 5A + request had a bare `0x02` checksum, which the unit reads as STX. A 5A + checksum in {02, 03, 04, 10} is now DLE-escaped (re-run 2026-10-26). 3. **The unit boots when its port opens** and ignores a POLL sent before the `Operating System` banner. Startup now waits for it. 4. **The 0x15 serial is a C string** (`"BE9441\x00?"`). Series-3 downloads are now checked against the unit's own 0C peaks before - being stored. ⚠ **A re-run with the fixes in place is still owed before - merge**, plus the rest of the check's scope (spec, phase 1b). Next: 1c - (webapp). + being stored. **Re-run 2026-10-26:** every event that does not cross a + 64 KB page downloaded whole and verified (events 0, 1, 3, 4, 10). The two + that cross one (events 2, 19) are refused by name. Stale id gives 409, a + repeat gives `already_stored`. ⚠ Still owed before merge: a histogram event, + `already_stored` against Blastware's copy, and start/stop through the new path + (spec, phase 1b). Next: 1c (webapp). - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 618383a..c6f01f1 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,7 +11,8 @@ | Date | Section | Change | |---|---|---| -| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | +| 2026-10-26 | §7.8 | **5A requests must DLE-escape a checksum that is a framing byte (measured, BE9441).** The request for chunk 0x7D06 of event 01122f06 ends `… 02 03`: a bare 0x02 checksum (STX) before ETX. BE9441 never answered it, twice on two days, and rebooted ~11 s later each time; that was the 'mid-download reboot' of 2026-10-25 (row below). Sent as `… 10 02 03` it answered in 28 ms. So did chunk 0x7F06 (checksum 0x04 → `10 04`) and 0x8B06 (checksum 0x10 → `10 10`; sent bare, that reads as DLE+ETX), and the event downloaded whole and matched the unit's peaks. Escape set {02, 03, 04, 10}: a Micromate's for every byte (251/251 THOR requests), and consistent with §7.8's de-stuffing rule (`10 02/03/04` literal). About 1 chunk request in 64 has such a checksum. ⚠ Not known: whether standard (non-5A) requests need the same. No such keyed-read checksum has been sent. Also measured on the re-run: events that end in the next 64 KB page (BE9441 events 2 and 19) read an end offset lower than their start (the known page bug); every other event downloaded whole and verified. | +| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. ⚠ **RETRACTED 2026-10-26:** the cause is measured, and it was our request. The chunk request had a bare 0x02 checksum. See the 2026-10-26 row. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | | 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | | 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | | 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index f2f3610..7781caa 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -370,14 +370,28 @@ Each safety piece arrives with its first real use, so nothing sits untested. - ❌→✅ **A reboot mid-download stored a partial event as a success.** This was the dropped reply, occurring live. Fixed: a one-event download is whole or it is an error. + **Re-run, 2026-10-26, same unit, fixes in place:** + - ✅ Identify: the unit booted on connect and SFM waited for it. + - ✅ Events 0, 1, 3, 4 and 10 downloaded whole and **verified**. + Events 0 and 1 are byte-identical to their fixture checksums. + - ❌→✅ **Event 3 failed again at chunk `0x7D06`, the same address + both days.** The request's checksum was a bare `0x02`, which the + unit reads as STX; it never answered, and rebooted ~11 s later. That + was the "mid-download reboot". Escaped (`10 02`) it answered at once + (`d56dde7`). + - ✅ **The 64 KB page boundary:** events 2 and 19 cross it, and are now + refused by name (502) before any chunk (`bf9e32c`). The page bug + itself remains. + - ✅ **Stale id:** 409 after a header walk, with no 5A sent. + - ✅ **A repeat download:** `already_stored`, nothing written. - Still owed: - - a re-run with the fixes in place; - a histogram event (this unit records single shot); - - an event that *spans* the 64 KB page boundary. Event 3 sits in page - `0x12`, but within that one page; - - the stale-id check; - - `already_stored` against Blastware's copy; - - start/stop through the new path. + - `already_stored` against Blastware's own copy; + - start/stop through the new path, with Brian present; + - a dropped reply via fault injection. It happened for real on + 10-25, but that was our checksum bug, not a lossy link; + - ⚠ whether standard (non-5A) requests need the same checksum + escape. No keyed read has had such a checksum yet. - **Download = fetch, check, store** in SFM's database, the same as Series 3's `blastware_file` route, and returns the stored row's id. The file and waveform are then served by the existing `/db/events/{id}/…` -- 2.54.1 From 465bc704dd131394f1fcfeae2e02f52c4881a46a Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 12:15:50 -0400 Subject: [PATCH 102/223] test+docs: SFM's MiniMate downloads are byte-identical to Blastware's; the 64 KB bug narrowed Brian's Blastware downloads of BE9441's 20 events give ground truth. SFM's re-run downloads of events 0, 1, 3, 4 and 10 are byte-identical to Blastware's own files; imported first through the watcher route, the same events download as already_stored (no duplicate rows -- the unit's 0C and Blastware's file agree on serial + timestamp). Fixtures: Blastware's P00/Q10 (now asserted equal to SFM's builds) and QZ0/T80, the two page-crossing events, as byte-exact targets. The 64 KB page bug, narrowed by a read-only test walk: carrying the page byte addresses the first chunk in page 0x12 (answered), but the next request carries a raw 0x03 inside its params (counter 0x032c) and gets no reply. Pages after 0x11 have such counters; 0x11 does not (event 1 skips 0x0000-0x05FF). Needs a Blastware wire capture of event 2 or 19 (recorded in CLAUDE.md, the Series-III reference and the spec). No code change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 13 +++++++++++++ docs/instantel_protocol_reference.md | 1 + .../2026-10-20-sfm-series4-parity-design.md | 9 ++++++++- .../fixtures/minimate-bench-10-25-26/README.md | 16 ++++++++++++++++ .../blastware/K441LTMK.P00 | Bin 0 -> 25724 bytes .../blastware/K441LTMK.Q10 | Bin 0 -> 25812 bytes .../blastware/K441LTMK.QZ0 | Bin 0 -> 26092 bytes .../blastware/K441LTML.T80 | Bin 0 -> 25452 bytes tests/test_minimate_body_no_metadata.py | 11 +++++++++++ 9 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.P00 create mode 100644 tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.Q10 create mode 100644 tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.QZ0 create mode 100644 tests/fixtures/minimate-bench-10-25-26/blastware/K441LTML.T80 diff --git a/CLAUDE.md b/CLAUDE.md index f02d795..439f547 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -262,6 +262,19 @@ Read this first when picking the project back up. over) needs a BW capture of a spanning event first. Do not ship layer one alone without a loud truncation warning — a silently short event is the failure mode this codec has been bitten by repeatedly. + **Narrowed 2026-10-26 (BE9441, measured):** + - The one-event download now refuses a spanning event by name (502), before + any chunk. + - STRT carries the full 32-bit end key, so the page is there to use. + - A read-only test walk carrying the page byte got a proper reply for the + first chunk in the next page (`01 12 01 2c`). The second chunk, params + `… 01 12 03 2c`, got none: a raw `0x03` inside the params. + - Pages after `0x11` have counters with `02`/`03`/`04` bytes. Page `0x11` + has none, because event 1 skips `0x0000`–`0x05FF`. + - How Blastware encodes those bytes is the one unknown left. The capture to + take: Blastware downloading BE9441 event 2 (`0111c92c`) or 19 (`0118a4ca`) + through the recording bridge. Blastware's own files for both are fixtures + (`tests/fixtures/minimate-bench-10-25-26/blastware/`), as byte-exact targets. - **Open, not blocking:** 14 sensitive-range files show an exact 8x (= 10.0/1.25) units discrepancy; `scripts/backfill_sidecars.py --force` also inserts DB rows for store files that have none (one-time per store) and the diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index c6f01f1..bfe0129 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-10-26 (2) | §7.8 | **The 64 KB page bug, narrowed (measured, BE9441).** Blastware's own downloads of all 20 events (Brian, `example-events/10-25-26 - thumps`) give byte-exact ground truth. SFM's downloads of events 0, 1, 3, 4 and 10 are **byte-identical** to Blastware's. Importing Blastware's files first (the watcher route) makes SFM's downloads of the same events return `already_stored`: the unit's 0C and Blastware's file agree on (serial, timestamp). For an event that crosses a page (event 2, `0111c92c` → STRT end key `01122f06`, full 32 bits) a read-only test walk with the page byte carried (params `00 01 12 01 2c`) got a proper A5 reply for the first chunk in page 0x12, echoing `01 12 01 2c`. The second chunk, `00 01 12 03 2c`, got no reply frame: a raw 0x03 (ETX) inside the params. Page 0x11 never shows this, because event 1 skips 0x0000–0x05FF, so no counter there has a 02/03/04 byte. Every later page does. ⚠ How Blastware encodes a lone 02/03/04 inside params is unknown: §7.8 says `10 02/03/04` is kept as a literal pair, which would shift the address. A wire capture of Blastware downloading BE9441 event 2 or 19 settles it. Blastware's files are fixtures (`tests/fixtures/minimate-bench-10-25-26/blastware/`). | | 2026-10-26 | §7.8 | **5A requests must DLE-escape a checksum that is a framing byte (measured, BE9441).** The request for chunk 0x7D06 of event 01122f06 ends `… 02 03`: a bare 0x02 checksum (STX) before ETX. BE9441 never answered it, twice on two days, and rebooted ~11 s later each time; that was the 'mid-download reboot' of 2026-10-25 (row below). Sent as `… 10 02 03` it answered in 28 ms. So did chunk 0x7F06 (checksum 0x04 → `10 04`) and 0x8B06 (checksum 0x10 → `10 10`; sent bare, that reads as DLE+ETX), and the event downloaded whole and matched the unit's peaks. Escape set {02, 03, 04, 10}: a Micromate's for every byte (251/251 THOR requests), and consistent with §7.8's de-stuffing rule (`10 02/03/04` literal). About 1 chunk request in 64 has such a checksum. ⚠ Not known: whether standard (non-5A) requests need the same. No such keyed-read checksum has been sent. Also measured on the re-run: events that end in the next 64 KB page (BE9441 events 2 and 19) read an end offset lower than their start (the known page bug); every other event downloaded whole and verified. | | 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. ⚠ **RETRACTED 2026-10-26:** the cause is measured, and it was our request. The chunk request had a bare 0x02 checksum. See the 2026-10-26 row. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | | 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 7781caa..70d8f82 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -384,9 +384,16 @@ Each safety piece arrives with its first real use, so nothing sits untested. itself remains. - ✅ **Stale id:** 409 after a header walk, with no 5A sent. - ✅ **A repeat download:** `already_stored`, nothing written. + - ✅ **Against Blastware's own files** (Brian's downloads of all 20 + events): SFM's events 0, 1, 3, 4 and 10 are **byte-identical** to + Blastware's. Importing Blastware's files first through the watcher + route makes SFM's downloads return `already_stored`, with no + duplicate rows. + - 🔶 **The 64 KB page bug** is narrowed. The page byte carries; a raw + 02/03/04 inside the params is the blocker. It needs a Blastware wire + capture of event 2 or 19 (CLAUDE.md, KNOWN BUG). - Still owed: - a histogram event (this unit records single shot); - - `already_stored` against Blastware's own copy; - start/stop through the new path, with Brian present; - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; diff --git a/tests/fixtures/minimate-bench-10-25-26/README.md b/tests/fixtures/minimate-bench-10-25-26/README.md index 57ebf6a..8382adf 100644 --- a/tests/fixtures/minimate-bench-10-25-26/README.md +++ b/tests/fixtures/minimate-bench-10-25-26/README.md @@ -13,3 +13,19 @@ the `0xA5` frames. Both events: single shot, 4096 sps, 5 s record + 0.25 s pre-trigger = 5.25 s = 21,504 samples per channel. Event 1 is the case that showed the body builder skipping 13 bytes on its second and third frames as if they were metadata pages (2 bytes lost, decode truncated at 1,024 / 2,782 / 512). + +## `blastware/`: Blastware's own downloads of the same events (Brian, 2026-10-25) + +| file | event | key | note | +|---|---|---|---| +| `K441LTMK.P00` | 0 | `01110000` | byte-identical to SFM's build (sha `589073a0…`) | +| `K441LTMK.Q10` | 1 | `0111646a` | byte-identical to SFM's build after the metadata-page fix (sha `e74c664d…`) | +| `K441LTMK.QZ0` | 2 | `0111c92c` | **crosses the 64 KB page boundary**: STRT end key `01122f06` | +| `K441LTML.T80` | 19 | `0118a4ca` | **crosses the 64 KB page boundary**: STRT end key `01190824` | + +On the 2026-10-26 re-run, SFM's own downloads of events 0, 1, 3, 4 and 10 were byte-identical to +Blastware's files, all five. QZ0 and T80 are the byte-exact target for a fix of the +page bug. Carrying the page byte is enough to address the first chunk in the next page +(0x0112012C answered). The second chunk (0x0112032C) puts a raw 0x03 in the request's +params, and the unit does not answer. How Blastware encodes 02/03/04 inside params is +unknown; it needs a wire capture of Blastware downloading one of these two events. diff --git a/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.P00 b/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.P00 new file mode 100644 index 0000000000000000000000000000000000000000..e7c3b4c94fbb22fcf4146c0ef0c9d56a92ddb2a3 GIT binary patch literal 25724 zcma)_e~_J5ecsQN*VbBE>%J>*%mxlu}AbLXw$;Fk}d}Npb3UrbRGJnEWV}%#Wl^;$rDu0s)*@ zx1Z;E&be3W@JEdHz3+R@_k4dn&-tG7zW3dwE4_P5dHJyuC+|FV^2ps~>w4LFNxAjV zs}4=h_ZAPouD4jq!M`o9cv&fBOPTOr8Fq8MQR%w*!be%|=2lC&yI#%vYTZ|>Wyx3j zE&qvyHhF-D(g82f5GF5|M$b>s1<(<$c*d_o-@kvKKMn}Il zPCS2ks_flAi{}nUUdkPgnfS|U`Ixg19Rr^yXI(Ume!e`P?DlGQ8Oa!YC#$#H?jD~< z*JBzpne2MH{0&*mnDg{2s)aIgCRe(S?2J0alWby@sL;^wDWiB_Mv1THx@IB>G$dM{ zmP)^%v5yf(&-Z%_pX=6Wv8MXL1+8+RVU$ejh$h;}s&R~7GVN^63rR^JN2Hu%qqlSM z{N62-XD0u6_?u7{iPuKD$xB%#ksmeB@N`2C}?` zET5m8?>4%wS0OjzTksKEG~tWC!gqD z4a1bLZ%w|@9T;!Ew0r8A(erop&yE(aDd*0OcMkfKQE#!Ed}+Mc5j3$XTLU;S8uv`K-ue0%A&pKlU5>HB}~P)0*^Jpbkyvd>(&(0v z@VAV@r~BSg{s>+wKMH1jgnwIb4~#^mMeq(HbF@)2dNS?$!pSn%L=0QyrK}Pfx-%!h z0Zcf$U$a_%tNMw5I9ok!5*>*nak;()Y~QLG*RibpZ39A zGzWy%Wb&-vFTVxjTI@q%O&qIbFARnQvcPd!G233lWF8sK0QK$@Qc!h;&sF{x{F3SB zTPF^UG#`Uu!(oov(N=vBr|R?_o8>@R(lAT&;UkOXV=!wj%)*wk2pag|3Z^wf{_?R~ z9${_GQYhsULu7isN#O~y2w{O3$k!@NBxG6kGZP;c z>~-%Y@9F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vm_1 zM1wBs8od12T{jG_AMC&L`0=AB?m1R&J#zHK4TA&s+!g(UH)3FLQ@Q1*PaZjT_{ibG zkKA+e$ceH|F?{}q%I1)`4jm`se3paodB|@mT+*8(wzBu}Uwww#pKtupyN({a!MVSY zr2O1!*?b<-w;eft@}EBH|MK^Gu4B}Jdyc*4pFZlV>xDnVUACOR_q##0?AW$YKNr#Q zZYHxR;{OgjTCRG2nf#+jGuJQMX}pG?EzkSKa@Eac@^vAH^gL}p$j{t8A1PODmdP_j zUFNPUSJ3tx$^XmmD*t1Ta>4)YL%C58h52J9*Y>VuPNc5@($AN2R zaev2-9ak(|v3+6Nwr!VRK0m*;JM`w;4(+@7nq3{+*7IkdICJLonNz1vo&LR z?F$6b$JoxDS6;cK|LMOg`ETb=LgLTcD;~nxzFpA}%bO0}dh<2>!Ta-P&z$~Wryl0N z-+t)fhaP_Tk%vz`@|n*N577_{wPLQ@*Ac|x;;vmN+sVf+rAb;Hqkza?aww0VET8+K zM6ExbhN9AcyAltVK&AhHDfqnUo#oj(=ELaAwoIAb6NmrL+x{N}6-dkg literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.Q10 b/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.Q10 new file mode 100644 index 0000000000000000000000000000000000000000..d7912fce3fbb12576bf125b92b82148c5ee8e578 GIT binary patch literal 25812 zcma)_e~_J5ecsP2FV%J>C?&56ND|>(y$m^R3P4ntFF$+lWL(-_;j3yo6( zX#07d=bU?2Q~rp2_uThA=X<_CpYuIG-gno1>FzD%O-GNPICS*H`dwxFO4)Tmx#i%^ z2RF}kv;TRen=NH!uIzbZDP>#P+9+kZ@98cM8>R1OD0SV_Z=)=`T}wD5!*Xx@>Sg)lYFNOEz?^GMfLzUzVE>Y}Gv0Nt;E?T>6U#saGPCvPE*f_McajMQ&~73v{BKm9^!9 zQ$JaLoCq{)SNiF0gpc^PE=V`t-rxL0+mf%5Mr`)km;JtNAh!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GM{oGq*FJLV8I129IZz&6n7)Po z55eI>#|{r~UcdeBV~39%y<>RG`ib|v`>NyXC(2F7?tbU`?I*4;2iK3Ec*{n~)9_74Z@+5zs^Nh{ z$BrF2e)rLG%leVyR}F8x`}Xi3z6SxrYswAxoLE14c>VD3Eq9+-KVEjohOfM?tSw{L z!DD!w?{X7^WSRHxFX*PQt?c{4zx*Dd`l~-w=1fBRnF z=*!wG>2>4XNALLC_j+!nEaUQR=k9$OQ7t=nTvNYa4J&k>nueGEU2}E0^xCrdH-$h= zT~;oka*dyDQ*SSqURO4sm&H(v{vYwP{l))ME?p~|-xbLC19hU`E&9toUH)vZe8K-t zqFk*9jl6V!MR$b|FLVzV%I2Tm|FH)?|Lo~6|F@@~IrBgN*Z+R@xfe#?`aduJ-*12C zd;Rn?SKRR4;p#;@E}ogW4e&+OQ-Y9 z-+Sx9{nuT-o4<*^dG3X$PMeQ*zr=NfRsTW>&;Vef({E>Y|=wALP zd)J9|H`~|$RKpMx2HX1b3mfI+Yh%le>;f*eEjM&Gl$q5j{`Pu#?B3!0hyU5*&;Iu( zzIytpr)Zg!4~I{ z{XIs^&hFj~vt4}cmYc-YHYyM~KP+E3QNH}TSaYDfa@!TQ=Jnm{*$rv^KNXuE!KPon z|8sx&wLkxh)2E+$+Tl5?@ci|+ztc}Yy>0&;!?o#)E|yI@6&y)zcF7)Fgz$uD=HeOK zw0*jN;Er2wSR+7-gR?I@fBMv^lVAMeV~;)dD8(0RkciRQvsi^)3WluGzumEiTSBFO bglV7W(x3U2a@o%5is;!fvO8h&jgS97yLhM( literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.QZ0 b/tests/fixtures/minimate-bench-10-25-26/blastware/K441LTMK.QZ0 new file mode 100644 index 0000000000000000000000000000000000000000..977cae35dee3e4aca5e941cc395be0c7a911b125 GIT binary patch literal 26092 zcma)_e~_J5ecsQN7VBEN*1jt*W}zGQ+Fsm+EY=$D1U0qEmPkRgf+$$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imate_body_no_metadata.py b/tests/test_minimate_body_no_metadata.py index d21554c..21b3781 100644 --- a/tests/test_minimate_body_no_metadata.py +++ b/tests/test_minimate_body_no_metadata.py @@ -77,6 +77,8 @@ def test_a_sample_chunk_at_0x1002_is_not_mistaken_for_a_header_byte(): GOLDEN = { # sha256 of STRT + body + footer, and of the written file + # Both written files are byte-identical to Blastware's own downloads of the same + # events (fixtures/minimate-bench-10-25-26/blastware/, compared below). # event 0's file is byte-identical to the one SFM stored at the bench before any fix "event0": ("29beabfe46a858587b8cdc6ee3f484473c07f96485e404f68c42c6aa1e298aa7", "589073a096d4f867c5ab8c697c82c4b635c7757fcfdd618b460f3b647c32ed7f"), @@ -112,3 +114,12 @@ def test_a_term_at_0x1002_is_not_mistaken_for_a_header_byte(): moved = type(term)(**{**vars(term), "data": d[:3] + b"\x10\x02" + b"\x00" + d[5:]}) _s, got, _f = extract_body_bytes(frames[:-1] + [moved]) assert got == want + + +@pytest.mark.parametrize("which,bw", [("event0", "K441LTMK.P00"), ("event1", "K441LTMK.Q10")]) +def test_the_written_file_is_blastwares_own(which, bw, tmp_path): + ev = Event(index=0) + ev.timestamp = None + path = tmp_path / "x" + write_blastware_file(ev, a5_frames(which), path) + assert path.read_bytes() == (FIX / "blastware" / bw).read_bytes() -- 2.54.1 From 887e75d1ba8f7c9661a231f156fb0708dff64224 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 14:38:19 -0400 Subject: [PATCH 103/223] fix(minimateplus): MiniMate requests escape 02/03/04/10, and the 5A walk is 32-bit linear -- the 64 KB page bug A recording of Blastware downloading all 8 of BE9441's events (three crossing a 64 KB page; tests/fixtures/minimate-bench-10-26-26-blastware/) settles it: every one of its 748 requests is the standard 16-byte payload with a SUM8 checksum and every 02 / 03 / 04 / 10 byte DLE-escaped -- 748/748 re-encode byte-identically. A 5A request is not a special frame: it is that payload with a 2-byte LENGTH (0x0200 per chunk, the remainder for TERM) and a 4-byte linear ADDRESS. The walk is the event's start, +0x200 at a time carrying into the page byte, then TERM at the next boundary for exactly the remainder. What the old model misread: the fixed 'offset 0x1002' is length 0x0200 escaped (10 02 00); the first event's 'metadata pages at 0x1002/0x1004' are its chunks at 0x0200 and 0x0400; the 16-bit counter could not leave the key's page. - build_bw_frame escapes the four values (was 0x10 only); new s3_stuff(). - build_5a_request(address, length); parse_strt_end_key() -> the full 32 bits. - read_bulk_waveform_stream: one linear walk, no event-1 special case; strict mode keeps every refusal; an end at or before the start is refused as a corrupt STRT (a page crossing is no longer refused -- it downloads). Tests: all 540 Blastware 5A requests and all 208 others rebuilt byte for byte; SFM's walks for events 0, 1, 3 and 7 send exactly Blastware's requests and, fed Blastware's recorded replies, build whole events. In-page requests are byte-identical to before. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/framing.py | 69 ++++- minimateplus/protocol.py | 263 ++++++------------ .../README.md | 30 ++ .../blastware_requests.bin | Bin 0 -> 17757 bytes .../unit_replies.bin | Bin 0 -> 364972 bytes tests/test_5a_blastware_walk.py | 154 ++++++++++ tests/test_minimate_5a_strict.py | 19 +- 7 files changed, 339 insertions(+), 196 deletions(-) create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/README.md create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware_requests.bin create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/unit_replies.bin create mode 100644 tests/test_5a_blastware_walk.py diff --git a/minimateplus/framing.py b/minimateplus/framing.py index be0b57e..fd05178 100644 --- a/minimateplus/framing.py +++ b/minimateplus/framing.py @@ -28,6 +28,10 @@ De-stuffed payload layout: DLE stuffing rule: any 0x10 byte in the payload is doubled on the wire (0x10 → 0x10 0x10). This applies to the checksum byte too. +⚠ AMENDED 2026-10-26 (measured): a request escapes FOUR values, not one -- every 02, 03, +04 and 10 in payload and checksum gets a DLE in front. Blastware's 748 recorded requests +re-encode byte-identically under that rule (tests/test_5a_blastware_walk.py); a bare 02 or +03 left a request unanswered. See `s3_stuff()`. Confirmed from live captures (s3_parser.py validation + raw_bw.bin / raw_s3.bin). """ @@ -83,6 +87,24 @@ def dle_unstuff(data: bytes) -> bytes: # ── Checksum ───────────────────────────────────────────────────────────────── +# Every byte value a request DLE-escapes (2026-10-26, measured): Blastware's 748 +# requests from a whole download session re-encode byte-identically with this set, +# payload and checksum alike. A bare 0x02 checksum or a 0x03 inside the params left +# BE9441 silent (and the 0x02 made it reset ~11 s later). It is a Micromate's set +# too (micromate.framing._ESCAPED). +_ESCAPED = frozenset({STX, ETX, 0x04, DLE}) + + +def s3_stuff(data: bytes) -> bytes: + """Escape every byte a request escapes: `XX` → `10 XX` for 02, 03, 04 and 10.""" + out = bytearray() + for b in data: + if b in _ESCAPED: + out.append(DLE) + out.append(b) + return bytes(out) + + def checksum(payload: bytes) -> int: """SUM8: sum of all de-stuffed payload bytes, mod 256.""" return sum(payload) & 0xFF @@ -95,6 +117,30 @@ def checksum(payload: bytes) -> int: SUB_5A = 0x5A +_BULK_CHUNK = 0x0200 # bytes per 5A read; a TERM reads the remainder + + +def build_5a_request(address: int, length: int) -> bytes: + """A SUB 5A read of `length` bytes at the unit's 32-bit `address`. + + Measured 2026-10-26 from Blastware downloading all 8 of BE9441's events (three + crossing a 64 KB page): a 5A request is an ORDINARY 16-byte request -- + `[10 00 5A 00][length BE][address BE 4][zeros 6]`, SUM8 checksum, every + 02/03/04/10 escaped -- and this rebuilds all 540 of Blastware's 5A requests + byte for byte. The older model below (`build_5a_frame`: a raw "offset_hi + 0x10", an "11-byte params", "metadata pages at 0x1002 / 0x1004") was the + same bytes misread: `10 02 00` is the length 0x0200 escaped, and the + "metadata pages" are the first event's chunks at 0x0200 and 0x0400. + """ + if not 0 <= address <= 0xFFFFFFFF: + raise ValueError(f"address must fit in 32 bits, got {address:#x}") + if not 0 <= length <= 0xFFFF: + raise ValueError(f"length must fit in 16 bits, got {length:#x}") + payload = (bytes([BW_CMD, 0x00, SUB_5A, 0x00, (length >> 8) & 0xFF, length & 0xFF]) + + address.to_bytes(4, "big") + bytes(6)) + return bytes([ACK, STX]) + s3_stuff(payload + bytes([checksum(payload)])) + bytes([ETX]) + + def build_5a_frame(offset_word: int, raw_params: bytes) -> bytes: """ Build a BW→S3 frame for SUB 5A (BULK_WAVEFORM_STREAM) that exactly @@ -210,7 +256,7 @@ def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> byte byte lives at params[6] (= payload[12]). Use waveform_key_params() and token_params() helpers to build these safely. - Wire output: [ACK] [STX] dle_stuff(payload + checksum) [ETX] + Wire output: [ACK] [STX] s3_stuff(payload + checksum) [ETX] Args: sub: SUB command byte (e.g. 0x01 = FULL_CONFIG_READ) @@ -233,7 +279,7 @@ def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> byte offset_lo = offset & 0xFF payload = bytes([BW_CMD, 0x00, sub, 0x00, offset_hi, offset_lo]) + params chk = checksum(payload) - wire = bytes([ACK, STX]) + dle_stuff(payload + bytes([chk])) + bytes([ETX]) + wire = bytes([ACK, STX]) + s3_stuff(payload + bytes([chk])) + bytes([ETX]) return wire @@ -548,6 +594,25 @@ def bulk_waveform_term_v2( STRT_MARKER = b"STRT" +def parse_strt_end_key(a5_data: bytes) -> Optional[int]: + """The event's FULL 32-bit end key from the STRT record in an A5 reply's + data, or None. The page byte is part of it: an event that ends in the next + 64 KB page reads e.g. 0x011216C4 here, where `parse_strt_end_offset` gave + 0x16C4. Read after removing the reply's inner DLE pairs (10 02 / 10 03 / + 10 04 → 02 / 03 / 04), which the parser keeps as two bytes.""" + out, i = bytearray(), 0 + while i < len(a5_data): + if a5_data[i] == DLE and i + 1 < len(a5_data) and a5_data[i + 1] in (STX, ETX, 0x04): + i += 1 + continue + out.append(a5_data[i]) + i += 1 + pos = bytes(out).find(STRT_MARKER) + if pos < 0 or pos + 10 > len(out): + return None + return int.from_bytes(out[pos + 6:pos + 10], "big") + + def parse_strt_end_offset(a5_data: bytes) -> Optional[int]: """ Extract the event-end offset from the STRT record in an A5 response payload. diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 1e2b55d..c43bd7f 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -37,6 +37,8 @@ from .framing import ( bulk_waveform_term_params, bulk_waveform_term_v2, parse_strt_end_offset, + parse_strt_end_key, + build_5a_request, POLL_PROBE, POLL_DATA, SESSION_RESET, @@ -558,48 +560,34 @@ class MiniMateProtocol: 2026-10-25 and its partial event was kept). Without strict the legacy tolerance stands: an early end proceeds to TERM and returns what arrived. - Algorithm (matches BW captures across 2-sec / 3-sec / event-2): + The walk (measured 2026-10-26: Blastware downloading all 8 of BE9441's + events, three crossing a 64 KB page -- tests/test_5a_blastware_walk.py + rebuilds its requests byte for byte): - 1. Probe - - For events at start_key[2:4] = 0x0000 (first event after erase - / wrap): probe at counter=0x0000 with full key in params. - - For continuation events (start_key[2:4] != 0): first chunk at - counter = start_key[2:4] + 0x0046; acts as both probe and - first sample chunk; response carries STRT. + 1. Read 0x200 bytes at the event's own 32-bit address (the key). The + reply carries STRT, whose end key is the full 32-bit address where + the event ends. + 2. Read 0x200 bytes at each next address, +0x200 at a time, as plain + 32-bit numbers -- crossing into the next 64 KB page needs nothing + special -- while the whole chunk fits before the end. + 3. TERM: read the remainder (end - next boundary) at the next boundary. + Its reply carries the event's tail and the file footer. - 2. Parse end_offset from STRT record at data[23:27] of the probe response. - - 3. Read two fixed metadata pages at counter=0x1002 and counter=0x1004 - — global session metadata (Project / Client / User Name / Seis Loc - / Extended Notes ASCII strings). Event 1 only; continuation - events skip these (BW caches them across the session). - - 4. Walk sample chunks at 0x0200 increments, starting from 0x0600 for - event 1 or `start + 0x0046 + 0x0200` for continuation events. - Stop when `next_chunk + 0x0200 > end_offset`. - - 5. Send TERM frame with offset_word and params computed by - `bulk_waveform_term_v2(key4, end_offset, last_chunk_counter)`. - The TERM response contains the partial last chunk (residual = - end_offset - next_boundary) including the 26-byte 0e 08 file - footer. + The first event on a unit reads 0x0000, 0x0200, 0x0400, 0x0600, ...: the + "metadata pages at 0x1002 / 0x1004" of the earlier model were its chunks + at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`). That model's + 16-bit counter could not leave the key's page -- the 64 KB page bug. Returns: - List of S3Frame objects from each A5 response (probe, metadata - pages, sample chunks, optional TERM response). Caller passes - `include_terminator=True` (e.g. write_blastware_file) to keep the - TERM response in the list — it's required to reconstruct the - file footer. + The A5 frames in order (first chunk, chunks, and with + `include_terminator=True` the TERM reply, which write_blastware_file + needs for the footer). - Deprecated kwargs: - stop_after_metadata: legacy "Project:"-string-based stop condition. - No-op under the BW-exact walk; the loop is - deterministically bounded by end_offset from - STRT. Accepted for backward compat. - extra_chunks_after_metadata: same. + Deprecated kwargs (no-ops): stop_after_metadata, extra_chunks_after_metadata. Raises: - ProtocolError: on timeout / bad checksum / unexpected SUB. + ProtocolError: on timeout / bad checksum / unexpected SUB, and in + strict mode on any early end. """ if len(key4) != 4: raise ValueError(f"waveform key must be 4 bytes, got {len(key4)}") @@ -613,38 +601,15 @@ class MiniMateProtocol: rsp_sub = _expected_rsp_sub(SUB_BULK_WAVEFORM) # 0xA5 frames_data: list[S3Frame] = [] + start = int.from_bytes(key4, "big") - start_offset = (key4[2] << 8) | key4[3] - is_event_1 = (start_offset == 0) + def request(address: int, length: int) -> None: + self._send(build_5a_request(address, length)) + self._parser.reset() - # ── Step 1: probe / first chunk ────────────────────────────────────── - if is_event_1: - probe_counter = 0 - probe_params = bulk_waveform_params(key4, 0, is_probe=True) - log.debug("5A probe (event-1) key=%s counter=0x0000", key4.hex()) - else: - # Continuation events: first 5A request lands at counter = key[2:4] - # (i.e. the address of the off=0x46 WAVEHDR record returned by 1F). - # The probe response carries STRT at byte 17 with end_offset. - # - # Confirmed 2026-05-04 from 5-1-26 "copy 2nd address" capture - # (BW probes counter=0x2238 with key=01112238, STRT@17 end=0x417E) - # and 5-4-26 BW captures (2-sec event probes counter=0x2238). - # - # The earlier "+0x46" formula in the doc came from calling - # start_key the BOUNDARY (off=0x2C) key, but the iteration walk - # uses 1F's off=0x46 key as cur_key, which already incorporates - # the +0x46 offset relative to the boundary. Adding it again - # caused the probe to overshoot, miss STRT, and run uncapped. - probe_counter = start_offset - probe_params = bulk_waveform_params(key4, probe_counter) - log.debug( - "5A probe (event-N) key=%s counter=0x%04X", - key4.hex(), probe_counter, - ) - - self._send(build_5a_frame(_BULK_CHUNK_OFFSET, probe_params)) - self._parser.reset() + # ── Step 1: the event's first chunk; its reply carries STRT ────────── + log.debug("5A first chunk key=%s", key4.hex()) + request(start, _BULK_COUNTER_STEP) try: rsp = self._recv_one(expected_sub=rsp_sub, reset_parser=False) except TimeoutError: @@ -653,110 +618,49 @@ class MiniMateProtocol: key4.hex(), self._parser.bytes_fed, ) raise - frames_data.append(rsp) - log.debug("5A A5[0] (probe) page_key=0x%04X %d bytes", - rsp.page_key, len(rsp.data)) + log.debug("5A A5[0] (probe) page_key=0x%04X %d bytes", rsp.page_key, len(rsp.data)) - # ── Step 2: parse STRT end_offset from probe response ──────────────── - end_offset = parse_strt_end_offset(rsp.data) - if end_offset is None and strict: + # ── Step 2: where the event ends -- STRT's full 32-bit end key ─────── + end = parse_strt_end_key(rsp.data) + if end is None and strict: raise ProtocolError( f"5A probe for {key4.hex()} carried no STRT record, so the event's end " "is unknown -- not downloaded") - if strict and end_offset is not None and end_offset < start_offset: - # The known 5A page bug: parse_strt_end_offset keeps only the low 16 - # bits, so an event that ends in the next 64 KB page reads as ending - # before it starts, and the walk cannot follow it yet. BE9441's - # events 2 and 19 (bench 2026-10-26) -- named here, before any chunk. - raise ProtocolError( - f"event {key4.hex()} crosses the unit's 64 KB page boundary (starts at " - f"0x{start_offset:04X} in page 0x{key4[1]:02X}, ends at 0x{end_offset:04X} in " - "the next) -- SFM cannot download such an event yet (the known 5A page bug); " - "not saved") - if end_offset is None: + if end is not None and end <= start: + if strict: + raise ProtocolError( + f"5A STRT for {key4.hex()} says the event ends at 0x{end:08X}, at or " + "before its start -- not downloaded") + log.warning("5A STRT end 0x%08X is not after the start 0x%08X -- ignored", end, start) + end = None + have_end = end is not None + if not have_end: log.warning( - "5A probe response did not contain a STRT record; " + "5A probe response did not contain a usable STRT record; " "cannot bound chunk loop — falling back to max_chunks=%d cap", max_chunks, ) - end_offset = 0xFFFF # impossible value → loop runs to max_chunks + end = start + (max_chunks + 2) * _BULK_COUNTER_STEP # the cap bounds the loop else: - log.info( - "5A STRT start_offset=0x%04X end_offset=0x%04X size=0x%04X", - start_offset, end_offset, end_offset - start_offset, - ) + log.info("5A STRT start=0x%08X end=0x%08X size=0x%X", start, end, end - start) - # ── Step 3: metadata pages 0x1002 + 0x1004 (event 1 only) ──────────── - # Confirmed from BW captures: BW reads these two fixed device-buffer - # pages immediately after the probe for events at start_key[2:4]=0. - # Continuation events skip them (BW caches across the session). - # Their content is global compliance-setup metadata: Project, Client, - # User Name, Seis Loc, Extended Notes. - if is_event_1: - for meta_counter in (0x1002, 0x1004): - # Metadata page params have an extra trailing 0x00 byte - # (12-byte params instead of 11) — empirical from BW captures. - # Checksum-neutral but matches BW byte-for-byte. - meta_params = bytes([ - 0x00, - key4[0], key4[1], - (meta_counter >> 8) & 0xFF, - meta_counter & 0xFF, - 0, 0, 0, 0, 0, 0, 0, - ]) - log.debug("5A metadata page counter=0x%04X", meta_counter) - self._send(build_5a_frame(_BULK_CHUNK_OFFSET, meta_params)) - self._parser.reset() - try: - meta_rsp = self._recv_one( - expected_sub=rsp_sub, reset_parser=False, timeout=10.0, - ) - except TimeoutError as exc: - if strict: - raise TimeoutError( - f"5A stream ended early: metadata page 0x{meta_counter:04X} got " - "no reply -- the event was not kept") from exc - log.warning( - "5A metadata page 0x%04X TIMED OUT — continuing", - meta_counter, - ) - continue - frames_data.append(meta_rsp) - log.debug( - "5A meta@0x%04X page_key=0x%04X %d bytes", - meta_counter, meta_rsp.page_key, len(meta_rsp.data), - ) - - # ── Step 4: sample chunk loop, bounded by end_offset ───────────────── - # Sample chunks start at: - # event 1: counter = 0x0600 - # event N (>0): counter = probe_counter + 0x0200 - # (probe was the first sample chunk) - if is_event_1: - counter = 0x0600 - else: - counter = probe_counter + _BULK_COUNTER_STEP - - last_chunk_counter: Optional[int] = ( - probe_counter if not is_event_1 else None - ) + # ── Step 3: chunks at +0x200, plain 32-bit addresses ───────────────── + address = start + _BULK_COUNTER_STEP + last = start chunks_fetched = 0 while chunks_fetched < max_chunks: - # Stop when next chunk would straddle the event end. - if counter + _BULK_COUNTER_STEP > end_offset: + # Stop when the next chunk would straddle the event end. + if address + _BULK_COUNTER_STEP > end: log.debug( - "5A chunk loop done at counter=0x%04X (end=0x%04X); " - "%d chunks fetched", - counter, end_offset, chunks_fetched, + "5A chunk loop done at 0x%08X (end=0x%08X); %d chunks fetched", + address, end, chunks_fetched, ) break - params = bulk_waveform_params(key4, counter) - log.debug("5A chunk #%d counter=0x%04X", chunks_fetched + 1, counter) - self._send(build_5a_frame(_BULK_CHUNK_OFFSET, params)) - self._parser.reset() + log.debug("5A chunk #%d address=0x%08X", chunks_fetched + 1, address) + request(address, _BULK_COUNTER_STEP) try: rsp = self._recv_one( expected_sub=rsp_sub, reset_parser=False, timeout=10.0, @@ -764,13 +668,13 @@ class MiniMateProtocol: except TimeoutError as exc: raw = self._parser.bytes_fed log.warning( - "5A TIMEOUT chunk=%d counter=0x%04X raw_bytes=%d", - chunks_fetched + 1, counter, raw, + "5A TIMEOUT chunk=%d address=0x%08X raw_bytes=%d", + chunks_fetched + 1, address, raw, ) if strict: raise TimeoutError( - f"5A stream ended early: no reply for the chunk at 0x{counter:04X}; the " - f"event ends at 0x{end_offset:04X} ({chunks_fetched} chunk(s) received) " + f"5A stream ended early: no reply for the chunk at 0x{address:08X}; the " + f"event ends at 0x{end:08X} ({chunks_fetched} chunk(s) received) " "-- the event was not kept") from exc if raw > 0 and frames_data: log.warning( @@ -788,52 +692,41 @@ class MiniMateProtocol: # Device terminated mid-stream unexpectedly. if strict: raise ProtocolError( - f"5A stream ended early: the unit sent its terminator at 0x{counter:04X}, " - f"before the event's end 0x{end_offset:04X} -- the event was not kept") + f"5A stream ended early: the unit sent its terminator at 0x{address:08X}, " + f"before the event's end 0x{end:08X} -- the event was not kept") log.warning( - "5A unexpected page_key=0x0000 mid-stream at counter=0x%04X", - counter, + "5A unexpected page_key=0x0000 mid-stream at address=0x%08X", + address, ) if include_terminator: frames_data.append(rsp) return frames_data frames_data.append(rsp) - last_chunk_counter = counter - counter += _BULK_COUNTER_STEP + last = address + address += _BULK_COUNTER_STEP chunks_fetched += 1 else: if strict: raise ProtocolError( - f"5A reached the {max_chunks}-chunk cap at 0x{counter:04X} before the " - f"event's end 0x{end_offset:04X} -- the event was not kept") + f"5A reached the {max_chunks}-chunk cap at 0x{address:08X} before the " + f"event's end 0x{end:08X} -- the event was not kept") log.warning( - "5A reached max_chunks=%d at counter=0x%04X (end=0x%04X)", - max_chunks, counter, end_offset, + "5A reached max_chunks=%d at address=0x%08X (end=0x%08X)", + max_chunks, address, end, ) - # ── Step 5: TERM with proper end_offset-derived formula ────────────── - if last_chunk_counter is None or end_offset == 0xFFFF: - # No STRT or no chunks fetched — fall back to legacy TERM. - log.warning( - "5A using legacy TERM (offset_word=0x005A); " - "end_offset unavailable or no chunks fetched", - ) - legacy_counter = (last_chunk_counter or probe_counter) + _BULK_COUNTER_STEP - term_offset_word = _BULK_TERM_OFFSET # 0x005A - term_params = bulk_waveform_term_params(key4, legacy_counter) + # ── Step 4: TERM -- the remainder, from the next boundary ─────────── + boundary = last + _BULK_COUNTER_STEP + if have_end: + term_length = end - boundary + log.debug("5A TERM address=0x%08X length=0x%04X end=0x%08X", + boundary, term_length, end) else: - term_offset_word, term_params = bulk_waveform_term_v2( - key4, end_offset, last_chunk_counter, - ) - log.debug( - "5A TERM offset_word=0x%04X params[2:4]=%s end=0x%04X " - "last_chunk=0x%04X", - term_offset_word, term_params[2:4].hex(), - end_offset, last_chunk_counter, - ) + term_length = _BULK_TERM_OFFSET # legacy: no STRT, so no remainder known + log.warning("5A using legacy TERM (length 0x%04X); end unknown", term_length) - self._send(build_5a_frame(term_offset_word, term_params)) + self._send(build_5a_request(boundary, term_length)) try: term_rsp = self._recv_one(expected_sub=rsp_sub, timeout=10.0) log.info( diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/README.md b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md new file mode 100644 index 0000000..54f2487 --- /dev/null +++ b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md @@ -0,0 +1,30 @@ +# Blastware downloading all 8 events from BE9441, recorded (2026-10-26) + +BE9441 (S338.17, single shot, 4096 sps) on the dev box's serial port, shared on TCP by +`bridges/mm_link.py`; Blastware connected over TCP, listed the events and copied all 8 +to disk. Both directions, raw: + +| file | direction | size | +|---|---|---| +| `blastware_requests.bin` | Blastware → unit (748 requests, each after a `41 03` SESSION_RESET) | 17,757 B | +| `unit_replies.bin` | unit → Blastware | 364,972 B | + +Events (key → end), from Blastware's 5A walks. Three cross a 64 KB page: + +| event | start key | end (STRT) | 5A requests | +|---|---|---|---| +| 0 | 01110000 | 01118a2c | 70 | +| 1 | 01118a2c | 011216c4 | 71 (crosses into page 0x12) | +| 2 | 011216c4 | 0112a0b6 | 69 | +| 3 | 0112a0b6 | 011329d2 | 69 (crosses into 0x13) | +| 4 | 011329d2 | 0113b072 | 68 | +| 5 | 0113b072 | 01143046 | 64 (crosses into 0x14) | +| 6 | 01143046 | 0114b0b2 | 65 | +| 7 | 0114b0b2 | 01152f0e | 64 (crosses into 0x15) | + +What it settled (measured): every request is the standard 16-byte payload, SUM8 checksum, +and every 02 / 03 / 04 / 10 byte DLE-escaped (748/748 re-encode byte-identically). The 5A +"offset" is a length (0x0200 per chunk, the remainder for TERM), followed by a 4-byte linear +address; a walk is start, start+0x200, ... carrying into the page byte, then TERM at the next +boundary for exactly the remainder. The first event's "metadata pages at 0x1002/0x1004" are +its chunks at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`). diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware_requests.bin b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware_requests.bin new file mode 100644 index 0000000000000000000000000000000000000000..fcc9f1fbc75b1819eb22e00d47d0227112aeb0a5 GIT binary patch literal 17757 zcmdVgZMalZ8^G~>lHMfKnVBR>lJuUJgoGl=TaqM|BzX@>5|SiIk|arzB&j4vk|arz zBuSDaNs=Tovb z(IDio#^jVuzN~f@H%~%7_Xs&F_nxfLS-BHjKO9{;nIUoICrRH)f|q4D2uB~D8k_nj zk)%!*hxeV}6GG199#lIB)@L!flRP8j0_M&wH$MnUhDp-*o#L-TE@;=e;KXzsl3LC`8plF6Oqsv#FJckGyELGWUjB%M3OcZOWh z+Ylc*&ftIBFB642>q=MT1cx;?5ia1~koDO~ zBuPK8CO9kiiQy+Lv+pDe^|~x(-$`=KkPDbQRj7-HNfN&@KX-~R47s4WlZE>JFi9qN zl0OQ$fVoqJx<;5Jojb+1hFs9x$wJ*SOp?i+KrTL19>a&p%i+W2>&8KkPFWlyO*77NM8~IectvnBJC!dCQkWa@u%4gu6zHn`E2|e z`5gQ@`CR-4`8>RdFkC1P{N6NS2qvYH0 z(emy182Ju-tb8XvPQD8tFW-$%knh1K?(Mnx-*FL>F3q6A)1pcwwDyafK5 zycGVryfprXybS)PJQ5-BmIAr>+wvIxPR4_gIl1NFbO*Mu?U||GMRL!)EOX<@Z<@K~ z=O;A?+RH28m&+^SSI8^jSIR5nSIMj3=^kqS9-dnjzgFX`;n&Nnse^1^Ie_!4o|3E$f|4=>< z|42Rv|5!d4|3p3n|5QE{|4cp%|6D#C|3W?j|582@|4Kdz|5`p8|0d%(+j4Tpz{^4| zbQ@r@!JfQ4VdHR5*m&F%HUam9O~gH6lkuzxOD)(b__yJV@j;)8e<#nwzn4$Le~?ed zf0WO_f0EC{f0oa}f056|f0fU{f0NI}f0xh0|B%ne|CBGl|B^4n|CTSp|B)}obL30# z$bJeeC9uDI8D3nz94{$ffgd1Wi61Cmg&!nejhB_L!K3oEcwD{?KUlsVKSaI(KUBUE zKTN&}KU}^UKSI6*KT^IGKT5t0KU%&WuOZ)o*OKqV>&SQE_2j$pW957B_`33m1@(c0j{9XC2_0N|CCR{|B}Ci|1EzR|0mA$38)mtis34Su@bmSVXPFcQWz_ZXO+U_Cq7mN z&(U8Hi4brjA(l&Ef4w4x7nhgAOUldR2gobn2g)nr2gxhpW#yIesJsdumsiCPmRG|M zkypnLmDj`%lh?)%&v?%AoLF6Wd&q@tGfMqG*5r2NrFk6xH_c14KJKO20Qb^73HQ=$ zhInjHp9I#o8w-Y=i*+O=i^?PEpV^Qmbh1DE8Huy zHSU$!2KUNri)XFORBdR79}zCi{9Pp00Y6gS5kE@a2|rri8LuJlg4dE?gV&K?hu4$e zfFCRGiXSh(89zbZ4L?!d9Y0y#13yLH6F*hn3qM_c7v4nP8$VOt2R}>R7e8Cx4?joV zA3sk%0KY&!5Wi492){@^7{6FP1iwT+6u(qH48Kf19B(flfnP2kiC-ZfgnKY54cyom0T3<3Gq};6KV|;y=k};Xlh~&f@v$L{U%0Ix5P6d|Bfr+B0&0i8O(D7)8rPvyybP{G zr+6enK&MXeTwI4v@ffZ{r+7JBhfeYGxDK7-6>uFo#Vg`Ebc$EPb?6kYjJMWXPzBea uQ@kp!L#KE(T!&8a>Uh?nQ}Q7*UK8)A-&-5+l<}ZLPP{Ih?(h_X&FFuf*7X4Z literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/unit_replies.bin b/tests/fixtures/minimate-bench-10-26-26-blastware/unit_replies.bin new file mode 100644 index 0000000000000000000000000000000000000000..b48e1ab277bae7cb9dd6705afafbcceb55e8a22d GIT binary patch literal 364972 zcmeFa4YXv}Ro{6_Zb{Frr+)R?&vK)5^s42?Je#)qS#F@?NVWhuv_S?13*#Y9VvW_t zVuTzdnU4fwlQ;xC9w1psFbu;uz+`2Gghdl{0E2x*3-g)<(FTMS~)3aOedi}lQnQv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d(8B{gf9gAHwViw`1hD{h9O!ISP;r8zj{(q(azdxbSN&o-= literal 0 HcmV?d00001 diff --git a/tests/test_5a_blastware_walk.py b/tests/test_5a_blastware_walk.py new file mode 100644 index 0000000..a043eaf --- /dev/null +++ b/tests/test_5a_blastware_walk.py @@ -0,0 +1,154 @@ +"""SFM's MiniMate requests and 5A walk, against Blastware's own (recorded 2026-10-26). + +Blastware downloaded all 8 of BE9441's events -- three of which cross a 64 KB page +-- while a bridge recorded both directions (fixture README). Every one of its 748 +requests is the standard 16-byte payload with a SUM8 checksum and every 02 / 03 / +04 / 10 byte DLE-escaped; a 5A request carries a length (0x0200, or the remainder +for TERM) and a 4-byte linear address. The walk is the event's start, then ++0x200 at a time carrying into the page byte, then TERM at the next boundary for +exactly the remainder. SFM must send exactly those requests. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import fast_clock # noqa: E402 +from minimateplus.blastware_file import extract_body_bytes # noqa: E402 +from minimateplus.framing import S3FrameParser, build_5a_request, build_bw_frame, waveform_key_params # noqa: E402 +from minimateplus.waveform_codec import STREAM_END_ID, decode_waveform_v2, walk_records # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-blastware" + + +def _unstuff(b: bytes) -> bytes: + out, k = bytearray(), 0 + while k < len(b): + if b[k] == 0x10 and k + 1 < len(b): + out.append(b[k + 1]); k += 2 + else: + out.append(b[k]); k += 1 + return bytes(out) + + +def bw_requests() -> list: + """Blastware's requests, each as wire bytes; the SESSION_RESETs dropped.""" + raw, out, i = (FIX / "blastware_requests.bin").read_bytes(), [], 0 + while i < len(raw): + if raw[i:i + 2] == b"\x41\x03": + i += 2 + continue + j = i + 2 + while raw[j] != 0x03: # the first ETX not escaped by a DLE + j += 2 if raw[j] == 0x10 else 1 + out.append(raw[i:j + 1]) + i = j + 1 + return out + + +def logical(frame: bytes) -> bytes: + return _unstuff(frame[2:-1])[:-1] # the 16-byte payload, checksum dropped + + +def unit_a5_replies() -> list: + raw, out, start, p = (FIX / "unit_replies.bin").read_bytes(), [], 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + if f.sub == 0xA5: + out.append(raw[start:i + 1]) + start = i + 1 + return out + + +REQS = bw_requests() +FIVE_A = [f for f in REQS if logical(f)[2] == 0x5A] + + +def addr_len(frame: bytes) -> tuple: + p = logical(frame) + return int.from_bytes(p[6:10], "big"), int.from_bytes(p[4:6], "big") + + +def test_the_recording_is_what_the_readme_says(): + assert (len(REQS), len(FIVE_A)) == (748, 540) + + +def test_every_blastware_5a_request_is_rebuilt_byte_for_byte(): + assert [build_5a_request(*addr_len(f)) for f in FIVE_A] == FIVE_A + + +def test_every_other_blastware_request_is_rebuilt_byte_for_byte(): + others = [f for f in REQS if logical(f)[2] != 0x5A] + assert len(others) == 208 + for f in others: + p = logical(f) + assert build_bw_frame(p[2], p[5], p[6:16]) == f + + +def test_a_standard_request_escapes_02_03_04_in_its_params_and_checksum(): + frame = build_bw_frame(0x0A, 0x46, waveform_key_params(bytes.fromhex("01120203"))) + assert b"\x10\x02\x10\x03" in frame # the key's 02 and 03 + for low in range(256): # a checksum of 0x03 + f = build_bw_frame(0x0A, 0x46, waveform_key_params(bytes([0x01, 0x11, 0x50, low]))) + if sum(_unstuff(f[2:-1])[:-1]) & 0xFF == 0x03: + assert f.endswith(b"\x10\x03\x03") + break + else: + pytest.fail("no key gave a checksum of 0x03") + + +# -- the walk ------------------------------------------------------------------ + +class ByAddress: + """Answers each 5A request with Blastware's recorded reply for the same + (address, length); records what SFM sent.""" + + def __init__(self): + self.replies = {addr_len(q): r for q, r in zip(FIVE_A, unit_a5_replies())} + self.sent, self._buf = [], b"" + + def write(self, data): + data = bytes(data) + self.sent.append(data) + self._buf += self.replies.get(addr_len(data), b"") + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +def blastware_walk(start: int) -> list: + """Blastware's requests for the event that starts at `start`.""" + i = next(k for k, f in enumerate(FIVE_A) if addr_len(f) == (start, 0x200)) + walk = [FIVE_A[i]] + while addr_len(walk[-1])[1] == 0x200: # until TERM (a short read) + i += 1 + walk.append(FIVE_A[i]) + return walk + + +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +@pytest.mark.parametrize("key", ["01110000", "01118a2c", "0112a0b6", "0114b0b2"]) +def test_the_walk_sends_exactly_blastwares_requests_and_the_event_is_whole(key): + t = ByAddress() + frames = mp.MiniMateProtocol(t).read_bulk_waveform_stream( + bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, strict=True) + want = blastware_walk(int(key, 16)) + assert t.sent == want + assert len(frames) == len(want) + _s, body, _f = extract_body_bytes(frames) + recs = walk_records(body) + assert body[recs[-1]["end"] + 4] == STREAM_END_ID + dec = decode_waveform_v2(body) + assert len({len(dec[c]) for c in ("Tran", "Vert", "Long")}) == 1 diff --git a/tests/test_minimate_5a_strict.py b/tests/test_minimate_5a_strict.py index 397739c..4151a22 100644 --- a/tests/test_minimate_5a_strict.py +++ b/tests/test_minimate_5a_strict.py @@ -71,8 +71,9 @@ def test_strict_raises_when_the_term_gets_no_reply(): stream(a5_replies(), silent_from=50, strict=True) # every chunk answered, the TERM not -def test_strict_raises_when_a_metadata_page_gets_no_reply(): - with pytest.raises(mp.ProtocolError, match="metadata page 0x1002 got no reply"): +def test_strict_raises_when_the_first_events_second_chunk_gets_no_reply(): + # once called the "metadata page at 0x1002": it is event 0's chunk at 0x0200 + with pytest.raises(mp.ProtocolError, match="no reply for the chunk at 0x01110200"): stream(a5_replies(FIX_EVENT0), key=KEY0, silent_from=1, strict=True) @@ -101,15 +102,15 @@ def test_the_legacy_walk_keeps_its_tolerance(): assert 0 < len(frames) < 51 # short, returned, not raised -- as before -def test_strict_names_an_event_that_crosses_the_64kb_page_boundary(): - """BE9441 events 2 and 19 end in the next page (end offset < start offset); - the walk cannot follow them yet. Refused by name, before any chunk is sent.""" +def test_strict_refuses_a_strt_whose_end_is_not_after_its_start(): + """An event that crosses a 64 KB page now downloads (tests/test_5a_blastware_walk.py); + an end at or before the start can only be a corrupt STRT.""" r = a5_replies() i = r[0].find(b"STRT") - assert r[0][i + 6:i + 10] == bytes.fromhex("0111c92c") # the end key: same page - r[0] = r[0][:i + 6] + bytes.fromhex("01122f06") + r[0][i + 10:] # ... now the next page + assert r[0][i + 6:i + 10] == bytes.fromhex("0111c92c") # the end key + r[0] = r[0][:i + 6] + bytes.fromhex("01110000") + r[0][i + 10:] # ... before the start p = mp.MiniMateProtocol(Replay(r)) - with pytest.raises(mp.ProtocolError, match="crosses the unit's 64 KB page boundary"): + with pytest.raises(mp.ProtocolError, match="at or before its start"): p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, strict=True) - assert p._transport.sent == 1 # the probe, and nothing after + assert p._transport.sent == 1 # the first chunk, and nothing after -- 2.54.1 From 6f31eca36606831a7a0bfef5245e270b8352c72a Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 14:44:11 -0400 Subject: [PATCH 104/223] docs: the 64 KB page bug is fixed; the 5A 'non-standard frame' model retracted in place CLAUDE.md: the KNOWN BUG entry marked fixed (887e75d) with what settled it, and retraction notes under the 5A sections that described the misreading (partial stuffing, offset_hi 0x10 raw, 11-byte params, metadata pages 0x1002/0x1004). Series-III reference: a 2026-10-26 (3) row. Spec: the MiniMate check updated. Code comments that called the page bug open, updated; the adapter's struct.error mapping kept as a defence, its message and test no longer naming the old bug. Verified live on BE9441 the same day: all 8 events downloaded by serial, the 4 that cross a 64 KB page included, each whole and matching the unit's own peaks. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 37 ++++++++++++++++++- docs/instantel_protocol_reference.md | 1 + .../2026-10-20-sfm-series4-parity-design.md | 13 ++++--- micromate/protocol.py | 5 ++- sfm/device_access/s3.py | 9 ++--- tests/test_device_access_s3_events.py | 6 ++- 6 files changed, 56 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 439f547..ab14535 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -244,7 +244,23 @@ Read this first when picking the project back up. 4th-decimal tick and are Thor's own rounding — no single linear LSB can reproduce every printed value (the constraints are infeasible by 7e-5 relative), so do NOT retune `_GEO_LSB_IPS`. -- **⚠ KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB.** +- **✅ FIXED 2026-10-26 (`887e75d`) — was: "KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB."** + Kept below as history. The fix came from a recording of Blastware downloading all 8 of + BE9441's events, 3 crossing a page (`tests/fixtures/minimate-bench-10-26-26-blastware/`): + - **Every MiniMate request DLE-escapes 02, 03, 04 and 10**, payload and checksum alike + (748/748 re-encode). `build_bw_frame` had escaped only 0x10. + - **A 5A request is an ordinary request carrying a LENGTH and a 4-byte linear ADDRESS.** + The walk: the event's start, +0x200 carrying into the page byte, then TERM at the + next boundary for the remainder. + - **The old model misread the same bytes.** The "offset 0x1002" is length 0x0200 + escaped; the "metadata pages at 0x1002/0x1004" are event 0's chunks at 0x0200 and + 0x0400; the 16-bit counter could not leave its page. + - **Verified on BE9441**, live: all 8 events, including 4 page crossings, downloaded + whole and matched the unit's own peaks. + ⚠ Sections below that describe "partial DLE stuffing", "11-byte params", "offset_hi + 0x10 raw" and "metadata pages 0x1002/0x1004" are that misreading. They are retracted + here, not deleted. + ~~**⚠ KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB.**~~ `parse_strt_end_offset()` returns only `(end_key[2] << 8) | end_key[3]`, discarding the key's page byte. An event starting at `0x0111F2A2` and ending at `0x0112_1010` therefore reads `end_offset = 0x1010` — *behind* its own @@ -843,6 +859,14 @@ S3→BW (response): ## Critical protocol gotchas (hard-won — do not re-derive) ### SUB 5A — bulk waveform stream — NON-STANDARD frame format +> ⚠ **RETRACTED 2026-10-26 (measured): it is a standard frame.** The payload is +> `[10 00 5A 00][length BE][address BE 4][zeros 6]` with a SUM8 checksum, and every +> 02/03/04/10 is DLE-escaped (`s3_stuff`, `build_5a_request`). "offset_hi 0x10 raw" was +> the length 0x0200 escaped (`10 02 00`). The "DLE-aware checksum" is SUM8 of the +> unescaped payload. The "partial stuffing" carve-outs were the escape rule seen half. +> All 540 of Blastware's 5A requests rebuild byte for byte +> (`tests/test_5a_blastware_walk.py`). The text below is history. + **Always use `build_5a_frame()` for SUB 5A. Never use `build_bw_frame()` for SUB 5A.** @@ -883,6 +907,9 @@ the 1-2-26 BW TX capture (10 frames). Difference (3) confirmed against the 5-1- "bwcap3sec" capture (17 frames, all match byte-for-byte after fix). ### SUB 5A — chunk counter formula (REWRITTEN 2026-05-01 — see 5-1-26 captures) +> ⚠ **SUPERSEDED 2026-10-26:** a chunk is addressed by a full 32-bit address, stepping +> +0x200 across page boundaries; no event-1 special case (see `read_bulk_waveform_stream`). + > ⚠️ **Everything that came before this rewrite was WRONG in important ways.** The previous > formula `max(key4[2:4], 0x0400) + (chunk_num - 1) * 0x0400` happened to *work* for events @@ -1031,6 +1058,11 @@ are wrong; the device's response under that path is a tiny 101-byte device-side (arrived only after we walked the entire post-event buffer), not the proper file footer. ### SUB 5A — fixed metadata pages 0x1002 and 0x1004 (NEW 2026-05-01) +> ⚠ **RETRACTED 2026-10-26 (measured):** these are not fixed global pages. They are the +> first event's own chunks at addresses 0x0200 and 0x0400, which escape to `10 02 00` and +> `10 04 00` on the wire. A non-first event has no such reads because it does not start at +> 0x0000. Their strings are still read as described below. + Two chunk addresses are GLOBAL device/session metadata, not event-specific: @@ -1055,6 +1087,9 @@ locates the ASCII strings via label scans (`Project:`, `Client:`, `User Name:`, dump the structural layout if more session-global fields need to be extracted. ### SUB 5A — params are 11 bytes for chunk frames, 10 for termination +> ⚠ **RETRACTED 2026-10-26:** every 5A request has the standard 10 params bytes (address + +> 6 zeros). The "11th byte" was the length's low byte, read as params. + `bulk_waveform_params()` returns 11 bytes (extra trailing `0x00`). The 11th byte was confirmed from the BW wire capture. `bulk_waveform_term_params()` returns 10 bytes. diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index bfe0129..04f0670 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-10-26 (3) | §3, §7.8, §10 | **⚠ RETRACTS the 5A "non-standard frame" model; the 64 KB page bug is FIXED (measured).** A bridge recorded Blastware downloading all 8 of BE9441's events, 3 crossing a 64 KB page (`tests/fixtures/minimate-bench-10-26-26-blastware/`). **Every request** is the standard 16-byte payload with a SUM8 checksum and **every 02, 03, 04 and 10 DLE-escaped**, payload and checksum alike: 748/748 re-encode byte-identically. §10's "only 0x10 is stuffed" is half the rule. **A 5A request is an ordinary request** `[10 00 5A 00][length BE 2][address BE 4][zeros 6]`, where length is 0x0200 per chunk and the remainder for TERM. The walk: the event's start address, +0x200 at a time as plain 32-bit addresses (carrying into the page byte), then TERM at the next boundary for exactly the remainder, ending at STRT's full 32-bit end key. **Misreadings retracted:** the fixed "offset 0x1002" is length 0x0200 escaped (`10 02 00`); the "metadata pages at 0x1002 / 0x1004, global, read once per session" are the first event's own chunks at 0x0200 and 0x0400; the "11-byte params" counted the length's low byte; the "partial DLE stuffing" carve-outs were the escape rule seen half; the 16-bit counter is why a walk could not leave its page. **Verified live on BE9441:** all 8 events downloaded whole, the 4 crossings included, each matching the unit's own 0C peaks. Code `887e75d`. | | 2026-10-26 (2) | §7.8 | **The 64 KB page bug, narrowed (measured, BE9441).** Blastware's own downloads of all 20 events (Brian, `example-events/10-25-26 - thumps`) give byte-exact ground truth. SFM's downloads of events 0, 1, 3, 4 and 10 are **byte-identical** to Blastware's. Importing Blastware's files first (the watcher route) makes SFM's downloads of the same events return `already_stored`: the unit's 0C and Blastware's file agree on (serial, timestamp). For an event that crosses a page (event 2, `0111c92c` → STRT end key `01122f06`, full 32 bits) a read-only test walk with the page byte carried (params `00 01 12 01 2c`) got a proper A5 reply for the first chunk in page 0x12, echoing `01 12 01 2c`. The second chunk, `00 01 12 03 2c`, got no reply frame: a raw 0x03 (ETX) inside the params. Page 0x11 never shows this, because event 1 skips 0x0000–0x05FF, so no counter there has a 02/03/04 byte. Every later page does. ⚠ How Blastware encodes a lone 02/03/04 inside params is unknown: §7.8 says `10 02/03/04` is kept as a literal pair, which would shift the address. A wire capture of Blastware downloading BE9441 event 2 or 19 settles it. Blastware's files are fixtures (`tests/fixtures/minimate-bench-10-25-26/blastware/`). | | 2026-10-26 | §7.8 | **5A requests must DLE-escape a checksum that is a framing byte (measured, BE9441).** The request for chunk 0x7D06 of event 01122f06 ends `… 02 03`: a bare 0x02 checksum (STX) before ETX. BE9441 never answered it, twice on two days, and rebooted ~11 s later each time; that was the 'mid-download reboot' of 2026-10-25 (row below). Sent as `… 10 02 03` it answered in 28 ms. So did chunk 0x7F06 (checksum 0x04 → `10 04`) and 0x8B06 (checksum 0x10 → `10 10`; sent bare, that reads as DLE+ETX), and the event downloaded whole and matched the unit's peaks. Escape set {02, 03, 04, 10}: a Micromate's for every byte (251/251 THOR requests), and consistent with §7.8's de-stuffing rule (`10 02/03/04` literal). About 1 chunk request in 64 has such a checksum. ⚠ Not known: whether standard (non-5A) requests need the same. No such keyed-read checksum has been sent. Also measured on the re-run: events that end in the next 64 KB page (BE9441 events 2 and 19) read an end offset lower than their start (the known page bug); every other event downloaded whole and verified. | | 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. ⚠ **RETRACTED 2026-10-26:** the cause is measured, and it was our request. The chunk request had a bare 0x02 checksum. See the 2026-10-26 row. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 70d8f82..bccd973 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -389,16 +389,19 @@ Each safety piece arrives with its first real use, so nothing sits untested. Blastware's. Importing Blastware's files first through the watcher route makes SFM's downloads return `already_stored`, with no duplicate rows. - - 🔶 **The 64 KB page bug** is narrowed. The page byte carries; a raw - 02/03/04 inside the params is the blocker. It needs a Blastware wire - capture of event 2 or 19 (CLAUDE.md, KNOWN BUG). + - ✅ **The 64 KB page bug is FIXED (`887e75d`).** A recording of + Blastware downloading all 8 events (4 crossing a page) showed every + request escapes 02/03/04/10, and that a 5A request is an ordinary one + carrying a length and a 32-bit linear address. Live on BE9441, all 8 + events downloaded whole and verified, the 4 crossings included. - Still owed: - a histogram event (this unit records single shot); - start/stop through the new path, with Brian present; - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; - - ⚠ whether standard (non-5A) requests need the same checksum - escape. No keyed read has had such a checksum yet. + - ~~whether standard (non-5A) requests need the same checksum + escape~~: settled 2026-10-26. Every request escapes 02/03/04/10 + (748/748 Blastware requests), and `build_bw_frame` now does. - **Download = fetch, check, store** in SFM's database, the same as Series 3's `blastware_file` route, and returns the stored row's id. The file and waveform are then served by the existing `/db/events/{id}/…` diff --git a/micromate/protocol.py b/micromate/protocol.py index ab5883f..6e4c4f4 100644 --- a/micromate/protocol.py +++ b/micromate/protocol.py @@ -231,8 +231,9 @@ def chunk_params(key4: bytes, byte_offset: int) -> bytes: ⚠ This is the **Series III 64 KB page-boundary bug in a new guise** — there, `parse_strt_end_offset()` discards the key's page byte and the `5A` walk - crashes once a unit's buffer crosses 64 KB, which is *still open* on that - side. The lesson that transfers: an address field whose high bytes are zero + crashed once a unit's buffer crossed 64 KB (fixed 2026-10-26: a Blastware + recording showed its 5A address is a plain 32-bit linear one, like this). + The lesson that transfers: an address field whose high bytes are zero in every capture is not a narrow field, it is an untested one. """ if byte_offset == 0: diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index c47a95e..e84c49e 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -322,12 +322,11 @@ class Series3Adapter: try: ev = client.download_event_by_key(key, expected_timestamp=iso) except struct.error as exc: - # Inferred, not measured here: the known 5A page bug. An event past the unit's - # first 64 KB drives TERM's offset negative, and struct.pack rejects it - # (seismo-relay CLAUDE.md, "KNOWN BUG"). + # Defensive. This once caught the 64 KB page bug (TERM's offset driven + # negative); the walk is 32-bit linear since 2026-10-26 and no longer + # produces it, so reaching here is a new fault. raise MalformedReply( - f"event {key.hex()}: its download could not be assembled ({exc}) -- most " - "likely the known bug with events past the unit's first 64 KB; not saved" + f"event {key.hex()}: its download could not be assembled ({exc}); not saved" ) from exc if ev is None: raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again") diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index e4ac8b7..9f17183 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -122,11 +122,13 @@ def test_a_failed_5a_is_a_clear_error(): adapter(fake).download_event(TCP, "BE18193", FIRST, None) -def test_the_64k_page_bug_is_named_not_a_bare_500(): +def test_an_assembly_fault_is_a_named_502_not_a_bare_500(): + # Once the 64 KB page bug's signature; that is fixed (2026-10-26), and the + # mapping stays as a defence against any struct.error in assembly. fake = FakeMiniMateClient() def boom(key4, **kw): raise struct.error("argument out of range") fake.download_event_by_key = boom - with pytest.raises(MalformedReply, match="64 KB"): + with pytest.raises(MalformedReply, match="could not be assembled.*not saved"): adapter(fake).download_event(TCP, "BE18193", FIRST, None) -- 2.54.1 From f61fc3cc785225670352992a8384c80252b259a3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 14:45:38 -0400 Subject: [PATCH 105/223] test(minimateplus): the walk rebuilds Blastware's own files for the page-crossing events Brian's Blastware files from the recorded session (events 0, 1, 3, 7 -- three cross a 64 KB page) as fixtures; SFM's walk, fed Blastware's recorded replies, writes each one byte for byte. Live the same day, SFM's own downloads of all 8 events were byte-identical to Blastware's (sha256), the 4 crossings included -- and events 2-5's shorter sample counts (20,490-21,011 vs 21,504) are in Blastware's files too: the unit's own recording. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../minimate-bench-10-26-26-blastware/README.md | 12 ++++++++++++ .../blastware/K441LTOF.ZI0 | Bin 0 -> 35390 bytes .../blastware/K441LTOF.ZQ0 | Bin 0 -> 36010 bytes .../blastware/K441LTOG.000 | Bin 0 -> 35118 bytes .../blastware/K441LTOG.0S0 | Bin 0 -> 32366 bytes tests/test_5a_blastware_walk.py | 15 ++++++++++++++- 6 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZI0 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZQ0 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.000 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.0S0 diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/README.md b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md index 54f2487..a951a4f 100644 --- a/tests/fixtures/minimate-bench-10-26-26-blastware/README.md +++ b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md @@ -28,3 +28,15 @@ and every 02 / 03 / 04 / 10 byte DLE-escaped (748/748 re-encode byte-identically address; a walk is start, start+0x200, ... carrying into the page byte, then TERM at the next boundary for exactly the remainder. The first event's "metadata pages at 0x1002/0x1004" are its chunks at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`). + +## `blastware/`: the files Blastware wrote in that session (Brian) + +| file | event | crosses a page | +|---|---|---| +| `K441LTOF.ZI0` | 0 (`01110000`) | no | +| `K441LTOF.ZQ0` | 1 (`01118a2c`) | yes, into 0x12 | +| `K441LTOG.000` | 3 (`0112a0b6`) | yes, into 0x13 | +| `K441LTOG.0S0` | 7 (`0114b0b2`) | yes, into 0x15 | + +After the fix (887e75d), SFM's own live downloads of all 8 events were byte-identical to +Blastware's files (sha256), the 4 crossings included. diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZI0 b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZI0 new file mode 100644 index 0000000000000000000000000000000000000000..8630f0fc64afe3e5b33c7b2ebe8833796cc182e2 GIT binary patch literal 35390 zcma)_f3RKGRo~BfezvaVYu)qY7v~XFzbpAAyadHk904vkL?uom69b-D`B9o_aJT=e z?w*rxIk~*tul@Aley!_%_hi5R=ew?3>AIem)#0wquAlXbVQ10tw_9xX{tn$vw=>%u zJkQBthnA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blt~3`1e2bvCp0Rjo*3t{Q1xP zpU*yX;o{=iFMRQjpZf}*e0utZ`LV07-ZQy&?{(AZ_51ei<6k@CXYI-lZ)UR@SFWE< zue&bgIQzueC!g@=96wJzb@AfGOHVJC zGva8}ss4eK}Dz}vO`Ym7hJH@p7&>#v*cz3$p;uiZ1*bImY0g-wig`||R|b7!A? z{1cz}#ACns*eCq&?Bi$8o;~-(xeMnmE@?4cESC$?6B&20cJm>A_8(#>hI7M^45z`v ze%`Jf_p>qmKe?&<(wDJq^85S0>Fx7ln06h$;vbM7*7onmHhwT`f9%@NkPM7v`=*$NzxKvo z@BE=tcf8@y!G1Qobn)D|C!aWb_Hlk5dyGG4@!6A4ox6a?*o9s$y0ta&zO7%;Bs{i% n|G`5bw$>jcvv)!_KIihcZtPyRZ!)s`mE-GCtR)F<-uV9jrxTUM literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZQ0 b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZQ0 new file mode 100644 index 0000000000000000000000000000000000000000..ea8f8a542a4e06f35a2022976dbee6fb101437b4 GIT binary patch literal 36010 zcma)_e~=|-b)LINBk5{)w72hQ5EEsrxw{N7kU=|=7T8e2UfUv(Vqt_4HnDL9m9#dp zVFl7+ASFPi3??yEB;~4*N=P97!%%T5j;YuQCE5Ha;z|X{HpDotL@RbF>|nv}-dThY zLYkZBc~AFBPVt9lXYcL)`uomz&U@Z-z8~H9PS>>eHqDL4?mm9&vExVI)LgvPEML&P z=9ZthWxm@kU;g=a(lr0&zV^z$*EG!n|L5~=)XkdpX0cmbZ`JF|AyjJl<6 zw$3qE4>eS4*4O!Mcg7qwEwAIQX?Cc$*6hqWfBm7H`pBVnJ8oy~4)w;}4!_i<$zr#} ztEcqJ(MmVk8Mh5`7Lm5(Rjbue`dIAJJQC0S=XIw1m2tD47U-;HsT+&7 zV(mJ|>#f~j47#OOGdr@-pvFblv{(H7;4|lk_D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-gf+D%`HdoKK|NccN~9_-M*P_n;(7C9Y>Gl z%3XKe`l44Jz3q*+9=qeVyPMbEee|yBkKg*{qc-|$m!>x!yX~s!i>5c+de>cd+FoE@&6AtvT|CAAYK7uKV`qK6J;itAhPOKzSEWB)ovyKY8@7=~ZZ(@g-tOLe1zv6TJ^Pye9d93e1PZ?wS^0VLlg;JVH1pqSo=@q? zhCWu`&xH$q|2Lbz^U%x7iXUU;`0QA5V|!!P2FWDG_~}Rf z_k&-4=;4P?e(f*5{*BXTXW#nvM-b*gIhf*hG%GZoYfw!~+lA|AjAn;lAIx?+gBW;Qj|5 zc;Li?Cr+O@GpEK9EBIO~Z_FmoIl#~I0lK0)r#;M;HMm>mbb@tQ`me8SzVw4--3{bT zQZ&V{XkS6y8Z0J$&Lc9%HwUeX+>|dUc1}1x>;C~&X3C=g literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.000 b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.000 new file mode 100644 index 0000000000000000000000000000000000000000..25907f6c90f9f5e697ad7ad187ef08c03c15aea1 GIT binary patch literal 35118 zcma)_e~?{gdEd{G*V47L);%k4%$97l*JgpmBc#Qs6NSh@Eq02h=C^@#hCkx5RbmP< zkwscMDIuN0vvlJu9c>kL*hKp7WmfectE!KHukgf1Gpg4qgB5uDkur{papFbMEw8yM0HxLsxaL zyYsboE-v@iz2Fb~L)U-u=6}?0|7h2Bd%DGU7T+0`x_P%WEKN6foy@y#>ie|I`O;3V zRoOn+%hUZo~JbZlK+oXB!k;vIggrZuH$w*YEJMG_3a1VLJ5l zVaKaWT~AADa7q~^6D!txq;J}Ixg(LErSc7&dG>Y#>sbI9^2q`b6(}H#xNjpt`#s>}P+i z5WBqi?l4gwYa&Lw)R}$-V%pn*5-6E8eV0;u9n^Lf$fX8A+N)MfF`eV(evUB%_%5Nx zWSI4oqk`IM;m{2tFBsTu>luao(t6_(ZlX`yYQYw$VdBvh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plus): size the 5A chunk cap from STRT, refuse a misread STRT, TERM only a tail Follow-ups from the review of 887e75d (verdict: keep, with fixes; no critical). - The cap: a caller's max_chunks (client.py passes 128) now bounds only a walk whose end is unknown. With STRT it cut every event past ~66 KB short -- 2,545 of 63,500 archived histograms are bigger (the review's count, DL2). Strict raised; legacy sent a TERM for most of the event, or a bare ValueError. - A STRT claiming less than one 0x200 chunk, or more than 4 MiB (a sanity bound, not a measured limit), is refused as a misread, in both modes -- once a bare ValueError and a 500. - TERM is sent only for a true tail (< 0x200). After an early end the legacy walk returns what arrived and sends none. - build_5a_request wraps build_bw_frame; the old 5A helpers are marked superseded (kept for tests/test_5a_protocol.py) and their imports dropped. Tests: all 8 recorded events (were 4) walk exactly as Blastware and rebuild its own files; an end key holding escaped bytes; a 300 KB event past a 128 cap; both misread-STRT refusals; the 1A frames BE9441 answered post-fix; the checksum vectors retargeted. Mutants the review saw survive (no STRT un-escape; a standard-request escape revert) and 3 new ones are each caught. Measured on the way: a reply's checksum is SUM8 of its unescaped payload, 748/748. The 'S3 checksums frequently fail' note was the parser summing its own kept escape bytes; noted, parser unchanged. Docs: the crossing count corrected to four (events 1, 3, 5, 7); the remaining stale 5A sections in CLAUDE.md annotated; the write-frame suspicion recorded as inferred only. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 60 ++++++-- docs/instantel_protocol_reference.md | 3 +- .../2026-10-20-sfm-series4-parity-design.md | 6 +- micromate/framing.py | 6 +- minimateplus/framing.py | 32 +++-- minimateplus/protocol.py | 72 ++++++---- .../README.md | 12 +- .../blastware/K441LTOF.ZV0 | Bin 0 -> 35332 bytes .../blastware/K441LTOG.050 | Bin 0 -> 34482 bytes .../blastware/K441LTOG.0A0 | Bin 0 -> 32742 bytes .../blastware/K441LTOG.0L0 | Bin 0 -> 32894 bytes tests/minimate_replay.py | 5 +- tests/test_5a_blastware_walk.py | 130 +++++++++++++++++- tests/test_5a_checksum_escape.py | 8 +- tests/test_minimate_5a_strict.py | 24 +++- 15 files changed, 285 insertions(+), 73 deletions(-) create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZV0 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.050 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.0A0 create mode 100644 tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.0L0 diff --git a/CLAUDE.md b/CLAUDE.md index ab14535..3b60f89 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,7 +10,7 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as --- -## Where things stand (updated 2026-10-25) +## Where things stand (updated 2026-10-26) Read this first when picking the project back up. @@ -150,11 +150,14 @@ Read this first when picking the project back up. Series-3 downloads are now checked against the unit's own 0C peaks before being stored. **Re-run 2026-10-26:** every event that does not cross a - 64 KB page downloaded whole and verified (events 0, 1, 3, 4, 10). The two - that cross one (events 2, 19) are refused by name. Stale id gives 409, a - repeat gives `already_stored`. ⚠ Still owed before merge: a histogram event, - `already_stored` against Blastware's copy, and start/stop through the new path - (spec, phase 1b). Next: 1c (webapp). + 64 KB page downloaded whole and verified (events 0, 1, 3, 4, 10). ~~The two + that cross one (events 2, 19) are refused by name.~~ **Later the same day the + page bug was fixed** (see the ✅ FIXED entry below): a fresh 8 events, 4 of them + crossing a page, all downloaded byte-identical to Blastware's own files. Stale + id gives 409, a repeat gives `already_stored`, also against Blastware's imported + copy. ⚠ Still owed before merge: a histogram event (and one over ~66 KB, the + size a 128-chunk cap used to cut short; now sized from STRT, untested on a unit) + and start/stop through the new path (spec, phase 1b). Next: 1c (webapp). - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor @@ -246,7 +249,7 @@ Read this first when picking the project back up. relative), so do NOT retune `_GEO_LSB_IPS`. - **✅ FIXED 2026-10-26 (`887e75d`) — was: "KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB."** Kept below as history. The fix came from a recording of Blastware downloading all 8 of - BE9441's events, 3 crossing a page (`tests/fixtures/minimate-bench-10-26-26-blastware/`): + BE9441's events, 4 crossing a page (`tests/fixtures/minimate-bench-10-26-26-blastware/`): - **Every MiniMate request DLE-escapes 02, 03, 04 and 10**, payload and checksum alike (748/748 re-encode). `build_bw_frame` had escaped only 0x10. - **A 5A request is an ordinary request carrying a LENGTH and a 4-byte linear ADDRESS.** @@ -260,6 +263,20 @@ Read this first when picking the project back up. ⚠ Sections below that describe "partial DLE stuffing", "11-byte params", "offset_hi 0x10 raw" and "metadata pages 0x1002/0x1004" are that misreading. They are retracted here, not deleted. + **Review follow-ups (2026-10-26):** the walk's chunk cap is now sized from STRT (a + caller's 128 cut every event past ~66 KB; 2,545 of 63,500 archived histograms are + bigger); a STRT claiming less than one chunk or more than 4 MiB is refused as a + misread; a TERM is sent only for a true tail. Still open, none measured: an event + ending exactly on a chunk step sends a zero-length TERM (as the old code did; 1 in + 512, never seen); with no STRT the legacy walk still reads `max_chunks` blind. + 🔶 **Inferred only, do not act on it without a capture:** `build_bw_write_frame` + ("raw except BW_CMD", "DLE-aware checksum") carries the same fingerprints as the + retracted 5A model: SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and + Blastware escapes `03` in write data. A write whose payload holds a bare + 02/03/04/10 may be malformed. One Blastware config-write capture settles it. + 🔑 **Replies follow the same rule (measured, 748/748):** every 02/03/04/10 escaped, + checksum = SUM8 of the unescaped payload. The "S3 checksums frequently fail" belief + is `S3FrameParser` summing its output with the `10` of `10 02/03/04` still in it. ~~**⚠ KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB.**~~ `parse_strt_end_offset()` returns only `(end_key[2] << 8) | end_key[3]`, discarding the key's page byte. An event starting at `0x0111F2A2` and ending @@ -530,7 +547,7 @@ Full read pipeline + write pipeline + erase pipeline + monitor log + call home c | Event header / first key | 1E | ✅ | | Waveform header | 0A | ✅ | | Waveform record (peaks, timestamp, project) | 0C | ✅ | -| **Bulk waveform stream (event-time metadata + full waveform)** | **5A** | ✅ **byte-perfect against BW captures (v0.14.3, 2026-05-05)** — STRT-bounded chunk walk + correct event-N probe counter + DLE-stuffed `0x10` bytes in params + concatenate-only file body assembly. All 17 5A request frames in the 5-1-26 3-sec capture reproduce byte-for-byte. | +| **Bulk waveform stream (event-time metadata + full waveform)** | **5A** | ✅ **(2026-10-26: a LENGTH read at a 32-bit ADDRESS, every 02/03/04/10 escaped — the model in the rest of this cell is retracted, see "✅ FIXED 2026-10-26")** byte-perfect against BW captures (v0.14.3, 2026-05-05) — STRT-bounded chunk walk + correct event-N probe counter + DLE-stuffed `0x10` bytes in params + concatenate-only file body assembly. All 17 5A request frames in the 5-1-26 3-sec capture reproduce byte-for-byte. | | Event advance / next key | 1F | ✅ | | **Write commands (push config to device)** | **68–83** | ✅ new v0.8.0 | | **Erase all events** | **0xA3 → 0x1C → 0x06 → 0xA2** | ✅ new v0.9.0 | @@ -994,6 +1011,11 @@ several events should read 0x1002/0x1004 only once at the start. `read_bulk_waveform_stream`. ### SUB 5A — STRT record encodes end_offset (NEW 2026-05-01) +> ⚠ **SUPERSEDED 2026-10-26:** the end is the FULL 32-bit `end_key` +> (`parse_strt_end_key`), read after removing the reply's escape bytes. The 16-bit +> `end_offset` below was the 64 KB page bug, and misread any end whose low bytes held +> an escaped 02/03/04. + The first A5 response (probe response, or the first chunk for event 2+) contains a STRT record at byte offset 17 of the `data` field. Layout: @@ -1023,6 +1045,11 @@ Verified across 3 events: | 5-1-26 "copy 2nd address" / DA event 2 | `011121F2` | `0111417E` | `0x417E` (event 2 span 0x1F8C = 8,076 B) | ### SUB 5A — TERM frame formula (FINALIZED 2026-05-01) +> ⚠ **SUPERSEDED 2026-10-26:** TERM is `build_5a_request(next_boundary, end - +> next_boundary)`: a read of the remainder at the next 32-bit boundary. "offset_word" +> is that length; "params[2:4]" are the address's low bytes. The tables below still +> hold as numbers. + The TERM frame fetches the partial last chunk *and* the file footer. It is **not** a simple "goodbye" frame — its response payload contains the bytes between the last full 0x0200-aligned @@ -1096,6 +1123,9 @@ confirmed from the BW wire capture. `bulk_waveform_term_params()` returns 10 byt Do not swap them. ### SUB 5A — event-time metadata source (FINALIZED 2026-05-05) +> ⚠ **AMENDED 2026-10-26:** the strings come from the first event's chunks at 0x0200 and +> 0x0400, not from "global pages read once per session" (see the retraction above). + The metadata strings come from the two fixed metadata pages at counter `0x1002` and `0x1004` (see "SUB 5A — fixed metadata pages 0x1002 and 0x1004" above). These pages @@ -1137,6 +1167,11 @@ that's an old-walk artifact (the broken `0x0400`-step formula occasionally caugh pages instead. ### SUB 5A — end-of-stream (FINALIZED 2026-05-01) +> ⚠ **AMENDED 2026-10-26:** a reply's `page_key` is not a page. It is the echoed +> length plus an escape byte the parser keeps: all 532 chunk replies read `0x0010` and +> the 8 TERMs `0x0000`/`0x0001`. The walk relies on it only for the mid-stream +> terminator check, and now sends TERM only for a tail (< 0x200). + Under the v0.14.0+ STRT-bounded walk the stream ends cleanly: @@ -1302,6 +1337,7 @@ Confirmed from the 5-1-26 "Download All" capture: 1F → null sentinel ``` +(⚠ 2026-10-26: the walk starts at the 0x46 key itself, as a plain 32-bit address.) This is why event 2's first 5A chunk is at `start_key + 0x46` — that's the address of the "real start" 0x46-record, distinct from the `0x2C`-record at the raw boundary. Use the `0x46` keys as the input to `read_bulk_waveform_stream`, not the `0x2C` keys. @@ -1563,12 +1599,12 @@ All DB endpoints are read-only except `PATCH /db/events/{id}/false_trigger`. | Capture | Location | Contents | |---|---|---| -| 1-2-26 | `bridges/captures/1-2-26/` | SUB 5A BW TX frames — confirmed 5A frame format, 11-byte params, DLE-aware checksum | +| 1-2-26 | `bridges/captures/1-2-26/` | SUB 5A BW TX frames — confirmed 5A frame format, 11-byte params, DLE-aware checksum (⚠ that model retracted 2026-10-26: a standard frame, length + 32-bit address) | | 3-11-26 | `bridges/captures/3-11-26/` | Full compliance setup write, Aux Trigger capture | | 3-31-26 | `bridges/captures/3-31-26/` | Complete event download cycle (148 BW / 147 S3 frames) — confirmed 1E/0A/0C/1F sequence; only 1 event stored so token=0xFE appeared to work | | 4-3-26 | `bridges/captures/4-3-26/` | Browse-mode S3 capture with 2+ events — confirmed all-zero params for 1F, 1F response layout, null sentinel, 0A context requirement | | 4-27-26 | `bridges/captures/4-27-26/` | BW "open 2sec waveform" + "copy event to disk" + paired SFM "seismo_dl" — first proof that SFM was over-reading 5× past event end. BW reads 14 chunks at 0x0200 increments + TERM at end_offset; SFM was reading 37 chunks at 0x0400 increments. STRT end_key field located. | -| 5-1-26 | `bridges/captures/5-1-26/comcheck/` | Three sub-captures: SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945`/`_171216`). Confirmed: TERM frame formula across 3 events; metadata pages 0x1002/0x1004 are global (read once per session); event-1 vs event-N chunk-pattern split; WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundaries. | +| 5-1-26 | `bridges/captures/5-1-26/comcheck/` | Three sub-captures: SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945`/`_171216`). Confirmed: TERM frame formula across 3 events; metadata pages 0x1002/0x1004 are global (read once per session) (⚠ retracted 2026-10-26: event 1's chunks at 0x0200/0x0400); event-1 vs event-N chunk-pattern split; WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundaries. | --- @@ -2184,7 +2220,7 @@ body) because writing a dial string may require DLE escaping for embedded contro | Folder / File | Contents | |---|---| -| `1-2-26/` | First SUB 5A BW TX capture — established 5A frame format (raw offset_hi, DLE-aware checksum). 10 frames verified. | +| `1-2-26/` | First SUB 5A BW TX capture — established 5A frame format (raw offset_hi, DLE-aware checksum). 10 frames verified. (⚠ model retracted 2026-10-26) | | `3-11-26/raw_bw_20260311_170151.bin` | Full compliance write + event download (SUBs 68→83 confirmed, frames 102–112) | | `3-31-26/` | Single-event download (148 BW / 147 S3 frames) — 1E/0A/0C/1F sequence confirmed (single event so token=0xFE appeared to work in either branch) | | `4-2-26/` | Download-mode BW TX capture — POLL×3 requirement confirmed (frames 68-73 between 1F and first 5A) | @@ -2196,7 +2232,7 @@ body) because writing a dial string may require DLE escaping for embedded contro | `4-20-26/geo sensitivity/` | Geo sensitivity changes: 1.25 in/s (Sensitive), 10 in/s (Normal) | | `4-20-26/call home settings/` | Call home config read/write captures | | `4-27-26/` | BW "open 2sec waveform" + "copy event to disk" + paired SFM "seismo_dl" — first proof of 5× SFM over-read. STRT end_key field located. | -| **`5-1-26/comcheck/`** | **Triplet of captures that nailed the v0.14.0 walk:** SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945` / `_171216`). Confirmed: TERM frame formula across 3 events, metadata pages 0x1002/0x1004 are global session metadata, event-1 vs event-N chunk pattern split, WAVEHDR off=0x46 vs 0x2C disambiguates real events from boundaries. | +| **`5-1-26/comcheck/`** | **Triplet of captures that nailed the v0.14.0 walk:** SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945` / `_171216`). Confirmed: TERM frame formula across 3 events, metadata pages 0x1002/0x1004 are global session metadata (⚠ retracted 2026-10-26: event 1's chunks at 0x0200/0x0400), event-1 vs event-N chunk pattern split, WAVEHDR off=0x46 vs 0x2C disambiguates real events from boundaries. | | **`5-1-26/comcheck/bwcap3sec/`** | **The byte-perfect reference for v0.14.3.** All 17 BW 5A request frames (probe, 2 metadata, 13 samples, TERM) reproduce byte-for-byte from SFM's framing helpers — including the `10 10 00` DLE-stuffed counter for sample @ 0x1000 that was the long-standing failure mode. | | `5-4-26/` | BW MITM captures of "copy 3sec / 2sec / Download All" + paired SFM session (`seismo_dl_20260504_145701`) showing the +0x46 event-N probe bug producing 110-chunk runaway walk. Cross-references against 5-1-26 confirmed device behavior is identical. | diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 04f0670..1495d1b 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,7 +11,8 @@ | Date | Section | Change | |---|---|---| -| 2026-10-26 (3) | §3, §7.8, §10 | **⚠ RETRACTS the 5A "non-standard frame" model; the 64 KB page bug is FIXED (measured).** A bridge recorded Blastware downloading all 8 of BE9441's events, 3 crossing a 64 KB page (`tests/fixtures/minimate-bench-10-26-26-blastware/`). **Every request** is the standard 16-byte payload with a SUM8 checksum and **every 02, 03, 04 and 10 DLE-escaped**, payload and checksum alike: 748/748 re-encode byte-identically. §10's "only 0x10 is stuffed" is half the rule. **A 5A request is an ordinary request** `[10 00 5A 00][length BE 2][address BE 4][zeros 6]`, where length is 0x0200 per chunk and the remainder for TERM. The walk: the event's start address, +0x200 at a time as plain 32-bit addresses (carrying into the page byte), then TERM at the next boundary for exactly the remainder, ending at STRT's full 32-bit end key. **Misreadings retracted:** the fixed "offset 0x1002" is length 0x0200 escaped (`10 02 00`); the "metadata pages at 0x1002 / 0x1004, global, read once per session" are the first event's own chunks at 0x0200 and 0x0400; the "11-byte params" counted the length's low byte; the "partial DLE stuffing" carve-outs were the escape rule seen half; the 16-bit counter is why a walk could not leave its page. **Verified live on BE9441:** all 8 events downloaded whole, the 4 crossings included, each matching the unit's own 0C peaks. Code `887e75d`. | +| 2026-10-26 (4) | §3, §10 | **Replies follow the request rule; a write-frame suspicion (inferred).** Measured on all 748 reply frames of the 10-26 recording: the unit escapes exactly 02/03/04/10 with a `10`, and the checksum is **SUM8 of the unescaped payload**, 748/748. The long-held "S3 response checksums frequently fail SUM8" (`protocol._validate_frame`) is `S3FrameParser`'s own doing: it keeps the `10` of `10 02/03/04` in its output (consumers rely on that) and sums it, so 502/540 A5 replies read invalid. 🔶 **Inferred only:** `build_bw_write_frame`'s model ("raw except BW_CMD", "DLE-aware checksum") shows the same fingerprints as the retracted 5A model -- SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and Blastware escapes `03` in write data (§3 note, 2026-04-20). A write whose payload holds a bare 02/03/04/10 may be malformed; one Blastware config-write capture settles it. Not acted on. | +| 2026-10-26 (3) | §3, §7.8, §10 | **⚠ RETRACTS the 5A "non-standard frame" model; the 64 KB page bug is FIXED (measured).** A bridge recorded Blastware downloading all 8 of BE9441's events, 4 crossing a 64 KB page (`tests/fixtures/minimate-bench-10-26-26-blastware/`). **Every request** is the standard 16-byte payload with a SUM8 checksum and **every 02, 03, 04 and 10 DLE-escaped**, payload and checksum alike: 748/748 re-encode byte-identically. §10's "only 0x10 is stuffed" is half the rule. **A 5A request is an ordinary request** `[10 00 5A 00][length BE 2][address BE 4][zeros 6]`, where length is 0x0200 per chunk and the remainder for TERM. The walk: the event's start address, +0x200 at a time as plain 32-bit addresses (carrying into the page byte), then TERM at the next boundary for exactly the remainder, ending at STRT's full 32-bit end key. **Misreadings retracted:** the fixed "offset 0x1002" is length 0x0200 escaped (`10 02 00`); the "metadata pages at 0x1002 / 0x1004, global, read once per session" are the first event's own chunks at 0x0200 and 0x0400; the "11-byte params" counted the length's low byte; the "partial DLE stuffing" carve-outs were the escape rule seen half; the 16-bit counter is why a walk could not leave its page. **Verified live on BE9441:** all 8 events downloaded whole, the 4 crossings included, each matching the unit's own 0C peaks. Code `887e75d`. | | 2026-10-26 (2) | §7.8 | **The 64 KB page bug, narrowed (measured, BE9441).** Blastware's own downloads of all 20 events (Brian, `example-events/10-25-26 - thumps`) give byte-exact ground truth. SFM's downloads of events 0, 1, 3, 4 and 10 are **byte-identical** to Blastware's. Importing Blastware's files first (the watcher route) makes SFM's downloads of the same events return `already_stored`: the unit's 0C and Blastware's file agree on (serial, timestamp). For an event that crosses a page (event 2, `0111c92c` → STRT end key `01122f06`, full 32 bits) a read-only test walk with the page byte carried (params `00 01 12 01 2c`) got a proper A5 reply for the first chunk in page 0x12, echoing `01 12 01 2c`. The second chunk, `00 01 12 03 2c`, got no reply frame: a raw 0x03 (ETX) inside the params. Page 0x11 never shows this, because event 1 skips 0x0000–0x05FF, so no counter there has a 02/03/04 byte. Every later page does. ⚠ How Blastware encodes a lone 02/03/04 inside params is unknown: §7.8 says `10 02/03/04` is kept as a literal pair, which would shift the address. A wire capture of Blastware downloading BE9441 event 2 or 19 settles it. Blastware's files are fixtures (`tests/fixtures/minimate-bench-10-25-26/blastware/`). | | 2026-10-26 | §7.8 | **5A requests must DLE-escape a checksum that is a framing byte (measured, BE9441).** The request for chunk 0x7D06 of event 01122f06 ends `… 02 03`: a bare 0x02 checksum (STX) before ETX. BE9441 never answered it, twice on two days, and rebooted ~11 s later each time; that was the 'mid-download reboot' of 2026-10-25 (row below). Sent as `… 10 02 03` it answered in 28 ms. So did chunk 0x7F06 (checksum 0x04 → `10 04`) and 0x8B06 (checksum 0x10 → `10 10`; sent bare, that reads as DLE+ETX), and the event downloaded whole and matched the unit's peaks. Escape set {02, 03, 04, 10}: a Micromate's for every byte (251/251 THOR requests), and consistent with §7.8's de-stuffing rule (`10 02/03/04` literal). About 1 chunk request in 64 has such a checksum. ⚠ Not known: whether standard (non-5A) requests need the same. No such keyed-read checksum has been sent. Also measured on the re-run: events that end in the next 64 KB page (BE9441 events 2 and 19) read an end offset lower than their start (the known page bug); every other event downloaded whole and verified. | | 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. ⚠ **RETRACTED 2026-10-26:** the cause is measured, and it was our request. The chunk request had a bare 0x02 checksum. See the 2026-10-26 row. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index bccd973..052576b 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -394,8 +394,12 @@ Each safety piece arrives with its first real use, so nothing sits untested. request escapes 02/03/04/10, and that a 5A request is an ordinary one carrying a length and a 32-bit linear address. Live on BE9441, all 8 events downloaded whole and verified, the 4 crossings included. + Review follow-ups: the chunk cap is sized from STRT (a caller's 128 + cut events past ~66 KB short, e.g. large histograms), a misread STRT + is refused, TERM only for a true tail. - Still owed: - - a histogram event (this unit records single shot); + - a histogram event (this unit records single shot), ideally one + over ~66 KB, which only the new cap sizing lets through; - start/stop through the new path, with Brian present; - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; diff --git a/micromate/framing.py b/micromate/framing.py index a676748..9d1b714 100644 --- a/micromate/framing.py +++ b/micromate/framing.py @@ -130,8 +130,10 @@ def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: by """Build a host→unit command frame. ⚠ Do **not** substitute `minimateplus.framing.build_bw_frame()` here, even - though the payload layout is identical. That builder escapes only `0x10`, - so it reproduces just **161 of Thor's 218** captured read frames. The 57 it + though the payload layout is identical. That builder escaped only `0x10`, + so it reproduced just **161 of Thor's 218** captured read frames. (Since + 2026-10-26 it escapes the same four values -- a MiniMate wants them too -- but + the Micromate framing differs in other ways; keep the two builders apart.) The 57 it gets wrong are not edge cases: * every `SUB 0x5A` bulk download — `offset = 0x0400` puts a literal diff --git a/minimateplus/framing.py b/minimateplus/framing.py index fd05178..8795a77 100644 --- a/minimateplus/framing.py +++ b/minimateplus/framing.py @@ -112,18 +112,15 @@ def checksum(payload: bytes) -> int: # ── BW→S3 frame builder ─────────────────────────────────────────────────────── -# SUB byte for 5A — used by build_5a_frame below (protocol.py has the full -# constant set; defined here to avoid a circular import). +# SUB byte for 5A (protocol.py has the full constant set; defined here to +# avoid a circular import). SUB_5A = 0x5A -_BULK_CHUNK = 0x0200 # bytes per 5A read; a TERM reads the remainder - - def build_5a_request(address: int, length: int) -> bytes: """A SUB 5A read of `length` bytes at the unit's 32-bit `address`. - Measured 2026-10-26 from Blastware downloading all 8 of BE9441's events (three + Measured 2026-10-26 from Blastware downloading all 8 of BE9441's events (four crossing a 64 KB page): a 5A request is an ORDINARY 16-byte request -- `[10 00 5A 00][length BE][address BE 4][zeros 6]`, SUM8 checksum, every 02/03/04/10 escaped -- and this rebuilds all 540 of Blastware's 5A requests @@ -134,15 +131,15 @@ def build_5a_request(address: int, length: int) -> bytes: """ if not 0 <= address <= 0xFFFFFFFF: raise ValueError(f"address must fit in 32 bits, got {address:#x}") - if not 0 <= length <= 0xFFFF: - raise ValueError(f"length must fit in 16 bits, got {length:#x}") - payload = (bytes([BW_CMD, 0x00, SUB_5A, 0x00, (length >> 8) & 0xFF, length & 0xFF]) - + address.to_bytes(4, "big") + bytes(6)) - return bytes([ACK, STX]) + s3_stuff(payload + bytes([checksum(payload)])) + bytes([ETX]) + return build_bw_frame(SUB_5A, length, address.to_bytes(4, "big") + bytes(6)) def build_5a_frame(offset_word: int, raw_params: bytes) -> bytes: """ + ⛔ SUPERSEDED 2026-10-26 by `build_5a_request` -- no production caller. Kept + because tests/test_5a_protocol.py pins its bytes against the 5-1-26 captures; + for in-page requests it emits the same bytes. Its model (below) is retracted. + Build a BW→S3 frame for SUB 5A (BULK_WAVEFORM_STREAM) that exactly matches Blastware's wire output. @@ -442,6 +439,9 @@ def token_params(token: int = 0) -> bytes: def bulk_waveform_params(key4: bytes, counter: int, *, is_probe: bool = False) -> bytes: """ + ⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no + production caller; kept for tests/test_5a_protocol.py. See build_5a_request. + Build the 10-byte params block for SUB 5A (BULK_WAVEFORM_STREAM) requests. Confirmed 2026-04-02 from 1-2-26 BW TX capture analysis: @@ -487,6 +487,9 @@ def bulk_waveform_params(key4: bytes, counter: int, *, is_probe: bool = False) - def bulk_waveform_term_params(key4: bytes, counter: int) -> bytes: """ + ⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no + production caller; kept for tests/test_5a_protocol.py. See build_5a_request. + ⛔ DEPRECATED — DO NOT USE IN NEW CODE. This is the v1 termination params helper, paired with the broken @@ -523,6 +526,9 @@ def bulk_waveform_term_v2( last_chunk_counter: int, ) -> tuple[int, bytes]: """ + ⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no + production caller; kept for tests/test_5a_protocol.py. See build_5a_request. + Compute the SUB 5A TERM frame's offset_word and 10-byte params block. Confirmed across 3 events (4-27-26 + 5-1-26 captures): @@ -615,6 +621,10 @@ def parse_strt_end_key(a5_data: bytes) -> Optional[int]: def parse_strt_end_offset(a5_data: bytes) -> Optional[int]: """ + ⛔ SUPERSEDED 2026-10-26 by `parse_strt_end_key`: this keeps only the low 16 + bits (the 64 KB page bug) and misreads an end whose low bytes hold an escaped + 02/03/04. No production caller; kept for tests/test_5a_protocol.py. + Extract the event-end offset from the STRT record in an A5 response payload. The first A5 response (the probe response, or the first chunk for events diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index c43bd7f..1339099 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -29,14 +29,9 @@ from .framing import ( S3Frame, S3FrameParser, build_bw_frame, - build_5a_frame, build_bw_write_frame, waveform_key_params, token_params, - bulk_waveform_params, - bulk_waveform_term_params, - bulk_waveform_term_v2, - parse_strt_end_offset, parse_strt_end_key, build_5a_request, POLL_PROBE, @@ -125,23 +120,15 @@ DATA_LENGTHS: dict[int, int] = { # NOT handled here — requires specialised read logic. } -# SUB 5A (BULK_WAVEFORM_STREAM) protocol constants. -# -# 2026-05-01 minimal-fix: the chunk-counter walk is now bounded by the event's -# `end_offset` extracted from the STRT record at data[23:27] of the probe -# response. Without this bound the loop kept asking for chunks past the event -# end and the device responded with post-event circular-buffer garbage, -# corrupting reconstructed Blastware files for events ≥ 2 sec. -# -# We keep the OLD 0x0400 chunk step here (BW actually uses 0x0200 — see §7.8.5 -# of the protocol reference for the corrected understanding) because the -# existing blastware_file.py builder relies on the 0x0400-step frame structure -# to produce valid files. Switching to BW's 0x0200 step is a separate task -# that also requires updating the file builder. -# BW-exact protocol values (v0.14.0). Verified against 4-27-26 + 5-1-26 captures. -_BULK_CHUNK_OFFSET = 0x1002 # offset_word for probe + all chunk requests -_BULK_TERM_OFFSET = 0x005A # offset_word for the legacy terminator (fallback only) -_BULK_COUNTER_STEP = 0x0200 # chunk counter increment (matches chunk payload size) +# SUB 5A (BULK_WAVEFORM_STREAM) walk constants. A 5A request is a read of a +# LENGTH at a 32-bit ADDRESS (measured 2026-10-26 against Blastware; see +# read_bulk_waveform_stream and framing.build_5a_request). +_BULK_TERM_OFFSET = 0x005A # TERM length when the end is unknown (legacy fallback only) +_BULK_COUNTER_STEP = 0x0200 # bytes per chunk read, and the step between addresses +# A sanity bound on the size STRT claims, not a measured limit: BE units report +# 983,026 bytes of memory (SUB 1C) and the largest archived event is ~850 KB. A +# claim past this is a misread STRT, refused before walking megabytes of garbage. +_BULK_MAX_EVENT_BYTES = 0x400000 # 4 MiB # Default timeout values (seconds). # MiniMate Plus is a slow device — keep these generous. @@ -561,7 +548,7 @@ class MiniMateProtocol: tolerance stands: an early end proceeds to TERM and returns what arrived. The walk (measured 2026-10-26: Blastware downloading all 8 of BE9441's - events, three crossing a 64 KB page -- tests/test_5a_blastware_walk.py + events, four crossing a 64 KB page -- tests/test_5a_blastware_walk.py rebuilds its requests byte for byte): 1. Read 0x200 bytes at the event's own 32-bit address (the key). The @@ -634,6 +621,16 @@ class MiniMateProtocol: "before its start -- not downloaded") log.warning("5A STRT end 0x%08X is not after the start 0x%08X -- ignored", end, start) end = None + if end is not None and end - start < _BULK_COUNTER_STEP: + # The walk's first read is a whole chunk, so a smaller event cannot be + # bounded -- and no event is that small (the header alone is longer). + raise ProtocolError( + f"5A STRT for {key4.hex()} says the event is {end - start} bytes, less than " + "one 0x200 chunk -- a misread STRT; not downloaded") + if end is not None and end - start > _BULK_MAX_EVENT_BYTES: + raise ProtocolError( + f"5A STRT for {key4.hex()} says the event is {end - start:,} bytes, more than " + f"any unit holds ({_BULK_MAX_EVENT_BYTES:,}) -- a misread STRT; not downloaded") have_end = end is not None if not have_end: log.warning( @@ -644,13 +641,18 @@ class MiniMateProtocol: end = start + (max_chunks + 2) * _BULK_COUNTER_STEP # the cap bounds the loop else: log.info("5A STRT start=0x%08X end=0x%08X size=0x%X", start, end, end - start) + # With the end known, STRT bounds the walk and the cap must not cut it short: + # a histogram can be several hundred KB (2,545 of 63,500 in the DL2 archive + # exceed the 128-chunk / ~66 KB a caller's cap allowed). The cap still + # bounds a walk whose end is unknown. + chunk_cap = max(max_chunks, (end - start) // _BULK_COUNTER_STEP) if have_end else max_chunks # ── Step 3: chunks at +0x200, plain 32-bit addresses ───────────────── address = start + _BULK_COUNTER_STEP last = start chunks_fetched = 0 - while chunks_fetched < max_chunks: + while chunks_fetched < chunk_cap: # Stop when the next chunk would straddle the event end. if address + _BULK_COUNTER_STEP > end: log.debug( @@ -709,17 +711,27 @@ class MiniMateProtocol: else: if strict: raise ProtocolError( - f"5A reached the {max_chunks}-chunk cap at 0x{address:08X} before the " + f"5A reached the {chunk_cap}-chunk cap at 0x{address:08X} before the " f"event's end 0x{end:08X} -- the event was not kept") log.warning( "5A reached max_chunks=%d at address=0x%08X (end=0x%08X)", - max_chunks, address, end, + chunk_cap, address, end, ) # ── Step 4: TERM -- the remainder, from the next boundary ─────────── boundary = last + _BULK_COUNTER_STEP if have_end: term_length = end - boundary + if not 0 <= term_length < _BULK_COUNTER_STEP: + # Only after an early end (the legacy tolerance): what is left is not a + # tail but most of the event, and a TERM for it is no TERM at all. + if strict: + raise ProtocolError( + f"5A TERM for {key4.hex()} would read 0x{term_length:X} bytes from " + f"0x{boundary:08X}, not a tail -- the event was not kept") + log.warning("5A stream ended 0x%X bytes before the event's end; no TERM sent", + term_length) + return frames_data log.debug("5A TERM address=0x%08X length=0x%04X end=0x%08X", boundary, term_length, end) else: @@ -1466,10 +1478,10 @@ class MiniMateProtocol: def _validate_frame(frame: S3Frame, expected_sub: Optional[int]) -> None: """Validate SUB; log but do not raise on bad checksum. - S3 response checksums frequently fail SUM8 validation due to inner-frame - delimiter bytes being captured as the checksum byte. The original - s3_parser.py deliberately never validates S3 checksums for exactly this - reason. We log a warning and continue. + A reply's checksum is SUM8 of its unescaped payload (748/748, measured + 2026-10-26). `checksum_valid` is usually False only because S3FrameParser + sums its output with the `10` of each kept `10 02/03/04` pair still in it + -- the parser's doing, not the unit's. We log and continue. """ if not frame.checksum_valid: # S3 checksums frequently fail SUM8 due to inner-frame delimiter bytes diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/README.md b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md index a951a4f..0f4a2fd 100644 --- a/tests/fixtures/minimate-bench-10-26-26-blastware/README.md +++ b/tests/fixtures/minimate-bench-10-26-26-blastware/README.md @@ -9,7 +9,7 @@ to disk. Both directions, raw: | `blastware_requests.bin` | Blastware → unit (748 requests, each after a `41 03` SESSION_RESET) | 17,757 B | | `unit_replies.bin` | unit → Blastware | 364,972 B | -Events (key → end), from Blastware's 5A walks. Three cross a 64 KB page: +Events (key → end), from Blastware's 5A walks. Four cross a 64 KB page (1, 3, 5, 7): | event | start key | end (STRT) | 5A requests | |---|---|---|---| @@ -35,8 +35,18 @@ its chunks at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`). |---|---|---| | `K441LTOF.ZI0` | 0 (`01110000`) | no | | `K441LTOF.ZQ0` | 1 (`01118a2c`) | yes, into 0x12 | +| `K441LTOF.ZV0` | 2 (`011216c4`) | no | | `K441LTOG.000` | 3 (`0112a0b6`) | yes, into 0x13 | +| `K441LTOG.050` | 4 (`011329d2`) | no | +| `K441LTOG.0A0` | 5 (`0113b072`) | yes, into 0x14 | +| `K441LTOG.0L0` | 6 (`01143046`) | no | | `K441LTOG.0S0` | 7 (`0114b0b2`) | yes, into 0x15 | After the fix (887e75d), SFM's own live downloads of all 8 events were byte-identical to Blastware's files (sha256), the 4 crossings included. + +The unit's replies (measured on all 748): every 02/03/04/10 is escaped with a `10`, exactly as +in requests, and the checksum is SUM8 of the **unescaped** payload, 748/748. `S3FrameParser` +keeps the escape bytes of `10 02/03/04` in its output and sums those too, which is why its +`checksum_valid` is False on 502 of the 540 A5 replies. The "S3 checksums frequently fail" +note in `protocol._validate_frame` describes the parser, not the unit. diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZV0 b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOF.ZV0 new file mode 100644 index 0000000000000000000000000000000000000000..875e2a11da9fc110f6aa72724405d5fd630a26a0 GIT binary patch literal 35332 zcma)_e~e{kdEd_&kGl*(aSiz30dKK0m(C_j%s;J?GrJUDH0$G`F6-|J1RQr;gv#?AdPiU((!h z=Ns-^Txj=y{L}61SGV8%ndYg#-89V-|M*$$Hg}q4-tEl0Y12--ooPF7n$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Z?^VxzwodB z_zxcXACElp`SV};-(UIa*LBx7pTf4~&mZ_Re`$6E)2_f*Q(U!j-~hJq2eS^ut^*9o zz*x3_f@%0`U;Oo>?>TkztFOPVpH9E=__=crKlI>(5Af&y`+0c~pFRA@xySGrbzm{? vR#wdENBcdRgvSmXxbAuoTj{T(j&?%VRxv+wb$8AF<^PZ6%$K_E#BKi<9|Ad$ literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.0A0 b/tests/fixtures/minimate-bench-10-26-26-blastware/blastware/K441LTOG.0A0 new file mode 100644 index 0000000000000000000000000000000000000000..655687f5d66a36ef27c91fb46233bed21d30b231 GIT binary patch literal 32742 zcma)_e~hMAb>E+7J$T3Vc;}hj!I_Zh&TBIyLs+~646va~yu~&#twC1o@Iy@-9D7Ne z;&s?vP}0(d5;aW~+7vYrijqo*rXp?AA8D1g308t4>I$$c0cwS)ZEP1P82^|tkN~lF z`uTj%y)#DTkIc@#@AKo{bIYC}=Xu_DreS=~Fud-}x%0Q4Ie+@?!@*<2;fscw zZ~4(%b}x*}o39;@yztYnxOQBA?Jx`nhTRLh7lyfMZgFjxpXP_1#fiQ7fj5ut48zK_ zKJIL<4ZKX-6DJne#(}oW!?-;z4r?O^7p4Wy(SWUaj(dKA_lbUUoZE@qX*xF0h%UpT z=LTBPeXWn=xH~(G&(_0%*;fzbpj7EKpKkNhBI^_0F(8 z%%-`r22Ici`8&MNG4iu;L18t;o>;TSxjA*1R!5reEG}UZC{OCRHb%!uEIFsX%WDG` zh{F!PS!HWyaa0Qo3rg%NAD<4pR{XQ?Tr9&Quwjw?m7RetloT39(EI+b>X%?Lk2X7;nc;lT*iV4fdBp>G z1`9X<+U&2P`^dRXM#9<=%6M>R2UXKr3(`*{IkKbo*Ey}EVNJzQhq33Ut!O2U>AyIx z1z}xSn%Rz#$_w#eVR6InkB5npv9S1#s3=_216 z4{c_;P6}}_5yr8V#cABNQLtTc+~XOiLU2b;tr(ElD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ench-10-26-26-blastware/blastware/K441LTOG.0L0 new file mode 100644 index 0000000000000000000000000000000000000000..33d1d0fafe9f46effb894b7564da17706d853a9b GIT binary patch literal 32894 zcma)_e~?~hb>HtRukE$9)?UdQv!RRjwOQzrEVh7UqEZnQkf}W}361TPX`Pv>wnEi{ zOk}~(hD;z#J4wqVVcHCIS{lksCqT-Crjs8OO52Q+HbEwV6v|M`v57;CvCXb)z!;;q zpU?L^&#pYfACXq?z4y7#bDnd)=X=icYnAh@VVI6{!}c&YE^Uq5oNRex zZk!*7?M3R%4XeY-I7dawhEu;`Rg2@W6#dHz^j{q&i)9B|ce@ur!4?bS0_J0r_6%4-du^V? zg84M&($5Y#%8^JtsJ;c(gBWQ9_5~936KHr|7js9jmU6i4W&C;PEyMqWdy_qb{!=Hk zSrRk!1od$n@woEulD46vfG2w%|w|Iu@kh}-nzDl(Ob3{D61 zE^hcaj>}R_aT=<8dV=hr0y@Z5tNG|O9Tx;*bu3FBx^1`*CThv~*>}b{L@$KF^@-*v zhv(21Y(NM$%WJw3C;6r4$}801jtnE5TB|j#tg(r{YN2-^2No2{Fb`GJMmV`@2Q>4d z@dWAdd5~?|%VMI6a=P28xuHd6&%gTP$vn*46B?=mcuJpWZsu7Smj~FTCd1-&VGO0F zLAAjzTwy0K6Co()!#rmEr@azjf_omW7&FeOa=;iFbeI=!$6GiC3zdG%CnR8_f4*axgarnYW9@! zgCUHJLZX|*&z;Itpqre)A}kTJ zc}&eQ8CM=z3)Rz)MjC_O#3~T-tZ?X2VHQJg?TjslVIJp)5A7CTt~mf>$VrKi!W)e1U2rgP#RKldsQi= z&Ad^RdhLj*!P;1}+#o>TvB6_erf6xXm zCP$#ZT67f9MQbRLbMz5ZwbUp9llaA0MVt77F`d-m2#*GoVia|_FZ|O)jPhpd3$~Xitj>x8pLGZY;w*|MLo$)mEi_Yu7Blg=IU&@`R6?(*czhtX>W-{sqRf`aC@%fZvB^Lj%_S3m zdz_nH2dfuKvB;;ha6n9Gg+sX%AZyl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>p;He{M(<6SBHJe-_wrIM#kOz=Q5wtJ%4P^M+waPxv}SYpB}Dy$uRrIut4n(4o?u+o0fn0{|r}c4zq6!^ZX|jfBPZ~ z+OIWxUT}K2`-oWZpS=&)P9C9Xm^^RtykTLwLYMD)_j~UC>bcK+;r<66c<}!|^zfsP zZ9V?P*T4C#Z}We(-hbtE^Wuvyoxkkzy$cIh?Ay0*k+ESM_wWAUVsUYiJ69|$?A^Qf z^2_Hho1edQyyY!FdCRevTyypQVR3f;(MQjnyXWjZXYakoKj-*!-+hlg_So0%pUoDx z%r-|RlL>?LFq!P1?B9Pi(z(pF{A_zB|KYcWdtY8w{4guVXT^#eCpQv{l{FR*%?-0* z_{7gnm;dRz{_DeEyytWG-gn>q5B|kNUw!mzTmSFtPk!sEr(@CKi!Z^V7__J$bO? zIQFV*uAVF|e(kYy=kC4d?AcH7=i?ve<19YA_r7zF;xX3fv#nwOe(^p$*`rB#?7)Gm kuK}_BldIj!5W4ma> 16 != int(k, 16) >> 16] + assert crossing == ["01118a2c", "0112a0b6", "0113b072", "0114b0b2"] + + +@pytest.mark.parametrize("key", [k for k, _ in EVENTS]) def test_the_walk_sends_exactly_blastwares_requests_and_the_event_is_whole(key): t = ByAddress() frames = mp.MiniMateProtocol(t).read_bulk_waveform_stream( @@ -155,8 +168,7 @@ def test_the_walk_sends_exactly_blastwares_requests_and_the_event_is_whole(key): assert len({len(dec[c]) for c in ("Tran", "Vert", "Long")}) == 1 -@pytest.mark.parametrize("key,bw", [("01110000", "K441LTOF.ZI0"), ("01118a2c", "K441LTOF.ZQ0"), - ("0112a0b6", "K441LTOG.000"), ("0114b0b2", "K441LTOG.0S0")]) +@pytest.mark.parametrize("key,bw", EVENTS) def test_the_file_built_from_the_walk_is_blastwares_own(key, bw, tmp_path): frames = mp.MiniMateProtocol(ByAddress()).read_bulk_waveform_stream( bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, strict=True) @@ -165,3 +177,111 @@ def test_the_file_built_from_the_walk_is_blastwares_own(key, bw, tmp_path): path = tmp_path / bw write_blastware_file(ev, frames, path) assert path.read_bytes() == (FIX / "blastware" / bw).read_bytes() + + +# -- the requests BE9441 answered after the escape fix --------------------------- + +def test_the_compliance_reads_be9441_answered_with_the_escaped_0x04(): + # SUB 1A frames B and C are the only fixed requests whose bytes the fix changed + # (their 0x0400 length went out bare). These exact frames got full replies, + # 2,125 bytes, decoded correctly (bench 2026-10-26 14:38:43). + assert build_bw_frame(0x1A, 0x0400, bytes(7) + b"\x64\x00\x00").hex() == \ + "41021010001a00100400000000000000006400009203" + assert build_bw_frame(0x1A, 0x0400, bytes([0, 0, 4, 0, 0, 0, 0, 0x64, 0, 0])).hex() == \ + "41021010001a0010040000001004000000006400009603" + + +# -- synthetic replies: the unit's own encoding, with a chosen STRT end ---------- + +def _escape(b: bytes) -> bytes: + """The unit's encoding (measured on 748 replies): 10 before 02, 03, 04 and 10.""" + return b"".join(bytes([0x10, x]) if x in (0x02, 0x03, 0x04, 0x10) else bytes([x]) for x in b) + + +def _parse(wire: bytes): + frames = S3FrameParser().feed(wire) + assert len(frames) == 1 + return frames[0] + + +def _logical(reply: bytes) -> bytes: + """A recorded reply's payload, unescaped and without its checksum. Each + recorded reply opens with the unit's `41 03 41` before its `10 02`.""" + return _unstuff(reply[reply.index(b"\x10\x02") + 2:-1])[:-1] + + +def first_reply_ending_at(end: int, event: int = 1) -> bytes: + """A recorded first-chunk reply with STRT's end key set to `end`, re-encoded.""" + q = FIVE_A.index(blastware_walk(int(EVENTS[event][0], 16))[0]) + payload = bytearray(_logical(unit_a5_replies()[q])) + i = payload.find(b"STRT") + payload[i + 6:i + 10] = end.to_bytes(4, "big") + return b"\x10\x02" + _escape(bytes(payload) + bytes([sum(payload) & 0xFF])) + b"\x03" + + +def test_the_reply_encoder_is_the_units(): + q = FIVE_A.index(blastware_walk(0x01118a2c)[0]) + recorded = unit_a5_replies()[q] + payload = _logical(recorded) + i = payload.find(b"STRT") + end = int.from_bytes(payload[i + 6:i + 10], "big") + assert _parse(first_reply_ending_at(end)).data == _parse(recorded).data + + +def test_an_end_key_holding_escaped_bytes_reads_whole(): + # None of the 8 recorded end keys holds a 02/03/04/10; this one holds 03 and 10. + data = _parse(first_reply_ending_at(0x01120310)).data + assert parse_strt_end_key(data) == 0x01120310 + assert parse_strt_end_offset(data) != 0x0310 # the old reader's misread + + +class Synthetic: + """Answers the first 5A request with `first`, each chunk with a recorded chunk + reply and the TERM with a recorded TERM reply; records (address, length).""" + + def __init__(self, first: bytes): + replies = unit_a5_replies() + walk = blastware_walk(0x01118a2c) + self.first, self.sent, self._buf = first, [], b"" + self.chunk = replies[FIVE_A.index(walk[1])] + self.term = replies[FIVE_A.index(walk[-1])] + + def write(self, data): + a, n = addr_len(bytes(data)) + self.sent.append((a, n)) + self._buf += self.first if len(self.sent) == 1 else (self.chunk if n == 0x200 else self.term) + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +def walk(first: bytes, start: int = 0x01118a2c, **kw): + t = Synthetic(first) + frames = mp.MiniMateProtocol(t).read_bulk_waveform_stream( + start.to_bytes(4, "big"), stop_after_metadata=False, include_terminator=True, **kw) + return t.sent, frames + + +def test_the_walk_ends_on_an_escaped_end_key(): + sent, _ = walk(first_reply_ending_at(0x01120310), strict=True) + # chunks step from the start (...8a2c), so the TERM is at 0x0112022C for 0xE4 + assert sent[-1] == (0x0112022C, 0x01120310 - 0x0112022C) # TERM: the tail, exactly + + +def test_a_large_event_walks_whole_past_the_callers_cap(): + # 2,545 of 63,500 archived histograms exceed the ~66 KB a 128-chunk cap allowed. + start, end = 0x01118a2c, 0x01118a2c + 300_000 + sent, frames = walk(first_reply_ending_at(end), start, strict=True, max_chunks=128) + n = (end - start) // 0x200 + assert sent[:-1] == [(start + 0x200 * k, 0x200) for k in range(n)] + assert sent[-1] == (start + 0x200 * n, (end - start) % 0x200) + assert len(frames) == len(sent) + + +@pytest.mark.parametrize("strict", [True, False]) +@pytest.mark.parametrize("size,why", [(0x100, "less than one 0x200 chunk"), + (0x500000, "more than any unit holds")]) +def test_a_misread_strt_is_refused_in_both_modes(size, why, strict): + with pytest.raises(mp.ProtocolError, match=why): + walk(first_reply_ending_at(0x01118a2c + size), strict=strict) diff --git a/tests/test_5a_checksum_escape.py b/tests/test_5a_checksum_escape.py index 9c4ec74..e8241e8 100644 --- a/tests/test_5a_checksum_escape.py +++ b/tests/test_5a_checksum_escape.py @@ -17,14 +17,12 @@ import pytest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from minimateplus.framing import build_5a_frame, bulk_waveform_params # noqa: E402 - -KEY = bytes.fromhex("01122f06") -CHUNK_OFFSET = 0x1002 +from minimateplus.framing import build_5a_request # noqa: E402 def chunk(counter: int) -> str: - return build_5a_frame(CHUNK_OFFSET, bulk_waveform_params(KEY, counter)).hex() + # Event 01122f06's chunk reads, length 0x0200 (once read as an "offset 0x1002") + return build_5a_request(0x01120000 + counter, 0x0200).hex() @pytest.mark.parametrize("counter,wire", [ diff --git a/tests/test_minimate_5a_strict.py b/tests/test_minimate_5a_strict.py index 4151a22..107ff0b 100644 --- a/tests/test_minimate_5a_strict.py +++ b/tests/test_minimate_5a_strict.py @@ -84,9 +84,17 @@ def test_strict_raises_on_a_terminator_mid_stream(): stream(r, strict=True) -def test_strict_raises_at_the_chunk_cap(): - with pytest.raises(mp.ProtocolError, match="chunk cap"): - stream(a5_replies(), max_chunks=5, strict=True) +def test_a_known_end_is_not_cut_short_by_the_callers_chunk_cap(): + # STRT bounds the walk; a cap (client.py passes 128) once cut every event past + # ~66 KB short -- a large histogram, say. It now bounds only a walk with no end. + assert len(stream(a5_replies(), max_chunks=5, strict=True)) == 51 + + +def test_the_cap_still_bounds_a_legacy_walk_with_no_strt(): + r = a5_replies() + r[0] = r[0].replace(b"STRT", b"XXXX") + frames = stream(r, max_chunks=5) + assert len(frames) == 1 + 5 + 1 # first chunk, 5 capped chunks, TERM def test_strict_raises_when_the_probe_has_no_strt(): @@ -114,3 +122,13 @@ def test_strict_refuses_a_strt_whose_end_is_not_after_its_start(): p.read_bulk_waveform_stream(KEY, stop_after_metadata=False, include_terminator=True, strict=True) assert p._transport.sent == 1 # the first chunk, and nothing after + + +def test_the_legacy_walk_sends_no_term_for_most_of_an_event(): + # After an early end, the "remainder" is most of the event, not a tail; a TERM + # for it once asked for kilobytes (or, past 64 KB, raised a bare ValueError). + t = Replay(a5_replies(), silent_from=40) + frames = mp.MiniMateProtocol(t).read_bulk_waveform_stream( + KEY, stop_after_metadata=False, include_terminator=True) + assert len(frames) == 40 + assert t.sent == 41 # 40 answered, the one met by silence, and no TERM -- 2.54.1 From d9904664076886dce2065eb3533b6d518cfd6449 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 18:53:11 -0400 Subject: [PATCH 107/223] fix(minimateplus): the 0x1C status reads a histogram run as monitoring, and unescapes before counting from the end Measured on BE9441 tonight, through the recording bridge: - Monitoring flag 0x0B while recording a histogram (confirmed at the unit), 0x00 idle. Only 0x10 had been measured as monitoring (BE11529, 2026-04-08), so the status showed 'not monitoring' and the change path refused the state as unknown(0x0B) -- refused, not skipped, which is the design working. 0x0B joins S3_RUN_STATES and S3_MONITORING_FLAGS as measured. The shared status's 'monitoring' now follows the change path's reading: None for an unmeasured flag, never a guessed False. - Free memory 0x000D0E04 arrived as 0d 0e 10 04. The parser keeps the 10 of a 10 02/03/04 escape, so every field counted from the end read one byte off: 419.84 V and 251,655,168 bytes for 6.76 V and 983,028. New framing.unescape_reply() (also used by parse_strt_end_key) runs first. Tests: the two recorded replies (idle 16:24, monitoring 18:47) decode to the unit's own values; each escaped value in the last ten bytes decodes; the status mapping for 00 / 10 / 0B / unmeasured. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 17 +++++++- minimateplus/framing.py | 31 ++++++++----- sfm/device_access/s3.py | 10 +++-- tests/test_device_access_change.py | 9 +++- tests/test_minimate_monitor_status.py | 63 +++++++++++++++++++++++++++ 5 files changed, 114 insertions(+), 16 deletions(-) create mode 100644 tests/test_minimate_monitor_status.py diff --git a/minimateplus/client.py b/minimateplus/client.py index 5f74588..2cf70e6 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -34,7 +34,7 @@ import re import struct from typing import Optional -from .framing import S3Frame +from .framing import S3Frame, unescape_reply from .models import ( CallHomeConfig, ComplianceConfig, @@ -60,6 +60,11 @@ from .transport import SerialTransport, BaseTransport log = logging.getLogger(__name__) +# SUB 0x1C state-flag values measured while a unit was monitoring: 0x10 (BE11529, +# 2026-04-08, 98 frames) and 0x0B (BE9441 recording a histogram, 2026-10-26). +# Idle is 0x00 on both. +S3_MONITORING_FLAGS = frozenset({0x10, 0x0B}) + # ── Module-level constants ──────────────────────────────────────────────────── # Trigger config payload hardcoded from 3-11-26 BW TX capture (BW frame 108). @@ -2682,6 +2687,10 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus: mem_total 0x000EFFF2 = 983026 bytes ≈ 960 KB mem_free 0x000E9E52 = 958034 bytes ≈ 935 KB """ + # Unescape first (2026-10-26): BE9441's free memory 0x000D0E04 arrived as + # `0d 0e 10 04`, and with the parser's kept 10 every field counted from the + # end read one byte off -- 419.84 V and 251,655,168 bytes for 6.76 V and 983,028. + data = unescape_reply(data) # The data section starts at offset 11 (after the S3 section header). section = data[11:] if len(data) > 11 else data @@ -2694,7 +2703,11 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus: # Confirmed from byte diff of all 144 0xE3 data frames in 4-8-26/2ndtry capture: # section[1] = 0x00 in all IDLE frames, 0x10 in all MONITORING frames. # (section[6] also changes but has non-binary values 0xea/0x07 — device-specific.) - is_monitoring = len(section) > 1 and section[1] == 0x10 + # + # 2026-10-26: 0x0B on BE9441 recording a HISTOGRAM (confirmed at the unit); + # 0x00 on the same unit idle. Only measured values count as monitoring -- + # sfm.device_access.s3.S3_RUN_STATES refuses any other for a change. + is_monitoring = len(section) > 1 and section[1] in S3_MONITORING_FLAGS # The same byte, raw -- but only from a real section: for data of 11 bytes # or fewer, `section` above falls back to the header itself. state_flag = data[12] if len(data) > 12 else None diff --git a/minimateplus/framing.py b/minimateplus/framing.py index 8795a77..5a29e21 100644 --- a/minimateplus/framing.py +++ b/minimateplus/framing.py @@ -600,20 +600,31 @@ def bulk_waveform_term_v2( STRT_MARKER = b"STRT" +def unescape_reply(data: bytes) -> bytes: + """A reply's data with each kept escape removed: `10 02/03/04` → `02/03/04`. + + The unit escapes 02, 03, 04 and 10 in its replies exactly as requests do + (748/748 replies, 2026-10-26). S3FrameParser collapses `10 10` but keeps the + `10` of `10 02/03/04` (inner-frame markers to it), so its `.data` carries an + extra byte before each 02/03/04 value -- harmless for fields read before the + escape, one byte off for any read after it, or counted from the end.""" + out, i = bytearray(), 0 + while i < len(data): + if data[i] == DLE and i + 1 < len(data) and data[i + 1] in (STX, ETX, 0x04): + i += 1 + continue + out.append(data[i]) + i += 1 + return bytes(out) + + def parse_strt_end_key(a5_data: bytes) -> Optional[int]: """The event's FULL 32-bit end key from the STRT record in an A5 reply's data, or None. The page byte is part of it: an event that ends in the next 64 KB page reads e.g. 0x011216C4 here, where `parse_strt_end_offset` gave - 0x16C4. Read after removing the reply's inner DLE pairs (10 02 / 10 03 / - 10 04 → 02 / 03 / 04), which the parser keeps as two bytes.""" - out, i = bytearray(), 0 - while i < len(a5_data): - if a5_data[i] == DLE and i + 1 < len(a5_data) and a5_data[i + 1] in (STX, ETX, 0x04): - i += 1 - continue - out.append(a5_data[i]) - i += 1 - pos = bytes(out).find(STRT_MARKER) + 0x16C4. Read after `unescape_reply`.""" + out = unescape_reply(a5_data) + pos = out.find(STRT_MARKER) if pos < 0 or pos + 10 > len(out): return None return int.from_bytes(out[pos + 6:pos + 10], "big") diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index e84c49e..c9e13cc 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -27,8 +27,10 @@ S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "H S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use -# The 0x1C flag byte (section[1]): the only two values ever measured. -S3_RUN_STATES = {0x00: "idle", 0x10: "monitoring"} +# The 0x1C flag byte (section[1]): the only values ever measured. 0x10 is +# BE11529 monitoring (2026-04-08); 0x0B is BE9441 recording a histogram, +# confirmed at the unit (2026-10-26). Anything else is refused for a change. +S3_RUN_STATES = {0x00: "idle", 0x10: "monitoring", 0x0B: "monitoring"} def s3_run_state(status: Any) -> str: @@ -263,8 +265,10 @@ class Series3Adapter: def op(client: Any) -> UnitStatus: client.poll() ms = client.get_monitor_status() + # The change path's reading, not a guess: an unmeasured flag is None. + monitoring = {"monitoring": True, "idle": False}.get(s3_run_state(ms)) return UnitStatus( - serial=serial, series=3, monitoring=ms.is_monitoring, + serial=serial, series=3, monitoring=monitoring, battery_volts=round(ms.battery_v, 2) if ms.battery_v is not None else None, memory_total_bytes=ms.memory_total, memory_free_bytes=ms.memory_free, device_time=None, event_count=None, diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 56b32d9..2d245b6 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -686,10 +686,17 @@ def test_series3_state_names_come_from_the_raw_flag(flag, state): assert r.state_before == state +@pytest.mark.parametrize("flag,monitoring", [(0x00, False), (0x10, True), (0x0B, True), (0x07, None)]) +def test_series3_status_shows_the_change_paths_reading(flag, monitoring): + # 0x0B: BE9441 recording a histogram (2026-10-26) once showed "not monitoring" + st = access3(FakeMiniMateClient(monitor_states=[flag])).status(TCP3, "BE18193") + assert st.monitoring is monitoring + + def test_series3_monitor_status_decode_keeps_the_raw_flag(): from minimateplus.client import _decode_monitor_status tail = bytes.fromhex("02a8000effc0000e9e52") # battery + memory: the last 10 bytes - for flag, monitoring in ((0x00, False), (0x10, True), (0x07, False)): + for flag, monitoring in ((0x00, False), (0x10, True), (0x0B, True), (0x07, False)): st = _decode_monitor_status(bytes(11) + bytes([0x00, flag]) + bytes(34) + tail) assert (st.state_flag, st.is_monitoring) == (flag, monitoring) assert _decode_monitor_status(bytes(12)).state_flag is None # no section[1] diff --git a/tests/test_minimate_monitor_status.py b/tests/test_minimate_monitor_status.py new file mode 100644 index 0000000..bd96677 --- /dev/null +++ b/tests/test_minimate_monitor_status.py @@ -0,0 +1,63 @@ +"""SUB 0x1C monitor status, decoded from BE9441's own replies (2026-10-26). + +Recorded by the bridge (bridges/captures/10-26-26 - BE9441 blastware histogram/): + +* 16:24:54, idle, before the histogram run: flag 0x00. +* 18:47:41, during a histogram run Brian confirmed at the unit: flag **0x0B**. Only + 0x10 had ever been measured as "monitoring" (BE11529, 2026-04-08), so the status + read "not monitoring" and the change path refused the state as unknown. +* The same 18:47 reply's free memory, 0x000D0E04, holds a 04. The unit escapes it + (10 04) and the parser keeps both bytes, so the fields counted from the end came + out one byte off: 419.84 V and 251,655,168 bytes, against 6.76 V and 983,028. +""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from minimateplus.client import _decode_monitor_status # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 +from sfm.device_access.s3 import s3_run_state # noqa: E402 + +IDLE_1624 = bytes.fromhex( + "1002001010e300002c0000000000000000000000001a0a07ea0010101836000000000000010107cb00070000010107cb0013000000001002a4000efff4000e0de4fa03") +MONITORING_1847 = bytes.fromhex( + "1002001010e300002c00000000000000000000000b1a0a07ea00122f29000000000000010107cb00070000010107cb0013000000001002a4000efff4000d0e10043103") + + +def _status(wire: bytes): + frames = S3FrameParser().feed(wire) + assert len(frames) == 1 and frames[0].sub == 0xE3 + return _decode_monitor_status(frames[0].data) + + +def test_idle_reply(): + st = _status(IDLE_1624) + assert (st.state_flag, st.is_monitoring, s3_run_state(st)) == (0x00, False, "idle") + assert (st.battery_v, st.memory_total, st.memory_free) == (6.76, 983028, 921060) + + +def test_a_histogram_run_reads_monitoring(): + st = _status(MONITORING_1847) + assert (st.state_flag, st.is_monitoring, s3_run_state(st)) == (0x0B, True, "monitoring") + + +def test_an_escaped_byte_in_the_memory_field_does_not_shift_the_fields(): + st = _status(MONITORING_1847) + assert (st.battery_v, st.memory_total, st.memory_free) == (6.76, 983028, 855556) + + +@pytest.mark.parametrize("value", [0x02, 0x03, 0x04, 0x10]) +def test_every_escaped_value_in_the_last_ten_bytes_decodes(value): + # free memory ending in each escaped value, encoded as the unit does + st0 = _status(IDLE_1624) + # the reply's last data byte (free memory's low byte, 0xE4) swapped for `value` + assert IDLE_1624[-3] == 0xE4 + frames = S3FrameParser().feed(IDLE_1624[:-3] + bytes([0x10, value]) + IDLE_1624[-2:]) + st = _decode_monitor_status(frames[0].data) + assert st.memory_free == (st0.memory_free & ~0xFF) | value + assert (st.battery_v, st.memory_total) == (6.76, 983028) -- 2.54.1 From 258a6e214383cef8f0aefa562aefa4dd9762889a Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 19:09:48 -0400 Subject: [PATCH 108/223] test(minimateplus): a 71 KB histogram past the old 128-chunk cap walks as Blastware's and rebuilds its file Tonight's bridge recording of BE9441 (16:08-19:06) as a fixture, with Blastware's files: Blastware's and SFM's requests in order (1,596, 722 of them 5A, 722 A5 replies), two Blastware config writes, SFM's stop, and three events. Event 2 is a 4,096-sps, 2 s histogram of 71,088 bytes -- 139 requests, two 64 KB crossings. Measured live the same evening (SFM through the bridge, read-only downloads): SFM's files for events 1 and 2 are byte-identical to Blastware's (sha256), the 71 KB histogram included -- the first event past the old cap downloaded from a unit. Event 0, the mic-off histogram, was refused ('decodes as neither'), as expected on this branch: its decoder fix (#47) is on dev. The test, fed the recorded replies with max_chunks=128: SFM's walks send exactly Blastware's 139 and 118 requests and rebuild both files byte for byte. Reverting the STRT-sized cap (8acb951) fails it. No code change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../README.md | 34 + .../blastware/K441LTOK.QZ0 | Bin 0 -> 1714 bytes .../blastware/K441LTOK.R10 | Bin 0 -> 60290 bytes .../blastware/K441LTOK_QZ0_ASCII.TXT | 72 + .../blastware/K441LTON.900 | Bin 0 -> 71106 bytes .../blastware/K441LTON900_ASCII.TXT | 3456 +++++++++++++++++ .../requests.bin | Bin 0 -> 42023 bytes .../unit_replies.bin | Bin 0 -> 543559 bytes tests/test_5a_blastware_walk_histogram.py | 124 + 9 files changed, 3686 insertions(+) create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/README.md create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.QZ0 create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.R10 create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK_QZ0_ASCII.TXT create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTON.900 create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTON900_ASCII.TXT create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/requests.bin create mode 100644 tests/fixtures/minimate-bench-10-26-26-histogram/unit_replies.bin create mode 100644 tests/test_5a_blastware_walk_histogram.py diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/README.md b/tests/fixtures/minimate-bench-10-26-26-histogram/README.md new file mode 100644 index 0000000..99b2e61 --- /dev/null +++ b/tests/fixtures/minimate-bench-10-26-26-histogram/README.md @@ -0,0 +1,34 @@ +# BE9441 through the recording bridge, 16:08–19:06 on 2026-10-26 + +BE9441 (S338.17) on the dev box's serial port, shared on TCP by `bridges/mm_link.py`. +Both Blastware and SFM connected through it, so `requests.bin` holds both clients' +requests in order and `unit_replies.bin` everything the unit sent: 1,596 requests, +722 of them 5A, matched by 722 A5 replies. + +What happened, in order: + +| time | who | what | +|---|---|---| +| 16:10–16:15 | Blastware | listed and downloaded events 0 and 1 (below); a cancelled re-read of event 1 | +| 16:26:10 | Blastware | **config write**: Histogram mode, 15-minute interval, mic enabled (13 frames) | +| 16:27:21 | Blastware | **config write**: interval back to 2 s (13 frames; 2 image bytes differ) | +| 17:00 | keypad | histogram monitoring started | +| 18:47–18:53 | SFM | status reads; the flag read 0x0B (monitoring, histogram) | +| 18:53:53 | SFM | **stop** (0x97): acked 0x68, read back idle; audit c9c17128 | +| 18:55–19:00 | Blastware | downloaded event 2 (a cancelled partial walk, then the full one) | +| 19:03–19:06 | SFM | downloaded events 1 and 2 by serial, byte-identical to `blastware/` | + +Events (Blastware's files in `blastware/`): + +| event | key → end | what | file | +|---|---|---|---| +| 0 | `01110000` → `011106A0` | histogram, 2 s, **mic off**, 22 intervals (1,696 B) | `K441LTOK.QZ0` (+ ASCII) | +| 1 | `011106A0` → `0111F210` | waveform, 60,272 B | `K441LTOK.R10` | +| 2 | `0111F210` → `011307C0` | histogram, 2 s, mic on, 4,096 sps, 3,398 intervals, **71,088 B: 139 requests, two 64 KB crossings** | `K441LTON.900` (+ ASCII) | + +Measured from this recording: +- every request, write frames included, follows the uniform escape model (#46); +- the config image's layout matches Series 4's `0x1A` (#48); +- the mic-off histogram format (#47); +- the old histogram reader misreads 87/3,398 of event 2's intervals at 4,096 sps (#49); +- the 0x1C flag 0x0B and the escaped-memory-field decode (`d990466`). diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.QZ0 b/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.QZ0 new file mode 100644 index 0000000000000000000000000000000000000000..1b5c86ec4e7815a4cdfb13492e2a50b4b44dadc0 GIT binary patch literal 1714 zcma)+Urbw79LK+>E%f$Mde3bc62x%}nF5irLg#b}V;dwuU?H^Z(b$v=c44M@7Fc}hpa8oU!3QV9F z{Z!jvhll!&u-)?jE(B0V7Ej_4>;wG!(2Q18paBok7vy^KYk>pLP+Lj?HN~kiCC<2O|DI_w(<*ecMLZ z+wbwA4Q|f~zyDs3S$1OHg$p$b2VjS*#A`}YZ zVAKG!y-Vxt29z@g$ALrC5$#U(K)9vl@j!4t5ZoKs-;83}dFwA_$#JJ5?QGE(H{yNK zw667!j-|H!T4Xdh0EYxC8`k)tbJW=3q_g2{&2+xldg0hS7}%u(CaR<`ovWc}a!4D{ zV~ONY+!)cqdV1_+Af>0#pG+LrW9b8k=&AIe5l=UYuqP-ij*P~2!ScT5*E}NY>hz;$R-rfLOYrmG`M!?E_6D6hlC4}fu zvSWHOeg9r_rx9u(uik_)a{pe}&ZDk~F2UwXC8-KtT)WjecUiXtbO-O2bE7D4hWVwq zU*ynAhf**~{5h1jz-*`6C9DI$LlOGgJ@FyRLolyn5B2QgmR8c5a6H_F&z};xAW$^2 zRUtX6XLa1ID20M)YE>}t*{iR=_35qL7gulGnE&?X!oux*;iq3#?yRnH$DBa_|rDs>gEC>~E~soU)?k!6?5B}qJTYIrbwq^5>*#WeG?OH0$! z+3e)h)Kqpdo6Y8?bGg~&<-D0!6xt;ZF|Mk9)$djP)?1}MIA;u;m?g4N+QrSq`kS~y z$q+m}sI_@5o*vf29h}oT4u-uBm<*qcYZWiQ_R-?Z^p)J)?EH7%|F|fqR(@OkeT_?V z-p&y%-%L$i zyqGzAHj|;>WM(Qmot+U_o2E&7=_=4RX>DdD%ufOQHIy#Gq^r9jt@93qV1!n1Bp1y>j~Fh3nH-bF;*B^M}RT%f$5Sowaqr)NzWK7BP`(6meTCl1i3bPN$Q literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.R10 b/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTOK.R10 new file mode 100644 index 0000000000000000000000000000000000000000..186958bee47de07031a6b06decaff00e895a679c GIT binary patch literal 60290 zcmZ6U4UlDNS>MkY8n<_8=bqc!uAQ}+zCC+|2AiGUnE^*#b&v%XSyPLyA1N&*DL`US zNJ$k$;%B8w6QikwScw{uSXLB2&_tq1N|X4N7+HuIMMK%XV#UiNL@{>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7=P8>(PU zPoah*wKXi_e3a3(x{ZEgL>8yg#2yTAR8$SjD<;#sW|di}lz)u(CxKro1T4IBa@jF2O|aO4r}!Z|es zgMonG?{Cx);Kiq6M%dY@$<#nJieVUGC04e#%jHsOsaPzQmP)0PTXx-*ot@pvE^fJ^ zf9Z%Ufq)ck;pR5^%0VvBrR8mQ_+X@|&2zc?0bN03FwY3J*M%j|h%$m6D!rCM-5#na z^u@e*(VPTW(epMqOiuhDnU-dCx!u3b_MDudNoqfL^Dr~sz7&t2TO zUcTzCfa%6Bn_D|z`s1%VcbRGMESR)Le=xu*NhYAQRI$JWxlrQ+tss@A`n+Cm=>4fl zJsE9AjFfxZ?s8Qo2nC=LfR200 0.010 >200 0.010 >200 0.015 +16:06:43 0.230 26 0.400 17.4 0.195 19.3 0.461 +16:06:45 0.250 16.8 0.120 24 0.135 20 0.255 +16:06:47 0.015 20 0.020 10.7 0.015 39 0.022 +16:06:49 0.235 33 1.080 22 0.165 20 1.083 +16:06:51 0.015 19.7 0.040 19.0 0.020 25 0.043 +16:06:53 0.085 4.3 0.140 3.0 0.115 3.4 0.185 +16:06:55 0.045 2.9 0.140 2.9 0.120 2.8 0.181 +16:06:57 0.015 31 0.010 >200 0.010 >200 0.015 +16:06:59 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:01 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:03 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:05 0.015 114 0.010 >200 0.010 >200 0.016 +16:07:07 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:09 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:11 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:13 0.045 4.0 0.055 3.4 0.055 5.7 0.066 +16:07:15 0.055 5.0 0.070 3.0 0.075 2.2 0.111 +16:07:17 0.010 >200 0.010 >200 0.010 >200 0.015 +16:07:19 0.010 >200 0.010 >200 0.010 >200 0.015 diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTON.900 b/tests/fixtures/minimate-bench-10-26-26-histogram/blastware/K441LTON.900 new file mode 100644 index 0000000000000000000000000000000000000000..28c73b68a5a644d99b16842e00e366e08b8107e3 GIT binary patch literal 71106 zcmagH2b>+%k?(&8&5R@i!XgNeEkH9uSpr2wkPIRxfdG?55=rEovq&PC93)JVLUsnUfRb>t~$9dlBv|M=G0{aX9(x6gk6{eL^w>Hk*8;O++=U%c8;Uuf~K;|s0M z*1rgzY4vMeC>SZ^FkRo;>TWI6abasUeOj&Qx_5-&i-LZE8?3WV!CK|obc4z{e7J7n z)@a~5TPxLe6TuEaw}H6*q}AQAx{iM?yj!hlI$kW;PEhsRzxCDDz}8Wc@g%kFC;85A zb+zu$^)Gb%aqyej>fic6@R{)cOH{q0J51-x1uI4ObRS)J>!+f7T=<^^?l4_1YYk{E zk}OXM*P*s^b$*)Ky&_(_2i-=xzFzR5?tMRSW5nlm;cgM`vA~Vf`4z(5pti^KwH+YY zzR-G4eZ3R72X%d~`h7*Tp9Jn0wY^){=;89f4Hxbr_4C)le-OA?x<6FcCzQUd`<`;I zpD1k&Y-u}S%g^KLHcGlLw9#Sn!8P0S|5q4(^m z8%JAwHgV1QLrd&f^^tU|(!si)qpNGW(rI00>;=`@4O#lNwifOb!OjKGIQq#O`?c!2 zqAeeA))#$rb(}5__>JJBXuGvM?k@T9+rqsg%3&JsJRN5W_}mb5YwP?=(&&*ojtSgQ zUEiv9`{_78aKm+dyLjFt+-ZTE_RyQ*W2==ocBN>Rh!5i!uKtK)M++{{^%;VVg&U%| zwp_8}G4c9$;dT&Cv99Cyx<0)%pkusn8wxj9bVq9R#|wW#^mn=L9V0kEJZ}u#hPvj{ z^jZ2h-t(lT`O?+;o!|3-_>aTSOm2b@zvYH-*0|a8t$mhwA6oI{s_m7~317 zJ4tj`25y3`|4Vew>iAEAJ5cA33AaM@_XKW^+FaA>>_D4m3)d-`hw7XhwVz<5aOfF7 z#>e*2aZ0pZuiWd`TEAT99PLyN=xn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b9D71CQPkz7U zt=r2{Z*wHye^R;!5-4J02frtcURDQI1Pg0D%KXQns zX2MP(0MUuWX~=Lnf8FA7@7?lA7i7e#0QE@8Nj$hq8N+vPJJcyQxkhAZDp)B40-TWG zbU_b~GdF9O$Gz*-RUMk|T4y404>F__1J1cZYdrq@_8nhqzLPn_RWSANqhlBnUMt@3 zaqk>9p400 +17:00:42 0.015 21.3 0.015 128 0.015 >400 0.021 0.000 87.96 >400 +17:00:44 0.015 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:00:46 0.010 >400 0.015 54 0.010 >400 0.019 0.000 87.96 >400 +17:00:48 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:00:50 0.020 10.8 0.015 64 0.015 30.1 0.024 0.000 87.96 >400 +17:00:52 0.020 9.5 0.030 7.7 0.020 8.5 0.036 0.000 91.48 >400 +17:00:54 0.015 16.4 0.015 31.5 0.015 >400 0.021 0.000 87.96 >400 +17:00:56 0.035 24.1 0.045 20.9 0.030 19.0 0.055 0.000 87.96 >400 +17:00:58 0.025 13.7 0.030 9.3 0.025 9.5 0.039 0.000 87.96 >400 +17:01:00 0.035 10.1 0.035 9.6 0.030 8.4 0.048 0.000 91.48 59 +17:01:02 0.030 12.5 0.030 10.8 0.025 11.7 0.039 0.000 87.96 >400 +17:01:04 0.030 9.4 0.035 12.0 0.030 9.5 0.048 0.000 87.96 >400 +17:01:06 0.035 12.6 0.040 14.9 0.020 12.0 0.045 0.000 87.96 >400 +17:01:08 0.020 18.3 0.025 11.1 0.015 27.3 0.027 0.000 87.96 >400 +17:01:10 0.025 14.7 0.025 10.0 0.020 9.8 0.032 0.000 87.96 >400 +17:01:12 0.030 11.0 0.025 14.1 0.020 12.1 0.033 0.000 87.96 >400 +17:01:14 0.020 15.8 0.025 14.6 0.015 20.3 0.027 0.000 87.96 >400 +17:01:16 0.040 9.6 0.050 10.3 0.035 10.4 0.063 0.000 87.96 >400 +17:01:18 0.050 13.0 0.040 11.1 0.025 9.9 0.050 0.000 87.96 >400 +17:01:20 0.020 13.5 0.025 16.4 0.015 15.9 0.029 0.000 87.96 >400 +17:01:22 0.020 16.5 0.030 9.0 0.025 10.1 0.039 0.000 87.96 >400 +17:01:24 0.015 79 0.025 19.3 0.020 15.8 0.029 0.000 87.96 >400 +17:01:26 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:01:28 0.010 >400 0.015 128 0.010 >400 0.017 0.000 87.96 >400 +17:01:30 0.010 >400 0.015 171 0.010 >400 0.017 0.000 87.96 >400 +17:01:32 0.010 >400 0.015 205 0.010 >400 0.017 0.000 87.96 >400 +17:01:34 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:01:36 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:01:38 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:01:40 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:01:42 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:01:44 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:01:46 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:01:48 0.010 >400 0.015 205 0.010 >400 0.017 0.000 87.96 >400 +17:01:50 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:01:52 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:01:54 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:01:56 0.010 >400 0.015 158 0.010 >400 0.017 0.000 87.96 >400 +17:01:58 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:02:00 0.015 46 0.015 34.1 0.015 25.6 0.022 0.000 87.96 >400 +17:02:02 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:02:04 0.010 >400 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +17:02:06 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:02:08 0.015 >400 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +17:02:10 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:02:12 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:02:14 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:02:16 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:02:18 0.015 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:02:20 0.015 34.7 0.015 18.6 0.015 28.8 0.022 0.000 87.96 >400 +17:02:22 0.015 205 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:02:24 0.015 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:02:26 0.025 5.6 0.025 9.1 0.025 10.0 0.038 0.000 87.96 >400 +17:02:28 0.030 13.6 0.040 10.5 0.025 10.4 0.048 0.000 91.48 71 +17:02:30 0.015 33.6 0.015 >400 0.015 14.6 0.021 0.000 87.96 >400 +17:02:32 0.015 76 0.020 21.1 0.015 50 0.025 0.000 87.96 >400 +17:02:34 0.020 14.0 0.025 24.4 0.020 20.7 0.029 0.000 87.96 >400 +17:02:36 0.025 13.8 0.030 14.3 0.020 18.3 0.036 0.000 87.96 >400 +17:02:38 0.020 15.5 0.025 13.3 0.015 34.7 0.027 0.000 91.48 62 +17:02:40 0.020 20.5 0.020 16.8 0.015 18.0 0.023 0.000 91.48 66 +17:02:42 0.035 12.5 0.045 12.1 0.030 8.2 0.060 0.000 91.48 30.1 +17:02:44 0.030 4.2 0.030 18.1 0.040 6.8 0.045 0.000 91.48 82 +17:02:46 0.035 21.1 0.050 19.7 0.030 19.3 0.057 0.000 87.96 >400 +17:02:48 0.015 20.3 0.015 23.5 0.020 14.5 0.025 0.000 87.96 >400 +17:02:50 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:02:52 0.015 62 0.015 >400 0.015 120 0.021 0.000 87.96 >400 +17:02:54 0.025 8.8 0.025 15.8 0.020 9.6 0.030 0.000 87.96 >400 +17:02:56 0.035 9.9 0.045 10.1 0.040 9.7 0.060 0.000 91.48 >400 +17:02:58 0.025 11.4 0.035 12.1 0.030 9.7 0.046 0.000 87.96 >400 +17:03:00 0.025 11.4 0.045 13.1 0.025 12.5 0.050 0.000 87.96 >400 +17:03:02 0.040 10.5 0.040 10.0 0.025 11.8 0.047 0.000 87.96 >400 +17:03:04 0.010 >400 0.015 114 0.010 >400 0.018 0.000 87.96 >400 +17:03:06 0.025 17.5 0.030 8.8 0.025 10.2 0.036 0.000 87.96 >400 +17:03:08 0.040 10.4 0.030 18.0 0.025 13.0 0.041 0.000 91.48 186 +17:03:10 0.035 10.1 0.025 11.1 0.025 10.4 0.037 0.000 91.48 186 +17:03:12 0.015 22.5 0.015 25.3 0.015 120 0.022 0.000 87.96 >400 +17:03:14 0.020 13.5 0.020 14.8 0.015 341 0.027 0.000 87.96 >400 +17:03:16 0.020 14.2 0.020 12.3 0.015 37.2 0.025 0.000 87.96 >400 +17:03:18 0.030 9.7 0.030 10.7 0.020 13.6 0.036 0.000 87.96 >400 +17:03:20 0.025 9.7 0.035 9.1 0.025 8.3 0.046 0.000 87.96 >400 +17:03:22 0.025 10.9 0.030 19.0 0.020 15.5 0.034 0.000 87.96 >400 +17:03:24 0.030 8.1 0.035 11.6 0.030 8.5 0.047 0.000 87.96 >400 +17:03:26 0.030 12.1 0.035 11.8 0.025 13.2 0.044 0.000 87.96 >400 +17:03:28 0.020 15.2 0.020 7.9 0.015 17.5 0.025 0.000 87.96 >400 +17:03:30 0.015 128 0.015 24.4 0.015 54 0.022 0.000 87.96 >400 +17:03:32 0.015 76 0.020 25.0 0.015 40 0.023 0.000 87.96 >400 +17:03:34 0.010 >400 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:03:36 0.020 12.0 0.020 11.1 0.015 26.9 0.030 0.000 87.96 >400 +17:03:38 0.015 53 0.015 128 0.015 >400 0.022 0.000 91.48 >400 +17:03:40 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:03:42 0.015 >400 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:03:44 0.015 30.1 0.020 10.1 0.015 10.3 0.025 0.000 87.96 >400 +17:03:46 0.010 >400 0.015 158 0.010 >400 0.017 0.000 87.96 >400 +17:03:48 0.020 8.5 0.020 16.3 0.015 57 0.024 0.000 87.96 >400 +17:03:50 0.020 11.2 0.030 3.9 0.020 4.1 0.036 0.000 87.96 >400 +17:03:52 0.020 15.5 0.020 23.0 0.020 20.5 0.026 0.000 87.96 >400 +17:03:54 0.030 12.5 0.030 15.6 0.020 11.5 0.039 0.000 87.96 >400 +17:03:56 0.025 9.1 0.025 12.7 0.020 16.3 0.027 0.000 87.96 >400 +17:03:58 0.020 11.1 0.030 N/A 0.020 46 0.036 0.000 87.96 >400 +17:04:00 0.025 7.7 0.025 14.4 0.020 17.7 0.030 0.000 87.96 >400 +17:04:02 0.015 51 0.015 23.5 0.015 68 0.021 0.000 87.96 >400 +17:04:04 0.030 12.8 0.035 10.7 0.020 11.1 0.041 0.000 87.96 >400 +17:04:06 0.030 8.6 0.025 10.2 0.020 14.4 0.031 0.000 87.96 >400 +17:04:08 0.025 14.0 0.025 20.5 0.025 10.2 0.035 0.000 87.96 >400 +17:04:10 0.025 11.9 0.025 25.6 0.020 16.1 0.030 0.000 87.96 >400 +17:04:12 0.025 11.2 0.030 11.4 0.025 14.2 0.039 0.000 87.96 >400 +17:04:14 0.025 18.0 0.030 13.3 0.020 13.2 0.036 0.000 87.96 >400 +17:04:16 0.015 49 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:04:18 0.015 >400 0.015 66 0.015 >400 0.019 0.000 87.96 >400 +17:04:20 0.015 341 0.015 71 0.015 35.3 0.021 0.000 87.96 >400 +17:04:22 0.040 N/A 0.050 9.5 0.035 11.8 0.063 0.000 91.48 48 +17:04:24 0.030 10.3 0.035 10.5 0.025 12.9 0.043 0.000 87.96 >400 +17:04:26 0.030 13.0 0.040 17.4 0.030 10.8 0.045 0.000 91.48 >400 +17:04:28 0.020 13.6 0.030 16.3 0.020 13.1 0.036 0.000 87.96 >400 +17:04:30 0.025 10.6 0.035 N/A 0.020 14.9 0.038 0.000 87.96 >400 +17:04:32 0.030 14.5 0.030 12.4 0.035 11.0 0.046 0.000 87.96 >400 +17:04:34 0.025 11.7 0.030 14.3 0.020 15.5 0.036 0.000 87.96 >400 +17:04:36 0.025 12.2 0.025 16.7 0.025 10.6 0.038 0.000 87.96 >400 +17:04:38 0.025 13.0 0.040 12.8 0.035 12.7 0.055 0.000 91.48 33.6 +17:04:40 0.025 11.5 0.025 17.5 0.025 12.6 0.032 0.000 87.96 >400 +17:04:42 0.025 9.2 0.025 21.3 0.020 10.2 0.030 0.000 87.96 >400 +17:04:44 0.025 13.7 0.030 16.9 0.020 12.8 0.037 0.000 87.96 >400 +17:04:46 0.025 12.3 0.030 15.3 0.020 14.9 0.037 0.000 87.96 >400 +17:04:48 0.020 15.1 0.025 13.9 0.020 18.6 0.033 0.000 87.96 >400 +17:04:50 0.020 12.0 0.025 14.3 0.020 14.5 0.031 0.000 87.96 >400 +17:04:52 0.025 10.2 0.025 16.9 0.020 18.6 0.034 0.000 87.96 >400 +17:04:54 0.030 12.2 0.030 11.4 0.020 12.3 0.035 0.000 87.96 >400 +17:04:56 0.025 11.0 0.025 18.0 0.025 8.7 0.034 0.000 87.96 >400 +17:04:58 0.025 18.3 0.040 13.4 0.020 20.9 0.043 0.000 87.96 >400 +17:05:00 0.020 9.3 0.020 19.5 0.015 341 0.027 0.000 87.96 >400 +17:05:02 0.035 10.9 0.050 11.5 0.025 12.3 0.056 0.000 87.96 >400 +17:05:04 0.035 8.6 0.045 9.5 0.025 11.0 0.057 0.000 87.96 >400 +17:05:06 0.025 15.2 0.025 15.3 0.015 293 0.030 0.000 87.96 >400 +17:05:08 0.020 16.3 0.025 15.8 0.015 171 0.030 0.000 87.96 >400 +17:05:10 0.020 14.9 0.030 13.0 0.015 293 0.032 0.000 87.96 >400 +17:05:12 0.030 13.9 0.030 13.6 0.020 16.5 0.034 0.000 87.96 >400 +17:05:14 0.030 15.5 0.030 15.9 0.020 18.0 0.035 0.000 87.96 >400 +17:05:16 0.030 12.0 0.035 10.6 0.025 10.4 0.039 0.000 87.96 >400 +17:05:18 0.020 17.7 0.025 14.6 0.015 24.1 0.030 0.000 87.96 >400 +17:05:20 0.030 10.7 0.045 13.5 0.035 12.6 0.057 0.000 87.96 >400 +17:05:22 0.020 13.4 0.020 13.5 0.020 10.6 0.025 0.000 87.96 >400 +17:05:24 0.015 137 0.015 146 0.015 186 0.021 0.000 91.48 205 +17:05:26 0.015 76 0.015 293 0.010 >400 0.021 0.000 87.96 >400 +17:05:28 0.015 42 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:05:30 0.015 205 0.015 79 0.015 >400 0.021 0.000 87.96 >400 +17:05:32 0.010 >400 0.015 120 0.015 >400 0.019 0.000 87.96 >400 +17:05:34 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:05:36 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:05:38 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:05:40 0.015 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:05:42 0.010 >400 0.015 85 0.015 >400 0.019 0.000 87.96 >400 +17:05:44 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:05:46 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:05:48 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:05:50 0.010 >400 0.015 76 0.010 >400 0.019 0.000 87.96 >400 +17:05:52 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:05:54 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:05:56 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:05:58 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:06:00 0.015 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:06:02 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:06:04 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:06:06 0.015 >400 0.015 79 0.015 25.0 0.021 0.000 87.96 >400 +17:06:08 0.015 >400 0.020 21.3 0.015 39.4 0.022 0.000 87.96 >400 +17:06:10 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:06:12 0.010 >400 0.015 62 0.010 >400 0.017 0.000 87.96 >400 +17:06:14 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:06:16 0.015 66 0.025 35.9 0.015 66 0.029 0.000 87.96 >400 +17:06:18 0.015 >400 0.015 59 0.010 >400 0.019 0.000 87.96 >400 +17:06:20 0.015 64 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:06:22 0.015 20.5 0.015 341 0.015 146 0.022 0.000 87.96 >400 +17:06:24 0.010 >400 0.015 228 0.015 293 0.019 0.000 87.96 >400 +17:06:26 0.015 76 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:06:28 0.015 341 0.015 128 0.010 >400 0.017 0.000 87.96 >400 +17:06:30 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:06:32 0.010 >400 0.015 146 0.010 >400 0.017 0.000 87.96 >400 +17:06:34 0.010 >400 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:06:36 0.010 >400 0.015 43 0.010 >400 0.019 0.000 87.96 >400 +17:06:38 0.015 108 0.015 54 0.015 >400 0.022 0.000 87.96 >400 +17:06:40 0.015 45 0.015 28.1 0.015 120 0.021 0.000 87.96 >400 +17:06:42 0.015 341 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:06:44 0.025 13.4 0.030 14.7 0.025 10.1 0.039 0.000 87.96 >400 +17:06:46 0.015 14.1 0.020 21.1 0.015 158 0.027 0.000 87.96 >400 +17:06:48 0.030 13.1 0.020 15.8 0.025 15.3 0.034 0.000 87.96 >400 +17:06:50 0.020 12.7 0.025 23.5 0.020 14.1 0.031 0.000 87.96 >400 +17:06:52 0.020 25.0 0.035 19.1 0.025 19.5 0.043 0.000 87.96 >400 +17:06:54 0.015 22.5 0.015 >400 0.015 30.6 0.022 0.000 87.96 >400 +17:06:56 0.015 205 0.020 9.1 0.015 120 0.023 0.000 87.96 >400 +17:06:58 0.020 13.5 0.025 13.0 0.015 171 0.031 0.000 87.96 >400 +17:07:00 0.020 12.8 0.025 10.4 0.015 34.7 0.031 0.000 87.96 >400 +17:07:02 0.020 12.0 0.020 12.5 0.015 15.4 0.023 0.000 87.96 >400 +17:07:04 0.015 114 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:07:06 0.015 43 0.015 46 0.010 >400 0.021 0.000 87.96 >400 +17:07:08 0.015 50 0.015 48 0.010 >400 0.019 0.000 87.96 >400 +17:07:10 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:07:12 0.015 228 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:07:14 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:07:16 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:07:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:07:20 0.015 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:07:22 0.015 158 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:07:24 0.015 205 0.015 256 0.010 60 0.019 0.000 87.96 >400 +17:07:26 0.015 146 0.015 85 0.015 >400 0.022 0.000 87.96 >400 +17:07:28 0.020 12.1 0.020 13.7 0.015 >400 0.025 0.000 87.96 >400 +17:07:30 0.020 8.6 0.025 16.4 0.015 35.3 0.027 0.000 87.96 >400 +17:07:32 0.015 22.8 0.020 14.1 0.020 10.2 0.029 0.000 87.96 >400 +17:07:34 0.020 10.9 0.020 19.1 0.015 15.5 0.023 0.000 87.96 >400 +17:07:36 0.030 17.8 0.035 17.1 0.025 17.7 0.043 0.000 87.96 >400 +17:07:38 0.015 171 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:07:40 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:07:42 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:07:44 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:07:46 0.015 205 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:07:48 0.015 293 0.015 48 0.010 >400 0.019 0.000 87.96 >400 +17:07:50 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:07:52 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:07:54 0.010 >400 0.015 228 0.010 >400 0.017 0.000 87.96 >400 +17:07:56 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:07:58 0.015 341 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:08:00 0.015 >400 0.015 146 0.010 >400 0.021 0.000 87.96 >400 +17:08:02 0.025 9.9 0.030 11.8 0.025 12.6 0.036 0.000 87.96 >400 +17:08:04 0.035 10.5 0.035 8.4 0.030 8.8 0.042 0.000 87.96 >400 +17:08:06 0.025 12.8 0.035 14.5 0.025 13.0 0.039 0.000 87.96 >400 +17:08:08 0.025 11.1 0.030 15.9 0.025 11.8 0.039 0.000 91.48 256 +17:08:10 0.035 11.3 0.040 15.6 0.030 13.1 0.043 0.000 91.48 >400 +17:08:12 0.025 12.4 0.035 12.1 0.030 13.0 0.044 0.000 91.48 >400 +17:08:14 0.030 12.5 0.030 12.1 0.025 15.1 0.040 0.000 87.96 >400 +17:08:16 0.025 12.1 0.030 13.4 0.025 12.8 0.034 0.000 87.96 >400 +17:08:18 0.025 9.3 0.035 10.9 0.025 10.0 0.046 0.000 87.96 >400 +17:08:20 0.035 9.4 0.030 7.3 0.020 16.7 0.042 0.000 87.96 >400 +17:08:22 0.020 11.3 0.015 19.5 0.015 42 0.023 0.000 87.96 >400 +17:08:24 0.010 >400 0.015 205 0.010 >400 0.019 0.000 91.48 >400 +17:08:26 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:08:28 0.015 22.5 0.020 16.3 0.020 16.4 0.027 0.000 87.96 >400 +17:08:30 0.015 >400 0.020 10.6 0.015 20.1 0.025 0.000 87.96 >400 +17:08:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:08:34 0.015 128 0.015 146 0.015 40 0.019 0.000 87.96 >400 +17:08:36 0.010 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:08:38 0.030 14.2 0.025 15.6 0.020 16.8 0.034 0.000 87.96 >400 +17:08:40 0.030 25.0 0.045 20.9 0.025 19.5 0.052 0.000 87.96 >400 +17:08:42 0.015 108 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:08:44 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 91.48 >400 +17:08:46 0.010 >400 0.015 120 0.010 >400 0.017 0.000 87.96 >400 +17:08:48 0.015 >400 0.015 76 0.010 >400 0.017 0.000 87.96 >400 +17:08:50 0.010 >400 0.015 102 0.010 >400 0.017 0.000 87.96 >400 +17:08:52 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:08:54 0.010 >400 0.015 158 0.010 >400 0.017 0.000 91.48 >400 +17:08:56 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:08:58 0.015 >400 0.015 158 0.010 >400 0.017 0.000 87.96 >400 +17:09:00 0.015 102 0.015 >400 0.015 146 0.019 0.000 91.48 >400 +17:09:02 0.015 228 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:09:04 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:09:06 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:09:08 0.015 50 0.015 35.9 0.010 >400 0.021 0.000 87.96 >400 +17:09:10 0.010 >400 0.015 38.6 0.010 >400 0.021 0.000 87.96 >400 +17:09:12 0.015 >400 0.015 41 0.010 >400 0.019 0.000 87.96 >400 +17:09:14 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:09:16 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:09:18 0.010 >400 0.015 341 0.010 >400 0.017 0.000 91.48 >400 +17:09:20 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:09:22 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:09:24 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:09:26 0.020 9.2 0.020 8.7 0.015 10.0 0.025 0.000 87.96 >400 +17:09:28 0.025 N/A 0.030 10.2 0.025 14.5 0.034 0.000 87.96 >400 +17:09:30 0.030 11.6 0.035 11.3 0.030 11.7 0.046 0.000 87.96 >400 +17:09:32 0.025 33.6 0.030 13.9 0.020 12.6 0.037 0.000 87.96 >400 +17:09:34 0.020 8.2 0.020 11.9 0.015 31.0 0.025 0.000 87.96 >400 +17:09:36 0.020 N/A 0.025 10.2 0.020 11.0 0.032 0.000 87.96 >400 +17:09:38 0.025 16.4 0.030 15.8 0.020 13.3 0.035 0.000 87.96 >400 +17:09:40 0.015 21.6 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:09:42 0.025 9.4 0.025 16.4 0.015 43 0.030 0.000 87.96 >400 +17:09:44 0.020 16.5 0.025 22.8 0.020 16.3 0.030 0.000 87.96 >400 +17:09:46 0.025 12.6 0.025 11.0 0.020 12.0 0.032 0.000 87.96 >400 +17:09:48 0.030 12.3 0.040 11.7 0.025 15.5 0.045 0.000 87.96 >400 +17:09:50 0.030 11.9 0.035 13.4 0.020 17.8 0.041 0.000 87.96 >400 +17:09:52 0.025 14.4 0.030 11.1 0.020 17.2 0.034 0.000 87.96 >400 +17:09:54 0.020 19.1 0.035 11.6 0.025 12.0 0.041 0.000 87.96 >400 +17:09:56 0.030 14.3 0.040 13.9 0.020 15.3 0.044 0.000 91.48 341 +17:09:58 0.035 12.3 0.035 11.9 0.025 9.6 0.046 0.000 87.96 >400 +17:10:00 0.030 10.0 0.030 13.5 0.020 14.1 0.036 0.000 87.96 >400 +17:10:02 0.035 10.2 0.035 19.7 0.020 13.7 0.043 0.000 87.96 >400 +17:10:04 0.030 12.5 0.040 12.8 0.040 11.7 0.053 0.000 87.96 >400 +17:10:06 0.035 10.4 0.050 9.4 0.035 11.6 0.066 0.000 87.96 >400 +17:10:08 0.030 10.0 0.035 12.8 0.020 18.5 0.041 0.000 87.96 >400 +17:10:10 0.040 11.0 0.040 17.8 0.020 9.9 0.045 0.000 87.96 >400 +17:10:12 0.020 13.0 0.020 15.6 0.020 15.4 0.028 0.000 87.96 >400 +17:10:14 0.025 13.7 0.035 9.9 0.020 10.7 0.038 0.000 87.96 >400 +17:10:16 0.015 120 0.015 43 0.015 114 0.023 0.000 87.96 >400 +17:10:18 0.015 158 0.015 29.3 0.010 >400 0.019 0.000 87.96 >400 +17:10:20 0.015 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:10:22 0.015 205 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:10:24 0.015 >400 0.030 7.6 0.025 7.8 0.039 0.000 87.96 >400 +17:10:26 0.020 15.5 0.020 19.9 0.020 15.6 0.029 0.000 87.96 >400 +17:10:28 0.020 18.0 0.025 13.7 0.020 18.1 0.032 0.000 87.96 >400 +17:10:30 0.020 12.3 0.025 11.7 0.025 12.1 0.036 0.000 87.96 >400 +17:10:32 0.025 12.0 0.020 5.5 0.020 6.9 0.030 0.000 87.96 >400 +17:10:34 0.015 146 0.015 59 0.015 53 0.019 0.000 87.96 >400 +17:10:36 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:10:38 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:10:40 0.010 >400 0.015 >400 0.010 >400 0.018 0.000 87.96 >400 +17:10:42 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:10:44 0.010 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +17:10:46 0.020 20.7 0.030 13.3 0.025 12.3 0.037 0.000 87.96 >400 +17:10:48 0.015 17.8 0.015 >400 0.015 85 0.021 0.000 87.96 >400 +17:10:50 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:10:52 0.015 15.6 0.015 >400 0.015 17.2 0.023 0.000 87.96 >400 +17:10:54 0.015 293 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:10:56 0.015 71 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:10:58 0.015 53 0.015 37.2 0.015 293 0.021 0.000 87.96 >400 +17:11:00 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:11:02 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:11:04 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:11:06 0.015 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:11:08 0.015 >400 0.015 57 0.015 >400 0.019 0.000 87.96 >400 +17:11:10 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:11:12 0.010 >400 0.015 25.3 0.010 >400 0.019 0.000 87.96 >400 +17:11:14 0.010 >400 0.015 66 0.010 >400 0.017 0.000 87.96 >400 +17:11:16 0.010 >400 0.015 37.2 0.010 >400 0.019 0.000 87.96 >400 +17:11:18 0.015 341 0.015 128 0.015 >400 0.019 0.000 87.96 >400 +17:11:20 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:11:22 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:11:24 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:11:26 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:11:28 0.010 >400 0.015 39.4 0.010 >400 0.021 0.000 87.96 >400 +17:11:30 0.010 >400 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +17:11:32 0.015 >400 0.015 47 0.015 >400 0.019 0.000 87.96 >400 +17:11:34 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:11:36 0.010 >400 0.015 39.4 0.010 >400 0.019 0.000 87.96 >400 +17:11:38 0.015 98 0.015 25.6 0.010 >400 0.021 0.000 87.96 >400 +17:11:40 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:11:42 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:11:44 0.015 293 0.015 146 0.010 >400 0.021 0.000 87.96 >400 +17:11:46 0.015 186 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:11:48 0.010 >400 0.015 54 0.010 >400 0.017 0.000 87.96 >400 +17:11:50 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:11:52 0.010 >400 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:11:54 0.015 171 0.015 22.3 0.010 >400 0.021 0.000 87.96 >400 +17:11:56 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:11:58 0.015 205 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:12:00 0.010 >400 0.015 46 0.010 >400 0.021 0.000 87.96 >400 +17:12:02 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:12:04 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:12:06 0.010 >400 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:12:08 0.015 293 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:12:10 0.015 28.1 0.020 16.8 0.015 >400 0.027 0.000 87.96 >400 +17:12:12 0.015 62 0.015 >400 0.015 26.6 0.022 0.000 87.96 >400 +17:12:14 0.015 54 0.015 31.0 0.010 >400 0.019 0.000 87.96 >400 +17:12:16 0.015 205 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:12:18 0.015 51 0.015 205 0.015 120 0.021 0.000 87.96 >400 +17:12:20 0.015 >400 0.015 228 0.010 >400 0.022 0.000 87.96 >400 +17:12:22 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:12:24 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:12:26 0.010 >400 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:12:28 0.015 256 0.015 256 0.015 >400 0.019 0.000 87.96 >400 +17:12:30 0.030 24.1 0.035 6.2 0.025 4.0 0.041 0.000 87.96 >400 +17:12:32 0.025 15.2 0.025 13.7 0.015 42 0.031 0.000 87.96 >400 +17:12:34 0.025 10.2 0.030 12.7 0.025 12.7 0.039 0.000 87.96 >400 +17:12:36 0.030 16.9 0.040 15.5 0.030 12.5 0.053 0.000 91.48 48 +17:12:38 0.025 10.5 0.030 10.4 0.020 10.0 0.037 0.000 87.96 >400 +17:12:40 0.015 171 0.015 341 0.015 >400 0.021 0.000 87.96 >400 +17:12:42 0.025 10.3 0.025 13.9 0.020 13.2 0.034 0.000 87.96 >400 +17:12:44 0.030 10.3 0.035 9.9 0.020 10.6 0.038 0.000 91.48 >400 +17:12:46 0.030 12.5 0.030 12.0 0.020 18.3 0.035 0.000 87.96 >400 +17:12:48 0.030 10.0 0.025 11.1 0.020 15.2 0.031 0.000 91.48 >400 +17:12:50 0.020 22.0 0.025 15.4 0.020 12.5 0.033 0.000 87.96 >400 +17:12:52 0.030 10.6 0.025 11.6 0.020 15.6 0.032 0.000 87.96 >400 +17:12:54 0.020 12.6 0.025 15.8 0.020 16.9 0.032 0.000 87.96 >400 +17:12:56 0.025 10.6 0.030 7.3 0.025 9.3 0.039 0.000 87.96 >400 +17:12:58 0.020 16.1 0.025 13.8 0.025 15.9 0.032 0.000 87.96 >400 +17:13:00 0.040 34.1 0.110 24.4 0.030 17.8 0.114 0.000 91.48 158 +17:13:02 0.025 37.2 0.030 31.0 0.020 11.8 0.039 0.000 87.96 >400 +17:13:04 0.030 18.5 0.050 14.0 0.045 9.6 0.068 0.000 91.48 28.4 +17:13:06 0.015 82 0.020 11.4 0.015 27.3 0.023 0.000 87.96 >400 +17:13:08 0.015 293 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:13:10 0.015 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:13:12 0.015 186 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:13:14 0.010 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:13:16 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +17:13:18 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:13:20 0.010 >400 0.015 49 0.015 293 0.019 0.000 87.96 >400 +17:13:22 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:13:24 0.020 11.0 0.015 20.7 0.015 102 0.023 0.000 87.96 >400 +17:13:26 0.015 186 0.015 49 0.015 54 0.022 0.000 87.96 >400 +17:13:28 0.015 186 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:13:30 0.015 >400 0.015 128 0.015 128 0.019 0.000 87.96 >400 +17:13:32 0.010 >400 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:13:34 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:13:36 0.010 >400 0.015 114 0.010 >400 0.021 0.000 87.96 >400 +17:13:38 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:13:40 0.025 7.5 0.030 8.8 0.020 8.8 0.036 0.000 87.96 >400 +17:13:42 0.035 N/A 0.050 10.0 0.035 10.8 0.062 0.000 91.48 256 +17:13:44 0.030 10.5 0.045 14.7 0.025 11.8 0.051 0.000 91.48 128 +17:13:46 0.025 12.6 0.030 14.1 0.020 18.5 0.036 0.000 87.96 >400 +17:13:48 0.020 11.8 0.030 12.0 0.020 16.1 0.036 0.000 87.96 >400 +17:13:50 0.025 12.5 0.035 14.0 0.025 13.1 0.040 0.000 87.96 >400 +17:13:52 0.035 9.8 0.045 12.1 0.025 13.5 0.050 0.000 91.48 186 +17:13:54 0.035 9.5 0.050 10.3 0.030 11.4 0.060 0.000 91.48 186 +17:13:56 0.025 12.5 0.030 16.1 0.025 14.0 0.036 0.000 87.96 >400 +17:13:58 0.025 9.4 0.025 17.8 0.020 8.5 0.032 0.000 87.96 >400 +17:14:00 0.025 14.3 0.025 14.1 0.020 13.0 0.032 0.000 87.96 >400 +17:14:02 0.025 13.0 0.025 17.8 0.025 11.5 0.038 0.000 91.48 >400 +17:14:04 0.020 11.8 0.020 26.9 0.020 13.2 0.027 0.000 87.96 >400 +17:14:06 0.015 62 0.020 19.1 0.020 15.3 0.027 0.000 87.96 >400 +17:14:08 0.020 10.8 0.030 16.5 0.020 17.5 0.032 0.000 91.48 71 +17:14:10 0.030 11.6 0.035 14.3 0.025 12.4 0.045 0.000 91.48 293 +17:14:12 0.025 13.0 0.030 11.7 0.015 57 0.034 0.000 87.96 >400 +17:14:14 0.030 11.3 0.035 18.5 0.020 20.1 0.041 0.000 91.48 128 +17:14:16 0.015 53 0.015 341 0.015 45 0.019 0.000 91.48 186 +17:14:18 0.015 39.4 0.020 20.5 0.020 6.1 0.028 0.000 87.96 >400 +17:14:20 0.020 14.9 0.025 19.7 0.020 14.2 0.032 0.000 87.96 >400 +17:14:22 0.020 8.6 0.020 14.5 0.015 102 0.024 0.000 87.96 >400 +17:14:24 0.020 14.6 0.040 16.9 0.020 21.6 0.047 0.000 87.96 >400 +17:14:26 0.020 25.3 0.020 21.6 0.015 25.9 0.025 0.000 91.48 >400 +17:14:28 0.020 12.0 0.020 11.1 0.015 20.9 0.023 0.000 87.96 >400 +17:14:30 0.015 186 0.015 114 0.015 >400 0.019 0.000 87.96 >400 +17:14:32 0.010 >400 0.015 >400 0.015 93 0.021 0.000 87.96 >400 +17:14:34 0.015 >400 0.015 51 0.015 >400 0.021 0.000 87.96 >400 +17:14:36 0.015 57 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:14:38 0.015 22.8 0.015 71 0.015 85 0.021 0.000 87.96 >400 +17:14:40 0.015 114 0.015 146 0.015 >400 0.019 0.000 87.96 >400 +17:14:42 0.015 120 0.015 33.6 0.015 >400 0.019 0.000 91.48 >400 +17:14:44 0.015 54 0.015 93 0.015 >400 0.019 0.000 87.96 >400 +17:14:46 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:14:48 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:14:50 0.015 44 0.015 59 0.015 >400 0.022 0.000 87.96 >400 +17:14:52 0.050 9.1 0.070 9.3 0.055 10.6 0.095 0.000 91.48 64 +17:14:54 0.050 10.2 0.030 11.8 0.025 11.1 0.050 0.000 87.96 >400 +17:14:56 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:14:58 0.015 36.6 0.020 14.9 0.015 17.7 0.025 0.000 87.96 >400 +17:15:00 0.015 341 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:15:02 0.010 >400 0.015 341 0.015 >400 0.019 0.000 87.96 >400 +17:15:04 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:15:06 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:15:08 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:15:10 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:15:12 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:15:14 0.115 23.8 0.145 23.3 0.085 16.4 0.169 0.000 91.48 47 +17:15:16 0.020 14.8 0.015 17.7 0.015 93 0.023 0.000 87.96 >400 +17:15:18 0.015 >400 0.015 228 0.010 >400 0.017 0.000 87.96 >400 +17:15:20 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:15:22 0.015 76 0.015 >400 0.015 23.3 0.021 0.000 87.96 >400 +17:15:24 0.015 82 0.020 22.0 0.020 16.9 0.028 0.000 87.96 >400 +17:15:26 0.015 27.3 0.020 34.1 0.015 44 0.023 0.000 87.96 >400 +17:15:28 0.015 48 0.020 10.3 0.015 >400 0.024 0.000 87.96 >400 +17:15:30 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:15:32 0.015 66 0.015 >400 0.015 37.9 0.019 0.000 87.96 >400 +17:15:34 0.015 102 0.015 128 0.015 293 0.021 0.000 91.48 >400 +17:15:36 0.015 228 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:15:38 0.025 14.5 0.035 10.0 0.025 10.8 0.041 0.000 87.96 >400 +17:15:40 0.030 13.0 0.030 17.1 0.025 N/A 0.035 0.000 87.96 >400 +17:15:42 0.020 12.8 0.025 9.5 0.020 9.5 0.031 0.000 87.96 >400 +17:15:44 0.015 137 0.015 89 0.010 >400 0.021 0.000 87.96 >400 +17:15:46 0.015 59 0.015 >400 0.015 293 0.019 0.000 87.96 >400 +17:15:48 0.015 27.7 0.015 293 0.015 102 0.021 0.000 87.96 >400 +17:15:50 0.015 114 0.015 93 0.010 >400 0.021 0.000 87.96 >400 +17:15:52 0.015 >400 0.015 89 0.015 >400 0.019 0.000 91.48 256 +17:15:54 0.015 293 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:15:56 0.010 >400 0.015 >400 0.015 54 0.019 0.000 87.96 >400 +17:15:58 0.015 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:16:00 0.015 18.6 0.015 186 0.015 158 0.019 0.000 87.96 >400 +17:16:02 0.015 98 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +17:16:04 0.015 171 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:16:06 0.015 256 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:16:08 0.015 22.3 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:16:10 0.010 >400 0.015 108 0.010 >400 0.017 0.000 87.96 >400 +17:16:12 0.015 228 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:16:14 0.015 >400 0.015 137 0.015 >400 0.019 0.000 87.96 >400 +17:16:16 0.010 >400 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:16:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:16:20 0.010 >400 0.015 205 0.010 >400 0.017 0.000 87.96 >400 +17:16:22 0.015 26.9 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:16:24 0.015 82 0.020 10.5 0.015 79 0.025 0.000 87.96 >400 +17:16:26 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:16:28 0.015 158 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:16:30 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:16:32 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:16:34 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:16:36 0.015 >400 0.015 60 0.010 >400 0.021 0.000 87.96 >400 +17:16:38 0.015 158 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:16:40 0.015 137 0.015 98 0.015 >400 0.021 0.000 87.96 >400 +17:16:42 0.015 29.7 0.015 120 0.010 >400 0.021 0.000 91.48 >400 +17:16:44 0.010 >400 0.015 102 0.015 >400 0.019 0.000 87.96 >400 +17:16:46 0.010 >400 0.015 >400 0.010 >400 0.018 0.000 87.96 >400 +17:16:48 0.015 293 0.015 44 0.010 >400 0.017 0.000 87.96 >400 +17:16:50 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:16:52 0.015 341 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:16:54 0.015 >400 0.015 341 0.015 256 0.019 0.000 87.96 >400 +17:16:56 0.010 >400 0.015 66 0.015 >400 0.019 0.000 91.48 >400 +17:16:58 0.015 256 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +17:17:00 0.015 76 0.015 293 0.015 158 0.022 0.000 91.48 >400 +17:17:02 0.015 >400 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:17:04 0.015 114 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:17:06 0.015 30.1 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +17:17:08 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:17:10 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:17:12 0.015 >400 0.015 186 0.010 >400 0.018 0.000 87.96 >400 +17:17:14 0.015 341 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +17:17:16 0.015 68 0.015 >400 0.015 171 0.019 0.000 87.96 >400 +17:17:18 0.015 114 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:17:20 0.015 293 0.015 293 0.015 146 0.021 0.000 87.96 >400 +17:17:22 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:17:24 0.015 >400 0.015 47 0.010 >400 0.019 0.000 87.96 >400 +17:17:26 0.015 114 0.015 73 0.010 >400 0.019 0.000 91.48 >400 +17:17:28 0.015 256 0.015 228 0.010 >400 0.021 0.000 87.96 341 +17:17:30 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:17:32 0.015 341 0.015 >400 0.015 137 0.019 0.000 87.96 >400 +17:17:34 0.010 >400 0.015 256 0.015 >400 0.021 0.000 87.96 >400 +17:17:36 0.015 89 0.015 82 0.015 146 0.021 0.000 87.96 >400 +17:17:38 0.015 49 0.015 89 0.015 >400 0.019 0.000 87.96 >400 +17:17:40 0.015 120 0.015 73 0.015 102 0.019 0.000 87.96 >400 +17:17:42 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:17:44 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:17:46 0.015 >400 0.015 114 0.010 >400 0.021 0.000 87.96 >400 +17:17:48 0.015 >400 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:17:50 0.015 256 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:17:52 0.015 186 0.015 >400 0.015 186 0.021 0.000 87.96 >400 +17:17:54 0.015 146 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:17:56 0.010 >400 0.015 82 0.015 >400 0.021 0.000 87.96 >400 +17:17:58 0.010 >400 0.015 102 0.015 256 0.019 0.000 87.96 >400 +17:18:00 0.010 >400 0.015 228 0.010 >400 0.017 0.000 87.96 >400 +17:18:02 0.015 38.6 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:18:04 0.015 20.3 0.015 341 0.010 >400 0.021 0.000 87.96 >400 +17:18:06 0.015 23.3 0.015 60 0.015 137 0.021 0.000 91.48 >400 +17:18:08 0.015 25.9 0.015 186 0.010 341 0.019 0.000 87.96 >400 +17:18:10 0.015 186 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:18:12 0.015 42 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:18:14 0.015 146 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:18:16 0.015 293 0.015 93 0.015 293 0.021 0.000 87.96 >400 +17:18:18 0.010 >400 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:18:20 0.015 114 0.015 68 0.010 228 0.019 0.000 87.96 >400 +17:18:22 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:18:24 0.015 >400 0.015 >400 0.015 158 0.019 0.000 87.96 >400 +17:18:26 0.010 >400 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:18:28 0.015 28.1 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:18:30 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:18:32 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:18:34 0.015 54 0.015 68 0.015 79 0.019 0.000 87.96 >400 +17:18:36 0.015 186 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:18:38 0.015 >400 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +17:18:40 0.015 >400 0.015 137 0.015 256 0.019 0.000 87.96 >400 +17:18:42 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:18:44 0.015 120 0.015 24.7 0.010 >400 0.019 0.000 87.96 >400 +17:18:46 0.015 30.1 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:18:48 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:18:50 0.015 26.6 0.015 48 0.015 98 0.019 0.000 87.96 >400 +17:18:52 0.015 158 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:18:54 0.015 146 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:18:56 0.010 >400 0.015 46 0.015 >400 0.019 0.000 87.96 >400 +17:18:58 0.015 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:19:00 0.010 >400 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:19:02 0.015 60 0.015 26.6 0.010 >400 0.021 0.000 87.96 >400 +17:19:04 0.015 >400 0.020 8.4 0.015 25.3 0.025 0.000 87.96 >400 +17:19:06 0.015 47 0.015 146 0.015 41 0.021 0.000 87.96 >400 +17:19:08 0.015 186 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:19:10 0.015 79 0.015 120 0.015 341 0.021 0.000 87.96 >400 +17:19:12 0.010 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:19:14 0.015 102 0.015 146 0.015 256 0.019 0.000 87.96 >400 +17:19:16 0.010 >400 0.015 66 0.010 >400 0.021 0.000 91.48 >400 +17:19:18 0.010 >400 0.015 42 0.015 >400 0.019 0.000 87.96 >400 +17:19:20 0.010 >400 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +17:19:22 0.010 >400 0.015 >400 0.010 >400 0.018 0.000 87.96 >400 +17:19:24 0.010 >400 0.015 228 0.010 >400 0.017 0.000 87.96 >400 +17:19:26 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:19:28 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:19:30 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:19:32 0.015 146 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:19:34 0.015 19.9 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:19:36 0.015 66 0.015 49 0.015 186 0.022 0.000 87.96 >400 +17:19:38 0.015 35.3 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:19:40 0.010 >400 0.015 82 0.010 >400 0.021 0.000 87.96 >400 +17:19:42 0.015 205 0.015 293 0.015 146 0.021 0.000 87.96 >400 +17:19:44 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:19:46 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:19:48 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:19:50 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:19:52 0.010 >400 0.010 228 0.010 >400 0.017 0.000 87.96 >400 +17:19:54 0.015 102 0.015 341 0.015 >400 0.019 0.000 87.96 >400 +17:19:56 0.015 35.9 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:19:58 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:20:00 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:20:02 0.015 102 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +17:20:04 0.015 205 0.015 23.3 0.010 >400 0.021 0.000 87.96 >400 +17:20:06 0.015 108 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:20:08 0.010 >400 0.015 93 0.010 >400 0.021 0.000 87.96 >400 +17:20:10 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:20:12 0.015 68 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:20:14 0.015 114 0.015 22.0 0.015 >400 0.022 0.000 87.96 >400 +17:20:16 0.010 >400 0.015 51 0.015 >400 0.019 0.000 87.96 >400 +17:20:18 0.015 256 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:20:20 0.015 158 0.015 42 0.015 108 0.019 0.000 87.96 >400 +17:20:22 0.010 >400 0.015 45 0.010 >400 0.019 0.000 87.96 >400 +17:20:24 0.010 >400 0.015 28.8 0.010 >400 0.019 0.000 87.96 >400 +17:20:26 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:20:28 0.015 228 0.015 64 0.015 341 0.022 0.000 87.96 >400 +17:20:30 0.025 18.1 0.035 13.7 0.025 13.8 0.043 0.000 87.96 >400 +17:20:32 0.020 12.3 0.020 14.6 0.015 13.6 0.025 0.000 87.96 >400 +17:20:34 0.015 137 0.015 30.1 0.010 >400 0.019 0.000 87.96 >400 +17:20:36 0.020 8.4 0.025 5.1 0.020 5.9 0.034 0.000 87.96 >400 +17:20:38 0.085 22.0 0.115 20.7 0.060 16.4 0.131 0.000 91.48 102 +17:20:40 0.025 23.8 0.035 14.7 0.025 15.3 0.044 0.000 87.96 >400 +17:20:42 0.015 341 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:20:44 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:20:46 0.015 186 0.015 79 0.010 >400 0.019 0.000 91.48 >400 +17:20:48 0.015 >400 0.015 158 0.010 >400 0.021 0.000 87.96 >400 +17:20:50 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:20:52 0.015 >400 0.015 205 0.015 71 0.019 0.000 87.96 >400 +17:20:54 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:20:56 0.010 >400 0.015 128 0.015 >400 0.019 0.000 87.96 >400 +17:20:58 0.010 >400 0.015 128 0.010 >400 0.021 0.000 87.96 >400 +17:21:00 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:21:02 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:21:04 0.015 57 0.015 186 0.015 205 0.021 0.000 87.96 >400 +17:21:06 0.015 19.7 0.015 39.4 0.015 >400 0.022 0.000 87.96 >400 +17:21:08 0.015 256 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:21:10 0.015 41 0.015 47 0.015 62 0.019 0.000 87.96 >400 +17:21:12 0.015 48 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:21:14 0.015 146 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +17:21:16 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:21:18 0.010 >400 0.015 44 0.010 >400 0.021 0.000 87.96 >400 +17:21:20 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:21:22 0.015 60 0.015 137 0.015 76 0.021 0.000 87.96 >400 +17:21:24 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:21:26 0.015 37.2 0.015 >400 0.015 120 0.021 0.000 87.96 >400 +17:21:28 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:21:30 0.015 256 0.015 64 0.015 186 0.019 0.000 87.96 >400 +17:21:32 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:21:34 0.015 60 0.015 22.8 0.010 >400 0.019 0.000 87.96 >400 +17:21:36 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:21:38 0.010 >400 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:21:40 0.015 186 0.020 11.1 0.015 23.5 0.027 0.000 87.96 >400 +17:21:42 0.025 10.8 0.030 12.5 0.030 N/A 0.043 0.000 87.96 >400 +17:21:44 0.035 17.8 0.055 18.1 0.030 12.6 0.058 0.000 91.48 48 +17:21:46 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:21:48 0.015 137 0.015 51 0.010 >400 0.021 0.000 87.96 >400 +17:21:50 0.015 79 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:21:52 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:21:54 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:21:56 0.015 108 0.015 >400 0.015 >400 0.022 0.000 87.96 >400 +17:21:58 0.015 68 0.015 34.1 0.010 >400 0.021 0.000 87.96 >400 +17:22:00 0.015 256 0.015 >400 0.015 89 0.019 0.000 87.96 >400 +17:22:02 0.015 293 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:22:04 0.015 228 0.015 37.9 0.015 50 0.021 0.000 87.96 >400 +17:22:06 0.015 13.4 0.015 79 0.015 37.2 0.022 0.000 87.96 >400 +17:22:08 0.015 26.6 0.015 39.4 0.010 >400 0.019 0.000 87.96 >400 +17:22:10 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:22:12 0.015 >400 0.015 68 0.010 293 0.018 0.000 91.48 >400 +17:22:14 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:22:16 0.015 114 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:22:18 0.015 66 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:22:20 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:22:22 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:22:24 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:22:26 0.020 11.7 0.025 22.0 0.020 12.6 0.032 0.000 87.96 >400 +17:22:28 0.015 35.9 0.015 66 0.015 128 0.022 0.000 87.96 >400 +17:22:30 0.015 146 0.015 137 0.015 36.6 0.021 0.000 87.96 >400 +17:22:32 0.015 256 0.015 114 0.010 >400 0.021 0.000 87.96 >400 +17:22:34 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:22:36 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:22:38 0.020 19.9 0.020 22.8 0.020 19.5 0.029 0.000 87.96 >400 +17:22:40 0.010 >400 0.015 43 0.015 60 0.021 0.000 87.96 >400 +17:22:42 0.010 >400 0.015 >400 0.010 341 0.019 0.000 87.96 >400 +17:22:44 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:22:46 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:22:48 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:22:50 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:22:52 0.010 >400 0.010 341 0.010 >400 0.017 0.000 87.96 >400 +17:22:54 0.015 89 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:22:56 0.015 29.7 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:22:58 0.015 79 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:23:00 0.015 34.7 0.015 108 0.015 >400 0.022 0.000 87.96 >400 +17:23:02 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:23:04 0.015 38.6 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:23:06 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:23:08 0.010 >400 0.015 137 0.010 >400 0.017 0.000 87.96 >400 +17:23:10 0.015 40 0.015 53 0.015 341 0.019 0.000 87.96 >400 +17:23:12 0.015 82 0.015 293 0.010 >400 0.019 0.000 91.48 >400 +17:23:14 0.015 256 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:23:16 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:23:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:23:20 0.015 62 0.015 39.4 0.010 >400 0.019 0.000 87.96 >400 +17:23:22 0.015 >400 0.015 85 0.010 >400 0.017 0.000 87.96 >400 +17:23:24 0.010 >400 0.015 120 0.015 >400 0.019 0.000 87.96 >400 +17:23:26 0.015 128 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +17:23:28 0.015 >400 0.015 44 0.010 >400 0.019 0.000 87.96 >400 +17:23:30 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:23:32 0.015 205 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:23:34 0.010 >400 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:23:36 0.015 >400 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +17:23:38 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:23:40 0.015 293 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +17:23:42 0.015 37.9 0.020 31.0 0.020 12.2 0.028 0.000 87.96 >400 +17:23:44 0.020 13.8 0.020 18.1 0.015 54 0.025 0.000 87.96 >400 +17:23:46 0.020 12.0 0.030 15.3 0.020 15.5 0.036 0.000 91.48 293 +17:23:48 0.015 28.4 0.015 341 0.015 23.8 0.023 0.000 87.96 >400 +17:23:50 0.020 12.3 0.020 17.4 0.020 14.9 0.029 0.000 87.96 >400 +17:23:52 0.020 13.8 0.020 19.0 0.015 37.2 0.027 0.000 87.96 >400 +17:23:54 0.020 11.0 0.015 21.3 0.015 16.5 0.022 0.000 87.96 >400 +17:23:56 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:23:58 0.010 >400 0.015 >400 0.015 >400 0.019 0.000 91.48 >400 +17:24:00 0.015 >400 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +17:24:02 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:24:04 0.015 98 0.020 30.6 0.015 205 0.025 0.000 91.48 12.5 +17:24:06 0.010 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:24:08 0.015 341 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:24:10 0.015 26.9 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:24:12 0.015 >400 0.015 41 0.015 137 0.021 0.000 87.96 >400 +17:24:14 0.015 31.5 0.015 34.1 0.010 >400 0.021 0.000 87.96 >400 +17:24:16 0.015 28.1 0.020 24.4 0.015 39.4 0.023 0.000 87.96 >400 +17:24:18 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +17:24:20 0.015 33.6 0.020 35.9 0.015 >400 0.025 0.000 87.96 >400 +17:24:22 0.025 8.6 0.025 10.3 0.015 293 0.027 0.000 87.96 >400 +17:24:24 0.030 12.0 0.040 8.9 0.030 9.2 0.049 0.000 91.48 341 +17:24:26 0.025 8.6 0.030 12.6 0.025 10.5 0.039 0.000 91.48 89 +17:24:28 0.020 12.6 0.020 15.8 0.020 15.6 0.029 0.000 87.96 >400 +17:24:30 0.025 11.6 0.025 14.5 0.020 14.9 0.029 0.000 91.48 >400 +17:24:32 0.020 13.0 0.020 20.1 0.020 19.0 0.025 0.000 87.96 >400 +17:24:34 0.015 146 0.015 98 0.015 55 0.022 0.000 87.96 >400 +17:24:36 0.025 14.3 0.025 16.1 0.020 13.8 0.031 0.000 87.96 >400 +17:24:38 0.015 21.1 0.015 59 0.015 120 0.021 0.000 87.96 >400 +17:24:40 0.020 18.3 0.025 14.7 0.020 15.8 0.031 0.000 87.96 >400 +17:24:42 0.040 23.3 0.060 19.3 0.030 13.9 0.069 0.000 87.96 >400 +17:24:44 0.020 12.5 0.015 89 0.015 186 0.022 0.000 87.96 >400 +17:24:46 0.015 >400 0.015 341 0.015 50 0.023 0.000 87.96 >400 +17:24:48 0.015 114 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:24:50 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:24:52 0.020 16.4 0.020 11.0 0.015 44 0.025 0.000 87.96 >400 +17:24:54 0.015 108 0.020 15.2 0.015 85 0.025 0.000 87.96 >400 +17:24:56 0.015 120 0.015 293 0.015 293 0.021 0.000 87.96 >400 +17:24:58 0.020 28.4 0.030 N/A 0.020 12.3 0.034 0.000 87.96 >400 +17:25:00 0.040 12.2 0.040 12.0 0.020 13.6 0.045 0.000 87.96 >400 +17:25:02 0.020 13.0 0.025 12.3 0.015 205 0.030 0.000 91.48 >400 +17:25:04 0.025 N/A 0.035 21.8 0.020 22.5 0.041 0.000 87.96 >400 +17:25:06 0.025 26.6 0.020 25.3 0.015 35.9 0.027 0.000 87.96 >400 +17:25:08 0.015 205 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:25:10 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:25:12 0.010 >400 0.015 205 0.015 >400 0.019 0.000 87.96 >400 +17:25:14 0.015 >400 0.015 55 0.015 32.0 0.023 0.000 87.96 >400 +17:25:16 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:25:18 0.015 341 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:25:20 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:25:22 0.015 38.6 0.025 17.2 0.020 15.1 0.032 0.000 87.96 >400 +17:25:24 0.020 12.8 0.025 15.9 0.020 16.4 0.032 0.000 87.96 >400 +17:25:26 0.015 15.6 0.020 10.9 0.015 16.7 0.026 0.000 87.96 >400 +17:25:28 0.020 13.5 0.020 21.6 0.020 17.4 0.029 0.000 87.96 >400 +17:25:30 0.025 13.3 0.030 9.8 0.020 15.1 0.037 0.000 87.96 >400 +17:25:32 0.015 10.6 0.015 23.3 0.015 >400 0.021 0.000 87.96 >400 +17:25:34 0.020 12.9 0.020 10.3 0.020 9.7 0.028 0.000 87.96 >400 +17:25:36 0.015 102 0.015 54 0.010 >400 0.019 0.000 87.96 >400 +17:25:38 0.015 >400 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +17:25:40 0.015 293 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:25:42 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:25:44 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:25:46 0.015 341 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:25:48 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:25:50 0.010 >400 0.015 35.3 0.010 >400 0.019 0.000 87.96 >400 +17:25:52 0.015 54 0.015 137 0.015 76 0.021 0.000 87.96 >400 +17:25:54 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:25:56 0.015 128 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:25:58 0.010 >400 0.015 205 0.015 >400 0.022 0.000 87.96 >400 +17:26:00 0.015 89 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:26:02 0.015 >400 0.015 50 0.010 >400 0.019 0.000 87.96 >400 +17:26:04 0.015 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:26:06 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:26:08 0.015 32.0 0.020 17.1 0.020 16.8 0.025 0.000 87.96 >400 +17:26:10 0.020 9.8 0.025 11.8 0.020 18.8 0.030 0.000 87.96 >400 +17:26:12 0.020 10.3 0.020 31.5 0.015 20.7 0.027 0.000 87.96 >400 +17:26:14 0.025 11.6 0.030 13.4 0.020 14.8 0.038 0.000 87.96 >400 +17:26:16 0.020 13.2 0.025 20.5 0.015 341 0.030 0.000 87.96 >400 +17:26:18 0.020 21.8 0.025 23.8 0.015 28.8 0.029 0.000 87.96 >400 +17:26:20 0.015 43 0.015 64 0.010 >400 0.021 0.000 87.96 >400 +17:26:22 0.010 >400 0.015 108 0.010 >400 0.018 0.000 87.96 >400 +17:26:24 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:26:26 0.015 137 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:26:28 0.015 35.9 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +17:26:30 0.015 256 0.015 137 0.015 186 0.019 0.000 87.96 >400 +17:26:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:26:34 0.015 256 0.020 23.5 0.015 53 0.025 0.000 87.96 >400 +17:26:36 0.015 28.4 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +17:26:38 0.015 137 0.020 32.5 0.015 171 0.023 0.000 87.96 >400 +17:26:40 0.015 >400 0.020 19.9 0.020 12.3 0.025 0.000 87.96 >400 +17:26:42 0.020 12.4 0.030 17.5 0.020 13.6 0.034 0.000 87.96 >400 +17:26:44 0.035 19.9 0.040 18.5 0.025 16.4 0.047 0.000 87.96 >400 +17:26:46 0.015 293 0.015 108 0.010 >400 0.021 0.000 87.96 >400 +17:26:48 0.020 12.3 0.025 28.1 0.020 20.7 0.027 0.000 87.96 >400 +17:26:50 0.020 18.6 0.030 17.8 0.020 18.1 0.036 0.000 87.96 >400 +17:26:52 0.020 13.8 0.015 22.5 0.015 >400 0.021 0.000 87.96 >400 +17:26:54 0.015 82 0.020 21.3 0.015 68 0.023 0.000 87.96 >400 +17:26:56 0.010 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +17:26:58 0.010 >400 0.015 60 0.010 >400 0.021 0.000 87.96 >400 +17:27:00 0.010 >400 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:27:02 0.010 >400 0.015 >400 0.015 293 0.019 0.000 87.96 >400 +17:27:04 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:27:06 0.010 >400 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +17:27:08 0.015 >400 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:27:10 0.015 293 0.015 82 0.015 293 0.022 0.000 87.96 >400 +17:27:12 0.015 31.0 0.015 146 0.015 256 0.022 0.000 87.96 >400 +17:27:14 0.015 48 0.020 17.5 0.020 10.4 0.027 0.000 91.48 >400 +17:27:16 0.025 9.5 0.025 12.6 0.015 >400 0.030 0.000 91.48 >400 +17:27:18 0.015 >400 0.020 9.4 0.015 137 0.024 0.000 87.96 >400 +17:27:20 0.015 19.0 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:27:22 0.015 16.0 0.015 29.3 0.015 293 0.022 0.000 87.96 >400 +17:27:24 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:27:26 0.015 89 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:27:28 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:27:30 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:27:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:27:34 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:27:36 0.015 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:27:38 0.015 293 0.015 62 0.010 >400 0.021 0.000 87.96 >400 +17:27:40 0.015 186 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:27:42 0.010 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:27:44 0.015 >400 0.015 53 0.010 >400 0.019 0.000 87.96 >400 +17:27:46 0.010 >400 0.015 46 0.010 >400 0.019 0.000 87.96 >400 +17:27:48 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:27:50 0.015 >400 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +17:27:52 0.015 54 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:27:54 0.015 59 0.015 137 0.015 82 0.019 0.000 87.96 >400 +17:27:56 0.015 137 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:27:58 0.015 102 0.015 205 0.015 >400 0.019 0.000 87.96 >400 +17:28:00 0.015 79 0.015 >400 0.015 29.7 0.021 0.000 91.48 >400 +17:28:02 0.015 >400 0.015 137 0.015 >400 0.021 0.000 87.96 >400 +17:28:04 0.010 >400 0.015 73 0.015 71 0.023 0.000 87.96 >400 +17:28:06 0.025 8.3 0.025 3.2 0.020 8.1 0.035 0.000 87.96 >400 +17:28:08 0.015 146 0.015 108 0.010 >400 0.021 0.000 87.96 >400 +17:28:10 0.015 >400 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +17:28:12 0.015 54 0.015 293 0.010 >400 0.021 0.000 87.96 >400 +17:28:14 0.015 32.5 0.025 13.0 0.020 11.2 0.032 0.000 87.96 >400 +17:28:16 0.015 26.3 0.015 32.0 0.015 22.0 0.022 0.000 87.96 >400 +17:28:18 0.015 31.5 0.020 33.6 0.015 146 0.024 0.000 87.96 >400 +17:28:20 0.015 >400 0.015 38.6 0.010 >400 0.019 0.000 91.48 >400 +17:28:22 0.015 93 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:28:24 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:28:26 0.015 293 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:28:28 0.015 49 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:28:30 0.015 341 0.015 >400 0.015 256 0.019 0.000 91.48 >400 +17:28:32 0.015 >400 0.015 60 0.015 205 0.019 0.000 87.96 >400 +17:28:34 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:28:36 0.010 >400 0.015 >400 0.015 108 0.022 0.000 87.96 >400 +17:28:38 0.015 293 0.015 44 0.010 >400 0.019 0.000 87.96 >400 +17:28:40 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:28:42 0.015 >400 0.015 256 0.015 38.6 0.021 0.000 87.96 >400 +17:28:44 0.015 137 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:28:46 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:28:48 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:28:50 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:28:52 0.015 293 0.015 55 0.015 41 0.021 0.000 87.96 >400 +17:28:54 0.020 17.2 0.020 14.6 0.015 137 0.026 0.000 91.48 >400 +17:28:56 0.015 34.7 0.015 43 0.015 293 0.021 0.000 87.96 >400 +17:28:58 0.010 >400 0.015 76 0.010 >400 0.019 0.000 91.48 >400 +17:29:00 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:29:02 0.010 >400 0.015 146 0.015 >400 0.019 0.000 91.48 >400 +17:29:04 0.015 >400 0.025 19.5 0.020 4.2 0.029 0.000 87.96 >400 +17:29:06 0.025 12.1 0.030 18.6 0.020 11.3 0.036 0.000 87.96 >400 +17:29:08 0.030 11.2 0.035 11.4 0.025 12.2 0.043 0.000 87.96 >400 +17:29:10 0.030 18.8 0.030 22.8 0.020 20.3 0.034 0.000 87.96 >400 +17:29:12 0.015 17.8 0.020 15.1 0.015 >400 0.024 0.000 87.96 >400 +17:29:14 0.015 20.7 0.015 55 0.015 108 0.021 0.000 87.96 >400 +17:29:16 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:29:18 0.015 293 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:29:20 0.015 205 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:29:22 0.015 82 0.020 20.9 0.015 34.1 0.023 0.000 87.96 >400 +17:29:24 0.020 13.7 0.025 23.8 0.015 89 0.026 0.000 87.96 >400 +17:29:26 0.015 46 0.015 76 0.010 186 0.019 0.000 87.96 >400 +17:29:28 0.015 171 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +17:29:30 0.020 11.5 0.025 17.5 0.020 13.4 0.030 0.000 87.96 >400 +17:29:32 0.015 20.7 0.015 26.3 0.015 68 0.021 0.000 87.96 >400 +17:29:34 0.015 40 0.015 35.9 0.010 >400 0.021 0.000 87.96 >400 +17:29:36 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:29:38 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:29:40 0.020 24.1 0.020 26.6 0.020 11.7 0.027 0.000 87.96 >400 +17:29:42 0.015 29.3 0.015 21.3 0.015 128 0.021 0.000 87.96 >400 +17:29:44 0.015 256 0.020 25.9 0.020 N/A 0.029 0.000 87.96 >400 +17:29:46 0.030 23.3 0.045 20.1 0.030 18.5 0.055 0.000 87.96 >400 +17:29:48 0.020 11.6 0.015 35.9 0.015 45 0.021 0.000 87.96 >400 +17:29:50 0.015 293 0.015 293 0.010 >400 0.019 0.000 91.48 >400 +17:29:52 0.015 146 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:29:54 0.020 23.8 0.020 25.6 0.020 10.9 0.025 0.000 87.96 >400 +17:29:56 0.025 12.7 0.030 11.9 0.025 13.2 0.039 0.000 87.96 >400 +17:29:58 0.030 12.0 0.030 16.4 0.020 10.3 0.039 0.000 87.96 >400 +17:30:00 0.015 >400 0.020 13.7 0.015 >400 0.025 0.000 87.96 >400 +17:30:02 0.015 >400 0.020 13.4 0.015 66 0.022 0.000 87.96 >400 +17:30:04 0.025 16.9 0.020 11.2 0.020 23.5 0.029 0.000 87.96 >400 +17:30:06 0.015 18.5 0.015 >400 0.015 79 0.022 0.000 87.96 >400 +17:30:08 0.025 10.1 0.030 6.4 0.025 9.9 0.036 0.000 87.96 >400 +17:30:10 0.025 11.6 0.040 15.4 0.025 13.9 0.049 0.000 91.48 35.9 +17:30:12 0.015 27.3 0.020 15.3 0.015 30.6 0.025 0.000 87.96 >400 +17:30:14 0.015 6.5 0.020 19.5 0.015 171 0.022 0.000 91.48 137 +17:30:16 0.015 228 0.015 36.6 0.010 >400 0.021 0.000 87.96 >400 +17:30:18 0.015 >400 0.015 146 0.010 >400 0.021 0.000 87.96 >400 +17:30:20 0.015 171 0.025 28.8 0.015 47 0.027 0.000 87.96 >400 +17:30:22 0.015 51 0.015 48 0.015 120 0.022 0.000 87.96 >400 +17:30:24 0.015 38.6 0.020 25.6 0.015 79 0.025 0.000 87.96 >400 +17:30:26 0.015 54 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:30:28 0.015 16.8 0.020 16.8 0.015 25.6 0.024 0.000 87.96 >400 +17:30:30 0.015 >400 0.015 38.6 0.010 >400 0.019 0.000 87.96 >400 +17:30:32 0.020 14.0 0.020 9.6 0.020 10.0 0.029 0.000 87.96 >400 +17:30:34 0.015 19.3 0.015 22.3 0.015 19.5 0.023 0.000 87.96 >400 +17:30:36 0.015 79 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +17:30:38 0.015 57 0.015 38.6 0.015 228 0.019 0.000 87.96 >400 +17:30:40 0.015 89 0.015 37.9 0.015 42 0.021 0.000 87.96 >400 +17:30:42 0.020 12.1 0.020 16.9 0.015 >400 0.025 0.000 87.96 >400 +17:30:44 0.035 22.5 0.055 20.9 0.030 18.3 0.061 0.000 87.96 >400 +17:30:46 0.015 146 0.015 256 0.015 >400 0.021 0.000 87.96 >400 +17:30:48 0.015 108 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:30:50 0.010 >400 0.015 37.9 0.010 >400 0.019 0.000 87.96 >400 +17:30:52 0.015 35.9 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:30:54 0.020 13.8 0.030 14.5 0.020 14.8 0.036 0.000 87.96 >400 +17:30:56 0.025 11.8 0.025 13.7 0.025 11.1 0.032 0.000 87.96 >400 +17:30:58 0.030 12.6 0.040 11.2 0.030 12.9 0.048 0.000 91.48 256 +17:31:00 0.020 15.2 0.025 17.8 0.020 12.1 0.034 0.000 87.96 >400 +17:31:02 0.015 24.1 0.020 21.3 0.015 68 0.025 0.000 87.96 >400 +17:31:04 0.020 12.2 0.025 13.7 0.025 14.1 0.036 0.000 87.96 >400 +17:31:06 0.025 11.8 0.025 12.2 0.020 23.5 0.032 0.000 87.96 >400 +17:31:08 0.020 15.8 0.020 20.1 0.015 54 0.025 0.000 87.96 >400 +17:31:10 0.015 >400 0.015 68 0.015 59 0.021 0.000 87.96 >400 +17:31:12 0.015 128 0.020 15.8 0.015 19.3 0.025 0.000 87.96 >400 +17:31:14 0.030 11.1 0.030 10.5 0.025 10.6 0.037 0.000 87.96 >400 +17:31:16 0.025 9.9 0.035 11.0 0.030 10.6 0.041 0.000 87.96 >400 +17:31:18 0.025 28.1 0.035 23.0 0.015 40 0.038 0.000 87.96 >400 +17:31:20 0.015 37.9 0.015 24.7 0.015 205 0.021 0.000 87.96 >400 +17:31:22 0.020 31.5 0.020 25.9 0.015 38.6 0.025 0.000 87.96 >400 +17:31:24 0.020 8.8 0.020 11.6 0.020 11.0 0.025 0.000 87.96 >400 +17:31:26 0.095 8.1 0.070 32.0 0.105 7.1 0.128 0.000 91.48 12.6 +17:31:28 0.025 9.0 0.025 13.2 0.020 11.9 0.032 0.000 87.96 >400 +17:31:30 0.015 11.2 0.015 256 0.015 256 0.021 0.000 87.96 >400 +17:31:32 0.015 102 0.020 28.8 0.015 256 0.023 0.000 87.96 >400 +17:31:34 0.020 9.4 0.015 50 0.015 >400 0.022 0.000 87.96 >400 +17:31:36 0.020 18.8 0.015 54 0.015 >400 0.022 0.000 87.96 >400 +17:31:38 0.015 28.1 0.015 108 0.015 24.7 0.021 0.000 87.96 >400 +17:31:40 0.015 293 0.015 36.6 0.020 16.5 0.022 0.000 87.96 >400 +17:31:42 0.015 >400 0.015 23.0 0.010 >400 0.021 0.000 87.96 >400 +17:31:44 0.015 39.4 0.015 46 0.015 293 0.019 0.000 87.96 >400 +17:31:46 0.030 7.7 0.020 24.7 0.025 11.4 0.032 0.000 87.96 >400 +17:31:48 0.020 11.6 0.015 32.0 0.015 82 0.023 0.000 87.96 >400 +17:31:50 0.015 146 0.015 137 0.015 22.5 0.021 0.000 87.96 >400 +17:31:52 0.020 14.1 0.025 23.5 0.020 13.1 0.027 0.000 87.96 >400 +17:31:54 0.015 256 0.020 34.7 0.015 93 0.023 0.000 87.96 >400 +17:31:56 0.035 10.1 0.035 10.5 0.030 10.1 0.046 0.000 87.96 >400 +17:31:58 0.040 27.3 0.070 20.1 0.035 17.8 0.081 0.000 87.96 >400 +17:32:00 0.025 13.2 0.025 14.3 0.020 10.6 0.027 0.000 87.96 >400 +17:32:02 0.015 256 0.015 >400 0.015 >400 0.023 0.000 87.96 >400 +17:32:04 0.015 17.2 0.015 186 0.015 205 0.022 0.000 87.96 >400 +17:32:06 0.015 35.3 0.020 19.9 0.015 128 0.025 0.000 87.96 >400 +17:32:08 0.030 7.6 0.025 24.4 0.020 17.1 0.032 0.000 87.96 >400 +17:32:10 0.030 9.2 0.025 20.5 0.020 11.6 0.032 0.000 87.96 >400 +17:32:12 0.020 9.4 0.020 14.3 0.020 16.0 0.023 0.000 87.96 >400 +17:32:14 0.020 9.4 0.015 12.4 0.015 137 0.022 0.000 87.96 >400 +17:32:16 0.015 68 0.015 293 0.010 205 0.019 0.000 87.96 >400 +17:32:18 0.015 55 0.015 >400 0.015 205 0.022 0.000 87.96 >400 +17:32:20 0.015 256 0.020 10.3 0.015 186 0.025 0.000 87.96 >400 +17:32:22 0.020 12.1 0.020 32.0 0.015 >400 0.027 0.000 87.96 >400 +17:32:24 0.020 6.5 0.015 34.1 0.015 35.9 0.023 0.000 87.96 >400 +17:32:26 0.020 12.2 0.015 89 0.015 22.0 0.022 0.000 87.96 >400 +17:32:28 0.040 5.2 0.020 25.6 0.025 8.2 0.042 0.000 87.96 >400 +17:32:30 0.025 38.6 0.020 17.7 0.020 22.5 0.031 0.000 87.96 >400 +17:32:32 0.030 6.5 0.020 9.1 0.015 34.1 0.031 0.000 87.96 >400 +17:32:34 0.025 5.9 0.020 25.9 0.015 21.6 0.027 0.000 87.96 >400 +17:32:36 0.025 10.7 0.020 39.4 0.020 21.6 0.026 0.000 87.96 >400 +17:32:38 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:32:40 0.015 79 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:32:42 0.020 18.3 0.020 10.0 0.015 137 0.025 0.000 87.96 >400 +17:32:44 0.025 10.7 0.030 15.2 0.020 16.9 0.036 0.000 87.96 >400 +17:32:46 0.015 14.8 0.015 62 0.015 293 0.022 0.000 87.96 >400 +17:32:48 0.015 >400 0.020 10.7 0.015 25.6 0.027 0.000 87.96 >400 +17:32:50 0.020 13.4 0.025 11.5 0.020 11.4 0.030 0.000 87.96 >400 +17:32:52 0.015 137 0.020 19.7 0.015 76 0.025 0.000 87.96 >400 +17:32:54 0.010 >400 0.015 79 0.015 50 0.019 0.000 87.96 >400 +17:32:56 0.015 171 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:32:58 0.015 120 0.015 158 0.010 >400 0.021 0.000 87.96 >400 +17:33:00 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:33:02 0.015 50 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:33:04 0.015 79 0.015 34.1 0.010 >400 0.019 0.000 91.48 341 +17:33:06 0.015 158 0.015 37.2 0.015 >400 0.019 0.000 87.96 >400 +17:33:08 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:33:10 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:12 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:14 0.015 228 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:16 0.015 158 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:33:18 0.015 171 0.015 128 0.015 37.2 0.019 0.000 87.96 >400 +17:33:20 0.015 >400 0.020 18.0 0.020 9.0 0.025 0.000 87.96 >400 +17:33:22 0.025 11.0 0.030 10.7 0.020 12.7 0.036 0.000 87.96 >400 +17:33:24 0.025 22.5 0.030 19.0 0.020 19.7 0.036 0.000 87.96 >400 +17:33:26 0.015 205 0.015 120 0.015 62 0.019 0.000 87.96 >400 +17:33:28 0.015 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +17:33:30 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:33:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:34 0.015 158 0.015 171 0.010 >400 0.017 0.000 87.96 >400 +17:33:36 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:38 0.020 27.3 0.020 30.6 0.015 >400 0.023 0.000 87.96 >400 +17:33:40 0.020 20.1 0.025 20.1 0.020 13.3 0.031 0.000 87.96 >400 +17:33:42 0.020 11.6 0.030 10.8 0.025 11.6 0.039 0.000 87.96 >400 +17:33:44 0.015 102 0.015 32.5 0.015 66 0.021 0.000 87.96 >400 +17:33:46 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:33:48 0.015 >400 0.015 >400 0.015 >400 0.019 0.000 91.48 >400 +17:33:50 0.015 186 0.015 89 0.015 108 0.023 0.000 87.96 >400 +17:33:52 0.015 43 0.015 114 0.015 102 0.021 0.000 87.96 >400 +17:33:54 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:33:56 0.010 128 0.015 85 0.015 137 0.021 0.000 87.96 >400 +17:33:58 0.015 >400 0.015 >400 0.015 114 0.019 0.000 87.96 >400 +17:34:00 0.015 73 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:34:02 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:34:04 0.015 39.4 0.015 171 0.015 >400 0.021 0.000 87.96 >400 +17:34:06 0.015 25.9 0.015 186 0.015 137 0.019 0.000 87.96 >400 +17:34:08 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:34:10 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:34:12 0.015 35.3 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:34:14 0.015 228 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:34:16 0.015 >400 0.015 158 0.015 >400 0.021 0.000 87.96 >400 +17:34:18 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:34:20 0.025 10.0 0.025 16.1 0.020 13.5 0.034 0.000 87.96 >400 +17:34:22 0.025 14.8 0.035 13.9 0.025 13.3 0.044 0.000 91.48 >400 +17:34:24 0.015 >400 0.015 27.7 0.010 20.7 0.019 0.000 87.96 >400 +17:34:26 0.015 28.8 0.020 29.7 0.015 228 0.023 0.000 87.96 >400 +17:34:28 0.015 >400 0.015 33.0 0.010 >400 0.017 0.000 87.96 >400 +17:34:30 0.010 >400 0.015 68 0.010 >400 0.017 0.000 87.96 >400 +17:34:32 0.010 >400 0.015 89 0.010 >400 0.017 0.000 87.96 >400 +17:34:34 0.010 >400 0.015 341 0.010 >400 0.021 0.000 87.96 >400 +17:34:36 0.015 228 0.020 25.3 0.015 >400 0.023 0.000 87.96 >400 +17:34:38 0.015 89 0.020 34.7 0.010 >400 0.021 0.000 87.96 >400 +17:34:40 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:34:42 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:34:44 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:34:46 0.015 171 0.015 62 0.015 9.8 0.022 0.000 87.96 >400 +17:34:48 0.010 >400 0.015 114 0.010 >400 0.017 0.000 87.96 >400 +17:34:50 0.015 256 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:34:52 0.015 >400 0.015 256 0.015 102 0.019 0.000 87.96 >400 +17:34:54 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:34:56 0.015 38.6 0.015 >400 0.015 20.7 0.022 0.000 87.96 >400 +17:34:58 0.015 >400 0.015 62 0.010 >400 0.021 0.000 87.96 >400 +17:35:00 0.020 N/A 0.025 17.1 0.020 13.0 0.029 0.000 87.96 >400 +17:35:02 0.020 14.0 0.020 22.3 0.015 228 0.025 0.000 87.96 >400 +17:35:04 0.025 12.3 0.030 12.7 0.025 12.4 0.040 0.000 87.96 >400 +17:35:06 0.020 16.0 0.020 17.7 0.015 14.8 0.025 0.000 87.96 >400 +17:35:08 0.020 13.0 0.020 16.1 0.015 256 0.027 0.000 87.96 >400 +17:35:10 0.025 16.0 0.030 19.1 0.020 19.5 0.036 0.000 87.96 >400 +17:35:12 0.020 18.1 0.020 15.1 0.015 31.5 0.023 0.000 87.96 >400 +17:35:14 0.015 19.7 0.020 29.3 0.015 24.7 0.023 0.000 87.96 >400 +17:35:16 0.015 293 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +17:35:18 0.015 18.8 0.015 26.6 0.010 >400 0.021 0.000 87.96 >400 +17:35:20 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:35:22 0.015 171 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:35:24 0.015 137 0.015 33.0 0.010 >400 0.019 0.000 87.96 >400 +17:35:26 0.015 120 0.020 19.0 0.015 76 0.025 0.000 87.96 >400 +17:35:28 0.015 25.9 0.020 23.8 0.015 93 0.025 0.000 87.96 >400 +17:35:30 0.015 128 0.015 49 0.015 98 0.022 0.000 87.96 >400 +17:35:32 0.020 14.5 0.025 13.9 0.020 14.5 0.032 0.000 91.48 >400 +17:35:34 0.020 19.7 0.025 20.7 0.015 158 0.030 0.000 87.96 >400 +17:35:36 0.020 12.5 0.020 18.1 0.015 51 0.025 0.000 87.96 >400 +17:35:38 0.015 >400 0.020 17.1 0.015 18.3 0.025 0.000 87.96 >400 +17:35:40 0.015 256 0.015 256 0.015 59 0.023 0.000 87.96 >400 +17:35:42 0.010 >400 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +17:35:44 0.015 73 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +17:35:46 0.015 55 0.015 341 0.010 >400 0.021 0.000 87.96 >400 +17:35:48 0.015 293 0.015 120 0.010 >400 0.021 0.000 91.48 >400 +17:35:50 0.015 >400 0.015 228 0.010 >400 0.017 0.000 87.96 >400 +17:35:52 0.015 128 0.015 205 0.015 158 0.022 0.000 87.96 >400 +17:35:54 0.015 128 0.015 19.5 0.015 35.9 0.021 0.000 87.96 >400 +17:35:56 0.015 28.8 0.025 23.0 0.015 89 0.027 0.000 87.96 >400 +17:35:58 0.020 13.0 0.020 11.0 0.015 18.5 0.025 0.000 87.96 >400 +17:36:00 0.015 >400 0.015 79 0.015 293 0.019 0.000 87.96 >400 +17:36:02 0.020 33.6 0.025 24.1 0.015 28.4 0.029 0.000 87.96 >400 +17:36:04 0.015 66 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:36:06 0.015 >400 0.015 68 0.010 >400 0.019 0.000 91.48 >400 +17:36:08 0.015 293 0.015 62 0.010 >400 0.019 0.000 87.96 >400 +17:36:10 0.015 >400 0.015 293 0.010 >400 0.021 0.000 87.96 >400 +17:36:12 0.015 171 0.025 8.6 0.020 12.3 0.031 0.000 87.96 >400 +17:36:14 0.015 >400 0.015 341 0.015 146 0.019 0.000 91.48 >400 +17:36:16 0.015 N/A 0.030 12.2 0.030 N/A 0.042 0.000 91.48 293 +17:36:18 0.020 15.4 0.025 10.6 0.020 16.0 0.031 0.000 91.48 76 +17:36:20 0.010 >400 0.015 79 0.015 >400 0.019 0.000 87.96 >400 +17:36:22 0.015 >400 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +17:36:24 0.015 36.6 0.015 120 0.015 12.5 0.022 0.000 87.96 >400 +17:36:26 0.015 228 0.015 46 0.015 >400 0.019 0.000 87.96 >400 +17:36:28 0.010 >400 0.015 26.3 0.010 >400 0.019 0.000 87.96 >400 +17:36:30 0.015 68 0.015 171 0.015 205 0.022 0.000 87.96 >400 +17:36:32 0.010 >400 0.015 293 0.010 >400 0.018 0.000 87.96 >400 +17:36:34 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:36:36 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:36:38 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:36:40 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:36:42 0.010 >400 0.015 114 0.015 >400 0.021 0.000 87.96 >400 +17:36:44 0.010 >400 0.015 128 0.015 >400 0.023 0.000 87.96 >400 +17:36:46 0.020 11.4 0.025 10.6 0.015 >400 0.027 0.000 87.96 >400 +17:36:48 0.015 102 0.015 35.3 0.010 >400 0.021 0.000 87.96 >400 +17:36:50 0.015 158 0.015 22.5 0.015 48 0.021 0.000 87.96 >400 +17:36:52 0.010 >400 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +17:36:54 0.015 >400 0.015 48 0.010 >400 0.019 0.000 87.96 >400 +17:36:56 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:36:58 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:37:00 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:02 0.010 >400 0.015 85 0.010 >400 0.021 0.000 87.96 >400 +17:37:04 0.010 >400 0.015 256 0.015 293 0.019 0.000 87.96 >400 +17:37:06 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:08 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:37:10 0.015 98 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:12 0.015 >400 0.015 31.0 0.010 >400 0.019 0.000 87.96 >400 +17:37:14 0.015 228 0.020 N/A 0.015 120 0.024 0.000 87.96 >400 +17:37:16 0.015 57 0.020 15.9 0.015 89 0.023 0.000 87.96 >400 +17:37:18 0.015 36.6 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +17:37:20 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:37:22 0.015 46 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:24 0.015 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:37:26 0.015 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:37:28 0.015 16.5 0.015 82 0.015 >400 0.021 0.000 87.96 >400 +17:37:30 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:32 0.015 341 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:37:34 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:37:36 0.010 >400 0.015 54 0.010 >400 0.021 0.000 87.96 >400 +17:37:38 0.015 >400 0.015 73 0.015 146 0.021 0.000 91.48 >400 +17:37:40 0.015 40 0.015 171 0.015 >400 0.019 0.000 91.48 341 +17:37:42 0.015 114 0.015 66 0.010 >400 0.019 0.000 91.48 >400 +17:37:44 0.015 186 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:37:46 0.015 158 0.015 256 0.015 18.8 0.022 0.000 91.48 >400 +17:37:48 0.020 12.8 0.025 8.8 0.020 4.3 0.032 0.000 87.96 >400 +17:37:50 0.015 17.7 0.025 10.2 0.015 21.6 0.027 0.000 87.96 >400 +17:37:52 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:37:54 0.015 22.0 0.015 71 0.015 >400 0.021 0.000 87.96 >400 +17:37:56 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:37:58 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:38:00 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:38:02 0.015 256 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:38:04 0.015 45 0.020 25.0 0.015 44 0.022 0.000 87.96 >400 +17:38:06 0.025 6.0 0.020 37.9 0.020 16.3 0.032 0.000 87.96 >400 +17:38:08 0.060 N/A 0.060 26.9 0.050 10.3 0.079 0.000 91.48 >400 +17:38:10 0.065 9.7 0.050 11.4 0.090 9.6 0.099 0.000 91.48 93 +17:38:12 0.015 82 0.030 25.3 0.020 21.8 0.036 0.000 87.96 >400 +17:38:14 0.015 11.4 0.015 102 0.015 55 0.021 0.000 87.96 >400 +17:38:16 0.015 137 0.020 27.3 0.015 31.5 0.025 0.000 87.96 >400 +17:38:18 0.010 >400 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:38:20 0.010 >400 0.015 >400 0.015 186 0.019 0.000 87.96 >400 +17:38:22 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:38:24 0.030 14.3 0.040 12.4 0.025 12.0 0.047 0.000 87.96 >400 +17:38:26 0.025 11.2 0.030 14.7 0.020 14.6 0.036 0.000 87.96 >400 +17:38:28 0.020 16.1 0.025 16.0 0.025 13.5 0.035 0.000 87.96 >400 +17:38:30 0.020 16.0 0.015 33.6 0.015 137 0.022 0.000 87.96 >400 +17:38:32 0.015 76 0.020 26.6 0.015 128 0.023 0.000 87.96 >400 +17:38:34 0.015 60 0.015 41 0.015 >400 0.019 0.000 87.96 >400 +17:38:36 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:38:38 0.015 89 0.015 93 0.010 >400 0.019 0.000 91.48 >400 +17:38:40 0.020 N/A 0.030 19.0 0.020 15.3 0.034 0.000 87.96 >400 +17:38:42 0.025 16.1 0.030 14.2 0.025 13.8 0.036 0.000 87.96 >400 +17:38:44 0.020 21.8 0.020 19.7 0.015 31.5 0.025 0.000 87.96 >400 +17:38:46 0.015 25.0 0.025 20.3 0.015 >400 0.027 0.000 87.96 >400 +17:38:48 0.015 128 0.020 9.1 0.015 23.5 0.023 0.000 87.96 >400 +17:38:50 0.020 17.2 0.020 13.4 0.020 15.6 0.030 0.000 91.48 >400 +17:38:52 0.020 17.7 0.025 9.6 0.020 14.6 0.032 0.000 87.96 >400 +17:38:54 0.030 10.1 0.030 13.7 0.030 11.3 0.043 0.000 87.96 >400 +17:38:56 0.015 35.9 0.015 33.6 0.015 158 0.019 0.000 87.96 >400 +17:38:58 0.020 11.2 0.020 17.8 0.025 11.7 0.029 0.000 87.96 >400 +17:39:00 0.020 15.3 0.030 12.0 0.020 13.9 0.034 0.000 87.96 >400 +17:39:02 0.025 11.6 0.035 13.2 0.020 13.0 0.039 0.000 87.96 >400 +17:39:04 0.030 10.7 0.045 10.6 0.040 11.8 0.062 0.000 91.48 76 +17:39:06 0.030 25.0 0.040 19.5 0.025 20.1 0.045 0.000 87.96 >400 +17:39:08 0.015 341 0.015 93 0.015 >400 0.021 0.000 87.96 >400 +17:39:10 0.010 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:39:12 0.015 68 0.020 7.9 0.020 8.8 0.025 0.000 87.96 >400 +17:39:14 0.035 11.4 0.035 11.1 0.030 8.8 0.041 0.000 87.96 >400 +17:39:16 0.045 22.0 0.055 22.0 0.030 23.5 0.061 0.000 87.96 >400 +17:39:18 0.015 293 0.015 37.9 0.010 >400 0.019 0.000 87.96 >400 +17:39:20 0.015 79 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +17:39:22 0.015 59 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:39:24 0.015 293 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:39:26 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:39:28 0.010 >400 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:39:30 0.015 >400 0.020 19.9 0.020 9.4 0.025 0.000 87.96 >400 +17:39:32 0.025 14.4 0.025 11.4 0.020 16.1 0.031 0.000 87.96 >400 +17:39:34 0.030 9.8 0.040 9.3 0.035 9.7 0.055 0.000 91.48 44 +17:39:36 0.020 12.5 0.025 16.1 0.025 10.7 0.032 0.000 87.96 >400 +17:39:38 0.015 14.0 0.015 205 0.015 256 0.021 0.000 87.96 >400 +17:39:40 0.015 256 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:39:42 0.015 59 0.015 205 0.010 >400 0.021 0.000 91.48 >400 +17:39:44 0.015 256 0.015 256 0.010 >400 0.019 0.000 91.48 >400 +17:39:46 0.015 >400 0.015 137 0.015 98 0.019 0.000 87.96 >400 +17:39:48 0.015 186 0.015 >400 0.015 171 0.019 0.000 87.96 >400 +17:39:50 0.020 16.0 0.020 15.3 0.015 82 0.027 0.000 87.96 >400 +17:39:52 0.015 48 0.020 12.8 0.020 13.2 0.030 0.000 91.48 >400 +17:39:54 0.015 18.1 0.020 21.6 0.015 108 0.023 0.000 87.96 >400 +17:39:56 0.020 16.9 0.020 10.7 0.015 23.3 0.025 0.000 91.48 >400 +17:39:58 0.015 186 0.015 28.1 0.015 45 0.019 0.000 87.96 >400 +17:40:00 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:40:02 0.015 137 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:40:04 0.015 >400 0.015 102 0.015 171 0.021 0.000 87.96 >400 +17:40:06 0.015 293 0.020 25.9 0.015 108 0.023 0.000 87.96 >400 +17:40:08 0.015 79 0.015 33.6 0.015 50 0.019 0.000 87.96 >400 +17:40:10 0.015 37.2 0.020 38.6 0.015 34.7 0.024 0.000 87.96 >400 +17:40:12 0.015 256 0.015 293 0.010 >400 0.021 0.000 87.96 >400 +17:40:14 0.015 31.0 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +17:40:16 0.015 >400 0.015 47 0.010 >400 0.019 0.000 87.96 >400 +17:40:18 0.010 341 0.015 60 0.010 >400 0.019 0.000 91.48 >400 +17:40:20 0.010 >400 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +17:40:22 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:40:24 0.015 108 0.015 73 0.015 >400 0.019 0.000 87.96 >400 +17:40:26 0.015 43 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +17:40:28 0.015 76 0.015 35.9 0.010 >400 0.021 0.000 87.96 >400 +17:40:30 0.015 85 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:40:32 0.015 20.7 0.015 137 0.015 >400 0.023 0.000 87.96 >400 +17:40:34 0.020 20.3 0.015 25.9 0.015 171 0.023 0.000 87.96 >400 +17:40:36 0.015 256 0.020 24.1 0.015 48 0.023 0.000 87.96 >400 +17:40:38 0.025 14.1 0.025 19.0 0.015 17.7 0.033 0.000 87.96 >400 +17:40:40 0.015 57 0.020 22.5 0.015 93 0.023 0.000 87.96 >400 +17:40:42 0.025 16.1 0.025 17.4 0.020 22.8 0.030 0.000 87.96 >400 +17:40:44 0.015 186 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:40:46 0.015 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:40:48 0.010 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +17:40:50 0.015 186 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:40:52 0.010 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:40:54 0.015 341 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:40:56 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +17:40:58 0.015 108 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +17:41:00 0.015 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:41:02 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:41:04 0.010 >400 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:41:06 0.010 >400 0.015 55 0.015 114 0.019 0.000 87.96 >400 +17:41:08 0.010 >400 0.015 36.6 0.010 >400 0.019 0.000 91.48 >400 +17:41:10 0.015 186 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:41:12 0.020 21.8 0.030 8.7 0.030 5.0 0.043 0.000 87.96 >400 +17:41:14 0.020 10.8 0.020 13.0 0.015 293 0.027 0.000 87.96 >400 +17:41:16 0.015 256 0.015 128 0.015 293 0.019 0.000 87.96 >400 +17:41:18 0.020 10.6 0.015 293 0.015 17.7 0.023 0.000 87.96 >400 +17:41:20 0.015 31.0 0.015 35.9 0.015 128 0.022 0.000 87.96 >400 +17:41:22 0.015 137 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +17:41:24 0.015 16.9 0.020 30.1 0.015 57 0.024 0.000 87.96 >400 +17:41:26 0.020 15.1 0.025 16.5 0.020 14.2 0.032 0.000 87.96 >400 +17:41:28 0.020 13.8 0.025 11.8 0.020 14.5 0.032 0.000 87.96 >400 +17:41:30 0.015 89 0.020 29.3 0.015 158 0.025 0.000 87.96 >400 +17:41:32 0.015 42 0.015 93 0.015 293 0.019 0.000 87.96 >400 +17:41:34 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:41:36 0.015 20.9 0.015 >400 0.010 >400 0.021 0.000 91.48 >400 +17:41:38 0.015 89 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:41:40 0.015 114 0.025 25.3 0.015 33.0 0.030 0.000 87.96 >400 +17:41:42 0.015 >400 0.015 205 0.010 >400 0.017 0.000 87.96 >400 +17:41:44 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:41:46 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:41:48 0.015 35.3 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:41:50 0.020 14.5 0.015 89 0.015 82 0.022 0.000 87.96 >400 +17:41:52 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:41:54 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:41:56 0.015 293 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:41:58 0.015 341 0.015 64 0.010 >400 0.021 0.000 87.96 >400 +17:42:00 0.010 >400 0.015 341 0.015 256 0.019 0.000 87.96 >400 +17:42:02 0.015 12.7 0.010 >400 0.010 >400 0.019 0.000 87.96 >400 +17:42:04 0.015 26.6 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +17:42:06 0.015 45 0.015 21.3 0.015 76 0.021 0.000 87.96 >400 +17:42:08 0.015 47 0.015 256 0.015 108 0.019 0.000 91.48 >400 +17:42:10 0.010 >400 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +17:42:12 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:42:14 0.020 9.1 0.020 9.1 0.015 48 0.025 0.000 91.48 >400 +17:42:16 0.015 45 0.020 22.5 0.015 186 0.027 0.000 87.96 >400 +17:42:18 0.095 11.0 0.085 9.1 0.080 9.9 0.126 0.000 91.48 22.3 +17:42:20 0.015 >400 0.020 11.3 0.015 26.9 0.027 0.000 87.96 341 +17:42:22 0.015 82 0.020 22.3 0.015 341 0.023 0.000 87.96 >400 +17:42:24 0.015 256 0.015 186 0.015 >400 0.022 0.000 87.96 >400 +17:42:26 0.015 >400 0.015 54 0.010 >400 0.019 0.000 91.48 158 +17:42:28 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +17:42:30 0.015 158 0.020 18.5 0.015 171 0.022 0.000 91.48 256 +17:42:32 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:42:34 0.015 146 0.015 71 0.015 >400 0.019 0.000 87.96 >400 +17:42:36 0.015 108 0.020 19.0 0.015 82 0.023 0.000 91.48 341 +17:42:38 0.015 19.3 0.020 25.6 0.010 >400 0.025 0.000 91.48 256 +17:42:40 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +17:42:42 0.010 >400 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +17:42:44 0.015 186 0.020 22.8 0.015 >400 0.024 0.000 91.48 15.1 +17:42:46 0.015 59 0.015 59 0.015 79 0.021 0.000 87.96 171 +17:42:48 0.015 256 0.020 21.1 0.010 >400 0.023 0.000 91.48 >400 +17:42:50 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +17:42:52 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:42:54 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:42:56 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:42:58 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:43:00 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:43:02 0.015 76 0.020 34.7 0.010 >400 0.024 0.000 87.96 >400 +17:43:04 0.015 73 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:43:06 0.015 93 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:43:08 0.015 158 0.015 68 0.010 341 0.021 0.000 87.96 >400 +17:43:10 0.015 93 0.015 66 0.010 >400 0.021 0.000 91.48 341 +17:43:12 0.015 >400 0.015 33.0 0.010 >400 0.019 0.000 91.48 341 +17:43:14 0.015 >400 0.015 53 0.015 256 0.019 0.000 87.96 >400 +17:43:16 0.015 76 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:43:18 0.015 73 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +17:43:20 0.015 55 0.015 89 0.015 >400 0.022 0.000 87.96 >400 +17:43:22 0.015 46 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:43:24 0.015 93 0.015 45 0.015 37.2 0.019 0.000 87.96 >400 +17:43:26 0.015 >400 0.015 137 0.015 37.9 0.021 0.000 87.96 >400 +17:43:28 0.045 24.4 0.060 26.6 0.030 21.3 0.066 0.000 91.48 >400 +17:43:30 0.030 9.9 0.025 14.9 0.020 13.4 0.032 0.000 87.96 >400 +17:43:32 0.025 13.3 0.030 16.3 0.015 16.7 0.034 0.000 87.96 >400 +17:43:34 0.015 >400 0.015 137 0.015 >400 0.019 0.000 87.96 >400 +17:43:36 0.015 256 0.015 66 0.010 >400 0.021 0.000 87.96 >400 +17:43:38 0.015 37.9 0.015 >400 0.015 68 0.021 0.000 87.96 >400 +17:43:40 0.015 >400 0.015 228 0.015 59 0.021 0.000 91.48 >400 +17:43:42 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:43:44 0.015 82 0.015 341 0.010 256 0.021 0.000 87.96 >400 +17:43:46 0.015 40 0.015 59 0.015 146 0.021 0.000 87.96 >400 +17:43:48 0.015 >400 0.015 71 0.015 >400 0.019 0.000 87.96 >400 +17:43:50 0.015 66 0.015 89 0.015 >400 0.019 0.000 87.96 >400 +17:43:52 0.020 8.5 0.020 11.3 0.015 98 0.025 0.000 87.96 >400 +17:43:54 0.015 98 0.015 31.5 0.015 186 0.019 0.000 87.96 >400 +17:43:56 0.015 59 0.015 19.7 0.010 >400 0.022 0.000 87.96 >400 +17:43:58 0.015 25.6 0.015 20.7 0.010 >400 0.021 0.000 87.96 >400 +17:44:00 0.015 51 0.015 171 0.015 93 0.022 0.000 91.48 146 +17:44:02 0.015 44 0.015 98 0.015 341 0.019 0.000 87.96 >400 +17:44:04 0.015 114 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:44:06 0.015 >400 0.015 68 0.010 >400 0.017 0.000 87.96 >400 +17:44:08 0.015 293 0.015 171 0.015 146 0.021 0.000 87.96 >400 +17:44:10 0.015 >400 0.015 76 0.015 293 0.021 0.000 87.96 >400 +17:44:12 0.015 108 0.015 >400 0.015 256 0.021 0.000 87.96 >400 +17:44:14 0.015 205 0.015 98 0.010 256 0.019 0.000 87.96 >400 +17:44:16 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:44:18 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +17:44:20 0.015 >400 0.015 256 0.010 >400 0.019 0.000 91.48 >400 +17:44:22 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +17:44:24 0.015 293 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:44:26 0.015 186 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:44:28 0.010 >400 0.015 54 0.010 >400 0.019 0.000 87.96 >400 +17:44:30 0.015 79 0.015 73 0.015 89 0.022 0.000 87.96 >400 +17:44:32 0.015 93 0.015 17.4 0.015 137 0.022 0.000 91.48 >400 +17:44:34 0.015 19.9 0.015 34.1 0.015 82 0.021 0.000 87.96 >400 +17:44:36 0.015 79 0.015 23.0 0.015 256 0.022 0.000 91.48 256 +17:44:38 0.015 >400 0.015 >400 0.015 171 0.022 0.000 87.96 >400 +17:44:40 0.015 37.2 0.015 41 0.015 256 0.021 0.000 87.96 >400 +17:44:42 0.015 33.6 0.020 18.3 0.015 >400 0.023 0.000 91.48 85 +17:44:44 0.015 20.3 0.015 17.4 0.015 >400 0.022 0.000 91.48 >400 +17:44:46 0.015 21.3 0.015 341 0.015 228 0.021 0.000 87.96 >400 +17:44:48 0.015 >400 0.015 29.3 0.015 22.5 0.019 0.000 91.48 >400 +17:44:50 0.015 18.8 0.015 48 0.010 >400 0.021 0.000 87.96 >400 +17:44:52 0.015 38.6 0.015 171 0.015 >400 0.022 0.000 91.48 293 +17:44:54 0.015 137 0.015 48 0.015 256 0.022 0.000 87.96 >400 +17:44:56 0.015 60 0.015 85 0.015 256 0.021 0.000 87.96 >400 +17:44:58 0.015 256 0.015 256 0.015 256 0.019 0.000 87.96 >400 +17:45:00 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:45:02 0.015 21.3 0.015 62 0.015 114 0.021 0.000 87.96 >400 +17:45:04 0.015 >400 0.015 114 0.015 82 0.019 0.000 87.96 >400 +17:45:06 0.015 137 0.015 >400 0.015 341 0.021 0.000 87.96 >400 +17:45:08 0.015 93 0.015 146 0.015 146 0.021 0.000 87.96 >400 +17:45:10 0.015 33.0 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:45:12 0.015 114 0.015 30.1 0.010 >400 0.021 0.000 87.96 >400 +17:45:14 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:45:16 0.015 >400 0.015 128 0.010 >400 0.021 0.000 87.96 >400 +17:45:18 0.015 >400 0.015 >400 0.015 68 0.022 0.000 87.96 >400 +17:45:20 0.015 158 0.015 256 0.015 >400 0.021 0.000 91.48 >400 +17:45:22 0.015 76 0.015 93 0.015 171 0.019 0.000 87.96 >400 +17:45:24 0.015 46 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +17:45:26 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:45:28 0.015 >400 0.015 171 0.015 128 0.021 0.000 91.48 >400 +17:45:30 0.015 102 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:45:32 0.015 >400 0.015 38.6 0.010 >400 0.019 0.000 87.96 >400 +17:45:34 0.015 82 0.015 76 0.010 >400 0.022 0.000 87.96 >400 +17:45:36 0.015 36.6 0.015 29.3 0.010 >400 0.021 0.000 87.96 >400 +17:45:38 0.015 85 0.015 >400 0.015 341 0.019 0.000 87.96 >400 +17:45:40 0.015 158 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:45:42 0.015 >400 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:45:44 0.015 >400 0.015 64 0.015 293 0.022 0.000 87.96 >400 +17:45:46 0.015 85 0.020 24.7 0.015 17.5 0.027 0.000 87.96 >400 +17:45:48 0.020 16.8 0.020 21.1 0.015 >400 0.023 0.000 91.48 >400 +17:45:50 0.015 89 0.020 18.1 0.015 18.8 0.023 0.000 91.48 >400 +17:45:52 0.015 82 0.015 >400 0.015 57 0.022 0.000 87.96 >400 +17:45:54 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:45:56 0.015 293 0.020 22.3 0.015 93 0.022 0.000 91.48 >400 +17:45:58 0.015 45 0.020 68 0.015 82 0.025 0.000 87.96 >400 +17:46:00 0.020 32.5 0.020 33.6 0.015 46 0.023 0.000 87.96 >400 +17:46:02 0.015 20.9 0.020 24.1 0.015 79 0.023 0.000 87.96 >400 +17:46:04 0.015 293 0.020 32.5 0.015 40 0.023 0.000 87.96 >400 +17:46:06 0.020 10.8 0.020 20.1 0.015 205 0.025 0.000 91.48 54 +17:46:08 0.020 17.5 0.020 44 0.015 59 0.025 0.000 87.96 >400 +17:46:10 0.020 16.3 0.020 20.1 0.015 171 0.025 0.000 87.96 >400 +17:46:12 0.015 108 0.015 24.1 0.015 73 0.021 0.000 87.96 >400 +17:46:14 0.015 24.1 0.020 14.5 0.015 128 0.022 0.000 87.96 >400 +17:46:16 0.015 60 0.015 25.9 0.015 62 0.022 0.000 87.96 >400 +17:46:18 0.015 71 0.020 32.0 0.015 114 0.023 0.000 87.96 205 +17:46:20 0.020 18.5 0.020 20.9 0.015 21.3 0.023 0.000 91.48 293 +17:46:22 0.015 186 0.015 137 0.015 34.7 0.022 0.000 87.96 >400 +17:46:24 0.015 21.1 0.015 48 0.015 85 0.022 0.000 87.96 >400 +17:46:26 0.015 18.8 0.020 16.0 0.015 44 0.023 0.000 87.96 >400 +17:46:28 0.015 66 0.020 44 0.020 15.3 0.025 0.000 91.48 146 +17:46:30 0.020 10.0 0.020 11.0 0.015 >400 0.023 0.000 91.48 >400 +17:46:32 0.015 82 0.020 43 0.015 71 0.023 0.000 91.48 158 +17:46:34 0.015 15.3 0.020 20.1 0.015 >400 0.023 0.000 87.96 71 +17:46:36 0.015 37.2 0.020 17.4 0.015 19.0 0.022 0.000 87.96 >400 +17:46:38 0.015 64 0.020 28.8 0.015 >400 0.023 0.000 91.48 >400 +17:46:40 0.020 14.7 0.020 21.1 0.015 228 0.025 0.000 91.48 146 +17:46:42 0.020 8.1 0.020 31.5 0.015 21.1 0.024 0.000 91.48 256 +17:46:44 0.020 13.3 0.025 11.1 0.020 43 0.030 0.000 91.48 120 +17:46:46 0.020 14.6 0.025 38.6 0.025 7.8 0.028 0.000 91.48 186 +17:46:48 0.020 13.5 0.020 20.1 0.020 10.1 0.023 0.000 91.48 76 +17:46:50 0.020 14.0 0.020 16.4 0.020 9.2 0.028 0.000 91.48 >400 +17:46:52 0.020 11.9 0.020 13.0 0.015 45 0.025 0.000 91.48 >400 +17:46:54 0.020 8.5 0.020 34.7 0.020 10.0 0.025 0.000 87.96 >400 +17:46:56 0.020 16.3 0.020 14.2 0.015 64 0.027 0.000 91.48 228 +17:46:58 0.020 15.4 0.020 41 0.020 13.0 0.025 0.000 91.48 341 +17:47:00 0.015 25.3 0.020 18.5 0.015 186 0.023 0.000 91.48 256 +17:47:02 0.025 5.5 0.035 9.8 0.025 10.3 0.042 0.000 93.98 16.1 +17:47:04 0.020 12.5 0.020 16.4 0.015 12.6 0.024 0.000 91.48 158 +17:47:06 0.020 13.9 0.020 17.1 0.015 68 0.024 0.000 87.96 >400 +17:47:08 0.020 13.1 0.020 12.2 0.015 256 0.025 0.000 87.96 >400 +17:47:10 0.015 256 0.020 15.9 0.015 66 0.023 0.000 91.48 137 +17:47:12 0.015 >400 0.020 16.1 0.015 54 0.023 0.000 87.96 120 +17:47:14 0.015 30.1 0.020 17.8 0.015 49 0.023 0.000 91.48 >400 +17:47:16 0.015 93 0.020 18.5 0.015 50 0.023 0.000 87.96 >400 +17:47:18 0.025 10.5 0.025 13.0 0.015 13.1 0.032 0.000 91.48 293 +17:47:20 0.015 293 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:47:22 0.015 73 0.015 45 0.015 341 0.021 0.000 87.96 >400 +17:47:24 0.065 23.8 0.090 20.5 0.050 15.8 0.106 0.000 91.48 53 +17:47:26 0.020 11.9 0.020 11.3 0.020 10.7 0.027 0.000 87.96 >400 +17:47:28 0.020 9.5 0.020 31.5 0.015 17.5 0.023 0.000 91.48 158 +17:47:30 0.020 21.1 0.025 13.8 0.020 12.6 0.029 0.000 91.48 47 +17:47:32 0.015 50 0.015 73 0.015 76 0.022 0.000 87.96 >400 +17:47:34 0.015 26.9 0.015 34.7 0.015 44 0.022 0.000 87.96 >400 +17:47:36 0.015 >400 0.020 20.7 0.015 57 0.023 0.000 87.96 >400 +17:47:38 0.015 >400 0.015 293 0.020 11.2 0.023 0.000 87.96 >400 +17:47:40 0.015 25.0 0.015 55 0.015 108 0.019 0.000 87.96 >400 +17:47:42 0.020 12.2 0.020 29.7 0.015 59 0.025 0.000 91.48 >400 +17:47:44 0.015 16.8 0.015 14.9 0.015 73 0.021 0.000 87.96 >400 +17:47:46 0.015 35.9 0.015 27.7 0.015 256 0.019 0.000 87.96 >400 +17:47:48 0.015 93 0.015 16.7 0.015 >400 0.019 0.000 87.96 >400 +17:47:50 0.015 102 0.015 >400 0.015 >400 0.022 0.000 87.96 >400 +17:47:52 0.015 293 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:47:54 0.015 19.5 0.015 27.7 0.015 102 0.022 0.000 91.48 >400 +17:47:56 0.015 256 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:47:58 0.015 158 0.015 >400 0.015 >400 0.019 0.000 87.96 341 +17:48:00 0.015 >400 0.020 13.5 0.015 85 0.023 0.000 87.96 >400 +17:48:02 0.010 >400 0.015 293 0.010 >400 0.019 0.000 91.48 228 +17:48:04 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 293 +17:48:06 0.015 46 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:48:08 0.015 71 0.015 >400 0.010 >400 0.019 0.000 91.48 120 +17:48:10 0.015 79 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:48:12 0.015 293 0.015 37.9 0.015 >400 0.021 0.000 87.96 >400 +17:48:14 0.015 >400 0.015 37.9 0.010 >400 0.021 0.000 87.96 >400 +17:48:16 0.015 82 0.015 44 0.010 >400 0.021 0.000 87.96 >400 +17:48:18 0.015 41 0.015 293 0.015 >400 0.022 0.000 87.96 >400 +17:48:20 0.015 40 0.015 15.4 0.015 114 0.023 0.000 91.48 171 +17:48:22 0.015 64 0.020 18.8 0.010 >400 0.024 0.000 87.96 >400 +17:48:24 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:48:26 0.015 >400 0.015 76 0.010 >400 0.019 0.000 87.96 >400 +17:48:28 0.015 68 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:48:30 0.015 102 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:48:32 0.010 >400 0.015 137 0.010 >400 0.019 0.000 91.48 >400 +17:48:34 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:48:36 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:48:38 0.010 205 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:48:40 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:48:42 0.015 60 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:48:44 0.015 293 0.020 17.4 0.015 >400 0.022 0.000 87.96 >400 +17:48:46 0.015 93 0.020 14.2 0.015 >400 0.025 0.000 87.96 >400 +17:48:48 0.015 31.5 0.015 108 0.010 >400 0.023 0.000 87.96 >400 +17:48:50 0.015 108 0.020 19.7 0.010 >400 0.024 0.000 87.96 >400 +17:48:52 0.015 120 0.015 >400 0.010 >400 0.022 0.000 87.96 >400 +17:48:54 0.015 32.5 0.020 22.0 0.015 >400 0.023 0.000 91.48 186 +17:48:56 0.015 21.1 0.015 38.6 0.010 >400 0.021 0.000 91.48 137 +17:48:58 0.020 19.0 0.015 42 0.015 >400 0.021 0.000 87.96 >400 +17:49:00 0.015 186 0.020 21.3 0.010 >400 0.021 0.000 87.96 >400 +17:49:02 0.015 137 0.015 59 0.015 71 0.019 0.000 91.48 >400 +17:49:04 0.015 64 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:49:06 0.015 102 0.015 62 0.015 >400 0.019 0.000 87.96 >400 +17:49:08 0.015 228 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:49:10 0.015 186 0.015 54 0.010 >400 0.019 0.000 87.96 >400 +17:49:12 0.015 55 0.015 137 0.015 64 0.021 0.000 91.48 228 +17:49:14 0.015 85 0.015 39.4 0.010 >400 0.019 0.000 87.96 >400 +17:49:16 0.025 7.3 0.020 6.9 0.015 11.6 0.027 0.000 87.96 >400 +17:49:18 0.020 12.4 0.020 17.5 0.015 82 0.025 0.000 91.48 293 +17:49:20 0.015 30.1 0.020 20.7 0.015 186 0.022 0.000 87.96 >400 +17:49:22 0.015 25.6 0.015 35.3 0.015 32.5 0.022 0.000 91.48 >400 +17:49:24 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:49:26 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:49:28 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 91.48 >400 +17:49:30 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:49:32 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +17:49:34 0.015 59 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +17:49:36 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:49:38 0.015 41 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:49:40 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:49:42 0.015 171 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:49:44 0.015 29.7 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +17:49:46 0.015 40 0.015 186 0.015 256 0.021 0.000 87.96 >400 +17:49:48 0.015 38.6 0.015 31.0 0.010 >400 0.021 0.000 87.96 >400 +17:49:50 0.015 146 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +17:49:52 0.015 120 0.015 128 0.010 >400 0.019 0.000 91.48 >400 +17:49:54 0.020 14.4 0.025 10.5 0.020 N/A 0.029 0.000 87.96 >400 +17:49:56 0.025 8.8 0.015 9.6 0.020 9.6 0.027 0.000 87.96 >400 +17:49:58 0.015 108 0.015 54 0.015 25.0 0.021 0.000 91.48 >400 +17:50:00 0.015 24.7 0.015 256 0.015 293 0.022 0.000 87.96 >400 +17:50:02 0.015 47 0.015 186 0.015 108 0.022 0.000 87.96 >400 +17:50:04 0.015 >400 0.015 293 0.015 22.3 0.021 0.000 87.96 >400 +17:50:06 0.010 >400 0.015 40 0.010 >400 0.019 0.000 87.96 >400 +17:50:08 0.030 7.7 0.025 6.5 0.030 6.9 0.040 0.000 91.48 47 +17:50:10 0.020 9.9 0.015 21.6 0.015 43 0.022 0.000 87.96 >400 +17:50:12 0.015 120 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:50:14 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:50:16 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:50:18 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:50:20 0.025 10.4 0.025 9.1 0.015 29.3 0.031 0.000 87.96 >400 +17:50:22 0.020 5.9 0.015 19.0 0.015 59 0.022 0.000 87.96 >400 +17:50:24 0.015 146 0.020 10.1 0.015 >400 0.023 0.000 91.48 256 +17:50:26 0.020 11.4 0.020 18.8 0.020 11.8 0.025 0.000 93.98 205 +17:50:28 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:50:30 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:50:32 0.010 >400 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +17:50:34 0.015 57 0.015 39.4 0.010 >400 0.021 0.000 87.96 >400 +17:50:36 0.015 42 0.015 36.6 0.010 >400 0.021 0.000 91.48 >400 +17:50:38 0.025 13.8 0.030 10.0 0.020 15.6 0.033 0.000 87.96 >400 +17:50:40 0.025 10.3 0.020 11.6 0.020 10.7 0.029 0.000 87.96 >400 +17:50:42 0.025 12.6 0.020 16.1 0.020 11.6 0.028 0.000 87.96 >400 +17:50:44 0.015 228 0.015 21.6 0.015 51 0.021 0.000 87.96 >400 +17:50:46 0.015 20.5 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +17:50:48 0.015 >400 0.015 57 0.015 >400 0.022 0.000 87.96 341 +17:50:50 0.015 >400 0.015 137 0.015 >400 0.021 0.000 91.48 256 +17:50:52 0.020 12.0 0.020 21.8 0.020 9.1 0.027 0.000 87.96 >400 +17:50:54 0.020 11.7 0.020 9.1 0.020 10.9 0.027 0.000 87.96 >400 +17:50:56 0.015 158 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:50:58 0.015 186 0.015 32.5 0.010 >400 0.019 0.000 87.96 >400 +17:51:00 0.015 57 0.015 30.6 0.015 293 0.021 0.000 87.96 >400 +17:51:02 0.015 32.0 0.015 50 0.015 102 0.019 0.000 87.96 >400 +17:51:04 0.015 89 0.015 228 0.010 >400 0.019 0.000 91.48 >400 +17:51:06 0.015 68 0.015 158 0.010 256 0.019 0.000 87.96 >400 +17:51:08 0.015 256 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:51:10 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:51:12 0.015 73 0.015 98 0.015 >400 0.021 0.000 87.96 >400 +17:51:14 0.010 >400 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +17:51:16 0.015 137 0.015 171 0.010 >400 0.019 0.000 91.48 >400 +17:51:18 0.010 >400 0.015 341 0.015 108 0.019 0.000 87.96 >400 +17:51:20 0.015 43 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:51:22 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:51:24 0.015 205 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +17:51:26 0.015 186 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:51:28 0.015 41 0.015 256 0.015 >400 0.019 0.000 87.96 >400 +17:51:30 0.010 >400 0.015 73 0.010 >400 0.021 0.000 87.96 >400 +17:51:32 0.015 23.8 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +17:51:34 0.015 146 0.015 26.9 0.015 >400 0.021 0.000 87.96 >400 +17:51:36 0.015 108 0.015 146 0.015 >400 0.019 0.000 87.96 >400 +17:51:38 0.015 68 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:51:40 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +17:51:42 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:51:44 0.015 57 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:51:46 0.015 102 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:51:48 0.015 53 0.015 108 0.010 >400 0.021 0.000 87.96 >400 +17:51:50 0.015 23.0 0.015 73 0.015 41 0.019 0.000 87.96 >400 +17:51:52 0.010 >400 0.015 186 0.010 >400 0.019 0.000 91.48 >400 +17:51:54 0.010 >400 0.015 >400 0.010 >400 0.018 0.000 87.96 >400 +17:51:56 0.015 228 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:51:58 0.015 85 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:52:00 0.015 186 0.015 71 0.010 >400 0.021 0.000 91.48 >400 +17:52:02 0.015 >400 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +17:52:04 0.015 >400 0.015 293 0.015 79 0.019 0.000 87.96 >400 +17:52:06 0.015 186 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:52:08 0.015 32.5 0.020 8.3 0.020 9.8 0.028 0.000 91.48 >400 +17:52:10 0.015 33.0 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:52:12 0.015 >400 0.015 137 0.010 >400 0.019 0.000 91.48 293 +17:52:14 0.015 46 0.015 26.6 0.010 >400 0.021 0.000 87.96 >400 +17:52:16 0.015 128 0.015 64 0.015 114 0.021 0.000 87.96 >400 +17:52:18 0.015 108 0.015 43 0.010 >400 0.019 0.000 87.96 >400 +17:52:20 0.015 44 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +17:52:22 0.015 76 0.015 31.5 0.015 >400 0.021 0.000 87.96 >400 +17:52:24 0.015 128 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +17:52:26 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:52:28 0.015 128 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:52:30 0.010 >400 0.015 68 0.010 >400 0.019 0.000 91.48 >400 +17:52:32 0.015 171 0.015 53 0.010 >400 0.021 0.000 91.48 >400 +17:52:34 0.015 54 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:52:36 0.015 256 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:52:38 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:52:40 0.010 >400 0.015 44 0.010 >400 0.019 0.000 87.96 >400 +17:52:42 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:52:44 0.015 128 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +17:52:46 0.015 293 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +17:52:48 0.010 >400 0.015 293 0.015 >400 0.019 0.000 87.96 >400 +17:52:50 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:52:52 0.015 205 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:52:54 0.015 102 0.015 256 0.010 341 0.019 0.000 87.96 >400 +17:52:56 0.015 128 0.015 256 0.015 >400 0.021 0.000 87.96 >400 +17:52:58 0.015 256 0.015 44 0.015 >400 0.022 0.000 87.96 >400 +17:53:00 0.015 >400 0.015 102 0.015 228 0.019 0.000 87.96 >400 +17:53:02 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +17:53:04 0.015 25.3 0.015 228 0.015 21.1 0.021 0.000 87.96 >400 +17:53:06 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:53:08 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:53:10 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:53:12 0.015 85 0.015 341 0.015 34.1 0.021 0.000 87.96 >400 +17:53:14 0.015 64 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:53:16 0.015 >400 0.015 76 0.015 114 0.022 0.000 91.48 89 +17:53:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:53:20 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:53:22 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:53:24 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:53:26 0.015 >400 0.015 53 0.010 >400 0.019 0.000 87.96 >400 +17:53:28 0.015 42 0.030 21.6 0.015 21.8 0.034 0.000 91.48 >400 +17:53:30 0.020 18.5 0.025 23.3 0.015 26.3 0.030 0.000 87.96 >400 +17:53:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:53:34 0.015 89 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +17:53:36 0.015 21.8 0.015 256 0.015 293 0.022 0.000 87.96 >400 +17:53:38 0.020 11.7 0.020 18.5 0.015 76 0.025 0.000 87.96 >400 +17:53:40 0.015 71 0.020 20.7 0.015 19.0 0.027 0.000 87.96 >400 +17:53:42 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +17:53:44 0.015 293 0.015 89 0.015 60 0.019 0.000 87.96 >400 +17:53:46 0.015 293 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:53:48 0.015 >400 0.015 45 0.010 >400 0.019 0.000 87.96 >400 +17:53:50 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:53:52 0.015 51 0.015 93 0.015 >400 0.021 0.000 87.96 >400 +17:53:54 0.015 76 0.015 34.7 0.010 >400 0.019 0.000 87.96 >400 +17:53:56 0.015 >400 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +17:53:58 0.025 25.9 0.030 10.0 0.020 11.9 0.039 0.000 87.96 >400 +17:54:00 0.020 17.1 0.020 22.0 0.015 37.2 0.025 0.000 87.96 >400 +17:54:02 0.020 14.4 0.020 20.1 0.015 >400 0.027 0.000 87.96 >400 +17:54:04 0.025 9.3 0.035 11.3 0.025 10.4 0.043 0.000 87.96 >400 +17:54:06 0.020 11.6 0.030 15.3 0.020 13.2 0.037 0.000 87.96 >400 +17:54:08 0.025 15.3 0.030 12.1 0.020 20.5 0.039 0.000 87.96 >400 +17:54:10 0.015 98 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +17:54:12 0.010 >400 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:54:14 0.015 98 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:54:16 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:54:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:54:20 0.015 35.3 0.015 35.3 0.015 256 0.021 0.000 87.96 >400 +17:54:22 0.010 >400 0.015 48 0.010 >400 0.019 0.000 87.96 >400 +17:54:24 0.015 89 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +17:54:26 0.015 93 0.015 51 0.015 51 0.019 0.000 87.96 >400 +17:54:28 0.015 108 0.015 128 0.015 128 0.022 0.000 87.96 >400 +17:54:30 0.015 293 0.015 293 0.015 228 0.019 0.000 87.96 >400 +17:54:32 0.015 29.7 0.015 >400 0.015 51 0.021 0.000 87.96 >400 +17:54:34 0.015 89 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:54:36 0.015 120 0.015 256 0.015 >400 0.019 0.000 87.96 >400 +17:54:38 0.015 48 0.015 256 0.015 186 0.019 0.000 87.96 >400 +17:54:40 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:54:42 0.015 >400 0.015 76 0.015 >400 0.019 0.000 87.96 >400 +17:54:44 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:54:46 0.015 >400 0.015 171 0.010 >400 0.021 0.000 87.96 >400 +17:54:48 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:54:50 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:54:52 0.030 12.8 0.025 20.5 0.020 11.5 0.030 0.000 91.48 >400 +17:54:54 0.030 10.8 0.035 16.7 0.020 11.7 0.040 0.000 91.48 >400 +17:54:56 0.020 25.0 0.030 18.8 0.015 256 0.034 0.000 87.96 >400 +17:54:58 0.015 >400 0.015 54 0.015 171 0.019 0.000 87.96 >400 +17:55:00 0.015 40 0.015 37.9 0.010 >400 0.021 0.000 87.96 >400 +17:55:02 0.020 14.0 0.020 15.5 0.015 23.0 0.026 0.000 87.96 >400 +17:55:04 0.025 N/A 0.025 17.5 0.015 82 0.030 0.000 87.96 >400 +17:55:06 0.030 11.1 0.035 12.5 0.025 12.3 0.041 0.000 87.96 >400 +17:55:08 0.025 11.4 0.020 19.9 0.020 16.8 0.029 0.000 87.96 >400 +17:55:10 0.035 11.4 0.040 9.1 0.030 10.4 0.052 0.000 91.48 >400 +17:55:12 0.030 11.9 0.025 12.3 0.020 15.2 0.032 0.000 87.96 >400 +17:55:14 0.020 27.3 0.035 16.5 0.025 15.6 0.041 0.000 87.96 >400 +17:55:16 0.020 17.1 0.030 20.1 0.020 13.6 0.034 0.000 87.96 >400 +17:55:18 0.020 26.9 0.020 23.3 0.015 24.4 0.025 0.000 87.96 >400 +17:55:20 0.015 32.0 0.020 24.1 0.015 30.6 0.024 0.000 87.96 >400 +17:55:22 0.010 146 0.015 205 0.010 >400 0.019 0.000 87.96 341 +17:55:24 0.015 256 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:55:26 0.015 26.3 0.015 >400 0.015 49 0.019 0.000 87.96 >400 +17:55:28 0.015 120 0.015 146 0.015 >400 0.021 0.000 87.96 >400 +17:55:30 0.015 66 0.015 >400 0.015 71 0.023 0.000 91.48 >400 +17:55:32 0.015 93 0.015 256 0.015 >400 0.019 0.000 91.48 228 +17:55:34 0.020 17.5 0.025 12.8 0.015 186 0.029 0.000 91.48 186 +17:55:36 0.015 128 0.020 18.0 0.015 51 0.025 0.000 87.96 >400 +17:55:38 0.015 82 0.020 15.5 0.015 >400 0.025 0.000 91.48 >400 +17:55:40 0.015 55 0.025 13.0 0.015 31.0 0.027 0.000 91.48 146 +17:55:42 0.015 18.8 0.020 17.2 0.015 46 0.023 0.000 87.96 >400 +17:55:44 0.015 293 0.020 25.9 0.015 25.9 0.023 0.000 91.48 >400 +17:55:46 0.015 47 0.020 18.3 0.015 293 0.023 0.000 91.48 98 +17:55:48 0.020 16.0 0.020 16.4 0.015 171 0.027 0.000 91.48 >400 +17:55:50 0.015 51 0.020 23.0 0.015 89 0.023 0.000 87.96 >400 +17:55:52 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +17:55:54 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:55:56 0.020 17.8 0.020 17.8 0.015 30.6 0.025 0.000 87.96 >400 +17:55:58 0.015 29.3 0.020 13.7 0.015 57 0.025 0.000 91.48 82 +17:56:00 0.020 15.2 0.020 17.5 0.020 10.0 0.032 0.000 87.96 >400 +17:56:02 0.015 137 0.015 256 0.015 73 0.022 0.000 87.96 >400 +17:56:04 0.010 >400 0.015 43 0.010 >400 0.019 0.000 87.96 >400 +17:56:06 0.015 >400 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +17:56:08 0.020 12.3 0.025 13.7 0.020 15.4 0.030 0.000 87.96 >400 +17:56:10 0.020 13.6 0.020 9.4 0.015 >400 0.027 0.000 87.96 >400 +17:56:12 0.025 14.2 0.025 13.0 0.015 18.0 0.030 0.000 87.96 >400 +17:56:14 0.030 13.7 0.030 12.6 0.035 12.8 0.046 0.000 87.96 >400 +17:56:16 0.025 13.9 0.030 15.4 0.020 16.1 0.036 0.000 87.96 >400 +17:56:18 0.020 13.8 0.020 19.3 0.015 46 0.027 0.000 91.48 >400 +17:56:20 0.030 11.2 0.030 15.8 0.020 13.5 0.032 0.000 87.96 >400 +17:56:22 0.025 14.1 0.025 11.6 0.020 14.9 0.031 0.000 87.96 >400 +17:56:24 0.030 14.6 0.035 11.8 0.025 16.3 0.042 0.000 91.48 >400 +17:56:26 0.030 12.2 0.035 13.9 0.020 9.8 0.041 0.000 87.96 >400 +17:56:28 0.025 11.0 0.030 16.8 0.025 13.3 0.039 0.000 87.96 >400 +17:56:30 0.020 9.1 0.020 19.3 0.015 22.3 0.024 0.000 91.48 31.0 +17:56:32 0.025 15.3 0.030 16.9 0.025 11.5 0.039 0.000 91.48 128 +17:56:34 0.035 7.2 0.030 16.1 0.030 8.9 0.042 0.000 93.98 205 +17:56:36 0.040 7.4 0.030 14.8 0.020 19.0 0.045 0.000 91.48 256 +17:56:38 0.015 >400 0.015 26.3 0.015 49 0.023 0.000 87.96 >400 +17:56:40 0.015 13.6 0.015 21.1 0.010 228 0.021 0.000 87.96 >400 +17:56:42 0.015 44 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +17:56:44 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:56:46 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:56:48 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:56:50 0.015 82 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:56:52 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:56:54 0.015 68 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +17:56:56 0.015 186 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:56:58 0.015 85 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +17:57:00 0.015 >400 0.015 137 0.010 >400 0.017 0.000 87.96 >400 +17:57:02 0.015 171 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +17:57:04 0.020 37.2 0.025 32.0 0.015 33.6 0.027 0.000 91.48 >400 +17:57:06 0.015 186 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +17:57:08 0.015 34.7 0.015 31.0 0.015 128 0.022 0.000 87.96 >400 +17:57:10 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:57:12 0.020 35.9 0.030 26.3 0.015 >400 0.034 0.000 87.96 >400 +17:57:14 0.020 30.1 0.025 21.1 0.025 8.6 0.041 0.000 87.96 >400 +17:57:16 0.035 6.3 0.030 7.3 0.045 4.3 0.057 0.000 91.48 45 +17:57:18 0.025 13.6 0.020 12.9 0.020 11.6 0.027 0.000 87.96 >400 +17:57:20 0.020 13.8 0.040 98 0.020 25.3 0.042 0.000 87.96 >400 +17:57:22 0.020 14.5 0.015 >400 0.015 >400 0.021 0.000 91.48 >400 +17:57:24 0.015 76 0.015 37.9 0.015 42 0.021 0.000 87.96 >400 +17:57:26 0.015 62 0.015 137 0.015 >400 0.021 0.000 87.96 >400 +17:57:28 0.015 36.6 0.015 20.9 0.015 108 0.021 0.000 87.96 >400 +17:57:30 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:57:32 0.015 23.8 0.015 45 0.015 256 0.022 0.000 87.96 >400 +17:57:34 0.015 71 0.015 108 0.015 25.3 0.019 0.000 87.96 >400 +17:57:36 0.015 14.7 0.015 28.8 0.015 53 0.022 0.000 87.96 >400 +17:57:38 0.015 35.9 0.015 128 0.010 >400 0.019 0.000 91.48 256 +17:57:40 0.020 29.3 0.020 23.3 0.025 48 0.030 0.000 87.96 >400 +17:57:42 0.040 25.3 0.060 22.8 0.035 16.1 0.071 0.000 91.48 >400 +17:57:44 0.020 9.3 0.015 17.1 0.015 >400 0.023 0.000 87.96 >400 +17:57:46 0.030 N/A 0.025 N/A 0.020 13.5 0.037 0.000 87.96 >400 +17:57:48 0.020 22.0 0.020 10.1 0.020 21.1 0.025 0.000 87.96 >400 +17:57:50 0.010 >400 0.015 146 0.010 >400 0.017 0.000 87.96 >400 +17:57:52 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +17:57:54 0.010 >400 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +17:57:56 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +17:57:58 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +17:58:00 0.015 256 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +17:58:02 0.015 8.7 0.015 62 0.015 114 0.023 0.000 87.96 >400 +17:58:04 0.020 12.3 0.025 14.0 0.020 12.7 0.030 0.000 87.96 >400 +17:58:06 0.020 11.1 0.025 9.8 0.020 11.8 0.029 0.000 87.96 >400 +17:58:08 0.020 19.7 0.020 15.6 0.015 66 0.026 0.000 87.96 >400 +17:58:10 0.015 36.6 0.015 50 0.015 14.2 0.022 0.000 87.96 >400 +17:58:12 0.020 9.8 0.025 14.7 0.015 15.9 0.027 0.000 87.96 >400 +17:58:14 0.035 10.7 0.035 9.9 0.030 10.4 0.046 0.000 87.96 >400 +17:58:16 0.020 8.5 0.025 13.5 0.020 14.5 0.030 0.000 87.96 >400 +17:58:18 0.030 13.0 0.040 10.9 0.030 11.7 0.047 0.000 87.96 >400 +17:58:20 0.020 12.6 0.020 18.0 0.015 15.2 0.030 0.000 87.96 >400 +17:58:22 0.020 14.7 0.025 14.7 0.020 16.9 0.030 0.000 87.96 >400 +17:58:24 0.020 12.1 0.020 11.9 0.020 18.3 0.027 0.000 87.96 >400 +17:58:26 0.040 22.3 0.055 20.7 0.030 18.8 0.061 0.000 87.96 >400 +17:58:28 0.020 15.4 0.020 20.5 0.015 50 0.025 0.000 91.48 >400 +17:58:30 0.015 89 0.015 341 0.015 59 0.019 0.000 87.96 >400 +17:58:32 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +17:58:34 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:58:36 0.015 >400 0.015 >400 0.010 341 0.019 0.000 87.96 >400 +17:58:38 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +17:58:40 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:58:42 0.015 98 0.015 137 0.015 293 0.019 0.000 87.96 >400 +17:58:44 0.015 >400 0.015 85 0.010 >400 0.021 0.000 91.48 >400 +17:58:46 0.020 9.8 0.020 15.4 0.015 45 0.027 0.000 87.96 >400 +17:58:48 0.030 8.8 0.025 10.3 0.020 11.3 0.032 0.000 87.96 >400 +17:58:50 0.025 6.8 0.020 13.3 0.015 128 0.026 0.000 87.96 >400 +17:58:52 0.025 10.2 0.020 17.2 0.015 40 0.027 0.000 87.96 >400 +17:58:54 0.020 11.3 0.020 15.2 0.015 54 0.027 0.000 87.96 >400 +17:58:56 0.015 54 0.015 102 0.015 82 0.023 0.000 87.96 >400 +17:58:58 0.020 8.0 0.015 37.9 0.015 32.5 0.023 0.000 87.96 >400 +17:59:00 0.020 7.8 0.015 82 0.015 47 0.023 0.000 87.96 >400 +17:59:02 0.020 16.7 0.015 26.3 0.015 32.5 0.021 0.000 87.96 >400 +17:59:04 0.020 10.7 0.015 35.3 0.015 108 0.023 0.000 87.96 >400 +17:59:06 0.025 8.7 0.020 12.0 0.015 39.4 0.027 0.000 87.96 >400 +17:59:08 0.020 7.2 0.015 >400 0.015 228 0.023 0.000 87.96 >400 +17:59:10 0.015 137 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +17:59:12 0.015 82 0.015 19.0 0.010 >400 0.021 0.000 87.96 >400 +17:59:14 0.015 31.5 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +17:59:16 0.015 55 0.015 33.0 0.010 >400 0.021 0.000 87.96 >400 +17:59:18 0.015 >400 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +17:59:20 0.015 171 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +17:59:22 0.010 >400 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +17:59:24 0.015 59 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +17:59:26 0.015 17.1 0.020 17.2 0.015 >400 0.023 0.000 91.48 >400 +17:59:28 0.020 8.1 0.020 14.1 0.015 205 0.027 0.000 87.96 >400 +17:59:30 0.015 >400 0.015 37.2 0.015 341 0.023 0.000 87.96 >400 +17:59:32 0.020 6.8 0.015 82 0.015 228 0.021 0.000 91.48 >400 +17:59:34 0.015 >400 0.015 128 0.015 >400 0.023 0.000 87.96 >400 +17:59:36 0.020 10.0 0.015 68 0.015 79 0.023 0.000 87.96 >400 +17:59:38 0.020 9.8 0.020 16.7 0.015 341 0.025 0.000 91.48 >400 +17:59:40 0.015 11.4 0.020 13.5 0.015 256 0.025 0.000 87.96 >400 +17:59:42 0.020 10.0 0.020 23.8 0.015 37.2 0.023 0.000 87.96 >400 +17:59:44 0.025 9.2 0.020 12.7 0.015 158 0.025 0.000 87.96 >400 +17:59:46 0.020 10.7 0.020 68 0.015 22.3 0.023 0.000 87.96 >400 +17:59:48 0.015 30.1 0.015 256 0.015 85 0.019 0.000 87.96 >400 +17:59:50 0.015 256 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +17:59:52 0.015 28.8 0.015 158 0.015 158 0.019 0.000 87.96 >400 +17:59:54 0.015 47 0.015 146 0.015 205 0.019 0.000 87.96 >400 +17:59:56 0.020 9.8 0.020 14.1 0.015 62 0.025 0.000 87.96 >400 +17:59:58 0.015 66 0.015 26.3 0.015 171 0.021 0.000 87.96 >400 +18:00:00 0.015 186 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:00:02 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:00:04 0.015 76 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:00:06 0.015 46 0.020 29.3 0.015 >400 0.023 0.000 87.96 >400 +18:00:08 0.015 76 0.015 32.0 0.015 50 0.022 0.000 87.96 >400 +18:00:10 0.015 256 0.015 85 0.015 >400 0.019 0.000 87.96 >400 +18:00:12 0.015 >400 0.015 128 0.015 128 0.023 0.000 87.96 >400 +18:00:14 0.015 >400 0.015 158 0.015 35.3 0.019 0.000 87.96 >400 +18:00:16 0.015 66 0.015 108 0.015 >400 0.021 0.000 87.96 186 +18:00:18 0.015 108 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:00:20 0.015 >400 0.015 128 0.015 >400 0.021 0.000 87.96 >400 +18:00:22 0.015 >400 0.015 186 0.015 293 0.019 0.000 87.96 >400 +18:00:24 0.015 186 0.015 60 0.015 171 0.021 0.000 87.96 >400 +18:00:26 0.015 76 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:00:28 0.010 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:00:30 0.015 76 0.015 60 0.010 >400 0.019 0.000 91.48 293 +18:00:32 0.020 N/A 0.025 16.5 0.015 >400 0.031 0.000 87.96 >400 +18:00:34 0.030 10.7 0.025 14.5 0.020 11.6 0.035 0.000 87.96 >400 +18:00:36 0.020 8.0 0.020 17.2 0.020 18.3 0.029 0.000 87.96 >400 +18:00:38 0.020 11.8 0.020 18.6 0.015 >400 0.024 0.000 87.96 >400 +18:00:40 0.020 9.7 0.015 16.4 0.015 228 0.025 0.000 87.96 >400 +18:00:42 0.020 10.6 0.020 15.1 0.020 17.8 0.025 0.000 87.96 >400 +18:00:44 0.020 11.1 0.015 293 0.015 35.3 0.023 0.000 87.96 >400 +18:00:46 0.015 60 0.015 22.0 0.015 293 0.019 0.000 87.96 293 +18:00:48 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:00:50 0.015 64 0.015 37.2 0.015 89 0.021 0.000 87.96 >400 +18:00:52 0.020 9.3 0.015 120 0.015 120 0.023 0.000 87.96 >400 +18:00:54 0.020 13.2 0.015 39.4 0.015 66 0.023 0.000 87.96 >400 +18:00:56 0.020 9.3 0.015 32.0 0.015 25.3 0.022 0.000 87.96 >400 +18:00:58 0.020 9.1 0.015 89 0.015 158 0.026 0.000 91.48 293 +18:01:00 0.020 10.6 0.015 18.1 0.020 14.6 0.023 0.000 87.96 >400 +18:01:02 0.015 171 0.015 23.5 0.015 >400 0.021 0.000 87.96 >400 +18:01:04 0.010 >400 0.015 85 0.010 >400 0.021 0.000 87.96 >400 +18:01:06 0.015 >400 0.015 228 0.015 59 0.019 0.000 87.96 >400 +18:01:08 0.025 6.9 0.035 15.4 0.025 9.7 0.041 0.000 87.96 >400 +18:01:10 0.025 12.3 0.025 20.1 0.025 9.5 0.032 0.000 87.96 >400 +18:01:12 0.020 13.7 0.020 9.8 0.015 15.2 0.025 0.000 87.96 >400 +18:01:14 0.020 12.3 0.025 9.8 0.020 14.6 0.032 0.000 87.96 293 +18:01:16 0.025 11.3 0.045 16.3 0.025 11.4 0.051 0.000 87.96 >400 +18:01:18 0.035 10.1 0.030 15.8 0.025 12.5 0.039 0.000 87.96 >400 +18:01:20 0.015 48 0.025 22.8 0.020 12.4 0.030 0.000 87.96 >400 +18:01:22 0.025 7.9 0.030 10.8 0.020 11.7 0.036 0.000 87.96 >400 +18:01:24 0.025 13.8 0.025 16.9 0.020 22.3 0.031 0.000 87.96 >400 +18:01:26 0.025 11.9 0.030 15.6 0.025 12.6 0.036 0.000 87.96 >400 +18:01:28 0.025 12.1 0.025 11.5 0.020 12.2 0.030 0.000 87.96 >400 +18:01:30 0.015 16.9 0.020 16.8 0.020 15.4 0.027 0.000 87.96 >400 +18:01:32 0.015 171 0.015 341 0.015 171 0.021 0.000 87.96 >400 +18:01:34 0.015 37.2 0.015 >400 0.015 >400 0.022 0.000 87.96 >400 +18:01:36 0.015 35.3 0.020 16.1 0.015 20.9 0.023 0.000 87.96 >400 +18:01:38 0.020 20.1 0.020 16.8 0.015 48 0.025 0.000 87.96 >400 +18:01:40 0.020 8.9 0.020 21.8 0.020 16.4 0.028 0.000 87.96 >400 +18:01:42 0.025 9.6 0.020 19.0 0.025 14.0 0.030 0.000 87.96 >400 +18:01:44 0.020 11.2 0.020 12.4 0.020 16.9 0.027 0.000 87.96 >400 +18:01:46 0.020 13.3 0.020 15.5 0.020 17.2 0.024 0.000 87.96 >400 +18:01:48 0.020 14.5 0.020 12.2 0.020 13.0 0.025 0.000 91.48 >400 +18:01:50 0.020 13.7 0.015 22.5 0.015 76 0.023 0.000 87.96 >400 +18:01:52 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:01:54 0.020 6.3 0.015 >400 0.015 59 0.022 0.000 87.96 >400 +18:01:56 0.020 8.6 0.015 14.9 0.015 53 0.023 0.000 87.96 >400 +18:01:58 0.015 35.3 0.020 13.4 0.015 85 0.025 0.000 87.96 >400 +18:02:00 0.020 8.1 0.015 98 0.015 >400 0.023 0.000 87.96 >400 +18:02:02 0.020 10.4 0.020 15.4 0.015 28.4 0.024 0.000 87.96 >400 +18:02:04 0.015 256 0.015 13.4 0.015 22.0 0.022 0.000 91.48 >400 +18:02:06 0.015 128 0.015 >400 0.015 22.8 0.022 0.000 87.96 >400 +18:02:08 0.015 89 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:02:10 0.015 128 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +18:02:12 0.010 >400 0.010 >400 0.015 >400 0.019 0.000 87.96 >400 +18:02:14 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 256 +18:02:16 0.015 146 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:02:18 0.010 >400 0.015 128 0.010 >400 0.017 0.000 87.96 >400 +18:02:20 0.015 73 0.015 114 0.010 >400 0.021 0.000 87.96 >400 +18:02:22 0.015 >400 0.015 79 0.010 >400 0.021 0.000 87.96 >400 +18:02:24 0.015 >400 0.015 256 0.010 >400 0.019 0.000 91.48 >400 +18:02:26 0.015 93 0.015 256 0.010 >400 0.019 0.000 91.48 >400 +18:02:28 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:02:30 0.015 82 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:02:32 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:02:34 0.015 228 0.015 128 0.015 >400 0.018 0.000 87.96 >400 +18:02:36 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:02:38 0.010 >400 0.015 50 0.010 >400 0.021 0.000 87.96 >400 +18:02:40 0.025 9.6 0.025 9.3 0.025 10.0 0.038 0.000 87.96 >400 +18:02:42 0.015 45 0.015 28.8 0.015 22.3 0.021 0.000 87.96 >400 +18:02:44 0.015 128 0.020 11.5 0.015 >400 0.024 0.000 87.96 >400 +18:02:46 0.015 37.9 0.015 102 0.015 85 0.021 0.000 87.96 >400 +18:02:48 0.015 43 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:02:50 0.015 158 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:02:52 0.015 293 0.015 48 0.010 >400 0.019 0.000 91.48 >400 +18:02:54 0.015 82 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:02:56 0.015 128 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:02:58 0.020 11.4 0.015 341 0.015 158 0.023 0.000 87.96 >400 +18:03:00 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:03:02 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:03:04 0.020 9.7 0.015 50 0.015 24.7 0.023 0.000 87.96 >400 +18:03:06 0.015 98 0.020 23.8 0.015 205 0.023 0.000 91.48 >400 +18:03:08 0.020 8.2 0.020 29.3 0.020 12.9 0.025 0.000 87.96 >400 +18:03:10 0.020 9.4 0.015 17.4 0.015 32.5 0.023 0.000 87.96 >400 +18:03:12 0.020 9.9 0.015 228 0.015 >400 0.022 0.000 87.96 >400 +18:03:14 0.020 9.2 0.015 18.1 0.015 13.7 0.023 0.000 87.96 >400 +18:03:16 0.020 7.7 0.020 10.1 0.015 186 0.026 0.000 87.96 >400 +18:03:18 0.025 6.5 0.020 16.0 0.020 10.2 0.027 0.000 87.96 >400 +18:03:20 0.025 8.0 0.020 N/A 0.020 10.4 0.027 0.000 91.48 >400 +18:03:22 0.025 9.4 0.015 10.8 0.020 14.5 0.029 0.000 87.96 >400 +18:03:24 0.025 9.8 0.020 13.4 0.020 14.9 0.032 0.000 87.96 >400 +18:03:26 0.030 9.2 0.025 11.2 0.015 120 0.034 0.000 87.96 >400 +18:03:28 0.025 9.2 0.020 16.1 0.015 19.5 0.029 0.000 87.96 >400 +18:03:30 0.015 9.4 0.020 13.9 0.015 >400 0.022 0.000 87.96 >400 +18:03:32 0.020 9.8 0.015 54 0.015 76 0.023 0.000 87.96 >400 +18:03:34 0.020 8.5 0.015 102 0.015 14.1 0.023 0.000 87.96 >400 +18:03:36 0.020 9.4 0.015 158 0.015 128 0.024 0.000 91.48 >400 +18:03:38 0.020 12.8 0.015 19.0 0.015 22.5 0.022 0.000 87.96 >400 +18:03:40 0.020 8.5 0.020 11.8 0.015 14.8 0.023 0.000 87.96 >400 +18:03:42 0.020 13.7 0.020 11.4 0.020 11.6 0.025 0.000 91.48 >400 +18:03:44 0.020 9.3 0.020 14.3 0.020 12.6 0.023 0.000 87.96 >400 +18:03:46 0.025 8.5 0.020 14.3 0.020 12.9 0.026 0.000 87.96 >400 +18:03:48 0.020 8.3 0.015 54 0.015 293 0.023 0.000 87.96 >400 +18:03:50 0.020 8.4 0.015 158 0.015 79 0.023 0.000 87.96 >400 +18:03:52 0.020 9.9 0.015 >400 0.015 >400 0.023 0.000 87.96 >400 +18:03:54 0.025 9.7 0.020 15.3 0.020 11.5 0.026 0.000 87.96 >400 +18:03:56 0.020 7.8 0.020 22.5 0.015 171 0.025 0.000 87.96 >400 +18:03:58 0.015 50 0.020 11.1 0.015 20.9 0.025 0.000 87.96 >400 +18:04:00 0.015 >400 0.015 19.5 0.015 59 0.023 0.000 87.96 >400 +18:04:02 0.015 89 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:04:04 0.015 256 0.015 120 0.015 >400 0.019 0.000 87.96 >400 +18:04:06 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:04:08 0.020 9.8 0.015 73 0.015 54 0.023 0.000 87.96 >400 +18:04:10 0.040 8.8 0.025 11.3 0.025 9.9 0.041 0.000 87.96 >400 +18:04:12 0.030 9.1 0.025 14.9 0.030 14.7 0.043 0.000 91.48 64 +18:04:14 0.025 6.6 0.020 10.9 0.020 11.1 0.029 0.000 87.96 >400 +18:04:16 0.020 15.3 0.020 11.8 0.020 13.1 0.030 0.000 87.96 >400 +18:04:18 0.020 10.6 0.015 146 0.025 11.8 0.027 0.000 87.96 >400 +18:04:20 0.020 10.0 0.020 13.0 0.015 >400 0.022 0.000 87.96 >400 +18:04:22 0.030 13.8 0.020 11.3 0.035 12.3 0.039 0.000 91.48 >400 +18:04:24 0.025 10.8 0.025 18.6 0.035 12.7 0.038 0.000 87.96 >400 +18:04:26 0.030 8.2 0.020 23.8 0.030 12.6 0.035 0.000 87.96 >400 +18:04:28 0.020 9.8 0.015 137 0.020 19.7 0.023 0.000 87.96 >400 +18:04:30 0.010 >400 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +18:04:32 0.015 146 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:04:34 0.020 15.6 0.015 93 0.020 13.1 0.025 0.000 91.48 >400 +18:04:36 0.030 14.1 0.030 10.4 0.035 12.5 0.041 0.000 91.48 59 +18:04:38 0.030 14.3 0.025 10.2 0.035 13.0 0.038 0.000 91.48 256 +18:04:40 0.035 14.5 0.025 15.2 0.040 12.7 0.043 0.000 91.48 57 +18:04:42 0.030 14.5 0.030 12.5 0.035 13.0 0.042 0.000 87.96 >400 +18:04:44 0.035 12.1 0.025 14.2 0.035 12.0 0.042 0.000 87.96 >400 +18:04:46 0.030 16.4 0.035 12.6 0.030 12.0 0.043 0.000 87.96 66 +18:04:48 0.015 49 0.015 57 0.015 46 0.022 0.000 87.96 >400 +18:04:50 0.015 >400 0.015 108 0.015 >400 0.019 0.000 87.96 >400 +18:04:52 0.015 >400 0.015 73 0.015 120 0.021 0.000 87.96 >400 +18:04:54 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:04:56 0.015 37.2 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +18:04:58 0.015 33.6 0.015 28.4 0.010 >400 0.019 0.000 87.96 >400 +18:05:00 0.020 13.2 0.015 44 0.015 76 0.023 0.000 87.96 >400 +18:05:02 0.020 10.9 0.015 25.0 0.015 35.9 0.023 0.000 87.96 >400 +18:05:04 0.020 8.7 0.015 36.6 0.015 >400 0.023 0.000 87.96 >400 +18:05:06 0.020 9.5 0.015 14.5 0.020 13.6 0.023 0.000 87.96 >400 +18:05:08 0.015 59 0.015 >400 0.015 54 0.021 0.000 87.96 >400 +18:05:10 0.030 10.7 0.025 11.6 0.025 10.7 0.035 0.000 87.96 >400 +18:05:12 0.025 12.8 0.025 10.6 0.035 12.8 0.037 0.000 91.48 >400 +18:05:14 0.035 12.7 0.025 10.0 0.035 12.0 0.042 0.000 87.96 >400 +18:05:16 0.025 12.7 0.035 10.3 0.030 11.2 0.043 0.000 91.48 >400 +18:05:18 0.015 24.1 0.015 85 0.015 66 0.021 0.000 87.96 >400 +18:05:20 0.015 186 0.020 14.2 0.015 35.9 0.024 0.000 87.96 >400 +18:05:22 0.015 9.0 0.015 31.5 0.015 20.7 0.021 0.000 87.96 >400 +18:05:24 0.015 98 0.015 59 0.015 27.3 0.021 0.000 87.96 >400 +18:05:26 0.020 9.7 0.015 49 0.025 12.4 0.027 0.000 87.96 >400 +18:05:28 0.015 10.7 0.015 >400 0.015 186 0.021 0.000 87.96 >400 +18:05:30 0.015 89 0.015 171 0.010 >400 0.019 0.000 91.48 >400 +18:05:32 0.020 39.4 0.030 28.1 0.015 54 0.032 0.000 87.96 >400 +18:05:34 0.020 10.2 0.020 13.5 0.020 13.5 0.023 0.000 87.96 >400 +18:05:36 0.020 9.4 0.015 146 0.020 12.6 0.025 0.000 87.96 >400 +18:05:38 0.025 10.5 0.020 13.8 0.025 13.7 0.032 0.000 91.48 >400 +18:05:40 0.030 13.7 0.025 10.3 0.035 13.1 0.037 0.000 91.48 >400 +18:05:42 0.035 13.9 0.025 13.0 0.035 13.3 0.043 0.000 87.96 >400 +18:05:44 0.030 16.1 0.025 12.3 0.030 13.0 0.037 0.000 87.96 >400 +18:05:46 0.035 14.3 0.030 13.0 0.035 12.5 0.043 0.000 91.48 57 +18:05:48 0.020 11.4 0.020 14.1 0.015 18.0 0.032 0.000 87.96 >400 +18:05:50 0.015 146 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +18:05:52 0.015 293 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:05:54 0.030 15.2 0.030 10.9 0.035 13.4 0.039 0.000 87.96 >400 +18:05:56 0.030 14.6 0.025 13.0 0.030 12.6 0.039 0.000 87.96 >400 +18:05:58 0.015 44 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:06:00 0.015 73 0.015 57 0.015 256 0.019 0.000 87.96 >400 +18:06:02 0.015 22.3 0.015 35.9 0.015 256 0.021 0.000 87.96 >400 +18:06:04 0.015 293 0.015 137 0.015 >400 0.021 0.000 87.96 >400 +18:06:06 0.010 >400 0.015 120 0.015 >400 0.019 0.000 87.96 >400 +18:06:08 0.015 293 0.015 >400 0.015 114 0.019 0.000 87.96 >400 +18:06:10 0.015 22.8 0.015 55 0.010 >400 0.019 0.000 87.96 >400 +18:06:12 0.015 256 0.015 73 0.015 55 0.021 0.000 87.96 >400 +18:06:14 0.015 48 0.015 256 0.015 89 0.019 0.000 87.96 >400 +18:06:16 0.010 >400 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:06:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:06:20 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:06:22 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:06:24 0.015 31.0 0.015 82 0.020 15.1 0.025 0.000 87.96 >400 +18:06:26 0.015 47 0.015 47 0.010 >400 0.019 0.000 87.96 >400 +18:06:28 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:06:30 0.015 36.6 0.015 48 0.015 >400 0.019 0.000 87.96 >400 +18:06:32 0.015 60 0.015 98 0.015 256 0.019 0.000 87.96 >400 +18:06:34 0.020 15.3 0.015 34.1 0.020 13.3 0.023 0.000 87.96 >400 +18:06:36 0.015 73 0.015 120 0.015 21.1 0.023 0.000 91.48 >400 +18:06:38 0.015 22.8 0.020 17.4 0.015 37.2 0.022 0.000 87.96 >400 +18:06:40 0.015 171 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +18:06:42 0.015 89 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:06:44 0.015 >400 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +18:06:46 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:06:48 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:06:50 0.015 59 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:06:52 0.010 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +18:06:54 0.015 85 0.015 66 0.010 >400 0.021 0.000 87.96 >400 +18:06:56 0.010 293 0.015 171 0.010 >400 0.021 0.000 87.96 >400 +18:06:58 0.010 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:07:00 0.015 >400 0.015 120 0.010 >400 0.019 0.000 91.48 >400 +18:07:02 0.015 108 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:07:04 0.015 >400 0.015 128 0.015 >400 0.019 0.000 87.96 >400 +18:07:06 0.025 13.1 0.025 9.2 0.020 9.7 0.032 0.000 87.96 >400 +18:07:08 0.015 15.8 0.015 50 0.010 >400 0.019 0.000 87.96 >400 +18:07:10 0.015 >400 0.015 >400 0.015 128 0.019 0.000 91.48 >400 +18:07:12 0.020 16.7 0.025 15.4 0.020 14.1 0.031 0.000 87.96 >400 +18:07:14 0.070 24.7 0.095 23.0 0.040 21.6 0.102 0.000 87.96 >400 +18:07:16 0.020 13.4 0.020 12.8 0.020 14.1 0.029 0.000 87.96 >400 +18:07:18 0.015 108 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:07:20 0.015 256 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +18:07:22 0.015 >400 0.015 68 0.015 >400 0.021 0.000 87.96 >400 +18:07:24 0.015 341 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:07:26 0.015 >400 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +18:07:28 0.010 >400 0.015 293 0.015 293 0.019 0.000 87.96 >400 +18:07:30 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:07:32 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:07:34 0.015 98 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:07:36 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:07:38 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:07:40 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:07:42 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:07:44 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:07:46 0.015 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:07:48 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:07:50 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:07:52 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:07:54 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:07:56 0.015 42 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:07:58 0.015 76 0.015 137 0.015 >400 0.022 0.000 87.96 228 +18:08:00 0.015 48 0.025 32.0 0.015 >400 0.027 0.000 87.96 >400 +18:08:02 0.020 23.3 0.030 20.3 0.020 18.6 0.036 0.000 87.96 >400 +18:08:04 0.015 42 0.020 16.5 0.015 25.6 0.023 0.000 87.96 >400 +18:08:06 0.045 15.4 0.060 20.5 0.035 14.8 0.071 0.000 91.48 66 +18:08:08 0.020 12.9 0.015 27.3 0.015 137 0.023 0.000 87.96 >400 +18:08:10 0.015 >400 0.015 26.9 0.015 102 0.021 0.000 87.96 >400 +18:08:12 0.015 293 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +18:08:14 0.015 14.0 0.020 11.5 0.015 293 0.024 0.000 87.96 >400 +18:08:16 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:08:18 0.025 33.0 0.030 26.9 0.015 43 0.034 0.000 87.96 >400 +18:08:20 0.015 228 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:08:22 0.025 8.5 0.020 19.9 0.020 14.0 0.030 0.000 87.96 >400 +18:08:24 0.015 128 0.015 120 0.010 >400 0.021 0.000 87.96 >400 +18:08:26 0.025 47 0.040 98 0.025 10.7 0.046 0.000 91.48 158 +18:08:28 0.025 14.6 0.020 15.5 0.030 10.1 0.037 0.000 91.48 >400 +18:08:30 0.015 >400 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +18:08:32 0.015 205 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:08:34 0.010 >400 0.015 108 0.010 >400 0.017 0.000 87.96 >400 +18:08:36 0.010 >400 0.015 64 0.010 >400 0.021 0.000 87.96 >400 +18:08:38 0.015 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:08:40 0.010 >400 0.015 293 0.010 >400 0.021 0.000 91.48 >400 +18:08:42 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 91.48 341 +18:08:44 0.015 71 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:08:46 0.015 53 0.015 341 0.010 >400 0.021 0.000 87.96 >400 +18:08:48 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:08:50 0.015 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +18:08:52 0.015 171 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:08:54 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:08:56 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:08:58 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:09:00 0.020 14.4 0.030 12.0 0.020 15.8 0.036 0.000 87.96 >400 +18:09:02 0.015 >400 0.020 17.4 0.015 114 0.023 0.000 87.96 >400 +18:09:04 0.015 293 0.015 102 0.015 82 0.026 0.000 87.96 >400 +18:09:06 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:09:08 0.010 >400 0.015 28.1 0.015 >400 0.021 0.000 87.96 >400 +18:09:10 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:09:12 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:09:14 0.020 18.3 0.025 17.4 0.015 32.0 0.027 0.000 87.96 >400 +18:09:16 0.010 >400 0.015 137 0.010 >400 0.017 0.000 87.96 >400 +18:09:18 0.015 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:09:20 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:09:22 0.010 341 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:09:24 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:09:26 0.015 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:09:28 0.015 120 0.015 71 0.015 48 0.022 0.000 87.96 >400 +18:09:30 0.015 >400 0.015 66 0.015 79 0.021 0.000 87.96 >400 +18:09:32 0.015 73 0.020 23.8 0.015 158 0.023 0.000 87.96 >400 +18:09:34 0.015 85 0.015 48 0.015 47 0.022 0.000 87.96 >400 +18:09:36 0.015 32.5 0.020 26.3 0.015 205 0.022 0.000 87.96 >400 +18:09:38 0.015 228 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +18:09:40 0.015 114 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:09:42 0.015 >400 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +18:09:44 0.010 >400 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +18:09:46 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:09:48 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +18:09:50 0.010 >400 0.015 120 0.010 >400 0.021 0.000 87.96 >400 +18:09:52 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:09:54 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:09:56 0.010 >400 0.015 341 0.010 >400 0.017 0.000 91.48 >400 +18:09:58 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:10:00 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:10:02 0.015 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:10:04 0.015 256 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:10:06 0.015 51 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:10:08 0.015 82 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:10:10 0.015 37.9 0.015 62 0.010 >400 0.021 0.000 87.96 >400 +18:10:12 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:10:14 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:10:16 0.010 >400 0.015 128 0.010 >400 0.017 0.000 87.96 >400 +18:10:18 0.015 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:10:20 0.010 >400 0.015 73 0.010 >400 0.021 0.000 91.48 >400 +18:10:22 0.015 >400 0.015 34.7 0.010 >400 0.021 0.000 87.96 >400 +18:10:24 0.010 >400 0.015 228 0.015 >400 0.019 0.000 87.96 >400 +18:10:26 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:10:28 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:10:30 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:10:32 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:10:34 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:10:36 0.015 120 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:10:38 0.015 76 0.015 128 0.010 >400 0.019 0.000 91.48 >400 +18:10:40 0.015 >400 0.015 >400 0.015 228 0.021 0.000 87.96 256 +18:10:42 0.010 >400 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +18:10:44 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:10:46 0.015 256 0.015 31.0 0.010 >400 0.021 0.000 87.96 >400 +18:10:48 0.015 >400 0.015 >400 0.010 186 0.019 0.000 87.96 >400 +18:10:50 0.010 341 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:10:52 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:10:54 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:10:56 0.020 11.8 0.020 11.0 0.015 >400 0.027 0.000 87.96 >400 +18:10:58 0.060 19.3 0.055 23.5 0.030 22.5 0.061 0.000 91.48 26.9 +18:11:00 0.025 8.3 0.025 18.0 0.020 15.2 0.034 0.000 91.48 158 +18:11:02 0.015 39.4 0.015 24.4 0.015 82 0.019 0.000 87.96 >400 +18:11:04 0.010 >400 0.015 256 0.010 >400 0.017 0.000 91.48 >400 +18:11:06 0.020 12.5 0.020 10.6 0.020 11.0 0.029 0.000 87.96 >400 +18:11:08 0.020 14.5 0.025 14.2 0.020 11.1 0.030 0.000 87.96 >400 +18:11:10 0.030 14.0 0.035 11.8 0.030 11.2 0.044 0.000 87.96 >400 +18:11:12 0.040 11.9 0.055 11.0 0.040 11.6 0.065 0.000 91.48 73 +18:11:14 0.015 17.1 0.020 8.6 0.015 128 0.025 0.000 87.96 >400 +18:11:16 0.015 256 0.015 128 0.010 >400 0.019 0.000 91.48 >400 +18:11:18 0.020 13.1 0.025 11.6 0.020 11.2 0.032 0.000 87.96 >400 +18:11:20 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:11:22 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:11:24 0.020 16.9 0.030 16.8 0.020 14.9 0.037 0.000 87.96 >400 +18:11:26 0.015 48 0.015 256 0.010 >400 0.021 0.000 87.96 >400 +18:11:28 0.015 114 0.020 66 0.015 108 0.023 0.000 91.48 53 +18:11:30 0.020 15.6 0.020 16.1 0.015 35.3 0.025 0.000 87.96 >400 +18:11:32 0.010 >400 0.010 >400 0.015 98 0.019 0.000 87.96 >400 +18:11:34 0.015 59 0.035 10.8 0.025 13.3 0.041 0.000 87.96 >400 +18:11:36 0.025 11.3 0.025 20.7 0.020 14.1 0.034 0.000 87.96 >400 +18:11:38 0.025 13.2 0.025 13.2 0.020 15.9 0.036 0.000 87.96 293 +18:11:40 0.030 10.7 0.025 13.0 0.020 14.6 0.032 0.000 87.96 >400 +18:11:42 0.015 >400 0.015 171 0.010 >400 0.023 0.000 87.96 >400 +18:11:44 0.015 >400 0.015 >400 0.015 33.0 0.023 0.000 87.96 >400 +18:11:46 0.015 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:11:48 0.010 >400 0.015 14.1 0.015 34.1 0.023 0.000 87.96 >400 +18:11:50 0.030 8.8 0.025 10.3 0.025 10.0 0.037 0.000 87.96 >400 +18:11:52 0.020 8.7 0.020 13.8 0.020 14.9 0.032 0.000 87.96 >400 +18:11:54 0.030 12.0 0.040 11.6 0.030 12.1 0.046 0.000 87.96 >400 +18:11:56 0.025 11.6 0.025 16.0 0.015 137 0.030 0.000 87.96 >400 +18:11:58 0.025 15.4 0.020 15.2 0.015 13.8 0.027 0.000 87.96 >400 +18:12:00 0.035 10.6 0.035 14.4 0.020 17.5 0.041 0.000 87.96 >400 +18:12:02 0.030 9.8 0.045 14.7 0.030 12.6 0.055 0.000 87.96 >400 +18:12:04 0.020 7.8 0.030 12.3 0.020 11.0 0.037 0.000 87.96 >400 +18:12:06 0.030 12.2 0.035 12.3 0.025 14.1 0.043 0.000 87.96 >400 +18:12:08 0.025 9.0 0.035 12.2 0.020 13.0 0.039 0.000 87.96 >400 +18:12:10 0.020 19.3 0.020 16.9 0.020 17.5 0.029 0.000 87.96 >400 +18:12:12 0.030 11.1 0.030 11.0 0.025 10.2 0.035 0.000 87.96 >400 +18:12:14 0.030 11.6 0.030 13.8 0.020 11.1 0.036 0.000 87.96 >400 +18:12:16 0.025 11.2 0.035 12.9 0.020 16.4 0.040 0.000 87.96 >400 +18:12:18 0.030 14.7 0.030 13.7 0.020 13.3 0.036 0.000 87.96 >400 +18:12:20 0.025 13.8 0.025 11.6 0.020 15.4 0.031 0.000 87.96 >400 +18:12:22 0.020 14.9 0.020 17.5 0.020 11.1 0.029 0.000 87.96 >400 +18:12:24 0.035 11.4 0.045 12.1 0.030 11.1 0.052 0.000 87.96 >400 +18:12:26 0.035 11.6 0.030 12.5 0.025 12.5 0.039 0.000 87.96 >400 +18:12:28 0.015 50 0.020 21.3 0.015 186 0.023 0.000 87.96 >400 +18:12:30 0.025 8.8 0.025 13.6 0.020 15.9 0.029 0.000 87.96 >400 +18:12:32 0.025 11.8 0.030 11.4 0.025 10.5 0.042 0.000 87.96 >400 +18:12:34 0.025 11.0 0.030 13.8 0.025 12.4 0.040 0.000 87.96 >400 +18:12:36 0.015 256 0.015 256 0.015 50 0.019 0.000 87.96 >400 +18:12:38 0.015 93 0.020 15.5 0.015 48 0.022 0.000 87.96 >400 +18:12:40 0.015 14.9 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:12:42 0.025 14.7 0.025 16.5 0.015 12.9 0.027 0.000 87.96 >400 +18:12:44 0.035 9.1 0.035 10.6 0.025 12.6 0.043 0.000 87.96 >400 +18:12:46 0.040 11.2 0.050 9.8 0.040 10.0 0.063 0.000 91.48 >400 +18:12:48 0.030 13.5 0.035 13.1 0.020 14.0 0.042 0.000 87.96 >400 +18:12:50 0.025 12.0 0.030 16.1 0.020 14.7 0.034 0.000 87.96 >400 +18:12:52 0.030 11.6 0.045 11.8 0.030 N/A 0.054 0.000 91.48 >400 +18:12:54 0.035 11.4 0.035 13.0 0.020 13.4 0.047 0.000 87.96 >400 +18:12:56 0.025 15.4 0.030 14.9 0.025 12.6 0.038 0.000 87.96 >400 +18:12:58 0.020 17.1 0.025 15.1 0.020 13.3 0.032 0.000 87.96 >400 +18:13:00 0.030 11.3 0.030 13.2 0.025 13.7 0.042 0.000 91.48 158 +18:13:02 0.025 11.8 0.030 12.6 0.020 11.1 0.035 0.000 87.96 >400 +18:13:04 0.035 10.4 0.035 11.3 0.025 12.2 0.043 0.000 87.96 >400 +18:13:06 0.030 9.8 0.030 12.2 0.020 18.0 0.036 0.000 91.48 >400 +18:13:08 0.015 9.7 0.020 17.2 0.015 158 0.022 0.000 87.96 >400 +18:13:10 0.010 >400 0.015 228 0.015 >400 0.021 0.000 87.96 >400 +18:13:12 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:13:14 0.015 51 0.015 146 0.015 28.4 0.022 0.000 87.96 >400 +18:13:16 0.030 9.4 0.040 12.2 0.030 10.3 0.049 0.000 87.96 >400 +18:13:18 0.025 20.1 0.030 16.8 0.020 14.4 0.036 0.000 87.96 >400 +18:13:20 0.025 15.1 0.025 13.9 0.015 18.8 0.029 0.000 87.96 >400 +18:13:22 0.020 6.1 0.020 13.5 0.020 14.5 0.029 0.000 87.96 >400 +18:13:24 0.020 13.2 0.025 12.2 0.020 13.4 0.032 0.000 87.96 >400 +18:13:26 0.015 25.0 0.015 39.4 0.015 85 0.021 0.000 87.96 >400 +18:13:28 0.015 >400 0.015 >400 0.015 137 0.021 0.000 87.96 >400 +18:13:30 0.015 >400 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:13:32 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:13:34 0.010 >400 0.015 293 0.010 >400 0.017 0.000 91.48 >400 +18:13:36 0.030 12.8 0.030 19.3 0.025 9.5 0.036 0.000 87.96 >400 +18:13:38 0.015 25.6 0.015 32.5 0.015 186 0.021 0.000 87.96 >400 +18:13:40 0.035 22.0 0.050 20.1 0.025 20.5 0.057 0.000 87.96 >400 +18:13:42 0.025 11.6 0.025 11.8 0.025 10.3 0.037 0.000 87.96 >400 +18:13:44 0.030 11.0 0.035 11.4 0.030 11.6 0.046 0.000 87.96 >400 +18:13:46 0.030 7.8 0.035 12.6 0.025 11.4 0.043 0.000 91.48 66 +18:13:48 0.030 10.9 0.035 11.6 0.020 13.2 0.038 0.000 87.96 >400 +18:13:50 0.015 40 0.015 50 0.015 >400 0.021 0.000 87.96 >400 +18:13:52 0.015 28.4 0.015 137 0.015 >400 0.021 0.000 91.48 >400 +18:13:54 0.020 11.8 0.015 73 0.015 108 0.023 0.000 87.96 >400 +18:13:56 0.015 19.1 0.020 18.1 0.020 17.5 0.028 0.000 87.96 >400 +18:13:58 0.025 10.6 0.040 11.0 0.035 12.1 0.053 0.000 87.96 >400 +18:14:00 0.020 18.0 0.025 16.7 0.025 14.1 0.034 0.000 87.96 >400 +18:14:02 0.025 9.7 0.030 16.3 0.025 14.7 0.032 0.000 87.96 >400 +18:14:04 0.020 14.2 0.035 15.6 0.025 13.5 0.040 0.000 87.96 >400 +18:14:06 0.025 14.5 0.030 10.4 0.020 12.3 0.036 0.000 87.96 >400 +18:14:08 0.035 11.6 0.035 11.6 0.025 13.5 0.042 0.000 87.96 >400 +18:14:10 0.035 12.2 0.030 8.8 0.025 8.2 0.039 0.000 87.96 >400 +18:14:12 0.020 14.7 0.020 29.3 0.015 >400 0.025 0.000 87.96 >400 +18:14:14 0.030 11.4 0.025 9.3 0.020 11.4 0.032 0.000 87.96 293 +18:14:16 0.025 12.0 0.025 21.3 0.020 16.9 0.034 0.000 87.96 >400 +18:14:18 0.025 13.4 0.030 11.7 0.020 13.3 0.035 0.000 87.96 >400 +18:14:20 0.040 12.3 0.040 9.3 0.030 9.5 0.052 0.000 87.96 >400 +18:14:22 0.030 10.0 0.025 12.5 0.020 13.5 0.033 0.000 87.96 >400 +18:14:24 0.010 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +18:14:26 0.020 18.1 0.020 19.5 0.015 23.5 0.024 0.000 91.48 108 +18:14:28 0.020 14.9 0.020 16.0 0.015 59 0.023 0.000 87.96 >400 +18:14:30 0.015 34.1 0.020 18.6 0.015 228 0.022 0.000 87.96 >400 +18:14:32 0.015 29.3 0.015 37.2 0.015 256 0.021 0.000 87.96 >400 +18:14:34 0.015 293 0.015 205 0.015 102 0.021 0.000 91.48 293 +18:14:36 0.015 108 0.015 36.6 0.015 137 0.021 0.000 91.48 >400 +18:14:38 0.015 146 0.015 45 0.015 293 0.021 0.000 87.96 >400 +18:14:40 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:14:42 0.015 57 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:14:44 0.015 35.9 0.020 12.0 0.015 51 0.023 0.000 87.96 >400 +18:14:46 0.015 57 0.020 18.1 0.015 171 0.022 0.000 87.96 >400 +18:14:48 0.015 64 0.020 33.0 0.015 76 0.023 0.000 87.96 >400 +18:14:50 0.025 11.4 0.040 11.7 0.030 12.9 0.050 0.000 91.48 >400 +18:14:52 0.030 10.2 0.040 9.9 0.035 10.9 0.052 0.000 91.48 341 +18:14:54 0.030 11.6 0.050 12.4 0.030 13.7 0.055 0.000 87.96 >400 +18:14:56 0.035 12.0 0.040 14.7 0.025 13.0 0.047 0.000 87.96 >400 +18:14:58 0.030 13.1 0.030 12.2 0.020 10.2 0.037 0.000 87.96 >400 +18:15:00 0.025 12.3 0.035 11.4 0.025 13.1 0.040 0.000 87.96 >400 +18:15:02 0.030 12.5 0.045 10.2 0.030 12.6 0.052 0.000 91.48 82 +18:15:04 0.025 11.1 0.035 10.7 0.025 15.1 0.044 0.000 91.48 >400 +18:15:06 0.025 15.5 0.035 19.5 0.025 14.7 0.046 0.000 87.96 >400 +18:15:08 0.015 9.9 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:15:10 0.015 137 0.015 >400 0.010 205 0.017 0.000 87.96 >400 +18:15:12 0.015 57 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:15:14 0.015 341 0.020 12.3 0.015 28.1 0.023 0.000 91.48 >400 +18:15:16 0.015 >400 0.015 114 0.015 89 0.021 0.000 87.96 >400 +18:15:18 0.015 21.8 0.015 >400 0.015 32.5 0.022 0.000 87.96 >400 +18:15:20 0.020 22.5 0.025 17.5 0.020 14.7 0.029 0.000 87.96 >400 +18:15:22 0.025 10.6 0.030 14.0 0.025 10.1 0.039 0.000 91.48 >400 +18:15:24 0.030 11.4 0.035 15.6 0.025 10.9 0.043 0.000 91.48 293 +18:15:26 0.015 16.8 0.015 98 0.015 >400 0.022 0.000 87.96 >400 +18:15:28 0.015 205 0.015 >400 0.015 341 0.021 0.000 87.96 >400 +18:15:30 0.015 341 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:15:32 0.015 128 0.025 27.3 0.015 82 0.027 0.000 91.48 >400 +18:15:34 0.015 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:15:36 0.030 20.5 0.040 18.3 0.025 18.1 0.048 0.000 91.48 341 +18:15:38 0.030 6.0 0.030 9.7 0.025 9.9 0.039 0.000 87.96 >400 +18:15:40 0.040 9.3 0.040 9.7 0.030 10.3 0.050 0.000 87.96 >400 +18:15:42 0.015 9.8 0.020 18.3 0.020 13.7 0.025 0.000 87.96 >400 +18:15:44 0.015 76 0.015 98 0.015 228 0.019 0.000 87.96 >400 +18:15:46 0.015 >400 0.015 102 0.015 >400 0.019 0.000 87.96 >400 +18:15:48 0.035 31.0 0.065 8.7 0.035 4.0 0.074 0.000 91.48 120 +18:15:50 0.020 11.3 0.015 16.9 0.020 15.4 0.025 0.000 91.48 293 +18:15:52 0.025 10.9 0.030 13.6 0.020 12.1 0.037 0.000 91.48 >400 +18:15:54 0.035 13.4 0.040 9.8 0.025 10.7 0.047 0.000 91.48 >400 +18:15:56 0.025 16.8 0.030 12.1 0.025 13.3 0.042 0.000 87.96 >400 +18:15:58 0.025 16.4 0.030 10.0 0.025 14.7 0.036 0.000 91.48 >400 +18:16:00 0.030 10.6 0.030 18.1 0.025 16.3 0.036 0.000 87.96 >400 +18:16:02 0.020 17.8 0.025 13.7 0.020 10.7 0.031 0.000 87.96 >400 +18:16:04 0.035 14.5 0.040 11.8 0.030 13.2 0.050 0.000 87.96 >400 +18:16:06 0.030 11.6 0.030 18.3 0.025 12.5 0.040 0.000 91.48 341 +18:16:08 0.020 10.9 0.025 11.6 0.015 16.3 0.029 0.000 87.96 >400 +18:16:10 0.025 13.8 0.025 15.2 0.015 85 0.034 0.000 87.96 >400 +18:16:12 0.015 13.4 0.015 39.4 0.010 >400 0.021 0.000 87.96 >400 +18:16:14 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:16:16 0.025 13.1 0.030 13.3 0.020 12.0 0.032 0.000 87.96 >400 +18:16:18 0.020 18.3 0.025 19.5 0.020 22.0 0.030 0.000 87.96 >400 +18:16:20 0.030 12.3 0.030 11.1 0.025 12.3 0.036 0.000 87.96 >400 +18:16:22 0.020 17.4 0.020 13.3 0.020 14.7 0.030 0.000 87.96 >400 +18:16:24 0.040 19.9 0.065 16.5 0.040 14.1 0.076 0.000 91.48 27.7 +18:16:26 0.025 11.5 0.030 10.8 0.020 19.1 0.032 0.000 91.48 >400 +18:16:28 0.015 128 0.015 93 0.015 >400 0.021 0.000 87.96 >400 +18:16:30 0.015 293 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +18:16:32 0.015 68 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:16:34 0.015 50 0.020 6.5 0.015 >400 0.025 0.000 87.96 >400 +18:16:36 0.015 128 0.015 128 0.015 256 0.022 0.000 91.48 >400 +18:16:38 0.055 11.0 0.045 10.1 0.075 9.3 0.082 0.000 91.48 108 +18:16:40 0.030 9.9 0.030 10.7 0.030 2.7 0.044 0.000 91.48 19.3 +18:16:42 0.015 66 0.020 16.8 0.015 29.7 0.027 0.000 87.96 >400 +18:16:44 0.015 256 0.015 256 0.015 186 0.021 0.000 87.96 >400 +18:16:46 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:16:48 0.015 13.5 0.015 205 0.015 293 0.021 0.000 87.96 >400 +18:16:50 0.015 171 0.020 19.0 0.015 341 0.023 0.000 87.96 >400 +18:16:52 0.020 13.8 0.020 13.0 0.020 14.5 0.029 0.000 87.96 >400 +18:16:54 0.040 12.3 0.035 10.0 0.030 11.4 0.044 0.000 87.96 >400 +18:16:56 0.030 15.2 0.030 10.7 0.025 11.3 0.042 0.000 87.96 >400 +18:16:58 0.035 12.8 0.040 12.7 0.030 13.6 0.052 0.000 91.48 >400 +18:17:00 0.035 13.7 0.035 11.2 0.030 12.7 0.044 0.000 91.48 53 +18:17:02 0.020 14.7 0.025 14.6 0.020 12.6 0.031 0.000 91.48 >400 +18:17:04 0.040 11.3 0.055 11.3 0.045 11.8 0.074 0.000 91.48 32.5 +18:17:06 0.030 12.1 0.045 11.6 0.040 10.9 0.057 0.000 91.48 48 +18:17:08 0.030 11.2 0.040 12.6 0.035 12.0 0.050 0.000 91.48 >400 +18:17:10 0.015 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +18:17:12 0.015 293 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:17:14 0.030 17.1 0.040 19.3 0.025 16.9 0.047 0.000 87.96 >400 +18:17:16 0.015 38.6 0.015 158 0.015 >400 0.021 0.000 87.96 >400 +18:17:18 0.020 12.6 0.020 11.4 0.015 43 0.025 0.000 87.96 >400 +18:17:20 0.040 13.0 0.040 11.4 0.030 11.3 0.051 0.000 91.48 341 +18:17:22 0.030 12.5 0.045 16.4 0.030 10.8 0.052 0.000 91.48 57 +18:17:24 0.045 N/A 0.045 9.2 0.035 9.0 0.059 0.000 91.48 85 +18:17:26 0.040 11.4 0.035 N/A 0.030 10.3 0.043 0.000 91.48 256 +18:17:28 0.030 9.6 0.040 8.9 0.025 9.4 0.047 0.000 87.96 >400 +18:17:30 0.030 8.2 0.035 10.3 0.030 10.2 0.048 0.000 91.48 98 +18:17:32 0.025 17.2 0.030 14.6 0.020 24.4 0.036 0.000 87.96 >400 +18:17:34 0.030 13.4 0.030 15.5 0.030 12.9 0.039 0.000 87.96 >400 +18:17:36 0.030 14.7 0.055 10.8 0.040 9.8 0.063 0.000 91.48 21.8 +18:17:38 0.045 11.4 0.055 11.0 0.030 11.1 0.063 0.000 87.96 >400 +18:17:40 0.035 14.2 0.035 12.0 0.025 12.1 0.044 0.000 87.96 >400 +18:17:42 0.035 10.2 0.040 13.1 0.030 12.3 0.048 0.000 87.96 >400 +18:17:44 0.025 9.1 0.035 12.6 0.025 11.9 0.043 0.000 87.96 >400 +18:17:46 0.030 14.2 0.035 11.4 0.020 12.6 0.039 0.000 87.96 >400 +18:17:48 0.030 13.0 0.030 11.9 0.020 11.1 0.039 0.000 87.96 >400 +18:17:50 0.025 10.7 0.035 12.9 0.025 12.8 0.043 0.000 87.96 >400 +18:17:52 0.045 12.0 0.035 9.7 0.025 10.7 0.046 0.000 91.48 >400 +18:17:54 0.030 11.6 0.025 11.6 0.020 13.4 0.033 0.000 91.48 >400 +18:17:56 0.030 11.6 0.040 11.4 0.025 12.8 0.045 0.000 87.96 >400 +18:17:58 0.025 10.8 0.040 13.8 0.030 14.2 0.047 0.000 87.96 >400 +18:18:00 0.035 10.8 0.045 10.0 0.030 11.6 0.052 0.000 87.96 >400 +18:18:02 0.030 9.8 0.035 15.4 0.025 10.8 0.042 0.000 87.96 >400 +18:18:04 0.015 98 0.015 341 0.015 16.8 0.022 0.000 87.96 >400 +18:18:06 0.015 146 0.020 24.4 0.015 47 0.025 0.000 87.96 >400 +18:18:08 0.015 73 0.015 114 0.010 >400 0.021 0.000 87.96 >400 +18:18:10 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:18:12 0.015 293 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:18:14 0.015 71 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:18:16 0.015 256 0.015 64 0.010 >400 0.019 0.000 87.96 >400 +18:18:18 0.015 108 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:18:20 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:18:22 0.015 48 0.015 341 0.010 >400 0.021 0.000 87.96 >400 +18:18:24 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:18:26 0.015 228 0.015 186 0.010 >400 0.017 0.000 91.48 >400 +18:18:28 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:18:30 0.010 >400 0.015 51 0.010 >400 0.017 0.000 87.96 >400 +18:18:32 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:18:34 0.015 55 0.015 40 0.015 66 0.023 0.000 87.96 >400 +18:18:36 0.025 14.6 0.030 11.6 0.020 14.5 0.032 0.000 87.96 >400 +18:18:38 0.025 10.5 0.045 16.9 0.030 14.6 0.055 0.000 87.96 >400 +18:18:40 0.015 39.4 0.020 16.3 0.015 >400 0.022 0.000 87.96 >400 +18:18:42 0.030 13.1 0.030 9.8 0.025 13.4 0.040 0.000 87.96 >400 +18:18:44 0.030 12.0 0.035 14.7 0.030 11.5 0.041 0.000 91.48 >400 +18:18:46 0.025 10.3 0.035 12.6 0.025 13.3 0.044 0.000 87.96 >400 +18:18:48 0.015 28.8 0.015 51 0.015 53 0.022 0.000 91.48 >400 +18:18:50 0.015 79 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:18:52 0.015 11.9 0.010 >400 0.010 >400 0.019 0.000 87.96 >400 +18:18:54 0.015 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:18:56 0.015 256 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:18:58 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:19:00 0.015 205 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +18:19:02 0.025 14.5 0.030 13.0 0.025 12.6 0.039 0.000 87.96 >400 +18:19:04 0.025 9.9 0.020 10.7 0.015 59 0.025 0.000 87.96 >400 +18:19:06 0.025 11.8 0.030 10.9 0.025 11.4 0.039 0.000 87.96 >400 +18:19:08 0.020 10.1 0.020 16.3 0.020 12.8 0.026 0.000 87.96 >400 +18:19:10 0.035 10.2 0.045 9.0 0.030 10.3 0.056 0.000 87.96 >400 +18:19:12 0.025 14.4 0.030 16.8 0.020 17.4 0.035 0.000 87.96 >400 +18:19:14 0.020 13.7 0.025 17.1 0.015 25.3 0.030 0.000 87.96 >400 +18:19:16 0.015 158 0.015 47 0.015 293 0.019 0.000 87.96 >400 +18:19:18 0.015 293 0.015 85 0.015 >400 0.022 0.000 87.96 >400 +18:19:20 0.015 120 0.015 23.8 0.015 66 0.021 0.000 87.96 >400 +18:19:22 0.015 >400 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +18:19:24 0.015 39.4 0.020 30.1 0.015 64 0.025 0.000 87.96 >400 +18:19:26 0.015 >400 0.020 19.7 0.015 76 0.023 0.000 87.96 >400 +18:19:28 0.015 46 0.015 256 0.010 >400 0.023 0.000 87.96 >400 +18:19:30 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:19:32 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:19:34 0.015 102 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +18:19:36 0.015 120 0.015 53 0.015 85 0.019 0.000 91.48 >400 +18:19:38 0.015 >400 0.015 42 0.015 >400 0.021 0.000 87.96 >400 +18:19:40 0.015 76 0.015 37.9 0.015 256 0.021 0.000 87.96 >400 +18:19:42 0.015 41 0.015 38.6 0.015 24.4 0.021 0.000 87.96 >400 +18:19:44 0.015 76 0.015 171 0.015 137 0.019 0.000 87.96 >400 +18:19:46 0.015 32.5 0.015 48 0.015 51 0.022 0.000 87.96 >400 +18:19:48 0.015 11.9 0.015 158 0.015 186 0.021 0.000 91.48 >400 +18:19:50 0.015 64 0.015 36.6 0.015 171 0.022 0.000 87.96 >400 +18:19:52 0.015 64 0.015 76 0.015 55 0.022 0.000 87.96 >400 +18:19:54 0.015 79 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:19:56 0.015 >400 0.015 73 0.010 >400 0.021 0.000 87.96 >400 +18:19:58 0.015 256 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:20:00 0.015 228 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +18:20:02 0.010 >400 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:20:04 0.015 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:20:06 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:20:08 0.010 >400 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:20:10 0.015 82 0.015 102 0.015 >400 0.021 0.000 87.96 341 +18:20:12 0.015 341 0.015 >400 0.015 158 0.021 0.000 87.96 >400 +18:20:14 0.015 93 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:20:16 0.015 27.7 0.015 42 0.015 120 0.022 0.000 87.96 >400 +18:20:18 0.015 22.5 0.015 293 0.015 34.1 0.022 0.000 91.48 >400 +18:20:20 0.015 46 0.015 19.3 0.015 16.9 0.022 0.000 87.96 >400 +18:20:22 0.015 128 0.015 93 0.015 120 0.021 0.000 87.96 >400 +18:20:24 0.015 38.6 0.015 256 0.015 71 0.022 0.000 87.96 >400 +18:20:26 0.015 256 0.015 186 0.015 128 0.021 0.000 87.96 >400 +18:20:28 0.015 36.6 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +18:20:30 0.015 128 0.015 85 0.015 293 0.019 0.000 87.96 >400 +18:20:32 0.020 8.0 0.020 14.1 0.015 14.9 0.027 0.000 87.96 >400 +18:20:34 0.020 11.2 0.020 12.1 0.015 15.4 0.024 0.000 87.96 >400 +18:20:36 0.015 60 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +18:20:38 0.015 205 0.015 85 0.015 >400 0.021 0.000 87.96 >400 +18:20:40 0.015 171 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:20:42 0.015 341 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:20:44 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:20:46 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:20:48 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:20:50 0.010 >400 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +18:20:52 0.015 293 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:20:54 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:20:56 0.010 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:20:58 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:21:00 0.015 293 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:21:02 0.015 66 0.015 137 0.015 32.5 0.022 0.000 87.96 >400 +18:21:04 0.015 108 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:21:06 0.015 341 0.015 186 0.015 256 0.019 0.000 87.96 >400 +18:21:08 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:21:10 0.015 158 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:21:12 0.010 >400 0.015 54 0.010 >400 0.021 0.000 87.96 >400 +18:21:14 0.015 102 0.015 33.6 0.010 >400 0.019 0.000 87.96 >400 +18:21:16 0.015 37.2 0.015 228 0.015 34.1 0.021 0.000 87.96 >400 +18:21:18 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:21:20 0.015 114 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:21:22 0.010 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:21:24 0.015 >400 0.015 93 0.010 >400 0.021 0.000 87.96 >400 +18:21:26 0.015 171 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:21:28 0.020 8.5 0.020 5.0 0.020 6.1 0.030 0.000 87.96 >400 +18:21:30 0.015 >400 0.015 146 0.010 >400 0.021 0.000 87.96 >400 +18:21:32 0.015 137 0.015 33.6 0.015 14.3 0.022 0.000 87.96 >400 +18:21:34 0.015 37.2 0.020 15.6 0.015 171 0.025 0.000 87.96 >400 +18:21:36 0.015 >400 0.025 18.0 0.020 5.8 0.030 0.000 87.96 >400 +18:21:38 0.015 102 0.020 16.0 0.015 341 0.027 0.000 87.96 >400 +18:21:40 0.015 >400 0.020 12.3 0.015 205 0.027 0.000 87.96 >400 +18:21:42 0.015 82 0.015 24.4 0.015 19.1 0.023 0.000 87.96 341 +18:21:44 0.015 114 0.020 19.7 0.020 N/A 0.025 0.000 87.96 >400 +18:21:46 0.020 20.7 0.025 6.4 0.015 12.4 0.030 0.000 87.96 >400 +18:21:48 0.015 171 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:21:50 0.015 37.2 0.020 16.3 0.015 >400 0.025 0.000 87.96 >400 +18:21:52 0.015 256 0.025 12.4 0.020 17.7 0.027 0.000 87.96 >400 +18:21:54 0.015 51 0.020 18.5 0.015 20.7 0.023 0.000 87.96 >400 +18:21:56 0.015 186 0.015 >400 0.015 24.4 0.021 0.000 87.96 >400 +18:21:58 0.015 256 0.020 12.6 0.015 17.4 0.025 0.000 87.96 >400 +18:22:00 0.020 11.2 0.020 6.7 0.015 32.0 0.025 0.000 87.96 >400 +18:22:02 0.015 37.2 0.015 33.6 0.015 53 0.022 0.000 87.96 >400 +18:22:04 0.015 >400 0.020 11.1 0.015 114 0.025 0.000 87.96 >400 +18:22:06 0.015 256 0.025 6.5 0.020 14.6 0.034 0.000 87.96 >400 +18:22:08 0.015 >400 0.015 36.6 0.015 >400 0.023 0.000 87.96 >400 +18:22:10 0.015 >400 0.015 82 0.015 >400 0.019 0.000 87.96 >400 +18:22:12 0.015 205 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:22:14 0.015 256 0.020 15.4 0.015 17.8 0.025 0.000 87.96 >400 +18:22:16 0.020 20.1 0.020 7.4 0.015 9.1 0.025 0.000 87.96 >400 +18:22:18 0.015 85 0.020 31.0 0.015 54 0.022 0.000 87.96 >400 +18:22:20 0.015 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:22:22 0.015 38.6 0.020 14.1 0.015 128 0.027 0.000 87.96 >400 +18:22:24 0.020 20.9 0.020 6.5 0.020 6.5 0.027 0.000 87.96 >400 +18:22:26 0.020 15.3 0.030 17.7 0.020 14.6 0.034 0.000 87.96 >400 +18:22:28 0.030 11.9 0.030 16.1 0.020 17.7 0.036 0.000 87.96 >400 +18:22:30 0.035 11.8 0.035 11.9 0.025 15.5 0.040 0.000 91.48 73 +18:22:32 0.025 10.4 0.030 13.2 0.025 11.8 0.040 0.000 87.96 >400 +18:22:34 0.020 13.1 0.025 17.2 0.020 17.8 0.034 0.000 87.96 >400 +18:22:36 0.025 13.9 0.035 15.4 0.025 15.6 0.043 0.000 87.96 >400 +18:22:38 0.030 12.6 0.030 12.0 0.015 186 0.035 0.000 87.96 >400 +18:22:40 0.025 11.2 0.025 28.8 0.020 17.5 0.031 0.000 87.96 >400 +18:22:42 0.015 293 0.025 7.5 0.020 11.0 0.032 0.000 87.96 >400 +18:22:44 0.015 64 0.015 228 0.015 >400 0.019 0.000 87.96 >400 +18:22:46 0.020 20.1 0.020 12.4 0.015 17.5 0.025 0.000 87.96 >400 +18:22:48 0.015 39.4 0.020 18.5 0.015 30.1 0.023 0.000 91.48 >400 +18:22:50 0.015 17.1 0.015 49 0.010 >400 0.021 0.000 87.96 >400 +18:22:52 0.015 45 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:22:54 0.015 >400 0.015 114 0.015 60 0.022 0.000 87.96 >400 +18:22:56 0.015 55 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:22:58 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:23:00 0.015 34.7 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:23:02 0.015 62 0.015 186 0.010 >400 0.021 0.000 87.96 >400 +18:23:04 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:23:06 0.015 256 0.015 102 0.010 >400 0.017 0.000 87.96 >400 +18:23:08 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:23:10 0.010 >400 0.015 50 0.010 >400 0.019 0.000 87.96 >400 +18:23:12 0.015 35.9 0.015 >400 0.010 >400 0.021 0.000 91.48 >400 +18:23:14 0.015 >400 0.015 >400 0.015 >400 0.023 0.000 87.96 >400 +18:23:16 0.020 13.4 0.025 10.3 0.015 14.6 0.030 0.000 87.96 >400 +18:23:18 0.015 23.5 0.015 44 0.015 85 0.021 0.000 87.96 >400 +18:23:20 0.020 11.0 0.020 11.8 0.015 15.6 0.025 0.000 87.96 >400 +18:23:22 0.020 N/A 0.060 N/A 0.040 N/A 0.075 0.000 91.48 146 +18:23:24 0.035 29.3 0.060 23.5 0.045 6.1 0.075 0.000 91.48 137 +18:23:26 0.025 12.6 0.035 12.6 0.020 10.5 0.038 0.000 87.96 >400 +18:23:28 0.025 9.4 0.030 12.1 0.020 15.6 0.034 0.000 87.96 >400 +18:23:30 0.035 11.8 0.035 14.9 0.030 12.0 0.044 0.000 87.96 >400 +18:23:32 0.035 10.9 0.035 11.0 0.025 10.8 0.043 0.000 87.96 >400 +18:23:34 0.025 17.4 0.025 15.2 0.015 33.6 0.030 0.000 87.96 >400 +18:23:36 0.030 13.3 0.030 12.3 0.025 11.8 0.041 0.000 87.96 >400 +18:23:38 0.025 8.9 0.030 14.9 0.025 12.0 0.039 0.000 87.96 >400 +18:23:40 0.020 11.4 0.025 15.2 0.020 11.1 0.034 0.000 87.96 >400 +18:23:42 0.015 114 0.015 64 0.015 32.5 0.022 0.000 87.96 >400 +18:23:44 0.030 N/A 0.030 14.3 0.020 11.8 0.035 0.000 87.96 >400 +18:23:46 0.025 11.3 0.030 15.6 0.020 13.7 0.035 0.000 87.96 >400 +18:23:48 0.030 16.0 0.030 13.2 0.020 18.0 0.037 0.000 87.96 >400 +18:23:50 0.020 13.6 0.025 8.7 0.015 22.3 0.025 0.000 87.96 >400 +18:23:52 0.015 73 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:23:54 0.010 >400 0.015 85 0.010 >400 0.019 0.000 91.48 >400 +18:23:56 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:23:58 0.020 13.3 0.025 12.1 0.015 20.5 0.030 0.000 87.96 >400 +18:24:00 0.025 20.9 0.030 15.5 0.020 17.1 0.036 0.000 87.96 >400 +18:24:02 0.025 15.8 0.025 16.1 0.015 71 0.031 0.000 91.48 34.1 +18:24:04 0.015 25.0 0.020 18.8 0.015 205 0.025 0.000 91.48 >400 +18:24:06 0.015 93 0.020 17.5 0.015 171 0.024 0.000 91.48 128 +18:24:08 0.015 >400 0.020 13.8 0.015 128 0.024 0.000 87.96 >400 +18:24:10 0.015 44 0.020 19.7 0.015 137 0.023 0.000 87.96 >400 +18:24:12 0.015 17.1 0.020 18.5 0.015 60 0.023 0.000 91.48 171 +18:24:14 0.020 15.1 0.020 16.3 0.015 41 0.027 0.000 91.48 98 +18:24:16 0.015 32.0 0.020 16.9 0.015 85 0.024 0.000 91.48 54 +18:24:18 0.015 34.7 0.020 15.6 0.015 53 0.025 0.000 91.48 >400 +18:24:20 0.010 >400 0.015 33.0 0.015 102 0.021 0.000 87.96 >400 +18:24:22 0.015 >400 0.015 >400 0.015 >400 0.019 0.000 87.96 >400 +18:24:24 0.015 68 0.020 16.9 0.015 >400 0.025 0.000 87.96 >400 +18:24:26 0.015 15.8 0.020 14.8 0.015 89 0.023 0.000 87.96 >400 +18:24:28 0.015 23.8 0.025 15.6 0.015 57 0.027 0.000 91.48 53 +18:24:30 0.015 >400 0.015 51 0.015 >400 0.021 0.000 87.96 >400 +18:24:32 0.015 32.0 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:24:34 0.020 14.4 0.030 14.9 0.015 102 0.030 0.000 91.48 205 +18:24:36 0.020 18.0 0.025 13.9 0.015 256 0.027 0.000 87.96 >400 +18:24:38 0.015 >400 0.015 128 0.010 >400 0.021 0.000 87.96 >400 +18:24:40 0.015 60 0.015 20.3 0.010 >400 0.021 0.000 87.96 >400 +18:24:42 0.015 137 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:24:44 0.015 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:24:46 0.015 60 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:24:48 0.020 10.8 0.015 293 0.015 256 0.022 0.000 87.96 >400 +18:24:50 0.015 47 0.015 >400 0.015 158 0.021 0.000 87.96 >400 +18:24:52 0.015 48 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:24:54 0.015 36.6 0.020 19.7 0.015 128 0.024 0.000 91.48 >400 +18:24:56 0.015 93 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:24:58 0.015 85 0.015 256 0.015 23.0 0.022 0.000 87.96 >400 +18:25:00 0.010 >400 0.015 37.2 0.010 >400 0.021 0.000 87.96 >400 +18:25:02 0.015 102 0.015 28.8 0.010 >400 0.021 0.000 87.96 >400 +18:25:04 0.010 >400 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +18:25:06 0.015 171 0.015 71 0.010 >400 0.022 0.000 87.96 >400 +18:25:08 0.015 17.1 0.020 16.9 0.015 50 0.023 0.000 87.96 >400 +18:25:10 0.015 25.6 0.020 17.5 0.015 85 0.023 0.000 87.96 >400 +18:25:12 0.015 11.0 0.020 12.1 0.015 66 0.025 0.000 87.96 >400 +18:25:14 0.015 49 0.015 23.0 0.015 186 0.021 0.000 91.48 >400 +18:25:16 0.015 35.3 0.020 16.0 0.015 293 0.023 0.000 87.96 >400 +18:25:18 0.015 48 0.015 23.3 0.010 >400 0.021 0.000 87.96 >400 +18:25:20 0.015 120 0.015 23.0 0.015 108 0.023 0.000 87.96 >400 +18:25:22 0.015 16.9 0.025 13.7 0.015 256 0.027 0.000 91.48 >400 +18:25:24 0.015 25.6 0.020 15.1 0.015 256 0.023 0.000 87.96 >400 +18:25:26 0.015 19.9 0.020 16.0 0.015 186 0.022 0.000 87.96 >400 +18:25:28 0.015 41 0.020 16.0 0.010 >400 0.024 0.000 87.96 >400 +18:25:30 0.015 120 0.025 14.0 0.015 >400 0.027 0.000 87.96 >400 +18:25:32 0.015 29.3 0.020 12.2 0.015 85 0.023 0.000 87.96 >400 +18:25:34 0.015 102 0.020 14.3 0.015 137 0.023 0.000 87.96 >400 +18:25:36 0.015 >400 0.020 12.9 0.015 93 0.024 0.000 87.96 >400 +18:25:38 0.015 33.0 0.015 89 0.010 >400 0.019 0.000 87.96 >400 +18:25:40 0.015 293 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:25:42 0.015 186 0.020 13.1 0.015 31.0 0.023 0.000 87.96 >400 +18:25:44 0.015 93 0.020 16.5 0.015 205 0.023 0.000 87.96 >400 +18:25:46 0.020 24.7 0.015 128 0.015 82 0.026 0.000 87.96 >400 +18:25:48 0.010 49 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:25:50 0.015 55 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:25:52 0.015 >400 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:25:54 0.015 31.5 0.015 32.5 0.015 293 0.021 0.000 87.96 >400 +18:25:56 0.015 >400 0.015 186 0.010 >400 0.021 0.000 91.48 >400 +18:25:58 0.015 32.5 0.015 29.7 0.010 >400 0.021 0.000 87.96 >400 +18:26:00 0.015 102 0.015 158 0.015 >400 0.021 0.000 87.96 >400 +18:26:02 0.015 114 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:26:04 0.015 205 0.015 93 0.015 120 0.022 0.000 91.48 >400 +18:26:06 0.015 50 0.015 37.9 0.015 120 0.021 0.000 91.48 158 +18:26:08 0.015 >400 0.015 37.9 0.015 >400 0.023 0.000 91.48 >400 +18:26:10 0.025 7.2 0.020 13.3 0.020 9.1 0.027 0.000 87.96 >400 +18:26:12 0.020 13.0 0.015 19.9 0.015 13.1 0.023 0.000 87.96 341 +18:26:14 0.015 205 0.015 32.5 0.010 >400 0.021 0.000 87.96 >400 +18:26:16 0.015 82 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:26:18 0.015 37.9 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:26:20 0.015 102 0.015 49 0.015 341 0.021 0.000 87.96 >400 +18:26:22 0.015 85 0.020 N/A 0.020 N/A 0.029 0.000 87.96 >400 +18:26:24 0.025 13.8 0.030 13.3 0.020 13.8 0.036 0.000 87.96 >400 +18:26:26 0.040 11.0 0.055 8.5 0.040 10.0 0.068 0.000 91.48 256 +18:26:28 0.025 16.7 0.025 11.8 0.020 14.3 0.033 0.000 91.48 >400 +18:26:30 0.025 11.0 0.025 20.3 0.020 18.8 0.029 0.000 87.96 >400 +18:26:32 0.020 16.4 0.025 12.6 0.015 15.3 0.031 0.000 87.96 >400 +18:26:34 0.020 13.9 0.020 13.8 0.015 32.5 0.024 0.000 87.96 >400 +18:26:36 0.015 39.4 0.015 82 0.010 >400 0.021 0.000 87.96 >400 +18:26:38 0.025 11.8 0.030 14.1 0.025 12.3 0.042 0.000 87.96 >400 +18:26:40 0.025 11.6 0.035 15.1 0.025 15.8 0.041 0.000 87.96 >400 +18:26:42 0.030 11.7 0.025 19.5 0.020 14.9 0.035 0.000 91.48 >400 +18:26:44 0.025 13.3 0.025 15.5 0.020 14.0 0.032 0.000 87.96 >400 +18:26:46 0.015 >400 0.015 98 0.015 158 0.022 0.000 87.96 >400 +18:26:48 0.010 >400 0.015 128 0.010 >400 0.021 0.000 91.48 >400 +18:26:50 0.015 137 0.015 45 0.010 >400 0.021 0.000 87.96 >400 +18:26:52 0.020 10.8 0.020 24.4 0.020 14.9 0.029 0.000 87.96 >400 +18:26:54 0.020 6.8 0.020 30.1 0.015 68 0.023 0.000 87.96 >400 +18:26:56 0.030 10.8 0.030 13.5 0.025 8.8 0.039 0.000 87.96 >400 +18:26:58 0.030 16.1 0.035 11.3 0.025 12.5 0.044 0.000 87.96 >400 +18:27:00 0.020 6.1 0.020 8.4 0.020 12.8 0.030 0.000 87.96 >400 +18:27:02 0.015 16.8 0.020 15.9 0.015 15.9 0.025 0.000 91.48 205 +18:27:04 0.015 62 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:27:06 0.015 51 0.020 12.9 0.015 62 0.023 0.000 91.48 >400 +18:27:08 0.010 >400 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +18:27:10 0.010 >400 0.015 128 0.010 >400 0.017 0.000 87.96 >400 +18:27:12 0.015 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:27:14 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:27:16 0.010 >400 0.015 256 0.010 >400 0.017 0.000 91.48 >400 +18:27:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:20 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:22 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:27:24 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:26 0.015 42 0.025 12.2 0.015 34.7 0.025 0.000 91.48 >400 +18:27:28 0.020 25.3 0.020 31.5 0.015 89 0.027 0.000 91.48 128 +18:27:30 0.015 17.7 0.015 73 0.015 19.9 0.021 0.000 91.48 >400 +18:27:32 0.015 293 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:34 0.015 82 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +18:27:36 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:27:38 0.010 >400 0.015 93 0.010 >400 0.021 0.000 87.96 >400 +18:27:40 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:42 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:27:44 0.010 >400 0.015 102 0.015 228 0.019 0.000 87.96 >400 +18:27:46 0.025 8.4 0.020 27.3 0.015 120 0.025 0.000 87.96 >400 +18:27:48 0.025 16.4 0.025 16.1 0.020 19.0 0.035 0.000 87.96 >400 +18:27:50 0.030 10.7 0.035 11.8 0.025 12.7 0.047 0.000 87.96 >400 +18:27:52 0.020 13.2 0.025 15.8 0.020 16.3 0.034 0.000 87.96 >400 +18:27:54 0.020 12.0 0.020 16.0 0.020 11.1 0.028 0.000 91.48 >400 +18:27:56 0.025 5.8 0.015 43 0.015 >400 0.027 0.000 87.96 >400 +18:27:58 0.015 85 0.015 158 0.015 256 0.021 0.000 87.96 >400 +18:28:00 0.015 186 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:28:02 0.010 >400 0.015 41 0.010 >400 0.019 0.000 87.96 >400 +18:28:04 0.015 82 0.020 32.5 0.015 171 0.021 0.000 91.48 >400 +18:28:06 0.015 59 0.020 16.3 0.015 186 0.025 0.000 87.96 >400 +18:28:08 0.030 9.9 0.035 19.1 0.020 11.4 0.039 0.000 87.96 >400 +18:28:10 0.025 11.2 0.035 17.5 0.025 13.3 0.039 0.000 87.96 >400 +18:28:12 0.015 158 0.015 108 0.015 >400 0.021 0.000 87.96 >400 +18:28:14 0.015 228 0.020 22.3 0.015 293 0.025 0.000 87.96 >400 +18:28:16 0.025 8.1 0.020 33.0 0.015 256 0.025 0.000 87.96 >400 +18:28:18 0.015 19.7 0.015 102 0.020 8.2 0.025 0.000 87.96 >400 +18:28:20 0.020 49 0.030 34.7 0.015 66 0.036 0.000 93.98 256 +18:28:22 0.020 11.3 0.030 8.2 0.045 22.8 0.054 0.000 91.48 114 +18:28:24 0.015 40 0.015 >400 0.015 76 0.022 0.000 87.96 >400 +18:28:26 0.060 37.2 0.265 38.6 0.055 28.1 0.266 0.000 98.84 158 +18:28:28 0.030 7.7 0.025 37.9 0.020 16.4 0.031 0.000 87.96 >400 +18:28:30 0.015 256 0.020 17.7 0.010 >400 0.023 0.000 87.96 >400 +18:28:32 0.015 28.8 0.015 23.0 0.015 293 0.021 0.000 87.96 >400 +18:28:34 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:28:36 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:28:38 0.015 >400 0.015 120 0.015 >400 0.019 0.000 87.96 >400 +18:28:40 0.015 85 0.015 60 0.010 >400 0.019 0.000 87.96 >400 +18:28:42 0.015 >400 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:28:44 0.010 >400 0.015 293 0.010 >400 0.019 0.000 91.48 >400 +18:28:46 0.015 >400 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +18:28:48 0.025 35.3 0.120 39.4 0.030 50 0.123 0.000 91.48 114 +18:28:50 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:28:52 0.015 >400 0.015 171 0.015 102 0.023 0.000 91.48 256 +18:28:54 0.020 10.7 0.015 120 0.015 108 0.023 0.000 87.96 >400 +18:28:56 0.015 137 0.015 44 0.015 73 0.022 0.000 87.96 >400 +18:28:58 0.015 186 0.015 102 0.015 186 0.019 0.000 87.96 >400 +18:29:00 0.015 44 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +18:29:02 0.015 137 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:29:04 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:29:06 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:29:08 0.010 >400 0.015 128 0.015 158 0.019 0.000 87.96 >400 +18:29:10 0.020 12.2 0.025 5.2 0.015 128 0.029 0.000 87.96 >400 +18:29:12 0.015 11.1 0.015 68 0.015 120 0.023 0.000 87.96 >400 +18:29:14 0.020 14.6 0.015 171 0.015 13.5 0.022 0.000 87.96 >400 +18:29:16 0.015 >400 0.015 32.5 0.010 >400 0.021 0.000 87.96 >400 +18:29:18 0.015 47 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +18:29:20 0.015 >400 0.015 62 0.015 293 0.021 0.000 87.96 >400 +18:29:22 0.015 22.8 0.015 76 0.010 >400 0.021 0.000 87.96 >400 +18:29:24 0.015 62 0.015 40 0.010 >400 0.021 0.000 87.96 >400 +18:29:26 0.010 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:29:28 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:29:30 0.010 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:29:32 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:29:34 0.015 >400 0.015 55 0.015 >400 0.021 0.000 87.96 >400 +18:29:36 0.015 21.6 0.015 28.8 0.015 44 0.022 0.000 91.48 186 +18:29:38 0.015 82 0.015 68 0.015 137 0.021 0.000 87.96 >400 +18:29:40 0.015 28.1 0.015 62 0.015 59 0.022 0.000 87.96 >400 +18:29:42 0.015 102 0.015 137 0.015 186 0.022 0.000 87.96 >400 +18:29:44 0.015 25.6 0.015 82 0.015 >400 0.021 0.000 87.96 >400 +18:29:46 0.015 27.3 0.015 93 0.015 46 0.022 0.000 87.96 >400 +18:29:48 0.015 62 0.015 41 0.015 27.7 0.022 0.000 87.96 >400 +18:29:50 0.015 48 0.015 59 0.010 >400 0.019 0.000 87.96 >400 +18:29:52 0.015 >400 0.015 33.6 0.010 >400 0.021 0.000 87.96 >400 +18:29:54 0.015 120 0.015 341 0.015 205 0.021 0.000 87.96 >400 +18:29:56 0.020 9.7 0.015 41 0.015 12.5 0.021 0.000 87.96 >400 +18:29:58 0.015 228 0.015 102 0.015 >400 0.021 0.000 87.96 >400 +18:30:00 0.015 256 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:30:02 0.015 171 0.015 51 0.015 >400 0.021 0.000 87.96 >400 +18:30:04 0.015 293 0.015 93 0.010 >400 0.019 0.000 87.96 >400 +18:30:06 0.015 256 0.015 27.7 0.015 >400 0.021 0.000 87.96 >400 +18:30:08 0.015 >400 0.015 >400 0.015 23.3 0.023 0.000 91.48 >400 +18:30:10 0.015 93 0.015 42 0.015 41 0.022 0.000 91.48 >400 +18:30:12 0.015 46 0.015 29.7 0.015 171 0.021 0.000 87.96 293 +18:30:14 0.015 15.2 0.015 89 0.010 >400 0.021 0.000 87.96 >400 +18:30:16 0.015 53 0.015 79 0.015 293 0.021 0.000 87.96 >400 +18:30:18 0.015 19.7 0.015 26.3 0.015 57 0.021 0.000 87.96 >400 +18:30:20 0.015 >400 0.015 37.2 0.015 23.3 0.022 0.000 87.96 >400 +18:30:22 0.015 93 0.015 128 0.015 128 0.019 0.000 87.96 >400 +18:30:24 0.010 >400 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +18:30:26 0.015 >400 0.015 256 0.015 158 0.021 0.000 87.96 >400 +18:30:28 0.015 54 0.015 82 0.015 >400 0.019 0.000 87.96 >400 +18:30:30 0.015 23.5 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:30:32 0.015 186 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:30:34 0.015 >400 0.015 43 0.010 >400 0.021 0.000 87.96 >400 +18:30:36 0.015 171 0.015 108 0.010 >400 0.021 0.000 87.96 >400 +18:30:38 0.015 >400 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:30:40 0.010 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:30:42 0.015 >400 0.015 108 0.010 >400 0.021 0.000 87.96 >400 +18:30:44 0.010 55 0.015 47 0.010 >400 0.019 0.000 87.96 >400 +18:30:46 0.015 >400 0.015 137 0.015 256 0.021 0.000 87.96 341 +18:30:48 0.015 128 0.015 186 0.015 186 0.021 0.000 87.96 >400 +18:30:50 0.015 >400 0.015 28.8 0.015 >400 0.022 0.000 87.96 >400 +18:30:52 0.015 158 0.015 76 0.015 171 0.023 0.000 87.96 >400 +18:30:54 0.020 11.6 0.020 12.9 0.020 14.2 0.029 0.000 91.48 >400 +18:30:56 0.015 98 0.015 171 0.010 >400 0.021 0.000 87.96 >400 +18:30:58 0.015 >400 0.015 38.6 0.015 158 0.019 0.000 87.96 >400 +18:31:00 0.015 228 0.015 146 0.015 49 0.019 0.000 87.96 >400 +18:31:02 0.015 >400 0.015 146 0.015 293 0.021 0.000 87.96 >400 +18:31:04 0.010 >400 0.015 137 0.015 >400 0.019 0.000 87.96 >400 +18:31:06 0.015 >400 0.015 >400 0.015 120 0.022 0.000 87.96 >400 +18:31:08 0.015 108 0.015 146 0.015 146 0.021 0.000 87.96 >400 +18:31:10 0.020 9.1 0.015 >400 0.015 137 0.023 0.000 91.48 >400 +18:31:12 0.015 293 0.015 79 0.015 23.0 0.022 0.000 87.96 >400 +18:31:14 0.015 16.0 0.015 57 0.015 256 0.021 0.000 87.96 >400 +18:31:16 0.015 28.4 0.015 >400 0.015 >400 0.021 0.000 87.96 >400 +18:31:18 0.015 >400 0.015 36.6 0.015 30.1 0.021 0.000 91.48 >400 +18:31:20 0.015 82 0.020 17.2 0.015 34.7 0.022 0.000 87.96 >400 +18:31:22 0.015 62 0.015 23.3 0.015 256 0.021 0.000 87.96 >400 +18:31:24 0.015 108 0.015 93 0.015 228 0.021 0.000 87.96 >400 +18:31:26 0.015 62 0.015 34.7 0.015 205 0.021 0.000 91.48 >400 +18:31:28 0.015 85 0.015 22.3 0.015 66 0.021 0.000 87.96 >400 +18:31:30 0.015 45 0.015 15.4 0.015 53 0.022 0.000 87.96 >400 +18:31:32 0.015 48 0.015 293 0.015 >400 0.021 0.000 87.96 >400 +18:31:34 0.015 293 0.015 >400 0.015 128 0.021 0.000 87.96 >400 +18:31:36 0.015 171 0.015 31.5 0.015 171 0.021 0.000 87.96 >400 +18:31:38 0.015 120 0.015 21.8 0.015 >400 0.023 0.000 87.96 >400 +18:31:40 0.015 38.6 0.015 171 0.015 102 0.022 0.000 87.96 >400 +18:31:42 0.015 68 0.015 23.8 0.010 >400 0.021 0.000 87.96 >400 +18:31:44 0.015 256 0.020 19.7 0.015 >400 0.023 0.000 87.96 >400 +18:31:46 0.015 >400 0.015 102 0.015 >400 0.021 0.000 87.96 >400 +18:31:48 0.015 >400 0.015 40 0.015 293 0.023 0.000 87.96 >400 +18:31:50 0.015 120 0.015 256 0.015 85 0.021 0.000 87.96 >400 +18:31:52 0.015 102 0.015 32.5 0.015 82 0.022 0.000 91.48 >400 +18:31:54 0.015 62 0.015 >400 0.015 >400 0.021 0.000 91.48 >400 +18:31:56 0.015 293 0.015 19.9 0.015 82 0.021 0.000 87.96 >400 +18:31:58 0.015 256 0.015 21.8 0.015 25.9 0.019 0.000 87.96 >400 +18:32:00 0.015 33.6 0.015 38.6 0.015 22.8 0.022 0.000 91.48 293 +18:32:02 0.015 21.8 0.015 205 0.015 85 0.022 0.000 87.96 >400 +18:32:04 0.010 34.7 0.015 26.9 0.015 >400 0.022 0.000 87.96 >400 +18:32:06 0.015 82 0.015 >400 0.015 256 0.021 0.000 87.96 >400 +18:32:08 0.015 186 0.020 15.6 0.015 >400 0.022 0.000 87.96 >400 +18:32:10 0.015 120 0.020 12.0 0.015 53 0.022 0.000 87.96 >400 +18:32:12 0.015 40 0.015 27.7 0.015 256 0.023 0.000 87.96 >400 +18:32:14 0.015 37.2 0.015 17.2 0.015 60 0.021 0.000 87.96 >400 +18:32:16 0.015 25.9 0.015 186 0.015 128 0.022 0.000 87.96 >400 +18:32:18 0.015 228 0.020 13.4 0.015 293 0.027 0.000 87.96 >400 +18:32:20 0.015 11.0 0.015 35.3 0.015 137 0.021 0.000 87.96 >400 +18:32:22 0.015 256 0.015 76 0.010 >400 0.021 0.000 87.96 >400 +18:32:24 0.015 186 0.015 >400 0.015 146 0.021 0.000 87.96 >400 +18:32:26 0.020 29.7 0.015 64 0.015 55 0.021 0.000 87.96 >400 +18:32:28 0.015 108 0.020 17.2 0.015 68 0.025 0.000 87.96 >400 +18:32:30 0.025 17.8 0.045 19.1 0.020 23.0 0.048 0.000 87.96 >400 +18:32:32 0.020 20.5 0.025 16.8 0.020 19.9 0.032 0.000 91.48 205 +18:32:34 0.025 10.1 0.030 12.9 0.030 11.8 0.043 0.000 91.48 >400 +18:32:36 0.030 12.7 0.045 9.4 0.035 10.8 0.050 0.000 87.96 >400 +18:32:38 0.040 11.4 0.045 11.0 0.030 11.7 0.051 0.000 91.48 186 +18:32:40 0.020 20.1 0.025 13.8 0.025 N/A 0.036 0.000 87.96 >400 +18:32:42 0.025 12.0 0.025 14.9 0.020 17.5 0.031 0.000 87.96 >400 +18:32:44 0.025 15.5 0.020 20.3 0.015 21.6 0.027 0.000 87.96 >400 +18:32:46 0.020 9.5 0.025 9.7 0.020 11.0 0.032 0.000 87.96 >400 +18:32:48 0.030 13.4 0.030 14.2 0.025 15.4 0.039 0.000 87.96 >400 +18:32:50 0.035 11.0 0.030 16.7 0.025 11.9 0.039 0.000 87.96 >400 +18:32:52 0.020 16.3 0.020 10.1 0.020 12.0 0.030 0.000 87.96 >400 +18:32:54 0.030 12.0 0.035 11.7 0.025 13.3 0.042 0.000 87.96 >400 +18:32:56 0.025 10.1 0.030 14.8 0.020 18.6 0.036 0.000 87.96 >400 +18:32:58 0.030 11.5 0.030 9.2 0.020 20.5 0.037 0.000 87.96 >400 +18:33:00 0.030 12.9 0.030 9.9 0.025 13.7 0.036 0.000 87.96 >400 +18:33:02 0.030 11.3 0.035 13.5 0.025 12.0 0.043 0.000 87.96 >400 +18:33:04 0.020 14.1 0.030 17.7 0.020 13.7 0.034 0.000 87.96 >400 +18:33:06 0.015 341 0.015 256 0.015 >400 0.021 0.000 87.96 >400 +18:33:08 0.020 15.6 0.035 14.7 0.020 14.6 0.041 0.000 87.96 >400 +18:33:10 0.020 14.1 0.025 14.4 0.020 16.3 0.030 0.000 87.96 >400 +18:33:12 0.020 14.3 0.025 15.8 0.020 12.9 0.029 0.000 87.96 >400 +18:33:14 0.025 15.4 0.025 12.7 0.020 14.1 0.032 0.000 87.96 >400 +18:33:16 0.020 20.1 0.020 24.1 0.015 22.3 0.027 0.000 87.96 >400 +18:33:18 0.025 9.2 0.030 8.8 0.020 11.6 0.032 0.000 87.96 >400 +18:33:20 0.025 13.7 0.030 9.3 0.020 16.9 0.035 0.000 87.96 >400 +18:33:22 0.030 10.4 0.035 12.8 0.025 12.9 0.044 0.000 87.96 >400 +18:33:24 0.025 9.8 0.030 12.9 0.025 12.8 0.037 0.000 87.96 >400 +18:33:26 0.020 15.8 0.035 12.1 0.025 14.6 0.038 0.000 87.96 >400 +18:33:28 0.025 14.3 0.035 16.9 0.025 12.4 0.040 0.000 87.96 >400 +18:33:30 0.040 9.6 0.045 9.3 0.030 10.8 0.056 0.000 91.48 228 +18:33:32 0.015 >400 0.015 24.7 0.015 102 0.022 0.000 87.96 >400 +18:33:34 0.020 11.4 0.025 10.7 0.020 14.0 0.032 0.000 87.96 >400 +18:33:36 0.015 64 0.015 21.8 0.010 >400 0.019 0.000 87.96 >400 +18:33:38 0.025 12.8 0.025 5.0 0.025 7.5 0.035 0.000 87.96 >400 +18:33:40 0.045 9.0 0.040 11.1 0.035 10.3 0.055 0.000 91.48 293 +18:33:42 0.035 8.6 0.040 10.2 0.030 11.4 0.049 0.000 87.96 >400 +18:33:44 0.025 15.4 0.030 12.0 0.025 13.9 0.040 0.000 87.96 >400 +18:33:46 0.030 11.8 0.030 11.8 0.025 12.0 0.037 0.000 87.96 >400 +18:33:48 0.025 13.6 0.030 16.3 0.020 13.0 0.034 0.000 87.96 >400 +18:33:50 0.020 13.6 0.025 17.4 0.020 14.2 0.032 0.000 87.96 >400 +18:33:52 0.030 12.1 0.035 12.1 0.030 11.1 0.044 0.000 91.48 >400 +18:33:54 0.015 11.4 0.020 26.9 0.015 38.6 0.023 0.000 87.96 >400 +18:33:56 0.025 13.7 0.025 12.6 0.015 14.7 0.029 0.000 87.96 >400 +18:33:58 0.035 11.8 0.035 13.4 0.020 13.4 0.043 0.000 87.96 >400 +18:34:00 0.025 12.0 0.035 15.3 0.025 14.2 0.041 0.000 87.96 >400 +18:34:02 0.040 11.4 0.045 12.6 0.030 9.9 0.051 0.000 91.48 186 +18:34:04 0.030 13.9 0.025 16.1 0.025 11.0 0.036 0.000 87.96 >400 +18:34:06 0.025 14.0 0.030 16.5 0.025 10.7 0.037 0.000 87.96 >400 +18:34:08 0.025 13.0 0.035 12.7 0.025 14.1 0.042 0.000 87.96 >400 +18:34:10 0.020 11.6 0.020 17.5 0.015 19.7 0.025 0.000 87.96 >400 +18:34:12 0.015 41 0.015 64 0.010 >400 0.021 0.000 87.96 >400 +18:34:14 0.015 73 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:34:16 0.010 >400 0.015 128 0.010 >400 0.021 0.000 87.96 >400 +18:34:18 0.015 158 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:34:20 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:34:22 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:34:24 0.015 82 0.015 51 0.010 >400 0.019 0.000 87.96 >400 +18:34:26 0.015 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:34:28 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:34:30 0.010 >400 0.015 158 0.010 >400 0.019 0.000 91.48 >400 +18:34:32 0.015 186 0.015 205 0.015 256 0.019 0.000 87.96 >400 +18:34:34 0.010 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +18:34:36 0.015 35.9 0.015 29.7 0.015 108 0.021 0.000 87.96 >400 +18:34:38 0.015 31.0 0.015 >400 0.015 128 0.019 0.000 87.96 >400 +18:34:40 0.015 186 0.015 22.8 0.015 228 0.019 0.000 87.96 >400 +18:34:42 0.015 25.0 0.015 19.5 0.015 >400 0.019 0.000 91.48 >400 +18:34:44 0.020 10.4 0.020 17.4 0.015 64 0.025 0.000 91.48 >400 +18:34:46 0.015 137 0.015 85 0.015 55 0.023 0.000 87.96 >400 +18:34:48 0.035 8.8 0.035 14.4 0.020 20.9 0.039 0.000 87.96 171 +18:34:50 0.015 >400 0.015 64 0.015 >400 0.019 0.000 87.96 >400 +18:34:52 0.015 98 0.015 128 0.015 >400 0.022 0.000 87.96 >400 +18:34:54 0.015 >400 0.015 64 0.015 98 0.021 0.000 87.96 >400 +18:34:56 0.015 33.6 0.015 25.6 0.015 228 0.021 0.000 91.48 >400 +18:34:58 0.015 >400 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:35:00 0.015 >400 0.020 19.5 0.015 293 0.023 0.000 87.96 >400 +18:35:02 0.015 256 0.015 66 0.015 >400 0.021 0.000 87.96 >400 +18:35:04 0.015 25.6 0.015 102 0.015 12.5 0.023 0.000 87.96 >400 +18:35:06 0.015 >400 0.020 29.3 0.020 11.8 0.030 0.000 87.96 >400 +18:35:08 0.015 102 0.015 24.4 0.015 >400 0.021 0.000 87.96 228 +18:35:10 0.010 >400 0.015 71 0.010 >400 0.017 0.000 87.96 >400 +18:35:12 0.015 341 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:35:14 0.015 >400 0.015 59 0.010 >400 0.019 0.000 87.96 >400 +18:35:16 0.015 93 0.015 36.6 0.015 71 0.022 0.000 87.96 >400 +18:35:18 0.015 256 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +18:35:20 0.015 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:35:22 0.015 293 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:35:24 0.015 293 0.015 40 0.010 >400 0.019 0.000 87.96 >400 +18:35:26 0.015 >400 0.015 76 0.015 128 0.021 0.000 87.96 >400 +18:35:28 0.015 >400 0.015 >400 0.015 186 0.021 0.000 91.48 >400 +18:35:30 0.015 66 0.020 11.8 0.015 11.1 0.022 0.000 87.96 >400 +18:35:32 0.015 32.5 0.015 >400 0.015 43 0.021 0.000 87.96 >400 +18:35:34 0.030 11.5 0.035 13.6 0.020 16.9 0.039 0.000 87.96 >400 +18:35:36 0.030 9.1 0.030 13.2 0.020 17.7 0.036 0.000 87.96 >400 +18:35:38 0.035 11.6 0.035 12.6 0.025 13.4 0.041 0.000 87.96 >400 +18:35:40 0.020 10.0 0.030 12.5 0.020 14.9 0.035 0.000 87.96 >400 +18:35:42 0.030 13.3 0.035 12.0 0.030 11.1 0.043 0.000 91.48 >400 +18:35:44 0.030 25.3 0.040 21.8 0.025 21.3 0.045 0.000 87.96 >400 +18:35:46 0.015 41 0.015 186 0.010 >400 0.019 0.000 91.48 293 +18:35:48 0.015 137 0.015 76 0.015 256 0.021 0.000 87.96 >400 +18:35:50 0.015 51 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:35:52 0.015 68 0.015 57 0.015 228 0.019 0.000 87.96 >400 +18:35:54 0.015 341 0.015 42 0.010 >400 0.019 0.000 91.48 >400 +18:35:56 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:35:58 0.015 35.3 0.015 32.0 0.015 98 0.019 0.000 87.96 >400 +18:36:00 0.015 73 0.015 60 0.015 53 0.019 0.000 91.48 >400 +18:36:02 0.015 29.3 0.015 93 0.015 171 0.019 0.000 87.96 >400 +18:36:04 0.015 37.2 0.015 128 0.015 51 0.021 0.000 87.96 >400 +18:36:06 0.015 108 0.015 228 0.015 293 0.019 0.000 87.96 >400 +18:36:08 0.015 54 0.015 22.5 0.015 >400 0.019 0.000 87.96 >400 +18:36:10 0.015 256 0.020 21.8 0.015 171 0.022 0.000 87.96 >400 +18:36:12 0.015 20.5 0.015 73 0.015 293 0.021 0.000 91.48 128 +18:36:14 0.015 256 0.015 38.6 0.015 146 0.021 0.000 87.96 >400 +18:36:16 0.015 256 0.015 89 0.015 186 0.019 0.000 91.48 >400 +18:36:18 0.015 35.9 0.015 22.3 0.015 256 0.019 0.000 91.48 >400 +18:36:20 0.015 64 0.015 42 0.015 293 0.019 0.000 91.48 >400 +18:36:22 0.020 13.4 0.015 22.0 0.015 44 0.022 0.000 87.96 >400 +18:36:24 0.015 45 0.015 82 0.015 186 0.021 0.000 87.96 >400 +18:36:26 0.025 6.2 0.020 15.8 0.020 7.2 0.027 0.000 87.96 >400 +18:36:28 0.015 62 0.020 19.9 0.020 12.4 0.027 0.000 91.48 >400 +18:36:30 0.015 25.3 0.015 82 0.015 98 0.023 0.000 87.96 >400 +18:36:32 0.015 146 0.015 66 0.015 15.6 0.023 0.000 91.48 >400 +18:36:34 0.025 13.2 0.025 12.8 0.020 13.4 0.030 0.000 87.96 >400 +18:36:36 0.020 10.1 0.020 23.0 0.015 98 0.025 0.000 91.48 >400 +18:36:38 0.025 15.1 0.030 12.4 0.025 11.0 0.039 0.000 91.48 171 +18:36:40 0.050 11.3 0.075 10.8 0.060 10.4 0.097 0.000 91.48 42 +18:36:42 0.040 10.4 0.045 16.7 0.035 13.5 0.057 0.000 91.48 >400 +18:36:44 0.020 14.3 0.020 22.3 0.015 17.8 0.027 0.000 87.96 >400 +18:36:46 0.015 293 0.015 146 0.015 293 0.021 0.000 87.96 >400 +18:36:48 0.015 50 0.015 205 0.015 71 0.019 0.000 87.96 >400 +18:36:50 0.015 45 0.020 20.1 0.015 293 0.022 0.000 91.48 >400 +18:36:52 0.015 256 0.015 128 0.010 >400 0.021 0.000 87.96 >400 +18:36:54 0.015 114 0.015 46 0.010 >400 0.019 0.000 87.96 >400 +18:36:56 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +18:36:58 0.020 9.1 0.020 14.8 0.020 9.4 0.024 0.000 87.96 >400 +18:37:00 0.015 341 0.015 47 0.010 >400 0.021 0.000 87.96 >400 +18:37:02 0.015 37.9 0.020 18.0 0.020 7.9 0.029 0.000 87.96 >400 +18:37:04 0.030 14.0 0.030 11.0 0.025 12.8 0.039 0.000 91.48 341 +18:37:06 0.035 11.3 0.035 9.2 0.030 9.6 0.048 0.000 87.96 >400 +18:37:08 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:37:10 0.015 137 0.015 158 0.015 98 0.021 0.000 87.96 >400 +18:37:12 0.015 293 0.020 13.9 0.020 14.0 0.028 0.000 87.96 >400 +18:37:14 0.135 25.9 0.180 23.8 0.095 18.1 0.200 0.000 91.48 >400 +18:37:16 0.015 256 0.015 21.8 0.015 85 0.021 0.000 87.96 >400 +18:37:18 0.015 62 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:37:20 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:37:22 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:37:24 0.015 256 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:37:26 0.015 82 0.015 205 0.015 186 0.022 0.000 87.96 >400 +18:37:28 0.025 28.8 0.025 21.1 0.020 10.4 0.030 0.000 87.96 >400 +18:37:30 0.015 256 0.020 11.1 0.015 73 0.023 0.000 87.96 >400 +18:37:32 0.010 >400 0.015 30.6 0.010 >400 0.019 0.000 87.96 >400 +18:37:34 0.015 171 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:37:36 0.015 120 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:37:38 0.020 18.1 0.030 18.3 0.020 11.6 0.039 0.000 87.96 >400 +18:37:40 0.025 9.3 0.030 11.3 0.025 11.1 0.040 0.000 87.96 >400 +18:37:42 0.025 12.1 0.025 20.1 0.020 16.0 0.029 0.000 87.96 >400 +18:37:44 0.025 12.8 0.035 12.8 0.020 12.7 0.042 0.000 87.96 >400 +18:37:46 0.030 9.8 0.045 16.4 0.025 15.3 0.051 0.000 87.96 >400 +18:37:48 0.045 11.3 0.040 18.8 0.030 12.3 0.047 0.000 91.48 >400 +18:37:50 0.030 11.8 0.025 11.7 0.020 15.6 0.032 0.000 87.96 >400 +18:37:52 0.025 9.8 0.030 13.7 0.025 11.8 0.039 0.000 87.96 >400 +18:37:54 0.025 12.7 0.030 11.8 0.020 18.0 0.037 0.000 87.96 >400 +18:37:56 0.025 16.9 0.025 12.5 0.020 18.5 0.033 0.000 87.96 >400 +18:37:58 0.025 12.6 0.030 12.1 0.025 11.0 0.037 0.000 87.96 >400 +18:38:00 0.025 13.0 0.035 N/A 0.020 17.7 0.039 0.000 87.96 >400 +18:38:02 0.025 10.8 0.035 13.7 0.025 13.5 0.041 0.000 91.48 >400 +18:38:04 0.030 7.9 0.045 15.4 0.030 12.8 0.051 0.000 87.96 >400 +18:38:06 0.030 9.7 0.035 10.8 0.025 13.7 0.044 0.000 91.48 256 +18:38:08 0.015 33.6 0.015 47 0.015 51 0.019 0.000 87.96 >400 +18:38:10 0.015 93 0.015 59 0.010 >400 0.019 0.000 87.96 >400 +18:38:12 0.015 128 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:38:14 0.015 15.6 0.015 171 0.010 >400 0.021 0.000 91.48 >400 +18:38:16 0.015 47 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:38:18 0.015 >400 0.015 38.6 0.010 >400 0.019 0.000 87.96 >400 +18:38:20 0.015 256 0.015 51 0.010 >400 0.021 0.000 87.96 >400 +18:38:22 0.015 34.1 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:38:24 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:38:26 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:38:28 0.015 60 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:38:30 0.015 256 0.015 27.7 0.010 >400 0.019 0.000 87.96 >400 +18:38:32 0.010 >400 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:38:34 0.015 49 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:38:36 0.015 256 0.015 44 0.010 >400 0.019 0.000 91.48 >400 +18:38:38 0.015 186 0.015 98 0.015 93 0.019 0.000 87.96 >400 +18:38:40 0.015 27.7 0.015 82 0.015 114 0.021 0.000 87.96 >400 +18:38:42 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:38:44 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:38:46 0.015 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:38:48 0.015 228 0.015 68 0.015 293 0.019 0.000 87.96 >400 +18:38:50 0.020 12.0 0.025 16.9 0.015 98 0.029 0.000 87.96 >400 +18:38:52 0.040 11.0 0.040 8.6 0.035 8.9 0.055 0.000 91.48 >400 +18:38:54 0.040 11.0 0.035 9.2 0.025 11.4 0.043 0.000 87.96 >400 +18:38:56 0.030 13.2 0.035 12.7 0.025 12.2 0.041 0.000 91.48 38.6 +18:38:58 0.020 15.2 0.020 13.9 0.015 18.6 0.023 0.000 87.96 >400 +18:39:00 0.020 11.5 0.020 12.8 0.020 10.3 0.029 0.000 87.96 >400 +18:39:02 0.030 10.4 0.045 13.6 0.025 15.6 0.052 0.000 87.96 >400 +18:39:04 0.025 12.3 0.030 12.2 0.020 15.2 0.033 0.000 87.96 >400 +18:39:06 0.025 13.0 0.040 15.2 0.035 13.3 0.048 0.000 91.48 >400 +18:39:08 0.015 18.3 0.015 158 0.015 205 0.019 0.000 87.96 >400 +18:39:10 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 341 +18:39:12 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:39:14 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:39:16 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:39:18 0.010 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +18:39:20 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 91.48 >400 +18:39:22 0.015 341 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:39:24 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:39:26 0.015 120 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:39:28 0.015 >400 0.015 76 0.015 186 0.019 0.000 87.96 >400 +18:39:30 0.020 19.7 0.030 13.9 0.020 13.7 0.035 0.000 87.96 >400 +18:39:32 0.025 13.6 0.020 14.4 0.020 19.3 0.030 0.000 87.96 >400 +18:39:34 0.030 11.4 0.030 10.7 0.025 12.2 0.039 0.000 87.96 >400 +18:39:36 0.025 12.8 0.030 12.8 0.025 14.0 0.037 0.000 87.96 >400 +18:39:38 0.020 16.7 0.025 16.4 0.020 11.4 0.032 0.000 87.96 >400 +18:39:40 0.020 14.6 0.025 10.4 0.020 12.6 0.034 0.000 87.96 >400 +18:39:42 0.020 11.6 0.020 12.6 0.015 186 0.026 0.000 87.96 >400 +18:39:44 0.015 205 0.015 57 0.015 66 0.023 0.000 87.96 >400 +18:39:46 0.015 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:39:48 0.020 16.8 0.020 12.2 0.015 19.1 0.025 0.000 87.96 >400 +18:39:50 0.020 12.6 0.020 5.9 0.020 9.4 0.029 0.000 87.96 >400 +18:39:52 0.025 11.4 0.035 9.8 0.020 15.3 0.041 0.000 87.96 >400 +18:39:54 0.015 89 0.025 14.8 0.020 13.4 0.029 0.000 87.96 >400 +18:39:56 0.030 10.9 0.035 16.5 0.020 16.9 0.041 0.000 87.96 >400 +18:39:58 0.025 12.8 0.025 12.0 0.020 12.3 0.032 0.000 87.96 >400 +18:40:00 0.030 12.1 0.030 10.2 0.025 10.8 0.039 0.000 87.96 >400 +18:40:02 0.030 12.6 0.030 16.8 0.020 18.1 0.034 0.000 87.96 >400 +18:40:04 0.030 14.1 0.035 12.9 0.025 11.4 0.043 0.000 87.96 >400 +18:40:06 0.030 13.4 0.030 10.2 0.025 10.9 0.039 0.000 87.96 >400 +18:40:08 0.030 12.2 0.030 10.8 0.025 15.1 0.036 0.000 87.96 >400 +18:40:10 0.025 11.7 0.030 12.5 0.020 14.8 0.038 0.000 87.96 >400 +18:40:12 0.020 17.4 0.025 14.3 0.020 14.3 0.030 0.000 87.96 >400 +18:40:14 0.015 24.4 0.020 10.8 0.015 85 0.027 0.000 87.96 >400 +18:40:16 0.025 10.8 0.025 15.4 0.020 15.2 0.032 0.000 91.48 >400 +18:40:18 0.025 11.0 0.025 13.6 0.020 21.6 0.032 0.000 87.96 >400 +18:40:20 0.020 16.8 0.030 14.7 0.020 15.3 0.034 0.000 87.96 341 +18:40:22 0.025 12.5 0.030 13.9 0.020 15.1 0.035 0.000 91.48 >400 +18:40:24 0.035 10.3 0.040 12.6 0.025 10.7 0.048 0.000 87.96 >400 +18:40:26 0.025 10.1 0.030 14.2 0.020 19.5 0.036 0.000 87.96 >400 +18:40:28 0.035 12.0 0.035 17.1 0.020 N/A 0.039 0.000 91.48 256 +18:40:30 0.070 15.9 0.100 16.1 0.045 11.9 0.106 0.000 91.48 41 +18:40:32 0.030 12.3 0.045 8.6 0.035 10.3 0.057 0.000 91.48 >400 +18:40:34 0.015 37.9 0.015 25.6 0.015 36.6 0.022 0.000 87.96 >400 +18:40:36 0.015 >400 0.015 59 0.010 341 0.019 0.000 87.96 >400 +18:40:38 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:40:40 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:40:42 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:40:44 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:40:46 0.015 >400 0.015 54 0.010 >400 0.019 0.000 87.96 >400 +18:40:48 0.015 102 0.015 60 0.010 >400 0.021 0.000 87.96 >400 +18:40:50 0.015 26.9 0.015 >400 0.015 46 0.021 0.000 87.96 >400 +18:40:52 0.015 45 0.015 89 0.015 128 0.021 0.000 87.96 >400 +18:40:54 0.015 >400 0.015 82 0.010 >400 0.019 0.000 87.96 >400 +18:40:56 0.015 76 0.015 42 0.010 >400 0.021 0.000 87.96 >400 +18:40:58 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:41:00 0.015 >400 0.015 82 0.015 205 0.021 0.000 87.96 >400 +18:41:02 0.010 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:41:04 0.015 186 0.015 53 0.010 >400 0.019 0.000 87.96 >400 +18:41:06 0.010 >400 0.015 93 0.010 >400 0.018 0.000 87.96 >400 +18:41:08 0.015 >400 0.015 76 0.010 >400 0.019 0.000 87.96 >400 +18:41:10 0.015 293 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:41:12 0.015 >400 0.015 228 0.015 186 0.021 0.000 87.96 >400 +18:41:14 0.030 9.7 0.045 11.3 0.035 10.4 0.056 0.000 91.48 >400 +18:41:16 0.030 13.1 0.030 15.8 0.025 11.7 0.040 0.000 87.96 >400 +18:41:18 0.020 11.9 0.025 16.3 0.015 28.4 0.030 0.000 87.96 >400 +18:41:20 0.020 9.6 0.025 47 0.015 120 0.032 0.000 87.96 >400 +18:41:22 0.055 9.4 0.075 8.4 0.070 9.1 0.105 0.000 91.48 79 +18:41:24 0.020 10.2 0.020 13.7 0.015 >400 0.024 0.000 87.96 >400 +18:41:26 0.015 20.5 0.015 42 0.015 79 0.021 0.000 87.96 >400 +18:41:28 0.015 102 0.015 54 0.015 114 0.021 0.000 87.96 >400 +18:41:30 0.015 51 0.015 128 0.010 >400 0.021 0.000 91.48 >400 +18:41:32 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:41:34 0.015 108 0.015 51 0.010 >400 0.019 0.000 91.48 >400 +18:41:36 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:41:38 0.015 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:41:40 0.015 33.6 0.015 256 0.015 >400 0.019 0.000 87.96 >400 +18:41:42 0.015 256 0.015 62 0.010 >400 0.019 0.000 87.96 >400 +18:41:44 0.020 14.1 0.015 256 0.015 31.5 0.022 0.000 87.96 >400 +18:41:46 0.015 79 0.015 43 0.015 48 0.021 0.000 87.96 >400 +18:41:48 0.030 22.5 0.040 21.3 0.025 19.7 0.045 0.000 91.48 >400 +18:41:50 0.015 39.4 0.020 9.8 0.015 11.0 0.027 0.000 91.48 >400 +18:41:52 0.025 21.1 0.035 18.8 0.025 17.4 0.042 0.000 87.96 >400 +18:41:54 0.020 10.2 0.020 19.3 0.015 44 0.023 0.000 87.96 >400 +18:41:56 0.015 >400 0.015 114 0.010 >400 0.019 0.000 87.96 >400 +18:41:58 0.015 79 0.015 38.6 0.015 76 0.019 0.000 87.96 >400 +18:42:00 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:42:02 0.015 108 0.015 293 0.015 228 0.022 0.000 87.96 >400 +18:42:04 0.010 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:42:06 0.015 228 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:42:08 0.015 57 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:42:10 0.010 >400 0.015 76 0.010 >400 0.019 0.000 87.96 >400 +18:42:12 0.020 9.4 0.020 10.0 0.015 25.6 0.024 0.000 87.96 >400 +18:42:14 0.030 15.3 0.025 14.6 0.020 8.6 0.034 0.000 87.96 >400 +18:42:16 0.020 13.7 0.020 11.4 0.015 15.9 0.024 0.000 87.96 >400 +18:42:18 0.025 11.2 0.025 11.3 0.020 15.2 0.030 0.000 87.96 >400 +18:42:20 0.020 9.4 0.025 N/A 0.025 N/A 0.036 0.000 87.96 >400 +18:42:22 0.025 14.5 0.030 11.4 0.025 10.7 0.040 0.000 87.96 >400 +18:42:24 0.015 20.3 0.015 59 0.015 34.1 0.022 0.000 87.96 >400 +18:42:26 0.035 22.0 0.040 19.3 0.025 18.8 0.045 0.000 87.96 >400 +18:42:28 0.015 33.6 0.020 41 0.015 25.6 0.021 0.000 87.96 256 +18:42:30 0.015 20.5 0.015 35.3 0.015 >400 0.022 0.000 91.48 >400 +18:42:32 0.015 128 0.015 256 0.015 228 0.019 0.000 87.96 >400 +18:42:34 0.015 228 0.020 17.2 0.015 16.5 0.023 0.000 87.96 >400 +18:42:36 0.025 18.3 0.025 18.6 0.015 23.8 0.030 0.000 87.96 >400 +18:42:38 0.015 158 0.020 9.8 0.020 10.4 0.025 0.000 87.96 >400 +18:42:40 0.025 15.8 0.035 18.8 0.025 9.1 0.046 0.000 87.96 >400 +18:42:42 0.025 10.7 0.030 10.8 0.020 13.7 0.039 0.000 87.96 >400 +18:42:44 0.020 13.4 0.025 13.7 0.020 19.3 0.029 0.000 87.96 >400 +18:42:46 0.020 14.6 0.025 13.8 0.015 28.4 0.030 0.000 87.96 >400 +18:42:48 0.025 10.3 0.030 11.1 0.020 13.5 0.034 0.000 87.96 >400 +18:42:50 0.015 82 0.015 24.4 0.015 17.2 0.023 0.000 87.96 >400 +18:42:52 0.015 39.4 0.020 13.2 0.015 22.8 0.025 0.000 87.96 >400 +18:42:54 0.015 186 0.020 30.6 0.015 256 0.022 0.000 87.96 >400 +18:42:56 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:42:58 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:43:00 0.015 >400 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +18:43:02 0.015 33.6 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:43:04 0.015 >400 0.015 76 0.015 >400 0.019 0.000 87.96 >400 +18:43:06 0.015 89 0.015 108 0.015 >400 0.021 0.000 87.96 >400 +18:43:08 0.015 186 0.015 108 0.010 >400 0.019 0.000 87.96 >400 +18:43:10 0.020 21.8 0.020 18.6 0.015 >400 0.025 0.000 87.96 >400 +18:43:12 0.015 93 0.015 137 0.010 98 0.019 0.000 87.96 >400 +18:43:14 0.015 >400 0.015 79 0.015 >400 0.021 0.000 87.96 >400 +18:43:16 0.015 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:43:18 0.015 256 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:43:20 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:43:22 0.015 293 0.015 137 0.010 >400 0.019 0.000 87.96 341 +18:43:24 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:43:26 0.015 205 0.015 171 0.010 >400 0.021 0.000 87.96 >400 +18:43:28 0.015 >400 0.015 186 0.015 >400 0.019 0.000 87.96 >400 +18:43:30 0.015 50 0.020 21.6 0.015 158 0.023 0.000 87.96 >400 +18:43:32 0.015 256 0.015 341 0.010 >400 0.019 0.000 91.48 >400 +18:43:34 0.015 43 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:43:36 0.015 171 0.015 >400 0.015 293 0.019 0.000 87.96 >400 +18:43:38 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:43:40 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:43:42 0.015 171 0.015 293 0.015 59 0.019 0.000 87.96 >400 +18:43:44 0.020 21.8 0.020 25.3 0.015 82 0.023 0.000 87.96 >400 +18:43:46 0.015 27.7 0.015 21.8 0.015 22.8 0.021 0.000 87.96 >400 +18:43:48 0.010 >400 0.015 128 0.010 >400 0.019 0.000 91.48 256 +18:43:50 0.015 >400 0.015 228 0.010 >400 0.021 0.000 87.96 >400 +18:43:52 0.015 293 0.015 128 0.015 158 0.021 0.000 87.96 >400 +18:43:54 0.015 228 0.015 35.9 0.010 >400 0.019 0.000 87.96 >400 +18:43:56 0.015 89 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:43:58 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:44:00 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:44:02 0.015 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:44:04 0.015 256 0.020 18.0 0.010 >400 0.023 0.000 91.48 >400 +18:44:06 0.020 13.7 0.015 32.5 0.015 >400 0.021 0.000 87.96 >400 +18:44:08 0.015 12.6 0.015 37.9 0.015 98 0.021 0.000 87.96 >400 +18:44:10 0.015 171 0.015 85 0.010 >400 0.019 0.000 91.48 >400 +18:44:12 0.015 62 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:44:14 0.020 12.8 0.020 20.9 0.015 60 0.027 0.000 87.96 >400 +18:44:16 0.030 9.2 0.040 9.6 0.030 11.0 0.053 0.000 87.96 >400 +18:44:18 0.020 10.2 0.025 13.4 0.020 15.6 0.031 0.000 87.96 >400 +18:44:20 0.020 13.3 0.025 15.1 0.020 13.3 0.029 0.000 87.96 >400 +18:44:22 0.025 14.5 0.030 10.7 0.020 12.0 0.034 0.000 87.96 >400 +18:44:24 0.025 13.4 0.020 21.1 0.015 16.9 0.025 0.000 87.96 >400 +18:44:26 0.020 11.8 0.020 16.7 0.015 >400 0.025 0.000 87.96 >400 +18:44:28 0.020 10.0 0.030 10.1 0.020 17.2 0.034 0.000 87.96 >400 +18:44:30 0.025 9.8 0.025 11.0 0.025 10.9 0.032 0.000 87.96 >400 +18:44:32 0.035 26.6 0.055 19.0 0.030 16.7 0.062 0.000 87.96 >400 +18:44:34 0.020 10.1 0.030 20.1 0.015 >400 0.034 0.000 91.48 >400 +18:44:36 0.025 20.7 0.030 20.3 0.020 13.0 0.032 0.000 87.96 >400 +18:44:38 0.025 15.2 0.025 14.3 0.015 14.0 0.030 0.000 91.48 >400 +18:44:40 0.015 62 0.015 158 0.010 >400 0.021 0.000 87.96 >400 +18:44:42 0.015 93 0.015 60 0.010 >400 0.021 0.000 91.48 >400 +18:44:44 0.020 16.8 0.015 186 0.015 205 0.021 0.000 87.96 >400 +18:44:46 0.015 30.1 0.015 186 0.015 89 0.021 0.000 87.96 >400 +18:44:48 0.015 >400 0.020 23.5 0.015 48 0.025 0.000 87.96 >400 +18:44:50 0.020 17.2 0.020 12.6 0.015 42 0.030 0.000 87.96 >400 +18:44:52 0.025 7.6 0.025 18.1 0.015 76 0.030 0.000 87.96 >400 +18:44:54 0.015 171 0.015 186 0.015 60 0.022 0.000 87.96 >400 +18:44:56 0.015 19.0 0.015 68 0.015 64 0.019 0.000 87.96 >400 +18:44:58 0.015 76 0.015 40 0.015 228 0.019 0.000 87.96 >400 +18:45:00 0.015 >400 0.015 93 0.010 >400 0.021 0.000 91.48 >400 +18:45:02 0.010 >400 0.015 171 0.010 >400 0.017 0.000 87.96 >400 +18:45:04 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:45:06 0.015 186 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:45:08 0.015 73 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:45:10 0.010 >400 0.015 341 0.010 >400 0.017 0.000 87.96 >400 +18:45:12 0.015 186 0.015 137 0.015 293 0.019 0.000 87.96 >400 +18:45:14 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:45:16 0.015 293 0.015 49 0.010 >400 0.019 0.000 87.96 >400 +18:45:18 0.015 62 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:45:20 0.015 57 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:45:22 0.015 21.3 0.015 >400 0.015 85 0.023 0.000 87.96 >400 +18:45:24 0.015 22.3 0.015 26.9 0.015 108 0.022 0.000 87.96 >400 +18:45:26 0.020 15.8 0.020 11.1 0.015 25.9 0.027 0.000 87.96 >400 +18:45:28 0.020 12.3 0.020 11.4 0.015 31.5 0.027 0.000 87.96 >400 +18:45:30 0.020 14.9 0.020 22.5 0.020 15.1 0.025 0.000 87.96 >400 +18:45:32 0.020 22.5 0.025 23.8 0.025 16.8 0.037 0.000 87.96 >400 +18:45:34 0.010 >400 0.015 76 0.010 >400 0.019 0.000 87.96 >400 +18:45:36 0.010 >400 0.015 256 0.010 >400 0.017 0.000 87.96 >400 +18:45:38 0.015 293 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:45:40 0.015 341 0.015 102 0.015 >400 0.019 0.000 87.96 >400 +18:45:42 0.015 108 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:45:44 0.015 >400 0.015 98 0.010 >400 0.019 0.000 87.96 >400 +18:45:46 0.015 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:45:48 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:45:50 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:45:52 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:45:54 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:45:56 0.015 >400 0.015 228 0.015 >400 0.018 0.000 91.48 >400 +18:45:58 0.020 9.1 0.020 19.5 0.015 20.7 0.027 0.000 87.96 >400 +18:46:00 0.020 26.3 0.030 13.7 0.020 21.3 0.037 0.000 91.48 >400 +18:46:02 0.025 9.8 0.025 13.3 0.020 21.1 0.030 0.000 87.96 >400 +18:46:04 0.020 19.1 0.025 14.2 0.025 13.6 0.035 0.000 87.96 >400 +18:46:06 0.020 14.5 0.025 11.3 0.025 12.0 0.032 0.000 87.96 >400 +18:46:08 0.020 11.2 0.025 13.7 0.020 14.3 0.030 0.000 87.96 >400 +18:46:10 0.025 10.3 0.020 11.0 0.020 13.4 0.029 0.000 87.96 >400 +18:46:12 0.020 22.3 0.020 19.5 0.020 11.9 0.027 0.000 87.96 >400 +18:46:14 0.025 10.5 0.025 15.9 0.020 9.9 0.030 0.000 87.96 >400 +18:46:16 0.025 9.9 0.025 15.4 0.020 12.5 0.035 0.000 87.96 >400 +18:46:18 0.020 12.0 0.025 15.5 0.015 158 0.030 0.000 91.48 >400 +18:46:20 0.020 14.4 0.015 54 0.015 >400 0.023 0.000 87.96 >400 +18:46:22 0.015 36.6 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:46:24 0.020 7.0 0.030 11.5 0.025 11.6 0.037 0.000 87.96 >400 +18:46:26 0.050 22.5 0.060 21.6 0.035 16.5 0.071 0.000 91.48 256 +18:46:28 0.015 >400 0.015 293 0.015 33.6 0.021 0.000 87.96 >400 +18:46:30 0.020 9.3 0.045 12.0 0.025 15.5 0.052 0.000 87.96 >400 +18:46:32 0.030 9.6 0.030 11.5 0.025 10.8 0.037 0.000 87.96 >400 +18:46:34 0.025 11.1 0.020 13.8 0.020 12.5 0.029 0.000 87.96 >400 +18:46:36 0.025 10.3 0.025 11.9 0.020 16.4 0.032 0.000 91.48 >400 +18:46:38 0.025 8.9 0.030 16.8 0.020 16.4 0.037 0.000 91.48 >400 +18:46:40 0.020 22.8 0.020 13.0 0.015 18.3 0.025 0.000 87.96 >400 +18:46:42 0.020 11.6 0.030 12.7 0.025 15.1 0.036 0.000 87.96 >400 +18:46:44 0.015 89 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:46:46 0.020 7.8 0.020 22.0 0.020 16.0 0.027 0.000 87.96 >400 +18:46:48 0.025 13.5 0.020 22.8 0.015 >400 0.027 0.000 91.48 >400 +18:46:50 0.020 12.4 0.025 13.0 0.020 13.3 0.031 0.000 87.96 >400 +18:46:52 0.025 11.8 0.025 10.1 0.020 15.5 0.032 0.000 87.96 >400 +18:46:54 0.025 9.9 0.035 18.1 0.055 10.1 0.055 0.000 91.48 >400 +18:46:56 0.035 34.1 0.125 40 0.040 25.6 0.125 0.000 91.48 >400 +18:46:58 0.035 43 0.050 45 0.055 48 0.064 0.000 91.48 14.8 +18:47:00 0.015 >400 0.020 25.0 0.015 53 0.023 0.000 91.48 >400 +18:47:02 0.030 36.6 0.090 26.3 0.030 20.9 0.092 0.000 91.48 158 +18:47:04 0.015 >400 0.020 60 0.010 >400 0.023 0.000 87.96 >400 +18:47:06 0.025 33.6 0.040 89 0.030 22.3 0.041 0.000 91.48 32.5 +18:47:08 0.010 >400 0.015 >400 0.010 171 0.019 0.000 87.96 >400 +18:47:10 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:47:12 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:47:14 0.010 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +18:47:16 0.010 >400 0.015 205 0.010 >400 0.021 0.000 87.96 >400 +18:47:18 0.015 98 0.015 102 0.015 293 0.019 0.000 87.96 >400 +18:47:20 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:47:22 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:47:24 0.015 128 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:47:26 0.015 >400 0.015 50 0.015 228 0.021 0.000 87.96 >400 +18:47:28 0.015 93 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:47:30 0.010 >400 0.015 137 0.010 >400 0.019 0.000 87.96 >400 +18:47:32 0.015 293 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +18:47:34 0.015 102 0.020 7.6 0.015 186 0.025 0.000 87.96 >400 +18:47:36 0.015 >400 0.020 2.6 0.015 186 0.024 0.000 87.96 >400 +18:47:38 0.015 >400 0.015 34.1 0.010 >400 0.021 0.000 87.96 >400 +18:47:40 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:47:42 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:47:44 0.010 >400 0.015 76 0.015 >400 0.021 0.000 87.96 >400 +18:47:46 0.010 >400 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +18:47:48 0.010 >400 0.020 64 0.015 >400 0.023 0.000 87.96 >400 +18:47:50 0.015 45 0.020 44 0.020 76 0.030 0.000 87.96 >400 +18:47:52 0.015 >400 0.015 71 0.015 171 0.019 0.000 87.96 >400 +18:47:54 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:47:56 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:47:58 0.010 >400 0.015 256 0.015 341 0.019 0.000 87.96 >400 +18:48:00 0.010 341 0.015 98 0.010 >400 0.021 0.000 87.96 >400 +18:48:02 0.010 >400 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +18:48:04 0.010 >400 0.015 128 0.010 >400 0.021 0.000 91.48 >400 +18:48:06 0.015 256 0.020 57 0.025 54 0.030 0.000 91.48 54 +18:48:08 0.040 36.6 0.130 23.3 0.030 20.7 0.132 0.000 91.48 146 +18:48:10 0.030 4.9 0.030 10.1 0.025 16.4 0.035 0.000 91.48 8.8 +18:48:12 0.055 24.7 0.070 21.6 0.030 18.5 0.090 0.000 91.48 158 +18:48:14 0.020 N/A 0.030 18.8 0.020 16.7 0.034 0.000 87.96 >400 +18:48:16 0.020 10.3 0.025 12.6 0.020 11.8 0.034 0.000 87.96 >400 +18:48:18 0.025 13.5 0.030 14.9 0.020 9.2 0.038 0.000 87.96 >400 +18:48:20 0.040 10.6 0.040 12.3 0.030 11.4 0.050 0.000 91.48 32.5 +18:48:22 0.015 49 0.055 114 0.045 3.2 0.057 0.000 91.48 341 +18:48:24 0.020 43 0.055 25.6 0.030 1.9 0.057 0.000 91.48 >400 +18:48:26 0.200 38.6 0.385 93 0.255 37.2 0.385 0.001 106.0 120 +18:48:28 0.040 29.7 0.050 19.9 0.055 22.0 0.078 0.000 91.48 >400 +18:48:30 0.015 47 0.015 256 0.015 89 0.019 0.000 87.96 >400 +18:48:32 0.015 31.5 0.015 293 0.015 137 0.019 0.000 87.96 >400 +18:48:34 0.015 >400 0.015 120 0.015 228 0.019 0.000 87.96 >400 +18:48:36 0.010 >400 0.015 256 0.015 >400 0.019 0.000 91.48 >400 +18:48:38 0.015 158 0.020 18.0 0.025 31.5 0.031 0.000 87.96 >400 +18:48:40 0.025 25.3 0.055 25.3 0.080 27.7 0.081 0.000 91.48 >400 +18:48:42 0.015 15.6 0.020 9.9 0.015 16.3 0.025 0.000 87.96 >400 +18:48:44 0.025 10.1 0.020 10.8 0.025 12.6 0.033 0.000 87.96 >400 +18:48:46 0.020 9.2 0.015 50 0.015 158 0.022 0.000 87.96 >400 +18:48:48 0.010 >400 0.015 43 0.010 >400 0.019 0.000 87.96 >400 +18:48:50 0.015 >400 0.015 256 0.010 >400 0.019 0.000 91.48 341 +18:48:52 0.015 26.3 0.015 >400 0.015 >400 0.023 0.000 91.48 >400 +18:48:54 0.015 102 0.015 37.9 0.015 293 0.019 0.000 87.96 >400 +18:48:56 0.015 42 0.015 47 0.010 >400 0.019 0.000 87.96 >400 +18:48:58 0.015 71 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:49:00 0.015 228 0.020 18.3 0.015 137 0.024 0.000 87.96 >400 +18:49:02 0.035 13.8 0.035 16.9 0.030 14.1 0.047 0.000 91.48 41 +18:49:04 0.020 15.9 0.025 14.2 0.025 10.8 0.032 0.000 87.96 >400 +18:49:06 0.015 >400 0.015 66 0.010 >400 0.019 0.000 87.96 >400 +18:49:08 0.020 21.8 0.025 19.3 0.015 23.3 0.030 0.000 87.96 >400 +18:49:10 0.015 171 0.015 60 0.015 >400 0.019 0.000 87.96 >400 +18:49:12 0.015 >400 0.015 53 0.010 >400 0.019 0.000 87.96 >400 +18:49:14 0.010 >400 0.015 228 0.010 >400 0.021 0.000 87.96 >400 +18:49:16 0.010 >400 0.015 45 0.010 >400 0.019 0.000 87.96 >400 +18:49:18 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:49:20 0.015 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:49:22 0.020 11.0 0.020 15.9 0.020 11.6 0.027 0.000 87.96 >400 +18:49:24 0.025 9.9 0.030 8.9 0.020 10.0 0.032 0.000 87.96 >400 +18:49:26 0.020 18.3 0.020 15.1 0.015 341 0.025 0.000 87.96 >400 +18:49:28 0.020 16.9 0.025 13.5 0.020 12.0 0.032 0.000 91.48 >400 +18:49:30 0.020 14.6 0.025 18.1 0.020 12.0 0.031 0.000 87.96 >400 +18:49:32 0.020 23.5 0.030 16.4 0.025 13.6 0.039 0.000 87.96 >400 +18:49:34 0.015 >400 0.015 57 0.010 >400 0.021 0.000 87.96 >400 +18:49:36 0.015 43 0.015 68 0.010 >400 0.019 0.000 87.96 >400 +18:49:38 0.015 26.9 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:49:40 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:49:42 0.015 256 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +18:49:44 0.015 205 0.015 102 0.010 >400 0.021 0.000 87.96 >400 +18:49:46 0.015 146 0.020 15.6 0.015 186 0.027 0.000 91.48 293 +18:49:48 0.030 11.0 0.030 12.9 0.025 13.8 0.039 0.000 91.48 >400 +18:49:50 0.085 20.5 0.105 22.3 0.055 18.5 0.117 0.000 91.48 35.3 +18:49:52 0.075 20.7 0.095 22.3 0.055 17.8 0.108 0.000 91.48 36.6 +18:49:54 0.105 21.3 0.140 22.5 0.060 18.6 0.153 0.000 91.48 171 +18:49:56 0.025 13.5 0.030 12.0 0.025 12.9 0.034 0.000 87.96 >400 +18:49:58 0.015 >400 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:50:00 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:50:02 0.015 >400 0.015 76 0.010 >400 0.021 0.000 87.96 >400 +18:50:04 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:06 0.010 >400 0.015 68 0.010 >400 0.021 0.000 87.96 >400 +18:50:08 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:50:10 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:50:12 0.010 >400 0.015 171 0.010 >400 0.021 0.000 87.96 >400 +18:50:14 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:16 0.015 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +18:50:18 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:20 0.015 256 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:50:22 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:24 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:26 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:28 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:50:30 0.015 46 0.015 71 0.015 15.4 0.023 0.000 87.96 >400 +18:50:32 0.010 >400 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +18:50:34 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +18:50:36 0.015 >400 0.015 76 0.010 >400 0.017 0.000 87.96 >400 +18:50:38 0.015 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:50:40 0.015 256 0.015 256 0.015 341 0.019 0.000 87.96 >400 +18:50:42 0.015 >400 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:50:44 0.015 59 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:50:46 0.010 >400 0.015 293 0.010 >400 0.017 0.000 87.96 >400 +18:50:48 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:50:50 0.010 >400 0.015 120 0.010 >400 0.019 0.000 87.96 >400 +18:50:52 0.015 >400 0.015 137 0.015 >400 0.021 0.000 87.96 >400 +18:50:54 0.015 171 0.015 146 0.015 73 0.019 0.000 87.96 >400 +18:50:56 0.015 54 0.015 146 0.015 137 0.019 0.000 87.96 >400 +18:50:58 0.015 228 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:51:00 0.010 >400 0.015 98 0.015 71 0.019 0.000 91.48 >400 +18:51:02 0.015 >400 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +18:51:04 0.015 >400 0.015 62 0.010 205 0.019 0.000 87.96 >400 +18:51:06 0.015 50 0.015 >400 0.015 171 0.021 0.000 87.96 >400 +18:51:08 0.015 171 0.015 71 0.010 >400 0.019 0.000 87.96 >400 +18:51:10 0.010 >400 0.015 158 0.010 >400 0.019 0.000 87.96 >400 +18:51:12 0.015 >400 0.015 108 0.015 >400 0.019 0.000 91.48 >400 +18:51:14 0.015 >400 0.015 120 0.015 146 0.019 0.000 91.48 >400 +18:51:16 0.015 22.8 0.020 7.2 0.020 9.7 0.030 0.000 87.96 >400 +18:51:18 0.040 17.4 0.065 22.5 0.035 14.8 0.080 0.000 93.98 120 +18:51:20 0.035 4.5 0.030 13.6 0.030 9.7 0.045 0.000 91.48 >400 +18:51:22 0.025 12.0 0.025 12.9 0.020 15.3 0.031 0.000 87.96 >400 +18:51:24 0.025 14.2 0.020 14.4 0.020 17.1 0.030 0.000 91.48 >400 +18:51:26 0.015 17.8 0.015 21.1 0.015 64 0.022 0.000 87.96 >400 +18:51:28 0.015 108 0.015 171 0.015 256 0.021 0.000 87.96 >400 +18:51:30 0.015 10.6 0.020 15.4 0.015 89 0.024 0.000 87.96 >400 +18:51:32 0.020 19.3 0.025 17.8 0.020 19.9 0.031 0.000 87.96 >400 +18:51:34 0.015 35.9 0.015 33.0 0.015 15.2 0.022 0.000 87.96 >400 +18:51:36 0.015 >400 0.015 21.1 0.015 50 0.021 0.000 87.96 >400 +18:51:38 0.015 32.0 0.015 >400 0.015 205 0.021 0.000 87.96 >400 +18:51:40 0.015 32.5 0.020 32.5 0.015 41 0.023 0.000 87.96 >400 +18:51:42 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:51:44 0.015 >400 0.015 >400 0.015 93 0.019 0.000 87.96 >400 +18:51:46 0.020 43 0.025 54 0.025 24.7 0.032 0.000 87.96 >400 +18:51:48 0.015 158 0.015 85 0.010 >400 0.019 0.000 87.96 >400 +18:51:50 0.010 >400 0.015 137 0.010 >400 0.017 0.000 87.96 >400 +18:51:52 0.015 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:51:54 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:51:56 0.020 18.0 0.020 21.1 0.015 >400 0.023 0.000 87.96 >400 +18:51:58 0.015 24.4 0.015 42 0.015 60 0.022 0.000 91.48 >400 +18:52:00 0.015 93 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:52:02 0.035 22.0 0.045 21.3 0.025 18.8 0.052 0.000 87.96 >400 +18:52:04 0.015 68 0.015 36.6 0.015 93 0.019 0.000 87.96 >400 +18:52:06 0.015 >400 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:52:08 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:52:10 0.015 293 0.015 146 0.015 >400 0.021 0.000 87.96 >400 +18:52:12 0.010 >400 0.015 57 0.010 >400 0.019 0.000 87.96 >400 +18:52:14 0.010 >400 0.010 >400 0.010 >400 0.017 0.000 87.96 >400 +18:52:16 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:52:18 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:52:20 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:52:22 0.015 146 0.015 46 0.020 9.1 0.025 0.000 91.48 128 +18:52:24 0.015 25.6 0.015 31.5 0.015 171 0.021 0.000 87.96 >400 +18:52:26 0.010 >400 0.015 102 0.010 >400 0.019 0.000 87.96 >400 +18:52:28 0.010 >400 0.015 256 0.010 >400 0.019 0.000 87.96 >400 +18:52:30 0.015 108 0.020 25.9 0.015 41 0.022 0.000 87.96 >400 +18:52:32 0.015 >400 0.015 102 0.015 >400 0.019 0.000 87.96 >400 +18:52:34 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:52:36 0.015 256 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:52:38 0.010 >400 0.015 89 0.015 >400 0.019 0.000 87.96 >400 +18:52:40 0.010 >400 0.015 >400 0.010 >400 0.021 0.000 87.96 >400 +18:52:42 0.010 >400 0.015 228 0.010 >400 0.019 0.000 87.96 >400 +18:52:44 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:52:46 0.015 >400 0.015 171 0.010 >400 0.019 0.000 87.96 >400 +18:52:48 0.015 38.6 0.015 85 0.015 >400 0.019 0.000 87.96 >400 +18:52:50 0.010 >400 0.015 293 0.010 >400 0.019 0.000 87.96 >400 +18:52:52 0.015 228 0.015 341 0.010 >400 0.019 0.000 87.96 >400 +18:52:54 0.015 59 0.015 158 0.010 >400 0.021 0.000 87.96 >400 +18:52:56 0.015 171 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:52:58 0.010 >400 0.015 >400 0.010 >400 0.017 0.000 87.96 >400 +18:53:00 0.010 >400 0.015 186 0.010 >400 0.017 0.000 87.96 >400 +18:53:02 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 91.48 >400 +18:53:04 0.015 >400 0.015 205 0.010 >400 0.019 0.000 87.96 >400 +18:53:06 0.015 38.6 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:53:08 0.015 186 0.015 98 0.015 >400 0.019 0.000 87.96 >400 +18:53:10 0.015 128 0.015 102 0.015 >400 0.023 0.000 87.96 >400 +18:53:12 0.020 14.9 0.020 3.5 0.015 44 0.027 0.000 87.96 >400 +18:53:14 0.015 24.1 0.015 137 0.010 >400 0.021 0.000 87.96 >400 +18:53:16 0.010 >400 0.015 79 0.010 >400 0.019 0.000 87.96 >400 +18:53:18 0.010 >400 0.015 73 0.010 >400 0.019 0.000 87.96 >400 +18:53:20 0.010 >400 0.015 128 0.010 >400 0.019 0.000 87.96 >400 +18:53:22 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:53:24 0.010 >400 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:53:26 0.010 >400 0.015 186 0.010 >400 0.019 0.000 87.96 >400 +18:53:28 0.015 186 0.015 >400 0.010 >400 0.019 0.000 87.96 >400 +18:53:30 0.010 >400 0.015 146 0.010 >400 0.019 0.000 87.96 >400 +18:53:32 0.010 >400 0.015 71 0.010 >400 0.021 0.000 87.96 >400 +18:53:34 0.015 256 0.015 158 0.010 >400 0.019 0.000 91.48 >400 +18:53:36 0.010 >400 0.015 64 0.010 >400 0.021 0.000 87.96 >400 +18:53:38 0.025 10.3 0.025 7.5 0.025 5.2 0.036 0.000 87.96 >400 +18:53:40 0.025 10.6 0.025 15.4 0.020 11.9 0.034 0.000 87.96 >400 +18:53:42 0.030 11.1 0.040 10.1 0.030 11.2 0.050 0.000 91.48 >400 +18:53:44 0.055 12.2 0.045 10.2 0.040 10.2 0.060 0.000 91.48 44 +18:53:46 0.025 15.2 0.040 11.0 0.030 12.6 0.051 0.000 91.48 50 +18:53:48 0.015 34.1 0.015 120 0.015 62 0.022 0.000 87.96 >400 +18:53:50 0.015 108 0.020 12.5 0.015 17.4 0.024 0.000 87.96 >400 +18:53:52 0.015 14.9 0.025 12.9 0.015 66 0.031 0.000 87.96 >400 diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/requests.bin b/tests/fixtures/minimate-bench-10-26-26-histogram/requests.bin new file mode 100644 index 0000000000000000000000000000000000000000..2273d64425aaea365303ece1b494596b16462acf GIT binary patch literal 42023 zcmeI*51b6=9R~1Ogv%9KBqA4;tz1Nu^CuVdB7z_nz37#T>QQy>mOD9nm%Vin6}^gx zs;a7ps_Io#MO9Q)MO0N)Ra8|)R8&P(MO9T*RYm&F?(>_O-*YrpTyxj#_Qn7~TyU7c}Nv@e!Ej&EbO-hAp>%Ocx zt*VtNBff)4;S{7ebFpOftxTkRd7%b!4x;JD$S~ZTMO5m#)3_o=u((A4J|2o32K9sx% zJeRyD+&M$Qe(41tLG$;4k0kF4A4T3DUO=7+A5A_0UPzt=A4@(EUQC`150MXoJLjv| z-W+(C<{tu&kPn5Iljp)GkPnAXBp(5vL_QMEedH)Ocaa5fPY)UGYe&PUQu&4OY2;(! z)5(kBGsr{mndGJLS>$2(Z1MQ#n_;T`D@D=2<;Va4Kz*mvag|8-`2VX-zAHJ4+0el_#Lil>} zMeq&emGF(^i{YEdm%ulZFNJR*Uk2Ywz8t=dd@>TGiQN5L@! z^~sOJlgLlNlgU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@lh(;EX-%2^jL*l)ki5)#^oBH-Avt~$(k^fRvSL|MeE7lGZk|5SGm8WmcCIT;Q|w$-ny%QnrZhvbb46*Um(@LO?wT}puO@w2&F)@H`igSrQqr@Ez1Igk zr6-%V6rH}R=58o#t}uD#ZY=zD#eOrzO8JKJro!J;e53I5ikl06OK}U~Z!1m_enD|d z;qNGJCH!5*0pS-Fw-)}M;#A@9D{dqF1I2BHf2g>f@Jou@3%{&5P54KOI|=_-aTnpA zC{7ptsp77}KU3UY_~(iMF z!XH#TTlhA`bA&&nc&_m6isuR6p?JRVor)I--=%n=@P`#I67Hb5Qn;hy#loExFA=_5 z@lxS?6fYC*rg*vVM-;CRzE|-|;rkS?624#YYT@3B*9bqLc&%_h#p{G0RJ>mJA;lYn zKdN}6@WYBX34cuSX5o)3-Xc6$@mAqS6mJv$gyQYOpH#dV0~_%X#tgv%5k6&|nnnDFC@j|)Gc z_=NCh6rU7+Qt>I_&niAG{5i#Egr8D;R`_Yf=Y*e8d|vqTiZ2L%LGeZ5FM3(s(^bdJ b5*v|d=AMJAp;vuBS8RU1o6FWK8dLZW{OgGN literal 0 HcmV?d00001 diff --git a/tests/fixtures/minimate-bench-10-26-26-histogram/unit_replies.bin b/tests/fixtures/minimate-bench-10-26-26-histogram/unit_replies.bin new file mode 100644 index 0000000000000000000000000000000000000000..96b5d58351dfc85c37459ea18e3c35aba53ec61f GIT binary patch literal 543559 zcmeFa3$$g|Ri3$zT(+;|a@})Fg{hcAb*faDYo{!gq%tTVg8&%|V$%l8gd_}N$Ckmw z$Zkss1o9vmNkfy6qyu?CCq$h=2#Ewg9FF_`8~uF7EAP1D z&RcH#^l7^7!Y!YE`}B+(p80FP@uY%~@%l|oJ8z#g{y_ErvU>Y{2lw~B9Qm^Ad0Q-= z`PS)~{eENif8u9W$MJiSjrvVP{vCd8_m1UtzxL{Bx?>*j<4NMbN?GvnB>J(F=wn6K zt$KTMrYrk#&=frI;pa_k?<{k{44drP^WsUyE~aR1ME z=vw7&c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kjte~oF(=lP)w(x zXs%#c#p24HaYy=03U02nBgZL~1os9`P$(=^=Hx{T;N+5Xsrmgn|8M)HLztKs!MMUZ zCx&>OFwfV_^Qp<$qP>Wl&2P57WG}_!vNiBs&#OiHITelI0>&UIwu-4SnIu&^_nblJ zdrMo)(Bv!!5Fi2uAT~#7d$0RVhiVqLZ2^iOJpc&URV1na(bS)M4E=1+2de`(+1H^?9l&(Ql z%bGaV`=uEgh-_sH#r{P=cM}*dH1`?$>H8jw@tVV!{MQC*7cp>&C^|x21#X7W8#j7 JXI5-^!#`uHJ@o(p literal 0 HcmV?d00001 diff --git a/tests/test_5a_blastware_walk_histogram.py b/tests/test_5a_blastware_walk_histogram.py new file mode 100644 index 0000000..2e9559d --- /dev/null +++ b/tests/test_5a_blastware_walk_histogram.py @@ -0,0 +1,124 @@ +"""SFM's 5A walk past the old 128-chunk cap, against Blastware (BE9441, 2026-10-26). + +Event 2 of tests/fixtures/minimate-bench-10-26-26-histogram/ is a 71,088-byte +histogram: 139 requests, crossing two 64 KB pages. Before the walk was sized from +STRT, a caller's max_chunks=128 cut it short. Fed the unit's recorded replies, +SFM's walk must send exactly Blastware's requests and rebuild Blastware's file. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import fast_clock # noqa: E402 +from minimateplus.blastware_file import write_blastware_file # noqa: E402 +from minimateplus.framing import S3FrameParser # noqa: E402 +from minimateplus.models import Event # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram" + + +def _unstuff(b: bytes) -> bytes: + out, k = bytearray(), 0 + while k < len(b): + if b[k] == 0x10 and k + 1 < len(b): + out.append(b[k + 1]); k += 2 + else: + out.append(b[k]); k += 1 + return bytes(out) + + +def _requests() -> list: + raw, out, i = (FIX / "requests.bin").read_bytes(), [], 0 + while i < len(raw): + if raw[i:i + 2] == b"\x41\x03": + i += 2 + continue + if raw[i:i + 2] != b"\x41\x02": + i += 1 + continue + j = i + 2 + while raw[j] != 0x03: + j += 2 if raw[j] == 0x10 else 1 + out.append(raw[i:j + 1]) + i = j + 1 + return out + + +def _addr_len(frame: bytes) -> tuple: + p = _unstuff(frame[2:-1]) + return int.from_bytes(p[6:10], "big"), int.from_bytes(p[4:6], "big") + + +def _a5_replies() -> list: + raw, out, start, p = (FIX / "unit_replies.bin").read_bytes(), [], 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + if f.sub == 0xA5: + out.append(raw[start:i + 1]) + start = i + 1 + return out + + +FIVE_A = [f for f in _requests() if _unstuff(f[2:-1])[2] == 0x5A] +REPLIES = {} +for _q, _r in zip(FIVE_A, _a5_replies()): + REPLIES.setdefault(_addr_len(_q), _r) + + +class ByAddress: + def __init__(self): + self.sent, self._buf = [], b"" + + def write(self, data): + data = bytes(data) + self.sent.append(data) + self._buf += REPLIES.get(_addr_len(data), b"") + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +def _blastware_walk(start: int) -> list: + """Blastware's last complete walk for the event at `start` (it also cancelled one).""" + starts = [k for k, f in enumerate(FIVE_A) if _addr_len(f) == (start, 0x200)] + for i in reversed(starts): + walk = [FIVE_A[i]] + while i + 1 < len(FIVE_A) and _addr_len(walk[-1])[1] == 0x200: + i += 1 + walk.append(FIVE_A[i]) + if _addr_len(walk[-1])[1] != 0x200: + return walk + raise AssertionError("no complete walk") + + +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +def test_the_recording_pairs_up(): + assert len(FIVE_A) == len(_a5_replies()) == 722 + + +@pytest.mark.parametrize("key,bw,n", [("0111f210", "K441LTON.900", 139), + ("011106a0", "K441LTOK.R10", 118)]) +def test_the_walk_is_blastwares_and_rebuilds_its_file(key, bw, n, tmp_path): + t = ByAddress() + frames = mp.MiniMateProtocol(t).read_bulk_waveform_stream( + bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, + strict=True, max_chunks=128) + want = _blastware_walk(int(key, 16)) + assert len(want) == n and t.sent == want + ev = Event(index=0) + ev.timestamp = None + write_blastware_file(ev, frames, tmp_path / bw) + assert (tmp_path / bw).read_bytes() == (FIX / "blastware" / bw).read_bytes() -- 2.54.1 From 1da30836650216397ed7d62bb6e9802053d845d8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 19:10:04 -0400 Subject: [PATCH 109/223] docs: the MiniMate histogram and stop checks are done; start is still owed Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 10 +++++++--- .../2026-10-20-sfm-series4-parity-design.md | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3b60f89..253a331 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -155,9 +155,13 @@ Read this first when picking the project back up. page bug was fixed** (see the ✅ FIXED entry below): a fresh 8 events, 4 of them crossing a page, all downloaded byte-identical to Blastware's own files. Stale id gives 409, a repeat gives `already_stored`, also against Blastware's imported - copy. ⚠ Still owed before merge: a histogram event (and one over ~66 KB, the - size a 128-chunk cap used to cut short; now sized from STRT, untested on a unit) - and start/stop through the new path (spec, phase 1b). Next: 1c (webapp). + copy. **Evening 2026-10-26 (measured):** a 71 KB histogram (139 requests, two + 64 KB crossings) downloaded byte-identical to Blastware's, and SFM **stopped** + the unit through the new audited path (acked, read back idle). That needed + `d990466`: the 0x1C flag reads **0x0B** during a histogram run (only 0x10 had + been measured), and the status decode had to unescape before counting from the + end. ⚠ Still owed before merge: **start** through the new path (spec, phase + 1b), and #47 from dev for mic-off histograms. Next: 1c (webapp). - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 052576b..9462d17 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -397,10 +397,20 @@ Each safety piece arrives with its first real use, so nothing sits untested. Review follow-ups: the chunk cap is sized from STRT (a caller's 128 cut events past ~66 KB short, e.g. large histograms), a misread STRT is refused, TERM only for a true tail. + - ✅ **A histogram event, over 66 KB (2026-10-26 evening).** BE9441, + 2 s intervals, 4,096 sps, 3,398 intervals, 71,106 B: 139 requests and + two 64 KB crossings. SFM's download (by serial, through the bridge) + is byte-identical to Blastware's file, as is the 59 KB waveform. The + mic-off histogram was refused ("decodes as neither") until #47 (on dev) + reaches this branch. Fixture `minimate-bench-10-26-26-histogram/`. + - ✅ **Stop through the new path (2026-10-26 18:53).** Brian's go. The + flag read 0x0B (histogram monitoring); SFM had shown "not monitoring" + and refused the state as unknown until `d990466` (0x0B measured; the + status also misread an escaped 04 in free memory). The stop frame was + Blastware's bytes; it was acked 0x68 and read back idle, audit + `c9c17128`. No call-home attempt after it. - Still owed: - - a histogram event (this unit records single shot), ideally one - over ~66 KB, which only the new cap sizing lets through; - - start/stop through the new path, with Brian present; + - **start** through the new path, with Brian present; - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; - ~~whether standard (non-5A) requests need the same checksum -- 2.54.1 From 6f2acc79e6c9a61fd1ecf1a354a3b60c71556b4d Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 19:16:25 -0400 Subject: [PATCH 110/223] docs(spec): owe persist_download an alignment with dev's waveform-time restamp before the merge Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 9462d17..a523830 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -411,6 +411,15 @@ Each safety piece arrives with its first real use, so nothing sits untested. `c9c17128`. No call-home attempt after it. - Still owed: - **start** through the new path, with Brian present; + - **before merging to dev, align `persist_download`'s already-stored + check with dev's restamp fix** (fix/waveform-time-restamp, + `847900b`..`3948dc1`). Today it looks up (serial, timestamp), which + misses a v0.31.0 row not yet restamped, so the download would move + and overwrite the richer watcher copy. Mirror the merged + `insert_events` rules: match by (serial, Blastware filename) as + well; only filenames `blastware_filename_time()` can parse; prefer a + reviewed row that has a time. Series-3 waveform times come from + the Blastware filename there (`read_blastware_file(path, name=...)`). - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; - ~~whether standard (non-5A) requests need the same checksum -- 2.54.1 From 9886422212be942c43b090d6f789b06ddfed9f31 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 26 Oct 2026 23:51:15 -0400 Subject: [PATCH 111/223] fix(device_access): wake a MiniMate before every state read in a start/stop, so a start's read-back is answered BE9441, 2026-10-26 23:41:48 (through the bridge): SFM's start (0x96, Blastware's own bytes) was acked 0x69 and the unit began monitoring -- Brian saw it -- but the read-back sent one bare 0x1C two seconds later and got nothing for 120 s, so the change reported 'sent and acknowledged, but reading the state back failed' (504, audit 0c1cf813). Nothing was retried. A monitoring MiniMate ignores a bare request until SESSION_RESET + POLL (measured 2026-04-08). The read-back had relied on the connect's wake; a stop's read-back (18:53, the unit idle by then) never needed it. Every state read in the change now goes through _woken_state: client.poll() (41 03, POLL, 41 03, POLL -- the connect's own sequence), then 0x1C. Test: after the send, every 0x1C read is preceded by a POLL. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 13 ++++++++++++- tests/test_device_access_change.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index c9e13cc..e187b71 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -43,6 +43,17 @@ def s3_run_state(status: Any) -> str: return S3_RUN_STATES.get(flag, f"unknown(0x{flag:02X})") +def _woken_state(client: Any) -> str: + """The run state, read after waking the unit: SESSION_RESET + POLL first. + + A monitoring MiniMate ignores a bare request until it is woken (measured + 2026-04-08). On 2026-10-26 BE9441 acked a start, then let a bare 0x1C go + unanswered for 120 s -- the read-back had relied on the connect's wake, + which a stop's read-back (the unit idle by then) never needed.""" + client.poll() + return s3_run_state(client.get_monitor_status()) + + def default_s3_client_factory(address: UnitAddress, timeout: Optional[float] = None) -> MiniMateClient: if address.host: return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port), @@ -208,7 +219,7 @@ class Series3Adapter: even_if_already=even_if_already, audit=audit, address=address, caller=caller, sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, read_serial=read_serial, - read_state=lambda: s3_run_state(client.get_monitor_status()), + read_state=lambda: _woken_state(client), describe_plan=describe_plan, send=send) return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False) diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 2d245b6..2f5c759 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -771,3 +771,17 @@ def test_series3_a_cold_unit_during_a_change_is_not_retried(): da.start_monitoring(TCP3, "BE18193") assert fake.writes == [] assert len(da.factory_calls) == 1 # the change path never takes _run's retry + + +# -- Series 3: a monitoring unit answers only after the wake ---------------------- + +def test_series3_wakes_the_unit_before_every_state_read(): + # BE9441, 2026-10-26 23:41: the start was acked, then one bare 0x1C read got + # nothing for 120 s -- a monitoring unit ignores everything until SESSION_RESET + # + POLL (measured 2026-04-08), which only the connect had sent. + fake = FakeMiniMateClient(monitor_states=[False, True]) + r = access3(fake).start_monitoring(TCP3, "BE18193") + assert r.outcome == "sent" and r.verified == "ok" + after = fake.calls[fake.calls.index("start_monitoring") + 1:] + reads = [i for i, c in enumerate(after) if c == "get_monitor_status"] + assert reads and all(after[i - 1] == "poll" for i in reads) -- 2.54.1 From ca5c401c6faf35d52617c4f5511c153894913202 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 00:02:10 -0400 Subject: [PATCH 112/223] fix(device_access): a start's read-back waits out the sensor check, then wakes the MiniMate with retries Second start through SFM, BE9441 2026-10-26 23:54:41: acked 0x69, and Brian saw 'starting, performing sensor check, recording' -- but the read-back's single SESSION_RESET + POLL went out 2.3 s after the ack, inside the ~30 s sensor check, and was never answered or re-sent (504 after 120 s, audit ca7b5b42). Brian: every unit is set to sensor-check before monitoring, ~30 s, then 'Recording...'. - MiniMateProtocol.wake(attempt_s, deadline_s): SESSION_RESET + POLL re-sent every attempt_s until the unit answers, then the POLL data step; a named timeout at the deadline. Reads only. MiniMateClient.wake() wraps it. - The Series-3 change: after a START, the first read waits S3_SENSOR_CHECK_S (30 s) before asking; every read then wakes with retries (every 5 s, up to 60 s). A stop is unchanged -- its read-back was confirmed three times tonight. Tests: a unit deaf for 4 probes is asked a 5th time and answers; a unit that never answers ends in the named timeout after ~6 probes; a start's first read waits the sensor check, a stop's does not; every read is preceded by a wake. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 6 ++ minimateplus/protocol.py | 29 ++++++++++ sfm/device_access/s3.py | 30 ++++++++-- tests/device_access_fakes.py | 3 + tests/test_device_access_change.py | 18 +++++- tests/test_minimate_wake.py | 89 ++++++++++++++++++++++++++++++ 6 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 tests/test_minimate_wake.py diff --git a/minimateplus/client.py b/minimateplus/client.py index 2cf70e6..509e944 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -1203,6 +1203,12 @@ class MiniMateClient: log.debug("poll: startup handshake") proto.startup() + def wake(self, attempt_s: float = 5.0, deadline_s: float = 60.0) -> None: + """SESSION_RESET + POLL, re-sent until the unit answers (see + MiniMateProtocol.wake) -- for a unit that may be busy, e.g. sensor-checking + right after a start.""" + self._require_proto().wake(attempt_s=attempt_s, deadline_s=deadline_s) + # ── Monitoring ──────────────────────────────────────────────────────────── def get_monitor_status(self) -> MonitorStatus: diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 1339099..0d2e43d 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -289,6 +289,35 @@ class MiniMateProtocol: log.debug("read SUB=0x%02X: received %d data bytes", sub, len(data_rsp.data)) return data_rsp.data + def wake(self, attempt_s: float = 5.0, deadline_s: float = 60.0) -> S3Frame: + """SESSION_RESET + POLL, re-sent every `attempt_s` until the unit answers. + + A monitoring unit ignores everything until SESSION_RESET (2026-04-08), and + right after a start it runs its sensor check (~30 s, Brian, 2026-10-26). + BE9441 left a POLL sent 2 s after a start unanswered and never answered + it later, so one try with a long wait is not enough: ask again until the + unit answers or `deadline_s` passes. A read -- nothing but SESSION_RESET + and POLL is sent. Returns the POLL data frame. + """ + deadline = time.monotonic() + deadline_s + while True: + self._parser.reset() + self._send(SESSION_RESET) + self._send(POLL_PROBE) + try: + self._recv_one(expected_sub=_expected_rsp_sub(SUB_POLL), timeout=attempt_s) + break + except TimeoutError: + if time.monotonic() >= deadline: + raise TimeoutError( + f"the unit did not answer a POLL within {deadline_s:.0f} s " + f"(asked every {attempt_s:.0f} s)") from None + self._send(SESSION_RESET) + self._send(POLL_DATA) + rsp = self._recv_one(expected_sub=_expected_rsp_sub(SUB_POLL), timeout=attempt_s) + self._drain_boot_string(drain_ms=300) # a late answer to an earlier try, if any + return rsp + def poll(self) -> S3Frame: """ Send a single POLL (SUB 5B) probe+data cycle and return the data response. diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index e187b71..92d88b2 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -43,14 +43,23 @@ def s3_run_state(status: Any) -> str: return S3_RUN_STATES.get(flag, f"unknown(0x{flag:02X})") +# A start makes the unit run its sensor check before "Recording..." -- ~30 s +# (Brian, 2026-10-26), ~40 s on BE11529 (2026-04-08). A start's read-back waits +# this long before asking, then wakes the unit with retries (S3_WAKE_*). +S3_SENSOR_CHECK_S = 30.0 +S3_WAKE_ATTEMPT_S = 5.0 +S3_WAKE_DEADLINE_S = 60.0 + + def _woken_state(client: Any) -> str: - """The run state, read after waking the unit: SESSION_RESET + POLL first. + """The run state, read after waking the unit: SESSION_RESET + POLL first, + re-sent until it answers. A monitoring MiniMate ignores a bare request until it is woken (measured - 2026-04-08). On 2026-10-26 BE9441 acked a start, then let a bare 0x1C go - unanswered for 120 s -- the read-back had relied on the connect's wake, - which a stop's read-back (the unit idle by then) never needed.""" - client.poll() + 2026-04-08). On 2026-10-26 BE9441 acked a start, then left a bare 0x1C, and + later a single SESSION_RESET + POLL, unanswered for 120 s: both went out 2 s + after the start, inside the sensor check, and were never re-sent.""" + client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S) return s3_run_state(client.get_monitor_status()) @@ -209,17 +218,26 @@ class Series3Adapter: "data_len": 0, "expect_ack": f"0x{ack_sub:02X}", "frame": build_bw_write_frame(sub, b"").hex()}]} + settle: list = [] + def send() -> dict: # The client validates the ack SUB; it returns nothing else, so none is claimed. (client.start_monitoring if start else client.stop_monitoring)() + if start: + settle.append(S3_SENSOR_CHECK_S) # the first read waits out the check return {"subs": [f"0x{ack_sub:02X}"]} + def read_state() -> str: + if settle: + sleep(settle.pop()) + return _woken_state(client) + return run_change( serial=serial, series=3, start=start, dry_run=dry_run, even_if_already=even_if_already, audit=audit, address=address, caller=caller, sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, read_serial=read_serial, - read_state=lambda: _woken_state(client), + read_state=read_state, describe_plan=describe_plan, send=send) return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 08fe44c..cf656ae 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -105,6 +105,9 @@ class FakeMiniMateClient(_Base): def poll(self) -> None: self._step("poll") + def wake(self, **kw) -> None: + self._step("wake") + def get_monitor_status(self) -> MonitorStatus: self._step("get_monitor_status") state = self.monitor_states.pop(0) if len(self.monitor_states) > 1 else self.monitor_states[0] diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 2f5c759..d4d4280 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -328,7 +328,7 @@ from device_access_fakes import FakeMiniMateClient # no TCP3 = UnitAddress(host="10.0.0.6", tcp_port=12345, port=None, baud=None) -def access3(fake, audit="default"): +def access3(fake, audit="default", sleep=lambda s: None): seen = [] def factory(a, **kw): @@ -336,7 +336,7 @@ def access3(fake, audit="default"): return fake da = DeviceAccess(s3_client_factory=factory, start_reaper=False, audit=Audit() if audit == "default" else audit, - sleep=lambda s: None, verify_timeout_s=6.0, verify_interval_s=2.0) + sleep=sleep, verify_timeout_s=6.0, verify_interval_s=2.0) da.factory_calls = seen return da @@ -784,4 +784,16 @@ def test_series3_wakes_the_unit_before_every_state_read(): assert r.outcome == "sent" and r.verified == "ok" after = fake.calls[fake.calls.index("start_monitoring") + 1:] reads = [i for i, c in enumerate(after) if c == "get_monitor_status"] - assert reads and all(after[i - 1] == "poll" for i in reads) + assert reads and all(after[i - 1] == "wake" for i in reads) + + +def test_series3_a_start_waits_out_the_sensor_check_before_its_first_read(): + # Brian (2026-10-26): every unit runs a ~30 s sensor check before + # "Recording..."; a stop's read-back needs no such wait. + from sfm.device_access.s3 import S3_SENSOR_CHECK_S + for start, waited in ((True, True), (False, False)): + slept = [] + fake = FakeMiniMateClient(monitor_states=[not start, start]) + da = access3(fake, sleep=slept.append) + (da.start_monitoring if start else da.stop_monitoring)(TCP3, "BE18193") + assert (S3_SENSOR_CHECK_S in slept) is waited diff --git a/tests/test_minimate_wake.py b/tests/test_minimate_wake.py new file mode 100644 index 0000000..ab30b66 --- /dev/null +++ b/tests/test_minimate_wake.py @@ -0,0 +1,89 @@ +"""Waking a MiniMate that is busy right after a start (BE9441, 2026-10-26). + +A start makes the unit run its sensor check (~30 s, Brian; ~40 s on BE11529, +2026-04-08) before 'Recording...'. Twice tonight a read-back sent 2 s after the +start's ack -- a bare 0x1C, then SESSION_RESET + POLL -- got no answer, and with +nothing re-sent the read waited out 120 s. wake() re-sends SESSION_RESET + POLL +until the unit answers or the deadline passes. +""" +from __future__ import annotations + +import os +import sys + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +import minimateplus.protocol as mp # noqa: E402 +from minimate_replay import fast_clock # noqa: E402 +from minimateplus.framing import POLL_DATA, POLL_PROBE, SESSION_RESET # noqa: E402 + +# BE9441's own POLL replies, recorded 2026-10-26 (probe ack, then the data reply) +PROBE_ACK = bytes.fromhex("1002001010a400000030000000000000000000000000d403") + + +def _poll_data_reply() -> bytes: + from pathlib import Path + from minimateplus.framing import S3FrameParser + raw = (Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram" + / "unit_replies.bin").read_bytes() + p, start = S3FrameParser(), 0 + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + w = raw[start:i + 1] + if f.sub == 0xA4 and len(f.data) > 20: + return w[w.index(b"\x10\x02"):] + start = i + 1 + raise AssertionError("no POLL data reply in the fixture") + + +class Busy: + """Ignores the first `deaf` POLL probes (a sensor check), then answers.""" + + def __init__(self, deaf: int): + self.deaf, self.sent, self._buf = deaf, [], b"" + self.data_reply = _poll_data_reply() + + def write(self, data): + data = bytes(data) + self.sent.append(data) + if data == POLL_PROBE: + if self.deaf: + self.deaf -= 1 + else: + self._buf += PROBE_ACK + elif data == POLL_DATA: + self._buf += self.data_reply + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +@pytest.fixture(autouse=True) +def _fast(monkeypatch): + fast_clock(monkeypatch) + + +def test_the_probe_ack_is_real(): + from minimateplus.framing import S3FrameParser + f = S3FrameParser().feed(PROBE_ACK) + assert len(f) == 1 and f[0].sub == 0xA4 + + +def test_a_busy_unit_is_asked_again_until_it_answers(): + t = Busy(deaf=4) + mp.MiniMateProtocol(t).wake(attempt_s=5.0, deadline_s=60.0) + probes = [i for i, d in enumerate(t.sent) if d == POLL_PROBE] + assert len(probes) == 5 # 4 ignored, the 5th answered + assert all(t.sent[i - 1] == SESSION_RESET for i in probes) + assert t.sent[-2:] == [SESSION_RESET, POLL_DATA] + + +def test_a_unit_that_never_answers_ends_in_a_named_timeout(): + t = Busy(deaf=10 ** 6) + with pytest.raises(mp.TimeoutError, match="did not answer a POLL"): + mp.MiniMateProtocol(t).wake(attempt_s=5.0, deadline_s=30.0) + assert 5 <= t.sent.count(POLL_PROBE) <= 7 # every ~5 s for 30 s -- 2.54.1 From d7e65f5d15e95e45c4ce543d8d8953d73da52d07 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 00:13:37 -0400 Subject: [PATCH 113/223] docs: MiniMate start through SFM verified on BE9441 -- the start/stop bench check is complete Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 7 +++++-- .../specs/2026-10-20-sfm-series4-parity-design.md | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 253a331..3b39af9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -160,8 +160,11 @@ Read this first when picking the project back up. the unit through the new audited path (acked, read back idle). That needed `d990466`: the 0x1C flag reads **0x0B** during a histogram run (only 0x10 had been measured), and the status decode had to unescape before counting from the - end. ⚠ Still owed before merge: **start** through the new path (spec, phase - 1b), and #47 from dev for mic-off histograms. Next: 1c (webapp). + end. **Start too (2026-10-27 00:12):** idle → monitoring, verified -- once a + start's read-back waited out the ~30 s sensor check and re-sent the wake + (`9886422`, `ca5c401`; a monitoring MiniMate answers nothing until woken, and + nothing during its sensor check). Still owed before merge: #47 from dev, and + `persist_download` aligned with dev's waveform-time restamp (spec). Next: 1c. - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index a523830..322b96c 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -409,8 +409,16 @@ Each safety piece arrives with its first real use, so nothing sits untested. status also misread an escaped 04 in free memory). The stop frame was Blastware's bytes; it was acked 0x68 and read back idle, audit `c9c17128`. No call-home attempt after it. + - ✅ **Start through the new path (2026-10-27 00:12).** Brian's go; + idle → monitoring, verified, audit `cb540970`, 36.7 s; the stop that + followed verified too (`2618c81a`). Two earlier starts were acked and + the unit recorded, but their read-backs went unanswered: a bare 0x1C + (`9886422` added the wake), then a single wake sent 2 s in, inside the + ~30 s sensor check (`ca5c401`: a start's first read waits 30 s, then the + wake repeats every 5 s up to 60 s). A third was cancelled at the + keypad mid sensor check; SFM read it back honestly as a mismatch + ("unit reads idle", 30 reads), audit `b019ae6d`. - Still owed: - - **start** through the new path, with Brian present; - **before merging to dev, align `persist_download`'s already-stored check with dev's restamp fix** (fix/waveform-time-restamp, `847900b`..`3948dc1`). Today it looks up (serial, timestamp), which -- 2.54.1 From 98def4aae0d2d17d61b4ebd03930b73c2af9fd84 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 00:17:29 -0400 Subject: [PATCH 114/223] docs(spec): a stop starts a call-home on a unit with auto-call-home -- unmeasured on Series 3 Brian: stopping by command or keypad with ACH enabled makes the unit call home and upload events + MLG, which can take minutes. Fits UM20147's 0x01 after a stop (10-25). Owed: measure a MiniMate stop with ACH on, through the bridge. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 322b96c..b5d0adb 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -418,6 +418,16 @@ Each safety piece arrives with its first real use, so nothing sits untested. wake repeats every 5 s up to 60 s). A third was cancelled at the keypad mid sensor check; SFM read it back honestly as a mismatch ("unit reads idle", 30 reads), audit `b019ae6d`. + - 🔶 **A stop starts a call-home when auto-call-home is on** (Brian, + 2026-10-27): stopping by command or keypad makes the unit call home and + upload its events + MLG, which can take minutes. UM20147's `0x01` for + ~18 s after a stop (10-25) fits; BE9441 never called home (ACH + presumably off). For SFM: after a stop the read-back may meet a + call-home state, a ring, or silence, and on cellular the unit contends + for the modem's one TCP session SFM may be holding. **Series 3's 0x1C + value during a call-home is unmeasured** -- the change path would + refuse it as unknown. To measure: a MiniMate stop with ACH on, through + the bridge. - Still owed: - **before merging to dev, align `persist_download`'s already-stored check with dev's restamp fix** (fix/waveform-time-restamp, -- 2.54.1 From a7f581f66a8ba615257147590b028fba30e0eb94 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 00:20:54 -0400 Subject: [PATCH 115/223] docs(spec): the persist_download alignment follows what v0.32.0 shipped -- event-record times, the estimate guard Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index b5d0adb..27b5e6b 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -430,14 +430,19 @@ Each safety piece arrives with its first real use, so nothing sits untested. the bridge. - Still owed: - **before merging to dev, align `persist_download`'s already-stored - check with dev's restamp fix** (fix/waveform-time-restamp, - `847900b`..`3948dc1`). Today it looks up (serial, timestamp), which - misses a v0.31.0 row not yet restamped, so the download would move - and overwrite the richer watcher copy. Mirror the merged - `insert_events` rules: match by (serial, Blastware filename) as - well; only filenames `blastware_filename_time()` can parse; prefer a - reviewed row that has a time. Series-3 waveform times come from - the Blastware filename there (`read_blastware_file(path, name=...)`). + check with what v0.32.0 shipped** (dev `04acb99`; restamp `5737168`, + then `3a6df9d` fix/waveform-time-from-record). A Series-3 waveform's + time comes from the unit's **embedded event record** in the 5A stream + (`00 28 05 00 ?? ?? fe 80 [trigger][stop]`, + `event_file_io._embedded_event_record`), which SFM's own downloads + carry too; the filename is a cross-check only, never a fallback. + `Event.timestamp_source` says which ("event_record" / "report" / + "footer" / "estimate"). Mirror the DB rules: match by stored file + as well as (serial, timestamp) (`SeismoDb._restamp_by_file`), and an + **"estimate" time never matches, moves or duplicates a row** + (`SeismoDb._estimate_guard`). Take the semantics from the merged + code. Expect a trivial conflict at the top of the Series-III + reference's changelog table (dev added 2026-10-26 (5)). - a dropped reply via fault injection. It happened for real on 10-25, but that was our checksum bug, not a lossy link; - ~~whether standard (non-5A) requests need the same checksum -- 2.54.1 From b5037b0b1e5aead06ef83397468eced2a4b9f1ad Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 02:54:26 -0400 Subject: [PATCH 116/223] fix(minimateplus): MiniMate config writes are ordinary escaped requests carrying whole blocks; apply_config reads the unit's own trigger block (#46) Measured against every Blastware request on record: the uploaded Feb-Apr 2026 captures (3,869 frames, 3,869 re-encode exactly) and BE9441's two sends on 2026-10-26 (26 write frames). A write is the standard 16-byte request plus its data, every 02/03/04/10 escaped, SUM8 checksum; the length field is the data's length. A config block starts with its own length N and is written as N + 2 bytes: event index (68) and trigger (82) as read plus 02 00 / 00 00 (constant on 15 sends), waveform data (69) and the 2,092-byte compliance image (71) whole. The compliance image goes in addressed chunks (params[2:4] = address): 512 bytes tonight (Blastware 10.74), 1,024 in March. - framing.build_bw_write_frame: uniform escaping, SUM8, length = len(data). RETRACTED: 'only BW_CMD doubled', the 'DLE-aware checksum', 'offset = data[1] + 2' -- fitted to frames still holding their escape bytes ('data 91, offset 90' was 90 bytes and one escape). It got 7 of every 13 frames in a write wrong. - protocol.write_image(): unescapes (callers may pass the parser's form), adds the trailing two bytes to an N-byte block, and REFUSES anything else before a byte is sent -- an edit beside a kept escape byte (the old encoder's anc-9 hazard) leaves an image one byte long. - write_compliance_config_raw: 512-byte addressed chunks, then confirm 72. - read_event_index / read_waveform_data_raw unescape before slicing (a block holding 02/03/04/10 came out short); new read_trigger_config (SUB 0x2E). - apply_config reads the unit's trigger block. RETRACTED: the block 'hardcoded from 3-11-26 -- no read exists'. Blastware reads it; byte 5 has been 01 / 03 / 04 by unit and session, and the March copy (03) would have changed BE9441's (01). - The call-home write (7E) goes through write_image: its 127-byte 'read + 00 00' is the 126-byte image (N = 0x7C). No Blastware 7E is on record here -- that one is inferred from the other 77 write frames. Tests: tonight's 26 and every Feb-Apr write frame rebuilt byte for byte; each block as read written exactly as Blastware wrote it; the parser's form; the stray-byte refusal; the reads against the unit's recorded replies; apply_config writes BE9441's own trigger block. Six mutants, each caught. The old test_write_frames.py (25 tests that had been skipping) runs now that the captures are here, rewritten to the measured model. Not yet sent to a unit: a config push changes settings, so its first live use is a bench session with Brian. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 18 +- minimateplus/framing.py | 109 ++----- minimateplus/protocol.py | 298 ++++++------------ tests/test_minimate_write_frames.py | 249 +++++++++++++++ tests/test_write_frames.py | 464 ++++------------------------ 5 files changed, 436 insertions(+), 702 deletions(-) create mode 100644 tests/test_minimate_write_frames.py diff --git a/minimateplus/client.py b/minimateplus/client.py index 509e944..1269637 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -67,14 +67,11 @@ S3_MONITORING_FLAGS = frozenset({0x10, 0x0B}) # ── Module-level constants ──────────────────────────────────────────────────── -# Trigger config payload hardcoded from 3-11-26 BW TX capture (BW frame 108). -# No SUB 0x22 read exists in the capture — Blastware writes this fixed blob. -# 29 bytes: [00][1A][D5][00][00][10][03][08][0A] + 18×FF + [00][00] -_TRIGGER_DATA_HARDCODED: bytes = bytes.fromhex( - "001ad500001003080a" - "ffffffffffffffffffffffffffffffffffffff" - "0000" -) +# ⚠ RETRACTED 2026-10-27 (#46): a trigger block "hardcoded from 3-11-26 -- no +# read exists, Blastware writes this fixed blob". Blastware reads it first (SUB +# 0x2E), and its byte 5 differs by unit and session (01 / 03 / 04 on record), so +# the copy changed that setting on any unit that differed. apply_config reads +# the unit's own block (MiniMateProtocol.read_trigger_config). # Compliance ASCII slot format (confirmed from 3-11-26 capture + label search): # Each label occupies a 64-byte slot. @@ -1037,7 +1034,7 @@ class MiniMateClient: Write payloads: event_index_data : 88 bytes — read live via SUB 08 compliance_data : ~2128 bytes — read live via SUB 1A (~2126 bytes, varies ±1-2) + \\x00\\x00 footer - trigger_data : 29 bytes — hardcoded from 3-11-26 capture + trigger_data : 26 bytes — read live via SUB 2E (was hard-coded; #46) waveform_data : 204 bytes — read live via SUB 09 Raises: @@ -1057,7 +1054,8 @@ class MiniMateClient: log.info("apply_config: reading waveform data (SUB 09)") waveform_data = proto.read_waveform_data_raw() # 204 bytes - trigger_data = _TRIGGER_DATA_HARDCODED # 29 bytes + log.info("apply_config: reading trigger config (SUB 2E)") + trigger_data = proto.read_trigger_config() # 26 bytes, this unit's own # 2. Patch the compliance buffer and build the 2128-byte write payload compliance_data = _encode_compliance_config( diff --git a/minimateplus/framing.py b/minimateplus/framing.py index 5a29e21..5efa2a9 100644 --- a/minimateplus/framing.py +++ b/minimateplus/framing.py @@ -284,103 +284,34 @@ def build_bw_write_frame( sub: int, data: bytes, *, - offset: int = 0, + offset: Optional[int] = None, params: bytes = bytes(10), ) -> bytes: - """ - Build a BW→S3 write-command frame. + """A write request: the standard 16-byte request followed by `data`, escaped + and checksummed like every other request (s3_stuff, SUM8). - Write frames extend the standard 16-byte read header with a variable-length - data payload. They use a different checksum formula from read frames. + `offset` is the payload's [4:6] field -- the data's LENGTH; it defaults to + len(data), which is what Blastware sends on every write on record. - **CRITICAL: Write frames use minimal DLE stuffing.** + Measured 2026-10-26/27 (issue #46): all of Blastware's requests from February + to October 2026 -- 3,869 frames in the uploaded captures plus BE9441's 26 + write frames tonight -- rebuild byte for byte this way, the 77 write frames + that carry data included (event index 68, compliance 71, trigger 82, waveform + data 69). - Unlike read frames (build_bw_frame), write frames do NOT apply full DLE - stuffing to the payload. Only the BW_CMD byte (0x10) at position [0] is - doubled to 0x10 0x10 on the wire. All other bytes — flags, sub, offset, - params, data, and checksum — are written RAW with no stuffing, even if they - contain 0x10 bytes (e.g. offset_hi=0x10 for compliance chunks, or 0x10 - bytes in the write data payload). - - Confirmed from 3-11-26 BW TX capture (frames 102–112): all 11 write frames - match the rule "double BW_CMD only; everything else raw." ✅ 2026-04-07. - - Wire layout: - [41] ACK - [02] STX - [10 10] BW_CMD doubled (the ONLY DLE stuffing applied) - [00] flags - [sub] write command byte (0x68–0x83) - [00] always zero - [hi][lo] offset as uint16 BE (raw; NOT stuffed even if hi=0x10) - [params] 10 bytes (raw) - [data] variable-length write payload (raw; NOT stuffed) - [chk] checksum byte (raw; NOT stuffed even if 0x10) - [03] ETX - - De-stuffed payload (for checksum computation): - [0] BW_CMD 0x10 - [1] flags 0x00 - [2] SUB write command byte - [3] 0x00 always zero - [4] offset_hi - [5] offset_lo - [6:16] params 10 bytes - [16:] data write payload - [-1] chk - - **Checksum formula (confirmed 2026-03-12 from 3-11-26 BW TX capture):** - chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) % 256 - where payload = destuffed content BEFORE appending chk. - This skips all 0x10 bytes in payload[2:] (sub onwards), including any - 0x10 bytes in the offset, params, data, and the checksum byte itself. - - The offset field [4:6] meaning per write SUB: - - SUBs 68, 69, 82 (single-chunk writes): offset = data[1] + 2, where - data[1] is an embedded length field in the write payload. - Confirmed from capture: 68→0x5A (data[1]=0x58+2), 82→0x1C - (data[1]=0x1A+2), 69→0xCA (data[1]=0xC8+2). - - SUB 71 (multi-chunk compliance): 0x1004 for full chunks, 0x002C - for the final partial chunk. - - Confirm frames (72, 73, 74, 83): offset=0, no data. - - Args: - sub: Write command SUB byte. - data: Write payload (variable length; empty for confirm frames). - offset: 16-bit value placed at [4:6]. See per-SUB notes above. - params: 10 bytes placed at [6:16]. All-zero for most writes; compliance - chunk writes use chunk-specific values. - - Returns: - Complete frame bytes ready to write to the transport. + ⚠ RETRACTED: "only BW_CMD is doubled, everything else raw" and the "DLE-aware + checksum" `(sum of payload[2:] skipping 0x10) + 0x10`. That model rebuilt the + March frames only because it was fitted to data that still held its escape + bytes; the "data length 91, offset 90" it explained was 90 bytes plus one + escape. It got 7 of every 13 frames in a config write wrong. """ if len(params) != 10: raise ValueError(f"params must be exactly 10 bytes, got {len(params)}") - if offset > 0xFFFF: - raise ValueError(f"offset must fit in uint16, got {offset:#06x}") - - offset_hi = (offset >> 8) & 0xFF - offset_lo = offset & 0xFF - - # Destuffed payload (used only for checksum; not sent directly) - payload_no_chk = bytes([BW_CMD, 0x00, sub, 0x00, offset_hi, offset_lo]) + params + data - - # Large-frame checksum: sum payload[2:] skipping all 0x10 bytes, add 0x10. - # Applied to the destuffed representation — confirms correctly against - # all 11 write frames in the 3-11-26/170151 BW TX capture. ✅ - chk = (sum(b for b in payload_no_chk[2:] if b != 0x10) + 0x10) & 0xFF - - # Wire construction: only BW_CMD is doubled; everything else is raw. - # Do NOT use dle_stuff() here — that would incorrectly double 0x10 bytes - # in the offset, params, and data sections. - wire = ( - bytes([ACK, STX]) # Frame prefix (not part of payload) - + bytes([BW_CMD, BW_CMD]) # BW_CMD doubled (only DLE stuffing applied) - + payload_no_chk[1:] # flags, sub, offset, params, data — RAW - + bytes([chk]) # checksum — RAW - + bytes([ETX]) # Frame terminator - ) - return wire + length = len(data) if offset is None else offset + if not 0 <= length <= 0xFFFF: + raise ValueError(f"length must fit in 16 bits, got {length:#x}") + payload = bytes([BW_CMD, 0x00, sub, 0x00, (length >> 8) & 0xFF, length & 0xFF]) + params + data + return bytes([ACK, STX]) + s3_stuff(payload + bytes([checksum(payload)])) + bytes([ETX]) def waveform_key_params(key4: bytes) -> bytes: diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 0d2e43d..4766a29 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -33,6 +33,7 @@ from .framing import ( waveform_key_params, token_params, parse_strt_end_key, + unescape_reply, build_5a_request, POLL_PROBE, POLL_DATA, @@ -130,6 +131,40 @@ _BULK_COUNTER_STEP = 0x0200 # bytes per chunk read, and the step between addre # claim past this is a misread STRT, refused before walking megabytes of garbage. _BULK_MAX_EVENT_BYTES = 0x400000 # 4 MiB +# Config writes (issue #46, measured on every Blastware write since February 2026). +_COMPLIANCE_CHUNK = 0x0200 +# The two bytes after a block's N header bytes, when the read returned only N: +# Blastware's own, constant on record -- event index 02 00, trigger 00 00. The +# unit evidently does not check them (they are no CRC, and the compliance +# image's went out stale, unchanged across two different sends). +_WRITE_TAIL = {SUB_EVENT_INDEX_WRITE: b"\x02\x00", SUB_TRIGGER_CONFIG_WRITE: b"\x00\x00", + SUB_WAVEFORM_DATA_WRITE: b"\x00\x00", SUB_COMPLIANCE_WRITE: b"\x00\x00", + SUB_CALL_HOME_WRITE: b"\x00\x00"} + + +def write_image(sub: int, data: bytes) -> bytes: + """The whole block a write sends: `data` unescaped, N + 2 bytes. + + A config block starts with its own length N (uint16 BE) and is written as N + bytes plus two -- on every Blastware write on record. `data` may be the + block as a read returned it (N bytes, or N + 2) and may still hold the + parser's kept escape bytes (10 02 / 10 03 / 10 04), which come out here. + Anything else is refused before a byte is sent: a block one byte longer than + its header says is what an edit beside a kept escape byte leaves behind. + """ + image = unescape_reply(bytes(data)) + if len(image) < 2: + raise ValueError(f"write SUB 0x{sub:02X}: {len(image)} bytes is not a whole block") + n = int.from_bytes(image[:2], "big") + if len(image) == n: + image += _WRITE_TAIL[sub] + elif len(image) != n + 2: + raise ValueError( + f"write SUB 0x{sub:02X}: {len(image)} bytes, but its header says {n} (+ 2) -- " + "not a whole block (a stray byte?); nothing sent") + return image + + # Default timeout values (seconds). # MiniMate Plus is a slow device — keep these generous. DEFAULT_RECV_TIMEOUT = 10.0 @@ -383,7 +418,9 @@ class MiniMateProtocol: self._send(build_bw_frame(SUB_EVENT_INDEX, length)) data_rsp = self._recv_one(expected_sub=rsp_sub) - raw = data_rsp.data[11 : 11 + length] + # Unescaped first (2026-10-27): a 02/03/04 inside the block arrives as + # 10 0X and the parser keeps both, so a slice by length came up short. + raw = unescape_reply(data_rsp.data)[11 : 11 + length] log.debug("read_event_index: got %d bytes", len(raw)) return raw @@ -515,7 +552,7 @@ class MiniMateProtocol: self._send(build_bw_frame(SUB_WAVEFORM_DATA, length)) data_rsp = self._recv_one(expected_sub=rsp_sub) - raw = data_rsp.data[11:] + raw = unescape_reply(data_rsp.data)[11:] # unescaped, as read_event_index log.debug("read_waveform_data_raw: got %d bytes", len(raw)) return raw @@ -1013,208 +1050,66 @@ class MiniMateProtocol: self._send(frame) return self.recv_write_ack(expected_sub=rsp_sub) - def write_event_index(self, data: bytes) -> S3Frame: - """ - Send a SUB 68 (EVENT_INDEX_WRITE) frame and await the confirm ack (SUB 97). - - Offset formula: data[1] + 2 — confirmed from 3-11-26 BW TX capture frame 102. - The write payload has a 2-byte header [0x00][length] where data[1] encodes - the length of the meaningful payload; offset = data[1] + 2. - - Example from capture: - data[0:4] = 00 58 09 00 (data[1]=0x58=88 → offset=0x5A=90) - data length = 91, offset = 90 - - Write sequence fragment: - 68 (data) → device acks with SUB 0x97 - 73 (confirm) → device acks with SUB 0x8C - - Callers should call write_confirm(SUB_WRITE_CONFIRM_B) after this. - - Args: - data: Raw event-index payload bytes to write to the device. - Must be at least 2 bytes. data[1] must contain the length field. - - Returns: - The SUB 0x97 ack frame. - - Raises: - ProtocolError: on timeout or wrong response SUB. - ValueError: if data is shorter than 2 bytes. - """ - if len(data) < 2: - raise ValueError(f"event index write data must be at least 2 bytes, got {len(data)}") - rsp_sub = _expected_rsp_sub(SUB_EVENT_INDEX_WRITE) # 0xFF - 0x68 = 0x97 - offset = data[1] + 2 - frame = build_bw_write_frame(SUB_EVENT_INDEX_WRITE, data, offset=offset) - log.debug( - "write_event_index: %d bytes data[1]=0x%02X offset=0x%04X rsp_sub=0x%02X", - len(data), data[1], offset, rsp_sub, - ) + def _write_block(self, sub: int, data: bytes, params: bytes = bytes(10)) -> S3Frame: + """Send one config block as a write and return its ack (0xFF - sub).""" + image = write_image(sub, data) + frame = build_bw_write_frame(sub, image, params=params) + log.debug("write SUB=0x%02X: %d-byte image", sub, len(image)) self._send(frame) - return self.recv_write_ack(expected_sub=rsp_sub) + return self.recv_write_ack(expected_sub=_expected_rsp_sub(sub)) + + def write_event_index(self, data: bytes) -> S3Frame: + """SUB 68: write the event-index block (as SUB 08 read it). Ack 0x97; + callers follow with write_confirm(SUB_WRITE_CONFIRM_B). See write_image.""" + return self._write_block(SUB_EVENT_INDEX_WRITE, data) def write_waveform_data(self, data: bytes) -> S3Frame: - """ - Send a SUB 69 (WAVEFORM_DATA_WRITE) frame and await the confirm ack (SUB 96). - - Offset formula: data[1] + 2 — same pattern as write_event_index(). - Confirmed from 3-11-26 BW TX capture frame 110: - data[0:4] = 00 c8 08 00 (data[1]=0xC8=200 → offset=0xCA=202) - data length = 204, offset = 202 - - Write sequence fragment: - 69 (data) → device acks with SUB 0x96 - 74 (confirm) → device acks with SUB 0x8B - 72 (confirm) → device acks with SUB 0x8D - - Callers should call write_confirm(SUB_WRITE_CONFIRM_C) then - write_confirm(SUB_WRITE_CONFIRM_A) after this. - - Args: - data: Raw waveform-data payload bytes to write. - Must be at least 2 bytes. data[1] must contain the length field. - - Returns: - The SUB 0x96 ack frame. - - Raises: - ProtocolError: on timeout or wrong response SUB. - ValueError: if data is shorter than 2 bytes. - """ - if len(data) < 2: - raise ValueError(f"waveform data write payload must be at least 2 bytes, got {len(data)}") - rsp_sub = _expected_rsp_sub(SUB_WAVEFORM_DATA_WRITE) # 0xFF - 0x69 = 0x96 - offset = data[1] + 2 - frame = build_bw_write_frame(SUB_WAVEFORM_DATA_WRITE, data, offset=offset) - log.debug( - "write_waveform_data: %d bytes data[1]=0x%02X offset=0x%04X rsp_sub=0x%02X", - len(data), data[1], offset, rsp_sub, - ) - self._send(frame) - return self.recv_write_ack(expected_sub=rsp_sub) + """SUB 69: write the waveform-data block (as SUB 09 read it). Ack 0x96; + callers follow with write_confirm C then A. See write_image.""" + return self._write_block(SUB_WAVEFORM_DATA_WRITE, data) def write_compliance_config_raw(self, data: bytes) -> None: + """SUB 71: write the compliance image in addressed chunks, then confirm (72). + + Measured: the image is 2,092 bytes (its header N = 2,090, plus 2), sent as + 512-byte chunks with the chunk's address at params[2:4] -- 0x0000, 0x0200, + 0x0400, 0x0600, then the 44-byte rest at 0x0800 -- each acked 0x8E, then + SUB 72 (ack 0x8D). Blastware 10.74 on BE9441 (2026-10-26), byte for byte. + March 2026's Blastware sent 1,024-byte chunks the same way; the units took + both. (Retracted: "exactly 3 chunks, offset 0x1004, params 00 00 00 10 04" + -- the length 0x0400 and address 0x0400, read with their escape bytes.) """ - Send the SUB 71 (COMPLIANCE_WRITE) 3-chunk sequence and final confirm. - - The full compliance config payload (~2128 bytes) is split into exactly 3 - chunks with hardcoded boundaries and params confirmed from the 3-11-26 BW - TX capture (frames 104–108): - - Chunk 1 — first 1027 bytes: - offset=0x1004 params=bytes(10) - device acks SUB 0x8E - - Chunk 2 — next 1055 bytes: - offset=0x1004 params=b'\\x00\\x00\\x00\\x00\\x10\\x04' + b'\\x00'*4 - device acks SUB 0x8E - - Chunk 3 — remaining bytes: - offset=0x002C params=b'\\x00\\x00\\x08' + b'\\x00'*7 - device acks SUB 0x8E - - Confirm — SUB 72 (zero data): - device acks SUB 0x8D - - The total write payload should be at least 1027+1055=2082 bytes; chunk 3 - carries everything after offset 2082 (typically ~46 bytes for a 2128-byte - config). - - Args: - data: Raw compliance config bytes to write. Must be at least 2082 bytes. - - Raises: - ValueError: if data is too short to fill chunks 1 and 2. - ProtocolError: on timeout or wrong response SUB from any chunk. - """ - _CHUNK1_SIZE = 1027 - _CHUNK2_SIZE = 1055 - _CHUNK1_OFFSET = 0x1004 - _CHUNK2_OFFSET = 0x1004 - _CHUNK3_OFFSET = 0x002C - - _CHUNK1_PARAMS = bytes(10) - _CHUNK2_PARAMS = bytes([0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00]) - _CHUNK3_PARAMS = bytes([0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) - - min_size = _CHUNK1_SIZE + _CHUNK2_SIZE - if len(data) < min_size: - raise ValueError( - f"Compliance write data too short: {len(data)} bytes, " - f"need at least {min_size} (chunk1={_CHUNK1_SIZE} + chunk2={_CHUNK2_SIZE})" - ) - - rsp_sub = _expected_rsp_sub(SUB_COMPLIANCE_WRITE) # 0xFF - 0x71 = 0x8E - - chunk1 = data[:_CHUNK1_SIZE] - chunk2 = data[_CHUNK1_SIZE : _CHUNK1_SIZE + _CHUNK2_SIZE] - chunk3 = data[_CHUNK1_SIZE + _CHUNK2_SIZE :] - - chunks = [ - (1, chunk1, _CHUNK1_OFFSET, _CHUNK1_PARAMS), - (2, chunk2, _CHUNK2_OFFSET, _CHUNK2_PARAMS), - (3, chunk3, _CHUNK3_OFFSET, _CHUNK3_PARAMS), - ] - - for chunk_num, chunk_data, chunk_offset, chunk_params in chunks: - frame = build_bw_write_frame( - SUB_COMPLIANCE_WRITE, - chunk_data, - offset=chunk_offset, - params=chunk_params, - ) - log.debug( - "write_compliance_config_raw: chunk %d %d bytes " - "offset=0x%04X params=%s", - chunk_num, len(chunk_data), chunk_offset, chunk_params.hex(), - ) + image = write_image(SUB_COMPLIANCE_WRITE, data) + rsp_sub = _expected_rsp_sub(SUB_COMPLIANCE_WRITE) + for addr in range(0, len(image), _COMPLIANCE_CHUNK): + params = bytes([0x00, 0x00, (addr >> 8) & 0xFF, addr & 0xFF]) + bytes(6) + frame = build_bw_write_frame(SUB_COMPLIANCE_WRITE, + image[addr:addr + _COMPLIANCE_CHUNK], params=params) + log.debug("write_compliance_config_raw: chunk at 0x%04X", addr) self._send(frame) self.recv_write_ack(expected_sub=rsp_sub) - log.debug("write_compliance_config_raw: chunk %d acked", chunk_num) - - # Final confirm (SUB 72) - log.debug("write_compliance_config_raw: sending confirm (SUB 0x72)") self.write_confirm(SUB_WRITE_CONFIRM_A) - log.debug("write_compliance_config_raw: done") def write_trigger_config(self, data: bytes) -> S3Frame: + """SUB 82: write the trigger block (as SUB 0x2E read it). Ack 0x7D; + callers follow with write_confirm(SUB_TRIGGER_CONFIRM). See write_image.""" + return self._write_block(SUB_TRIGGER_CONFIG_WRITE, data) + + def read_trigger_config(self) -> bytes: + """SUB 0x2E two-step read: the 26-byte trigger block that SUB 82 writes. + + Blastware reads it before writing it (BE9441, 2026-10-26). Its byte 5 + differs by unit and session (01 / 03 / 04 on record) -- so a block copied + from another unit, as apply_config once wrote, changes a setting. + Returns the block unescaped (data[11:] after unescape_reply). """ - Send a SUB 82 (TRIGGER_CONFIG_WRITE) frame and await the confirm ack (SUB 7D). - - Offset formula: data[1] + 2 — same pattern as write_event_index(). - Confirmed from 3-11-26 BW TX capture frame 108: - data[0:4] = 00 1a d5 00 (data[1]=0x1A=26 → offset=0x1C=28) - data length = 29, offset = 28 - - Write sequence fragment: - 82 (data) → device acks with SUB 0x7D - 83 (confirm) → device acks with SUB 0x7C - - Callers should call write_confirm(SUB_TRIGGER_CONFIRM) after this. - - Args: - data: Raw trigger-config payload bytes to write. - Must be at least 2 bytes. data[1] must contain the length field. - - Returns: - The SUB 0x7D ack frame. - - Raises: - ProtocolError: on timeout or wrong response SUB. - ValueError: if data is shorter than 2 bytes. - """ - if len(data) < 2: - raise ValueError(f"trigger config write payload must be at least 2 bytes, got {len(data)}") - rsp_sub = _expected_rsp_sub(SUB_TRIGGER_CONFIG_WRITE) # 0xFF - 0x82 = 0x7D - offset = data[1] + 2 - frame = build_bw_write_frame(SUB_TRIGGER_CONFIG_WRITE, data, offset=offset) - log.debug( - "write_trigger_config: %d bytes data[1]=0x%02X offset=0x%04X rsp_sub=0x%02X", - len(data), data[1], offset, rsp_sub, - ) - self._send(frame) - return self.recv_write_ack(expected_sub=rsp_sub) + rsp_sub = _expected_rsp_sub(SUB_UNKNOWN_2E) + length = DATA_LENGTHS[SUB_UNKNOWN_2E] + self._send(build_bw_frame(SUB_UNKNOWN_2E, 0)) + self._recv_one(expected_sub=rsp_sub) + self._send(build_bw_frame(SUB_UNKNOWN_2E, length)) + data_rsp = self._recv_one(expected_sub=rsp_sub) + return unescape_reply(data_rsp.data)[11:11 + length] # ── Call home config (SUBs 0x2C / 0x7E / 0x7F) ────────────────────────── @@ -1278,20 +1173,13 @@ class MiniMateProtocol: ValueError: if data is not exactly 127 bytes or lacks expected header. ProtocolError: on timeout or wrong response SUB. """ - if len(data) < 2: - raise ValueError(f"call home write payload must be at least 2 bytes, got {len(data)}") - rsp_sub_write = _expected_rsp_sub(SUB_CALL_HOME_WRITE) # 0xFF - 0x7E = 0x81 rsp_sub_confirm = _expected_rsp_sub(SUB_CALL_HOME_CONFIRM) # 0xFF - 0x7F = 0x80 - - # Offset formula: data[1] + 2 (same pattern as other single-chunk writes) - offset = data[1] + 2 # 0x7C + 2 = 0x7E = 126 - frame = build_bw_write_frame(SUB_CALL_HOME_WRITE, data, offset=offset) - log.debug( - "write_call_home_config: %d bytes data[1]=0x%02X offset=0x%04X", - len(data), data[1], offset, - ) - self._send(frame) - self.recv_write_ack(expected_sub=rsp_sub_write) + # 2026-10-27 (#46): the read payload holds the parser's kept escape bytes + # (num_retries 3 arrives as 10 03); write_image removes them, so the + # 127-byte "read + 00 00" goes out as its 126-byte image (N = 0x7C, + 2), + # escaped like every request. No Blastware call-home write is on record + # here to compare against -- inferred from the 77 other write frames. + self._write_block(SUB_CALL_HOME_WRITE, data) log.debug("write_call_home_config: write acked; sending confirm 0x7F") confirm_frame = build_bw_write_frame(SUB_CALL_HOME_CONFIRM, b"") diff --git a/tests/test_minimate_write_frames.py b/tests/test_minimate_write_frames.py new file mode 100644 index 0000000..4f5997b --- /dev/null +++ b/tests/test_minimate_write_frames.py @@ -0,0 +1,249 @@ +"""MiniMate config writes, against Blastware's own (issue #46). + +Measured 2026-10-26/27: every Blastware request on record -- 3,869 frames from +February to April 2026 plus tonight's -- is the standard 16-byte payload with a +SUM8 checksum and every 02/03/04/10 escaped, write frames included (77 carrying +data). A write's length field is its data's length, and each block is written as +read plus two trailing bytes: event index (68) `02 00`, trigger (82) `00 00`, the +2,092-byte compliance image (71) in addressed chunks. The old builder ("raw +except BW_CMD", "DLE-aware checksum") got 7 of every 13 frames wrong, and +apply_config wrote a trigger block hard-coded from March whose byte 5 differs by +unit and session (01 / 03 / 04). +""" +from __future__ import annotations + +import glob +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.protocol as mp # noqa: E402 +from minimateplus.framing import S3FrameParser, build_bw_write_frame, unescape_reply # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram" +CAPTURES = Path(__file__).parent.parent / "bridges" / "captures" + + +def _unstuff(b: bytes) -> bytes: + out, k = bytearray(), 0 + while k < len(b): + if b[k] == 0x10 and k + 1 < len(b): + out.append(b[k + 1]); k += 2 + else: + out.append(b[k]); k += 1 + return bytes(out) + + +def _frames(raw: bytes) -> list: + out, i = [], 0 + while i < len(raw): + if raw[i:i + 2] == b"\x41\x03": + i += 2 + continue + if raw[i:i + 2] != b"\x41\x02": + i += 1 + continue + j = i + 2 + while j < len(raw) and raw[j] != 0x03: + j += 2 if raw[j] == 0x10 else 1 + out.append(raw[i:j + 1]) + i = j + 1 + return out + + +def _payload(frame: bytes) -> bytes: + return _unstuff(frame[2:-1])[:-1] + + +REQS = _frames((FIX / "requests.bin").read_bytes()) +WRITES = [f for f in REQS if 0x68 <= _payload(f)[2] <= 0x83] +SEND2 = WRITES[13:26] # 16:27:21, the interval back to 2 s + + +def _image(sub: int) -> bytes: + return b"".join(_payload(f)[16:] for f in SEND2 if _payload(f)[2] == sub) + + +def test_the_fixture_holds_two_whole_sends(): + assert [f"{_payload(f)[2]:02X}" for f in SEND2] == \ + ["68", "73", "71", "71", "71", "71", "71", "72", "82", "83", "69", "74", "72"] + + +def _rebuilds(frames: list) -> bool: + for f in frames: + p = _payload(f) + if build_bw_write_frame(p[2], p[16:], params=p[6:16]) != f: + return False + return True + + +def test_every_write_frame_tonight_is_rebuilt_byte_for_byte(): + assert len(WRITES) == 26 and _rebuilds(WRITES) + + +_OLD = sorted(glob.glob(str(CAPTURES / "[234]-*" / "**" / "raw_bw*.bin"), recursive=True)) + + +@pytest.mark.skipif(not _OLD, reason="the Feb-Apr 2026 Blastware captures are not on this box") +def test_every_write_frame_since_february_is_rebuilt_byte_for_byte(): + frames = [f for path in _OLD for f in _frames(Path(path).read_bytes()) + if 0x68 <= _payload(f)[2] <= 0x83] + assert len([f for f in frames if len(_payload(f)) > 16]) >= 48 + assert _rebuilds(frames) + + +# -- the protocol: images in, Blastware's frames out --------------------------- + +def _ack(write_sub: int) -> bytes: + raw, start, p = (FIX / "unit_replies.bin").read_bytes(), 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + w = raw[start:i + 1] + if f.sub == (0xFF - write_sub) & 0xFF: + return w[w.index(b"\x10\x02"):] + start = i + 1 + raise AssertionError(f"no ack for 0x{write_sub:02X}") + + +class Acks: + """Answers every write request with the unit's recorded ack for its SUB.""" + + def __init__(self): + self.sent, self._buf = [], b"" + + def write(self, data): + data = bytes(data) + self.sent.append(data) + self._buf += _ack(_payload(data)[2]) + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +def _proto(): + t = Acks() + return mp.MiniMateProtocol(t), t + + +def test_the_event_index_block_as_read_is_written_as_blastware_wrote_it(): + p, t = _proto() + block = _image(0x68)[:-2] # the 88 bytes 0x08 returns + p.write_event_index(block) + assert t.sent == [f for f in SEND2 if _payload(f)[2] == 0x68] + + +def test_the_trigger_block_as_read_is_written_as_blastware_wrote_it(): + p, t = _proto() + p.write_trigger_config(_image(0x82)[:-2]) # the 26 bytes 0x2E returns + assert t.sent == [f for f in SEND2 if _payload(f)[2] == 0x82] + + +def test_the_compliance_image_goes_in_blastwares_chunks_then_the_confirm(): + p, t = _proto() + p.write_compliance_config_raw(_image(0x71)) + want = [f for f in SEND2 if _payload(f)[2] == 0x71] + assert t.sent[:-1] == want + assert _payload(t.sent[-1])[2] == 0x72 + + +def test_the_waveform_data_block_is_written_as_given(): + p, t = _proto() + p.write_waveform_data(_image(0x69)) + assert t.sent == [f for f in SEND2 if _payload(f)[2] == 0x69] + + +def test_an_image_in_the_parsers_form_is_unescaped_first(): + # what a read hands over: the parser keeps the 10 of 10 02/03/04 + p, t = _proto() + img = _image(0x71) + parser_form = img.replace(b"\x03", b"\x10\x03").replace(b"\x04", b"\x10\x04") + assert unescape_reply(parser_form) == img and parser_form != img + p.write_compliance_config_raw(parser_form) + assert t.sent[:-1] == [f for f in SEND2 if _payload(f)[2] == 0x71] + + +def test_a_stray_byte_is_refused_before_anything_is_sent(): + # the encoder's old hazard: a value changed beside a kept escape byte leaves a + # lone 10 behind -- the image is then one byte longer than its header says + p, t = _proto() + img = _image(0x71) + with pytest.raises(ValueError, match="not a whole block"): + p.write_compliance_config_raw(img[:6] + b"\x10" + img[6:]) + assert t.sent == [] + + +class Replies: + """Answers each request with the unit's next recorded reply of the right SUB.""" + + def __init__(self): + raw, start, p = (FIX / "unit_replies.bin").read_bytes(), 0, S3FrameParser() + self.by_sub, self.sent, self._buf = {}, [], b"" + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + w = raw[start:i + 1] + self.by_sub.setdefault(f.sub, []).append(w[w.index(b"\x10\x02"):]) + start = i + 1 + + def write(self, data): + data = bytes(data) + self.sent.append(data) + self._buf += self.by_sub[(0xFF - _payload(data)[2]) & 0xFF].pop(0) + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +@pytest.mark.parametrize("read,sub,size", [("read_event_index", 0x68, 88), + ("read_trigger_config", 0x82, 26), + ("read_waveform_data_raw", 0x69, 202)]) +def test_each_read_returns_the_block_blastware_then_wrote(read, sub, size): + """A 02/03/04/10 inside a block arrives escaped; a slice of the parser's output + by length came up short. The reads return the unescaped block -- the bytes + Blastware wrote back (the waveform-data read includes its 2 trailing bytes, + which Blastware replaced).""" + block = getattr(mp.MiniMateProtocol(Replies()), read)() + assert len(block) == size + want = _image(sub) + assert block[:-2] == want[:-2] if sub == 0x69 else block == want[:-2] + + +# -- apply_config writes this unit's own trigger block --------------------------- + +class StubProto: + """Serves BE9441's blocks as read on 2026-10-26; records every write.""" + + def __init__(self): + self.writes = [] + + def read_event_index(self): + return _image(0x68)[:-2] + + def read_compliance_config(self): + return _image(0x71)[:-2] + + def read_waveform_data_raw(self): + return _image(0x69) + + def read_trigger_config(self): + return _image(0x82)[:-2] + + def __getattr__(self, name): + if name.startswith("write_"): + return lambda *a, **k: self.writes.append((name, a)) + raise AttributeError(name) + + +def test_apply_config_writes_the_units_own_trigger_block(): + from minimateplus.client import MiniMateClient + c = MiniMateClient(transport=object()) + c._proto = StubProto() + c.apply_config() # nothing changed: a round trip + trig = [a[0] for n, a in c._proto.writes if n == "write_trigger_config"] + assert trig == [_image(0x82)[:-2]] + assert trig[0][5] == 0x01 # BE9441's; the March copy had 0x03 diff --git a/tests/test_write_frames.py b/tests/test_write_frames.py index a1efc5a..f7e4a24 100644 --- a/tests/test_write_frames.py +++ b/tests/test_write_frames.py @@ -1,26 +1,19 @@ """ -test_write_frames.py — Verify write frame construction against BW capture. +test_write_frames.py — the 3-11-26/170151 Blastware config write, read correctly. -Validates that build_bw_write_frame() reproduces the exact wire bytes that -Blastware sent during the 3-11-26/170151 compliance-config write session. +Frames 102–112 of raw_bw_20260311_170151.bin: 68, 73, 71×3, 72, 82, 83, 69, 74, 72. -Frames tested (BW TX frame indices 102–112): - 102 — SUB 0x68 event index write - 103 — SUB 0x73 confirm B - 104 — SUB 0x71 compliance write chunk 1 - 105 — SUB 0x71 compliance write chunk 2 - 106 — SUB 0x71 compliance write chunk 3 - 107 — SUB 0x72 confirm A - 108 — SUB 0x82 trigger config write - 109 — SUB 0x83 trigger confirm - 110 — SUB 0x69 waveform data write - 111 — SUB 0x74 confirm C - 112 — SUB 0x72 confirm A (end of sequence) +⚠ REWRITTEN 2026-10-27 (#46). This file pinned a model of these frames that was +wrong: "only BW_CMD is doubled", a "DLE-aware checksum", compliance chunks of +1,027 / 1,055 bytes at "offset 0x1004", single-block "offset = data[1] + 2". +Every one of those read the frames with their escape bytes still in. Decoded +as every Blastware request decodes (each 02/03/04/10 escaped, SUM8 of the +payload), these frames are ordinary requests: a LENGTH at [4:6] equal to the +data's length, the compliance image in 1,024-byte chunks addressed by +params[2:4], and blocks of N + 2 bytes. tests/test_minimate_write_frames.py +covers every write on record, tonight's 26 frames included. -Run: - python -m pytest tests/test_write_frames.py -v -or: - python tests/test_write_frames.py +Skips when the capture is absent. """ from __future__ import annotations @@ -30,407 +23,82 @@ import sys import pytest -# Allow running from the project root without installation sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from minimateplus.framing import build_bw_write_frame - - -# ── Capture loading ──────────────────────────────────────────────────────────── +from minimateplus.framing import build_bw_write_frame, checksum CAPTURE_PATH = os.path.join( - os.path.dirname(__file__), - "..", - "bridges", - "captures", - "3-11-26", - "raw_bw_20260311_170151.bin", + os.path.dirname(__file__), "..", "bridges", "captures", "3-11-26", "raw_bw_20260311_170151.bin", ) -def _load_bw_frames(path: str) -> list[bytes]: - """ - Parse a raw BW capture file into a list of BW frames. - - BW frames start with ACK=0x41 followed by STX=0x02. The frame boundary is - the position of the NEXT 0x41 0x02 sequence (the ETX=0x03 terminator is the - last byte before the next frame start). - - NOTE: A naive scan for ETX=0x03 fails because 0x03 can appear inside the - DLE-stuffed payload. This parser uses consecutive 0x41 0x02 starts as - boundaries, which is safe because the ACK byte (0x41) is never DLE-stuffed. - """ - with open(path, "rb") as f: - raw = f.read() - - boundaries: list[int] = [] - i = 0 - while i < len(raw) - 1: - if raw[i] == 0x41 and raw[i + 1] == 0x02: - boundaries.append(i) - i += 1 - boundaries.append(len(raw)) - - frames = [] - for k in range(len(boundaries) - 1): - frames.append(raw[boundaries[k] : boundaries[k + 1]]) - return frames - - -def _destuff(data: bytes) -> bytes: - """Undo DLE stuffing: replace every 0x10 0x10 pair with a single 0x10.""" - result = bytearray() - k = 0 - while k < len(data): - if data[k] == 0x10 and k + 1 < len(data) and data[k + 1] == 0x10: - result.append(0x10) - k += 2 +def _unstuff(b: bytes) -> bytes: + out, k = bytearray(), 0 + while k < len(b): + if b[k] == 0x10 and k + 1 < len(b): + out.append(b[k + 1]); k += 2 else: - result.append(data[k]) - k += 1 - return bytes(result) + out.append(b[k]); k += 1 + return bytes(out) -def _decode_bw_frame(wire: bytes) -> tuple[int, int, bytes, bytes, int]: - """ - Decode a BW wire frame into its components. +def _frames(raw: bytes) -> list: + out, i = [], 0 + while i < len(raw): + if raw[i:i + 2] == b"\x41\x03": + i += 2 + continue + if raw[i:i + 2] != b"\x41\x02": + i += 1 + continue + j = i + 2 + while j < len(raw) and raw[j] != 0x03: + j += 2 if raw[j] == 0x10 else 1 + out.append(raw[i:j + 1]) + i = j + 1 + return out - Returns: - (sub, offset, params, data, chk) - sub — SUB byte (payload[2]) - offset — uint16 from payload[4:6] - params — 10-byte params field (payload[6:16]) - data — write payload bytes (payload[16:-1]) - chk — checksum byte (payload[-1]) - """ - inner = wire[2:-1] # strip ACK+STX and trailing ETX - payload = _destuff(inner) - sub = payload[2] - offset = (payload[4] << 8) | payload[5] - params = payload[6:16] - data = payload[16:-1] - chk = payload[-1] - return sub, offset, params, data, chk - - -# ── Test fixtures ────────────────────────────────────────────────────────────── @pytest.fixture(scope="module") -def bw_frames() -> list[bytes]: +def writes() -> list: if not os.path.exists(CAPTURE_PATH): pytest.skip(f"Capture file not found: {CAPTURE_PATH}") - return _load_bw_frames(CAPTURE_PATH) + frames = _frames(open(CAPTURE_PATH, "rb").read()) + w = [f for f in frames if 0x68 <= _unstuff(f[2:-1])[2] <= 0x83] + assert [f"{_unstuff(f[2:-1])[2]:02X}" for f in w] == \ + ["68", "73", "71", "71", "71", "72", "82", "83", "69", "74", "72"] + return w -# ── Individual frame tests ───────────────────────────────────────────────────── +def _fields(frame: bytes): + p = _unstuff(frame[2:-1]) + payload, chk = p[:-1], p[-1] + return payload[2], int.from_bytes(payload[4:6], "big"), payload[6:16], payload[16:], chk, payload -class TestWriteFrameReconstruction: - """Verify build_bw_write_frame() reproduces the exact wire bytes from the capture.""" - def test_frame_102_event_index_write_sub68(self, bw_frames: list[bytes]) -> None: - """SUB 0x68 — event index write (frame 102).""" - cap_wire = bw_frames[102] - sub_cap, offset_cap, params_cap, data_cap, chk_cap = _decode_bw_frame(cap_wire) +def test_every_frame_is_an_ordinary_request_with_a_sum8_checksum(writes): + for f in writes: + sub, length, params, data, chk, payload = _fields(f) + assert chk == checksum(payload) + assert build_bw_write_frame(sub, data, params=params) == f - assert sub_cap == 0x68 - assert params_cap == bytes(10) - # Reconstruct using build_bw_write_frame with the same data and offset - built = build_bw_write_frame(0x68, data_cap, offset=offset_cap, params=params_cap) - assert built == cap_wire, ( - f"SUB 0x68 wire mismatch\n" - f" built: {built.hex()}\n" - f" capt: {cap_wire.hex()}" - ) +def test_the_length_field_is_the_datas_length(writes): + for f in writes: + sub, length, params, data, chk, _ = _fields(f) + assert length == len(data) - def test_frame_103_confirm_b_sub73(self, bw_frames: list[bytes]) -> None: - """SUB 0x73 — confirm B (zero-data confirm frame 103).""" - cap_wire = bw_frames[103] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - assert sub_cap == 0x73 - assert data_cap == b"" - assert offset_cap == 0x0000 +def test_single_blocks_are_their_header_plus_two(writes): + for f in writes: + sub, length, params, data, chk, _ = _fields(f) + if sub in (0x68, 0x82, 0x69): + assert len(data) == int.from_bytes(data[:2], "big") + 2 - built = build_bw_write_frame(0x73, b"") - assert built == cap_wire - def test_frame_104_compliance_chunk1_sub71(self, bw_frames: list[bytes]) -> None: - """SUB 0x71 chunk 1 — 1027-byte compliance write (frame 104).""" - cap_wire = bw_frames[104] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x71 - assert offset_cap == 0x1004 - assert params_cap == bytes(10) - assert len(data_cap) == 1027 - - built = build_bw_write_frame( - 0x71, data_cap, - offset=0x1004, - params=bytes(10), - ) - assert built == cap_wire - - def test_frame_105_compliance_chunk2_sub71(self, bw_frames: list[bytes]) -> None: - """SUB 0x71 chunk 2 — 1055-byte compliance write (frame 105).""" - cap_wire = bw_frames[105] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - _CHUNK2_PARAMS = bytes([0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00]) - - assert sub_cap == 0x71 - assert offset_cap == 0x1004 - assert params_cap == _CHUNK2_PARAMS - assert len(data_cap) == 1055 - - built = build_bw_write_frame( - 0x71, data_cap, - offset=0x1004, - params=_CHUNK2_PARAMS, - ) - assert built == cap_wire - - def test_frame_106_compliance_chunk3_sub71(self, bw_frames: list[bytes]) -> None: - """SUB 0x71 chunk 3 — 46-byte compliance write (frame 106).""" - cap_wire = bw_frames[106] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - _CHUNK3_PARAMS = bytes([0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) - - assert sub_cap == 0x71 - assert offset_cap == 0x002C - assert params_cap == _CHUNK3_PARAMS - assert len(data_cap) == 46 - - built = build_bw_write_frame( - 0x71, data_cap, - offset=0x002C, - params=_CHUNK3_PARAMS, - ) - assert built == cap_wire - - def test_frame_107_confirm_a_sub72(self, bw_frames: list[bytes]) -> None: - """SUB 0x72 — confirm A after compliance write (frame 107).""" - cap_wire = bw_frames[107] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x72 - assert data_cap == b"" - assert offset_cap == 0x0000 - - built = build_bw_write_frame(0x72, b"") - assert built == cap_wire - - def test_frame_108_trigger_config_write_sub82(self, bw_frames: list[bytes]) -> None: - """SUB 0x82 — trigger config write (frame 108).""" - cap_wire = bw_frames[108] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x82 - assert params_cap == bytes(10) - assert len(data_cap) == 29 - - # Verify offset formula: data[1] + 2 - assert offset_cap == data_cap[1] + 2, ( - f"Trigger write offset formula mismatch: " - f"data[1]={data_cap[1]} → expected {data_cap[1]+2}, got {offset_cap}" - ) - - built = build_bw_write_frame( - 0x82, data_cap, - offset=offset_cap, - params=params_cap, - ) - assert built == cap_wire - - def test_frame_109_trigger_confirm_sub83(self, bw_frames: list[bytes]) -> None: - """SUB 0x83 — trigger confirm (frame 109).""" - cap_wire = bw_frames[109] - sub_cap, _, _, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x83 - assert data_cap == b"" - - built = build_bw_write_frame(0x83, b"") - assert built == cap_wire - - def test_frame_110_waveform_data_write_sub69(self, bw_frames: list[bytes]) -> None: - """SUB 0x69 — waveform data write (frame 110).""" - cap_wire = bw_frames[110] - sub_cap, offset_cap, params_cap, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x69 - assert params_cap == bytes(10) - assert len(data_cap) == 204 - - # Verify offset formula: data[1] + 2 - assert offset_cap == data_cap[1] + 2, ( - f"Waveform write offset formula mismatch: " - f"data[1]={data_cap[1]} → expected {data_cap[1]+2}, got {offset_cap}" - ) - - built = build_bw_write_frame( - 0x69, data_cap, - offset=offset_cap, - params=params_cap, - ) - assert built == cap_wire - - def test_frame_111_confirm_c_sub74(self, bw_frames: list[bytes]) -> None: - """SUB 0x74 — confirm C after waveform data write (frame 111).""" - cap_wire = bw_frames[111] - sub_cap, _, _, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x74 - assert data_cap == b"" - - built = build_bw_write_frame(0x74, b"") - assert built == cap_wire - - def test_frame_112_confirm_a_sub72_end(self, bw_frames: list[bytes]) -> None: - """SUB 0x72 — final confirm A at end of write sequence (frame 112).""" - cap_wire = bw_frames[112] - sub_cap, _, _, data_cap, _ = _decode_bw_frame(cap_wire) - - assert sub_cap == 0x72 - assert data_cap == b"" - - built = build_bw_write_frame(0x72, b"") - assert built == cap_wire - - -class TestOffsetFormula: - """Verify the offset = data[1] + 2 formula for single-chunk write commands.""" - - def test_event_index_offset_formula(self, bw_frames: list[bytes]) -> None: - """Frame 102 (SUB 0x68): offset = data[1] + 2.""" - _, offset_cap, _, data_cap, _ = _decode_bw_frame(bw_frames[102]) - assert offset_cap == data_cap[1] + 2 - - def test_trigger_config_offset_formula(self, bw_frames: list[bytes]) -> None: - """Frame 108 (SUB 0x82): offset = data[1] + 2.""" - _, offset_cap, _, data_cap, _ = _decode_bw_frame(bw_frames[108]) - assert offset_cap == data_cap[1] + 2 - - def test_waveform_data_offset_formula(self, bw_frames: list[bytes]) -> None: - """Frame 110 (SUB 0x69): offset = data[1] + 2.""" - _, offset_cap, _, data_cap, _ = _decode_bw_frame(bw_frames[110]) - assert offset_cap == data_cap[1] + 2 - - -class TestChecksumVerification: - """Verify large-frame DLE-aware checksum for all write frames.""" - - def _verify_checksum(self, wire: bytes, label: str) -> None: - inner = wire[2:-1] - payload = _destuff(inner) - chk = payload[-1] - computed = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF - assert computed == chk, ( - f"{label}: checksum mismatch — computed=0x{computed:02X}, got=0x{chk:02X}" - ) - - def test_all_write_frame_checksums(self, bw_frames: list[bytes]) -> None: - write_frames = { - 102: "SUB 0x68 event index write", - 103: "SUB 0x73 confirm B", - 104: "SUB 0x71 compliance chunk 1", - 105: "SUB 0x71 compliance chunk 2", - 106: "SUB 0x71 compliance chunk 3", - 107: "SUB 0x72 confirm A", - 108: "SUB 0x82 trigger config write", - 109: "SUB 0x83 trigger confirm", - 110: "SUB 0x69 waveform data write", - 111: "SUB 0x74 confirm C", - 112: "SUB 0x72 confirm A (end)", - } - for idx, label in write_frames.items(): - self._verify_checksum(bw_frames[idx], f"Frame {idx} ({label})") - - -class TestComplianceChunkSizes: - """Verify compliance write chunk sizes and sequence.""" - - def test_chunk1_size(self, bw_frames: list[bytes]) -> None: - _, _, _, data, _ = _decode_bw_frame(bw_frames[104]) - assert len(data) == 1027, f"Chunk 1 should be 1027 bytes, got {len(data)}" - - def test_chunk2_size(self, bw_frames: list[bytes]) -> None: - _, _, _, data, _ = _decode_bw_frame(bw_frames[105]) - assert len(data) == 1055, f"Chunk 2 should be 1055 bytes, got {len(data)}" - - def test_chunk3_size(self, bw_frames: list[bytes]) -> None: - _, _, _, data, _ = _decode_bw_frame(bw_frames[106]) - assert len(data) == 46, f"Chunk 3 should be 46 bytes, got {len(data)}" - - def test_total_compliance_data(self, bw_frames: list[bytes]) -> None: - total = sum( - len(_decode_bw_frame(bw_frames[i])[3]) for i in [104, 105, 106] - ) - assert total == 2128, f"Total compliance write data should be 2128 bytes, got {total}" - - def test_chunk1_params(self, bw_frames: list[bytes]) -> None: - _, _, params, _, _ = _decode_bw_frame(bw_frames[104]) - assert params == bytes(10) - - def test_chunk2_params(self, bw_frames: list[bytes]) -> None: - _, _, params, _, _ = _decode_bw_frame(bw_frames[105]) - assert params == bytes([0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00]) - - def test_chunk3_params(self, bw_frames: list[bytes]) -> None: - _, _, params, _, _ = _decode_bw_frame(bw_frames[106]) - assert params == bytes([0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) - - def test_chunk1_offset(self, bw_frames: list[bytes]) -> None: - _, offset, _, _, _ = _decode_bw_frame(bw_frames[104]) - assert offset == 0x1004 - - def test_chunk2_offset(self, bw_frames: list[bytes]) -> None: - _, offset, _, _, _ = _decode_bw_frame(bw_frames[105]) - assert offset == 0x1004 - - def test_chunk3_offset(self, bw_frames: list[bytes]) -> None: - _, offset, _, _, _ = _decode_bw_frame(bw_frames[106]) - assert offset == 0x002C - - -# ── Standalone runner ────────────────────────────────────────────────────────── - -if __name__ == "__main__": - if not os.path.exists(CAPTURE_PATH): - print(f"ERROR: Capture file not found: {CAPTURE_PATH}") - sys.exit(1) - - frames = _load_bw_frames(CAPTURE_PATH) - print(f"Loaded {len(frames)} BW frames from capture") - - write_frame_indices = list(range(102, 113)) - all_pass = True - print() - print(f"{'Frame':>6} {'SUB':>5} {'Offset':>8} {'DataLen':>8} {'Chk OK':>7} {'Rebuilt':>8}") - print("-" * 60) - for idx in write_frame_indices: - wire = frames[idx] - sub, offset, params, data, chk = _decode_bw_frame(wire) - payload = _destuff(wire[2:-1]) - computed = (sum(b for b in payload[2:-1] if b != 0x10) + 0x10) & 0xFF - chk_ok = computed == chk - - built = build_bw_write_frame(sub, data, offset=offset, params=params) - rebuilt_ok = built == wire - - status = "✅" if (chk_ok and rebuilt_ok) else "❌" - print( - f" {idx:4d} 0x{sub:02X} 0x{offset:04X} {len(data):8d} " - f"{'✅' if chk_ok else '❌':>7} {'✅' if rebuilt_ok else '❌':>8} {status}" - ) - if not (chk_ok and rebuilt_ok): - all_pass = False - - print() - if all_pass: - print("All 11 write frames verified ✅") - else: - print("FAILURES DETECTED ❌") - sys.exit(1) +def test_the_compliance_image_goes_in_1024_byte_chunks_addressed_by_params(writes): + chunks = [_fields(f) for f in writes if _fields(f)[0] == 0x71] + assert [(length, params[2:4].hex()) for _, length, params, *_ in chunks] == \ + [(0x400, "0000"), (0x400, "0400"), (0x2C, "0800")] + image = b"".join(c[3] for c in chunks) + assert len(image) == 2092 and int.from_bytes(image[:2], "big") == 2090 -- 2.54.1 From 329f7f2abba557b94a06bcc90d237a3e1f1e86ea Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 02:54:56 -0400 Subject: [PATCH 117/223] docs: retract the MiniMate write-frame model in place (#46) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 13 +++++++++++++ docs/instantel_protocol_reference.md | 1 + 2 files changed, 14 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 3b39af9..1de231b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1617,6 +1617,19 @@ All DB endpoints are read-only except `PATCH /db/events/{id}/false_trigger`. ## Write commands (SUBs 68–83) — confirmed 2026-04-07 +> ⚠ **RETRACTED 2026-10-27 (#46, measured): write frames are ordinary requests.** +> Every 02/03/04/10 is escaped and the checksum is SUM8 of the payload, as in every +> request. The length field [4:6] is the data's length. A config block is its own +> length N + 2 bytes; the compliance image (2,092) goes in addressed chunks +> (params[2:4]; 512 B now, 1,024 B in March). This re-encodes all 3,869 Blastware +> requests from February to April, plus 26 write frames from 2026-10-26. The +> "raw except BW_CMD", "DLE-aware checksum", "offset = data[1] + 2" and "71×3 at +> 0x1004" below were the same frames read with their escape bytes in. The trigger +> block is READ (SUB 0x2E) -- its byte 5 differs by unit -- not a fixed blob. +> Code: `build_bw_write_frame`, `protocol.write_image`, `b5037b0`. The text below +> is history. + + All confirmed from 3-11-26 BW TX capture (`raw_bw_20260311_170151.bin`, frames 102–112). ### Write frame format — CRITICAL: minimal DLE stuffing diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 1495d1b..d923c8e 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-10-27 | §3 writes | **⚠ RETRACTS the write-frame model (#46, measured).** Every Blastware request on record re-encodes under the uniform rule (02/03/04/10 escaped, SUM8): 3,869/3,869 frames in the Feb–Apr 2026 captures, plus BE9441's 26 write frames of 2026-10-26. A write's [4:6] is its data LENGTH. Config blocks are their header N + 2 bytes: event index (68) and trigger (82) are written as read plus `02 00` / `00 00` (constant on 15 sends); waveform data (69) and the 2,092-byte compliance image (71) are written whole, the latter in addressed chunks (params[2:4] = address; 1,024 B in March, 512 B with Blastware 10.74). The trailing two bytes are not a CRC and went out stale, so the unit evidently ignores them. "Only BW_CMD doubled", the "DLE-aware checksum", "offset = data[1] + 2" and "chunks 1,027 / 1,055 at offset 0x1004" were these frames read with their escape bytes in. The trigger block is read first (SUB 0x2E, 26 bytes); its byte 5 has been 01 / 03 / 04 by unit and session (meaning unknown). | | 2026-10-26 (4) | §3, §10 | **Replies follow the request rule; a write-frame suspicion (inferred).** Measured on all 748 reply frames of the 10-26 recording: the unit escapes exactly 02/03/04/10 with a `10`, and the checksum is **SUM8 of the unescaped payload**, 748/748. The long-held "S3 response checksums frequently fail SUM8" (`protocol._validate_frame`) is `S3FrameParser`'s own doing: it keeps the `10` of `10 02/03/04` in its output (consumers rely on that) and sums it, so 502/540 A5 replies read invalid. 🔶 **Inferred only:** `build_bw_write_frame`'s model ("raw except BW_CMD", "DLE-aware checksum") shows the same fingerprints as the retracted 5A model -- SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and Blastware escapes `03` in write data (§3 note, 2026-04-20). A write whose payload holds a bare 02/03/04/10 may be malformed; one Blastware config-write capture settles it. Not acted on. | | 2026-10-26 (3) | §3, §7.8, §10 | **⚠ RETRACTS the 5A "non-standard frame" model; the 64 KB page bug is FIXED (measured).** A bridge recorded Blastware downloading all 8 of BE9441's events, 4 crossing a 64 KB page (`tests/fixtures/minimate-bench-10-26-26-blastware/`). **Every request** is the standard 16-byte payload with a SUM8 checksum and **every 02, 03, 04 and 10 DLE-escaped**, payload and checksum alike: 748/748 re-encode byte-identically. §10's "only 0x10 is stuffed" is half the rule. **A 5A request is an ordinary request** `[10 00 5A 00][length BE 2][address BE 4][zeros 6]`, where length is 0x0200 per chunk and the remainder for TERM. The walk: the event's start address, +0x200 at a time as plain 32-bit addresses (carrying into the page byte), then TERM at the next boundary for exactly the remainder, ending at STRT's full 32-bit end key. **Misreadings retracted:** the fixed "offset 0x1002" is length 0x0200 escaped (`10 02 00`); the "metadata pages at 0x1002 / 0x1004, global, read once per session" are the first event's own chunks at 0x0200 and 0x0400; the "11-byte params" counted the length's low byte; the "partial DLE stuffing" carve-outs were the escape rule seen half; the 16-bit counter is why a walk could not leave its page. **Verified live on BE9441:** all 8 events downloaded whole, the 4 crossings included, each matching the unit's own 0C peaks. Code `887e75d`. | | 2026-10-26 (2) | §7.8 | **The 64 KB page bug, narrowed (measured, BE9441).** Blastware's own downloads of all 20 events (Brian, `example-events/10-25-26 - thumps`) give byte-exact ground truth. SFM's downloads of events 0, 1, 3, 4 and 10 are **byte-identical** to Blastware's. Importing Blastware's files first (the watcher route) makes SFM's downloads of the same events return `already_stored`: the unit's 0C and Blastware's file agree on (serial, timestamp). For an event that crosses a page (event 2, `0111c92c` → STRT end key `01122f06`, full 32 bits) a read-only test walk with the page byte carried (params `00 01 12 01 2c`) got a proper A5 reply for the first chunk in page 0x12, echoing `01 12 01 2c`. The second chunk, `00 01 12 03 2c`, got no reply frame: a raw 0x03 (ETX) inside the params. Page 0x11 never shows this, because event 1 skips 0x0000–0x05FF, so no counter there has a 02/03/04 byte. Every later page does. ⚠ How Blastware encodes a lone 02/03/04 inside params is unknown: §7.8 says `10 02/03/04` is kept as a literal pair, which would shift the address. A wire capture of Blastware downloading BE9441 event 2 or 19 settles it. Blastware's files are fixtures (`tests/fixtures/minimate-bench-10-25-26/blastware/`). | -- 2.54.1 From 20ea61e0e933b20e35a3adb571586fe2efaf1f74 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 27 Oct 2026 03:17:34 -0400 Subject: [PATCH 118/223] fix(minimateplus): push_config_raw checks every block before the first write goes out (#46 review) Review of b5037b0 (measured on 12 recorded SFM compliance reads): the read keeps three escape bytes from its reply headers, so every real config image is refused by write_image -- correctly, but only after 68 and 73 had been sent, with a message saying nothing was. All four blocks are now checked first; the test feeds the block exactly as SFM's read produces it and asserts no frame is sent (two went out without the check). Config push stays unusable on purpose: fixing that read alone would let the compliance encoder write some fields to the wrong bytes (e.g. 4,096 sps as 4,112) while the image still passes. The rework -- logical read, encoding at measured offsets with #48, a diff check, N pinned per SUB, an idle check, the start/stop safeguards on POST /device/config -- is recorded in the spec and on #46. Start/stop frames are unchanged (verified byte-identical by the review). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-20-sfm-series4-parity-design.md | 15 +++++++++++++++ minimateplus/client.py | 11 +++++++++++ tests/test_minimate_write_frames.py | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 27b5e6b..f14758a 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -428,6 +428,21 @@ Each safety piece arrives with its first real use, so nothing sits untested. value during a call-home is unmeasured** -- the change path would refuse it as unknown. To measure: a MiniMate stop with ACH on, through the bridge. + - ⚠ **MiniMate config push (#46): framing fixed (`b5037b0`), NOT + usable yet.** Review 2026-10-27, measured on recorded reads: (C1) + `read_compliance_config` keeps three escape bytes from its reply + headers, so every real config is refused -- now before any frame is + sent (`push_config_raw` checks all four blocks first); (C2) fixing that + read alone lets the encoder write some fields to the wrong bytes while + the image still passes the N+2 guard (e.g. 4,096 sps written as 4,112). + The rework: read the compliance block logically (reply page bytes + + data, unescaped), encode at the measured logical offsets (mode [5], + rate [6:8], interval [8:10], record time [18:22], trigger Tran+30, + alarm Tran+38) -- with #48 --, diff-check that only the requested + fields changed, pin N per SUB, refuse unless 0x1C reads idle, give + `POST /device/config` the start/stop safeguards, and test + `apply_config` from recorded replies. Review findings I2-I4, M1-M4 + are in the #46 thread. - Still owed: - **before merging to dev, align `persist_download`'s already-stored check with what v0.32.0 shipped** (dev `04acb99`; restamp `5737168`, diff --git a/minimateplus/client.py b/minimateplus/client.py index 1269637..280e266 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -956,6 +956,17 @@ class MiniMateClient: """ proto = self._require_proto() + # Every block is checked before the first frame goes out (review of #46, + # 2026-10-27): a block refused after 68 + 73 had been sent left a partial + # write behind. write_image is the same check each write makes. + from .protocol import (SUB_COMPLIANCE_WRITE, SUB_EVENT_INDEX_WRITE, + SUB_TRIGGER_CONFIG_WRITE, SUB_WAVEFORM_DATA_WRITE, write_image) + for sub, data in ((SUB_EVENT_INDEX_WRITE, event_index_data), + (SUB_COMPLIANCE_WRITE, compliance_data), + (SUB_TRIGGER_CONFIG_WRITE, trigger_data), + (SUB_WAVEFORM_DATA_WRITE, waveform_data)): + write_image(sub, data) + # 68 → 73 log.info("push_config_raw: write event index (SUB 68)") proto.write_event_index(event_index_data) diff --git a/tests/test_minimate_write_frames.py b/tests/test_minimate_write_frames.py index 4f5997b..94683b5 100644 --- a/tests/test_minimate_write_frames.py +++ b/tests/test_minimate_write_frames.py @@ -247,3 +247,22 @@ def test_apply_config_writes_the_units_own_trigger_block(): trig = [a[0] for n, a in c._proto.writes if n == "write_trigger_config"] assert trig == [_image(0x82)[:-2]] assert trig[0][5] == 0x01 # BE9441's; the March copy had 0x03 + + +def test_a_bad_block_is_refused_before_the_first_write_goes_out(): + """Review of #46 (2026-10-27, measured on 12 recorded SFM reads): the compliance + read keeps three escape bytes from its reply headers and unescapes to + 00 + cfg[0:1024] + 00 00 + cfg[1024:2090]. That block was refused -- but only + after 68 and 73 had been sent. push_config_raw now checks all four first. + (The read is deliberately not 'fixed' on its own: the encoder would then write + some fields to the wrong bytes while the image still passes -- see #46.)""" + from minimateplus.client import MiniMateClient + cfg = _image(0x71)[:-2] + as_sfm_reads_it = b"\x00" + cfg[:1024] + b"\x00\x00" + cfg[1024:] + p, t = _proto() + c = MiniMateClient(transport=object()) + c._proto = p + with pytest.raises(ValueError, match="not a whole block"): + c.push_config_raw(_image(0x68)[:-2], as_sfm_reads_it + b"\x00\x00", + _image(0x82)[:-2], _image(0x69)) + assert t.sent == [] -- 2.54.1 From 02d8517ebd5a1e603d376ca9342bce107249a44f Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 28 Oct 2026 23:16:50 -0400 Subject: [PATCH 119/223] docs(spec): park the MiniMate speed-ups, measured -- after 1c Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index f14758a..cd28f6c 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -740,6 +740,20 @@ items were left for later on purpose: ## Parking lot +- **Speed (Brian's goal: faster than Blastware), after 1c.** Measured on + BE9441, 2026-10-27 23:41, serial cable: + - wake + serial number take 0.16 s; + - `MiniMateClient.connect()` also reads 01 + 1A + 08 on every request, ~3 s; + - a fixed **2.0 s "safety drain"** at the end of `read_compliance_config` runs + on every connect; + - the read-back polls every 2 s. + + Ideas, each measured before and after against Blastware's own timings in the + bridge recordings: a light connect (wake + serial) for start/stop, status and + event list; drop or shorten the drain; reuse within a session (MiniMates + reconnect per request). New safeguards must state their time cost + (1c's identity check reuses the serial read connect already does). + **Monitor logs.** Its own piece of work, data side as much as device side. A unit calls in at least once or twice a day. With no events (e.g. waveform mode, no blast that day) it still delivers a **monitor log**: "monitoring from -- 2.54.1 From eecabc76ebecb310b53ec65fd0e0ea4912afa07f Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 28 Oct 2026 23:20:26 -0400 Subject: [PATCH 120/223] docs(plan): phase 1c -- the webapp by serial, and the wrong-series safeguards Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../plans/2026-10-28-sfm-phase1c-webapp.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-28-sfm-phase1c-webapp.md diff --git a/docs/superpowers/plans/2026-10-28-sfm-phase1c-webapp.md b/docs/superpowers/plans/2026-10-28-sfm-phase1c-webapp.md new file mode 100644 index 0000000..094d15e --- /dev/null +++ b/docs/superpowers/plans/2026-10-28-sfm-phase1c-webapp.md @@ -0,0 +1,207 @@ +# SFM phase 1c — the webapp on the serial-based endpoints, plus wrong-series safeguards + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** The SFM standalone page (`sfm/sfm_webapp.html`) drives both series through the serial-based device endpoints. In addition, no MiniMate-only write or erase can reach a unit that has not identified itself as Series 3. + +**Architecture:** +- **Server:** one helper refuses the legacy Series-3 write/erase routes unless the unit's own serial (read on the same connection) says Series 3. +- **Page:** the series routing and button rules live in a marked block of pure functions, tested through Node. The DOM wiring calls those functions and nothing else to build a `/device/` URL or decide a button's state. + +**Tech Stack:** Python 3.10 / FastAPI (`sfm/server.py`), vanilla JS in one HTML file, pytest. Node 20 (`~/.local/bin/node`) runs the page-logic tests. + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` covers "The webapp", "Scope: the parity table" rows 1–5 and 7, and "Build phases" 1c. The design agreed with Brian on 2026-10-28 is recorded in the Global Constraints below. + +## Global Constraints + +- Work in worktree `~/seismo-relay-parity`, on branch `feat/series4-sfm-parity`. Never commit to `main`. Check with `git branch --show-current` before every commit. +- Run tests with `/home/serversdown/seismo-relay/.venv/bin/python -m pytest -q -p no:cacheprovider`. The baseline is **16 known failures** (15 in `test_bw_ascii_report.py`, 1 in `test_event_file_io.py`). Read the failure list before committing. A `pytest | tail` exits 0. +- **Serial optional:** with a serial, the Live tabs use the serial-based endpoints: `/device/info`, `/device/monitor/status`, `/device/settings`, `/device/events`, `POST /device/events/download`, and `POST /device/monitor/start|stop` (all with `serial=`), plus `POST /device/hangup?host=&tcp_port=`. With the serial blank, every read behaves exactly as today. +- **Series comes from the unit's reply.** The badge and every series-specific control follow the `series` field of the last `/device/info` reply, and only if its `serial` equals the typed one. A typed serial alone never enables a series-specific control. +- **Write buttons:** + - Start/stop use the audited serial path for both series. + - Config write and Call-Home write are **disabled for both series**. Their tooltips read exactly "Coming in phase 5 (#46)" and "Coming in phase 4". + - Diagnostics (erase, rescue, slow drip, blind stop) is enabled only when the confirmed series is 3. + - Hang up is shown only when the confirmed series is 4. +- **Start feedback:** while a start is in flight, show "Starting — the unit runs its sensor check first (about 35 s)". The legacy 60-second `_pollMonitorConfirm` loop is not used in serial mode. +- **Results are reported as SFM returned them:** outcome, verified, state before → after, and the first 8 characters of the audit id. HTTP error `detail` strings are shown verbatim. +- **Speed (Brian):** no new request may be added to a path unless the plan says why. The server identity check reuses the serial that `connect()` already reads. On `rescue` and `POST /device/call_home` it adds exactly one SUB 0x15 read. +- No codec, store or DB change. The legacy `/device/*` routes keep their URLs and parameters (a new optional `serial` is added). + +## Review Focus + +1. **A typed `BE…` serial at an address that holds a Micromate.** The server must refuse every guarded route with 409 and send no write. In the page, Diagnostics stays disabled until `/device/info` answers Series 3. Pinned by Task 1 (`test_guarded_route_refuses_a_unit_that_answers_as_series4`) and Task 2 (`controls: typed serial is not confirmation`). +2. **The serial is edited after a successful identify.** The confirmation must stop counting the moment the typed serial no longer matches. Pinned by Task 2 (`controls: confirmation drops when the serial changes`). +3. **Lower-case or space-padded serials** (`" be9441 "`) are normalised the same way the server normalises them. Pinned by Task 2 (`seriesFromSerial` and `unitQuery` cases). +4. **A start that times out (504) or reads back a mismatch (409).** The page must show the server's detail and the audit id, never "started". Pinned by Task 2 (`changeSummary` cases for `failed`/`mismatch`) and Task 5 (an error-path render). +5. **A download that is already stored** (`inserted: false`) is reported as "already stored" and still opens the stored event. Pinned by Task 2 (`downloadSummary`). + +--- + +### Task 1: Server — legacy Series-3 writes refuse a unit that isn't Series 3 + +**Files:** +- Modify: `sfm/server.py`: + - `device_config` (~1107), `device_events_erase` (~1427), `device_rescue` (~1763), the `device_call_home` POST (~2066); + - `device_config_project` passes `serial` through. +- Modify: `minimateplus/client.py`: add `MiniMateClient.read_serial()`. +- Test: create `tests/test_server_series3_guard.py`. + +**Interfaces:** +- Produces: `MiniMateClient.read_serial(self) -> str`. Requires an open, polled session. It runs the SUB 0x15 read (`self._require_proto().read(SUB_SERIAL_NUMBER)`) and returns `_decode_serial_number(...).serial`. +- Produces: `sfm.server._require_series3(unit_serial: Optional[str], expected: Optional[str]) -> None`. It raises `HTTPException(409, detail)` when either: + - `series_for_serial(unit_serial)` is not 3 (an unknown serial counts as not 3), with detail `f"the unit at this address answers as {unit_serial!r}, not a Series-3 unit -- nothing sent"`; or + - `expected` is given and `normalise_serial(expected) != normalise_serial(unit_serial)`, with detail `f"the unit at this address is {unit_serial}, not {expected} -- nothing sent"`. +- Each guarded route gains `serial: Optional[str] = Query(None, description=_SERIAL_DOC)`. It calls the guard right after it knows the unit's serial, and before its first write: + - `device_config` and `device_events_erase`: `info = client.connect()` → `_require_series3(info.serial, serial)`; + - `device_rescue` and `device_call_home` (POST): after `client.poll()` → `_require_series3(client.read_serial(), serial)`. +- Not guarded, and each gets a one-line comment saying why: legacy `monitor/start|stop`, `stop_monitoring_blind`, `stop_monitoring_slow_drip`, `stop_monitoring_spam`. They send only `0x96`/`0x97`, which mean the same on both series (measured 2026-10-25/27), and the rescue tools must work on a unit too wedged to answer. + +- [ ] **Step 1: Write the failing tests** in `tests/test_server_series3_guard.py`. Use `monkeypatch.setattr(srv, "_build_client", factory)` as `tests/test_server_device_access.py:398` does. The fake client records every call: + - `test_guarded_route_refuses_a_unit_that_answers_as_series4[route]`: parametrise over the four routes. The fake's `connect()` returns a `DeviceInfo(serial="UM20147")`, or its `read_serial()` returns `"UM20147"`. Assert `HTTPException.status_code == 409`, and that the recorded calls contain no write method (`delete_all_events`, `apply_config`, `set_call_home_config`, `stop_monitoring`). + - `test_guarded_route_refuses_a_different_series3_unit`: the unit answers `"BE9441"`, the request names `serial="BE12599"`, so the response is 409 with `"not BE12599"` in the detail. + - `test_guarded_route_proceeds_for_the_named_series3_unit`: the unit answers `"BE9441"` with `serial="be9441 "` (normalised), and the write method is called once. + - `test_unguarded_stop_routes_send_without_an_identity_read`: `stop_monitoring_blind` (it writes through a bare `TcpTransport`; stub `srv.TcpTransport`) sends its stop frames, and nothing builds a client or reads a serial. +- [ ] **Step 2: Run them.** `…pytest tests/test_server_series3_guard.py -q` → FAIL (`_require_series3` / `read_serial` don't exist). +- [ ] **Step 3: Implement** `read_serial`, `_require_series3`, the `serial` query parameter, and the four guard calls as specified. +- [ ] **Step 4: Run** the new tests plus `tests/test_server_device_access.py` → PASS. Then the full suite → only the 16 known failures. +- [ ] **Step 5: Commit** `fix(sfm): legacy Series-3 writes and erase refuse a unit that does not answer as Series 3`. + +### Task 2: Page — the device-routing block (pure functions) and its Node-run tests + +**Files:** +- Modify: `sfm/sfm_webapp.html`. Add one ` +", PAGE.read_text(), re.S) + js = tmp_path / "page.js" + js.write_text("\n;\n".join(scripts)) + r = subprocess.run([NODE, "--check", str(js)], capture_output=True, text=True, timeout=30) + assert r.returncode == 0, r.stderr -- 2.54.1 From 44d6e754bd16d2f126ac7fe2bd3e7330138d9638 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 11:50:24 -0400 Subject: [PATCH 124/223] feat(webapp): name a unit by serial; series badge from the unit's own answer; Hang up for Series 4 - A Serial field beside host/port. With one, the Live tabs use the serial-based endpoints (both series); without, every read behaves as before. - The series badge, Hang up (Series 4), Diagnostics (Series 3), call-home read and the disabled config/call-home writes all follow applyControls() <- controlsFor() on the unit's own /device/info answer; editing the serial, host or port drops the confirmation. Erase additionally needs a confirmed Series 3. - Every /device/ request goes through deviceRequest/deviceFetch <- deviceUrl (a static test enforces it); the legacy per-event routes joined deviceUrl (event_waveform / event_file, index in the path). - The status panel and Device tab read both shapes (shared and legacy). - In serial mode the connect skips the legacy storage_range read (one connection fewer; a Micromate has no such route). Start/stop without a serial behave as before; with one, only for a confirmed series. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 220 +++++++++++++++++++--------- tests/test_webapp_device_routing.py | 19 +++ 2 files changed, 166 insertions(+), 73 deletions(-) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index 6e6caad..5d4c9b7 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -147,6 +147,15 @@ } #monitor-panel.monitoring { border-left: 3px solid var(--green); } #monitor-panel.idle { border-left: 3px solid var(--text-mute); } + .series-badge { + font-size: 12px; + font-weight: 700; + padding: 2px 10px; + border-radius: 10px; + border: 1px solid var(--accent, #58a6ff); + color: var(--accent, #58a6ff); + align-self: center; + } .mon-status-badge { font-size: 12px; font-weight: 700; @@ -843,7 +852,13 @@ + + + + @@ -1485,16 +1500,25 @@ const DEVICE_ROUTES = { call_home_read: ['GET', '/device/call_home', false], call_home_write: ['POST', '/device/call_home', false], config_write: ['POST', '/device/config', false], + event_waveform: ['GET', '/device/event/{index}/waveform', false], + event_file: ['GET', '/device/event/{index}/blastware_file', false], }; function deviceUrl(action, unit, params = {}) { const route = DEVICE_ROUTES[action]; if (!route) throw new Error(`unknown device action: ${action}`); - const [method, path, needsSerial] = route; + const [method, template, needsSerial] = route; if (needsSerial && !normSerial(unit.serial)) return null; + const rest = { ...params }; + let path = template; + if (path.includes('{index}')) { // the legacy per-event routes + if (rest.index === undefined) throw new Error(`${action} needs params.index`); + path = path.replace('{index}', encodeURIComponent(rest.index)); + delete rest.index; + } // Hang-up releases whatever line is held at the address: no serial. let query = action === 'hangup' ? unitQuery({ ...unit, serial: '' }) : unitQuery(unit); - for (const [k, v] of Object.entries(params)) query += `&${k}=${encodeURIComponent(v)}`; + for (const [k, v] of Object.entries(rest)) query += `&${k}=${encodeURIComponent(v)}`; return { method, path: `${path}?${query}` }; } @@ -1590,9 +1614,63 @@ function onForceToggle() { document.getElementById('force-toggle').classList.toggle('active', forceRefresh); } -function deviceParams() { - const base = `host=${encodeURIComponent(devHost())}&tcp_port=${devPort()}`; - return forceRefresh ? `${base}&force=true` : base; +// The unit as named in the bar. `confirmed` is the unit's own /device/info +// answer ({serial, series}); it is cleared whenever the serial, host or port is +// edited, so a series-specific control never outlives the identify behind it. +let unitConfirmed = null; + +function currentUnit() { + return { serial: document.getElementById('dev-serial').value, + host: devHost(), tcpPort: devPort(), confirmed: unitConfirmed }; +} + +function serialMode() { return Boolean(normSerial(currentUnit().serial)); } + +// Every device request goes through deviceUrl (the device-routing block). +async function deviceRequest(action, params = {}, opts = {}) { + const extra = forceRefresh && (DEVICE_ROUTES[action] || [])[0] === 'GET' ? { ...params, force: 'true' } : params; + const u = deviceUrl(action, currentUnit(), extra); + if (!u) throw new Error(`${action} needs a serial`); + return fetch(`${api()}${u.path}`, { method: u.method, ...opts }); +} + +async function deviceFetch(action, params = {}, opts = {}) { + const r = await deviceRequest(action, params, opts); + const body = await r.json().catch(() => ({})); + if (!r.ok) { + const d = body.detail; + const err = new Error(typeof d === 'string' ? d : (d && d.message) || r.statusText); + err.status = r.status; err.body = body; + throw err; + } + return body; +} + +// Every series-specific control, from controlsFor (the device-routing block). +function applyControls() { + const unit = currentUnit(); + const c = controlsFor(unit); + const series = confirmedSeries(unit); + const badge = document.getElementById('series-badge'); + badge.hidden = series == null; + badge.textContent = series ? `Series ${series}` : ''; + document.getElementById('hangup-btn').hidden = !c.hangup; + setDiagButtonsEnabled(c.diagnostics); + const cw = document.getElementById('cfg-write-btn'); + cw.disabled = !c.configWrite; cw.title = c.reasons.configWrite; + const hw = document.getElementById('ch-write-btn'); + hw.disabled = !c.callHomeWrite; hw.title = c.reasons.callHomeWrite; + document.getElementById('ch-read-btn').disabled = !c.callHomeRead; + setMonitorButtons(); +} + +async function hangUp() { + try { + const r = await deviceFetch('hangup'); + setStatus(r.hung_up ? 'Line released.' : 'No line was being held.', 'ok'); + } catch (e) { + setStatus(`Hang up failed: ${e.message}`, 'error'); + } } // ── Section switching ───────────────────────────────────────────────────────── @@ -1657,13 +1735,15 @@ async function connectUnit() { setStatus('Connecting — reading device info…', 'loading'); try { - const r = await fetch(`${api()}/device/info?${deviceParams()}`); - if (!r.ok) { const e = await r.json().catch(() => ({})); throw new Error(e.detail || r.statusText); } - unitInfo = await r.json(); + unitInfo = await deviceFetch('info'); } catch (e) { setStatus(`Connection failed: ${e.message}`, 'error'); btn.disabled = false; btn.textContent = 'Connect'; return; } + // The unit's own answer confirms its series; a legacy identify (no serial + // typed) answers with its serial alone. + unitConfirmed = { serial: unitInfo.serial, + series: unitInfo.series ?? seriesFromSerial(unitInfo.serial) }; // Connecting deliberately does NOT walk the event chain. That walk reads // every event header over the cellular link and can take minutes — or fail @@ -1671,7 +1751,9 @@ async function connectUnit() { // probes instead; the event list is opt-in via loadEventList(). eventList = []; eventsLoaded = false; setStatus('Reading device state…', 'loading'); - storageInfo = await fetchJson(`/device/events/storage_range`).catch(() => null); + // A legacy MiniMate read: skipped in serial mode (one connection fewer, and a + // Micromate has no such route). + storageInfo = serialMode() ? null : await deviceFetch('storage_range').catch(() => null); populateDeviceBar(); populateDeviceTab(); @@ -1682,11 +1764,8 @@ async function connectUnit() { document.getElementById('monitor-panel').style.display = 'flex'; setEventButtonsEnabled(); document.getElementById('load-events-btn').disabled = false; - setDiagButtonsEnabled(true); document.getElementById('cfg-read-btn').disabled = false; - document.getElementById('cfg-write-btn').disabled = false; - document.getElementById('ch-read-btn').disabled = false; - document.getElementById('ch-write-btn').disabled = false; + applyControls(); btn.disabled = false; btn.textContent = 'Reconnect'; @@ -1705,13 +1784,6 @@ async function connectUnit() { } // ── Shared fetch helper ──────────────────────────────────────────────────────── -async function fetchJson(path, opts) { - const sep = path.includes('?') ? '&' : '?'; - const r = await fetch(`${api()}${path}${sep}${deviceParams()}`, opts); - const body = await r.json().catch(() => ({})); - if (!r.ok) throw new Error(body.detail || r.statusText); - return body; -} function setEventButtonsEnabled() { const n = eventList.length; @@ -1729,7 +1801,7 @@ async function loadEventList() { btn.disabled = true; setStatus('Walking the event chain — this can take a while…', 'loading'); try { - const evData = await fetchJson('/device/events'); + const evData = await deviceFetch('events'); eventList = evData.events || []; eventsLoaded = true; // /device/events re-reads compliance; fold it in. @@ -1749,7 +1821,7 @@ async function loadEventList() { // ── Device bar ───────────────────────────────────────────────────────────────── function populateDeviceBar() { qs('di-serial').textContent = unitInfo.serial || '—'; - qs('di-fw').textContent = unitInfo.firmware_version || '—'; + qs('di-fw').textContent = unitInfo.firmware_version || unitInfo.firmware || '—'; const cc = unitInfo.compliance_config || {}; qs('di-sr').textContent = cc.sample_rate ? `${cc.sample_rate} sps` : '—'; qs('di-rt').textContent = cc.record_time != null ? `${cc.record_time.toFixed(1)} s` : '—'; @@ -1765,9 +1837,7 @@ function populateDeviceBar() { async function refreshMonitorStatus() { if (!devHost()) return null; try { - const r = await fetch(`${api()}/device/monitor/status?${deviceParams()}`); - if (!r.ok) return null; - const s = await r.json(); + const s = await deviceFetch('status'); updateMonitorPanel(s); return s; } catch (_) { return null; } @@ -1779,27 +1849,37 @@ function updateMonitorPanel(s) { const batEl = document.getElementById('mon-battery'); const memTEl = document.getElementById('mon-mem-total'); const memFEl = document.getElementById('mon-mem-free'); - const startB = document.getElementById('mon-start-btn'); - const stopB = document.getElementById('mon-stop-btn'); - - if (s.is_monitoring) { + // Two shapes: the shared model (serial mode) and the legacy one. + const monitoring = s.monitoring ?? s.is_monitoring; + lastMonitoring = monitoring; + if (monitoring) { badge.textContent = 'MONITORING'; badge.className = 'mon-status-badge monitoring'; panel.className = 'monitoring'; - startB.disabled = true; - stopB.disabled = false; } else { badge.textContent = 'IDLE'; badge.className = 'mon-status-badge idle'; panel.className = 'idle'; - startB.disabled = false; - stopB.disabled = true; } + setMonitorButtons(); // Battery and memory are available in both states — update if present, // keep previous value if this was an optimistic update with no real data. - if (s.battery_v != null) batEl.textContent = `${s.battery_v.toFixed(2)} V`; - if (s.memory_total_kb != null) memTEl.textContent = `${s.memory_total_kb} KB`; - if (s.memory_free_kb != null) memFEl.textContent = `${s.memory_free_kb} KB`; + const volts = s.battery_volts ?? s.battery_v; + const kb = (bytes, k) => bytes != null ? Math.round(bytes / 1024) : k; + const totalKb = kb(s.memory_total_bytes, s.memory_total_kb); + const freeKb = kb(s.memory_free_bytes, s.memory_free_kb); + if (volts != null) batEl.textContent = `${volts.toFixed(2)} V`; + if (totalKb != null) memTEl.textContent = `${totalKb} KB`; + if (freeKb != null) memFEl.textContent = `${freeKb} KB`; +} + +// Start/stop: in serial mode only for a unit whose series its own answer +// confirmed; without a serial, as before (0x96/0x97 mean the same on both). +let lastMonitoring = null; +function setMonitorButtons() { + const allowed = serialMode() ? controlsFor(currentUnit()).startStop : Boolean(devHost()); + document.getElementById('mon-start-btn').disabled = !allowed || lastMonitoring === true; + document.getElementById('mon-stop-btn').disabled = !allowed || lastMonitoring === false; } async function startMonitoring() { @@ -1808,8 +1888,7 @@ async function startMonitoring() { btn.disabled = true; btn.textContent = '…'; setStatus('Starting monitoring…', 'loading'); try { - const r = await fetch(`${api()}/device/monitor/start?${deviceParams()}`, { method: 'POST' }); - if (!r.ok) { const e = await r.json().catch(() => ({})); throw new Error(e.detail || r.statusText); } + await deviceFetch('start'); // Optimistically show MONITORING immediately. The unit may run a ~40s on-device // sensor check before fully entering monitor mode. We poll status every 5s for @@ -1859,8 +1938,7 @@ async function stopMonitoring() { btn.disabled = true; btn.textContent = '…'; setStatus('Stopping monitoring…', 'loading'); try { - const r = await fetch(`${api()}/device/monitor/stop?${deviceParams()}`, { method: 'POST' }); - if (!r.ok) { const e = await r.json().catch(() => ({})); throw new Error(e.detail || r.statusText); } + await deviceFetch('stop'); setStatus('Monitoring stopped.', 'ok'); await refreshMonitorStatus(); } catch (e) { @@ -1880,10 +1958,12 @@ function populateDeviceTab() { cards.innerHTML = ''; const cardData = [ { label:'Serial Number', value: unitInfo.serial || '—' }, - { label:'Firmware', value: unitInfo.firmware_version || '—' }, - { label:'DSP', value: unitInfo.dsp_version || '—' }, + { label:'Series', value: confirmedSeries(currentUnit()) ?? '—' }, + { label:'Firmware', value: unitInfo.firmware_version || unitInfo.firmware || '—' }, + { label:'DSP', value: unitInfo.dsp_version || (unitInfo.detail || {}).dsp_version || '—' }, { label:'Model', value: unitInfo.model || '—' }, - { label:'Manufacturer', value: unitInfo.manufacturer || '—' }, + { label:'Manufacturer', value: unitInfo.manufacturer || (unitInfo.detail || {}).manufacturer || '—' }, + { label:'Active Setup', value: unitInfo.active_setup || '—' }, { label:'Stored Events', value: eventsLoaded ? eventList.length : 'not loaded' }, { label:'Storage Used', value: storageUsedLabel() }, ]; @@ -1958,7 +2038,8 @@ function diagCheckEraseConfirm() { const btn = document.getElementById('diag-erase-btn'); if (!box || !btn) return; const serial = (unitInfo && unitInfo.serial) || ''; - btn.disabled = !serial || box.value.trim().toUpperCase() !== serial.toUpperCase(); + btn.disabled = !serial || box.value.trim().toUpperCase() !== serial.toUpperCase() + || !controlsFor(currentUnit()).diagnostics; } function diagResult(id, text, cls) { @@ -1974,9 +2055,9 @@ async function refreshDiagnostics() { if (st) { st.textContent = 'Reading…'; st.className = 'loading'; } const [mon, store, idx] = await Promise.all([ - fetchJson('/device/monitor/status?force=true').catch(e => ({ _err: e.message })), - fetchJson('/device/events/storage_range').catch(e => ({ _err: e.message })), - fetchJson('/device/events/index').catch(e => ({ _err: e.message })), + deviceFetch('status', { force: 'true' }).catch(e => ({ _err: e.message })), + deviceFetch('storage_range').catch(e => ({ _err: e.message })), + deviceFetch('index').catch(e => ({ _err: e.message })), ]); if (!store._err) storageInfo = store; @@ -1985,9 +2066,10 @@ async function refreshDiagnostics() { const rows = []; rows.push(['Monitoring', mon._err ? err(mon._err) - : (mon.is_monitoring ? 'MONITORING' : 'idle')]); + : ((mon.monitoring ?? mon.is_monitoring) ? 'MONITORING' : 'idle')]); if (!mon._err) { - rows.push(['Battery', mon.battery_v != null ? `${mon.battery_v.toFixed(2)} V` : '—']); + const volts = mon.battery_volts ?? mon.battery_v; + rows.push(['Battery', volts != null ? `${volts.toFixed(2)} V` : '—']); if (mon.memory_total_bytes) { const used = mon.memory_total_bytes - (mon.memory_free_bytes ?? 0); const pct = (used / mon.memory_total_bytes * 100).toFixed(1); @@ -2012,7 +2094,7 @@ async function diagStopMonitoring() { const btn = document.getElementById('diag-stop-btn'); btn.disabled = true; diagResult('diag-stop-result', 'Sending…'); try { - await fetchJson('/device/monitor/stop', { method: 'POST' }); + await deviceFetch('stop'); diagResult('diag-stop-result', 'Stop acknowledged — recording halted.', 'ok'); refreshDiagnostics(); } catch (e) { @@ -2025,7 +2107,7 @@ async function diagDisableAch() { const btn = document.getElementById('diag-ach-btn'); btn.disabled = true; diagResult('diag-ach-result', 'Writing call-home config…'); try { - const r = await fetchJson('/device/rescue?erase=false', { method: 'POST' }); + const r = await deviceFetch('rescue', { erase: 'false' }); const steps = (r.steps || []).map(s => s.step).join(' → ') || 'done'; diagResult('diag-ach-result', `ACH disabled (${steps}). Events untouched.`, 'ok'); } catch (e) { @@ -2040,7 +2122,7 @@ async function diagEraseEvents() { const btn = document.getElementById('diag-erase-btn'); btn.disabled = true; diagResult('diag-erase-result', 'Erasing…'); try { - await fetchJson('/device/events/erase', { method: 'POST' }); + await deviceFetch('erase'); diagResult('diag-erase-result', 'Events erased — chain reset to 0x01110000.', 'ok'); document.getElementById('diag-erase-confirm').value = ''; eventList = []; eventsLoaded = false; @@ -2057,8 +2139,7 @@ async function diagSlowDrip() { btn.disabled = true; diagResult('diag-drip-result', 'Holding a session for 120 s…'); try { - const r = await fetchJson('/device/stop_monitoring_slow_drip?duration_s=120&interval_s=3', - { method: 'POST' }); + const r = await deviceFetch('slow_drip', { duration_s: 120, interval_s: 3 }); const good = (r.bytes_received || 0) > 0; diagResult('diag-drip-result', `drips ${r.drips_sent} · held ${r.duration_s}s · bytes back ${r.bytes_received}` + @@ -2075,7 +2156,7 @@ async function diagBlindStop() { const btn = document.getElementById('diag-blind-btn'); btn.disabled = true; diagResult('diag-blind-result', 'Sending…'); try { - const r = await fetchJson('/device/stop_monitoring_blind', { method: 'POST' }); + const r = await deviceFetch('blind_stop'); diagResult('diag-blind-result', `Sent ${r.bytes_sent ?? '?'} bytes, no response read (fire-and-forget).`, 'ok'); } catch (e) { @@ -2115,9 +2196,7 @@ async function readConfig() { setCfgStatus('Reading config from device…'); document.getElementById('cfg-read-btn').disabled = true; try { - const r = await fetch(`${api()}/device/info?${deviceParams()}`); - if (!r.ok) { const e = await r.json().catch(()=>({})); throw new Error(e.detail || r.statusText); } - unitInfo = await r.json(); + unitInfo = await deviceFetch('info'); populateConfigFromDeviceInfo(); populateDeviceBar(); populateDeviceTab(); @@ -2169,13 +2248,10 @@ async function writeConfig() { document.getElementById('cfg-write-btn').disabled = true; try { - const r = await fetch(`${api()}/device/config?${deviceParams()}`, { - method: 'POST', + await deviceFetch('config_write', {}, { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), }); - if (!r.ok) { const e = await r.json().catch(()=>({})); throw new Error(e.detail || r.statusText); } - const result = await r.json(); setCfgStatus(`Written: ${fieldsStr}`, 'ok'); // Re-read device info so Device tab and bar refresh await readConfig(); @@ -2235,9 +2311,7 @@ async function readCallHome() { setChStatus('Reading call home config from device…'); document.getElementById('ch-read-btn').disabled = true; try { - const r = await fetch(`${api()}/device/call_home?${deviceParams()}`); - if (!r.ok) { const e = await r.json().catch(()=>({})); throw new Error(e.detail || r.statusText); } - const ch = await r.json(); + const ch = await deviceFetch('call_home_read'); populateCallHomeForm(ch); setChStatus('Call home config loaded from device.', 'ok'); } catch(e) { @@ -2298,12 +2372,10 @@ async function writeCallHome() { document.getElementById('ch-write-btn').disabled = true; try { - const r = await fetch(`${api()}/device/call_home?${deviceParams()}`, { - method: 'POST', + await deviceFetch('call_home_write', {}, { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), }); - if (!r.ok) { const e = await r.json().catch(()=>({})); throw new Error(e.detail || r.statusText); } setChStatus(`Written: ${fieldsStr}`, 'ok'); // Re-read to confirm changes await readCallHome(); @@ -2366,9 +2438,7 @@ async function loadWaveform() { let data; try { - const r = await fetch(`${api()}/device/event/${idx}/waveform?${deviceParams()}`); - if (!r.ok) { const e = await r.json().catch(()=>({})); throw new Error(e.detail || r.statusText); } - data = await r.json(); + data = await deviceFetch('event_waveform', { index: idx }); } catch(e) { setStatus(`Waveform error: ${e.message}`, 'error'); document.getElementById('load-btn').disabled = false; @@ -2399,7 +2469,7 @@ async function saveEventToDb() { setStatus(`Downloading event #${idx} and saving to DB…`, 'loading'); try { - const r = await fetch(`${api()}/device/event/${idx}/blastware_file?${deviceParams()}`); + const r = await deviceRequest('event_file', { index: idx }); if (!r.ok) { const e = await r.json().catch(() => ({})); throw new Error(e.detail || r.statusText); @@ -2426,7 +2496,7 @@ async function saveEventToDb() { function downloadEventFile() { if (!devHost()) { setStatus('Enter device host first.', 'error'); return; } const idx = currentEvent; - const url = `${api()}/device/event/${idx}/blastware_file?${deviceParams()}`; + const url = `${api()}${deviceUrl('event_file', currentUnit(), { index: idx }).path}`; setStatus(`Downloading event #${idx}…`, 'loading'); // Hidden iframe avoids navigating away from the SPA. FastAPI's FileResponse // sets Content-Disposition: attachment so the browser saves rather than displays. @@ -3594,6 +3664,10 @@ document.addEventListener('keydown', e => { // Default API base to wherever this page was served from — works whether you // hit localhost:8200, 10.0.0.44:8200, or anything else. document.getElementById('api-base').value = window.location.origin; +for (const id of ['dev-serial', 'dev-host', 'dev-port']) { + document.getElementById(id).addEventListener('input', () => { unitConfirmed = null; applyControls(); }); +} +applyControls(); // Reflect any persisted mic-unit preference in the header pill on load _refreshMicUnitToggleLabel(); diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index 0561eaa..1ef84e3 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -169,3 +169,22 @@ def test_the_page_scripts_parse_together(tmp_path): js.write_text("\n;\n".join(scripts)) r = subprocess.run([NODE, "--check", str(js)], capture_output=True, text=True, timeout=30) assert r.returncode == 0, r.stderr + + +def test_every_device_url_is_built_by_deviceUrl(): + """One place builds /device/ URLs, so the series rules cannot be bypassed: + outside the device-routing block the page holds no hand-built device path.""" + src = PAGE.read_text() + outside = re.sub(r"/\* \*/.*?/\* \*/", "", src, flags=re.S) + hand_built = [m.group(0) for m in re.finditer(r"(`\$\{api\(\)\}/device/[^`]*`|'/device/[^']*'|\"/device/[^\"]*\")", outside)] + assert hand_built == [], hand_built + + +def test_device_url_puts_an_event_index_in_the_path(): + # the legacy per-event routes carry the index in the path, not the query + r = run(["deviceUrl", ["event_waveform", BLANK, {"index": 3}]], + ["deviceUrl", ["event_file", S3, {"index": 0}]], + ["deviceUrl", ["event_file", S3]]) + assert r[0] == {"method": "GET", "path": "/device/event/3/waveform?host=h&tcp_port=9034"} + assert r[1] == {"method": "GET", "path": "/device/event/0/blastware_file?serial=BE9441&host=h&tcp_port=9034"} + assert "throws" in r[2] -- 2.54.1 From 9aae3b09deeb4acb7d6a5647de7209354cd2e32a Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 11:54:43 -0400 Subject: [PATCH 125/223] feat(webapp): list and download events by serial, for both series MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Load events with a serial lists the shared EventRef shape as a table: index, time, type, PVS and the three peaks (or —), each row with its own Download. - Download POSTs the row's event_id; SFM checks and stores it. The status bar says what was stored (or that it already was), and the stored event opens in the viewer. A refusal shows the server's detail verbatim. - eventView() (device-routing block, Node-tested) reads both event shapes for the table, the chips and the peaks bar. - A list loaded without a serial keeps the chips and the per-index Load / Save / Download buttons, unchanged; for a serial-loaded list those buttons are off with a tooltip pointing at the rows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 116 ++++++++++++++++++++++++---- tests/test_webapp_device_routing.py | 18 ++++- 2 files changed, 117 insertions(+), 17 deletions(-) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index 5d4c9b7..6482d14 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -987,6 +987,12 @@
+
@@ -1557,6 +1563,24 @@ function changeSummary(body) { return `${body.action}: ${body.outcome}, ${body.verified} (audit ${id8})`; } +// What a chip and the peaks bar show for an event, from either shape: the +// shared EventRef (serial mode) or the legacy event (host/port mode). +function eventView(ev) { + const label = typeof ev.timestamp === 'string' ? ev.timestamp.replace('T', ' ') + : (ev.timestamp && ev.timestamp.display) || `Event ${ev.index}`; + let peaks = null; + if (ev.peaks_ips || ev.peak_vector_sum_ips != null) { + const p = ev.peaks_ips || {}; + peaks = { tran: p.tran ?? null, vert: p.vert ?? null, long: p.long ?? null, + pvs: ev.peak_vector_sum_ips ?? null, micPsi: null }; + } else if (ev.peak_values) { + const pv = ev.peak_values; + peaks = { tran: pv.tran_in_s ?? null, vert: pv.vert_in_s ?? null, long: pv.long_in_s ?? null, + pvs: pv.peak_vector_sum ?? null, micPsi: pv.micl_psi ?? null }; + } + return { label, title: ev.record_type || '', peaks }; +} + function downloadSummary(body) { if (body.inserted === false) return `already stored — ${body.stored_filename}`; return `stored ${body.stored_filename}, ${body.filesize} bytes, check: ${(body.detail || {}).check}`; @@ -1570,7 +1594,8 @@ function downloadSummary(body) { let unitInfo = null; let eventList = []; let storageInfo = null; // /device/events/storage_range — cheap, read on connect -let eventsLoaded = false; // the event chain walk is opt-in; see loadEventList() +let eventsLoaded = false; +let eventsBySerial = false; // the list came from the serial-based /device/events (EventRef shape) // the event chain walk is opt-in; see loadEventList() let currentEvent = 0; let charts = {}; let geoAdcScale = 6.206; @@ -1639,7 +1664,7 @@ async function deviceFetch(action, params = {}, opts = {}) { const body = await r.json().catch(() => ({})); if (!r.ok) { const d = body.detail; - const err = new Error(typeof d === 'string' ? d : (d && d.message) || r.statusText); + const err = new Error(typeof d === 'string' ? d : d ? (d.message || JSON.stringify(d)) : r.statusText); err.status = r.status; err.body = body; throw err; } @@ -1787,11 +1812,17 @@ async function connectUnit() { function setEventButtonsEnabled() { const n = eventList.length; - document.getElementById('load-btn').disabled = n === 0; - document.getElementById('save-btn').disabled = n === 0; - document.getElementById('download-btn').disabled = n === 0; + // A list loaded by serial is downloaded row by row (by event_id); these + // per-index buttons belong to the legacy list. + const bySerial = eventsBySerial; + for (const id of ['load-btn', 'save-btn', 'download-btn']) { + const el = document.getElementById(id); + if (el.dataset.legacyTitle === undefined) el.dataset.legacyTitle = el.title; + el.disabled = n === 0 || bySerial; + el.title = bySerial ? 'For a list loaded without a serial — use a row\'s Download' : el.dataset.legacyTitle; + } document.getElementById('prev-btn').disabled = true; - document.getElementById('next-btn').disabled = n <= 1; + document.getElementById('next-btn').disabled = n <= 1 || bySerial; } // ── Event list (opt-in — this is the slow chain walk) ────────────────────────── @@ -1799,11 +1830,12 @@ async function loadEventList() { if (!devHost()) { setStatus('Connect to a device first.', 'error'); return; } const btn = document.getElementById('load-events-btn'); btn.disabled = true; - setStatus('Walking the event chain — this can take a while…', 'loading'); + setStatus(serialMode() ? 'Listing events…' : 'Walking the event chain — this can take a while…', 'loading'); try { const evData = await deviceFetch('events'); eventList = evData.events || []; eventsLoaded = true; + eventsBySerial = serialMode(); // /device/events re-reads compliance; fold it in. if (evData.device) unitInfo = { ...unitInfo, ...evData.device }; } catch (e) { @@ -2390,11 +2422,20 @@ async function writeCallHome() { function populateEventChips() { const el = document.getElementById('event-chips'); el.innerHTML = ''; + const wrap = document.getElementById('serial-events-wrap'); + wrap.style.display = eventsBySerial && eventList.length ? 'block' : 'none'; + if (eventsBySerial) { + populateSerialEventTable(); + document.getElementById('empty-state').style.display = eventList.length ? 'none' : 'flex'; + updatePeaksBar(null); + return; + } eventList.forEach((ev, i) => { const chip = document.createElement('button'); chip.className = 'event-chip' + (i === 0 ? ' active' : ''); - chip.textContent = ev.timestamp?.display ?? `Event ${ev.index}`; - chip.title = ev.record_type || ''; + const view = eventView(ev); + chip.textContent = view.label; + chip.title = view.title; chip.onclick = () => selectEvent(i); el.appendChild(chip); }); @@ -2403,6 +2444,31 @@ function populateEventChips() { if (eventList.length > 0) updatePeaksBar(eventList[0]); } +function populateSerialEventTable() { + const tbody = document.getElementById('serial-events-tbody'); + tbody.innerHTML = ''; + const ips = v => v != null ? v.toFixed(5) : '—'; + eventList.forEach((ev, i) => { + const view = eventView(ev); + const pk = view.peaks || {}; + const tr = document.createElement('tr'); + for (const text of [ev.index, view.label, view.title || '—', ips(pk.pvs), ips(pk.tran), ips(pk.vert), ips(pk.long)]) { + const td = document.createElement('td'); + td.textContent = text; + tr.appendChild(td); + } + const td = document.createElement('td'); + const btn = document.createElement('button'); + btn.className = 'btn btn-ghost'; + btn.textContent = '⬇ Download'; + btn.title = 'Download this event from the unit, check it and store it; then open it'; + btn.onclick = () => downloadEventBySerial(i, btn); + td.appendChild(btn); + tr.appendChild(td); + tbody.appendChild(tr); + }); +} + function selectEvent(idx) { currentEvent = idx; document.querySelectorAll('.event-chip').forEach((c, i) => c.classList.toggle('active', i === idx)); @@ -2418,16 +2484,17 @@ function stepEvent(delta) { } function updatePeaksBar(ev) { - const pv = ev?.peak_values; + const pk = ev ? eventView(ev).peaks : null; const bar = document.getElementById('peaks-bar'); - if (!pv) { bar.classList.remove('visible'); return; } + if (!pk) { bar.classList.remove('visible'); return; } bar.classList.add('visible'); - qs('pk-tran').textContent = pv.tran_in_s != null ? `${pv.tran_in_s.toFixed(5)} in/s` : '—'; - qs('pk-vert').textContent = pv.vert_in_s != null ? `${pv.vert_in_s.toFixed(5)} in/s` : '—'; - qs('pk-long').textContent = pv.long_in_s != null ? `${pv.long_in_s.toFixed(5)} in/s` : '—'; - const micDbl = pv.micl_psi != null && pv.micl_psi > 0 ? 20 * Math.log10(pv.micl_psi / DBL_REF) : null; + const ips = v => v != null ? `${v.toFixed(5)} in/s` : '—'; + qs('pk-tran').textContent = ips(pk.tran); + qs('pk-vert').textContent = ips(pk.vert); + qs('pk-long').textContent = ips(pk.long); + const micDbl = pk.micPsi != null && pk.micPsi > 0 ? 20 * Math.log10(pk.micPsi / DBL_REF) : null; qs('pk-mic').textContent = micDbl != null ? `${micDbl.toFixed(1)} dBL` : '—'; - qs('pk-pvs').textContent = pv.peak_vector_sum != null ? `${pv.peak_vector_sum.toFixed(5)} in/s` : '—'; + qs('pk-pvs').textContent = ips(pk.pvs); } async function loadWaveform() { @@ -2488,6 +2555,23 @@ async function saveEventToDb() { } } +// A list loaded by serial: download one event by its event_id -- SFM checks it +// and stores it -- then open it from the store. An event already stored says so. +async function downloadEventBySerial(i, btn) { + const ev = eventList[i]; + btn.disabled = true; + setStatus(`Downloading event #${ev.index} (${eventView(ev).label})…`, 'loading'); + try { + const body = await deviceFetch('download', { event_id: ev.event_id }); + setStatus(downloadSummary(body), 'ok'); + if (body.db_event_id) openSidecarModal(body.db_event_id); + } catch (e) { + setStatus(`Download failed: ${e.message}`, 'error'); + } finally { + btn.disabled = false; + } +} + // ── Download the event file to the user's computer ────────────────────────── // // Uses a transient anchor + click trick so the browser surfaces its native diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index 1ef84e3..dac403a 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -24,7 +24,7 @@ PAGE = Path(__file__).resolve().parent.parent / "sfm" / "sfm_webapp.html" NODE = shutil.which("node") pytestmark = pytest.mark.skipif(NODE is None, reason="node is not installed; the page-logic tests need it") -EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", +EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "changeSummary", "downloadSummary"] @@ -188,3 +188,19 @@ def test_device_url_puts_an_event_index_in_the_path(): assert r[0] == {"method": "GET", "path": "/device/event/3/waveform?host=h&tcp_port=9034"} assert r[1] == {"method": "GET", "path": "/device/event/0/blastware_file?serial=BE9441&host=h&tcp_port=9034"} assert "throws" in r[2] + + +def test_event_view_reads_both_event_shapes(): + shared = {"event_id": "BE9441:0111f210:20261026170036", "index": 2, "timestamp": "2026-10-26T17:00:36", + "record_type": "histogram", "peak_vector_sum_ips": 1.083, + "peaks_ips": {"tran": 0.25, "vert": 1.08, "long": 0.195}} + legacy = {"index": 0, "timestamp": {"display": "2026-10-26 16:06:37"}, "record_type": "Waveform", + "peak_values": {"tran_in_s": 0.03, "vert_in_s": 0.095, "long_in_s": 0.02, + "peak_vector_sum": 0.1, "micl_psi": 0.0001}} + bare = {"index": 5} + a, b, c = run(["eventView", [shared]], ["eventView", [legacy]], ["eventView", [bare]]) + assert a == {"label": "2026-10-26 17:00:36", "title": "histogram", + "peaks": {"tran": 0.25, "vert": 1.08, "long": 0.195, "pvs": 1.083, "micPsi": None}} + assert b == {"label": "2026-10-26 16:06:37", "title": "Waveform", + "peaks": {"tran": 0.03, "vert": 0.095, "long": 0.02, "pvs": 0.1, "micPsi": 0.0001}} + assert c == {"label": "Event 5", "title": "", "peaks": None} -- 2.54.1 From 3f249e23227fd42f27ef76e1f94d3fe9c5bbc8cf Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 11:56:36 -0400 Subject: [PATCH 126/223] feat(webapp): start/stop through the audited serial path, with the honest result - With a serial, Start / Stop ask first ("Start monitoring on BE9441?"), then POST once to the audited change -- never retried; both buttons stay off while it is in flight, so a double click cannot send twice. - The status bar shows changeSummary() of the ChangeResult, on a 409/502 too (dry run, already-in-state, confirmed a -> b, or the outcome and read-back); an error without one shows its detail verbatim; no reply from SFM says the command may have been sent and where to look, rather than that nothing was. - Then one status read updates the panel. The legacy 5 s confirm poll is not used in serial mode; with a blank serial start/stop are unchanged. - Diagnostics' Stop, which goes the same way in serial mode, shows the same summary; deviceFetch errors carry it for any non-200 ChangeResult. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index 6482d14..e02d8e7 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -1664,7 +1664,8 @@ async function deviceFetch(action, params = {}, opts = {}) { const body = await r.json().catch(() => ({})); if (!r.ok) { const d = body.detail; - const err = new Error(typeof d === 'string' ? d : d ? (d.message || JSON.stringify(d)) : r.statusText); + const err = new Error(body.outcome ? changeSummary(body) + : typeof d === 'string' ? d : d ? (d.message || JSON.stringify(d)) : r.statusText); err.status = r.status; err.body = body; throw err; } @@ -1908,14 +1909,17 @@ function updateMonitorPanel(s) { // Start/stop: in serial mode only for a unit whose series its own answer // confirmed; without a serial, as before (0x96/0x97 mean the same on both). let lastMonitoring = null; +let changeInFlight = false; // one start/stop at a time: a double click must not send twice function setMonitorButtons() { - const allowed = serialMode() ? controlsFor(currentUnit()).startStop : Boolean(devHost()); + const allowed = !changeInFlight + && (serialMode() ? controlsFor(currentUnit()).startStop : Boolean(devHost())); document.getElementById('mon-start-btn').disabled = !allowed || lastMonitoring === true; document.getElementById('mon-stop-btn').disabled = !allowed || lastMonitoring === false; } async function startMonitoring() { if (!devHost()) return; + if (serialMode()) { await changeMonitoring('start'); return; } const btn = document.getElementById('mon-start-btn'); btn.disabled = true; btn.textContent = '…'; setStatus('Starting monitoring…', 'loading'); @@ -1966,6 +1970,7 @@ async function _pollMonitorConfirm(attempt) { async function stopMonitoring() { if (!devHost()) return; + if (serialMode()) { await changeMonitoring('stop'); return; } const btn = document.getElementById('mon-stop-btn'); btn.disabled = true; btn.textContent = '…'; setStatus('Stopping monitoring…', 'loading'); @@ -1980,6 +1985,37 @@ async function stopMonitoring() { btn.textContent = '■ Stop'; } +// Serial mode: SFM's audited change -- identity and state read first, one send, +// never retried, then read back. The result body says what the unit did, on a +// 409/502 too; only the read that follows decides the panel. +async function changeMonitoring(action) { + const serial = normSerial(currentUnit().serial); + const verb = action === 'start' ? 'Start' : 'Stop'; + if (!confirm(`${verb} monitoring on ${serial}?`)) return; + const btn = document.getElementById(action === 'start' ? 'mon-start-btn' : 'mon-stop-btn'); + const label = btn.textContent; + changeInFlight = true; setMonitorButtons(); btn.textContent = '…'; + setStatus(action === 'start' ? 'Starting — the unit runs its sensor check first (about 35 s)' + : 'Stopping…', 'loading'); + try { + const r = await deviceRequest(action); + const body = await r.json().catch(() => ({})); + if (body.outcome) { + setStatus(changeSummary(body), r.ok ? 'ok' : 'error'); + } else { + const d = body.detail; + setStatus(`${verb} monitoring failed: ${typeof d === 'string' ? d : d ? JSON.stringify(d) : r.statusText}`, 'error'); + } + } catch (e) { + // No reply is not "nothing sent": the request may have reached the unit. + setStatus(`${verb} monitoring: no reply from SFM (${e.message}) — it may have been sent; ` + + `check the unit's state and GET /db/device_commands`, 'error'); + } + changeInFlight = false; btn.textContent = label; + await refreshMonitorStatus(); + setMonitorButtons(); +} + // ── Device tab ───────────────────────────────────────────────────────────────── function populateDeviceTab() { document.getElementById('no-device-msg').style.display = 'none'; @@ -2126,8 +2162,8 @@ async function diagStopMonitoring() { const btn = document.getElementById('diag-stop-btn'); btn.disabled = true; diagResult('diag-stop-result', 'Sending…'); try { - await deviceFetch('stop'); - diagResult('diag-stop-result', 'Stop acknowledged — recording halted.', 'ok'); + const r = await deviceFetch('stop'); + diagResult('diag-stop-result', r.outcome ? changeSummary(r) : 'Stop acknowledged — recording halted.', 'ok'); refreshDiagnostics(); } catch (e) { diagResult('diag-stop-result', `Failed: ${e.message}`, 'error'); -- 2.54.1 From a709d2388dccb12b033932e7e963bce87b868f6f Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 11:59:11 -0400 Subject: [PATCH 127/223] feat(webapp): config and call-home writes wait for phases 4-5; Diagnostics only for a confirmed Series-3 unit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Config, with a serial: Read shows the unit's shared UnitSettings (setup, record mode, sample rate, record time, histogram interval, geo trigger, notes; — for null) in place of the write form. settingsRows() is in the device-routing block, Node-tested; the rows are rendered as text, since setup names and notes come from the unit. - Write stays off for both series (and without a serial), tooltip "Coming in phase 5 (#46)"; Call Home write likewise, "Coming in phase 4". - Call Home read follows controlsFor().callHomeRead; for a confirmed Series 4 the tab says "Not yet available for Series 4". - Diagnostics: every button follows controlsFor().diagnostics (Task 3), and a refresh for anything but a confirmed Series-3 unit sends nothing and says why. Its requests carry the typed serial, so the server guard checks it. - Without a serial the legacy reads are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 70 ++++++++++++++++++++++++++++- tests/test_webapp_device_routing.py | 18 +++++++- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index e02d8e7..b7c251f 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -1008,7 +1008,12 @@ ═══════════════════════════════════════════════════════════════════ -->
-
+ + +
@@ -1233,6 +1238,7 @@ +
@@ -1581,6 +1587,24 @@ function eventView(ev) { return { label, title: ev.record_type || '', peaks }; } +// What the Config tab's serial-mode Read shows for a UnitSettings reply. +function settingsRows(st) { + const dash = v => (v == null || v === '' ? '—' : v); + const hi = st.histogram_interval_s; + const rows = [ + ['Setup Name', dash(st.setup_name)], + ['Record Mode', dash(st.record_mode)], + ['Sample Rate', st.sample_rate != null ? `${st.sample_rate} sps` : '—'], + ['Record Time', st.record_time_s != null ? `${st.record_time_s.toFixed(2)} s` : '—'], + ['Histogram Interval', hi == null ? '—' : hi < 60 ? `${hi} s` : `${hi / 60} min`], + ['Geo Trigger', st.geo_trigger_ips != null ? `${st.geo_trigger_ips.toFixed(4)} in/s` : '—'], + ]; + const notes = Object.entries(st.notes || {}); + if (!notes.length) rows.push(['Notes', '—']); + for (const [k, v] of notes) rows.push([`Note: ${k}`, dash(v)]); + return rows; +} + function downloadSummary(body) { if (body.inserted === false) return `already stored — ${body.stored_filename}`; return `stored ${body.stored_filename}, ${body.filesize} bytes, check: ${(body.detail || {}).check}`; @@ -1686,7 +1710,11 @@ function applyControls() { cw.disabled = !c.configWrite; cw.title = c.reasons.configWrite; const hw = document.getElementById('ch-write-btn'); hw.disabled = !c.callHomeWrite; hw.title = c.reasons.callHomeWrite; - document.getElementById('ch-read-btn').disabled = !c.callHomeRead; + const chr = document.getElementById('ch-read-btn'); + chr.disabled = !c.callHomeRead; + const s4 = series === 4 ? 'Not yet available for Series 4' : ''; + chr.title = s4; + document.getElementById('ch-series-note').textContent = s4; setMonitorButtons(); } @@ -2069,6 +2097,19 @@ function populateDeviceTab() { renderTable('project-table', projectRows); } +function renderTextTable(id, rows) { + const el = document.getElementById(id); + el.innerHTML = ''; + for (const [label, value] of rows) { + const row = document.createElement('div'); + row.className = 'dev-table-row'; + const l = document.createElement('div'); l.className = 'dtr-label'; l.textContent = label; + const v = document.createElement('div'); v.className = 'dtr-value'; v.textContent = value; + row.append(l, v); + el.appendChild(row); + } +} + function renderTable(id, rows) { const el = document.getElementById(id); el.innerHTML = ''; @@ -2120,6 +2161,10 @@ function diagResult(id, text, cls) { async function refreshDiagnostics() { if (!devHost()) return; const st = document.getElementById('diag-status'); + if (!controlsFor(currentUnit()).diagnostics) { + if (st) { st.textContent = 'Diagnostics are MiniMate tools: connect to a Series-3 unit first.'; st.className = ''; } + return; + } if (st) { st.textContent = 'Reading…'; st.className = 'loading'; } const [mon, store, idx] = await Promise.all([ @@ -2259,8 +2304,29 @@ function clearConfigForm() { setCfgStatus(''); } +// Serial mode: the shared UnitSettings, read-only (writes wait for phase 5). +async function readSettingsBySerial() { + const btn = document.getElementById('cfg-read-btn'); + btn.disabled = true; + setCfgStatus('Reading settings from the unit…'); + try { + const st = await deviceFetch('settings'); + renderTextTable('cfg-settings-table', settingsRows(st)); + document.getElementById('cfg-settings').style.display = 'block'; + document.getElementById('cfg-form').style.display = 'none'; + setCfgStatus(`Settings read from ${st.serial}.`, 'ok'); + } catch (e) { + setCfgStatus(`Read failed: ${e.message}`, 'error'); + } finally { + btn.disabled = false; + } +} + async function readConfig() { if (!devHost()) { setCfgStatus('Not connected.', 'error'); return; } + if (serialMode()) { await readSettingsBySerial(); return; } + document.getElementById('cfg-settings').style.display = 'none'; + document.getElementById('cfg-form').style.display = ''; setCfgStatus('Reading config from device…'); document.getElementById('cfg-read-btn').disabled = true; try { diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index dac403a..7c91bfa 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -24,7 +24,7 @@ PAGE = Path(__file__).resolve().parent.parent / "sfm" / "sfm_webapp.html" NODE = shutil.which("node") pytestmark = pytest.mark.skipif(NODE is None, reason="node is not installed; the page-logic tests need it") -EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", +EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "settingsRows", "changeSummary", "downloadSummary"] @@ -204,3 +204,19 @@ def test_event_view_reads_both_event_shapes(): assert b == {"label": "2026-10-26 16:06:37", "title": "Waveform", "peaks": {"tran": 0.03, "vert": 0.095, "long": 0.02, "pvs": 0.1, "micPsi": 0.0001}} assert c == {"label": "Event 5", "title": "", "peaks": None} + + +def test_settings_rows_show_unit_settings_with_a_dash_for_null(): + full = {"serial": "UM20147", "series": 4, "setup_name": "TMI default", "record_mode": "Waveform", + "sample_rate": 1024, "record_time_s": 2.0, "histogram_interval_s": 900, "geo_trigger_ips": 0.02, + "notes": {"project": "Bench", "client": ""}} + empty = {"serial": "BE9441", "series": 3, "setup_name": None, "record_mode": None, "sample_rate": None, + "record_time_s": None, "histogram_interval_s": None, "geo_trigger_ips": None, "notes": {}} + a, b, c = run(["settingsRows", [full]], ["settingsRows", [empty]], + ["settingsRows", [{**empty, "histogram_interval_s": 15}]]) + assert a == [["Setup Name", "TMI default"], ["Record Mode", "Waveform"], ["Sample Rate", "1024 sps"], + ["Record Time", "2.00 s"], ["Histogram Interval", "15 min"], ["Geo Trigger", "0.0200 in/s"], + ["Note: project", "Bench"], ["Note: client", "—"]] + assert b == [["Setup Name", "—"], ["Record Mode", "—"], ["Sample Rate", "—"], ["Record Time", "—"], + ["Histogram Interval", "—"], ["Geo Trigger", "—"], ["Notes", "—"]] + assert c[4] == ["Histogram Interval", "15 s"] -- 2.54.1 From c4cb979dfb2dfd30b4c6551f731264a493682485 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 12:00:12 -0400 Subject: [PATCH 128/223] feat(webapp): the status panel shows the unit's clock and event count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task 3's brief asked for them and they were missed: with a serial, the panel now shows UnitStatus.device_time and event_count, "—" where null (Series 3 reports both as null). Without a serial the two fields stay hidden. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index b7c251f..3141c17 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -916,6 +916,14 @@ Memory free —
+ +
@@ -1929,6 +1937,15 @@ function updateMonitorPanel(s) { const kb = (bytes, k) => bytes != null ? Math.round(bytes / 1024) : k; const totalKb = kb(s.memory_total_bytes, s.memory_total_kb); const freeKb = kb(s.memory_free_bytes, s.memory_free_kb); + // The unit's clock and event count come only in the shared shape (serial + // mode); Series 3 reports both as null. + const shared = 'monitoring' in s; + for (const [id, v] of [['mon-time', s.device_time ? s.device_time.replace('T', ' ') : '—'], + ['mon-events', s.event_count ?? '—']]) { + const el = document.getElementById(id); + if (shared) el.textContent = v; + el.parentElement.style.display = shared ? '' : 'none'; + } if (volts != null) batEl.textContent = `${volts.toFixed(2)} V`; if (totalKb != null) memTEl.textContent = `${totalKb} KB`; if (freeKb != null) memFEl.textContent = `${freeKb} KB`; -- 2.54.1 From 073284fc88b61ac761e8a750a07cb3ddbcb96ead Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 12:01:39 -0400 Subject: [PATCH 129/223] docs: phase 1c -- the webapp by serial, and the Series-3 guard on legacy writes - CLAUDE.md: a 1c entry under Where things stand (serial mode, what follows the unit's own answer, writes off until phases 4-5, the Node-run page tests) and the legacy-route guard in the REST API notes, with why the stop tools are exempt. - Spec: the 1c build status; the ring-path Runs A/B are still owed before serial mode is used on a unit that calls home to THOR; which parked 1c items the page settles (CORS: same origin; the S4 mic is not shown). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 37 ++++++++++++++++++- .../2026-10-20-sfm-series4-parity-design.md | 24 ++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1de231b..8def3a0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -164,7 +164,37 @@ Read this first when picking the project back up. start's read-back waited out the ~30 s sensor check and re-sent the wake (`9886422`, `ca5c401`; a monitoring MiniMate answers nothing until woken, and nothing during its sensor check). Still owed before merge: #47 from dev, and - `persist_download` aligned with dev's waveform-time restamp (spec). Next: 1c. + `persist_download` aligned with dev's waveform-time restamp (spec). +- **Phase 1c: the SFM webapp by serial (2026-10-29), built; bench pass owed.** + `sfm/sfm_webapp.html` has a **Serial** field beside host/port. With one, the + Live tabs use the serial-based routes for both series: identify, status (now + with the unit's clock and event count), settings (read-only), the event list + with a Download per row (checked, stored, then opened from the store), and + audited start/stop (asks first, one send, shows the ChangeResult as it is). + Hang up appears for a Series 4. Every series-specific control follows the + unit's own `/device/info` answer, never the typed serial, and drops the + moment the serial, host or port is edited. Config and call-home **writes are + off for both series** (phases 5 and 4); Diagnostics is enabled only for a + confirmed Series 3. Without a serial every read behaves as before. + The page keeps every routing and button rule in one block of pure functions + between `/* */` markers, run through **Node** by + `tests/test_webapp_device_routing.py` (skipped when `node` is absent); a + static test fails if a `/device/` URL is built anywhere else. + **Server side:** the legacy Series-3 writes and erase -- `POST /device/config` + (and `/config/project`), `/events/erase`, `/rescue` (when it disables ACH or + erases), `POST /device/call_home` -- read the unit's serial (or reuse the one + `connect()` read) and refuse 409, nothing sent, unless it is Series 3 and, + when `serial=` was given, that unit. 0xA2 is CONFIRM ERASE on a MiniMate and + ends a call-home on a Micromate. The stop tools (legacy `monitor/start|stop`, + `stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt: 0x96/0x97 mean + the same on both series, and the blind tools must reach a unit too wedged to + answer. + ⚠ **Before serial mode is used on a unit that calls home to THOR, run the + ring-path Runs A/B** (spec, *Open questions ... for the bench*): a held line + holds the modem's single TCP session. The page never polls (every request is + a click), SFM hangs up on RADIO RING, and **Hang up** releases the line at + once; whether a call-home still reaches THOR is unmeasured. + Next: the bench pass on BE9441 and UM20147, then phases 4 and 5. - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor @@ -1582,6 +1612,11 @@ POST /device/hangup?host=1.2.3.4&tcp_port=9034 ← release a held Serie nothing; `even_if_already=true` sends even when the unit is already in that state). A `UM` serial on any other `/device/*` route is 501; any request taking the legacy Series-3 path at a held Series-4 address is 409. +The legacy Series-3 writes and erase (`POST /device/config`, `/config/project`, +`/events/erase`, `/rescue`, `POST /device/call_home`) take an optional `serial=` and +refuse 409, nothing sent, when the unit at the address does not answer as Series 3 +or is not the named unit. The stop tools (`monitor/start|stop` without a serial, +`stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt by design. SFM must run a single uvicorn worker (locks and held lines are per process). Server retries once on `ProtocolError` for TCP connections (handles cold-boot timing). diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index e256072..6b10e95 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -490,6 +490,30 @@ Each safety piece arrives with its first real use, so nothing sits untested. address answer 503 + `Retry-After` until it expires, and `POST /device/hangup` clears it, with its length taken from Run A. If THOR gets the call anyway, no cool-down is needed. + - **Built 2026-10-29** (plan `docs/superpowers/plans/2026-10-28-sfm-phase1c-webapp.md`). + A Serial field beside host/port; with one, identify, status, settings + (read-only), events (a Download per row) and audited start/stop go + through the serial routes for both series, and Hang up shows for a + Series 4. Series-specific controls follow the unit's own `/device/info` + answer and drop when the serial, host or port is edited; config and + call-home writes are off for both series until phases 5 and 4; + Diagnostics needs a confirmed Series 3. Without a serial the page reads + as before. The rules are pure functions in one marked block, tested + through Node (`tests/test_webapp_device_routing.py`). + **Server side, the same phase:** the legacy Series-3 writes and erase + (`/device/config`, `/config/project`, `/events/erase`, `/rescue`, + `POST /device/call_home`) refuse 409 before any write unless the unit + answers as Series 3 (and as the named unit, given `serial=`). The stop + tools stay exempt: 0x96/0x97 mean the same on both series. + - ⚠ **The ring-path Runs A/B have not been run.** The page does not poll + (every request is a click), SFM hangs up on RADIO RING, and Hang up + releases a held line, but whether a call-home reaches THOR while SFM + holds the line is unmeasured. Run them before serial mode is used on a + unit that calls home to THOR, i.e. before this branch merges. + - Of the items parked for 1c below: **CORS ordering** does not bite the + page, which SFM serves itself (same origin); the **Series-4 mic** is not + shown (the event list shows geophone peaks only). The rest are server-side + and stay open. 2. **Encoder + opcode guard + dry run + frame-reproduction tests.** Still nothing sent. (2026-10-22) "Dry run" in this phase means the **write plan**: the exact -- 2.54.1 From 9082236c5e1abc5f227e72236ff605cfe3b1ec7e Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 12:16:49 -0400 Subject: [PATCH 130/223] fix(webapp): the final review's three page findings - The arrow keys reached the legacy per-index waveform route in serial mode, even with no list loaded (an unlocked MiniMate chain walk + 5A on the same modem session). perIndexLive() is now the one rule for the per-index buttons, the chips and the keyboard: live only for a list loaded without a serial that has events. - A failed reconnect left the previous unit's confirmation live (badge, Diagnostics incl. the unguarded blind/slow-drip stops, call-home read). connectUnit() now drops it before it identifies; only this answer confirms. - Unit strings reached innerHTML: the Device tab's cards (active_setup, new in 1c) and its compliance/project tables now render as text, and Diagnostics' error spans go through escapeHtml(). - CLAUDE.md: the ring-path Runs A/B are a merge gate (the spec's prerequisite to a webapp sending serial), not only a use-time one. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 4 ++-- sfm/sfm_webapp.html | 32 +++++++++++++++++++++++------ tests/test_webapp_device_routing.py | 15 +++++++++++++- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8def3a0..b84f053 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -189,8 +189,8 @@ Read this first when picking the project back up. `stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt: 0x96/0x97 mean the same on both series, and the blind tools must reach a unit too wedged to answer. - ⚠ **Before serial mode is used on a unit that calls home to THOR, run the - ring-path Runs A/B** (spec, *Open questions ... for the bench*): a held line + ⚠ **Before this branch merges, run the ring-path Runs A/B** -- the spec's + prerequisite to a webapp sending `serial` (*Open questions ... for the bench*): a held line holds the modem's single TCP session. The page never polls (every request is a click), SFM hangs up on RADIO RING, and **Hang up** releases the line at once; whether a call-home still reaches THOR is unmeasured. diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index 3141c17..327d0e9 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -1613,6 +1613,18 @@ function settingsRows(st) { return rows; } +// The legacy per-index routes (Load / Save / Download, prev/next, the arrow +// keys) address events by position on the MiniMate path: live only for a list +// loaded without a serial that has events. +function perIndexLive({ bySerial, count }) { return !bySerial && count > 0; } + +// A unit's own string (setup name, project, an error naming a serial) placed +// into markup must stay text. +function escapeHtml(v) { + return String(v ?? '').replace(/[&<>"']/g, + c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); +} + function downloadSummary(body) { if (body.inserted === false) return `already stored — ${body.stored_filename}`; return `stored ${body.stored_filename}, ${body.filesize} bytes, check: ${(body.detail || {}).check}`; @@ -1790,6 +1802,9 @@ function switchTab(name) { // ── Connect ──────────────────────────────────────────────────────────────────── async function connectUnit() { if (!devHost()) { setStatus('Enter a device host first.', 'error'); return; } + // Whatever answered last time no longer counts: only this identify confirms. + unitConfirmed = null; + applyControls(); const btn = document.getElementById('connect-btn'); btn.disabled = true; @@ -1852,14 +1867,15 @@ function setEventButtonsEnabled() { // A list loaded by serial is downloaded row by row (by event_id); these // per-index buttons belong to the legacy list. const bySerial = eventsBySerial; + const live = perIndexLive({ bySerial, count: n }); for (const id of ['load-btn', 'save-btn', 'download-btn']) { const el = document.getElementById(id); if (el.dataset.legacyTitle === undefined) el.dataset.legacyTitle = el.title; - el.disabled = n === 0 || bySerial; + el.disabled = !live; el.title = bySerial ? 'For a list loaded without a serial — use a row\'s Download' : el.dataset.legacyTitle; } document.getElementById('prev-btn').disabled = true; - document.getElementById('next-btn').disabled = n <= 1 || bySerial; + document.getElementById('next-btn').disabled = !live || n <= 1; } // ── Event list (opt-in — this is the slow chain walk) ────────────────────────── @@ -2083,7 +2099,9 @@ function populateDeviceTab() { for (const {label, value} of cardData) { const c = document.createElement('div'); c.className = 'dev-card'; - c.innerHTML = `
${label}
${value}
`; + const l = document.createElement('div'); l.className = 'dev-card-label'; l.textContent = label; + const v = document.createElement('div'); v.className = 'dev-card-value'; v.textContent = value; + c.append(l, v); cards.appendChild(c); } @@ -2101,7 +2119,7 @@ function populateDeviceTab() { ['ADC Scale Factor (geo)', cc.geo_adc_scale != null ? `${cc.geo_adc_scale.toFixed(4)} in/s` : '—'], ['Setup Name', cc.setup_name || '—'], ]; - renderTable('compliance-table', complianceRows); + renderTextTable('compliance-table', complianceRows); // Project table const projectRows = [ @@ -2111,7 +2129,7 @@ function populateDeviceTab() { ['Sensor Location', cc.sensor_location || '—'], ['Notes', cc.notes || '—'], ]; - renderTable('project-table', projectRows); + renderTextTable('project-table', projectRows); } function renderTextTable(id, rows) { @@ -2192,7 +2210,7 @@ async function refreshDiagnostics() { if (!store._err) storageInfo = store; - const err = v => `${v}`; + const err = v => `${escapeHtml(v)}`; const rows = []; rows.push(['Monitoring', mon._err ? err(mon._err) @@ -2589,6 +2607,8 @@ function populateSerialEventTable() { } function selectEvent(idx) { + // The arrow keys reach here too: they obey the same rule as the buttons. + if (!perIndexLive({ bySerial: eventsBySerial, count: eventList.length })) return; currentEvent = idx; document.querySelectorAll('.event-chip').forEach((c, i) => c.classList.toggle('active', i === idx)); document.getElementById('prev-btn').disabled = idx <= 0; diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index 7c91bfa..c1f6025 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -24,7 +24,7 @@ PAGE = Path(__file__).resolve().parent.parent / "sfm" / "sfm_webapp.html" NODE = shutil.which("node") pytestmark = pytest.mark.skipif(NODE is None, reason="node is not installed; the page-logic tests need it") -EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "settingsRows", +EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "settingsRows", "perIndexLive", "escapeHtml", "changeSummary", "downloadSummary"] @@ -220,3 +220,16 @@ def test_settings_rows_show_unit_settings_with_a_dash_for_null(): assert b == [["Setup Name", "—"], ["Record Mode", "—"], ["Sample Rate", "—"], ["Record Time", "—"], ["Histogram Interval", "—"], ["Geo Trigger", "—"], ["Notes", "—"]] assert c[4] == ["Histogram Interval", "15 s"] + + +def test_the_per_index_routes_follow_the_list_not_the_keyboard(): + # the legacy per-index routes (Load / Save / Download / arrow keys) are live + # only for a list loaded without a serial that has events + r = run(["perIndexLive", [{"bySerial": False, "count": 2}]], ["perIndexLive", [{"bySerial": True, "count": 2}]], + ["perIndexLive", [{"bySerial": False, "count": 0}]], ["perIndexLive", [{"bySerial": True, "count": 0}]]) + assert r == [True, False, False, False] + + +def test_escape_html_makes_a_unit_string_inert(): + r = run(["escapeHtml", ['Bench &\'']], ["escapeHtml", [None]], ["escapeHtml", [42]]) + assert r == ["Bench <b id="x">&'", "", "42"] -- 2.54.1 From 2560ef4586f742c45e297776797bd24136ad0694 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 13:12:29 -0400 Subject: [PATCH 131/223] docs: THOR's watchdog interval is a setting; the ring-path test varies it - micromate reference: the watchdog can check every 5 s, hourly or never (Brian, operator-reported). The 10-14 "reconnects continuously" describes that THOR's setting, not fixed behaviour; whether a check holds the line, and how a call-home reaches THOR with the watchdog off, are unmeasured. - spec, ring-path test: the old setup ("a unit THOR is not otherwise watching") would not test the production path, since THOR receives a call-home on its own connection. Revised: UM20147 as a THOR test unit; Run 0 baseline with the watchdog off; Run A with SFM holding the line; Run A2 and Run B at the fleet's watchdog setting; after the 1c bench pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- docs/micromate_protocol_reference.md | 10 ++++++ .../2026-10-20-sfm-series4-parity-design.md | 34 ++++++++++++++----- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 8518ebc..022561b 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2929,6 +2929,16 @@ There is no inbound connection, no dial, nothing to accept. to every unit continuously — 1,039 lines of it in 37 minutes. The call-home mechanism depends on that connection existing. +> **2026-10-29 (Brian, operator-reported; not measured by us):** the watchdog's +> interval is a THOR setting. It can check every 5 s, every hour, or never. The +> 1,039 lines above were taken at whatever that THOR was set to, so "continuously" +> describes that setting, not THOR's fixed behaviour. Two things are still +> unmeasured: whether a check holds the line open afterwards or drops it, and +> how a unit's call-home reaches THOR when the watchdog is set to never (the +> modem dialling out to `ListenerAchTcp`, presumably, which this capture never +> saw used). The ring-path bench test in the parity spec now varies this +> setting on purpose. + #### THOR has a second, unused ACH path `ListenerAchTcp` logs `Waiting for a ACH connection on :: Port 12346` — and in diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 6b10e95..ae7aaec 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -851,19 +851,35 @@ Open questions: 🔶 Inferred: 60 s between attempts (`0x2C` content `[120:122]` = `00 3c`, Series III's "time between retries" offset), and about 21 s of ringing per attempt (10-14 capture). - - *Setup:* a bench Micromate on a modem whose destination is the office - THOR-ACH server, and a unit THOR is not otherwise watching. SFM runs on a - test port with a scratch DB. Keep THOR's ACH log open. - - **Run A, one call-up:** SFM calls the unit up and holds the line (any - serial-named read). Trigger a call-home on the unit. Record: + - ~~*Setup:* a bench Micromate on a modem whose destination is the office + THOR-ACH server, and a unit THOR is not otherwise watching.~~ + **Revised 2026-10-29:** THOR receives a call-home on its *own* connection to + the unit (10-14, measured), so a unit THOR does not watch would not test the + production path. And THOR's watchdog interval is a THOR setting -- every 5 s, + hourly, or never (Brian) -- so the runs vary it on purpose. + - *Setup:* UM20147 added to THOR as a test unit, its modem's destination set to + the office THOR server. SFM runs from the parity branch on a test port with + a scratch DB and a timestamped log (it logs every ring and hang-up). THOR's + ACH log open; note THOR's clock against ours. Run after the 1c bench pass: + the call-home uploads UM20147's events, and may erase them per THOR's + test-unit settings. + - **Run 0, baseline (watchdog never, nobody on the line):** trigger a + call-home. Does it reach THOR -- i.e. does the modem dial out by itself? + - **Run A, one call-up (watchdog never):** SFM calls the unit up and holds + the line (any serial-named read). Trigger a call-home. Record: - whether SFM logs the RADIO RING and hangs up, with the time; - whether and when THOR starts a session (its ACH log); - the number and spacing of rings and attempts. - - **Run B, a poller:** as A, but a script requests the unit's status every - ~10 s throughout. If THOR still gets the call, no cool-down is needed; if - the poller keeps the call from reaching THOR, build it, sized from Run A. + - **Run A2 (watchdog at the fleet's setting):** as A, with THOR competing for + the line. First: can SFM get on at all, and does a watchdog check hold the + line or drop it? Then: after SFM hangs up on the ring, does THOR get back on + before the unit's next attempt? + - **Run B, a poller (watchdog at the fleet's setting):** as A2, but a script + requests the unit's status every ~10 s throughout. If THOR still gets the + call, no cool-down is needed; if the poller keeps the call from reaching + THOR, build it, sized from Run A. - *Also settles:* whether the modem routes a call-home to its destination - on its own, in which case SFM never sees a ring and THOR gets the call + on its own (Run 0), in which case SFM never sees a ring and THOR gets the call while SFM is still connected. - The ack for start/stop when the unit is already in that state. ✅ **Answered for stop (2026-10-25, UM20147):** a stop sent to an idle unit -- 2.54.1 From ee02874cb0965b1c14504c16402448d5cc6d20c8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 13:15:44 -0400 Subject: [PATCH 132/223] feat(sfm): opt-in raw SUB 0x49 code on a Series-4 status read GET /device/monitor/status?serial=UM...&run_state=true adds detail.run_state = {code, name}. For the ring-path bench test: the code during and after a call-home (0x01 for ~18 s after a stop, inferred to be call-home attempts; 0x03 = calling home) is what the test watches. Opt-in because it is one more round trip (~0.65 s on cellular); a plain status read is unchanged. Series 3 has no 0x49 and ignores it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/access.py | 7 +++++-- sfm/device_access/s4.py | 8 ++++++-- sfm/server.py | 5 ++++- tests/test_device_access_s4.py | 9 +++++++++ tests/test_server_device_access.py | 8 ++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/sfm/device_access/access.py b/sfm/device_access/access.py index 72e2c34..a691f88 100644 --- a/sfm/device_access/access.py +++ b/sfm/device_access/access.py @@ -62,8 +62,11 @@ class DeviceAccess: def identify(self, address: UnitAddress, serial: str) -> UnitInfo: return self._dispatch(address, serial, self._s3.identify, s4_identify) - def status(self, address: UnitAddress, serial: str) -> UnitStatus: - return self._dispatch(address, serial, self._s3.status, s4_status) + def status(self, address: UnitAddress, serial: str, *, run_state: bool = False) -> UnitStatus: + """`run_state` adds Series 4's raw SUB 0x49 code to `detail` (one more + round trip); Series 3 has no 0x49 and ignores it.""" + return self._dispatch(address, serial, self._s3.status, + lambda client, s: s4_status(client, s, run_state=run_state)) def settings(self, address: UnitAddress, serial: str) -> UnitSettings: return self._dispatch(address, serial, self._s3.settings, s4_settings) diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index 10961c6..87e929c 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -249,14 +249,18 @@ def s4_identify(client: Any, serial: str) -> UnitInfo: ) -def s4_status(client: Any, serial: str) -> UnitStatus: +def s4_status(client: Any, serial: str, run_state: bool = False) -> UnitStatus: st = client.get_state() count = client.get_event_count() + detail = {} + if run_state: # one more round trip, so only when asked (the ring-path bench test) + rs = client.read_run_state() + detail["run_state"] = {"code": rs.code, "name": rs.name} return UnitStatus( serial=serial, series=4, monitoring=st.monitoring, battery_volts=st.battery_volts, memory_total_bytes=st.memory_total_bytes, memory_free_bytes=st.memory_free_bytes, device_time=st.device_time.isoformat() if st.device_time else None, - event_count=count, + event_count=count, detail=detail, ) diff --git a/sfm/server.py b/sfm/server.py index 519789e..58b06e8 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -1234,6 +1234,8 @@ def device_monitor_status( tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"), force: bool = Query(False, description="Bypass cache and re-read from device"), serial: Optional[str] = Query(None, description=_SERIAL_DOC), + run_state: bool = Query(False, description="With a UM serial: also read SUB 0x49 " + "(one more round trip) and return its raw code in detail.run_state"), ) -> dict: """ Read monitoring status from the device. @@ -1251,7 +1253,8 @@ def device_monitor_status( """ if serial: return _via_device_access( - lambda: _device_access().status(_unit_address(port, baud, host, tcp_port), serial)) + lambda: _device_access().status(_unit_address(port, baud, host, tcp_port), serial, + run_state=run_state)) baud = 38400 if baud is None else baud cache = get_cache() conn_key = SFMCache.make_conn_key(host, tcp_port, port, baud) diff --git a/tests/test_device_access_s4.py b/tests/test_device_access_s4.py index 2116fc2..c59e657 100644 --- a/tests/test_device_access_s4.py +++ b/tests/test_device_access_s4.py @@ -280,6 +280,15 @@ def test_s4_status_includes_the_cheap_event_count(): assert st.device_time == "2026-10-20T18:07:58" +def test_s4_status_reads_0x49_only_when_asked(): + # speed: 0x49 is one more round trip, so a plain status never reads it + fake = FakeMicromateClient(run_states=[0x01]) + assert "run_state" not in s4_status(fake, "UM20147").detail + assert "read_run_state" not in fake.calls + st = s4_status(fake, "UM20147", run_state=True) + assert st.detail["run_state"] == {"code": 1, "name": "unknown(0x01)"} + + def test_s4_settings_maps_the_decoded_setup(): s = s4_settings(FakeMicromateClient(), "UM20147") assert (s.series, s.setup_name, s.record_mode) == (4, "test2.MMB", "Histogram Combo") diff --git a/tests/test_server_device_access.py b/tests/test_server_device_access.py index 7d73182..93bd2f3 100644 --- a/tests/test_server_device_access.py +++ b/tests/test_server_device_access.py @@ -48,6 +48,14 @@ def test_status_and_settings_with_a_serial(da): assert srv.device_settings(serial="UM20147", **TCP)["record_mode"] == "Histogram Combo" +def test_status_run_state_is_opt_in(da): + # called directly, a Query default is truthy: pass it as FastAPI would + assert "run_state" not in srv.device_monitor_status(force=False, serial="UM20147", run_state=False, + **TCP)["detail"] + out = srv.device_monitor_status(force=False, serial="UM20147", run_state=True, **TCP) + assert out["detail"]["run_state"] == {"code": 0, "name": "idle"} + + def test_hangup(da): srv.device_monitor_status(force=False, serial="UM20147", **TCP) assert srv.device_hangup(**TCP) == {"hung_up": True} -- 2.54.1 From 4117b056aaf15ddf4861dd737337dcf78c03614f Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 13:17:43 -0400 Subject: [PATCH 133/223] scratch: ring-path poller for the Runs A/B bench test Asks the bench SFM for a Micromate's status on a fixed interval (Run B) or once (Run A), with run_state=true, and logs each answer with its time as JSON lines: HTTP status, seconds, the raw 0x49 code, and the detail of any refusal (503 call-home-in-progress / could-not-connect). Read-only on the unit; refuses :8200. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- scratch/ring_path_poller.py | 90 +++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 scratch/ring_path_poller.py diff --git a/scratch/ring_path_poller.py b/scratch/ring_path_poller.py new file mode 100644 index 0000000..55c73d1 --- /dev/null +++ b/scratch/ring_path_poller.py @@ -0,0 +1,90 @@ +"""Ring-path bench test, Runs A/B: ask SFM for a Micromate's status on a fixed +interval and log every answer with its time. Read-only on the unit. + + python scratch/ring_path_poller.py --sfm http://127.0.0.1:8299 \ + --serial UM20147 --host --tcp-port 9034 --interval 10 \ + --log /poller.jsonl + +Run A: --count 1 (one call-up; SFM then holds the line until its 5-minute idle +hang-up or a RADIO RING). Run B: the default, every --interval seconds until +Ctrl-C. Each poll asks for the raw SUB 0x49 code (run_state=true), so a +call-home in progress shows as its own code rather than as "not monitoring". + +What the log is for (spec, "Open questions this design leaves for the bench"): +a 503 "call home in progress" is SFM seeing the ring and hanging up; a 503/504 +on connect while THOR's watchdog holds the line is contention; THOR's own ACH +log says when the call reached THOR. +""" +from __future__ import annotations + +import argparse +import datetime +import json +import time +import urllib.error +import urllib.parse +import urllib.request + + +def poll_once(sfm: str, serial: str, host: str, tcp_port: int, timeout: float) -> dict: + q = urllib.parse.urlencode({"serial": serial, "host": host, "tcp_port": tcp_port, "run_state": "true"}) + t0 = time.monotonic() + started = datetime.datetime.now().isoformat(timespec="milliseconds") + try: + with urllib.request.urlopen(f"{sfm}/device/monitor/status?{q}", timeout=timeout) as r: + code, body = r.status, json.loads(r.read() or b"{}") + except urllib.error.HTTPError as e: + code = e.code + try: + body = json.loads(e.read() or b"{}") + except ValueError: + body = {} + except (urllib.error.URLError, TimeoutError, OSError) as e: + code, body = None, {"error": f"{type(e).__name__}: {e}"} + secs = round(time.monotonic() - t0, 2) + d = body.get("detail") if isinstance(body, dict) else None + rs = d.get("run_state") if isinstance(d, dict) else None # an error's detail is a string + return {"at": started, "secs": secs, "http": code, + "monitoring": body.get("monitoring") if isinstance(body, dict) else None, + "run_state": rs, "device_time": body.get("device_time") if isinstance(body, dict) else None, + "detail": None if code == 200 else (body.get("detail") or body.get("error"))} + + +def line(rec: dict) -> str: + rs = rec["run_state"] + state = f"0x{rs['code']:02X} {rs['name']}" if rs else "-" + tail = f" {rec['detail']}" if rec["detail"] else "" + return f"{rec['at']} http={rec['http']} {rec['secs']:>6} s 0x49={state} monitoring={rec['monitoring']}{tail}" + + +def main() -> None: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("--sfm", default="http://127.0.0.1:8299") + ap.add_argument("--serial", required=True) + ap.add_argument("--host", required=True) + ap.add_argument("--tcp-port", type=int, default=9034) + ap.add_argument("--interval", type=float, default=10.0, help="seconds between polls (start to start)") + ap.add_argument("--count", type=int, default=0, help="stop after N polls (0 = until Ctrl-C)") + ap.add_argument("--timeout", type=float, default=180.0) + ap.add_argument("--log", required=True, help="JSON lines, appended") + a = ap.parse_args() + if a.sfm.rstrip("/").endswith(":8200"): + raise SystemExit("refusing :8200 -- use the bench SFM") + n = 0 + with open(a.log, "a") as f: + while True: + t0 = time.monotonic() + rec = poll_once(a.sfm.rstrip("/"), a.serial, a.host, a.tcp_port, a.timeout) + f.write(json.dumps(rec) + "\n"); f.flush() + print(line(rec), flush=True) + n += 1 + if a.count and n >= a.count: + return + time.sleep(max(0.0, a.interval - (time.monotonic() - t0))) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + pass -- 2.54.1 From 3528dde970105f12c6dcc91f6d77643b63ae21e6 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 20:16:46 -0400 Subject: [PATCH 134/223] docs(micromate): THOR's log location, its watchdog cadence, and the unit that went quiet after a THOR disconnect C:\THORDATA\Logs\ (Brian). From the 2026-10-29 log: the watchdog reads each unit's serial every ~15 s; Unit_CommandOutOfRange follows every ReadUnitStatus for every unit (fleet-wide noise); after a manual THOR disconnect UM20147 answered neither SFM nor THOR's own reconnect ("Mismatch connection found"). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- docs/micromate_protocol_reference.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 022561b..7202bc5 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2939,6 +2939,29 @@ mechanism depends on that connection existing. > saw used). The ring-path bench test in the parity spec now varies this > setting on purpose. +#### THOR's logs, and what the 2026-10-29 log showed + +**Location: `C:\THORDATA\Logs\` on the THOR PC** (Brian, 2026-10-29). The main +log is `thor.log.`. + +Measured from that day's log (UM20147 added as a bench test unit, on a fleet-config +RX55 at `63.45.161.30`): + +- **Watchdog cadence on this THOR:** per unit, `GET UNIT Connection STATUS` → + `ReadSerialNumber` → "received connected" every **~15 s**, with + `GET UNIT STATUS` → `ReadUnitStatus` reads in between. +- **`Unit_CommandOutOfRange` follows `ReadUnitStatus` for every unit** (UM20146, + UM13981, UM14133, UM6047, UM11719, UM11402, UM12420, UM20147), so it is + fleet-wide noise, not a fault of one unit. 🔶 Inferred: THOR's status read + includes a command the firmware rejects. +- **After a manual Disconnect in THOR (19:48:07), UM20147 stopped answering + anyone.** Until then THOR read its serial every ~15 s. After it, SFM's + call-ups (19:51:35, 19:52, 20:01) were accepted by the modem and got **zero + bytes** back, and THOR's own reconnect at 19:57:10 logged `Mismatch connection + found for 63.45.161.30:9034` four times, then "lost connection" at 19:57:38. + Cause not yet known (a unit reset and a modem power cycle did not restore it + by 20:01). See the parity spec's ring-path bench notes. + #### THOR has a second, unused ACH path `ListenerAchTcp` logs `Waiting for a ACH connection on :: Port 12346` — and in -- 2.54.1 From 7491cd4b6ff72ae16efa64874f028e1d6e2a6961 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 20:49:28 -0400 Subject: [PATCH 135/223] docs: the 1c bench pass and the ring-path results (2026-10-29) - Spec: the 1c bench pass on BE9441 and UM20147, each on its own modem, and its 16 findings (a new 'Left open by the 1c bench' section). Ring-path results, measured: with THOR's watchdog off a call-home reaches THOR when nobody holds the line (Run 0, via ListenerAchTcp) and is lost when SFM holds it (Run A: the unit times out and does not retry); with THOR polling, SFM gets no reply and THOR is undisturbed (A2, step 1). Decision owed before merge: the Micromate line hold. - Micromate reference: retracts 'ListenerAchTcp never used' in place (it accepted tonight's call-home; port 12345); a call-home that rings on another receiver's connection is lost; a second TCP connection while THOR holds the line is accepted but silent. - CLAUDE.md: 1c status, the open decision, THOR's log location. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 18 ++-- docs/micromate_protocol_reference.md | 32 ++++++- .../2026-10-20-sfm-series4-parity-design.md | 85 +++++++++++++++++-- 3 files changed, 123 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b84f053..cc7ef8a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -189,12 +189,18 @@ Read this first when picking the project back up. `stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt: 0x96/0x97 mean the same on both series, and the blind tools must reach a unit too wedged to answer. - ⚠ **Before this branch merges, run the ring-path Runs A/B** -- the spec's - prerequisite to a webapp sending `serial` (*Open questions ... for the bench*): a held line - holds the modem's single TCP session. The page never polls (every request is - a click), SFM hangs up on RADIO RING, and **Hang up** releases the line at - once; whether a call-home still reaches THOR is unmeasured. - Next: the bench pass on BE9441 and UM20147, then phases 4 and 5. + **Bench pass done 2026-10-29** (both series, each on its own modem): 16 + findings in the spec (*Left open by the 1c bench*) -- the S3 settings decode + reads escaped bytes (#1), S3 downloads skip the file reader (#8), the S3 + start read-back does not reconnect after the modem drops the line (#9), an + audit `sent: null` (#15), and page polish. + **Ring path measured the same night:** with THOR's watchdog off, a call-home + reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- + the unit takes SFM's connection for the call, times out and does not retry. + While THOR polls a unit, SFM gets no reply and does not disturb THOR. + ⚠ **Before merge: decide the Micromate line hold** (shorter / none, or SFM + runs the call-home session). THOR's log: `C:\THORDATA\Logs\`. + Next: a short fix plan for the findings, then phases 4 and 5. - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in 0.46 s and read back as monitoring at the first 2 s poll (during the sensor diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 7202bc5..6783664 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2960,7 +2960,26 @@ RX55 at `63.45.161.30`): bytes** back, and THOR's own reconnect at 19:57:10 logged `Mismatch connection found for 63.45.161.30:9034` four times, then "lost connection" at 19:57:38. Cause not yet known (a unit reset and a modem power cycle did not restore it - by 20:01). See the parity spec's ring-path bench notes. + by 20:01; it answered again at 20:16:51 after another reset and time). See the + parity spec's ring-path bench notes. + +#### A call-home that rings on someone else's connection is lost (2026-10-29) + +Measured with THOR's watchdog off and auto call-home on. SFM held UM20147's line +and sent a stop (`0x97`, 20:21:13.001); the unit answered with `RADIO RING` +instead of the ack (20:21:13.7). SFM hung up, then reconnected 0.1 s later for a +status read, and the unit answered it. The unit's screen: "connecting..." → +"call home data transfer..." for under a minute → idle. **It did not retry**, +and THOR never saw the call. The same stop from the keypad with nobody on the +line reached THOR through `ListenerAchTcp` (above). + +🔶 Inferred: the unit counts the connection its ring rode up as the call and +waits for the server to run the session; a receiver that is not THOR (or not +running an ACH session) swallows the call-home. One observation. + +While THOR **holds** the line (polling every ~5–15 s), a second TCP connection to +the modem is accepted but receives **nothing** (SFM: 0 bytes in 10 s), and THOR's +own reads continue to be answered -- measured 20:44:35.9. #### THOR has a second, unused ACH path @@ -2970,6 +2989,17 @@ RX55 at `63.45.161.30`): units that genuinely dial, on some other modem arrangement) but is not what a PAD-connected Micromate uses. +> ⚠ **RETRACTED 2026-10-29 (measured):** the listener *is* used by a +> PAD-connected Micromate, whenever nothing holds the modem's session. With +> THOR's watchdog off and nobody connected, UM20147's call-home (keypad stop) +> arrived as `ListenerAchTcp - Connection accepted from 63.45.161.30:36648` +> (20:37:28.5), THOR read the serial, and `RADIO RING` then came **up that +> connection** to start the session. So both paths are real and timing decides: +> the ring rides an existing connection (10-14, THOR's watchdog), or the modem +> dials its destination (here `50.197.32.91:12345`, the office) and the ring +> follows. THOR's listener port is **12345** (Brian, 2026-10-29); the 12346 in +> the 10-14 log was that day's setup. + #### What this means for a homebrew receiver ⚠ **`bridges/mm_ach_server.py` is built on the wrong model for this deployment.** diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index ae7aaec..e0fdbbc 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -505,11 +505,21 @@ Each safety piece arrives with its first real use, so nothing sits untested. `POST /device/call_home`) refuse 409 before any write unless the unit answers as Series 3 (and as the named unit, given `serial=`). The stop tools stay exempt: 0x96/0x97 mean the same on both series. - - ⚠ **The ring-path Runs A/B have not been run.** The page does not poll - (every request is a click), SFM hangs up on RADIO RING, and Hang up - releases a held line, but whether a call-home reaches THOR while SFM - holds the line is unmeasured. Run them before serial mode is used on a - unit that calls home to THOR, i.e. before this branch merges. + - **Bench pass 2026-10-29 (BE9441 and UM20147, each on its own modem):** + identify, status, settings, list, one download, start and stop through the + page on both series. Sixteen findings, listed under *Left open by the 1c + bench* below. + - **Ring path, 2026-10-29 (measured; details under *Open questions ... for + the bench*):** with THOR's watchdog off, a call-home **reaches THOR** when + nobody holds the line (Run 0), and **is lost** when SFM holds it (Run A): + the unit takes SFM's connection for the call, sits in "call home data + transfer", times out, goes idle and does not retry. With THOR polling, SFM + cannot reach the unit at all and does not disturb THOR (A2, step 1). + ⚠ **Decision owed before merge:** the 5-minute Micromate line hold makes + SFM a call-home sink whenever THOR is not holding the line. Options: a + much shorter hold or none (hang up after each request), or SFM runs the + call-home session itself (the ADR 0003 call-in server). A cool-down alone + does not help: the unit does not retry. - Of the items parked for 1c below: **CORS ordering** does not bite the page, which SFM serves itself (same origin); the **Series-4 mic** is not shown (the event list shows geophone peaks only). The rest are server-side @@ -644,6 +654,46 @@ matters to is named. - **Series-3 stored `record_type` (MiniMate bench check).** Rows SFM stores for Series 3 still say "Waveform" for histograms — pre-existing, the same as the legacy `blastware_file` route; fix it with the `0C` decode. - **A fresh Series-4 download's gaps (1c).** No `sample_rate` is stored, and the sidecar has no vector sum; the DB row has the unit's PVS (overlaid from `0x0C`). - **Orphan files (SDM).** An event file in the store with no DB row is still overwritten by a download. + +## Left open by the 1c bench (2026-10-29) + +From the page bench on BE9441 (MiniMate, modem `63.43.212.233`) and UM20147 +(Micromate, RX55 `63.45.161.30`). Numbers as given at the bench. Fixes wait for +a short plan; #14 waits for the line-hold decision above. + +1. **S3 settings decode reads before escapes are removed** -- BE9441 showed 0 sps + and a 68.3-min interval (true: Histogram, 4096 sps, 2 s, per the 10-26 fixture + README); while monitoring the `1A` anchor is not found at all. Old bug, the + same family as #46's C1. Fix: decode after unescaping; this reply is the + fixture. +2. **A 1.7 KB mic-off histogram is refused** -- this branch lacks #47/#49 (`dev` + decodes `K441LTOK.QZ0`, this branch does not). Bring them over before merge. +3. ✅ The 71 KB histogram crossing two 64 KB pages downloaded over the modem + byte-identical to Blastware's (`f10f39a8…`). +4. List vector sum 0 / −0 for three events whose peaks reach 1.08 in/s -- + suspected escapes in the `0C` record (not checked). +5. Stored S3 event: client "Terra-Mechanic" (last letter missing) -- unexplained. +6. Page: the Config tab shows the empty write form until Read in serial mode. +7. `/db/events` 500 "database is locked" on the first page load against a new DB. +8. **S3 downloads are stored from the live waveform decoder** (`store.save`), not + the file reader that Series 4 uses (`save_imported_idf`): a histogram gets no + samples and is labelled Waveform. Fix: store S3 downloads through the + file-import path (also aligns event times with v0.32.0). +9. **S3 start over a modem:** the line dropped during the sensor check, the + read-back hit `Broken pipe` and did not reconnect → 503 though the start + worked. Fix: reconnect for the read-back (reads only; the send stays single). +10. Page: "Start monitoring failed:" on a sent-but-unconfirmed change -- wording. +11. S3 stop ~19 s, 11.6 s of it the identity check (a full connect) vs ~1 s for a + serial-only read. **Identified only** (speed is secondary to reliability). +12. Page, serial mode: the Device tab's empty legacy compliance table; S4 + Firmware "—" (should say Thor line). +13. S4 mic in the event's peaks "0.0 dBL" vs 96.54 dB(L) in the file -- the + `0x0C` mic denormal parked above, now visible. +14. **After hanging up for a RADIO RING, SFM called the unit straight back up** + (the page's post-change status read). Part of the line-hold decision. +15. **Audit:** the UM20147 stop's record says `sent: null` although `0x97` went out. +16. Page: a 504 on a unit THOR holds should say "connected, but no reply -- + another program may be holding this unit's line". - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. - **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. - **A lost `0C` during a Series-3 list (1c).** The strict walk raises on a lost `0A` @@ -881,6 +931,31 @@ Open questions: - *Also settles:* whether the modem routes a call-home to its destination on its own (Run 0), in which case SFM never sees a ring and THOR gets the call while SFM is still connected. + - **Results, 2026-10-29** (UM20147 on a fleet-config RX55 at `63.45.161.30`, + added to THOR as a test unit; THOR log `C:\THORDATA\Logs\`; all measured + unless marked): + - **Run A (watchdog off, SFM holding the line).** SFM's stop (`0x97`, + 20:21:13.001) was answered by `RADIO RING` instead of its ack (20:21:13.7); + SFM hung up. The page's post-change status read called the unit straight + back up (20:21:13.8 → held to 20:21:47; the reaper listens every 5 s, no + second ring). The unit showed "connecting..." → "call home data + transfer..." for under a minute → idle, **no retry**; THOR logged nothing + for the unit through 20:23:57. + - **Run 0 (watchdog off, nobody on the line, keypad start/stop).** The modem + dialled `50.197.32.91:12345`: `ListenerAchTcp - Connection accepted from + 63.45.161.30:36648` (20:37:28.5) → serial → `RADIO RING IS RECEIVED` on that + connection → a full THOR session (count 8, download, **DeleteEventState** + per event, reports, email, Vision). SFM sent nothing 20:22–20:37. + - **A2, step 1 (THOR polling, ~5–15 s).** An SFM status read at 20:44:35.9: + the modem accepted the connection, 0 bytes back in 10 s (504). THOR's reads + of the unit at 20:44:37.4 and 20:44:44.3 were answered; no disconnect. + - **Conclusion:** the risk is confined to when THOR is not holding the line + (watchdog off, THOR down, reconnect gaps), and a cool-down would not fix + it. Run B (a poller) is deprioritised: while THOR polls it only collects + 504s; the open point is a reconnect gap. + - Also seen: after a manual THOR Disconnect (19:48:07) the unit answered + nobody until a reset (back 20:16:51); THOR's reconnect logged `Mismatch + connection found`. Cause unknown. - The ack for start/stop when the unit is already in that state. ✅ **Answered for stop (2026-10-25, UM20147):** a stop sent to an idle unit is acked `0x68` in 10 ms (twice) and changes nothing: not the state, the -- 2.54.1 From 335f70ff468a03504f102053b9313a2a91ad6cd9 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 21:02:20 -0400 Subject: [PATCH 136/223] docs: the Micromate line hold stays for now; SFM handling call-ins is the long-term fix Brian, 2026-10-29: not expected to be a problem in practice. Settles the 1c ring-path merge gate; Run B stays open, not blocking. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 5 +++-- .../specs/2026-10-20-sfm-series4-parity-design.md | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index cc7ef8a..d107012 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -198,8 +198,9 @@ Read this first when picking the project back up. reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- the unit takes SFM's connection for the call, times out and does not retry. While THOR polls a unit, SFM gets no reply and does not disturb THOR. - ⚠ **Before merge: decide the Micromate line hold** (shorter / none, or SFM - runs the call-home session). THOR's log: `C:\THORDATA\Logs\`. + ✅ **Line hold decided (Brian, 2026-10-29): keep it as is for now; the + long-term fix is SFM handling auto call-ins itself.** The ring-path merge gate + is settled. THOR's log: `C:\THORDATA\Logs\`. Next: a short fix plan for the findings, then phases 4 and 5. - **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built, reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index e0fdbbc..ffbd8d0 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -515,11 +515,14 @@ Each safety piece arrives with its first real use, so nothing sits untested. the unit takes SFM's connection for the call, sits in "call home data transfer", times out, goes idle and does not retry. With THOR polling, SFM cannot reach the unit at all and does not disturb THOR (A2, step 1). - ⚠ **Decision owed before merge:** the 5-minute Micromate line hold makes - SFM a call-home sink whenever THOR is not holding the line. Options: a - much shorter hold or none (hang up after each request), or SFM runs the - call-home session itself (the ADR 0003 call-in server). A cool-down alone - does not help: the unit does not retry. + The 5-minute Micromate line hold makes SFM a call-home sink whenever THOR + is not holding the line; a cool-down alone would not help (the unit does + not retry). + ✅ **Decided 2026-10-29 (Brian): keep the hold as it is for now** -- not + expected to be a problem in practice -- and the long-term fix is **SFM + handling auto call-ins itself** (the ADR 0003 call-in server). This + settles the 1c ring-path merge gate; Run B (a poller in THOR's reconnect + gap) stays open, not blocking. - Of the items parked for 1c below: **CORS ordering** does not bite the page, which SFM serves itself (same origin); the **Series-4 mic** is not shown (the event list shows geophone peaks only). The rest are server-side -- 2.54.1 From 0dbd0b506da280978133675f2caa8c299e9ec36c Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:08:56 -0400 Subject: [PATCH 137/223] docs(plan): 1c bench fixes, Batch 1 -- #1 settings decode, #9 read-back reconnect, #8 downloads via the file import path; #15 retracted Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-10-29-sfm-1c-bench-fixes-batch1.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-29-sfm-1c-bench-fixes-batch1.md diff --git a/docs/superpowers/plans/2026-10-29-sfm-1c-bench-fixes-batch1.md b/docs/superpowers/plans/2026-10-29-sfm-1c-bench-fixes-batch1.md new file mode 100644 index 0000000..6ae5538 --- /dev/null +++ b/docs/superpowers/plans/2026-10-29-sfm-1c-bench-fixes-batch1.md @@ -0,0 +1,172 @@ +# SFM 1c bench fixes, Batch 1 — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Fix the three reliability findings from the 2026-10-29 bench that put wrong or missing data in front of a user: MiniMate settings read from escaped bytes (#1), a MiniMate start reported failed because the read-back did not survive a dropped modem line (#9), and MiniMate downloads stored without the file reader (#8). + +**Architecture:** Three independent fixes on `feat/series4-sfm-parity` (merged up with `dev` at `342c696`), each behind its own tests on recorded BE9441 bytes. #1 changes only the four anchor-relative fields of the live `SUB 1A` decode; #9 adds one guarded reconnect to the Series-3 start read-back; #8 stores Series-3 downloads through the same Blastware-file import path production uses (`WaveformStore.save_imported_bw`), the way Series 4 already uses `save_imported_idf`. + +**Tech Stack:** Python 3.10, pytest; `minimateplus` (client, framing, blastware_file), `sfm` (device_access, event_ingest, waveform_store). + +**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` → *Left open by the 1c bench (2026-10-29)*, items 1, 8, 9 (and 15, retracted below). + +## Global Constraints + +- Branch `feat/series4-sfm-parity` only; push each commit; never `main`; no `CHANGELOG.md` edits (feature branch). +- **Reliability before speed** (Brian, 2026-10-29): no change removes a check; a start/stop is still sent exactly once, never retried. +- **File boundary with the S3 decode-checker session:** do not edit `minimateplus/event_file_io.py`, `histogram_codec.py`, `waveform_codec.py`, `bw_xml_report.py`, `decode_check*.py`. +- `docs/instantel_protocol_reference.md` is CRLF: edit it with the Edit tool only. +- Tests: `/home/serversdown/seismo-relay/.venv/bin/python -m pytest -q -p no:cacheprovider`; the baseline is exactly 16 known failures (15 `test_bw_ascii_report.py`, `test_event_file_io.py::test_save_imported_bw_without_report_works_unchanged`). +- Store consequence (state it in the commit and docs): #8 changes how **new** live downloads are stored; existing rows and files are untouched; no backfill, no migration. + +## Review Focus + +1. A modem that closes the line cleanly (FIN) during the read-back shows as silence, not an `OSError`: no reconnect, the result stays "sent, not checked", nothing re-sent. (Task 2 test.) +2. A MiniMate on a serial cable: never reconnect in the read-back — opening its port reboots the unit (measured 2026-10-25). (Task 2 test.) +3. A settings read while the unit is monitoring returns the device-info block, not the settings block (measured 2026-10-29): mode, sample rate, interval and record time must come back `None`, not garbage. (Task 1 test.) +4. Downloading an event twice, or one the watcher already imported, must not add a second row. (Task 3 tests.) +5. The channel block (trigger level, range, scale) and the note strings must read exactly as before: only the four anchor fields move to unescaped bytes. (Task 1 test.) + +## Retraction carried by this plan + +**#15 is not a bug.** `device_commands.sent` is documented as `1 acknowledged, 0 nothing sent, NULL unknown` (`sfm/database.py:148`, `change.py:12-14`); a stop answered by a ring instead of its ack is exactly "unknown", and the row's `error` text already says the frame was sent. Task 4 retracts it in the spec. + +--- + +### Task 1: The live settings decode reads its four anchor fields from unescaped bytes (#1) + +**Files:** +- Modify: `minimateplus/client.py` — `_decode_compliance_config_into` (~line 2312), its anchor block (~2385–2440) +- Create: `tests/test_s3_compliance_anchor_fields.py` + +**Interfaces:** Produces nothing new; `_decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None` keeps its signature. `info.compliance_config` fields `recording_mode`, `sample_rate`, `histogram_interval_sec`, `record_time` change meaning only for escaped replies. + +Measured layout once escapes are removed (`framing.unescape_reply`), from every distinct recorded reply: **mode `anchor−7` (u8), sample rate `anchor−6` (u16 BE), histogram interval `anchor−4` (u16 BE, s), record time `anchor+6` (f32 BE)**. The channel block and strings are correct on the raw bytes and must stay there (unescaped, `"Tran"+28` reads 0.0 instead of 6.2061). + +- [ ] **Step 1: Write the failing tests** — a helper collects every `SUB 0xE5` frame from `tests/fixtures/minimate-bench-10-25-26/*_rx.bin` and `tests/fixtures/minimate-bench-10-26-26-histogram/unit_replies.bin` whose `data` contains the anchor, de-duplicated by the 18 bytes around it (`S3FrameParser().feed`). + +```python +@pytest.mark.parametrize("fixture,expect", [ # (mode, sample_rate, interval_s, record_time_s) + ("10-25", (1, 4096, 5, 5.0)), # Continuous + ("10-26a", (4, 2048, 2, 20.0)), # Histogram + Continuous + ("10-26b", (3, 4096, 900, 20.0)), # Blastware's 16:26 write: Histogram, 15 min + ("10-26c", (3, 4096, 2, 20.0)), # Blastware's 16:27 write: back to 2 s (tonight's unit) +]) +def test_anchor_fields_read_from_unescaped_bytes(fixture, expect): ... + # decode the frame's data with _decode_compliance_config_into(DeviceInfo()) + # assert (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, round(cc.record_time, 2)) == expect + +def test_channel_block_still_reads_from_raw_bytes(): + # data = the 10-26c frame-B data + the next E5 frame whose data contains b"Tran" + # assert cc.trigger_level_geo == pytest.approx(0.04, abs=1e-4) + # assert cc.geo_adc_scale == pytest.approx(6.2061, abs=1e-3) and cc.geo_range == 0 + +def test_a_reply_without_the_settings_block_reads_as_unknown(): + # the recorded SUB 0xFE (device info) reply data -- what a monitoring BE9441 returned for 1A + # assert all four anchor fields are None +``` + +The fixture labels are the test's own: number the de-duplicated replies in file order and map them to the four expectations above (assert there are exactly four). + +- [ ] **Step 2: Run** `…pytest -q tests/test_s3_compliance_anchor_fields.py` → FAIL: `10-25` reads mode 0, `10-26c` reads sample rate 0 and interval 4098 (today's decoder on escaped bytes). +- [ ] **Step 3: Implement** — in the anchor block, search `_ANCHOR` in `logical = unescape_reply(data)` (same `0:150` window) and read the four fields from `logical` at the offsets above; leave every other read on `data`. Update the layout comment to the measured logical layout and note the old "anchor−7 constant 0x10" was the escape before `04` at 1024 sps. +- [ ] **Step 4: Run** the new tests, then the full suite → only the 16 known failures. +- [ ] **Step 5: Commit** `fix(minimateplus): read a MiniMate's mode, sample rate, interval and record time after removing escapes (#1)`. + +### Task 2: The Series-3 start read-back reconnects once after a dropped line (#9) + +**Files:** +- Modify: `sfm/device_access/s3.py` — `change_monitoring`'s `read_state` (~line 230) +- Modify: `tests/device_access_fakes.py` — `FakeMiniMateClient`: add `read_serial()` (returns `serial_reported`, default the unit's serial; records `"read_serial"`) and `wake_errors=` (exceptions raised by successive `wake()` calls) +- Test: `tests/test_device_access_change.py` + +**Interfaces:** Consumes `MiniMateClient.read_serial()` (exists), `normalise_serial` (`sfm/device_access/series.py`). No new public names. + +Behaviour: in `read_state`, an `OSError` from `_woken_state(client)` (Broken pipe / reset / aborted — measured: `[Errno 32] Broken pipe` at BE9441's first wake after the sensor check) **on a TCP address, the first time only**: log a warning "the line dropped during the read-back — reconnecting to read the state (nothing is re-sent)", `client.close()`, `client.open()`, require `normalise_serial(client.read_serial()) == serial` (else raise `WrongUnit`), then `_woken_state(client)`. A second `OSError`, any other error, or a serial-cable address propagates as today. + +- [ ] **Step 1: Write the failing tests** + +```python +def test_series3_start_read_back_reconnects_after_a_dropped_line(): + fake = FakeMiniMateClient(monitor_states=[False, True], wake_errors=[BrokenPipeError(32, "Broken pipe")]) + r = access3(fake).start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") + assert fake.writes == ["start_monitoring"] and fake.opened == 2 and "read_serial" in fake.calls + +def test_series3_read_back_reconnects_only_once(): + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")] * 2) + with pytest.raises(ChangeUnconfirmed): access3(fake).start_monitoring(TCP3, "BE18193") + assert fake.writes == ["start_monitoring"] and fake.opened == 2 + +def test_series3_read_back_reconnect_refuses_a_different_unit(): + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")], serial_reported="BE11529") + with pytest.raises(ChangeUnconfirmed) as e: access3(fake).start_monitoring(TCP3, "BE18193") + assert e.value.http_status == 409 and fake.writes == ["start_monitoring"] + +def test_series3_read_back_does_not_reconnect_on_a_serial_cable(): + # address with port=, no host: opening a MiniMate's port reboots it + ... assert fake.opened == 1 and raises ChangeUnconfirmed + +def test_series3_read_back_silence_is_not_a_dropped_line(): + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[NoAnswer("quiet")]) + ... raises ChangeUnconfirmed; fake.opened == 1; writes == ["start_monitoring"] +``` + +(`serial_reported` applies to `read_serial()` only; `connect()` keeps returning the real serial so the pre-send identity check passes. Use the module's existing `access3`, `TCP3` helpers; add a serial-cable `UnitAddress` beside `TCP3`.) + +- [ ] **Step 2: Run** them → the reconnect tests FAIL (no reconnect today); the last two may already pass — keep them as guards. +- [ ] **Step 3: Implement** `read_state` as described (a closed-over `reconnected` flag). +- [ ] **Step 4: Run** `tests/test_device_access_change.py`, then the full suite → only the 16 known failures. +- [ ] **Step 5: Commit** `fix(sfm): a MiniMate start's read-back reconnects once when the modem dropped the line (#9)`. + +### Task 3: MiniMate downloads are stored through the Blastware-file import path (#8) + +**Files:** +- Modify: `minimateplus/blastware_file.py` — add `blastware_file_bytes(event: Event, a5_frames: list) -> bytes`; `write_blastware_file` writes its result (no behaviour change) +- Modify: `sfm/device_access/models.py` — `DownloadedEvent.bw_bytes: Optional[bytes] = field(default=None, repr=False)` (Series 3: the assembled Blastware file) +- Modify: `sfm/device_access/s3.py` — `download_event` fills `bw_bytes` from the verified event's frames +- Modify: `sfm/waveform_store.py` — `save_imported_bw(..., source_kind: str = "bw-import")` writes it into the sidecar's `source.kind` +- Modify: `sfm/event_ingest.py` — `persist_download`'s Series-3 branch +- Test: `tests/test_event_ingest.py`, `tests/test_5a_blastware_walk_histogram.py` + +**Interfaces:** Produces `blastware_file_bytes(event, a5_frames) -> bytes`; `DownloadedEvent.bw_bytes`; `save_imported_bw(bw_bytes, source_path, *, serial_hint=None, bw_report_text=None, source_kind="bw-import") -> tuple[Event, dict]`. + +Behaviour: Series 3 mirrors Series 4 — `ev, rec = store.save_imported_bw(dl.bw_bytes, source_path=Path(dl.filename), serial_hint=dl.serial, source_kind="sfm-live")`, then the existing `db.insert_events(...)`. No `backfill_series3_event` on this path (the file's setup block supplies sample rate and record time, #44/#45); no overlay of the live `0C` peaks (data comes from the binary — they stay the download *check*). A download with no `bw_bytes` raises `IngestError("…the download carried no event file; nothing was stored")`. The "Waveform" label on a live histogram stays until the checker session's #41 (record type from `STRT[18]`) lands on `dev`. + +- [ ] **Step 1: Write the failing tests** + +```python +# tests/test_5a_blastware_walk_histogram.py, beside the existing K441LTON.900 comparison: +def test_blastware_file_bytes_is_blastwares_file(): + # the walk's frames for key 0111f210 -> blastware_file_bytes(ev, frames) == (FIX/"blastware"/"K441LTON.900").read_bytes() + +# tests/test_event_ingest.py +def test_a_series3_histogram_download_is_stored_from_its_file(tmp_path): + bw = (HIST_FIX / "K441LTON.900").read_bytes() # byte-identical to SFM's download (sha f10f39a8…) + out = persist_download(DownloadedEvent(event_id="BE9441:0111f210:20261026170036", serial="BE9441", + series=3, filename="K441LTON.900", verified=None, bw_bytes=bw, + timestamp=datetime.datetime(2026, 10, 26, 17, 0, 36)), store=WaveformStore(tmp_path / "w"), db=SeismoDb(tmp_path / "s.db")) + # assert the stored file's sha256 == hashlib.sha256(bw).hexdigest() + # assert plot_json_from_hdf5(
)["channels"]["Tran"]["values"] (non-empty: the histogram decoded) + # assert the sidecar's source.kind == "sfm-live" and the row's sample_rate == 4096 + +def test_the_small_mic_off_histogram_is_stored_with_samples(tmp_path): # K441LTOK.QZ0, refused on 10-29 +def test_a_repeat_series3_download_adds_no_row(tmp_path): # persist twice: one row; second inserted False +def test_a_series3_download_with_no_file_stores_nothing_and_says_so(tmp_path) # replaces the no-event test +``` + +Rewrite `test_a_series3_event_is_backfilled_then_stored_as_series3` to the new contract (bytes in, `save_imported_bw` called with `source_kind="sfm-live"`, no backfill); keep `test_downloading_an_event_the_watcher_stored_writes_nothing_series3` passing unchanged. + +- [ ] **Step 2: Run** them → FAIL (`bw_bytes` / `blastware_file_bytes` / `source_kind` do not exist). +- [ ] **Step 3: Implement** the five file changes above. +- [ ] **Step 4: Run** `tests/test_event_ingest.py tests/test_5a_blastware_walk_histogram.py tests/test_device_access_events.py tests/test_server_device_access.py`, then the full suite → only the 16 known failures. +- [ ] **Step 5: Commit** `fix(sfm): store a MiniMate download through the Blastware-file import path, as production does (#8)` — body states: new live downloads only; existing rows untouched; no backfill or migration. + +### Task 4: Docs + +**Files:** the spec (*Left open by the 1c bench*), `docs/instantel_protocol_reference.md` (CRLF — Edit tool), `CLAUDE.md` ("Where things stand"). + +- [ ] **Step 1:** Spec: mark #1, #8, #9 fixed (commit ids); **retract #15 in place** (by design: `sent` NULL = sent without acknowledgement); #2 fixed by the `dev` merge (`342c696`). +- [ ] **Step 2:** Instantel reference, a dated change-log row + §7.6.1 note: the measured logical `1A` layout (mode −7, rate −6, interval −4, record time +6 after unescaping; the old "anchor−7 constant 0x10" was the escape before `04`); while monitoring, BE9441 answered the `1A` reads with its device-info block (measured 2026-10-29); the channel block is read on raw bytes, so a trigger/alarm float containing `02/03/04/10` would read shifted — open, unmeasured. +- [ ] **Step 3:** CLAUDE.md: one line under the 1c entry — Batch 1 done (#1, #8, #9), #15 retracted. +- [ ] **Step 4: Commit** `docs: 1c bench Batch 1 -- #1, #8, #9 fixed; #15 retracted; the 1A layout after unescaping`. -- 2.54.1 From b320a534bc55c7e951706448ca907600c69d88a6 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:19:11 -0400 Subject: [PATCH 138/223] fix(minimateplus): read a MiniMate's mode, sample rate, interval and record time after removing escapes (#1) The unit escapes 02/03/04/10 in every reply and S3FrameParser keeps the 10 of 10 02/03/04, so on the raw SUB 1A bytes an escaped mode, rate or interval shifted every field after it: BE9441 at Histogram / 4096 sps / 2 s read back as 0 sps and a 4098 s interval (bench 2026-10-29), and a Continuous unit read as Single Shot. The four anchor fields are now read from unescape_reply(data): mode anchor-7, sample rate anchor-6, interval anchor-4, record time anchor+6 -- measured on all four distinct recorded replies, two of them Blastware's own writes (15 min, then 2 s). The old 'anchor-7 = constant 0x10' was the escape before 04 at 1024 sps. The channel block and strings still read the raw bytes: their label offsets were measured there and are wrong unescaped (pinned by a test). A reply with no anchor -- BE9441's monitoring-time 1A answer was its device-info block -- leaves all four None. Store consequence: none; this is the live settings read. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 115 +++++++--------------- tests/test_s3_compliance_anchor_fields.py | 96 ++++++++++++++++++ 2 files changed, 134 insertions(+), 77 deletions(-) create mode 100644 tests/test_s3_compliance_anchor_fields.py diff --git a/minimateplus/client.py b/minimateplus/client.py index d595df8..dfe8f0b 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -2365,92 +2365,53 @@ def _decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None: # ── recording_mode / sample_rate / histogram_interval / record_time ───────── # 6-byte stable anchor: b'\xbe\x80\x00\x00\x00\x00' — confirmed across BE11529 - # and BE18189. The 4 bytes immediately before the anchor are NOT constant: - # bytes -4:-2 are the histogram_interval (uint16 BE, seconds), and bytes -2:0 - # are zero padding. The old "10-byte anchor" (\x01\x2c\x00\x00 prefix) was - # only constant when the histogram interval happened to be 5 min (0x012C = 300). + # and BE18189. These four fields are read from the reply with its escapes + # REMOVED (unescape_reply): the unit escapes 02/03/04/10 in every reply and + # S3FrameParser keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped + # mode, sample rate or interval moves every field after it by one. BE9441 at + # Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval (2026-10-29). # - # E5 read format layout relative to 6-byte anchor: - # _anchor - 8 : recording_mode (uint8) - # _anchor - 7 : 0x10 (extra byte E5 read only; absent in SUB 71 write) - # _anchor - 6 : sample_rate_hi (uint16 BE, MSB) - # _anchor - 5 : sample_rate_lo (uint16 BE, LSB) - # _anchor - 4 : histogram_interval_hi (uint16 BE, seconds, MSB) - # _anchor - 3 : histogram_interval_lo (uint16 BE, seconds, LSB) - # _anchor - 2 : 0x00 (padding) - # _anchor - 1 : 0x00 (padding) - # _anchor : \xbe\x80\x00\x00\x00\x00 (6-byte anchor) - # _anchor + 6 : record_time (float32 BE) + # Layout after unescaping, measured on every recorded reply (four settings, + # two of them Blastware's own writes -- tests/test_s3_compliance_anchor_fields.py): + # _anchor - 7 : recording_mode (uint8) + # _anchor - 6 : sample_rate (uint16 BE) + # _anchor - 4 : histogram_interval_sec (uint16 BE, seconds) + # _anchor - 2 : 0x00 0x00 (padding) + # _anchor : \xbe\x80\x00\x00\x00\x00 + # _anchor + 6 : record_time (float32 BE) + # ⚠ The old raw layout's "anchor - 7 = constant 0x10" was the escape in front + # of `04` at 1024 sps (0x0400); it read right only at that rate. + # Everything below this block (channel block, strings) still reads the RAW + # bytes: its label-relative offsets were measured on them and are wrong + # unescaped. A reply with no anchor (BE9441 answered 1A with its device-info + # block while monitoring, 2026-10-29) leaves all four fields None. _ANCHOR = b'\xbe\x80\x00\x00\x00\x00' - _anchor = data.find(_ANCHOR, 0, 150) + logical = unescape_reply(data) + _anchor = logical.find(_ANCHOR, 0, 150) - # Log anchor position on every decode so we can compare read vs write and - # catch unexpected shifts from DLE jitter or firmware differences. - # Expected position is ~15 for the E5 read payload (anchor - 8 = recording_mode). if _anchor < 0: - log.warning( - "_decode_compliance_config_into: anchor NOT FOUND in data[0:150] (len=%d)", - len(data), - ) - else: - log.info( - "_decode_compliance_config_into: anchor at data[%d] data_len=%d " - "(expected ~15; recording_mode@%d sample_rate@%d:%d " - "histogram_interval@%d:%d record_time@%d:%d)", - _anchor, len(data), - _anchor - 8, - _anchor - 6, _anchor - 4, - _anchor - 4, _anchor - 2, - _anchor + 6, _anchor + 10, - ) - - if _anchor >= 8 and _anchor + 10 <= len(data): - try: - config.recording_mode = data[_anchor - 8] - log.debug( - "compliance_config: recording_mode = 0x%02X (anchor@%d)", config.recording_mode, _anchor - ) - except Exception as exc: - log.warning("compliance_config: recording_mode extraction failed: %s", exc) - try: - config.sample_rate = struct.unpack_from(">H", data, _anchor - 6)[0] - log.debug( - "compliance_config: sample_rate = %d Sa/s (anchor@%d)", config.sample_rate, _anchor - ) - except Exception as exc: - log.warning("compliance_config: sample_rate extraction failed: %s", exc) - try: - config.histogram_interval_sec = struct.unpack_from(">H", data, _anchor - 4)[0] - log.debug( - "compliance_config: histogram_interval = %d s (anchor@%d)", - config.histogram_interval_sec, _anchor - ) - except Exception as exc: - log.warning("compliance_config: histogram_interval extraction failed: %s", exc) - try: - config.record_time = struct.unpack_from(">f", data, _anchor + 6)[0] - log.debug( - "compliance_config: record_time = %.3f s (anchor@%d)", config.record_time, _anchor - ) - except Exception as exc: - log.warning("compliance_config: record_time extraction failed: %s", exc) - elif _anchor >= 6 and _anchor + 10 <= len(data): - # Fallback: anchor found but not enough bytes before it for recording_mode - log.warning("compliance_config: anchor too close to start (anchor@%d) — skipping recording_mode", _anchor) - try: - config.sample_rate = struct.unpack_from(">H", data, _anchor - 6)[0] - except Exception: - pass - try: - config.record_time = struct.unpack_from(">f", data, _anchor + 6)[0] - except Exception: - pass - else: log.warning( "compliance_config: anchor %s not found in cfg[0:150] (len=%d) " "— sample_rate, record_time and recording_mode will be None", _ANCHOR.hex(), len(data), ) + elif _anchor >= 7 and _anchor + 10 <= len(logical): + log.info("_decode_compliance_config_into: anchor at unescaped[%d] data_len=%d", + _anchor, len(data)) + config.recording_mode = logical[_anchor - 7] + config.sample_rate = struct.unpack_from(">H", logical, _anchor - 6)[0] + config.histogram_interval_sec = struct.unpack_from(">H", logical, _anchor - 4)[0] + config.record_time = struct.unpack_from(">f", logical, _anchor + 6)[0] + log.debug( + "compliance_config: recording_mode=0x%02X sample_rate=%d histogram_interval=%d s " + "record_time=%.3f s (anchor@%d unescaped)", + config.recording_mode, config.sample_rate, config.histogram_interval_sec, + config.record_time, _anchor, + ) + else: + log.warning("compliance_config: anchor at unescaped[%d] is too close to an end " + "(len=%d) — mode, rate, interval and record time left None", + _anchor, len(logical)) # ── Project strings ─────────────────────────────────────────────────────── try: diff --git a/tests/test_s3_compliance_anchor_fields.py b/tests/test_s3_compliance_anchor_fields.py new file mode 100644 index 0000000..29543e7 --- /dev/null +++ b/tests/test_s3_compliance_anchor_fields.py @@ -0,0 +1,96 @@ +"""A MiniMate's mode, sample rate, histogram interval and record time are read +from the SUB 1A reply after its escapes are removed (bench finding #1, 2026-10-29). + +The unit escapes 02/03/04/10 in every reply, and S3FrameParser keeps the `10` of +`10 02/03/04`, so the bytes between the mode and the `be 80 00 00 00 00` anchor +move by one for each escaped value. BE9441 at Histogram / 4096 sps / 2 s read +back as 0 sps and a 4098 s interval. Once unescaped, every recorded reply has the +same layout: mode at anchor-7, sample rate anchor-6, interval anchor-4, record +time anchor+6. The channel block and the strings are read on the raw bytes and +must not move. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from minimateplus.client import _decode_compliance_config_into # noqa: E402 +from minimateplus.framing import S3FrameParser, unescape_reply # noqa: E402 +from minimateplus.models import DeviceInfo # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" +ANCHOR = b"\xbe\x80\x00\x00\x00\x00" +SOURCES = sorted((FIX / "minimate-bench-10-25-26").glob("*_rx.bin")) + \ + [FIX / "minimate-bench-10-26-26-histogram" / "unit_replies.bin"] + + +def _frames(sub): + out = [] + for path in SOURCES: + out += [f for f in S3FrameParser().feed(path.read_bytes()) if f.sub == sub] + return out + + +def _settings_replies(): + """Each distinct recorded 1A data frame carrying the anchor, in file order.""" + seen, out = set(), [] + for f in _frames(0xE5): + data = bytes(f.data) + logical = unescape_reply(data) + a = logical.find(ANCHOR, 0, 200) + if a < 0: + continue + key = logical[a - 8:a + 10] + if key not in seen: + seen.add(key) + out.append(data) + return out + + +def _decode(data): + info = DeviceInfo(serial="BE9441", firmware_minor=17) + _decode_compliance_config_into(data, info) + return info.compliance_config + + +EXPECT = [ # (mode, sample_rate, interval_s, record_time_s) + (1, 4096, 5, 5.0), # 10-25: Continuous + (4, 2048, 2, 20.0), # 10-26: Histogram + Continuous + (3, 4096, 900, 20.0), # Blastware's 16:26 write: Histogram, 15 min + (3, 4096, 2, 20.0), # Blastware's 16:27 write: back to 2 s +] + + +def test_there_are_four_distinct_recorded_settings_replies(): + assert len(_settings_replies()) == 4 + + +@pytest.mark.parametrize("i", range(4)) +def test_anchor_fields_read_from_unescaped_bytes(i): + cc = _decode(_settings_replies()[i]) + got = (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, round(cc.record_time, 2)) + assert got == EXPECT[i] + + +def test_channel_block_still_reads_from_raw_bytes(): + frames = _frames(0xE5) + start = next(i for i, f in enumerate(frames) if bytes(f.data) == _settings_replies()[3]) + chan = next(bytes(f.data) for f in frames[start + 1:] if b"Tran" in bytes(f.data)) + cc = _decode(_settings_replies()[3] + chan) + assert cc.trigger_level_geo == pytest.approx(0.04, abs=1e-4) + assert cc.geo_adc_scale == pytest.approx(6.2061, abs=1e-3) + assert cc.geo_range == 0 + + +def test_a_reply_without_the_settings_block_reads_as_unknown(): + # While monitoring, BE9441 answered its 1A reads with this same device-info + # block (2026-10-29): no anchor, so nothing is read from it. + fe = next(bytes(f.data) for f in _frames(0xFE) if b"Instantel" in bytes(f.data)) + cc = _decode(fe) + assert (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, cc.record_time) == \ + (None, None, None, None) -- 2.54.1 From ce441a0911018d96b2013378033c0f0be139ab64 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:21:27 -0400 Subject: [PATCH 139/223] fix(sfm): a MiniMate start's read-back reconnects once when the modem dropped the line (#9) BE9441 over a modem, 2026-10-29: the start was acked, but the modem closed the line during the ~30 s sensor check, so the read-back's first wake hit '[Errno 32] Broken pipe' and the change was reported 503 'not checked' although the unit was monitoring. On an OSError in the read-back, a TCP unit is now reconnected once, its serial checked against the named unit, and its state read. Nothing is re-sent: the start still goes out exactly once. A serial cable is never reconnected (opening a MiniMate's port reboots it), a second failure or a silence (a cleanly closed line) ends 'not checked' as before, and a different unit after the reconnect is refused (409, change unconfirmed). Store consequence: none. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 22 +++++++++++++- tests/device_access_fakes.py | 12 +++++++- tests/test_device_access_change.py | 49 ++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 92d88b2..fad91fb 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -227,10 +227,30 @@ class Series3Adapter: settle.append(S3_SENSOR_CHECK_S) # the first read waits out the check return {"subs": [f"0x{ack_sub:02X}"]} + reconnected: list = [] + def read_state() -> str: if settle: sleep(settle.pop()) - return _woken_state(client) + try: + return _woken_state(client) + except OSError as exc: + # The modem can drop the line while the unit sensor-checks + # after a start: BE9441's first wake hit "[Errno 32] Broken + # pipe" (2026-10-29), and a fresh connection read it as + # monitoring. Reconnect once, TCP only (opening a MiniMate's + # serial port reboots it), check it is still the same unit, + # and read. A read -- nothing is re-sent. + if reconnected or not address.host: + raise + reconnected.append(True) + log.warning("Series 3 at %s: the line dropped during the read-back (%s) -- " + "reconnecting to read the state; nothing is re-sent", + address.key, exc) + client.close() + client.open() + self._check(client.read_serial(), serial, address) + return _woken_state(client) return run_change( serial=serial, series=3, start=start, dry_run=dry_run, diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index cf656ae..1c0c79e 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -75,9 +75,13 @@ def default_s3_events(): class FakeMiniMateClient(_Base): def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, - monitor_states=None, write_error=None, **kw): + monitor_states=None, write_error=None, serial_reported=None, wake_errors=None, **kw): super().__init__(**kw) self.serial = serial + # read_serial()'s answer (connect() keeps answering `serial`), and errors + # raised by wake() once a write has gone out -- the read-back's wakes. + self.serial_reported = serial if serial_reported is None else serial_reported + self.wake_errors = list(wake_errors or []) self.monitoring = monitoring self.monitor_states = list(monitor_states) if monitor_states else [monitoring] self.write_error = write_error @@ -107,6 +111,12 @@ class FakeMiniMateClient(_Base): def wake(self, **kw) -> None: self._step("wake") + if self.writes and self.wake_errors: + raise self.wake_errors.pop(0) + + def read_serial(self) -> str: + self._step("read_serial") + return self.serial_reported def get_monitor_status(self) -> MonitorStatus: self._step("get_monitor_status") diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index d4d4280..45cbe9a 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -797,3 +797,52 @@ def test_series3_a_start_waits_out_the_sensor_check_before_its_first_read(): da = access3(fake, sleep=slept.append) (da.start_monitoring if start else da.stop_monitoring)(TCP3, "BE18193") assert (S3_SENSOR_CHECK_S in slept) is waited + + +# ── #9: the read-back after a start survives a dropped modem line ───────────── +# BE9441 over a modem, 2026-10-29: the start was acked, and the read-back's first +# wake after the sensor check hit "[Errno 32] Broken pipe" -- the modem had closed +# the line. A fresh connection read the unit as monitoring a second later. + +SERIAL3 = UnitAddress(host=None, tcp_port=None, port="/dev/ttyUSB0", baud=38400) + + +def test_series3_start_read_back_reconnects_after_a_dropped_line(): + fake = FakeMiniMateClient(monitor_states=[False, True], + wake_errors=[BrokenPipeError(32, "Broken pipe")]) + r = access3(fake).start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") + assert fake.writes == ["start_monitoring"] + assert fake.opened == 2 and "read_serial" in fake.calls + + +def test_series3_read_back_reconnects_only_once(): + fake = FakeMiniMateClient(monitor_states=[False], + wake_errors=[BrokenPipeError(32, "x"), BrokenPipeError(32, "x")]) + with pytest.raises(ChangeUnconfirmed): + access3(fake).start_monitoring(TCP3, "BE18193") + assert fake.writes == ["start_monitoring"] and fake.opened == 2 + + +def test_series3_read_back_reconnect_refuses_a_different_unit(): + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")], + serial_reported="BE11529") + with pytest.raises(ChangeUnconfirmed) as e: + access3(fake).start_monitoring(TCP3, "BE18193") + assert e.value.http_status == 409 and fake.writes == ["start_monitoring"] + + +def test_series3_read_back_does_not_reconnect_on_a_serial_cable(): + # Opening a MiniMate's serial port reboots it (measured 2026-10-25). + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")]) + with pytest.raises(ChangeUnconfirmed): + access3(fake).start_monitoring(SERIAL3, "BE18193") + assert fake.opened == 1 and fake.writes == ["start_monitoring"] + + +def test_series3_read_back_silence_is_not_a_dropped_line(): + # A cleanly closed line reads as silence, not an OSError: no reconnect. + fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[NoAnswer("quiet")]) + with pytest.raises(ChangeUnconfirmed): + access3(fake).start_monitoring(TCP3, "BE18193") + assert fake.opened == 1 and fake.writes == ["start_monitoring"] -- 2.54.1 From 9492e4940004ef3f6dfd126faf69247fe9b9125d Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:27:44 -0400 Subject: [PATCH 140/223] fix(sfm): store a MiniMate download through the Blastware-file import path, as production does (#8) A live Series-3 download was stored from the live 5A decode (store.save): a histogram got no samples and nothing to plot (bench 2026-10-29). The download now carries the assembled Blastware file (DownloadedEvent.bw_bytes, built by the new blastware_file_bytes -- byte-identical to Blastware's own K441LTON.900 and K441LTOK.R10), and persist_download stores it through save_imported_bw, the path the watcher uses for Blastware's files, the way Series 4 already uses save_imported_idf. The event is decoded from the file: histogram samples, setup-block sample rate and record time (#44/#45). source.kind is 'sfm-live'. The file path does not yet read three things right (measured on BE9441): a histogram's vector sum (0.503 where Blastware and the unit say 0.385 -- the decode checker's open finding), the mic peak (0), and a sensitive range. So the unit's own 0C channel peaks, mic and vector sum are overlaid, as Series 4 does, except an impossible vector sum (below the largest channel; BE9441's 0C read -0.0, bench #4), and the unit's range is passed through for the stored samples. Store consequence: new live MiniMate downloads only; existing rows and files are untouched; no backfill, no migration. The record type still reads 'Waveform' for a live histogram until #41 (record type from STRT[18]) lands from the decode checker's branch. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/blastware_file.py | 24 ++--- sfm/device_access/models.py | 1 + sfm/device_access/s3.py | 9 +- sfm/event_ingest.py | 44 +++++++-- sfm/waveform_store.py | 8 +- tests/test_5a_blastware_walk_histogram.py | 13 ++- tests/test_device_access_s3_events.py | 3 + tests/test_event_ingest.py | 110 ++++++++++++++++++++-- 8 files changed, 180 insertions(+), 32 deletions(-) diff --git a/minimateplus/blastware_file.py b/minimateplus/blastware_file.py index e57342d..12e269c 100644 --- a/minimateplus/blastware_file.py +++ b/minimateplus/blastware_file.py @@ -702,8 +702,18 @@ def write_blastware_file( a5_frames: list[S3Frame], path: Union[str, Path], ) -> None: + """Write `blastware_file_bytes(event, a5_frames)` to `path`.""" + Path(path).write_bytes(blastware_file_bytes(event, a5_frames)) + + +def blastware_file_bytes( + event: Event, + a5_frames: list[S3Frame], +) -> bytes: """ - Write a Blastware waveform file from a downloaded event. + The Blastware waveform file for a downloaded event, as bytes -- what + write_blastware_file writes, and what a live SFM download stores through the + file-import path (sfm.event_ingest). Args: event: Event object (populated by get_events() or download_waveform()). @@ -712,23 +722,18 @@ def write_blastware_file( (page_key=0x0000). Pass include_terminator=True to read_bulk_waveform_stream() when collecting frames. Must have at least 2 frames (probe + terminator). - path: Destination file path. Parent directory must exist. - Extension should be set via blastware_filename(). File layout: [22B header] [21B STRT] [body bytes] [26B footer] Raises: ValueError: if a5_frames is empty or has no terminator (page_key=0). - OSError: if the file cannot be written. Confirmed correct waveform body reconstruction against M529LIY6 (example event) (2026-04-21). """ if not a5_frames: raise ValueError("a5_frames must not be empty") - path = Path(path) - # ── Extract STRT record from probe frame ──────────────────────────────── # The STRT record (21 bytes) lives verbatim inside A5[0].data[7:]. # It is stored as-is in the waveform file — do NOT reconstruct it from Event @@ -923,12 +928,7 @@ def write_blastware_file( + b"\x00\x00" ) - # ── Write file ─────────────────────────────────────────────────────────── - with open(path, "wb") as f: - f.write(header) - f.write(strt) - f.write(body) - f.write(footer) + return header + strt + body + footer def read_blastware_file(path: Union[str, Path]) -> Event: diff --git a/sfm/device_access/models.py b/sfm/device_access/models.py index 2d8534c..15b1c73 100644 --- a/sfm/device_access/models.py +++ b/sfm/device_access/models.py @@ -126,6 +126,7 @@ class DownloadedEvent: filename: str verified: Optional[bool] idf_bytes: Optional[bytes] = field(default=None, repr=False) + bw_bytes: Optional[bytes] = field(default=None, repr=False) # Series 3: the assembled Blastware file event: Any = field(default=None, repr=False) a5_frames: Optional[list] = field(default=None, repr=False) compliance: Any = field(default=None, repr=False) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index fad91fb..8d5779b 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -8,7 +8,7 @@ import struct from typing import Any, Callable, Optional from minimateplus import MiniMateClient -from minimateplus.blastware_file import blastware_filename +from minimateplus.blastware_file import blastware_file_bytes, blastware_filename from minimateplus.event_file_io import _GEO_INT16_FS from minimateplus.framing import build_bw_write_frame from minimateplus.protocol import SUB_START_MONITORING, SUB_STOP_MONITORING @@ -398,9 +398,16 @@ class Series3Adapter: if filename is None: raise MalformedReply(f"event {key.hex()} has no usable timestamp, so it cannot be named or stored") verified, why = verify_s3_download(ev, info.compliance_config) + try: + bw_bytes = blastware_file_bytes(ev, ev._a5_frames) + except ValueError as exc: + raise MalformedReply( + f"event {key.hex()}: its Blastware file could not be assembled ({exc}); not saved" + ) from exc return DownloadedEvent( event_id=make_event_id(serial, key, found), serial=serial, series=3, filename=filename, verified=verified, event=ev, a5_frames=ev._a5_frames, + bw_bytes=bw_bytes, compliance=info.compliance_config, timestamp=_s3_dt(ev), detail={"a5_frames": len(ev._a5_frames), "check": why}, ) diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index 5cd2673..c8dbb18 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -66,6 +66,33 @@ def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload: ) +def _overlay_s3_record(ev: Any, unit_peaks: Any) -> None: + """The unit's own 0C peaks, mic and vector sum over the file's. + + Measured 2026-10-29 on BE9441: the file path reads the channel peaks right but + a histogram's vector sum as 0.503 where Blastware and the unit say 0.385 (the + decode checker's open finding), the mic as 0, and it cannot scale a sensitive + range. The unit's values are the accurate ones until the file decoder reads + them. A vector sum below the largest channel peak is impossible -- BE9441's + 0C read -0.0 for some events (bench finding #4) -- so it is not kept. + """ + from minimateplus.models import PeakValues + + if unit_peaks is None: + return + if ev.peak_values is None: + ev.peak_values = PeakValues() + pv = ev.peak_values + for name in ("tran", "vert", "long", "micl"): + value = getattr(unit_peaks, name, None) + if value is not None: + setattr(pv, name, value) + pvs = getattr(unit_peaks, "peak_vector_sum", None) + largest = max((getattr(unit_peaks, n, None) or 0.0) for n in ("tran", "vert", "long")) + if pvs is not None and pvs > 0 and pvs >= largest - 0.005: + pv.peak_vector_sum = pvs + + def _overlay_s4_record(ev: Any, record: dict) -> None: """Fill, where the file left them empty, what the unit's 0x0C said. @@ -103,13 +130,18 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo _overlay_s4_record(ev, dl.record) family = "series4" else: - ev = dl.event - if ev is None: - raise IngestError(f"{dl.filename}: the download carried no event; nothing was stored") - backfill_series3_event(ev, dl.compliance) + # The same path production's watcher uses for Blastware's own files: the + # event is decoded from the file (samples, histogram, setup-block sample + # rate and record time), not from the live 5A decode. The unit's 0C peaks + # stay what they were -- the download *check* (verify_s3_download). + if not dl.bw_bytes: + raise IngestError(f"{dl.filename}: the download carried no event file; nothing was stored") geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None - rec = store.save(ev, serial=dl.serial, a5_frames=dl.a5_frames, - geo_range=geo_range if geo_range is not None else "normal") + ev, rec = store.save_imported_bw(dl.bw_bytes, source_path=Path(dl.filename), + serial_hint=dl.serial, source_kind="sfm-live", + geo_range=geo_range if geo_range is not None else "normal") + if ev is not None and dl.event is not None: + _overlay_s3_record(ev, getattr(dl.event, "peak_values", None)) family = "series3" if ev is None or ev._waveform_key is None: raise IngestError(f"{dl.filename}: stored the file but could not build a database row") diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index aa053fc..031065c 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -296,6 +296,8 @@ class WaveformStore: *, serial_hint: Optional[str] = None, bw_report_text: Optional[Union[str, bytes]] = None, + source_kind: str = "bw-import", + geo_range: Union[str, int] = "normal", ) -> tuple[Event, dict]: """ Ingest a Blastware event file produced by an external tool @@ -413,7 +415,9 @@ class WaveformStore: event_hdf5.write_event_hdf5( hdf5_path, ev, serial=serial, - geo_range="normal", # BW file doesn't carry the range; assume Normal + # The BW file doesn't carry the range (yet); an import assumes Normal, + # a live download passes the unit's own (event_ingest). + geo_range=geo_range, source_kind="bw-import", ) hdf5_filename = hdf5_path.name @@ -438,7 +442,7 @@ class WaveformStore: blastware_filename=filename, blastware_filesize=filesize, blastware_sha256=sha256, - source_kind="bw-import", + source_kind=source_kind, # "sfm-live" for SFM's own downloads (event_ingest) a5_pickle_filename=None, txt_filename=txt_filename, review=existing_review, diff --git a/tests/test_5a_blastware_walk_histogram.py b/tests/test_5a_blastware_walk_histogram.py index 2e9559d..d9492fd 100644 --- a/tests/test_5a_blastware_walk_histogram.py +++ b/tests/test_5a_blastware_walk_histogram.py @@ -18,7 +18,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import minimateplus.protocol as mp # noqa: E402 from minimate_replay import fast_clock # noqa: E402 -from minimateplus.blastware_file import write_blastware_file # noqa: E402 +from minimateplus.blastware_file import blastware_file_bytes, write_blastware_file # noqa: E402 from minimateplus.framing import S3FrameParser # noqa: E402 from minimateplus.models import Event # noqa: E402 @@ -122,3 +122,14 @@ def test_the_walk_is_blastwares_and_rebuilds_its_file(key, bw, n, tmp_path): ev.timestamp = None write_blastware_file(ev, frames, tmp_path / bw) assert (tmp_path / bw).read_bytes() == (FIX / "blastware" / bw).read_bytes() + + +@pytest.mark.parametrize("key,bw", [("0111f210", "K441LTON.900"), ("011106a0", "K441LTOK.R10")]) +def test_blastware_file_bytes_is_blastwares_file(key, bw): + # What a live MiniMate download hands to the store (#8): the file itself, as bytes. + frames = mp.MiniMateProtocol(ByAddress()).read_bulk_waveform_stream( + bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, + strict=True, max_chunks=128) + ev = Event(index=0) + ev.timestamp = None + assert blastware_file_bytes(ev, frames) == (FIX / "blastware" / bw).read_bytes() diff --git a/tests/test_device_access_s3_events.py b/tests/test_device_access_s3_events.py index 9f17183..0cf02d7 100644 --- a/tests/test_device_access_s3_events.py +++ b/tests/test_device_access_s3_events.py @@ -75,6 +75,9 @@ def test_download_returns_the_event_its_frames_and_the_settings(): assert dl.a5_frames and all(f.sub == 0xA5 for f in dl.a5_frames) assert dl.compliance is fake.compliance and dl.filename.startswith("T193") assert dl.timestamp == datetime.datetime(2026, 10, 1, 8, 0, 0) + # #8: the download carries the Blastware file itself, for the file-import path. + from minimateplus.blastware_file import blastware_file_bytes + assert dl.bw_bytes and dl.bw_bytes == blastware_file_bytes(dl.event, dl.a5_frames) def test_download_refuses_a_different_unit_before_downloading(): diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index ec4f7a5..e79a190 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -18,6 +18,7 @@ from sfm.waveform_store import WaveformStore # noqa: E4 THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" BW_FIXTURES = Path(__file__).parent / "fixtures" / "5-11-26" +HIST_FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram" / "blastware" @pytest.fixture @@ -182,23 +183,71 @@ class RecordingStore: self.saved.append((ev, serial, a5_frames, geo_range)) return {"filename": "T193LQ9K.OE0", "filesize": 8708, "sha256": "ab" * 32} + def save_imported_bw(self, bw_bytes, source_path, *, serial_hint=None, bw_report_text=None, + source_kind="bw-import", geo_range="normal"): + self.saved.append(("imported", bw_bytes, source_path, serial_hint, source_kind)) + self.geo_range = geo_range + ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) + return ev, {"filename": source_path.name, "filesize": len(bw_bytes), "sha256": "ab" * 32} -def test_a_series3_event_is_backfilled_then_stored_as_series3(tmp_path): + +def test_a_series3_download_is_stored_through_the_file_import_path(tmp_path): + # #8: the same path production's watcher uses; data from the binary, no backfill. db = SeismoDb(tmp_path / "seismo.db") store = RecordingStore() - fake = FakeMiniMateClient() - ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)) dl = DownloadedEvent(event_id="BE18193:01110000:20261001080000", serial="BE18193", series=3, - filename="T193LQ9K.OE0", verified=None, event=ev, a5_frames=["frame"], - compliance=fake.compliance, timestamp=datetime.datetime(2026, 10, 1, 8, 0, 0)) + filename="T193LQ9K.OE0", verified=None, bw_bytes=b"BW-FILE", + event=s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)), + compliance=FakeMiniMateClient().compliance, + timestamp=datetime.datetime(2026, 10, 1, 8, 0, 0)) out = persist_download(dl, store=store, db=db) - saved_ev, serial, frames, geo_range = store.saved[0] - assert (serial, frames, geo_range) == ("BE18193", ["frame"], 0) - assert saved_ev.sample_rate == 1024 and saved_ev.rectime_seconds == 3.0 + assert store.saved == [("imported", b"BW-FILE", Path("T193LQ9K.OE0"), "BE18193", "sfm-live")] + assert dl.event.sample_rate is None # the live event is not backfilled assert db.get_event(out.db_event_id)["device_family"] == "series3" assert out.stored_filename == "T193LQ9K.OE0" +def _hist_download(name, key, when): + return DownloadedEvent(event_id=f"BE9441:{key}:{when:%Y%m%d%H%M%S}", serial="BE9441", series=3, + filename=name, verified=None, bw_bytes=(HIST_FIX / name).read_bytes(), + timestamp=when) + + +def test_a_series3_histogram_download_is_stored_from_its_file(sdm): + import hashlib, json + from sfm import event_hdf5 + store, db = sdm + dl = _hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)) + out = persist_download(dl, store=store, db=db) + assert out.inserted is True + assert out.sha256 == hashlib.sha256(dl.bw_bytes).hexdigest() # the file, byte for byte + plot = event_hdf5.plot_json_from_hdf5(store.hdf5_path_for("BE9441", "K441LTON.900")) + assert plot["channels"]["Tran"]["values"] # the histogram decoded + sidecar = json.loads(store.sidecar_path_for("BE9441", "K441LTON.900").read_text()) + assert sidecar["source"]["kind"] == "sfm-live" + assert db.get_event(out.db_event_id)["sample_rate"] == 4096 + + +def test_the_small_mic_off_histogram_is_stored_with_samples(sdm): + # Refused on the 2026-10-29 bench; decodes since #47/#49 came in with dev. + from sfm import event_hdf5 + store, db = sdm + dl = _hist_download("K441LTOK.QZ0", "01110000", datetime.datetime(2026, 10, 26, 16, 6, 35)) + out = persist_download(dl, store=store, db=db) + assert out.inserted is True + plot = event_hdf5.plot_json_from_hdf5(store.hdf5_path_for("BE9441", "K441LTOK.QZ0")) + assert plot["channels"]["Vert"]["values"] + + +def test_a_repeat_series3_download_adds_no_row(sdm): + store, db = sdm + when = datetime.datetime(2026, 10, 26, 17, 0, 36) + first = persist_download(_hist_download("K441LTON.900", "0111f210", when), store=store, db=db) + again = persist_download(_hist_download("K441LTON.900", "0111f210", when), store=store, db=db) + assert first.inserted is True and again.inserted is False + assert len(db.query_events(serial="BE9441")) == 1 + + def test_downloading_an_event_the_watcher_stored_writes_nothing_series3(tmp_path): db = SeismoDb(tmp_path / "seismo.db") serial, rec = watcher_import_bw(WaveformStore(tmp_path / "waveforms"), db, "M529LL1L.V70") @@ -221,11 +270,11 @@ def test_downloading_an_event_the_watcher_stored_writes_nothing_series3(tmp_path assert ev.sample_rate is None # not even backfilled -def test_a_series3_download_with_no_event_stores_nothing_and_says_so(tmp_path): +def test_a_series3_download_with_no_file_stores_nothing_and_says_so(tmp_path): store = RecordingStore() dl = DownloadedEvent(event_id="BE18193:01110000:-", serial="BE18193", series=3, filename="T193LQ9K.OE0", verified=None, event=None, a5_frames=["frame"]) - with pytest.raises(IngestError, match="nothing was stored"): + with pytest.raises(IngestError, match="carried no event file; nothing was stored"): persist_download(dl, store=store, db=SeismoDb(tmp_path / "seismo.db")) assert store.saved == [] @@ -245,3 +294,44 @@ def test_backfill_without_settings_changes_nothing(): ev = s3_event(0, "01110000", datetime.datetime(2026, 10, 1)) backfill_series3_event(ev, None) assert ev.sample_rate is None + + +# The file path does not yet read a histogram's vector sum the way Blastware does +# (the checker's open finding), the mic peak, or a sensitive range, so a live +# download keeps the unit's own 0C values for those -- the Series-4 pattern. + +def _with_unit_peaks(dl, *, tran, vert, long, micl, pvs): + from minimateplus.models import PeakValues + dl.event = s3_event(0, dl.event_id.split(":")[1], dl.timestamp) + dl.event.peak_values = PeakValues(tran=tran, vert=vert, long=long, micl=micl, peak_vector_sum=pvs) + return dl + + +def test_a_series3_download_keeps_the_units_peaks_mic_and_vector_sum(sdm): + store, db = sdm + dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), + tran=0.2, vert=0.385, long=0.255, micl=0.00058, pvs=0.38516) + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert row["peak_vector_sum"] == pytest.approx(0.38516, abs=1e-5) # Blastware: 0.385; the file path says 0.503 + assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) + assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.2, 0.385, 0.255), abs=1e-4) + + +def test_an_impossible_unit_vector_sum_is_not_kept(sdm): + # Bench finding #4: BE9441's 0C read -0.0 for a vector sum whose channels reach 1.08. + store, db = sdm + dl = _with_unit_peaks(_hist_download("K441LTOK.R10", "011106a0", datetime.datetime(2026, 10, 26, 16, 6, 37)), + tran=0.25, vert=1.08, long=0.195, micl=0.0001, pvs=-0.0) + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert row["peak_vector_sum"] == pytest.approx(1.0826, abs=1e-3) # the file's own + + +def test_the_units_range_reaches_the_store(tmp_path): + store = RecordingStore() + cc = FakeMiniMateClient().compliance + cc.geo_range = 1 # Sensitive, 1.25 in/s + dl = DownloadedEvent(event_id="BE18193:01110000:20261001080000", serial="BE18193", series=3, + filename="T193LQ9K.OE0", verified=None, bw_bytes=b"BW-FILE", compliance=cc, + timestamp=datetime.datetime(2026, 10, 1, 8, 0, 0)) + persist_download(dl, store=store, db=SeismoDb(tmp_path / "seismo.db")) + assert store.geo_range == 1 -- 2.54.1 From 1626e521aef57e56385c11b64a15c47cbc780f66 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:28:39 -0400 Subject: [PATCH 141/223] docs: 1c bench Batch 1 -- #1, #8, #9 fixed; #15 retracted; the 1A layout after unescaping - Spec (Left open by the 1c bench): #1 b320a53, #8 9492e49, #9 ce441a0, #2 via the dev merge 342c696; #15 retracted in place (sent NULL = unknown, by design). - Series-III reference: a 2026-10-29 row -- the SUB 1A settings fields read after unescaping (mode -7, rate -6, interval -4, record time +6), the old 'anchor-7 constant 0x10' was the escape before 04 at 1024 sps, the channel block stays on raw bytes (open: a float containing an escapable byte), and a monitoring BE9441 answers 1A with its device-info block. CRLF kept. - CLAUDE.md: Batch 1 status. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 5 ++++ docs/instantel_protocol_reference.md | 1 + .../2026-10-20-sfm-series4-parity-design.md | 23 +++++++++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 69100df..1e43377 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -220,6 +220,11 @@ Read this first when picking the project back up. reads escaped bytes (#1), S3 downloads skip the file reader (#8), the S3 start read-back does not reconnect after the modem drops the line (#9), an audit `sent: null` (#15), and page polish. + **Batch 1 fixed (2026-10-29):** #1 (`b320a53`, settings read after unescaping: + mode −7, rate −6, interval −4, record time +6), #9 (`ce441a0`, one reconnect for + the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw` with + the unit's peaks/mic/vector sum overlaid and its range passed). #2 came with the + `dev` merge. **#15 retracted** -- `sent` NULL is "unknown", by design. **Ring path measured the same night:** with THOR's watchdog off, a call-home reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- the unit takes SFM's connection for the call, times out and does not retry. diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index c75e97c..897126f 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-10-29 | §7.6.1, §6 | **The SUB 1A settings fields are read AFTER unescaping (measured, BE9441).** The unit escapes 02/03/04/10 in its replies and `S3FrameParser` keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped mode, sample rate or interval shifts every field after it: BE9441 at Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval, and a Continuous unit read as Single Shot. After `unescape_reply`, every recorded reply (4 settings, two of them Blastware's own writes: 15 min, then 2 s) has one layout: **mode anchor−7, sample rate anchor−6 (u16 BE), histogram interval anchor−4 (u16 BE, s), record time anchor+6 (f32 BE)**. ⚠ The older table's "anchor−7 = constant 0x10" (and mode at anchor−8) was the escape in front of `04` at 1024 sps — right only at that rate. The channel block (`Tran`+28 scale, +33 range, +34 trigger) and the note strings are correct on the RAW bytes and wrong unescaped; 🔶 open: a trigger/alarm float that itself contains 02/03/04/10 would read shifted there. Also measured: **while monitoring, BE9441 answered the 1A reads with its device-info block** (`BE9441`, `Instantel` — the 0x01 reply), so no settings can be read then; the decoder leaves them unknown. The 2026-10-17 anchor question is untouched: every reply measured so far carries the anchor. Fixed in SFM `b320a53`. | | 2026-10-27 | §3 writes | **⚠ RETRACTS the write-frame model (#46, measured).** Every Blastware request on record re-encodes under the uniform rule (02/03/04/10 escaped, SUM8): 3,869/3,869 frames in the Feb–Apr 2026 captures, plus BE9441's 26 write frames of 2026-10-26. A write's [4:6] is its data LENGTH. Config blocks are their header N + 2 bytes: event index (68) and trigger (82) are written as read plus `02 00` / `00 00` (constant on 15 sends); waveform data (69) and the 2,092-byte compliance image (71) are written whole, the latter in addressed chunks (params[2:4] = address; 1,024 B in March, 512 B with Blastware 10.74). The trailing two bytes are not a CRC and went out stale, so the unit evidently ignores them. "Only BW_CMD doubled", the "DLE-aware checksum", "offset = data[1] + 2" and "chunks 1,027 / 1,055 at offset 0x1004" were these frames read with their escape bytes in. The trigger block is read first (SUB 0x2E, 26 bytes); its byte 5 has been 01 / 03 / 04 by unit and session (meaning unknown). | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | | 2026-10-26 (4) | §3, §10 | **Replies follow the request rule; a write-frame suspicion (inferred).** Measured on all 748 reply frames of the 10-26 recording: the unit escapes exactly 02/03/04/10 with a `10`, and the checksum is **SUM8 of the unescaped payload**, 748/748. The long-held "S3 response checksums frequently fail SUM8" (`protocol._validate_frame`) is `S3FrameParser`'s own doing: it keeps the `10` of `10 02/03/04` in its output (consumers rely on that) and sums it, so 502/540 A5 replies read invalid. 🔶 **Inferred only:** `build_bw_write_frame`'s model ("raw except BW_CMD", "DLE-aware checksum") shows the same fingerprints as the retracted 5A model -- SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and Blastware escapes `03` in write data (§3 note, 2026-04-20). A write whose payload holds a bare 02/03/04/10 may be malformed; one Blastware config-write capture settles it. Not acted on. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index ffbd8d0..74accc0 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -664,12 +664,15 @@ From the page bench on BE9441 (MiniMate, modem `63.43.212.233`) and UM20147 (Micromate, RX55 `63.45.161.30`). Numbers as given at the bench. Fixes wait for a short plan; #14 waits for the line-hold decision above. -1. **S3 settings decode reads before escapes are removed** -- BE9441 showed 0 sps +1. ✅ **Fixed `b320a53`** (the four anchor fields read after `unescape_reply`; mode −7, + rate −6, interval −4, record time +6; the channel block stays on raw bytes). + **S3 settings decode reads before escapes are removed** -- BE9441 showed 0 sps and a 68.3-min interval (true: Histogram, 4096 sps, 2 s, per the 10-26 fixture README); while monitoring the `1A` anchor is not found at all. Old bug, the same family as #46's C1. Fix: decode after unescaping; this reply is the fixture. -2. **A 1.7 KB mic-off histogram is refused** -- this branch lacks #47/#49 (`dev` +2. ✅ **Fixed by the `dev` merge `342c696`** (#47/#49 came in). + **A 1.7 KB mic-off histogram is refused** -- this branch lacks #47/#49 (`dev` decodes `K441LTOK.QZ0`, this branch does not). Bring them over before merge. 3. ✅ The 71 KB histogram crossing two 64 KB pages downloaded over the modem byte-identical to Blastware's (`f10f39a8…`). @@ -678,11 +681,18 @@ a short plan; #14 waits for the line-hold decision above. 5. Stored S3 event: client "Terra-Mechanic" (last letter missing) -- unexplained. 6. Page: the Config tab shows the empty write form until Read in serial mode. 7. `/db/events` 500 "database is locked" on the first page load against a new DB. -8. **S3 downloads are stored from the live waveform decoder** (`store.save`), not +8. ✅ **Fixed `9492e49`**: the download carries the assembled Blastware file and is + stored through `save_imported_bw` (`source.kind` "sfm-live"); the unit's 0C peaks, + mic and vector sum are overlaid (the file path reads a histogram's vector sum as + 0.503 vs 0.385, the mic as 0, and no sensitive range yet), and its range scales + the samples. The "Waveform" label waits for #41 from the checker branch. + **S3 downloads are stored from the live waveform decoder** (`store.save`), not the file reader that Series 4 uses (`save_imported_idf`): a histogram gets no samples and is labelled Waveform. Fix: store S3 downloads through the file-import path (also aligns event times with v0.32.0). -9. **S3 start over a modem:** the line dropped during the sensor check, the +9. ✅ **Fixed `ce441a0`** (one reconnect on an `OSError`, TCP only, identity checked, + nothing re-sent). + **S3 start over a modem:** the line dropped during the sensor check, the read-back hit `Broken pipe` and did not reconnect → 503 though the start worked. Fix: reconnect for the read-back (reads only; the send stays single). 10. Page: "Start monitoring failed:" on a sent-but-unconfirmed change -- wording. @@ -694,7 +704,10 @@ a short plan; #14 waits for the line-hold decision above. `0x0C` mic denormal parked above, now visible. 14. **After hanging up for a RADIO RING, SFM called the unit straight back up** (the page's post-change status read). Part of the line-hold decision. -15. **Audit:** the UM20147 stop's record says `sent: null` although `0x97` went out. +15. ~~**Audit:** the UM20147 stop's record says `sent: null` although `0x97` went out.~~ + **RETRACTED 2026-10-29: not a bug.** `sent` is documented as 1 acknowledged, 0 + nothing sent, NULL unknown (`sfm/database.py`, `change.py`); a frame answered by a + ring instead of its ack is exactly unknown, and the row's `error` says it was sent. 16. Page: a 504 on a unit THOR holds should say "connected, but no reply -- another program may be holding this unit's line". - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. -- 2.54.1 From dbd8a91661b4fd9357bf6e32a2e205b7adb9819c Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:56:44 -0400 Subject: [PATCH 142/223] fix(sfm): wake a MiniMate before the read-back reconnect reads its serial (#9 review) The reconnect in ce441a0 opened a fresh connection and sent a bare 0x15 (the identity check) before any SESSION_RESET + POLL. It exists for a unit that has just started -- sensor check, then monitoring -- and a monitoring MiniMate ignores a bare request until woken (measured 2026-04-08), so the identity read would have timed out and the start reported unconfirmed anyway. Now: open, wake (the same retried wake the read-back uses), read the serial, read 0x1C -- the order the status read and the legacy write routes use. Still one reconnect, TCP only, nothing re-sent. The fake gains bare_requests_ignored (off unless a test asks): a fresh connection's reads time out, with the real client's TimeoutError, until woken. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/s3.py | 6 +++++- tests/device_access_fakes.py | 26 +++++++++++++++++++++++--- tests/test_device_access_change.py | 13 +++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 8d5779b..38563a8 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -249,8 +249,12 @@ class Series3Adapter: address.key, exc) client.close() client.open() + # Wake first: the identity read is a bare 0x15, which a unit that + # has just started ignores until SESSION_RESET + POLL (the order + # the status read and the legacy write routes use: poll, then read). + client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S) self._check(client.read_serial(), serial, address) - return _woken_state(client) + return s3_run_state(client.get_monitor_status()) return run_change( serial=serial, series=3, start=start, dry_run=dry_run, diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 1c0c79e..6418e2b 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -18,6 +18,9 @@ SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um2014 THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf" +from minimateplus.protocol import TimeoutError as mmp_TimeoutError # noqa: E402 + + class _Base: def __init__(self, fail=None, open_error=None): self.fail = list(fail or []) @@ -75,9 +78,14 @@ def default_s3_events(): class FakeMiniMateClient(_Base): def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None, - monitor_states=None, write_error=None, serial_reported=None, wake_errors=None, **kw): + monitor_states=None, write_error=None, serial_reported=None, wake_errors=None, + bare_requests_ignored=False, **kw): super().__init__(**kw) self.serial = serial + # As a monitoring MiniMate (measured 2026-04-08): on a fresh connection a + # read before SESSION_RESET + POLL goes unanswered. Off unless a test asks. + self.bare_requests_ignored = bare_requests_ignored + self._woken = False # read_serial()'s answer (connect() keeps answering `serial`), and errors # raised by wake() once a write has gone out -- the read-back's wakes. self.serial_reported = serial if serial_reported is None else serial_reported @@ -98,8 +106,18 @@ class FakeMiniMateClient(_Base): self.download_requests: list = [] # (key4, expected_timestamp) per download self.last_download = None + def open(self): + super().open() + self._woken = False + + def _bare_read(self, name): + self._step(name) + if self.bare_requests_ignored and not self._woken: + raise mmp_TimeoutError(f"{name}: no reply (the unit was not woken)") + def connect(self) -> DeviceInfo: self._step("connect") + self._woken = True # connect() starts with the startup handshake return DeviceInfo( serial=self.serial, firmware_minor=17, firmware_version="S338.17", dsp_version="10.72", manufacturer="Instantel", model="MiniMate Plus", @@ -108,18 +126,20 @@ class FakeMiniMateClient(_Base): def poll(self) -> None: self._step("poll") + self._woken = True def wake(self, **kw) -> None: self._step("wake") if self.writes and self.wake_errors: raise self.wake_errors.pop(0) + self._woken = True def read_serial(self) -> str: - self._step("read_serial") + self._bare_read("read_serial") return self.serial_reported def get_monitor_status(self) -> MonitorStatus: - self._step("get_monitor_status") + self._bare_read("get_monitor_status") state = self.monitor_states.pop(0) if len(self.monitor_states) > 1 else self.monitor_states[0] # A bool is a measured state; an int (or None: a short section) is the raw 0x1C flag byte. flag = (0x10 if state else 0x00) if isinstance(state, bool) else state diff --git a/tests/test_device_access_change.py b/tests/test_device_access_change.py index 45cbe9a..e4e64e2 100644 --- a/tests/test_device_access_change.py +++ b/tests/test_device_access_change.py @@ -816,6 +816,19 @@ def test_series3_start_read_back_reconnects_after_a_dropped_line(): assert fake.opened == 2 and "read_serial" in fake.calls +def test_series3_read_back_reconnect_wakes_the_unit_before_reading_it(): + # The unit the reconnect is for has just started (sensor check, then + # monitoring), and a monitoring MiniMate ignores a bare request until it is + # woken -- so the fresh connection's identity read must come after the wake. + fake = FakeMiniMateClient(monitor_states=[False, True], bare_requests_ignored=True, + wake_errors=[BrokenPipeError(32, "Broken pipe")]) + r = access3(fake).start_monitoring(TCP3, "BE18193") + assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring") + assert fake.writes == ["start_monitoring"] and fake.opened == 2 + after = fake.calls[fake.calls.index("start_monitoring"):] + assert after.index("read_serial") > len(after) - 1 - after[::-1].index("wake") + + def test_series3_read_back_reconnects_only_once(): fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x"), BrokenPipeError(32, "x")]) -- 2.54.1 From 3a1d34ae928fd8b816b92578872f29569e626bc8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:56:44 -0400 Subject: [PATCH 143/223] fix(sfm): a download the store already holds is found by its Blastware name, not only its time (#8 review) persist_download checked 'already stored' on the unit's 0C time only, but a histogram's row is stored at its file's time, a second earlier on most histograms (#51): K441LTOK.QZ0 decodes to 16:06:34, its 0C says 16:06:35. So a live download of an event the watcher had imported missed the check and re-stored it -- UPSERTing over the watcher's row (Blastware's ZC frequencies and vector sum lost) and rewriting its sidecar as sfm-live -- and every repeat live download rewrote the files again. New SeismoDb.find_event_by_blastware_name(): the row stored under the same Blastware name (the event's second, per blastware_filename_time; the rule _restamp_by_file uses), matching a direct name to the call-in copy's W/H name. Any other name matches nothing. Also two comments from 9492e49 that said the opposite of the code (the unit's peaks are overlaid; source.kind is a parameter). Store consequence: none for existing rows; no schema change, no migration. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/database.py | 22 +++++++++++++++++++++ sfm/event_ingest.py | 9 +++++++-- sfm/waveform_store.py | 3 ++- tests/test_event_ingest.py | 40 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 3 deletions(-) diff --git a/sfm/database.py b/sfm/database.py index e872fb1..9ac430a 100644 --- a/sfm/database.py +++ b/sfm/database.py @@ -808,6 +808,28 @@ class SeismoDb: ).fetchone() return dict(row) if row else None + def find_event_by_blastware_name(self, serial: str, filename: str) -> Optional[dict]: + """The row stored under `filename`'s Blastware name, or None. + + A Blastware name encodes the serial and the event's second + (`blastware_filename_time`), so the same name is the same event -- the + rule `_restamp_by_file` uses. A direct download is `.0` and + Blastware's call-in copy of the same event `.0W` / `H`; all + three forms match. Any other name ("imported.bw") matches nothing. + """ + if blastware_filename_time(filename) is None: + return None + base = filename.upper() + if len(base.rsplit(".", 1)[-1]) == 4: + base = base[:-1] + with self._connect() as conn: + row = conn.execute( + "SELECT * FROM events WHERE serial = ? AND UPPER(blastware_filename) IN (?, ?, ?) " + "ORDER BY rowid LIMIT 1", + (serial, base, base + "W", base + "H"), + ).fetchone() + return dict(row) if row else None + def query_events( self, serial: Optional[str] = None, diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index c8dbb18..8480d96 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -123,6 +123,11 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo rows = db.query_events(serial=dl.serial, from_dt=dl.timestamp, to_dt=dl.timestamp, limit=1) if rows: return _already_stored(dl, rows[0]) + # A histogram's row is stored at its file's time, a second before the unit's + # on most (#51), so the time above misses it; its Blastware name does not. + row = db.find_event_by_blastware_name(dl.serial, dl.filename) + if row is not None: + return _already_stored(dl, row) if dl.series == 4: ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename), serial_hint=dl.serial) @@ -132,8 +137,8 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo else: # The same path production's watcher uses for Blastware's own files: the # event is decoded from the file (samples, histogram, setup-block sample - # rate and record time), not from the live 5A decode. The unit's 0C peaks - # stay what they were -- the download *check* (verify_s3_download). + # rate and record time), not from the live 5A decode. The unit's own 0C + # peaks, mic and vector sum then go over the file's (_overlay_s3_record). if not dl.bw_bytes: raise IngestError(f"{dl.filename}: the download carried no event file; nothing was stored") geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index 031065c..6408b1e 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -317,7 +317,8 @@ class WaveformStore: 3. Resolve serial from BW filename (`

...`) or use serial_hint. Falls back to "UNKNOWN". 4. Copy the BW bytes verbatim into //. - 5. Write the .sfm.json sidecar with source.kind = "bw-import" + 5. Write the .sfm.json sidecar with source.kind = `source_kind` + ("bw-import"; "sfm-live" for SFM's own downloads) and a5_pickle_filename = None. Does NOT write a .a5.pkl (no A5 source available; byte-for-byte regeneration not possible — the on-disk BW file IS the byte-for-byte source). diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index e79a190..5257762 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -335,3 +335,43 @@ def test_the_units_range_reaches_the_store(tmp_path): timestamp=datetime.datetime(2026, 10, 1, 8, 0, 0)) persist_download(dl, store=store, db=SeismoDb(tmp_path / "seismo.db")) assert store.geo_range == 1 + + +# Review finding (2026-10-29): a histogram's row is stored at its file's time, +# a second before the unit's 0C time on most histograms (#51) -- K441LTOK.QZ0 +# decodes to 16:06:34, its 0C says 16:06:35 -- so a pre-check on the 0C time +# alone missed it, and a live download overwrote the watcher's row and sidecar. +# The Blastware name encodes the event's own second and does not miss. + +@pytest.mark.parametrize("stored_as", ["K441LTOK.QZ0", "K441LTOK.QZ0H"]) # direct / call-in name +def test_a_live_histogram_the_watcher_already_stored_writes_nothing(sdm, stored_as): + import json + store, db = sdm + ev, rec = store.save_imported_bw((HIST_FIX / "K441LTOK.QZ0").read_bytes(), + source_path=Path(stored_as), serial_hint=None, + bw_report_text=(HIST_FIX / "K441LTOK_QZ0_ASCII.TXT").read_bytes()) + db.insert_events([ev], serial="BE9441", waveform_records={ev._waveform_key.hex(): rec}, + device_family="series3") # as the import route (server.py) does + [row0] = db.query_events(serial="BE9441") + assert row0["timestamp"] != "2026-10-26T16:06:35" # the case: the row sits a second off + assert row0["blastware_filename"] == stored_as + out = persist_download(_hist_download("K441LTOK.QZ0", "01110000", + datetime.datetime(2026, 10, 26, 16, 6, 35)), store=store, db=db) + assert out.inserted is False and out.detail["already_stored"] is True + assert db.query_events(serial="BE9441") == [row0] + sidecar = json.loads(store.sidecar_path_for("BE9441", stored_as).read_text()) + assert sidecar["source"]["kind"] == "bw-import" + + +def test_a_repeat_live_histogram_a_second_off_its_file_adds_nothing(sdm): + store, db = sdm + when = datetime.datetime(2026, 10, 26, 16, 6, 35) + first = persist_download(_hist_download("K441LTOK.QZ0", "01110000", when), store=store, db=db) + again = persist_download(_hist_download("K441LTOK.QZ0", "01110000", when), store=store, db=db) + assert first.inserted is True and again.inserted is False and again.detail["already_stored"] is True + assert len(db.query_events(serial="BE9441")) == 1 + + +def test_a_name_that_is_not_blastwares_matches_nothing(sdm): + store, db = sdm + assert db.find_event_by_blastware_name("BE9441", "imported.bw") is None -- 2.54.1 From a72d3a98a9fe9279e718580fa3e66301c5da7964 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:56:44 -0400 Subject: [PATCH 144/223] fix(minimateplus): refuse a settings write whose four fields would not read back as asked (#1 review) _encode_compliance_config patches the raw SUB 1A bytes at offsets measured at 1024 sps (April 2026), where the escape before 04 sits between the mode and the anchor. b320a53 moved the decoder to the measured layout (unescaped: mode -7, rate -6, interval -4, record time +6), which exposed the encoder: on BE9441's recorded 10-25 Continuous / 4096 block a mode change rewrote the byte in front of the mode, and on the 10-26 Histogram+Continuous / 2048 block a sample-rate change landed one byte off. The old decoder read the same wrong bytes, so such a write looked as if it had taken. The encoder now decodes its own result with the decoder and raises ValueError when mode, sample rate, interval or record time would not read back as asked (or a field not asked for would change) -- before push_config_raw sends a byte. No write offset is moved: rewriting the encoder on unescaped bytes is #46's. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 38 ++++++++++++++++++++++- tests/test_s3_compliance_anchor_fields.py | 29 +++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/minimateplus/client.py b/minimateplus/client.py index dfe8f0b..da5f252 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -2122,7 +2122,13 @@ def _encode_compliance_config( DLE-jitter shifts): Anchor: b'\\xbe\\x80\\x00\\x00\\x00\\x00' (confirmed stable, both BE11529 and BE18189) - recording_mode → uint8 at anchor_pos - 8 (BOTH read and write) + ⚠ 2026-10-29: these RAW offsets were measured at 1024 sps, where the escape + before `04` sits between the mode and the anchor. The decoder now reads + the four fields after unescaping (mode -7, rate -6, interval -4, record + time +6), so at any other layout these patch the wrong bytes. Until the + encoder is rewritten on unescaped bytes (#46), a payload whose four fields + do not read back as asked raises ValueError -- see the end of this function. + recording_mode → uint8 at anchor_pos - 8 (raw; right at 1024 sps only) Values: 0x00=Single Shot, 0x01=Continuous, 0x03=Histogram, 0x04=Histogram+Continuous NOTE: The byte at anchor_pos - 7 is always 0x10 (a DLE marker regenerated by device firmware in every E5 response). It must NOT be overwritten during @@ -2305,10 +2311,40 @@ def _encode_compliance_config( _set_string(b"Seis Loc:", seis_loc) _set_string(b"Extended Notes", notes) + # ── Read-back check: the payload must decode to what was asked ──────────── + # The decoder is the measured layout (every recorded reply); these offsets are + # 1024-sps raw ones. A mode change on BE9441's 10-25 Continuous / 4096 block + # rewrote the byte in front of the mode and read back unchanged. Refuse it + # here, before push_config_raw sends anything. + asked = {"recording_mode": recording_mode, "sample_rate": sample_rate, + "histogram_interval_sec": histogram_interval_sec, "record_time": record_time} + if any(v is not None for v in asked.values()): + before, after = _settings_read_back(raw), _settings_read_back(bytes(buf)) + if record_time is not None: + asked["record_time"] = struct.unpack(">f", struct.pack(">f", record_time))[0] + want = {k: (v if v is not None else before[k]) for k, v in asked.items()} + wrong = {k: (after[k], want[k]) for k in asked if after[k] != want[k]} + if wrong: + raise ValueError( + "_encode_compliance_config: the patched block would not read back as asked (" + + ", ".join(f"{k} reads {got!r}, not {exp!r}" for k, (got, exp) in wrong.items()) + + ") -- refused, nothing built or sent. The encoder's offsets were measured at " + "1024 sps and need rewriting on unescaped bytes (#46)." + ) + # 2-byte footer — checksum formula unknown; \x00\x00 confirmed accepted by device return bytes(buf) + b"\x00\x00" +def _settings_read_back(data: bytes) -> dict: + """Mode, sample rate, interval and record time as the decoder reads `data`.""" + info = DeviceInfo(serial="", firmware_minor=0) + _decode_compliance_config_into(data, info) + cc = info.compliance_config + return {k: getattr(cc, k, None) if cc is not None else None + for k in ("recording_mode", "sample_rate", "histogram_interval_sec", "record_time")} + + def _decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None: """ Decode a 2090-byte SUB 1A (COMPLIANCE_CONFIG) response into a ComplianceConfig. diff --git a/tests/test_s3_compliance_anchor_fields.py b/tests/test_s3_compliance_anchor_fields.py index 29543e7..52f2d4d 100644 --- a/tests/test_s3_compliance_anchor_fields.py +++ b/tests/test_s3_compliance_anchor_fields.py @@ -94,3 +94,32 @@ def test_a_reply_without_the_settings_block_reads_as_unknown(): cc = _decode(fe) assert (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, cc.record_time) == \ (None, None, None, None) + + +# The write side (review finding, 2026-10-29). _encode_compliance_config patches +# the RAW bytes at offsets measured at 1024 sps (April 2026), where an escape sits +# between the mode and the anchor. At other rates the mode is one byte later, so +# a mode change rewrote the byte in front of it. A payload that would not read +# back as asked is refused before anything is sent. + +from minimateplus.client import _encode_compliance_config # noqa: E402 + + +def _block(i): + return _settings_replies()[i].ljust(2126, b"\x00") # a whole block's length + + +@pytest.mark.parametrize("i, change", [ + (0, {"recording_mode": 0}), # 10-25 Continuous / 4096: mode sits at -7, not -8 + (1, {"sample_rate": 4096}), # 10-26 Histogram+Continuous / 2048: escaped mode shifts the rate +]) +def test_a_change_that_would_not_read_back_is_refused(i, change): + with pytest.raises(ValueError, match="read back"): + _encode_compliance_config(_block(i), **change) + + +def test_a_change_that_reads_back_as_asked_is_built(): + out = _encode_compliance_config(_block(0), record_time=7.0) + cc = _decode(out) + assert (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, cc.record_time) == \ + (1, 4096, 5, 7.0) -- 2.54.1 From 1cce2fcf63ddae970720c2d6ab08891857353b90 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:57:13 -0400 Subject: [PATCH 145/223] docs: Batch 1 final-review fixes -- reconnect wake, dedup by name, the write encoder's refusal - Spec: #1, #8, #9 carry their review follow-ups (a72d3a9, 3a1d34a, dbd8a91); new open finding 17 (a monitoring MiniMate's 1A has no range, so a download then stores Normal-scaled samples; ':S338.17' setup name; no .a5.pkl kept). - Series-III reference (CRLF kept): the 2026-10-29 row records that the write encoder was not moved and now refuses a patch that would not read back. - CLAUDE.md: the three fixes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 4 ++++ docs/instantel_protocol_reference.md | 2 +- .../2026-10-20-sfm-series4-parity-design.md | 16 +++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1e43377..335fc6c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -225,6 +225,10 @@ Read this first when picking the project back up. the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw` with the unit's peaks/mic/vector sum overlaid and its range passed). #2 came with the `dev` merge. **#15 retracted** -- `sent` NULL is "unknown", by design. + Final review fixes: `dbd8a91` (wake before the reconnect's identity read), + `3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write + encoder refuses a patch that would not read back -- its offsets are 1024-sps + raw ones, #46). **Ring path measured the same night:** with THOR's watchdog off, a call-home reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- the unit takes SFM's connection for the call, times out and does not retry. diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 897126f..bfed858 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,7 +11,7 @@ | Date | Section | Change | |---|---|---| -| 2026-10-29 | §7.6.1, §6 | **The SUB 1A settings fields are read AFTER unescaping (measured, BE9441).** The unit escapes 02/03/04/10 in its replies and `S3FrameParser` keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped mode, sample rate or interval shifts every field after it: BE9441 at Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval, and a Continuous unit read as Single Shot. After `unescape_reply`, every recorded reply (4 settings, two of them Blastware's own writes: 15 min, then 2 s) has one layout: **mode anchor−7, sample rate anchor−6 (u16 BE), histogram interval anchor−4 (u16 BE, s), record time anchor+6 (f32 BE)**. ⚠ The older table's "anchor−7 = constant 0x10" (and mode at anchor−8) was the escape in front of `04` at 1024 sps — right only at that rate. The channel block (`Tran`+28 scale, +33 range, +34 trigger) and the note strings are correct on the RAW bytes and wrong unescaped; 🔶 open: a trigger/alarm float that itself contains 02/03/04/10 would read shifted there. Also measured: **while monitoring, BE9441 answered the 1A reads with its device-info block** (`BE9441`, `Instantel` — the 0x01 reply), so no settings can be read then; the decoder leaves them unknown. The 2026-10-17 anchor question is untouched: every reply measured so far carries the anchor. Fixed in SFM `b320a53`. | +| 2026-10-29 | §7.6.1, §6 | **The SUB 1A settings fields are read AFTER unescaping (measured, BE9441).** The unit escapes 02/03/04/10 in its replies and `S3FrameParser` keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped mode, sample rate or interval shifts every field after it: BE9441 at Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval, and a Continuous unit read as Single Shot. After `unescape_reply`, every recorded reply (4 settings, two of them Blastware's own writes: 15 min, then 2 s) has one layout: **mode anchor−7, sample rate anchor−6 (u16 BE), histogram interval anchor−4 (u16 BE, s), record time anchor+6 (f32 BE)**. ⚠ The older table's "anchor−7 = constant 0x10" (and mode at anchor−8) was the escape in front of `04` at 1024 sps — right only at that rate. The channel block (`Tran`+28 scale, +33 range, +34 trigger) and the note strings are correct on the RAW bytes and wrong unescaped; 🔶 open: a trigger/alarm float that itself contains 02/03/04/10 would read shifted there. Also measured: **while monitoring, BE9441 answered the 1A reads with its device-info block** (`BE9441`, `Instantel` — the 0x01 reply), so no settings can be read then; the decoder leaves them unknown. The 2026-10-17 anchor question is untouched: every reply measured so far carries the anchor. Fixed in SFM `b320a53`. ⚠ **The write side was not moved:** `_encode_compliance_config` still patches the raw bytes at the 1024-sps offsets (mode anchor−8), which at 2048/4096 sps rewrite the byte in front of the mode (measured on BE9441's 10-25 block); it now refuses a patch whose four fields do not read back as asked (`a72d3a9`) until rewritten on unescaped bytes (#46). | | 2026-10-27 | §3 writes | **⚠ RETRACTS the write-frame model (#46, measured).** Every Blastware request on record re-encodes under the uniform rule (02/03/04/10 escaped, SUM8): 3,869/3,869 frames in the Feb–Apr 2026 captures, plus BE9441's 26 write frames of 2026-10-26. A write's [4:6] is its data LENGTH. Config blocks are their header N + 2 bytes: event index (68) and trigger (82) are written as read plus `02 00` / `00 00` (constant on 15 sends); waveform data (69) and the 2,092-byte compliance image (71) are written whole, the latter in addressed chunks (params[2:4] = address; 1,024 B in March, 512 B with Blastware 10.74). The trailing two bytes are not a CRC and went out stale, so the unit evidently ignores them. "Only BW_CMD doubled", the "DLE-aware checksum", "offset = data[1] + 2" and "chunks 1,027 / 1,055 at offset 0x1004" were these frames read with their escape bytes in. The trigger block is read first (SUB 0x2E, 26 bytes); its byte 5 has been 01 / 03 / 04 by unit and session (meaning unknown). | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | | 2026-10-26 (4) | §3, §10 | **Replies follow the request rule; a write-frame suspicion (inferred).** Measured on all 748 reply frames of the 10-26 recording: the unit escapes exactly 02/03/04/10 with a `10`, and the checksum is **SUM8 of the unescaped payload**, 748/748. The long-held "S3 response checksums frequently fail SUM8" (`protocol._validate_frame`) is `S3FrameParser`'s own doing: it keeps the `10` of `10 02/03/04` in its output (consumers rely on that) and sums it, so 502/540 A5 replies read invalid. 🔶 **Inferred only:** `build_bw_write_frame`'s model ("raw except BW_CMD", "DLE-aware checksum") shows the same fingerprints as the retracted 5A model -- SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and Blastware escapes `03` in write data (§3 note, 2026-04-20). A write whose payload holds a bare 02/03/04/10 may be malformed; one Blastware config-write capture settles it. Not acted on. | diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 74accc0..34506f2 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -664,7 +664,9 @@ From the page bench on BE9441 (MiniMate, modem `63.43.212.233`) and UM20147 (Micromate, RX55 `63.45.161.30`). Numbers as given at the bench. Fixes wait for a short plan; #14 waits for the line-hold decision above. -1. ✅ **Fixed `b320a53`** (the four anchor fields read after `unescape_reply`; mode −7, +1. ✅ **Fixed `b320a53`**; the write encoder refuses a patch that would not read back + (`a72d3a9`) -- its raw offsets are 1024-sps ones and need rewriting on unescaped + bytes (#46). (The four anchor fields read after `unescape_reply`; mode −7, rate −6, interval −4, record time +6; the channel block stays on raw bytes). **S3 settings decode reads before escapes are removed** -- BE9441 showed 0 sps and a 68.3-min interval (true: Histogram, 4096 sps, 2 s, per the 10-26 fixture @@ -681,7 +683,8 @@ a short plan; #14 waits for the line-hold decision above. 5. Stored S3 event: client "Terra-Mechanic" (last letter missing) -- unexplained. 6. Page: the Config tab shows the empty write form until Read in serial mode. 7. `/db/events` 500 "database is locked" on the first page load against a new DB. -8. ✅ **Fixed `9492e49`**: the download carries the assembled Blastware file and is +8. ✅ **Fixed `9492e49`**, plus `3a1d34a` ("already stored" also matches the Blastware + name: a histogram's row sits a second off its 0C time). The download carries the assembled Blastware file and is stored through `save_imported_bw` (`source.kind` "sfm-live"); the unit's 0C peaks, mic and vector sum are overlaid (the file path reads a histogram's vector sum as 0.503 vs 0.385, the mic as 0, and no sensitive range yet), and its range scales @@ -690,7 +693,8 @@ a short plan; #14 waits for the line-hold decision above. the file reader that Series 4 uses (`save_imported_idf`): a histogram gets no samples and is labelled Waveform. Fix: store S3 downloads through the file-import path (also aligns event times with v0.32.0). -9. ✅ **Fixed `ce441a0`** (one reconnect on an `OSError`, TCP only, identity checked, +9. ✅ **Fixed `ce441a0`**, plus `dbd8a91` (the reconnect wakes the unit before its + identity read). (One reconnect on an `OSError`, TCP only, identity checked, nothing re-sent). **S3 start over a modem:** the line dropped during the sensor check, the read-back hit `Broken pipe` and did not reconnect → 503 though the start @@ -710,6 +714,12 @@ a short plan; #14 waits for the line-hold decision above. ring instead of its ack is exactly unknown, and the row's `error` says it was sent. 16. Page: a 504 on a unit THOR holds should say "connected, but no reply -- another program may be holding this unit's line". +17. **Found by the Batch 1 review (open):** a MiniMate downloaded *while monitoring* + answers 1A with its device-info block, so no range is read and the stored + `.h5` samples assume Normal -- 8x off on a sensitive-range unit (the row's + peaks are the unit's, overlaid). Pre-existing on the old path too. The same + reply decodes a setup name of `:S338.17`. Live S3 downloads also no longer + keep the `.a5.pkl` wire record. - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. - **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. - **A lost `0C` during a Series-3 list (1c).** The strict walk raises on a lost `0A` -- 2.54.1 From 50a050114712b127a342749fe2934e84b3c66e4f Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 23:58:52 -0400 Subject: [PATCH 146/223] test(sfm): a live MiniMate histogram is labelled Histogram (#8, via #41) K441LTON.900 -- a direct download's name, with no type letter -- read 'Waveform' before #41 came in with a1d2b61 (verified failing first), and 'Histogram' from STRT[18] after. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/test_event_ingest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 5257762..1d4a5d3 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -375,3 +375,12 @@ def test_a_repeat_live_histogram_a_second_off_its_file_adds_nothing(sdm): def test_a_name_that_is_not_blastwares_matches_nothing(sdm): store, db = sdm assert db.find_event_by_blastware_name("BE9441", "imported.bw") is None + + +def test_a_live_histogram_is_labelled_a_histogram(sdm): + # #41 (the record type from STRT[18], not the name): a direct download's name, + # K441LTON.900, carries no type letter, so the bytes decide. + store, db = sdm + out = persist_download(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), + store=store, db=db) + assert db.get_event(out.db_event_id)["record_type"] == "Histogram" -- 2.54.1 From b6ed5f5bd5e092ba9d9ba1a1fde9a3b7b2a2ed8d Mon Sep 17 00:00:00 2001 From: serversdown Date: Fri, 30 Oct 2026 00:36:26 -0400 Subject: [PATCH 147/223] feat(sfm): SFM's MiniMate files carry the W/H type letter Blastware's direct downloads leave off Blastware names a direct download K441LTON.900 and only its call-in copy K441LTON.900H, so a folder of directly downloaded events cannot be sorted by kind. SFM's own files now always carry the letter. It is read from the file's own record-type byte (STRT[18], #41) by the new with_type_letter() -- not from the recording mode: BE9441's K441LTOK.R10 is a waveform that triggered 2 s into histogram K441LTOK.QZ0 (Histogram+Continuous). A file whose type does not read keeps the plain name; a name never fails a download. All three paths that name a MiniMate file SFM builds: the device-access download (the page's event list), WaveformStore.save (the legacy route's store copy, the bench call-in server), and the legacy /device/event/{i}/blastware_file download. Verified on BE9441's recorded 5A walk: 0111f210 -> K441LTON.900H, 011106a0 -> K441LTOK.R10W, byte-identical to Blastware's files. find_event_by_blastware_name tightens with it: a lettered name matches itself and the letterless form, not the other letter (a waveform and a histogram in the same second are different events); a letterless name still matches all three. Store consequence: new downloads only; rows and files stored before keep their names, and 'already stored' still finds them. No schema change, no migration. The event list shows the plain name until the event is downloaded (the type is not known before the 5A). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 2 +- minimateplus/blastware_file.py | 29 +++++++++ sfm/database.py | 23 ++++--- sfm/device_access/s3.py | 3 +- sfm/server.py | 10 +-- sfm/waveform_store.py | 9 +-- tests/device_access_fakes.py | 4 +- tests/test_5a_blastware_walk_histogram.py | 75 +++++++++++++++++++++++ tests/test_blastware_type_letter.py | 41 +++++++++++++ tests/test_event_ingest.py | 25 ++++++++ 10 files changed, 200 insertions(+), 21 deletions(-) create mode 100644 tests/test_blastware_type_letter.py diff --git a/CLAUDE.md b/CLAUDE.md index 335fc6c..1a5c2c5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2307,7 +2307,7 @@ body) because writing a dial string may require DLE escaping for embedded contro - **Database** — SQLite store for events + monitor log entries; dedup by key; queryable - **Histograms** — decode histogram-mode A5 data (noise floor tracking) -- **Blastware-compatible file output** — `write_blastware_file()` and `write_mlg()` implemented. `blastware_filename()` generates correct Blastware filenames (AB0 for direct, AB0W/AB0H for ACH). **Confirmed BYTE-PERFECT against BW reference (v0.14.3, 2026-05-05):** when fed the BW 5-1-26 3-sec capture's A5 frames, the SFM-built file matches BW's saved `M529LKIQ.G10` byte-for-byte (8708 bytes, 0 differences). Live SFM downloads of event 0 (3-sec) and event 1 (3-sec continuation) both open cleanly in Blastware with full Event Reports, frequency analysis, and waveform plots. Body assembly is just contiguous concatenation of frame contributions in stream order (probe → meta@0x1002 → meta@0x1004 → samples → TERM); no stripping, no overlay, no special handling. Histogram+Continuous mode deferred (5A stream for those events embeds histogram interval records that may need different handling — untested under v0.14.x). Extension mapping: extensions encode timestamp (AB0T for ACH, AB0 for direct), NOT recording mode. Filename format: `<4-char-base36-stem>` +- **Blastware-compatible file output** — `write_blastware_file()` and `write_mlg()` implemented. `blastware_filename()` generates correct Blastware filenames (AB0 for direct, AB0W/AB0H for ACH). **SFM's own MiniMate downloads carry the W/H letter (2026-10-30):** `with_type_letter()` reads it from the file's STRT[18] (#41) on all three naming paths (device-access download, `WaveformStore.save`, the legacy `/device/event/{i}/blastware_file`); Blastware's direct downloads leave it off. **Confirmed BYTE-PERFECT against BW reference (v0.14.3, 2026-05-05):** when fed the BW 5-1-26 3-sec capture's A5 frames, the SFM-built file matches BW's saved `M529LKIQ.G10` byte-for-byte (8708 bytes, 0 differences). Live SFM downloads of event 0 (3-sec) and event 1 (3-sec continuation) both open cleanly in Blastware with full Event Reports, frequency analysis, and waveform plots. Body assembly is just contiguous concatenation of frame contributions in stream order (probe → meta@0x1002 → meta@0x1004 → samples → TERM); no stripping, no overlay, no special handling. Histogram+Continuous mode deferred (5A stream for those events embeds histogram interval records that may need different handling — untested under v0.14.x). Extension mapping: extensions encode timestamp (AB0T for ACH, AB0 for direct), NOT recording mode. Filename format: `<4-char-base36-stem>` **Serial encoding (CONFIRMED 2026-04-22):** `prefix_letter = chr(ord('B') + floor(serial_numeric / 1000))`, `serial3 = f"{serial_numeric % 1000:03d}"`. Examples: BE6907→H907, BE11529→M529, BE14036→P036, BE17353→S353, BE18003→T003. The prefix letter encodes the production generation (batch of 1000 units). diff --git a/minimateplus/blastware_file.py b/minimateplus/blastware_file.py index 12e269c..9dcbcb4 100644 --- a/minimateplus/blastware_file.py +++ b/minimateplus/blastware_file.py @@ -467,6 +467,9 @@ def blastware_filename(event: Event, serial: str, ach: bool = False) -> str: 0 = always literal digit zero T = 'W' or 'H' — ONLY appended for call-home (ACH) downloads (ach=True). + ⚠ ach=True guesses the letter from the recording mode, which is wrong for + a waveform recorded in Histogram+Continuous; for a file in hand use + `with_type_letter(name, bw_bytes)`, which reads the file's own type byte. Manual / direct downloads produce a 3-char extension (AB0) with no type char. Call-home downloads produce a 4-char extension (AB0W or AB0H). @@ -531,6 +534,32 @@ def blastware_filename(event: Event, serial: str, ach: bool = False) -> str: return prefix + stem + ext +_TYPE_LETTER = {"Waveform": "W", "Histogram": "H"} + + +def with_type_letter(name: str, bw_bytes: bytes) -> str: + """`name` with the W/H type letter, for a Blastware file SFM built itself. + + Blastware's own direct downloads leave the letter off (`K441LTON.900`) and + only its call-in copies carry it (`K441LTON.900H`), which makes events hard + to sort; SFM's files carry it (2026-10-30). The letter is read from the + file's own record-type byte -- STRT[18], as `decode_blastware_bytes` reads it + (#41) -- not from the recording mode, which in Histogram+Continuous records + both kinds. A file whose type does not read keeps the plain name: a name is + never a reason to fail a download. A name already carrying a letter, or + not of the `.0` form, is returned unchanged. + """ + if blastware_filename_time(name) is None or len(name.rsplit(".", 1)[-1]) != 3: + return name + try: + from .event_file_io import decode_blastware_bytes # lazy: event_file_io imports this module + letter = _TYPE_LETTER.get(decode_blastware_bytes(bw_bytes).record_type) + except Exception as exc: # noqa: BLE001 + log.warning("with_type_letter: %s: the record type did not read (%s) -- plain name kept", name, exc) + letter = None + return name + letter if letter else name + + # ── A5 frame classifier ─────────────────────────────────────────────────────────── # ASCII markers that identify a compliance-config / metadata frame. diff --git a/sfm/database.py b/sfm/database.py index 9ac430a..d2ad16c 100644 --- a/sfm/database.py +++ b/sfm/database.py @@ -813,20 +813,25 @@ class SeismoDb: A Blastware name encodes the serial and the event's second (`blastware_filename_time`), so the same name is the same event -- the - rule `_restamp_by_file` uses. A direct download is `.0` and - Blastware's call-in copy of the same event `.0W` / `H`; all - three forms match. Any other name ("imported.bw") matches nothing. + rule `_restamp_by_file` uses. Blastware's direct download is + `.0`, its call-in copy and SFM's own files `.0W` / `H`. + A name without the letter matches all three forms; one with it matches + itself and the letterless form -- not the other letter, since in + Histogram+Continuous a waveform can trigger in the second a histogram + starts. Any other name ("imported.bw") matches nothing. """ if blastware_filename_time(filename) is None: return None - base = filename.upper() - if len(base.rsplit(".", 1)[-1]) == 4: - base = base[:-1] + name = filename.upper() + if len(name.rsplit(".", 1)[-1]) == 4: + forms = (name[:-1], name) + else: + forms = (name, name + "W", name + "H") with self._connect() as conn: row = conn.execute( - "SELECT * FROM events WHERE serial = ? AND UPPER(blastware_filename) IN (?, ?, ?) " - "ORDER BY rowid LIMIT 1", - (serial, base, base + "W", base + "H"), + f"SELECT * FROM events WHERE serial = ? AND UPPER(blastware_filename) IN " + f"({', '.join('?' * len(forms))}) ORDER BY rowid LIMIT 1", + (serial, *forms), ).fetchone() return dict(row) if row else None diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 38563a8..32f77b8 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -8,7 +8,7 @@ import struct from typing import Any, Callable, Optional from minimateplus import MiniMateClient -from minimateplus.blastware_file import blastware_file_bytes, blastware_filename +from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter from minimateplus.event_file_io import _GEO_INT16_FS from minimateplus.framing import build_bw_write_frame from minimateplus.protocol import SUB_START_MONITORING, SUB_STOP_MONITORING @@ -408,6 +408,7 @@ class Series3Adapter: raise MalformedReply( f"event {key.hex()}: its Blastware file could not be assembled ({exc}); not saved" ) from exc + filename = with_type_letter(filename, bw_bytes) # ...900 -> ...900H, from the file's own bytes return DownloadedEvent( event_id=make_event_id(serial, key, found), serial=serial, series=3, filename=filename, verified=verified, event=ev, a5_frames=ev._a5_frames, diff --git a/sfm/server.py b/sfm/server.py index 58b06e8..e277948 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -71,7 +71,7 @@ from minimateplus import MiniMateClient from minimateplus.protocol import ProtocolError from minimateplus.models import CallHomeConfig, ComplianceConfig, DeviceInfo, Event, PeakValues, ProjectInfo, Timestamp from minimateplus.transport import TcpTransport, DEFAULT_TCP_PORT -from minimateplus.blastware_file import write_blastware_file, blastware_filename +from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter from minimateplus.client import _decode_a5_metadata_into, _decode_a5_waveform, _decode_event_count from minimateplus.framing import build_bw_write_frame, SESSION_RESET, POLL_PROBE, POLL_DATA from minimateplus.protocol import SUB_STOP_MONITORING @@ -1025,8 +1025,10 @@ def device_event_blastware_file( # Determine serial number from device info serial = getattr(info, "serial", None) or "UNKNOWN" - # Build filename using the same algorithm Blastware uses - filename = blastware_filename(ev, serial) + # Build filename using the same algorithm Blastware uses, plus the W/H type + # letter its direct downloads leave off (read from the file's own bytes). + bw_bytes = blastware_file_bytes(ev, a5_frames) + filename = with_type_letter(blastware_filename(ev, serial), bw_bytes) # Write to OS temp dir (cross-platform: /tmp on Linux/macOS, # %TEMP% on Windows) so FastAPI can stream it back via FileResponse. @@ -1040,7 +1042,7 @@ def device_event_blastware_file( out_path.unlink() except FileNotFoundError: pass - write_blastware_file(ev, a5_frames, out_path) + out_path.write_bytes(bw_bytes) log.info( "blastware_file: wrote %s (%d A5 frames, serial=%s)", out_path, len(a5_frames), serial, diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index 6408b1e..69314dd 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -38,7 +38,7 @@ from pathlib import Path from typing import Optional, Union from minimateplus import event_file_io -from minimateplus.blastware_file import blastware_filename, write_blastware_file +from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter from minimateplus.framing import S3Frame from minimateplus.models import Event from sfm import event_hdf5 @@ -75,7 +75,7 @@ class WaveformStore: """ Persistent store for Blastware-format waveform files + their A5 source frames. - Thread safety: write_blastware_file is single-shot; concurrent saves of the + Thread safety: the event file is written single-shot; concurrent saves of the *same* filename would race, but the filename encodes second-resolution timestamps + serial, so collisions across threads/processes are vanishingly unlikely in practice. @@ -184,7 +184,8 @@ class WaveformStore: if not serial: raise ValueError("WaveformStore.save: serial is required") - filename = blastware_filename(ev, serial) + bw_bytes = blastware_file_bytes(ev, a5_frames) + filename = with_type_letter(blastware_filename(ev, serial), bw_bytes) # ...900 -> ...900H bw_path, a5_path = self.paths_for(serial, filename) sidecar_path = self.sidecar_path_for(serial, filename) hdf5_path = self.hdf5_path_for(serial, filename) @@ -195,7 +196,7 @@ class WaveformStore: bw_path.unlink() except FileNotFoundError: pass - write_blastware_file(ev, a5_frames, bw_path) + bw_path.write_bytes(bw_bytes) filesize = bw_path.stat().st_size sha256 = event_file_io.file_sha256(bw_path) diff --git a/tests/device_access_fakes.py b/tests/device_access_fakes.py index 6418e2b..3cf84b4 100644 --- a/tests/device_access_fakes.py +++ b/tests/device_access_fakes.py @@ -181,8 +181,8 @@ class FakeMiniMateClient(_Base): if expected_timestamp is not None and _iso(ev) != expected_timestamp: ev = copy.copy(ev) ev._a5_frames = None - elif ev._a5_frames: - _as_downloaded(ev) + elif ev._a5_frames and isinstance(ev._a5_frames[0], str): + _as_downloaded(ev) # placeholder frames only; a test's real ones are kept self.last_download = ev return ev return None diff --git a/tests/test_5a_blastware_walk_histogram.py b/tests/test_5a_blastware_walk_histogram.py index d9492fd..e7b2e45 100644 --- a/tests/test_5a_blastware_walk_histogram.py +++ b/tests/test_5a_blastware_walk_histogram.py @@ -133,3 +133,78 @@ def test_blastware_file_bytes_is_blastwares_file(key, bw): ev = Event(index=0) ev.timestamp = None assert blastware_file_bytes(ev, frames) == (FIX / "blastware" / bw).read_bytes() + + + +# SFM's own downloads are named with the W/H letter (2026-10-30), on every path +# that builds the file: the device-access download, the store's save, and the +# legacy per-index route. BE9441's walk gives one of each: 0111f210 is the +# histogram K441LTON.900, 011106a0 the waveform K441LTOK.R10. + +import datetime # noqa: E402 + +from device_access_fakes import FakeMiniMateClient, s3_event # noqa: E402 +from minimateplus.models import DeviceInfo # noqa: E402 +from minimateplus.waveform_codec import decode_a5_frames # noqa: E402 + +LIVE = [("0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36), "K441LTON.900H"), + ("011106a0", datetime.datetime(2026, 10, 26, 16, 6, 37), "K441LTOK.R10W")] + + +def _walked_event(key, when): + frames = mp.MiniMateProtocol(ByAddress()).read_bulk_waveform_stream( + bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, + strict=True, max_chunks=128) + ev = s3_event(0, key, when, frames=False) + ev._a5_frames = frames + ev.raw_samples = decode_a5_frames(frames) # as the real client's download decodes them + return ev + + +@pytest.mark.parametrize("key,when,name", LIVE) +def test_a_live_download_is_named_with_its_type_letter(key, when, name): + from sfm.device_access.models import UnitAddress + from sfm.device_access.s3 import Series3Adapter + # Range unread (no settings): the check then does not compare peaks, which + # these events have no Blastware report for -- only the name is under test. + fake = FakeMiniMateClient(serial="BE9441", events=[_walked_event(key, when)], compliance=None) + dl = Series3Adapter(client_factory=lambda address, **kw: fake).download_event( + UnitAddress(host="10.0.0.5", tcp_port=9034, port=None, baud=None), "BE9441", + bytes.fromhex(key), None) + assert dl.filename == name + + +@pytest.mark.parametrize("key,when,name", LIVE) +def test_the_store_names_a_saved_download_with_its_type_letter(key, when, name, tmp_path): + from sfm.waveform_store import WaveformStore + ev = _walked_event(key, when) + rec = WaveformStore(tmp_path).save(ev, serial="BE9441", a5_frames=ev._a5_frames) + assert rec["filename"] == name + assert (tmp_path / "BE9441" / name).read_bytes() == (FIX / "blastware" / name[:-1]).read_bytes() + + +@pytest.mark.parametrize("key,when,name", LIVE) +def test_the_legacy_file_route_names_its_file_with_the_type_letter(key, when, name, tmp_path, monkeypatch): + import sfm.server as srv + from sfm.database import SeismoDb + from sfm.waveform_store import WaveformStore + ev = _walked_event(key, when) + + class Unit: + def __enter__(self): + return self + + def __exit__(self, *a): + return False + + def connect(self): + return DeviceInfo(serial="BE9441", firmware_minor=17) + + def get_events(self, **kw): + return [ev] + monkeypatch.setattr(srv, "_build_client", lambda *a, **kw: Unit()) + monkeypatch.setattr(srv, "_get_store", lambda: WaveformStore(tmp_path / "w")) + monkeypatch.setattr(srv, "_get_db", lambda: SeismoDb(tmp_path / "s.db")) + resp = srv.device_event_blastware_file(index=0, port=None, baud=38400, host="10.0.0.5", + tcp_port=9034, force=False) + assert resp.filename == name diff --git a/tests/test_blastware_type_letter.py b/tests/test_blastware_type_letter.py new file mode 100644 index 0000000..7e09b01 --- /dev/null +++ b/tests/test_blastware_type_letter.py @@ -0,0 +1,41 @@ +"""SFM names the Blastware files it builds with the W/H type letter (2026-10-30). + +Blastware's own direct downloads leave the letter off (`K441LTON.900`); only its +call-in copies carry it (`...900H`), which makes events hard to sort. The letter +comes from the file's own record-type byte (STRT[18], #41) -- not the recording +mode, which in Histogram+Continuous records both kinds. +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from minimateplus.blastware_file import blastware_filename_time, with_type_letter # noqa: E402 + +HIST = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram" / "blastware" +WAVE = Path(__file__).parent / "fixtures" / "5-11-26" + + +@pytest.mark.parametrize("path, want", [ + (HIST / "K441LTON.900", "K441LTON.900H"), + (HIST / "K441LTOK.QZ0", "K441LTOK.QZ0H"), + (HIST / "K441LTOK.R10", "K441LTOK.R10W"), # a waveform, 2 s into QZ0 (Histogram+Continuous) + (WAVE / "M529LL1L.V70", "M529LL1L.V70W"), +]) +def test_a_file_is_named_with_the_type_its_bytes_say(path, want): + got = with_type_letter(path.name, path.read_bytes()) + assert got == want + assert blastware_filename_time(got) == blastware_filename_time(path.name) # same second + + +def test_a_file_whose_type_does_not_read_keeps_the_plain_name(): + assert with_type_letter("K441LTON.900", b"not a blastware file") == "K441LTON.900" + + +def test_a_name_that_already_has_its_letter_is_left_alone(): + assert with_type_letter("K441LTON.900H", (HIST / "K441LTON.900").read_bytes()) == "K441LTON.900H" diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 1d4a5d3..271fefc 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -384,3 +384,28 @@ def test_a_live_histogram_is_labelled_a_histogram(sdm): out = persist_download(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), store=store, db=db) assert db.get_event(out.db_event_id)["record_type"] == "Histogram" + + +def _stored_as(store, db, name, fixture="K441LTOK.QZ0"): + ev, rec = store.save_imported_bw((HIST_FIX / fixture).read_bytes(), source_path=Path(name), + serial_hint=None) + db.insert_events([ev], serial="BE9441", waveform_records={ev._waveform_key.hex(): rec}, + device_family="series3") + + +def test_a_lettered_name_does_not_match_the_other_type_in_the_same_second(sdm): + # SFM's own names now carry W/H (2026-10-30). In Histogram+Continuous a + # waveform can trigger in the second a histogram starts; with both letters + # known they are different events. + store, db = sdm + _stored_as(store, db, "K441LTOK.QZ0H") + assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0W") is None + assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0H")["blastware_filename"] == "K441LTOK.QZ0H" + assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0") is not None # a letterless name: no opinion + + +def test_a_letterless_stored_name_still_matches_a_lettered_download(sdm): + # Rows stored before 2026-10-30, and Blastware's own direct downloads, have no letter. + store, db = sdm + _stored_as(store, db, "K441LTOK.QZ0") + assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0H")["blastware_filename"] == "K441LTOK.QZ0" -- 2.54.1 From 0a87d85202452d408c987e63aa77fab39edad6e8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sat, 31 Oct 2026 00:17:57 -0400 Subject: [PATCH 148/223] fix(sfm): a MiniMate download's peaks come from its file when the unit confirms Normal range Since the decode checker's histogram-PVS fix (625bc39, merged 6945009) the file reads a histogram's vector sum as the unit stored it: K441LTON.900 stores 0.200 / 0.385 / 0.255 and a vector sum of 0.3852, as Blastware's report (was 0.503). The 0C summary, read at fixed offsets, can shift (BE9441 read 0 and -0.0, bench #4) -- and a shifted value can look plausible and pass the impossible-value guard. So the row now takes the file's channel peaks and vector sum. Only when the unit's settings confirm Normal range: the file reader computes every peak as if the range were Normal (_GEO_SENSITIVE_FS_INS is defined but unused), so a Sensitive unit's file peaks are 8x off (the checker's 33 waveforms). For Sensitive, or a range not read (a monitoring unit's 1A has no settings), the unit's own peaks stand, as before. The mic is always the unit's: the file still reads it as 0. The 0C peaks remain the download check. Store consequence: new live downloads only; no backfill, no migration. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 3 +- .../2026-10-20-sfm-series4-parity-design.md | 10 +++-- sfm/event_ingest.py | 38 +++++++++++++------ tests/test_event_ingest.py | 38 +++++++++++++++++-- 4 files changed, 68 insertions(+), 21 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1a5c2c5..42695d5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -223,7 +223,8 @@ Read this first when picking the project back up. **Batch 1 fixed (2026-10-29):** #1 (`b320a53`, settings read after unescaping: mode −7, rate −6, interval −4, record time +6), #9 (`ce441a0`, one reconnect for the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw` with - the unit's peaks/mic/vector sum overlaid and its range passed). #2 came with the + the unit's mic overlaid, its peaks/vector sum too unless Normal range is confirmed + -- since 2026-10-31, after the checker's histogram-PVS fix -- and its range passed). #2 came with the `dev` merge. **#15 retracted** -- `sent` NULL is "unknown", by design. Final review fixes: `dbd8a91` (wake before the reconnect's identity read), `3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 34506f2..5f2a769 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -685,10 +685,12 @@ a short plan; #14 waits for the line-hold decision above. 7. `/db/events` 500 "database is locked" on the first page load against a new DB. 8. ✅ **Fixed `9492e49`**, plus `3a1d34a` ("already stored" also matches the Blastware name: a histogram's row sits a second off its 0C time). The download carries the assembled Blastware file and is - stored through `save_imported_bw` (`source.kind` "sfm-live"); the unit's 0C peaks, - mic and vector sum are overlaid (the file path reads a histogram's vector sum as - 0.503 vs 0.385, the mic as 0, and no sensitive range yet), and its range scales - the samples. The "Waveform" label waits for #41 from the checker branch. + stored through `save_imported_bw` (`source.kind` "sfm-live"), and its range scales + the samples. The unit's 0C mic is overlaid (the file reads it as 0). Its channel + peaks and vector sum were overlaid too until 2026-10-31; since the checker's + histogram-PVS fix (625bc39, merged `6945009`) the file's are taken when the unit + confirms Normal range, and the unit's stand for Sensitive or an unread range (the + file reader assumes Normal: 8x off). The label came with #41 (`a1d2b61`). **S3 downloads are stored from the live waveform decoder** (`store.save`), not the file reader that Series 4 uses (`save_imported_idf`): a histogram gets no samples and is labelled Waveform. Fix: store S3 downloads through the diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index 8480d96..64a2bf9 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -66,15 +66,23 @@ def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload: ) -def _overlay_s3_record(ev: Any, unit_peaks: Any) -> None: - """The unit's own 0C peaks, mic and vector sum over the file's. +def _overlay_s3_record(ev: Any, unit_peaks: Any, geo_range: Any) -> None: + """The unit's own 0C values over the file's, where the file's are not yet right. - Measured 2026-10-29 on BE9441: the file path reads the channel peaks right but - a histogram's vector sum as 0.503 where Blastware and the unit say 0.385 (the - decode checker's open finding), the mic as 0, and it cannot scale a sensitive - range. The unit's values are the accurate ones until the file decoder reads - them. A vector sum below the largest channel peak is impossible -- BE9441's - 0C read -0.0 for some events (bench finding #4) -- so it is not kept. + * Mic: always the unit's -- the file reads it as 0 (its psi conversion is an + open checker finding). + * Channel peaks and vector sum: the file's when the unit's settings confirm + Normal range (`geo_range` 0). The file reads them as the unit stored them + -- K441LTON.900: 0.200 / 0.385 / 0.255 and 0.385, as Blastware's report, + since the decode checker's fix (625bc39, 2026-10-31) -- while the 0C summary + is read at fixed offsets and can shift (BE9441 read 0 and -0.0 for vector + sums, bench #4). But the file reader computes every peak as if the range + were Normal, so a Sensitive unit's come out 8x off (the checker's 33 + waveforms): for Sensitive, or a range not read (a monitoring unit's 1A + carries no settings), the unit's own peaks stand, as before -- a vector + sum below the largest channel peak is impossible and is not kept. + + The 0C peaks remain the download *check* (verify_s3_download) either way. """ from minimateplus.models import PeakValues @@ -83,7 +91,12 @@ def _overlay_s3_record(ev: Any, unit_peaks: Any) -> None: if ev.peak_values is None: ev.peak_values = PeakValues() pv = ev.peak_values - for name in ("tran", "vert", "long", "micl"): + micl = getattr(unit_peaks, "micl", None) + if micl is not None: + pv.micl = micl + if geo_range in (0, "normal"): + return + for name in ("tran", "vert", "long"): value = getattr(unit_peaks, name, None) if value is not None: setattr(pv, name, value) @@ -137,8 +150,9 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo else: # The same path production's watcher uses for Blastware's own files: the # event is decoded from the file (samples, histogram, setup-block sample - # rate and record time), not from the live 5A decode. The unit's own 0C - # peaks, mic and vector sum then go over the file's (_overlay_s3_record). + # rate and record time), not from the live 5A decode. The unit's 0C mic + # goes over the file's, and its peaks too unless Normal range is + # confirmed (_overlay_s3_record). if not dl.bw_bytes: raise IngestError(f"{dl.filename}: the download carried no event file; nothing was stored") geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None @@ -146,7 +160,7 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo serial_hint=dl.serial, source_kind="sfm-live", geo_range=geo_range if geo_range is not None else "normal") if ev is not None and dl.event is not None: - _overlay_s3_record(ev, getattr(dl.event, "peak_values", None)) + _overlay_s3_record(ev, getattr(dl.event, "peak_values", None), geo_range) family = "series3" if ev is None or ev._waveform_key is None: raise IngestError(f"{dl.filename}: stored the file but could not build a database row") diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 271fefc..0d7021b 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -307,14 +307,26 @@ def _with_unit_peaks(dl, *, tran, vert, long, micl, pvs): return dl -def test_a_series3_download_keeps_the_units_peaks_mic_and_vector_sum(sdm): +def _range(geo_range): + cc = FakeMiniMateClient().compliance + cc.geo_range = geo_range + return cc + + +def test_a_series3_download_takes_its_peaks_from_the_file_and_its_mic_from_the_unit(sdm): + # 2026-10-31: the file now reads a histogram's vector sum as the unit stored it + # (0.385 here, as Blastware's report), so the row takes the file's peaks and + # vector sum. The unit's 0C summary is read at fixed offsets and can shift + # (bench #4 read 0 / -0.0); these believable-but-wrong values must not win. + # The mic still comes from the unit: the file reads it as 0. store, db = sdm dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), - tran=0.2, vert=0.385, long=0.255, micl=0.00058, pvs=0.38516) + tran=0.21, vert=0.36, long=0.27, micl=0.00058, pvs=0.40) # clears the old guard + dl.compliance = _range(0) # Normal, confirmed by the unit row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) - assert row["peak_vector_sum"] == pytest.approx(0.38516, abs=1e-5) # Blastware: 0.385; the file path says 0.503 - assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) + assert row["peak_vector_sum"] == pytest.approx(0.3852, abs=1e-4) # Blastware: 0.385 assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.2, 0.385, 0.255), abs=1e-4) + assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) def test_an_impossible_unit_vector_sum_is_not_kept(sdm): @@ -409,3 +421,21 @@ def test_a_letterless_stored_name_still_matches_a_lettered_download(sdm): store, db = sdm _stored_as(store, db, "K441LTOK.QZ0") assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0H")["blastware_filename"] == "K441LTOK.QZ0" + + + +# The file reader computes every peak as if the unit were in Normal range (10 in/s); +# a Sensitive (1.25 in/s) unit's file peaks come out 8x off (the checker's 33 +# waveforms). So the file's peaks are taken only when the unit's settings confirm +# Normal -- the download check's rule; Sensitive or unread keeps the unit's own. + +@pytest.mark.parametrize("compliance", [_range(1), None], ids=["sensitive", "range-unread"]) +def test_without_a_confirmed_normal_range_the_units_peaks_stand(sdm, compliance): + store, db = sdm + dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), + tran=0.025, vert=0.048, long=0.032, micl=0.00058, pvs=0.0481) + dl.compliance = compliance + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.025, 0.048, 0.032), abs=1e-6) + assert row["peak_vector_sum"] == pytest.approx(0.0481, abs=1e-6) + assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) -- 2.54.1 From 4844135f01cdc441bba058fda3c5a60f23acd170 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 1 Nov 2026 16:26:15 -0500 Subject: [PATCH 149/223] fix(decode): a Blastware file's geophone range comes from its setup -- Sensitive events no longer read 8x In the setup's channel blocks, the byte 29 after each geophone label is the range: 0x00 Normal (10 in/s), 0x01 Sensitive (1.25 in/s). It matches Blastware's GeoRange on 70,042 / 70,042 DL2 events, all three channels agreeing on every one (35 Sensitive). SFM's live 1A has the same byte at label+33. SFM assumed Normal, so every Sensitive event's peaks, vector sum and .h5 samples read 8x high. - Event.geo_range (0 / 1, None when not read -- channels disagreeing, an unknown value or a missing block -- with a decode_problems entry). - decode_blastware_bytes scales peaks and the histogram vector sum by it. - event_hdf5.write_event_hdf5: geo_range defaults to None = the event's own, else Normal; an explicit argument still wins. - waveform_store.save_imported_bw and scripts/backfill_sidecars.py stop forcing 'normal', so imports and the backfill store the file's range. The waveform_store line was agreed with the parity session, which owns that file; its own branch keeps a geo_range parameter, defaulting to None at its next dev merge. - The checker's SFM side converts at the event's range and reports GeoRange; tests that pinned the old 8x gap now pin the fix, and the saturation carve-out is still tested against an 8x value. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 23 +- minimateplus/event_file_io.py | 58 +- minimateplus/models.py | 3 + scripts/backfill_sidecars.py | 3 +- sfm/event_hdf5.py | 7 +- sfm/waveform_store.py | 3 +- .../fixtures/geo-range-11-01-26/K557J1KB.RQ0W | Bin 0 -> 4018 bytes .../geo-range-11-01-26/K557J1KB_RQ0W_XML.XML | 3207 +++++++++++++++++ .../fixtures/geo-range-11-01-26/M010HR6K.OA0H | Bin 0 -> 2374 bytes .../geo-range-11-01-26/M010HR6K_OA0H_XML.XML | 167 + tests/test_bw_file_fields.py | 70 + tests/test_check_s3_decode.py | 5 +- tests/test_decode_check.py | 35 +- 13 files changed, 3549 insertions(+), 32 deletions(-) create mode 100755 tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W create mode 100755 tests/fixtures/geo-range-11-01-26/K557J1KB_RQ0W_XML.XML create mode 100755 tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H create mode 100755 tests/fixtures/geo-range-11-01-26/M010HR6K_OA0H_XML.XML diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 871b48e..6133d77 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -18,12 +18,13 @@ from dataclasses import dataclass from typing import Callable, Optional, Sequence from .bw_xml_report import XmlReport -from .event_file_io import _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, decode_blastware_bytes +from .event_file_io import (_GEO_FS_BY_RANGE, _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, + decode_blastware_bytes) from .models import Event from .waveform_codec import mic_count_to_db -# SFM's conversion: it cannot yet read the geophone range from the file, and -# assumes Normal (10 in/s full scale = 32000 counts). +# SFM's conversion at the Normal range (10 in/s full scale = 32000 counts), +# which SFM assumes when it cannot read the event's range from the file. GEO_IPS_PER_COUNT: float = _GEO_NORMAL_FS_INS / _GEO_INT16_FS _CHANNELS = ("Tran", "Vert", "Long", "MicL") @@ -38,6 +39,7 @@ class SfmSide: job_number: Optional[str] # None until the decoder reads it channels: list[str] # channels with decoded data, in Tran/Vert/Long/MicL order counts: dict[str, list[int]] # waveform samples or histogram interval peaks + geo_ips_per_count: float = GEO_IPS_PER_COUNT # at the event's range, as SFM read it def sfm_side(raw: bytes) -> SfmSide: @@ -55,6 +57,7 @@ def sfm_side(raw: bytes) -> SfmSide: # SFM's interval count is its decoded entry count; the reference # carries this field for histograms only. "NumberofIntervals": len(counts["Tran"]) or None, + "GeoRange": _GEO_FS_BY_RANGE.get(ev.geo_range), } if ts is not None: date = f"{ts.year:04d}-{ts.month:02d}-{ts.day:02d}" @@ -78,6 +81,7 @@ def sfm_side(raw: bytes) -> SfmSide: job_number=None, channels=[ch for ch in _CHANNELS if counts[ch]], counts=counts, + geo_ips_per_count=_GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) / _GEO_INT16_FS, ) @@ -184,19 +188,20 @@ def _series_result(field: str, n_bw: int, n_sfm: int, diffs: list[tuple[int, flo ) -def _sample_converters(ref: XmlReport) -> dict[str, Callable[[int], float]]: - convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * GEO_IPS_PER_COUNT) for ch in _GEO} +def _sample_converters(sfm: SfmSide, ref: XmlReport) -> dict[str, Callable[[int], float]]: + k = sfm.geo_ips_per_count + convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * k) for ch in _GEO} mic = _mic_converter(ref) if mic is not None: convert["MicL"] = mic return convert -def _interval_converter(title: str) -> Optional[Callable[[int], float]]: +def _interval_converter(title: str, sfm: SfmSide) -> Optional[Callable[[int], float]]: """SFM keeps each interval's peaks; it drops their frequencies and geo PVS.""" ch, _, rest = title.partition(" ") if rest.startswith("Peak") and ch in _GEO: - return lambda c: c * GEO_IPS_PER_COUNT + return lambda c: c * sfm.geo_ips_per_count if ch == "MicL" and rest == "Peak dB(L)": return mic_count_to_db if ch == "MicL" and rest == "Peak psi(L)": @@ -215,7 +220,7 @@ def series_pairs(sfm: SfmSide, ref: XmlReport, a row whose cell count differs is a disagreement for every channel.""" if field.startswith("samples."): ch = field[len("samples."):] - convert = _sample_converters(ref).get(ch) + convert = _sample_converters(sfm, ref).get(ch) counts = sfm.counts.get(ch, []) if convert is None or not counts: return None @@ -232,7 +237,7 @@ def series_pairs(sfm: SfmSide, ref: XmlReport, if field.startswith("intervals."): title = field[len("intervals."):] columns = ref.interval_columns or [] - convert = _interval_converter(title) + convert = _interval_converter(title, sfm) counts = sfm.counts.get(title.partition(" ")[0], []) if convert is None or not counts or title not in columns: return None diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 61eacbc..7907e29 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -704,9 +704,11 @@ _INT16_FS = 32768.0 # sfm.event_hdf5._GEO_INT16_FS or sidecar peaks disagree with the plotted # waveform by 2.3%. Confirmed 2026-08-25 against the BW ASCII corpus. _GEO_INT16_FS = 32000.0 -# A histogram's geo values are in decoder units of 16 counts = 0.005 in/s at -# the Normal range (the same assumption as the samples above). -_HIST_GEO_UNIT_INS = 16 * _GEO_NORMAL_FS_INS / _GEO_INT16_FS +# Full scale per geo_range: 0 Normal, 1 Sensitive. +_GEO_FS_BY_RANGE = {0: _GEO_NORMAL_FS_INS, 1: _GEO_SENSITIVE_FS_INS} +# A histogram's geo values are decoder units of 16 counts: 0.005 in/s at the +# Normal range, scaled by the range's full scale like the samples above. +_HIST_GEO_COUNTS_PER_UNIT = 16 # Microphone scale factor, psi per MicL count: one count is 0.25 Pa # (waveform_codec.MIC_PA_PER_COUNT, measured against Blastware's psi(L) on @@ -749,17 +751,19 @@ def _decode_samples_4ch_int16_le(stream: bytes) -> dict[str, list[int]]: } -def _peaks_from_samples(samples: dict[str, list[int]]) -> PeakValues: +def _peaks_from_samples(samples: dict[str, list[int]], + geo_fs_ins: float = _GEO_NORMAL_FS_INS) -> PeakValues: """ - Compute approximate peaks from raw int16 samples assuming Normal-range - geophone sensitivity. Used by the BW-importer when the 0C waveform - record (the device's authoritative peaks) is unavailable. + Compute peaks from raw int16 samples at the given geophone full scale + (Normal, 10 in/s, unless the file's range says otherwise). Used by the + BW-importer when the 0C waveform record (the device's authoritative peaks) + is unavailable. """ def _peak_ins(ch: list[int]) -> float: if not ch: return 0.0 m = max(abs(int(v)) for v in ch) - return m / _GEO_INT16_FS * _GEO_NORMAL_FS_INS + return m / _GEO_INT16_FS * geo_fs_ins tran = _peak_ins(samples.get("Tran", [])) vert = _peak_ins(samples.get("Vert", [])) @@ -773,7 +777,7 @@ def _peaks_from_samples(samples: dict[str, list[int]]) -> PeakValues: pvs = 0.0 n = min(len(samples.get("Tran", [])), len(samples.get("Vert", [])), len(samples.get("Long", []))) if n: - scale = _GEO_NORMAL_FS_INS / _GEO_INT16_FS + scale = geo_fs_ins / _GEO_INT16_FS T = samples["Tran"]; V = samples["Vert"]; L = samples["Long"] for i in range(n): t = T[i] * scale @@ -996,6 +1000,32 @@ def _setup_notes(raw: bytes) -> ProjectInfo: operator=operator, sensor_location=location) +# The geophone range sits in the setup's channel blocks, which follow the +# notes: the byte 29 after each geophone label (`00 00 01 Tran ...`). 0x00 is +# Normal, 0x01 Sensitive -- Blastware's GeoRange on 70,042 / 70,042 DL2 events, +# all three channels agreeing on every one (measured 2026-11-01). SFM's live +# 1A read has the same byte at label+33. +_RANGE_AFTER_LABEL = 29 +_CHANNEL_BLOCK_SPAN = 2000 # how far past the setup name the blocks may sit + + +def _setup_geo_range(raw: bytes) -> tuple[Optional[int], Optional[str]]: + """(geo_range, problem): 0 Normal or 1 Sensitive when all three geophone + channels say the same, else None and why.""" + k = _setup_name_at(raw) + if k is None: + return None, "no recording-setup block to read the geophone range from" + found = {} + for label in (b"Tran", b"Vert", b"Long"): + i = raw.find(b"\x00\x00\x01" + label, k, k + _CHANNEL_BLOCK_SPAN) + p = i + 3 + _RANGE_AFTER_LABEL + found[label.decode()] = raw[p] if i >= 0 and p < len(raw) else None + values = set(found.values()) + if len(values) == 1 and values <= {0, 1}: + return values.pop(), None + return None, f"geophone range not read: channel range bytes {found}" + + def read_blastware_file(path: Union[str, Path], *, name: Optional[str] = None) -> Event: """Parse a Blastware event file into an Event: `decode_blastware_bytes` on its bytes, `name` defaulting to the file's own (see there -- never a time source).""" @@ -1156,6 +1186,9 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # every waveform used to read "70 s". A histogram has no record time or # pre-trigger -- Blastware reports neither. ev.sample_rate = _setup_sample_rate(raw) + ev.geo_range, range_problem = _setup_geo_range(raw) + if range_problem: + ev.decode_problems.append(range_problem + "; peaks assume the Normal range") if is_waveform_body: ev.rectime_seconds = _setup_record_time(raw) ev.total_samples = len(samples["Tran"]) or None @@ -1244,14 +1277,17 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # None, and ``apply_report_to_event`` overlays from a paired ASCII # report when one is supplied. has_samples = any(samples.get(ch) for ch in ("Tran", "Vert", "Long", "MicL")) - ev.peak_values = _peaks_from_samples(samples) if has_samples else None + # The geophone full scale is the file's range; Normal when it wasn't read. + geo_fs = _GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) + ev.peak_values = _peaks_from_samples(samples, geo_fs) if has_samples else None if not is_waveform_body and ev.peak_values is not None: # A histogram stores each interval's vector sum (squared); the event's # is the largest. Combining the channel peaks instead read high on 86% # of DL2's histograms -- they can come from different moments. pvs = interval_pvs(body) if pvs: - ev.peak_values.peak_vector_sum = max(pvs) * _HIST_GEO_UNIT_INS + ev.peak_values.peak_vector_sum = ( + max(pvs) * _HIST_GEO_COUNTS_PER_UNIT * geo_fs / _GEO_INT16_FS) ev._a5_frames = None # not recoverable from BW file return ev diff --git a/minimateplus/models.py b/minimateplus/models.py index 2c5aec4..81eb9ea 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -543,6 +543,9 @@ class Event: total_samples: Optional[int] = None # from STRT record: expected total sample-sets pretrig_samples: Optional[int] = None # from STRT record: pre-trigger sample count rectime_seconds: Optional[int] = None # from STRT record: record duration (seconds) + # Geophone range from the recording setup, as ComplianceConfig.geo_range: + # 0 Normal (10 in/s full scale), 1 Sensitive (1.25 in/s). None: not read. + geo_range: Optional[int] = None # Sensor self-check traces keyed by channel label — the short diagnostic # waveforms the unit records when it pulses each sensor before monitoring diff --git a/scripts/backfill_sidecars.py b/scripts/backfill_sidecars.py index 366b854..ed6d9a6 100644 --- a/scripts/backfill_sidecars.py +++ b/scripts/backfill_sidecars.py @@ -428,8 +428,7 @@ def main(argv=None) -> int: try: event_hdf5.write_event_hdf5( hdf5_path, ev, - serial=serial, - geo_range="normal", + serial=serial, # range: the event's own, from its setup source_kind=source_kind, ) hdf5_filename = hdf5_path.name diff --git a/sfm/event_hdf5.py b/sfm/event_hdf5.py index e5f4b8c..bde0e28 100644 --- a/sfm/event_hdf5.py +++ b/sfm/event_hdf5.py @@ -180,7 +180,7 @@ def write_event_hdf5( event: Event, *, serial: str, - geo_range = "normal", + geo_range = None, source_kind: str = "sfm-live", tool_version: Optional[str] = None, captured_at: Optional[datetime.datetime] = None, @@ -190,6 +190,9 @@ def write_event_hdf5( """ Persist a decoded Event as an HDF5 file with samples in physical units. + ``geo_range`` left as None takes the event's own (``event.geo_range``, + which a Blastware file's decode reads from its setup block), else Normal. + ``geo_ips_per_count`` overrides the range-derived MiniMate count scale for sources whose counts differ — Thor IDF imports pass ``micromate.idf_file._GEO_LSB_IPS`` (issue #42). @@ -202,6 +205,8 @@ def write_event_hdf5( pv = event.peak_values pi = event.project_info + if geo_range is None: + geo_range = event.geo_range if getattr(event, "geo_range", None) is not None else "normal" geo_fs = _resolve_geo_full_scale(geo_range) geo_range_str = _normalise_range(geo_range) captured_at = captured_at or datetime.datetime.utcnow() diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index aa053fc..0a43176 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -412,8 +412,7 @@ class WaveformStore: try: event_hdf5.write_event_hdf5( hdf5_path, ev, - serial=serial, - geo_range="normal", # BW file doesn't carry the range; assume Normal + serial=serial, # range: the event's own, read from the file's setup source_kind="bw-import", ) hdf5_filename = hdf5_path.name diff --git a/tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W b/tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W new file mode 100755 index 0000000000000000000000000000000000000000..459781eb5dbbd94d9403872d309c7b672018fa64 GIT binary patch literal 4018 zcma)9YiwM_6+Uyl!5csB%&eVYQL{6)n(uH%PzG>OwZ3MtNmIDx9FkW8`-i-L`8 zCqN}=XrUCUwn#-S6;wiMr9x1JR0*j~j4G9?g2tg~RZ0bMe0M{jgm`!EwG&9NclynB zLjU9k*x=AuVK3D$r&Jvc?AX4;)|gy>kjb_v`BT>R zH6rrJ)@)6z@_F6}srvF{$XL$P<%qK|6e8aesDKjUnUc>j9oERtkx4VI%8F|fGE-)O z5n(7p#sm{27$=fcR~5v{ArDDdC7~)bLNR7#NLWdTb}mB8nPn6i7Gg#cV^s)}w32(q z$bgGXM%Kv=%~wimJ;9kL)0*-k(84gQ$tw|8qgG5yxG-^dD5*u}=c*-9qf*WC zYPDHF8IP=Gfn+P?y7fKX+qZXTGpTI0C7acEiVP*icqy>H<&|1x{={5ms#@`FQ1x9H zjAukj%xEDrRf%&yO$rAI#xjhABBO~}KFztz`xTqb_=eVy?bMo`F?RaZk0z%ljxn7i zJ9qBm^Pe*DdapVX347vApLsm2)FwOo7^PBOOzMuhOtwR2vU-aU!bf-mBT45K6G|$j zgh@%mq8XDyBCv#PcD}4Fir%9^6H2n6-;vU~RW7#3n(DM1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R3uNx-aWc!@#03fgtj1^LvAc_qt*Svv6fV9fzO-$CivCR z;M@|=?Af`YYr(C_;}heD;n1O%4!(5oFvgLI<3}earz;f;$G~XJ`ISP;OQo`ztP5Q1 z7kZvVSGdSk)^3`ki8TuzZKf}=TI|s#wuzdYFO2>GUmpMQpFeu%&3{i#O_fi5@Zo3q zse$u)U4GyToZ)!Yb>6_AI7Kb3cuK(p#1Rd?8Tq;7NWIur*fG$ZaS5uxlZnIQ@Ziwl zL*wH}&(YYAYPD+7`ViSwPH*fCvXnutpwsnk_dkY1k>hH@lRy8~j~*g>a!Kh!Ey9_Z2!9J>c4oFSX)81DoO!5X z9{kO-ExPp!&;a=b9nb(B4|FD^-1_9hb-J~q`~eg!sF%v#cb4>tX0xK-2a53V*S-Eu@}wI z;39cRhiu%i;&I6zz47J`v^a&*adtQZ+!r?3*|W1ZR;o|!du*$2omZ{RjZMfzti>7B z7)N4x+oL}acHqvB-qWHA$x8-6i_=j%JA21-6}#{I`5DAHO-uG)Nmu#Fi>%W08N0-t I{;je90sE+ + +8.0 +Full Waveform +BE9557 +V 10.72-8.17 MiniMate Plus +K557J1KB.RQ0W +09:02:14 +2021-06-28 + +Tran +Vert +Long +MicL + +Manual +1.0 sec. +Fixed +1024 sps +6.7 Volts +February 14, 2020 by Instantel +in/s and dB(L) +Lawton Street Bridge - 50 South Mill St +Lobar Site Development +Terra-Mechanics, Inc. - D. Harrison +Loc #1 - 50 South Mill St. + +1.250 +in/s + + +0.019 +in/s + + +0.055 +in/s + + +0.019 +in/s + + +3.0 +Hz + + +3.0 +Hz + + +2.8 +Hz + + +0.345 +s + + +0.333 +s + + +0.336 +s + + +0.007 +g + + +0.017 +g + + +0.005 +g + + +0.001 +in + + +0.002 +in + + +0.001 +in + + +0.061 +in/s + + +0.333 +s + +Linear Weighting + +88.0 +dB(L) + + +0.296 +s + + +>100 +Hz + +7.9 Hz. +3.4 +Passed +7.4 Hz. +3.7 +Passed +7.7 Hz. +3.8 +Passed +20.1 Hz. +559 mv +Passed + + +2021-06-28 09:02:12 - 2021-06-28 09:02:15 "Event Recorded " + + + + +-0.0010.0000.0020.000 + + +-0.0010.0010.0030.000 + + +-0.0010.0000.0030.000 + + +-0.0020.0010.002-81.94 + + +-0.0020.0010.0020.000 + + +-0.0030.0020.0040.000 + + +-0.0020.0020.0040.000 + + +-0.0020.0020.004-81.94 + + +-0.0030.0020.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0020.0050.0030.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0010.0060.0030.000 + + +-0.0010.0060.0020.000 + + +-0.0010.0030.0020.000 + + +0.0010.0020.0030.000 + + +0.0000.0010.0010.000 + + +0.0010.0000.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0010.0020.000 + + +0.0000.0010.0020.000 + + +0.000-0.0010.0020.000 + + +0.000-0.0010.002-81.94 + + +0.000-0.0010.0020.000 + + +-0.001-0.0020.0010.000 + + +-0.001-0.0010.002-81.94 + + +-0.001-0.0020.002-81.94 + + +-0.002-0.0030.003-81.94 + + +-0.002-0.0040.004-81.94 + + +-0.002-0.0040.0030.000 + + +-0.002-0.0040.0040.000 + + +-0.003-0.0050.0040.000 + + +-0.002-0.0060.004-81.94 + + +-0.004-0.0070.004-81.94 + + +-0.005-0.0080.0040.000 + + +-0.004-0.0090.0040.000 + + +-0.004-0.0090.0040.000 + + +-0.003-0.0110.0040.000 + + +-0.003-0.0100.0050.000 + + +-0.004-0.0100.0040.000 + + +-0.004-0.0110.003-81.94 + + +-0.003-0.0110.003-81.94 + + +-0.004-0.0110.002-81.94 + + +-0.003-0.0110.004-81.94 + + +-0.004-0.0110.0020.000 + + +-0.003-0.0110.0020.000 + + +-0.002-0.0110.002-81.94 + + +-0.002-0.0120.002-81.94 + + +-0.002-0.0120.001-81.94 + + +-0.002-0.0110.001-81.94 + + +-0.001-0.0120.001-81.94 + + +-0.001-0.0120.001-81.94 + + +-0.001-0.0130.000-81.94 + + +0.001-0.0140.000-81.94 + + +0.000-0.0140.001-81.94 + + +0.000-0.013-0.001-81.94 + + +0.001-0.0140.001-81.94 + + +0.000-0.0140.001-81.94 + + +-0.001-0.0140.000-81.94 + + +-0.001-0.013-0.001-81.94 + + +-0.001-0.0130.000-81.94 + + +-0.001-0.0120.000-81.94 + + +-0.001-0.011-0.001-81.94 + + +-0.001-0.0100.001-81.94 + + +-0.002-0.0090.002-81.94 + + +-0.002-0.0090.002-81.94 + + +-0.002-0.0060.0020.000 + + +-0.003-0.0050.0030.000 + + +-0.003-0.0020.004-81.94 + + +-0.004-0.0010.0050.000 + + +-0.0040.0010.0060.000 + + +-0.0040.0040.006-81.94 + + +-0.0040.0060.006-81.94 + + +-0.0050.0070.007-81.94 + + +-0.0040.0110.007-81.94 + + +-0.0060.0120.007-81.94 + + +-0.0060.0150.009-81.94 + + +-0.0060.0160.009-81.94 + + +-0.0060.0180.009-81.94 + + +-0.0070.0200.009-81.94 + + +-0.0070.0210.009-81.94 + + +-0.0070.0220.010-81.94 + + +-0.0070.0240.010-81.94 + + +-0.0090.0240.010-81.94 + + +-0.0070.0250.011-81.94 + + +-0.0090.0260.0110.000 + + +-0.0090.0270.011-81.94 + + +-0.0090.0290.011-81.94 + + +-0.0090.0300.0120.000 + + +-0.0090.0310.012-81.94 + + +-0.0090.0320.012-81.94 + + +-0.0100.0340.012-81.94 + + +-0.0100.0350.013-81.94 + + +-0.0090.0360.013-81.94 + + +-0.0090.0370.014-81.94 + + +-0.0100.0390.014-81.94 + + +-0.0090.0400.014-81.94 + + +-0.0100.0400.0130.000 + + +-0.0110.0430.0130.000 + + +-0.0100.0420.0120.000 + + +-0.0090.0420.013-81.94 + + +-0.0100.0420.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0110.0440.014-81.94 + + +-0.0090.0440.014-81.94 + + +-0.0090.0440.013-81.94 + + +-0.0100.0440.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0110.0440.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0090.0440.012-81.94 + + +-0.0100.0430.012-81.94 + + +-0.0100.0440.0130.000 + + +-0.0110.0420.0140.000 + + +-0.0100.0420.012-81.94 + + +-0.0100.0420.014-81.94 + + +-0.0090.0410.0120.000 + + +-0.0110.0410.0130.000 + + +-0.0110.0400.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0380.011-81.94 + + +-0.0110.0370.009-81.94 + + +-0.0110.0360.010-81.94 + + +-0.0110.0350.010-81.94 + + +-0.0110.0340.010-81.94 + + +-0.0100.0320.009-81.94 + + +-0.0090.0310.009-81.94 + + +-0.0100.0310.009-81.94 + + +-0.0090.0290.007-81.94 + + +-0.0090.0270.0070.000 + + +-0.0090.0260.0070.000 + + +-0.0090.0250.007-81.94 + + +-0.0080.0220.0060.000 + + +-0.0070.0210.007-81.94 + + +-0.0070.0200.0060.000 + + +-0.0070.0180.0050.000 + + +-0.0070.0170.0050.000 + + +-0.0060.0160.0040.000 + + +-0.0060.0160.0040.000 + + +-0.0060.0140.0040.000 + + +-0.0060.0130.0030.000 + + +-0.0060.0130.0030.000 + + +-0.0060.0120.0020.000 + + +-0.0060.0110.0020.000 + + +-0.0050.0110.0020.000 + + +-0.0050.0090.0020.000 + + +-0.0060.0090.0020.000 + + +-0.0060.0080.0020.000 + + +-0.0060.0070.0020.000 + + +-0.0060.0070.0020.000 + + +-0.0060.0060.0010.000 + + +-0.0050.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0020.0060.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0020.000 + + +-0.0030.0060.0020.000 + + +-0.0040.0060.0020.000 + + +-0.0030.0060.0020.000 + + +-0.0040.0070.00181.94 + + +-0.0030.0080.0030.000 + + +-0.0030.0090.0020.000 + + +-0.0040.0090.00281.94 + + +-0.0040.0080.002-81.94 + + +-0.0040.0100.0020.000 + + +-0.0040.0110.0040.000 + + +-0.0040.0110.0030.000 + + +-0.0030.0120.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0040.0120.0050.000 + + +-0.0040.0120.0040.000 + + +-0.0040.0140.0020.000 + + +-0.0040.0140.0040.000 + + +-0.0040.0140.0040.000 + + +-0.0030.0140.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0120.0030.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.0050.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.00481.94 + + +-0.0030.0090.0040.000 + + +-0.0020.0100.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0050.000 + + +-0.0010.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0100.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0020.0110.0030.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0030.000 + + +-0.0010.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0130.0040.000 + + +-0.0020.0140.0030.000 + + +-0.0020.0140.003-81.94 + + +-0.0020.0140.0040.000 + + +-0.0020.0140.0040.000 + + +-0.0020.0140.0040.000 + + +-0.0020.0150.0040.000 + + +-0.0030.0150.0030.000 + + +-0.0020.0160.003-81.94 + + +-0.0020.0150.0030.000 + + +-0.0030.0150.0030.000 + + +-0.0020.0150.0040.000 + + +-0.0030.0140.0030.000 + + +-0.0040.0140.0040.000 + + +-0.0040.0160.0040.000 + + +-0.0040.0160.0040.000 + + +-0.0040.0160.0020.000 + + +-0.0040.0160.0020.000 + + +-0.0040.0160.0030.000 + + +-0.0050.0160.0030.000 + + +-0.0050.0160.0040.000 + + +-0.0040.0150.0020.000 + + +-0.0040.0150.0020.000 + + +-0.0040.0140.001-81.94 + + +-0.0050.0130.0010.000 + + +-0.0040.0110.0020.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0100.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0030.0120.0000.000 + + +-0.0030.0120.0010.000 + + +-0.0030.012-0.0010.000 + + +-0.0030.0110.0010.000 + + +-0.0030.0090.0000.000 + + +-0.0030.008-0.0020.000 + + +-0.0030.007-0.0010.000 + + +-0.0020.007-0.002-81.94 + + +-0.0020.008-0.0020.000 + + +-0.0020.009-0.0010.000 + + +-0.0030.011-0.0010.000 + + +-0.0040.011-0.0010.000 + + +-0.0040.011-0.0010.000 + + +-0.0040.010-0.0010.000 + + +-0.0030.009-0.0020.000 + + +-0.0020.009-0.0020.000 + + +-0.0020.009-0.0030.000 + + +-0.0020.009-0.0030.000 + + +-0.0020.011-0.0040.000 + + +-0.0020.010-0.0030.000 + + +-0.0020.010-0.004-81.94 + + +-0.0010.010-0.004-81.94 + + +-0.0020.009-0.002-81.94 + + +-0.0020.009-0.0040.000 + + +-0.0020.011-0.004-81.94 + + +-0.0010.011-0.0020.000 + + +-0.0010.012-0.0020.000 + + +-0.0020.012-0.0020.000 + + +-0.0020.013-0.0010.000 + + +-0.0010.013-0.0010.000 + + +-0.0010.013-0.0010.000 + + +-0.0010.014-0.0010.000 + + +-0.0020.012-0.0010.000 + + +-0.0020.010-0.0020.000 + + +-0.0010.009-0.0010.000 + + +-0.0010.009-0.0010.000 + + +-0.0020.009-0.0020.000 + + +-0.0020.008-0.0020.000 + + +-0.0020.007-0.0020.000 + + +-0.0020.005-0.0010.000 + + +-0.0020.002-0.0020.000 + + +-0.0020.000-0.0020.000 + + +-0.001-0.001-0.0020.000 + + +0.000-0.004-0.0040.000 + + +0.001-0.006-0.0050.000 + + +0.002-0.008-0.005-81.94 + + +0.002-0.009-0.005-81.94 + + +0.003-0.011-0.0060.000 + + +0.003-0.014-0.007-81.94 + + +0.005-0.016-0.008-81.94 + + +0.006-0.018-0.0070.000 + + +0.006-0.018-0.0090.000 + + +0.007-0.018-0.009-81.94 + + +0.009-0.017-0.009-81.94 + + +0.011-0.017-0.011-81.94 + + +0.011-0.018-0.012-87.96 + + +0.011-0.021-0.014-87.96 + + +0.010-0.027-0.014-81.94 + + +0.012-0.032-0.014-81.94 + + +0.012-0.037-0.013-87.96 + + +0.013-0.040-0.014-81.94 + + +0.014-0.039-0.014-81.94 + + +0.013-0.037-0.015-81.94 + + +0.012-0.034-0.016-81.94 + + +0.012-0.034-0.014-81.94 + + +0.011-0.034-0.014-81.94 + + +0.011-0.037-0.014-81.94 + + +0.012-0.040-0.014-81.94 + + +0.013-0.041-0.015-81.94 + + +0.013-0.039-0.014-81.94 + + +0.013-0.039-0.016-81.94 + + +0.012-0.039-0.016-81.94 + + +0.012-0.039-0.014-81.94 + + +0.013-0.040-0.015-81.94 + + +0.013-0.042-0.014-81.94 + + +0.014-0.043-0.015-81.94 + + +0.015-0.046-0.016-81.94 + + +0.016-0.047-0.016-81.94 + + +0.016-0.047-0.016-81.94 + + +0.015-0.048-0.016-81.94 + + +0.016-0.048-0.017-81.94 + + +0.016-0.047-0.016-81.94 + + +0.016-0.047-0.017-81.94 + + +0.016-0.046-0.016-81.94 + + +0.017-0.046-0.016-81.94 + + +0.017-0.047-0.016-81.94 + + +0.017-0.047-0.017-81.94 + + +0.017-0.047-0.017-81.94 + + +0.016-0.048-0.017-81.94 + + +0.016-0.049-0.017-81.94 + + +0.017-0.050-0.017-81.94 + + +0.017-0.051-0.017-81.94 + + +0.018-0.053-0.018-81.94 + + +0.018-0.055-0.019-81.94 + + +0.017-0.053-0.017-81.94 + + +0.017-0.053-0.019-81.94 + + +0.017-0.051-0.019-81.94 + + +0.018-0.052-0.018-81.94 + + +0.017-0.052-0.018-81.94 + + +0.017-0.051-0.017-81.94 + + +0.018-0.051-0.017-81.94 + + +0.018-0.051-0.018-87.96 + + +0.018-0.051-0.018-81.94 + + +0.018-0.049-0.017-81.94 + + +0.018-0.049-0.016-81.94 + + +0.019-0.047-0.017-81.94 + + +0.018-0.046-0.017-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.043-0.016-81.94 + + +0.018-0.042-0.014-81.94 + + +0.019-0.041-0.015-81.94 + + +0.018-0.041-0.0140.000 + + +0.018-0.040-0.014-81.94 + + +0.018-0.038-0.014-81.94 + + +0.019-0.038-0.014-81.94 + + +0.018-0.036-0.014-81.94 + + +0.018-0.035-0.014-81.94 + + +0.017-0.034-0.014-81.94 + + +0.016-0.033-0.014-81.94 + + +0.016-0.032-0.014-81.94 + + +0.016-0.031-0.0130.000 + + +0.014-0.029-0.013-81.94 + + +0.015-0.028-0.012-81.94 + + +0.015-0.027-0.012-81.94 + + +0.014-0.026-0.012-81.94 + + +0.015-0.026-0.012-81.94 + + +0.014-0.024-0.011-81.94 + + +0.014-0.023-0.012-81.94 + + +0.013-0.022-0.0120.000 + + +0.012-0.022-0.0110.000 + + +0.013-0.019-0.0110.000 + + +0.012-0.021-0.0110.000 + + +0.013-0.020-0.012-81.94 + + +0.012-0.020-0.011-81.94 + + +0.012-0.019-0.011-81.94 + + +0.012-0.019-0.011-81.94 + + +0.011-0.019-0.011-81.94 + + +0.011-0.019-0.0110.000 + + +0.011-0.019-0.0110.000 + + +0.011-0.020-0.0110.000 + + +0.010-0.020-0.0110.000 + + +0.010-0.019-0.0110.000 + + +0.011-0.021-0.0110.000 + + +0.010-0.021-0.0110.000 + + +0.010-0.021-0.010-81.94 + + +0.010-0.021-0.0110.000 + + +0.009-0.022-0.011-81.94 + + +0.010-0.022-0.0100.000 + + +0.010-0.023-0.011-81.94 + + +0.010-0.023-0.011-81.94 + + +0.009-0.022-0.011-81.94 + + +0.009-0.022-0.0110.000 + + +0.009-0.022-0.0110.000 + + +0.009-0.022-0.011-81.94 + + +0.009-0.021-0.0110.000 + + +0.009-0.021-0.0110.000 + + +0.009-0.019-0.011-81.94 + + +0.009-0.020-0.011-81.94 + + +0.007-0.019-0.0110.000 + + +0.007-0.020-0.0090.000 + + +0.008-0.020-0.010-81.94 + + +0.007-0.019-0.010-81.94 + + +0.006-0.019-0.010-81.94 + + +0.006-0.019-0.010-81.94 + + +0.006-0.018-0.0090.000 + + +0.006-0.019-0.0090.000 + + +0.005-0.018-0.0090.000 + + +0.006-0.017-0.009-81.94 + + +0.004-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.004-0.017-0.0080.000 + + +0.006-0.017-0.009-81.94 + + +0.005-0.017-0.0090.000 + + +0.005-0.017-0.0090.000 + + +0.004-0.017-0.009-81.94 + + +0.005-0.017-0.0090.000 + + +0.005-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.004-0.016-0.008-81.94 + + +0.004-0.015-0.0090.000 + + +0.004-0.014-0.0080.000 + + +0.004-0.015-0.0090.000 + + +0.004-0.015-0.0070.000 + + +0.005-0.015-0.0080.000 + + +0.004-0.014-0.0080.000 + + +0.004-0.015-0.0070.000 + + +0.004-0.014-0.0080.000 + + +0.005-0.014-0.008-81.94 + + +0.006-0.012-0.007-81.94 + + +0.005-0.013-0.0070.000 + + +0.005-0.013-0.0070.000 + + +0.005-0.012-0.008-81.94 + + +0.004-0.011-0.009-81.94 + + +0.004-0.011-0.007-81.94 + + +0.004-0.010-0.008-81.94 + + +0.004-0.011-0.0060.000 + + +0.004-0.009-0.0070.000 + + +0.004-0.009-0.0060.000 + + +0.004-0.009-0.0070.000 + + +0.003-0.009-0.0060.000 + + +0.004-0.007-0.0050.000 + + +0.004-0.007-0.0060.000 + + +0.004-0.007-0.0060.000 + + +0.003-0.006-0.0060.000 + + +0.004-0.005-0.0040.000 + + +0.002-0.004-0.004-81.94 + + +0.002-0.003-0.0040.000 + + +0.002-0.001-0.0030.000 + + +0.002-0.001-0.0030.000 + + +0.0010.000-0.0030.000 + + +0.0010.002-0.0010.000 + + +0.0010.002-0.0020.000 + + +0.0000.004-0.0020.000 + + +-0.0010.003-0.001-81.94 + + +0.0010.004-0.001-81.94 + + +0.0010.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +0.0000.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +0.0000.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +-0.0010.007-0.0010.000 + + +-0.0010.0080.0000.000 + + +-0.0010.0080.0000.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.001-81.94 + + +-0.0020.008-0.0010.000 + + +-0.0010.007-0.0010.000 + + +-0.0020.007-0.0020.000 + + +-0.0010.007-0.0010.000 + + +-0.0010.007-0.0020.000 + + +-0.0010.006-0.0020.000 + + +-0.0010.006-0.0020.000 + + +-0.0020.006-0.0020.000 + + +-0.0020.006-0.0020.000 + + +-0.0010.006-0.002-81.94 + + +-0.0010.005-0.0010.000 + + +-0.0010.006-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.002-81.94 + + +0.0000.004-0.0020.000 + + +0.0000.004-0.002-81.94 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.005-0.0010.000 + + +0.0000.004-0.0010.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0010.005-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.0040.0000.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.0040.0000.000 + + +-0.0010.0040.0000.000 + + +-0.0010.0040.0000.000 + + +-0.0020.0040.000-81.94 + + +-0.0020.0040.0010.000 + + +-0.0020.0050.0010.000 + + +-0.0010.0040.0010.000 + + +-0.0010.0040.0010.000 + + +-0.0020.0040.0020.000 + + +-0.0020.0050.0010.000 + + +-0.0010.0060.0010.000 + + +-0.0010.0050.001-81.94 + + +-0.0010.0050.0020.000 + + +-0.0020.0060.0010.000 + + +-0.0010.0060.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0070.0010.000 + + +-0.0020.0070.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0010.0070.0020.000 + + +-0.0020.0090.0020.000 + + +-0.0020.0090.0030.000 + + +-0.0020.0100.0030.000 + + +-0.0020.0110.00481.94 + + +-0.0020.0100.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0030.0130.0040.000 + + +-0.0030.0130.00581.94 + + +-0.0040.0140.0060.000 + + +-0.0040.0130.0050.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0150.0060.000 + + +-0.0020.0150.0060.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0080.000 + + +-0.0040.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.007-81.94 + + +-0.0020.0140.0070.000 + + +-0.0020.0130.007-81.94 + + +-0.0020.0140.007-81.94 + + +-0.0020.0120.007-81.94 + + +-0.0020.0120.0060.000 + + +-0.0020.0120.0060.000 + + +-0.0010.0120.0070.000 + + +-0.0010.0120.00681.94 + + +-0.0010.0110.0060.000 + + +-0.0010.0110.0070.000 + + +-0.0020.0110.0070.000 + + +-0.0020.0110.0060.000 + + +-0.0020.0090.007-81.94 + + +-0.0010.0080.0060.000 + + +-0.0020.0080.00681.94 + + +-0.0020.0080.00681.94 + + +-0.0020.0070.0060.000 + + +-0.0010.0070.00681.94 + + +-0.0020.0060.0050.000 + + +-0.0020.0070.00681.94 + + +-0.0020.0060.0050.000 + + +-0.0020.0060.0050.000 + + +-0.0020.0070.0060.000 + + +-0.0020.0060.0050.000 + + +-0.0020.0060.0040.000 + + +-0.0030.0060.0060.000 + + +-0.0020.0060.0060.000 + + +-0.0010.0050.0060.000 + + +-0.0020.0050.0050.000 + + +-0.0020.0060.0050.000 + + +-0.0030.0050.006-81.94 + + +-0.0030.0050.0060.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0030.0060.004-81.94 + + +-0.0040.0060.004-81.94 + + +-0.0040.0060.004-81.94 + + +-0.0030.0060.004-81.94 + + +-0.0020.0060.0030.000 + + +-0.0040.0060.0040.000 + + +-0.0030.0070.0040.000 + + +-0.0040.0060.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0050.0070.0040.000 + + +-0.0060.0080.0030.000 + + +-0.0060.0080.0030.000 + + +-0.0060.0090.0040.000 + + +-0.0060.0090.0040.000 + + +-0.0060.0090.0040.000 + + +-0.0070.0100.0040.000 + + +-0.0070.0110.0040.000 + + +-0.0070.0110.0040.000 + + +-0.0060.0120.0060.000 + + +-0.0070.0120.0040.000 + + +-0.0070.0130.0050.000 + + +-0.0070.0140.0060.000 + + +-0.0070.0130.0060.000 + + +-0.0070.0140.0050.000 + + +-0.0080.0140.0040.000 + + +-0.0080.0150.0050.000 + + +-0.0080.0160.0050.000 + + +-0.0070.0160.0050.000 + + +-0.0070.0170.0050.000 + + +-0.0080.0170.0060.000 + + +-0.0090.0170.0060.000 + + +-0.0080.0170.0060.000 + + +-0.0090.0190.0050.000 + + +-0.0090.0180.0060.000 + + +-0.0090.0180.006-81.94 + + +-0.0090.0180.0050.000 + + +-0.0080.0190.0060.000 + + +-0.0090.0210.0060.000 + + +-0.0090.0200.0060.000 + + +-0.0100.0200.0040.000 + + +-0.0090.0190.0040.000 + + +-0.0090.0210.0050.000 + + +-0.0090.0210.0050.000 + + +-0.0080.0200.0050.000 + + +-0.0090.0190.0060.000 + + +-0.0080.0200.0060.000 + + +-0.0090.0210.0060.000 + + +-0.0090.0200.006-81.94 + + +-0.0080.0200.0060.000 + + +-0.0090.0190.006-81.94 + + +-0.0100.0190.006-81.94 + + +-0.0080.0190.0040.000 + + +-0.0090.0190.005-81.94 + + +-0.0080.0180.006-81.94 + + +-0.0080.0180.006-81.94 + + +-0.0090.0170.006-81.94 + + +-0.0080.0170.005-81.94 + + +-0.0080.0160.0050.000 + + +-0.0080.0160.004-81.94 + + +-0.0070.0160.0040.000 + + +-0.0070.0150.004-81.94 + + +-0.0070.0140.004-81.94 + + +-0.0070.0140.0040.000 + + +-0.0070.0130.004-81.94 + + +-0.0060.0130.004-81.94 + + +-0.0060.0110.0040.000 + + +-0.0060.0120.0040.000 + + +-0.0050.0110.0040.000 + + +-0.0050.0100.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0080.003-81.94 + + +-0.0040.0070.003-81.94 + + +-0.0030.0070.003-81.94 + + +-0.0030.0060.002-81.94 + + +-0.0030.0060.002-81.94 + + +-0.0030.0060.003-81.94 + + +-0.0030.0040.0030.000 + + +-0.0030.0040.004-81.94 + + +-0.0030.0030.0030.000 + + +-0.0020.0020.003-81.94 + + +-0.0020.0020.003-81.94 + + +-0.0010.0020.004-81.94 + + +-0.0010.0010.004-81.94 + + +-0.0010.0010.004-81.94 + + +0.0000.0010.003-81.94 + + +0.0000.0010.003-81.94 + + +0.0000.0000.003-81.94 + + +0.000-0.0010.003-81.94 + + +0.000-0.0010.0020.000 + + +0.000-0.0010.0030.000 + + +0.001-0.0010.0020.000 + + +0.001-0.0020.003-81.94 + + +0.001-0.0020.0020.000 + + +0.001-0.0020.0020.000 + + +0.001-0.0030.0020.000 + + +0.002-0.0020.0020.000 + + +0.001-0.0010.0020.000 + + +0.002-0.0020.0020.000 + + +0.002-0.0020.002-81.94 + + +0.002-0.0020.003-81.94 + + +0.002-0.0020.002-81.94 + + +0.002-0.0020.003-81.94 + + +0.002-0.0010.0020.000 + + +0.002-0.0020.004-81.94 + + +0.002-0.0020.0020.000 + + +0.001-0.0020.0040.000 + + +0.001-0.0020.0030.000 + + +0.001-0.0010.004-81.94 + + +0.002-0.0010.0030.000 + + +0.0010.0020.004-81.94 + + +0.0010.0040.0050.000 + + +0.0010.0070.0050.000 + + +0.0010.0090.007-81.94 + + +0.0010.0120.007-81.94 + + +0.0010.0160.007-81.94 + + +-0.0010.0190.008-81.94 + + +-0.0010.0220.008-81.94 + + +-0.0010.0230.008-81.94 + + +-0.0010.0250.008-81.94 + + +-0.0020.0240.009-81.94 + + +-0.0010.0220.008-81.94 + + +-0.0020.0180.007-81.94 + + +-0.0020.0140.0060.000 + + +-0.0010.0100.0050.000 + + +-0.0020.0060.004-81.94 + + +-0.0010.0020.003-81.94 + + +-0.001-0.0010.0020.000 + + +0.000-0.0050.0020.000 + + +0.000-0.0080.0020.000 + + +0.001-0.0100.001-81.94 + + +0.000-0.0110.0010.000 + + +0.001-0.0110.0010.000 + + +0.001-0.0120.001-81.94 + + +0.002-0.0120.0010.000 + + +0.002-0.011-0.001-81.94 + + +0.002-0.011-0.001-81.94 + + +0.002-0.012-0.002-81.94 + + +0.002-0.012-0.0030.000 + + +0.003-0.012-0.002-81.94 + + +0.004-0.013-0.003-81.94 + + +0.004-0.014-0.003-81.94 + + +0.004-0.015-0.004-81.94 + + +0.004-0.016-0.004-81.94 + + +0.002-0.017-0.004-81.94 + + +0.002-0.018-0.004-81.94 + + +0.003-0.018-0.0040.000 + + +0.003-0.020-0.0040.000 + + +0.003-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.0040.000 + + +0.002-0.021-0.004-81.94 + + +0.001-0.019-0.004-81.94 + + +0.002-0.019-0.004-81.94 + + +0.001-0.019-0.004-81.94 + + +0.002-0.019-0.003-87.96 + + +0.002-0.018-0.002-81.94 + + +0.001-0.017-0.002-81.94 + + +0.001-0.016-0.002-81.94 + + +0.001-0.016-0.001-81.94 + + +0.001-0.015-0.001-81.94 + + +-0.001-0.013-0.0010.000 + + +-0.002-0.0120.001-81.94 + + +-0.002-0.0110.0010.000 + + +-0.002-0.0090.0010.000 + + +-0.002-0.0070.0010.000 + + +-0.002-0.0070.0010.000 + + +-0.002-0.0060.001-81.94 + + +-0.003-0.0040.0010.000 + + +-0.004-0.0040.001-81.94 + + +-0.004-0.0040.001-81.94 + + +-0.004-0.0040.001-81.94 + + +-0.003-0.0030.002-81.94 + + +-0.004-0.0030.002-81.94 + + +-0.003-0.0040.003-81.94 + + +-0.003-0.0040.0020.000 + + +-0.003-0.0020.0020.000 + + +-0.003-0.0020.0030.000 + + +-0.002-0.0020.0030.000 + + +-0.0040.0000.004-81.94 + + +-0.0040.0010.004-81.94 + + +-0.0040.0030.004-81.94 + + +-0.0040.0060.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0090.0040.000 + + +-0.0030.0110.0050.000 + + +-0.0040.0110.0050.000 + + +-0.0040.0120.0050.000 + + +-0.0040.0140.006-81.94 + + +-0.0040.0150.0050.000 + + +-0.0040.0170.006-81.94 + + +-0.0030.0170.0060.000 + + +-0.0040.0190.007-81.94 + + +-0.0040.0190.0070.000 + + +-0.0050.0190.0070.000 + + +-0.0050.0200.0070.000 + + +-0.0040.0210.007-81.94 + + +-0.0050.0220.007-81.94 + + +-0.0060.0210.007-81.94 + + +-0.0060.0220.0070.000 + + +-0.0050.0220.007-81.94 + + +-0.0060.0220.0070.000 + + +-0.0060.0220.0070.000 + + +-0.0070.0220.0060.000 + + +-0.0070.0220.007-81.94 + + +-0.0070.0210.007-81.94 + + +-0.0070.0210.007-81.94 + + +-0.0070.0220.006-81.94 + + +-0.0070.0210.0060.000 + + +-0.0070.0200.007-81.94 + + +-0.0080.0180.0060.000 + + +-0.0070.0170.0060.000 + + +-0.0070.0160.0060.000 + + +-0.0070.0150.0060.000 + + +-0.0070.0140.0050.000 + + +-0.0070.0110.004-81.94 + + +-0.0060.0090.004-81.94 + + +-0.0060.0080.0030.000 + + +-0.0060.0060.0030.000 + + +-0.0060.0050.003-81.94 + + +-0.0040.0020.002-81.94 + + +-0.004-0.0010.0020.000 + + +-0.004-0.0030.0010.000 + + +-0.004-0.0070.001-81.94 + + +-0.002-0.0090.001-81.94 + + +-0.002-0.011-0.001-81.94 + + +-0.001-0.014-0.0010.000 + + +0.000-0.014-0.0010.000 + + +0.000-0.016-0.001-81.94 + + +0.000-0.017-0.0020.000 + + +0.000-0.019-0.003-81.94 + + +0.000-0.019-0.0040.000 + + +0.000-0.020-0.003-81.94 + + +0.001-0.021-0.003-81.94 + + +0.002-0.021-0.004-81.94 + + +0.001-0.019-0.003-81.94 + + +0.001-0.020-0.003-81.94 + + +0.002-0.019-0.003-81.94 + + +0.002-0.019-0.004-81.94 + + +0.002-0.019-0.003-81.94 + + +0.001-0.018-0.003-81.94 + + +0.001-0.017-0.001-81.94 + + +0.002-0.016-0.002-81.94 + + +0.002-0.014-0.002-81.94 + + +0.002-0.014-0.002-81.94 + + +0.001-0.012-0.0020.000 + + +0.001-0.011-0.0020.000 + + +0.002-0.011-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.001-0.007-0.0020.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.0060.0000.000 + + +0.001-0.0060.0000.000 + + +0.001-0.005-0.0010.000 + + +0.001-0.0040.0010.000 + + +0.000-0.0020.0010.000 + + +-0.001-0.0020.0010.000 + + +0.001-0.0020.001-81.94 + + +0.000-0.0010.0010.000 + + +0.000-0.0010.0020.000 + + +0.001-0.0010.0010.000 + + +0.0010.0000.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0020.0020.000 + + +0.0000.0020.0020.000 + + +0.0000.0020.0020.000 + + +0.0010.0030.0030.000 + + +0.0010.0040.0030.000 + + +0.0010.0050.0030.000 + + +0.0010.0060.0030.000 + + +0.0020.0060.0030.000 + + +0.0020.0060.0020.000 + + +0.0010.0070.0020.000 + + +0.0010.0070.0040.000 + + +0.0020.0080.0030.000 + + +0.0010.0080.0040.000 + + +0.0010.0080.0030.000 + + +0.0010.0080.0030.000 + + +0.0010.0080.0020.000 + + +0.0010.0090.0020.000 + + +0.0010.0080.0030.000 + + +0.0000.0080.0040.000 + + +0.0000.0080.0040.000 + + +0.0000.0090.00481.94 + + +0.0000.0090.0040.000 + + +0.0010.0100.00481.94 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0020.0110.0030.000 + + +-0.0010.0090.0030.000 + + +-0.0010.0070.0030.000 + + +-0.0010.0070.0020.000 + + +-0.0010.0070.0030.000 + + +-0.0010.0060.0020.000 + + +-0.0010.0040.00381.94 + + +-0.0020.0040.0030.000 + + +-0.0010.0030.0020.000 + + +-0.0020.0020.0030.000 + + +-0.0020.0020.0020.000 + + +-0.0010.0000.0010.000 + + +-0.001-0.0010.0010.000 + + +0.000-0.0020.0010.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.003-0.0010.000 + + +-0.001-0.003-0.0010.000 + + +-0.001-0.004-0.0010.000 + + +-0.001-0.006-0.001-81.94 + + +-0.002-0.006-0.0020.000 + + +-0.001-0.007-0.0020.000 + + +-0.001-0.007-0.0010.000 + + +0.000-0.007-0.0020.000 + + +-0.001-0.008-0.0020.000 + + +-0.001-0.008-0.0030.000 + + +0.001-0.008-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.000-0.009-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.000-0.009-0.0020.000 + + +0.001-0.009-0.002-81.94 + + +0.000-0.009-0.002-81.94 + + +0.001-0.008-0.002-81.94 + + +0.000-0.007-0.0020.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.006-0.0020.000 + + +0.001-0.006-0.0010.000 + + +0.001-0.005-0.0010.000 + + +0.001-0.003-0.0010.000 + + +0.001-0.002-0.0010.000 + + +0.000-0.0020.0000.000 + + +0.000-0.0010.0010.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0020.0020.000 + + +-0.0010.0040.0030.000 + + +-0.0020.0040.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0070.0030.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0080.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0030.0070.00281.94 + + +-0.0030.0060.0030.000 + + +-0.0040.0060.0030.000 + + +-0.0040.0060.0020.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0030.0060.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0040.0040.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0020.0040.0040.000 + + +-0.0020.0040.0030.000 + + +-0.0030.0020.0030.000 + + +-0.0020.0030.0030.000 + + +-0.0010.0020.0020.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0020.0020.000 + + +-0.0020.0000.0010.000 + + +-0.0020.0010.0010.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0000.0010.000 + + +-0.0010.0000.0010.000 + + +0.0000.0010.0010.000 + + +-0.0010.0000.0020.000 + + +-0.001-0.0010.0020.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0020.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0010.000 + + +0.000-0.0010.0020.000 + + +-0.001-0.0010.0010.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.002-0.001-81.94 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +0.000-0.0010.0000.000 + + +0.000-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +0.001-0.002-0.0010.000 + + +0.000-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.0020.0010.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +0.000-0.0020.0000.000 + + +0.001-0.0020.0010.000 + + +0.000-0.0020.0000.000 + + +0.001-0.0020.0010.000 + + +0.000-0.002-0.0010.000 + + +0.000-0.0020.0010.000 + + +0.001-0.0010.0000.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0010.000 + + +0.0020.0000.0010.000 + + + + + + + diff --git a/tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H b/tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H new file mode 100755 index 0000000000000000000000000000000000000000..5bd95ff1e608c251624dbd4e37449035d7d47fe9 GIT binary patch literal 2374 zcma)8TWk|Y6uoOZ@%pj$u4B>=LbNsy5g@@%45Sed9*J721komd)IZm3h!L@=?Nn_) z5EUBC(b7yw< z%sq3@-kEVk;HqeNJ7~{=K16@QcLSwt?C3PSpu9y)ET34D>37&R6sUzkeN(m zTHz)OKA_D%9zHGYf6 z&GZ{^L0_a*kGE;K4G6n9#IyX%n*%y-2cG{n`RohmSK!`dyLDX9;%Dn)3endBpYimD zjyp8G9Pb%s*7Z-jKCa_VjX$qFpB>Au;`_ZiE^6_t_6Ag_6#2C>{we!)T+-ql8g9fG zBTWZBeWpT(3u$Ge-|zGLC@2wUIF9$It@CL8cA^z{VEv1{uBE1?w#vVl$nUFKTuqYQ zJn-LYMc|8!fANUsa3tIuOepf&EuHb_abqPk7t7QHUo!b}MHlXj#J-1lX;0&aOHZx8 z!@kzxUG#GquPdpFD+yW~i*8mzi8|U4?AY4bA+LB(scc-;+#*-MTI2IqR{IyqZ$#tD z)^@oiL94cel?cYJj0HdF2u9>pQS7@|XDAVlMrd7JiOFk%9ZDUwDzR9wvRMhW2P5H7 zTwWas$(3?LmAo<-OSDI~L_2~CwJ70umE05!)e)Nc@(e%5{BORPf&?4iPbiU%%0_uj zG@-oug``ZZ%xtZer!p(%SVr$~E&` z_ttormK?85&1tHjZ6TV&4vvW&&zbL%Wbo#DHz?=^95H!&+(5)VQSWH;q zIOFCSkbr@>Mcg8?%Vk7QkMH<&-yaVzU%b}ee{100gTY6`>5oOwmLH1#fFvFc9PaNQPD2k0lp&5|#HbGV zAdHbRgHWbNBux!x`H5?<7LQ z)sMFQeODIK2uEz51Sx1Lvh~|iYA~^ALKZ!4FyzBo26kjX=(;5_cC72MY%01vG_u^F Yj;f>2tW@gY^>fAZ{9N&{e{k&Lzec? + +8.0 +Full Histogram +BE11010 +V 10.72-8.17 MiniMate Plus +M010HR6K.OA0H +17:02:34 +2019-01-08 +17:20:00 +2019-01-08 + +Tran +Vert +Long +MicL + +18.00 +1 minute +1024 sps +6.8 Volts +December 17, 2018 by Instantel +in/s and dB(L) +Wampum Ave-ECMS 29301-215 Joseph St +Brayman Construction +Terra-Mechanics Inc - D. Bartholomae +Loc, #1 - 215 Joseph Street + +1.250 +in/s + + +0.008 +in/s + + +0.009 +in/s + + +0.005 +in/s + + +11 +Hz + + +73 +Hz + + +16 +Hz + +17:11:34 +2019-01-08 +17:03:34 +2019-01-08 +17:11:34 +2019-01-08 + +0.009 +in/s + +17:11:34 +2019-01-08 +Linear Weighting + +134.1 +dB(L) + +17:03:34 +2019-01-08 + +9.7 +Hz + +7.2 Hz. +4.3 +Passed +7.6 Hz. +3.4 +Passed +7.2 Hz. +3.8 +Passed +20.1 Hz. +583 mv +Passed + + +2019-01-08 17:02:33 - 2019-01-08 17:20:00 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.003470.009730.002>1000.0090.015134.19.7 + + +0.003210.007270.002850.0070.00087.96>100 + + +0.004200.004>1000.002>1000.0050.003119.17.5 + + +0.003340.002>1000.002510.0030.00081.94>100 + + +0.003510.002>1000.002>1000.0030.00091.4839 + + +0.004120.004160.002>1000.0050.00091.4813 + + +0.002510.002640.002>1000.0030.00081.94>100 + + +0.003120.002>1000.002>1000.0040.00081.94>100 + + +0.008110.005130.005160.0090.00091.4819 + + +0.006130.004140.004510.0070.00091.4820 + + +0.003570.002>1000.002>1000.0030.00087.96>100 + + +0.003470.002>1000.002>1000.0030.00091.4813 + + +0.002>1000.002>1000.002>1000.0040.00095.922.5 + + +0.003130.002>1000.002850.0040.00093.989.1 + + +0.003170.002850.002730.0030.00081.94>100 + + +0.002>1000.002>1000.002>1000.0040.00087.96>100 + + +0.003730.002>1000.003200.0040.00091.486.1 + + +0.002370.002>1000.002>1000.0030.00091.4818 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index 4027f7f..fc57beb 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -206,3 +206,73 @@ def test_mic_peak_in_psi(): # Blastware: MicL PSPL 106.0 dB(L) = 20 uPa x 10^(106/20) = 3.990 Pa = 5.787e-4 psi. ev = read_blastware_file(_FIX / "decode-checker-10-29-26/M529L4XQ.R30H") assert ev.peak_values.micl == pytest.approx(5.787e-4, rel=0.01) + + +# ── The geophone range: Normal or Sensitive ───────────────────────────────── +# In the setup's channel blocks, the byte 29 after each geophone label is the +# range: 0x00 Normal (10 in/s full scale), 0x01 Sensitive (1.25 in/s). It +# matches Blastware's GeoRange on 70,042 / 70,042 DL2 events, all three +# channels agreeing on every one (35 Sensitive), measured 2026-11-01. Until +# now SFM assumed Normal, so a Sensitive event read 8x high. + +from minimateplus.event_file_io import _setup_name_at # noqa: E402 + + +@pytest.mark.parametrize("rel,want", [ + ("bw-import-fields-10-29-26/R352HIUI.F40W", 0), + ("geo-range-11-01-26/K557J1KB.RQ0W", 1), # waveform, XML GeoRange 1.250 + ("geo-range-11-01-26/M010HR6K.OA0H", 1), # histogram, XML GeoRange 1.250 +]) +def test_geo_range_comes_from_the_file(rel, want): + assert read_blastware_file(_FIX / rel).geo_range == want + + +# (file, Blastware's Tran / Vert / Long PPV and Peak Vector Sum, from its XML) +@pytest.mark.parametrize("rel,peaks", [ + ("geo-range-11-01-26/K557J1KB.RQ0W", ("0.019", "0.055", "0.019", "0.061")), + ("geo-range-11-01-26/M010HR6K.OA0H", ("0.008", "0.009", "0.005", "0.009")), +]) +def test_sensitive_range_peaks_are_not_8x(rel, peaks): + pv = read_blastware_file(_FIX / rel).peak_values + for got, want in zip((pv.tran, pv.vert, pv.long, pv.peak_vector_sum), peaks): + assert abs(got - float(want)) <= 0.0005 + 1e-9, (got, want) + + +def test_channels_that_disagree_give_no_range_and_a_problem(): + raw = bytearray((_FIX / "geo-range-11-01-26/K557J1KB.RQ0W").read_bytes()) + i = raw.find(b"\x00\x00\x01Vert", _setup_name_at(bytes(raw))) + raw[i + 3 + 29] = 0x00 # Vert Normal, Tran / Long Sensitive + ev = decode_blastware_bytes(bytes(raw), name=None) + assert ev.geo_range is None + assert any("range" in p for p in ev.decode_problems) + + +def test_the_h5_takes_the_events_range(tmp_path): + import h5py + from sfm import event_hdf5 + ev = read_blastware_file(_FIX / "geo-range-11-01-26/K557J1KB.RQ0W") + event_hdf5.write_event_hdf5(tmp_path / "e.h5", ev, serial="BE9557") + with h5py.File(tmp_path / "e.h5", "r") as f: + assert f.attrs["geo_range"] == "sensitive" + assert abs(float(abs(f["samples/Vert"][:]).max()) - 0.055) <= 0.0005 + 1e-9 + + +def test_an_imported_file_and_the_backfill_store_its_range(tmp_path): + import h5py + import scripts.backfill_sidecars as backfill + from sfm import event_hdf5 + from sfm.waveform_store import WaveformStore + + src = _FIX / "geo-range-11-01-26/K557J1KB.RQ0W" + store = WaveformStore(tmp_path / "waveforms") + ev, _ = store.save_imported_bw(src.read_bytes(), source_path=src) + h5 = store.hdf5_path_for("BE9557", src.name) + with h5py.File(h5, "r") as f: + assert f.attrs["geo_range"] == "sensitive" + + # A file stored before this fix carries "normal"; the backfill rewrites it. + event_hdf5.write_event_hdf5(h5, ev, serial="BE9557", geo_range="normal") + assert backfill.main(["--store-root", str(tmp_path / "waveforms"), + "--db-path", str(tmp_path / "seismo_relay.db"), "--force"]) == 0 + with h5py.File(h5, "r") as f: + assert f.attrs["geo_range"] == "sensitive" diff --git a/tests/test_check_s3_decode.py b/tests/test_check_s3_decode.py index f9640f1..03f873d 100644 --- a/tests/test_check_s3_decode.py +++ b/tests/test_check_s3_decode.py @@ -28,7 +28,8 @@ def test_find_pairs_dedupes_and_pairs(tmp_path): def test_check_event_rows_and_attrs(): out = run.check_event("M007HVWF.K30W", str(FIX / "M007HVWF.K30W"), str(FIX / "M007HVWF_K30W_XML.XML")) assert out["attrs"]["range"] == "1.250" and out["attrs"]["model"] == "MiniMate Plus" - assert any(r[0] == "TranPPV" and r[1] == "mismatch" for r in out["results"]) + # clipped at its own 1.250 ceiling: accepted under the saturation carve-out + assert ["TranPPV", "accepted"] in [r[:2] for r in out["results"]] def test_bad_input_is_one_error_row(tmp_path): @@ -128,7 +129,7 @@ def test_compare_to_marks_the_summary(tmp_path): def test_file_prints_one_event(tmp_path, capsys): assert run.main([str(FIX), str(FIX), "--file", "M007HVWF.K30W"]) == 0 out = capsys.readouterr().out - assert any("TranPPV" in line and "mismatch" in line for line in out.splitlines()) + assert any("TranPPV" in line and "accepted" in line for line in out.splitlines()) # ── Final review fixes ────────────────────────────────────────────────────── diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 6669772..d030611 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -114,8 +114,23 @@ def test_clipped_normal_range_is_accepted(): assert (res[f].verdict, res[f].carveout) == ("accepted", "saturation") -def test_sensitive_range_8x_stays_a_mismatch(): +def test_a_clipped_sensitive_event_is_accepted_at_its_own_ceiling(): + # SFM reads the 1.250 range from the file; the clipped channels sit at 1.2506. res = _results("M007HVWF.K30W", CARVEOUTS) + assert res["GeoRange"].verdict == "match" and res["samples.Tran"].verdict == "match" + for f in ("TranPPV", "PeakVectorSum"): + assert (res[f].verdict, res[f].carveout) == ("accepted", "saturation") + + +def test_the_carveout_never_accepts_an_8x_value(): + # What SFM produced while it assumed Normal on a Sensitive unit: 8x high. + # The saturation rule must leave it a mismatch. + raw = (FIX / "M007HVWF.K30W").read_bytes() + side = sfm_side(raw) + side.values.update(TranPPV=10.005, VertPPV=10.005, LongPPV=10.005, PeakVectorSum=17.33) + side.geo_ips_per_count = 10.0 / 32000 + res = {r.field: r for r in compare(side, parse_xml_report_file(FIX / "M007HVWF_K30W_XML.XML"), + CARVEOUTS)} assert res["TranPPV"].verdict == "mismatch" and res["samples.Tran"].verdict == "mismatch" assert res["PeakVectorSum"].verdict == "mismatch" @@ -133,13 +148,14 @@ def test_pvs_carveout_needs_oorange_from_blastware(): def test_pvs_carveout_needs_the_clipped_channel_at_the_ceiling(): - # 1.250 range, Blastware PVS OORANGE; an UNclipped channel's 8x value happens to land - # in the 1.250 band -- that must not let SFM's 8x vector sum through. + # 1.250 range, Blastware PVS OORANGE, but no channel Blastware clamped: an + # UNclipped channel's 8x value landing in the 1.250 band must not let a vector + # sum through, even one inside the sqrt(3) bound. raw = (FIX / "M007HVWF.K30W").read_bytes() ref = parse_xml_report_file(FIX / "M007HVWF_K30W_XML.XML") - ref.scalars["TranPPV"] = "0.157" + ref.scalars.update(TranPPV="0.157", VertPPV="0.157", LongPPV="0.157") side = sfm_side(raw) - side.values["TranPPV"] = 1.256 + side.values.update(TranPPV=1.256, PeakVectorSum=2.0) res = {r.field: r for r in compare(side, ref, CARVEOUTS)} assert res["PeakVectorSum"].verdict == "mismatch" @@ -147,3 +163,12 @@ def test_pvs_carveout_needs_the_clipped_channel_at_the_ceiling(): def test_interval_mic_psi_matches(): # psi(L) report: every interval's "MicL Peak psi(L)" now converts right assert _results("T004JTRF.ME0H")["intervals.MicL Peak psi(L)"].verdict == "match" + + +def test_a_sensitive_range_event_now_matches(): + gr = FIX.parent / "geo-range-11-01-26" + raw = (gr / "K557J1KB.RQ0W").read_bytes() + res = {r.field: r for r in compare(sfm_side(raw), parse_xml_report_file(gr / "K557J1KB_RQ0W_XML.XML"))} + for f in ("GeoRange", "TranPPV", "VertPPV", "LongPPV", "PeakVectorSum", + "samples.Tran", "samples.Vert", "samples.Long"): + assert res[f].verdict == "match", (f, res[f]) -- 2.54.1 From be58b4f8f0b899a1467aa8df8b94c976391e5526 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 12:04:15 -0500 Subject: [PATCH 150/223] docs(changelog): Unreleased -- the geophone range from the file Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21a5034..ab3ba31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,37 @@ All notable changes to seismo-relay are documented here. --- +## Unreleased + +### Fixed +- **A Blastware file's geophone range comes from its setup, so Sensitive + events no longer read 8× high.** + - **Where it is:** in the setup's channel blocks, the byte 29 after each + geophone label. `0x00` is Normal (10 in/s full scale), `0x01` is Sensitive + (1.25 in/s). SFM's live 1A read has the same byte at label+33. + - **Measured:** it matches Blastware's GeoRange on 70,042 / 70,042 DL2 + events, all three channels agreeing on every one (35 Sensitive). + - **Before:** SFM assumed Normal, so every Sensitive event's peaks, vector + sum and `.h5` samples read 8× high. + - **`Event.geo_range`** is new: 0 or 1, or None when it isn't read (the + channels disagree, an unknown value, or a missing block). None comes with + a `decode_problems` entry, and peaks then assume Normal as before. + - **`decode_blastware_bytes`** scales peaks and the histogram vector sum by + the range. + - **`event_hdf5.write_event_hdf5`:** `geo_range` now defaults to None, + meaning the event's own range, else Normal. An explicit argument still + wins. + - **`waveform_store.save_imported_bw` and `scripts/backfill_sidecars.py`** + no longer force `"normal"`. The `waveform_store` line was agreed with the + parity session, which owns that file. + - **Decode checker:** GeoRange 70,042 / 70,042, and geophone samples exact + on **6,524 / 6,524** waveforms (was 6,491). PPV mismatches about halved, + and 10 of 88 fields fully match (was 6). 70,287 comparisons fixed, 0 + regressions. + - ⚠ **Codec change: bump `TOOL_VERSION` at the next release.** The backfill + (`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored + Sensitive events' peaks and `.h5` files. No schema change. + ## v0.33.0 — 2026-11-01 **SFM reads Series-3 events from the file alone, and proves it against -- 2.54.1 From f98c4ff129dd29e7fddc53fe61d25767ddc53dac Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 13:48:59 -0500 Subject: [PATCH 151/223] fix(sfm): a MiniMate download stores what its own file says, at the range it was recorded at (#17) With the decode checker's fixes merged (histogram vector sum 625bc39, mic psi 5644dbd, the file's geophone range 4844135), the event file reads everything Blastware reports. So a live download's row and samples are now the file's: peaks, vector sum, mic -- and the geophone range from the file's own setup block, the setting when the event was recorded. The live 1A is the unit's setting now, which may have changed since; it is the fallback only when the file's range does not read. Measured: K557J1KB.RQ0W (Sensitive waveform) downloaded with its settings unread -- e.g. while monitoring -- stores 0.019 / 0.055 / 0.019 and PVS 0.061, Blastware's report; its .h5 read 0.155 / 0.44 (8x) before. M010HR6K.OA0H (Sensitive histogram) likewise. K441LTON.900 (Normal) stores Blastware's values whatever the unit's current settings say, and its mic is 5.80e-4 psi (Blastware: 106.0 dB(L)). The unit's 0C summary stays the download check, and fills in the channel peaks and vector sum only when the file's range does not read (never seen in DL2) and the unit is not confirmed Normal -- the impossible-vector-sum guard kept there. The mic is the file's always. Closes the range part of open finding #17. Store consequence: new live downloads only; no backfill, no migration. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 6 +- .../2026-10-20-sfm-series4-parity-design.md | 28 ++-- sfm/event_ingest.py | 68 ++++++---- tests/test_event_ingest.py | 125 +++++++++++++----- 4 files changed, 150 insertions(+), 77 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6080f7f..7e17c14 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -228,9 +228,9 @@ Read this first when picking the project back up. audit `sent: null` (#15), and page polish. **Batch 1 fixed (2026-10-29):** #1 (`b320a53`, settings read after unescaping: mode −7, rate −6, interval −4, record time +6), #9 (`ce441a0`, one reconnect for - the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw` with - the unit's mic overlaid, its peaks/vector sum too unless Normal range is confirmed - -- since 2026-10-31, after the checker's histogram-PVS fix -- and its range passed). #2 came with the + the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw`; since + 2026-11-02 everything comes from the file -- peaks, vector sum, mic and the range + it was recorded at -- and the unit's 0C summary is only the download check). #2 came with the `dev` merge. **#15 retracted** -- `sent` NULL is "unknown", by design. Final review fixes: `dbd8a91` (wake before the reconnect's identity read), `3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 5f2a769..c72d3a1 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -685,12 +685,15 @@ a short plan; #14 waits for the line-hold decision above. 7. `/db/events` 500 "database is locked" on the first page load against a new DB. 8. ✅ **Fixed `9492e49`**, plus `3a1d34a` ("already stored" also matches the Blastware name: a histogram's row sits a second off its 0C time). The download carries the assembled Blastware file and is - stored through `save_imported_bw` (`source.kind` "sfm-live"), and its range scales - the samples. The unit's 0C mic is overlaid (the file reads it as 0). Its channel - peaks and vector sum were overlaid too until 2026-10-31; since the checker's - histogram-PVS fix (625bc39, merged `6945009`) the file's are taken when the unit - confirms Normal range, and the unit's stand for Sensitive or an unread range (the - file reader assumes Normal: 8x off). The label came with #41 (`a1d2b61`). + stored through `save_imported_bw` (`source.kind` "sfm-live"). Since 2026-11-02 + (after the checker's fixes for the histogram vector sum 625bc39, the mic psi + 5644dbd and the file's geophone range 4844135) the row and samples are the + file's: peaks, vector sum, mic, and the range the event was recorded at (the live + 1A is the unit's setting *now*, a fallback only when the file's range does not + read). The unit's 0C summary is the download check, and fills in peaks only when + the file's range does not read and the unit is not confirmed Normal. Until then + the unit's 0C values were overlaid (`9492e49`, narrowed `0a87d85`). The label + came with #41 (`a1d2b61`). **S3 downloads are stored from the live waveform decoder** (`store.save`), not the file reader that Series 4 uses (`save_imported_idf`): a histogram gets no samples and is labelled Waveform. Fix: store S3 downloads through the @@ -716,12 +719,13 @@ a short plan; #14 waits for the line-hold decision above. ring instead of its ack is exactly unknown, and the row's `error` says it was sent. 16. Page: a 504 on a unit THOR holds should say "connected, but no reply -- another program may be holding this unit's line". -17. **Found by the Batch 1 review (open):** a MiniMate downloaded *while monitoring* - answers 1A with its device-info block, so no range is read and the stored - `.h5` samples assume Normal -- 8x off on a sensitive-range unit (the row's - peaks are the unit's, overlaid). Pre-existing on the old path too. The same - reply decodes a setup name of `:S338.17`. Live S3 downloads also no longer - keep the `.a5.pkl` wire record. +17. ✅ **Range part fixed 2026-11-02:** a MiniMate downloaded *while monitoring* + answers 1A with its device-info block, so no range was read and the stored + `.h5` samples assumed Normal -- 8x off on a sensitive-range unit. The range now + comes from the event file itself (measured: K557J1KB.RQ0W stores 0.019 / 0.055 / + 0.019, Blastware's report, with the settings unread). Still open: the same reply + decodes a setup name of `:S338.17`, and live S3 downloads no longer keep the + `.a5.pkl` wire record. - **Same-second collisions (SDM).** Two events of one unit in the same second collide on (serial, timestamp) — a DB-wide dedup property, not 1b's. - **423 without `Retry-After` (1c).** Add `Retry-After` to the 423 a request gets while a download holds the unit. - **A lost `0C` during a Series-3 list (1c).** The strict walk raises on a lost `0A` diff --git a/sfm/event_ingest.py b/sfm/event_ingest.py index 64a2bf9..128ebce 100644 --- a/sfm/event_ingest.py +++ b/sfm/event_ingest.py @@ -66,36 +66,41 @@ def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload: ) -def _overlay_s3_record(ev: Any, unit_peaks: Any, geo_range: Any) -> None: - """The unit's own 0C values over the file's, where the file's are not yet right. +def _file_geo_range(bw_bytes: bytes) -> Any: + """The geophone range a Blastware file was recorded at (0 Normal, 1 Sensitive), + or None when it does not read -- or the file does not decode at all.""" + from minimateplus import event_file_io + try: + return event_file_io.decode_blastware_bytes(bw_bytes).geo_range + except Exception: # noqa: BLE001 -- the store reports it + return None - * Mic: always the unit's -- the file reads it as 0 (its psi conversion is an - open checker finding). - * Channel peaks and vector sum: the file's when the unit's settings confirm - Normal range (`geo_range` 0). The file reads them as the unit stored them - -- K441LTON.900: 0.200 / 0.385 / 0.255 and 0.385, as Blastware's report, - since the decode checker's fix (625bc39, 2026-10-31) -- while the 0C summary - is read at fixed offsets and can shift (BE9441 read 0 and -0.0 for vector - sums, bench #4). But the file reader computes every peak as if the range - were Normal, so a Sensitive unit's come out 8x off (the checker's 33 - waveforms): for Sensitive, or a range not read (a monitoring unit's 1A - carries no settings), the unit's own peaks stand, as before -- a vector - sum below the largest channel peak is impossible and is not kept. - The 0C peaks remain the download *check* (verify_s3_download) either way. +def _overlay_s3_record(ev: Any, unit_peaks: Any, unit_range: Any) -> None: + """The unit's own 0C peaks over the file's -- only where the file cannot be trusted. + + The file reads everything Blastware reports (checked on 70,042 events): the + channel peaks and the vector sum, scaled by the geophone range in its own + setup block (4844135), and the mic (5644dbd). The 0C summary is read at + fixed offsets and can shift -- BE9441's read 0 and -0.0 for vector sums + (bench #4) -- so the file's values stand. + + Except when the file's range does not read (`ev.geo_range` None; never seen + in DL2): the decoder then assumes Normal, 8x off for a Sensitive unit. Then + the unit's settings decide: Normal confirmed (`unit_range` 0) keeps the + file's peaks; Sensitive or unread keeps the unit's own, as before -- a vector + sum below the largest channel peak is impossible and is not kept. The mic + is the file's either way: its scale does not depend on the geophone range. """ + if unit_peaks is None or getattr(ev, "geo_range", None) is not None: + return + if unit_range in (0, "normal"): + return from minimateplus.models import PeakValues - if unit_peaks is None: - return if ev.peak_values is None: ev.peak_values = PeakValues() pv = ev.peak_values - micl = getattr(unit_peaks, "micl", None) - if micl is not None: - pv.micl = micl - if geo_range in (0, "normal"): - return for name in ("tran", "vert", "long"): value = getattr(unit_peaks, name, None) if value is not None: @@ -149,18 +154,23 @@ def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownlo family = "series4" else: # The same path production's watcher uses for Blastware's own files: the - # event is decoded from the file (samples, histogram, setup-block sample - # rate and record time), not from the live 5A decode. The unit's 0C mic - # goes over the file's, and its peaks too unless Normal range is - # confirmed (_overlay_s3_record). + # event is decoded from the file -- samples, histogram, peaks, vector sum, + # mic, sample rate, record time and the geophone range it was recorded + # at -- not from the live 5A decode. The unit's 0C summary is the + # download check (verify_s3_download); it fills in only when the file's + # range does not read (_overlay_s3_record). if not dl.bw_bytes: raise IngestError(f"{dl.filename}: the download carried no event file; nothing was stored") - geo_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None + unit_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None + # The file's range is the setting when it recorded; the live 1A is the + # unit's setting now, which may have changed since -- the fallback only. + # None lets the store scale by the file's own range. ev, rec = store.save_imported_bw(dl.bw_bytes, source_path=Path(dl.filename), serial_hint=dl.serial, source_kind="sfm-live", - geo_range=geo_range if geo_range is not None else "normal") + geo_range=None if _file_geo_range(dl.bw_bytes) is not None + else unit_range) if ev is not None and dl.event is not None: - _overlay_s3_record(ev, getattr(dl.event, "peak_values", None), geo_range) + _overlay_s3_record(ev, getattr(dl.event, "peak_values", None), unit_range) family = "series3" if ev is None or ev._waveform_key is None: raise IngestError(f"{dl.filename}: stored the file but could not build a database row") diff --git a/tests/test_event_ingest.py b/tests/test_event_ingest.py index 0d7021b..6e23fa0 100644 --- a/tests/test_event_ingest.py +++ b/tests/test_event_ingest.py @@ -296,9 +296,11 @@ def test_backfill_without_settings_changes_nothing(): assert ev.sample_rate is None -# The file path does not yet read a histogram's vector sum the way Blastware does -# (the checker's open finding), the mic peak, or a sensitive range, so a live -# download keeps the unit's own 0C values for those -- the Series-4 pattern. +# Since 2026-11-02 a live download stores what its own file says -- peaks, vector +# sum, mic, and the geophone range the event was recorded at -- and the unit's 0C +# summary is only the download check. The file's range is the setting when it +# recorded; the live 1A is the unit's setting now, which may have changed since. +# Only when the file's range does not read (never seen in DL2) does the 1A decide. def _with_unit_peaks(dl, *, tran, vert, long, micl, pvs): from minimateplus.models import PeakValues @@ -313,24 +315,99 @@ def _range(geo_range): return cc -def test_a_series3_download_takes_its_peaks_from_the_file_and_its_mic_from_the_unit(sdm): - # 2026-10-31: the file now reads a histogram's vector sum as the unit stored it - # (0.385 here, as Blastware's report), so the row takes the file's peaks and - # vector sum. The unit's 0C summary is read at fixed offsets and can shift - # (bench #4 read 0 / -0.0); these believable-but-wrong values must not win. - # The mic still comes from the unit: the file reads it as 0. +GEO_FIX = Path(__file__).parent / "fixtures" / "geo-range-11-01-26" +WRONG = dict(tran=0.21, vert=0.36, long=0.27, micl=0.0009, pvs=0.40) # believable, wrong; clears the old guard + + +def _download_from(path, serial): + from minimateplus.blastware_file import blastware_filename_time + when = blastware_filename_time(path.name) + return DownloadedEvent(event_id=f"{serial}:01110000:{when:%Y%m%d%H%M%S}", serial=serial, series=3, + filename=path.name, verified=None, bw_bytes=path.read_bytes(), timestamp=when) + + +def _h5_peaks(store, serial, name): + from sfm import event_hdf5 + plot = event_hdf5.plot_json_from_hdf5(store.hdf5_path_for(serial, name)) + return tuple(max(abs(v) for v in plot["channels"][c]["values"]) for c in ("Tran", "Vert", "Long")) + + +def _file_range_unread(monkeypatch): + # A file whose range does not read: the decoder then assumes Normal. + # K441LTON.900 is a Normal file, so its peaks are what such a decode gives. + import minimateplus.event_file_io as efi + real = efi.decode_blastware_bytes + + def unread(raw, **kw): + ev = real(raw, **kw) + ev.geo_range = None + return ev + monkeypatch.setattr(efi, "decode_blastware_bytes", unread) + + +@pytest.mark.parametrize("compliance", [_range(0), _range(1), None], + ids=["unit-says-normal", "unit-says-sensitive", "settings-unread"]) +def test_a_series3_download_stores_what_its_file_says(sdm, compliance): + # K441LTON.900 was recorded in Normal range, whatever the unit is set to now. store, db = sdm dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), - tran=0.21, vert=0.36, long=0.27, micl=0.00058, pvs=0.40) # clears the old guard - dl.compliance = _range(0) # Normal, confirmed by the unit + **WRONG) + dl.compliance = compliance row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) - assert row["peak_vector_sum"] == pytest.approx(0.3852, abs=1e-4) # Blastware: 0.385 assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.2, 0.385, 0.255), abs=1e-4) - assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) + assert row["peak_vector_sum"] == pytest.approx(0.3852, abs=1e-4) # Blastware: 0.385 + assert row["mic_ppv"] == pytest.approx(5.80e-4, abs=2e-6) # Blastware: 106.0 dB(L) + assert _h5_peaks(store, "BE9441", "K441LTON.900")[1] == pytest.approx(0.385, abs=0.006) -def test_an_impossible_unit_vector_sum_is_not_kept(sdm): - # Bench finding #4: BE9441's 0C read -0.0 for a vector sum whose channels reach 1.08. +def test_a_sensitive_waveform_downloaded_with_its_settings_unread_is_blastwares(sdm): + # e.g. downloaded while monitoring (the 1A carries no settings). The samples + # were scaled as Normal before -- 8x: Vert read 0.44 in the .h5. + store, db = sdm + dl = _download_from(GEO_FIX / "K557J1KB.RQ0W", "BE9557") + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.019, 0.055, 0.019), abs=6e-4) + assert row["peak_vector_sum"] == pytest.approx(0.061, abs=6e-4) # Blastware's report + assert _h5_peaks(store, "BE9557", "K557J1KB.RQ0W") == pytest.approx((0.019, 0.055, 0.019), abs=7e-4) + + +def test_a_sensitive_histogram_downloaded_with_its_settings_unread_keeps_its_scale(sdm): + from minimateplus.event_file_io import decode_blastware_bytes + store, db = sdm + path = GEO_FIX / "M010HR6K.OA0H" + pv = decode_blastware_bytes(path.read_bytes()).peak_values + persist_download(_download_from(path, "BE11010"), store=store, db=db) + assert _h5_peaks(store, "BE11010", path.name) == pytest.approx((pv.tran, pv.vert, pv.long), abs=7e-4) + assert max(_h5_peaks(store, "BE11010", path.name)) < 0.02 # not 8x (Vert would read ~0.07) + + +def test_when_the_files_range_does_not_read_a_sensitive_units_own_peaks_stand(sdm, monkeypatch): + _file_range_unread(monkeypatch) + store, db = sdm + dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), + tran=0.025, vert=0.048, long=0.032, micl=0.0009, pvs=0.0481) + dl.compliance = _range(1) + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.025, 0.048, 0.032), abs=1e-6) + assert row["peak_vector_sum"] == pytest.approx(0.0481, abs=1e-6) + assert row["mic_ppv"] == pytest.approx(5.80e-4, abs=2e-6) # the mic's scale is not the geophones' + assert _h5_peaks(store, "BE9441", "K441LTON.900")[1] == pytest.approx(0.385 / 8, abs=7e-4) + + +def test_when_the_files_range_does_not_read_and_the_unit_says_normal_the_files_peaks_stand(sdm, monkeypatch): + _file_range_unread(monkeypatch) + store, db = sdm + dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), + **WRONG) + dl.compliance = _range(0) + row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) + assert (row["vert_ppv"], row["peak_vector_sum"]) == pytest.approx((0.385, 0.3852), abs=1e-4) + + +def test_an_impossible_unit_vector_sum_is_not_kept(sdm, monkeypatch): + # Bench finding #4: BE9441's 0C read -0.0 for a vector sum whose channels reach + # 1.08. The unit's values are used only when neither range reads. + _file_range_unread(monkeypatch) store, db = sdm dl = _with_unit_peaks(_hist_download("K441LTOK.R10", "011106a0", datetime.datetime(2026, 10, 26, 16, 6, 37)), tran=0.25, vert=1.08, long=0.195, micl=0.0001, pvs=-0.0) @@ -421,21 +498,3 @@ def test_a_letterless_stored_name_still_matches_a_lettered_download(sdm): store, db = sdm _stored_as(store, db, "K441LTOK.QZ0") assert db.find_event_by_blastware_name("BE9441", "K441LTOK.QZ0H")["blastware_filename"] == "K441LTOK.QZ0" - - - -# The file reader computes every peak as if the unit were in Normal range (10 in/s); -# a Sensitive (1.25 in/s) unit's file peaks come out 8x off (the checker's 33 -# waveforms). So the file's peaks are taken only when the unit's settings confirm -# Normal -- the download check's rule; Sensitive or unread keeps the unit's own. - -@pytest.mark.parametrize("compliance", [_range(1), None], ids=["sensitive", "range-unread"]) -def test_without_a_confirmed_normal_range_the_units_peaks_stand(sdm, compliance): - store, db = sdm - dl = _with_unit_peaks(_hist_download("K441LTON.900", "0111f210", datetime.datetime(2026, 10, 26, 17, 0, 36)), - tran=0.025, vert=0.048, long=0.032, micl=0.00058, pvs=0.0481) - dl.compliance = compliance - row = db.get_event(persist_download(dl, store=store, db=db).db_event_id) - assert (row["tran_ppv"], row["vert_ppv"], row["long_ppv"]) == pytest.approx((0.025, 0.048, 0.032), abs=1e-6) - assert row["peak_vector_sum"] == pytest.approx(0.0481, abs=1e-6) - assert row["mic_ppv"] == pytest.approx(0.00058, abs=1e-6) -- 2.54.1 From b6e726f850e1b0db14e1db528c37093a7083b525 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 14:03:47 -0500 Subject: [PATCH 152/223] docs: the event-file fields SFM reads from the file alone (reference Appendix D.6) New Appendix D.6 records the bytes and DL2 verification for every field SFM reads from a Blastware event file: record type STRT[18], the recording-setup block (sample rate k-42, pre-trigger k-36, record time k-30, the four notes), the geophone range (label+29), each histogram interval's PVS^2, and the mic scale (0.25 Pa per count, dB offset 81.9384). None of these were written down outside code and issues. Retracted in place: - D.3.1's STRT[20] = record time: it is 00 on 70,041 / 70,041 DL2 files. - the 2026-08-26 reading of sub-minute histogram records as little- endian: big-endian from byte 5 since v0.32.0 (#47/#49), and the '2-word tail' is the PVS^2. Also in CLAUDE.md. Measured for #48 (files only): the 1A 'stable anchor' be 80 00 00 00 00 is the setup's pre-trigger -0.25 s plus 00 00. It is present only on the 3,886 / 6,541 DL2 waveforms recorded at exactly -0.25 s, and on no histogram. The live 1A read is still unmeasured. CLAUDE.md: Where things stand reflects the range fix on dev (6,524 / 6,524 waveforms exact); the 8x sensitive-range item and the MicL dB item are marked resolved in place. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CLAUDE.md | 49 ++++++--- docs/instantel_protocol_reference.md | 156 ++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 18 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8ceb078..83fd210 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,7 +10,7 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as --- -## Where things stand (updated 2026-11-01) +## Where things stand (updated 2026-11-02) Read this first when picking the project back up. @@ -25,14 +25,16 @@ Read this first when picking the project back up. `~/dl2-archive/checker-runs/` and is never committed. - **The rule:** every mismatch is SFM's bug unless a carve-out with evidence covers it. + - **Byte layouts** of every field read from the file: + `docs/instantel_protocol_reference.md` Appendix **D.6**. - **As of v0.33.0:** + **As of v0.33.0, plus the range fix on `dev` (`057df47`, 2026-11-02):** - ✅ **Match on every event:** sample rate, record time, pre-trigger, notes, - and event type (#41, from STRT[18]). - - ✅ **Geophone samples** are exact on 6,491 / 6,524 waveforms in every year. - The 33 others are the 1.250 in/s range, 8× under SFM's Normal-range - assumption. - - ✅ **Histogram PVS** = the stored per-interval PVS²: 69,919 / 70,042. + event type (#41, from STRT[18]), and geophone range (`dev`). + - ✅ **Geophone samples** are exact on **6,524 / 6,524** waveforms in every + year (`dev`). v0.33.0 had 6,491: the 33 others were on the 1.250 in/s + range, 8× high under SFM's old Normal-range assumption. + - ✅ **Histogram PVS** = the stored per-interval PVS²: 69,952 / 70,042. - ✅ **Mic: one count = 0.25 Pa,** with Blastware's dB offset at 81.9384. It fails on only a few dozen events. - ❌ **Open:** @@ -44,8 +46,12 @@ Read this first when picking the project back up. - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out to prove) - ⬜ **Not read yet:** job number, ZC frequency, acceleration, displacement, - time of peak, sensor check, battery, calibration, range, units, monitor - log. + time of peak, sensor check, battery, calibration, units, monitor log. + - 🔶 **#48, measured on files only:** the 1A "stable anchor" + `be 80 00 00 00 00` is the setup's pre-trigger −0.25 s followed by + `00 00`. It appears only on the 3,886 / 6,541 DL2 waveforms recorded at + exactly −0.25 s, and on no histogram. Whether the live 1A read breaks the + same way is still unmeasured (reference D.6.2). - **The Series-4 LIVE wire protocol is reverse-engineered end to end (2026-09-25).** `docs/micromate_protocol_reference.md` is the Series-4 Rosetta Stone, sibling to `instantel_protocol_reference.md`. **A Micromate @@ -229,8 +235,9 @@ Read this first when picking the project back up. over) needs a BW capture of a spanning event first. Do not ship layer one alone without a loud truncation warning — a silently short event is the failure mode this codec has been bitten by repeatedly. -- **Open, not blocking:** 14 sensitive-range files show an exact 8x - (= 10.0/1.25) units discrepancy; `scripts/backfill_sidecars.py --force` also +- **Open, not blocking:** ~~14 sensitive-range files show an exact 8x + (= 10.0/1.25) units discrepancy~~ (**resolved on `dev` 2026-11-02:** the + range is read from the file, reference D.6.4); `scripts/backfill_sidecars.py --force` also inserts DB rows for store files that have none (one-time per store) and the dry-run does not report that count. - **After any codec change, regenerate the store** — `backfill_sidecars.py` @@ -640,6 +647,14 @@ block still covers exactly one minute: | 15 s | 4 | 92 | | 2 s | 30 | 612 | +> ⚠ **CORRECTED in v0.32.0 (#47/#49), recorded here 2026-11-02.** The +> records are **big-endian, starting at byte 5**. Each holds a uint16 peak +> and a uint16 half-period per channel, then the interval's **PVS² as a +> uint32 BE**. Record = 4 × channels + 4 bytes: 20 with the mic, 16 +> without. `stride = 12 + n × record`. The little-endian reading below was +> the same words shifted by one byte. Its "2-word tail" is the PVS² +> (reference D.6.5). + `stride = 12 + n * 20`. Block = `[00][segment][ctr uint16 LE][0a][00]`, then n x 20-byte records of 8 x uint16 **LITTLE**-endian values (`T_peak, T_halfp, V_peak, V_halfp, L_peak, L_halfp, M_peak, M_halfp`) @@ -647,6 +662,7 @@ plus a 2-word tail whose first word is `0000` on every real interval, then a 6-byte block trailer. ⚠ The standard 32-byte block is BIG-endian; this variant is LITTLE-endian. +*(Retracted: both are big-endian; see the box above.)* Recovers **415 files** (216 on BE18193, 199 on BE9440) that decoded to nothing. Ground truth `BE9440/K440L3AQ.T70H` matches its BW ASCII export @@ -674,6 +690,9 @@ block has its own tail signature. Two long-standing errors: `1e 0a 00 00`, with arbitrary bytes at `[21:23]`. Rejecting it dropped the final interval of nearly every histogram — frequently the one holding the event peak, so the file's PPV read low. +- **`[21:25]` is the interval's PVS² as a uint32 BE** (v0.33.0, reference + D.6.5). The "arbitrary bytes" above are probably its high half + (inferred). Verified against 1211 production histograms paired with their BW ASCII exports: **1211/1211 decode exactly** (interval count plus every @@ -682,11 +701,13 @@ with zero mismatches. Before: 1 of 1196. ### What's NOT solved -- **MicL channel conversion to dB(L)** — the codec emits MicL as +- ~~**MicL channel conversion to dB(L)** — the codec emits MicL as raw ADC counts (same format as geo channels), but BW's ASCII export shows mic in dB(L) with ~6 dB quantization steps. Need to map ADC counts → dB(L) for direct comparison; likely - `dB = 20*log10(|counts|) + offset` or similar. + `dB = 20*log10(|counts|) + offset` or similar.~~ **Solved in v0.33.0.** + One count = 0.25 Pa, and dB(L) = 81.9384 + 20·log10(|count|), an offset + measured from Blastware's printed values (reference D.6.6). - **Variable-prefix segment descriptors** — 3 of the 75 ground-truth production events still truncate. The walk reaches a segment header whose channel-id field is preceded by a *variable-width* prefix (2, 4 @@ -1345,7 +1366,7 @@ Do NOT use fixed absolute offsets for sample_rate or record_time. | trigger_level_geo | float32 BE, located in channel block | | alarm_level_geo | float32 BE, adjacent to trigger_level_geo | | geo_hardware_constant (adc_scale_factor) | float32 BE at **channel_label+28** in both read (E5) and write (SUB 71) payloads — reads **6.206053** on BOTH tested units (BE11529 and BE18189); identical across all geo channels (Tran/Vert/Long) and all captures. **Confirmed 2026-04-17 from Interface Handbook §4.5**: this is the **ADC-to-velocity scale factor** = 1/sensitivity = (in/s per V). Firmware uses it as: `PPV (in/s) = ADC_voltage × 6.206053`. Cross-check: `1.61133 V (ADC full-scale) × 6.206053 = 10.000 in/s` (Normal range ✅). Do NOT write this field — it is a hardware/firmware constant. | -| geo_range (sensitivity selector) | **uint8 at channel_label+33** in both read (E5) and write (SUB 71) payloads — **CONFIRMED 2026-04-20** from 4-20-26 geo sensitivity captures: `0x00` = Normal 10.000 in/s (standard gain), `0x01` = Sensitive 1.250 in/s (high gain). Present in all three geo channel blocks (Tran, Vert, Long). **NOTE: `channel_label+20` reads `0x01` on ALL captures regardless of range setting — it is NOT this field.** Note: the "SUB 71 write offset = +29" that appears in earlier analysis was an artifact of incorrect BW-style destuffing applied to write frame data — write frame data is RAW, so the literal `0x10` bytes in the channel block header are preserved, and the offset is the same as in the E5 read payload. | +| geo_range (sensitivity selector) | **uint8 at channel_label+33** in both read (E5) and write (SUB 71) payloads (an event file's setup copy has it at label+29: reference D.6.4) — **CONFIRMED 2026-04-20** from 4-20-26 geo sensitivity captures: `0x00` = Normal 10.000 in/s (standard gain), `0x01` = Sensitive 1.250 in/s (high gain). Present in all three geo channel blocks (Tran, Vert, Long). **NOTE: `channel_label+20` reads `0x01` on ALL captures regardless of range setting — it is NOT this field.** Note: the "SUB 71 write offset = +29" that appears in earlier analysis was an artifact of incorrect BW-style destuffing applied to write frame data — write frame data is RAW, so the literal `0x10` bytes in the channel block header are preserved, and the offset is the same as in the E5 read payload. | | setup_name | ASCII, null-padded, in cfg body | | project / client / operator / sensor_location | ASCII, label-value pairs | diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index ccd9fa9..a59d4b7 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,9 +11,10 @@ | Date | Section | Change | |---|---|---| +| 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). 🔶 **For #48 (measured on files only):** the 1A "stable anchor" `be 80 00 00 00 00` is the file's pre-trigger −0.25 s followed by `00 00`. It appears only on the 3,886 / 6,541 DL2 waveforms recorded at exactly −0.25 s, and on no histogram. | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | | 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | -| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | +| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** ⚠ *Corrected 2026-11-02: the records are big-endian from byte 5, not little-endian (v0.32.0, #47/#49), and the "2-word tail" is the interval's PVS². See D.6.5.* The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | | 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | | 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | | 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. | @@ -3170,7 +3171,7 @@ The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger | **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open | | ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | | ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 | -| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | +| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** ⚠ *Corrected 2026-11-02: the records are big-endian from byte 5, not little-endian (v0.32.0, #47/#49), and the "2-word tail" is the interval's PVS². See D.6.5.* When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 | | **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open | | **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open | @@ -3397,8 +3398,16 @@ The STRT record immediately follows the 22-byte header. | 4 | 2 | `ff fe` | Fixed | | 6 | 4 | event key (key4) | 4-byte waveform key | | 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field | -| 14 | 6 | device-specific | NOT zero-padded — device-internal fields | -| 20 | 1 | rectime | uint8 seconds | +| 14 | 4 | device-specific | not identified (see the retraction below) | +| 18 | 1 | **record type** ✅ | `0x46` waveform, `0x0A` histogram: 6,541 / 6,541 `…W` and 63,500 / 63,500 `…H` DL2 files (2026-11-02). See D.6.1 | +| 19 | 2 | `00 00` | zero on 70,041 / 70,041 DL2 files | + +> ⚠ **RETRACTED 2026-11-02.** This table used to end `| 14 | 6 | device-specific |` and +> `| 20 | 1 | rectime | uint8 seconds |`. `STRT[20]` is `0x00` on every DL2 file, so it is not +> the record time. Until v0.33.0, SFM read a record time from `STRT[18]`, the record-type byte, +> which is why every waveform reported "70 s" (`0x46`). It also read pre-trigger and sample count +> from `[16:18]`; both were wrong (#45). The record time and pre-trigger live in the +> recording-setup block (D.6.2). **Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone. @@ -3576,6 +3585,10 @@ observed) and does NOT follow the AB0T formula. **DLE-shift offset note for reading recording_mode from N00/9T0 body:** +> ⚠ **2026-11-02:** this note finds the block by the 6-byte anchor. In an event file that anchor +> exists only when the pre-trigger is exactly −0.25 s: 3,886 / 6,541 DL2 waveforms, and no +> histogram. Find the block by its setup name instead (D.6.2). + The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: | 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) | @@ -3594,6 +3607,141 @@ file[anc−4]: histogram_interval_HI file[anc−3]: histogram_interval_LO ``` +### D.6 Event fields read from the file alone ✅ 2026-10-29 → 2026-11-02 + +Since v0.33.0, SFM decodes the fields below from an event file's bytes alone: no filename, no +Blastware report. The code is in `minimateplus/event_file_io.py`, `histogram_codec.py` and +`waveform_codec.py`. + +Each field was proven by the decode checker, `scratch/check_s3_decode.py`. It compares SFM's +decode with Blastware's `_XML.XML` report for every DL2 event: 70,042 events, 2016–2026, local +copy in `~/dl2-archive`. Counts below are from that archive unless stated otherwise. + +#### D.6.1 Record type — `STRT[18]` ✅ + +| `STRT[18]` | Type | DL2 | +|---|---|---| +| `0x46` | Waveform | 6,541 / 6,541 `…W` files | +| `0x0A` | Histogram | 63,500 / 63,500 `…H` files | + +- The 5A stream shows the same byte after the STRT keys (§7.8.5, `data[35]`). +- The filename's `W` / `H` is only a cross-check. On a disagreement SFM logs it and keeps the + byte (#41). +- Checker, event type: 70,042 / 70,042. + +#### D.6.2 Recording-setup block — sample rate, pre-trigger, record time ✅ + +**Find the block by structure:** `1c 08`, then the setup name (1–40 printable ASCII), then `00`. +That pattern occurs exactly once in every DL2 file. Do not search for the name "Standard +Recording Setup": 37% of DL2 files use another name. + +Offsets are from `k`, the first byte of the setup name: + +| Offset | Type | Field | Notes | +|---|---|---|---| +| `k − 42` | uint16 BE | sample rate | 1024 / 2048 / 4096 | +| `k − 36` | float32 BE | pre-trigger | seconds, ≤ 0: `−0.25` is a quarter second before the trigger | +| `k − 32` | 2 bytes | — | `00 00` on 70,041 / 70,041 files | +| `k − 30` | float32 BE | record time | seconds | + +- Pre-trigger samples = `round(−pre-trigger × sample rate)`. +- A histogram carries the block too, with pre-trigger `0.0` (63,500 / 63,500). Blastware reports + no record time or pre-trigger for a histogram, and SFM reports none. +- Sample rate, record time and pre-trigger match Blastware on every DL2 event that reports them + (#44, #45). + +⚠ **The 1A "stable anchor" sits on the pre-trigger (measured on files, 2026-11-02).** +- This is the 1A compliance layout: sample rate at anchor − 6 and record time at anchor + 6 + (§7.6.1) put the anchor at `k − 36`. +- The 6-byte `be 80 00 00 00 00` is the pre-trigger −0.25 s (`be 80 00 00`) followed by the + `00 00` at `k − 32`. +- It occurs in a file only when the pre-trigger is exactly −0.25 s: 3,886 / 6,541 waveforms. + The other 2,655 waveforms (−0.249, −0.248, −0.2471, 0.0 and others) and all 63,500 + histograms contain it nowhere. +- 🔶 **The live 1A read is not measured.** This supports #48 but does not prove it. Live 1A + captures in Histogram mode did show the anchor, while histogram files store 0.0, so the file + and the 1A differ in at least this field. + +#### D.6.3 Notes — four label/value pairs after the name ✅ + +- After the name's `00`, NUL-terminated `label`, `value` pairs fill four slots, in order: + project, client, operator ("User Name") and sensor location ("Seis Loc"). +- **Read them by position, never by label.** Blastware lets the operator relabel the slots + ("Seis. Loc:", "Location:", "Project: "). +- An empty value means none. +- They match Blastware on every DL2 event. +- Not read yet: extended notes, job number. + +#### D.6.4 Geophone range — the setup's channel blocks ✅ 2026-11-01 + +The channel blocks follow the notes, within 2,000 bytes of the name: `00 00 01` then `Tran` / +`Vert` / `Long`. The range is the byte at label + 29, where label is the first byte of +`Tran` / `Vert` / `Long`: + +| label + 29 | Range | Full scale | +|---|---|---| +| `0x00` | Normal | 10.000 in/s | +| `0x01` | Sensitive | 1.250 in/s | + +- It matches the report's `GeoRange` on 70,042 / 70,042 events. The three channels agree on + every event, and 35 are Sensitive. +- The live 1A carries the same byte at label + 33 (§7.6, confirmed 2026-04-20). +- Full scale is 32,000 counts at either range, so a Sensitive count is 8× smaller. +- Until `dev` `057df47` (2026-11-02), SFM assumed Normal and read every Sensitive event 8× high. +- If the channels disagree, a value is unknown or a block is missing, SFM reports no range, logs + a decode problem and assumes Normal. + +#### D.6.5 Histogram interval peak vector sum ✅ 2026-10-30 + +Each interval stores its peak vector sum **squared**: + +| Block | Where | Type | +|---|---|---| +| Standard 32-byte block (intervals of a minute or more) | `[21:25]` | uint32 BE | +| Sub-minute record | the record's last 4 bytes | uint32 BE | + +- `PVS = √value × unit`. The unit is 16 counts: 0.005 in/s at Normal, 0.000625 in/s at + Sensitive. +- **The event's PVS is the largest interval's.** Combining the three channel peaks instead read + high on 86% of DL2 histograms, because the peaks can come from different moments. +- **Verified:** √value matches Blastware's "Geo PVS" on 34.5 M DL2 sub-minute intervals, and the + event PVS matches on 69,952 / 70,042 events. The rest are the open histogram cases in D.6.7. +- 🔶 On the stream's last block, the "arbitrary bytes at [21:23]" in the 2026-08-25 note are + probably the high half of this field (inferred from the layout, not measured). + +**Sub-minute records (corrected in v0.32.0, #47/#49):** +- They are **big-endian, starting at byte 5** of the block. +- Each holds, per channel, a uint16 peak and a uint16 half-period (Tran, Vert, Long, and MicL + when the mic is on), then the uint32 PVS². +- Record = 4 × channels + 4 bytes: 20 with the mic, 16 without. `stride = 12 + n × record`. + +> ⚠ **RETRACTED:** the 2026-08-26 notes (Changelog, §15) read these records as 8 × uint16 +> little-endian after a 6-byte header. That was the same big-endian words shifted by one byte. +> Their "2-word tail whose first word is 0000" is the PVS², whose high word reads `0000`. + +#### D.6.6 Mic ✅ v0.33.0 + +- One count = **0.25 Pa**, so psi = count × 0.25 / 6894.757. +- dB(L) = **81.9384** + 20·log10(|count|). + - The exact value, 20·log10(0.25 Pa / 20 µPa), is 81.9382. Blastware's printed values pin the + offset in [81.9383, 81.9385] instead. + - With the exact value, 280 events mismatched, all at count 129. + - float32 rounding does not explain the difference. +- **Verified:** interval psi mismatches fell from 42,783 to 26, and mic peak mismatches from 345 + to 40. + +#### D.6.7 Not read from the file yet + +- **Fields:** job number, extended notes, ZC frequency, acceleration, displacement, time of + peak, sensor check results, battery, calibration, units, monitor log. +- **Open cases:** + - histogram start times are 1 s early (#51) + - 35 sub-minute histograms and 2 one-minute mic-off histograms decode wrongly + - 26 histogram start dates are a day off + - the per-interval PVS is not stored + - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out still to + prove) + --- *All findings reverse-engineered from live RS-232 bridge captures.* -- 2.54.1 From 55d74c0a7ba3e62baf7f89ab592aeb3cb9de294c Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 14:04:10 -0500 Subject: [PATCH 153/223] docs(changelog): Unreleased -- the event-file fields in the protocol reference Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab3ba31..3ee75a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,27 @@ All notable changes to seismo-relay are documented here. (`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored Sensitive events' peaks and `.h5` files. No schema change. +### Protocol / Documentation +- **`docs/instantel_protocol_reference.md` gains Appendix D.6:** the bytes + and DL2 verification for every field SFM reads from a Blastware event file. + - the record type, `STRT[18]` + - the recording-setup block: sample rate, pre-trigger, record time and the + four notes + - the geophone range + - each histogram interval's PVS² + - the mic scale +- **Retracted in place:** + - `STRT[20]` as the record time: it is `00` on every DL2 file. + - The 2026-08-26 reading of sub-minute histogram records as little-endian: + they are big-endian from byte 5 (#47/#49), and the "2-word tail" is the + PVS². This is corrected in CLAUDE.md too. +- **Measured for #48, on files only:** the 1A "stable anchor" + `be 80 00 00 00 00` is the setup's pre-trigger −0.25 s followed by `00 00`. + It appears only on the 3,886 / 6,541 DL2 waveforms recorded at exactly + −0.25 s, and on no histogram. The live 1A read is still unmeasured. +- **CLAUDE.md "Where things stand"** now reflects the range fix. +- Docs only: no code change, no migration. + ## v0.33.0 — 2026-11-01 **SFM reads Series-3 events from the file alone, and proves it against -- 2.54.1 From 5bed7d6c6f4b74b20fdbc9483405dc028ce40da9 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 14:23:32 -0500 Subject: [PATCH 154/223] docs: the file's pre-trigger is the event's, not the setting -- corrects today's #48 note The pre-trigger float in an event file's setup block varies from event to event on the same unit, often on the same day (BE18193: -0.25 and -0.248 on 2026-08-21; 253-256 samples at 1024 sps, -0.002 to -0.249 s at 4096 sps), and Blastware reports the same per-event value as Pre-triggerLength. So it is the event's own pre-trigger, and the note written earlier today overstated what the files say about #48: the live 1A holds the setting, so a missing anchor in a file says little about whether the live read loses its anchor. #48 stays open. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CLAUDE.md | 11 +++---- docs/instantel_protocol_reference.md | 44 ++++++++++++++++++---------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 83fd210..1552b7a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,11 +47,12 @@ Read this first when picking the project back up. (a carve-out to prove) - ⬜ **Not read yet:** job number, ZC frequency, acceleration, displacement, time of peak, sensor check, battery, calibration, units, monitor log. - - 🔶 **#48, measured on files only:** the 1A "stable anchor" - `be 80 00 00 00 00` is the setup's pre-trigger −0.25 s followed by - `00 00`. It appears only on the 3,886 / 6,541 DL2 waveforms recorded at - exactly −0.25 s, and on no histogram. Whether the live 1A read breaks the - same way is still unmeasured (reference D.6.2). + - 🔶 **#48 is still open.** The event file's setup block puts the pre-trigger + where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, + it is **each event's own pre-trigger**, not the setting: 253–256 samples at + 1024 sps, alternating on the same unit on the same day, and reported that + way by Blastware. So the files say little about whether the live 1A read + loses its anchor (reference D.6.2). - **The Series-4 LIVE wire protocol is reverse-engineered end to end (2026-09-25).** `docs/micromate_protocol_reference.md` is the Series-4 Rosetta Stone, sibling to `instantel_protocol_reference.md`. **A Micromate diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index a59d4b7..d3a3b16 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,7 +11,7 @@ | Date | Section | Change | |---|---|---| -| 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). 🔶 **For #48 (measured on files only):** the 1A "stable anchor" `be 80 00 00 00 00` is the file's pre-trigger −0.25 s followed by `00 00`. It appears only on the 3,886 / 6,541 DL2 waveforms recorded at exactly −0.25 s, and on no histogram. | +| 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). **For #48:** the file's copy of the block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is each event's own pre-trigger, which varies on the same unit on the same day (253–256 samples at 1024 sps), and Blastware reports it per event. So the file says little about whether the live 1A loses its anchor, and #48 stays open. | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | | 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | | 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** ⚠ *Corrected 2026-11-02: the records are big-endian from byte 5, not little-endian (v0.32.0, #47/#49), and the "2-word tail" is the interval's PVS². See D.6.5.* The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | @@ -3586,8 +3586,8 @@ observed) and does NOT follow the AB0T formula. **DLE-shift offset note for reading recording_mode from N00/9T0 body:** > ⚠ **2026-11-02:** this note finds the block by the 6-byte anchor. In an event file that anchor -> exists only when the pre-trigger is exactly −0.25 s: 3,886 / 6,541 DL2 waveforms, and no -> histogram. Find the block by its setup name instead (D.6.2). +> exists only when the event's own pre-trigger is exactly −0.25 s: 3,886 / 6,541 DL2 waveforms, +> and no histogram. Find the block by its setup name instead (D.6.2). The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so: @@ -3640,7 +3640,7 @@ Offsets are from `k`, the first byte of the setup name: | Offset | Type | Field | Notes | |---|---|---|---| | `k − 42` | uint16 BE | sample rate | 1024 / 2048 / 4096 | -| `k − 36` | float32 BE | pre-trigger | seconds, ≤ 0: `−0.25` is a quarter second before the trigger | +| `k − 36` | float32 BE | pre-trigger | seconds, ≤ 0: `−0.25` is a quarter second before the trigger. **This event's own length, not the unit's setting** (below) | | `k − 32` | 2 bytes | — | `00 00` on 70,041 / 70,041 files | | `k − 30` | float32 BE | record time | seconds | @@ -3650,17 +3650,31 @@ Offsets are from `k`, the first byte of the setup name: - Sample rate, record time and pre-trigger match Blastware on every DL2 event that reports them (#44, #45). -⚠ **The 1A "stable anchor" sits on the pre-trigger (measured on files, 2026-11-02).** -- This is the 1A compliance layout: sample rate at anchor − 6 and record time at anchor + 6 - (§7.6.1) put the anchor at `k − 36`. -- The 6-byte `be 80 00 00 00 00` is the pre-trigger −0.25 s (`be 80 00 00`) followed by the - `00 00` at `k − 32`. -- It occurs in a file only when the pre-trigger is exactly −0.25 s: 3,886 / 6,541 waveforms. - The other 2,655 waveforms (−0.249, −0.248, −0.2471, 0.0 and others) and all 63,500 - histograms contain it nowhere. -- 🔶 **The live 1A read is not measured.** This supports #48 but does not prove it. Live 1A - captures in Histogram mode did show the anchor, while histogram files store 0.0, so the file - and the 1A differ in at least this field. +⚠ **The file's pre-trigger is the event's, not the setting (measured 2026-11-02).** +- **It varies from event to event on the same unit, often on the same day.** BE18193 has both + −0.25 and −0.248 on 2026-08-21. + - At 1024 sps the common values −0.25, −0.249, −0.248 and −0.2471 are 256, 255, 254 and 253 + samples. + - At 4096 sps, BE18193's events range from −0.002 to −0.249 s. +- **Blastware reports the same per-event value** as `Pre-triggerLength`, for example + `-0.094 sec` for `T193KMX5.4Z0W`. +- 🔶 Inferred: the unit's setting stays fixed while the captured length falls short of it. Why it + falls short is unknown. + +**What this means for #48 (the 1A "stable anchor"):** +- This is the 1A compliance layout. Sample rate at anchor − 6 and record time at anchor + 6 + (§7.6.1) put the anchor at `k − 36`, so the 6-byte `be 80 00 00 00 00` is a pre-trigger of + −0.25 s followed by the `00 00` at `k − 32`. +- **In a file**, the anchor bytes appear only when that event's pre-trigger is exactly −0.25 s: + 3,886 / 6,541 waveforms, and no histogram (histogram files store 0.0). A file parser that + searches for the anchor breaks on the rest. SFM's file decoder finds the block by its setup + name instead. +- **The live 1A read holds the setting, not an event's length.** So these files say little about + whether the live read loses its anchor; #48 is still unsettled. +- `k − 32 : k − 30` is `00 00` on all 70,041 files. 🔶 If `[17]` is the stop mode, as on + Series IV, no DL2 event was recorded in Auto stop mode, so the archive cannot test that case. +- The two blocks differ in at least one field. A live 1A in Histogram mode showed the anchor + (−0.25 s), but histogram files store 0.0. #### D.6.3 Notes — four label/value pairs after the name ✅ -- 2.54.1 From 15a27d592126eb4f1da9f56bb0c4ff17bb4cdbb9 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 14:23:49 -0500 Subject: [PATCH 155/223] docs(changelog): Unreleased -- the file's pre-trigger is the event's Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ee75a3..15a9c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,10 +49,12 @@ All notable changes to seismo-relay are documented here. - The 2026-08-26 reading of sub-minute histogram records as little-endian: they are big-endian from byte 5 (#47/#49), and the "2-word tail" is the PVS². This is corrected in CLAUDE.md too. -- **Measured for #48, on files only:** the 1A "stable anchor" - `be 80 00 00 00 00` is the setup's pre-trigger −0.25 s followed by `00 00`. - It appears only on the 3,886 / 6,541 DL2 waveforms recorded at exactly - −0.25 s, and on no histogram. The live 1A read is still unmeasured. +- **#48 is still open.** The event file's setup block puts the pre-trigger where + the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is + **each event's own pre-trigger**, not the unit's setting: it varies on the + same unit on the same day, and Blastware reports it per event. So the files + say little about whether the live 1A read loses its anchor. (Corrected the + same day; the first version read the file's value as the setting.) - **CLAUDE.md "Where things stand"** now reflects the range fix. - Docs only: no code change, no migration. -- 2.54.1 From 7a58bad28dd248a6763fd8e585d572397d93dd14 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 14:31:23 -0500 Subject: [PATCH 156/223] feat(decode): a Blastware file's job number, and whether Blastware shows it The setup block has Series IV's 0x1A layout here too: report flags at k - 9 (bit 0x02 = job number shown) and the number, uint16 BE, at k - 8, kept while switched off. The flag matches Blastware's JobNumber on 2,997 / 2,997 DL2 events that print one and 66,986 / 66,986 that don't. Every printed value is 1 and matches; hidden ones hold real numbers (802, 1012, 1013, 622), so the value is only proven for 1. - ProjectInfo.job_number_enabled / job_number, named as in micromate.setup_block. - write_event_hdf5 stores both as .h5 attrs when read (additive). - The checker reports the number only when shown, and scores a number only SFM shows as a mismatch. The old test that pinned JobNumber as sfm_blank now checks only the ZC cases it also covered. Not carried into the DB, the API or the PDF report yet (needs a column). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 7 +- minimateplus/event_file_io.py | 23 +++- minimateplus/models.py | 2 + sfm/event_hdf5.py | 5 + .../job-number-11-02-26/K557I55Y.I20H | Bin 0 -> 1858 bytes .../job-number-11-02-26/K557I55Y_I20H_XML.XML | 116 +++++++++++++++++ .../job-number-11-02-26/T438I4V5.DJ0H | Bin 0 -> 1544 bytes .../job-number-11-02-26/T438I4V5_DJ0H_XML.XML | 117 ++++++++++++++++++ tests/test_bw_file_fields.py | 27 ++++ tests/test_decode_check.py | 21 +++- 10 files changed, 312 insertions(+), 6 deletions(-) create mode 100755 tests/fixtures/job-number-11-02-26/K557I55Y.I20H create mode 100755 tests/fixtures/job-number-11-02-26/K557I55Y_I20H_XML.XML create mode 100755 tests/fixtures/job-number-11-02-26/T438I4V5.DJ0H create mode 100755 tests/fixtures/job-number-11-02-26/T438I4V5_DJ0H_XML.XML diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 6133d77..0c19fdd 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -36,7 +36,7 @@ class SfmSide: event: Event values: dict[str, object] # reference tag -> SFM's value; absent or None = blank notes: list[str] # non-empty user-note slots, in order - job_number: Optional[str] # None until the decoder reads it + job_number: Optional[str] # only when the file says Blastware shows it channels: list[str] # channels with decoded data, in Tran/Vert/Long/MicL order counts: dict[str, list[int]] # waveform samples or histogram interval peaks geo_ips_per_count: float = GEO_IPS_PER_COUNT # at the event's range, as SFM read it @@ -78,7 +78,7 @@ def sfm_side(raw: bytes) -> SfmSide: values=values, notes=[v for v in (pi.project, pi.client, pi.operator, pi.sensor_location) if v] if pi is not None else [], - job_number=None, + job_number=str(pi.job_number) if pi is not None and pi.job_number_enabled else None, channels=[ch for ch in _CHANNELS if counts[ch]], counts=counts, geo_ips_per_count=_GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) / _GEO_INT16_FS, @@ -289,6 +289,9 @@ def compare(sfm: SfmSide, ref: XmlReport, carveouts: Sequence["Carveout"] = ()) if sfm.job_number is None else FieldResult("JobNumber", "match" if _same_text(sfm.job_number, ref.job_number) else "mismatch", ref.job_number, sfm.job_number)) + elif sfm.job_number is not None: + # SFM says the job number is shown; Blastware printed none. + out.append(FieldResult("JobNumber", "mismatch", None, sfm.job_number)) out.append(FieldResult("Channels", "match" if ref.channels == sfm.channels else "mismatch", " ".join(ref.channels), " ".join(sfm.channels))) if ref.sample_rows is not None: diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 7907e29..dd486b3 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -996,8 +996,29 @@ def _setup_notes(raw: bytes) -> ProjectInfo: text = [p.decode("ascii", errors="replace").strip() or None for p in parts] text += [None] * (2 + 2 * _NOTE_SLOTS - len(text)) project, client, operator, location = text[2:2 + 2 * _NOTE_SLOTS:2] + enabled, number = _setup_job_number(raw, k) return ProjectInfo(setup_name=text[0], project=project, client=client, - operator=operator, sensor_location=location) + operator=operator, sensor_location=location, + job_number_enabled=enabled, job_number=number) + + +# The job number, in Series IV's 0x1A layout ([39] report flags, [40:42] the +# number): flags at k - 9, bit 0x02 = shown; the number, uint16 BE, at k - 8, +# kept while switched off. The flag matches Blastware's JobNumber on 2,997 / +# 2,997 DL2 events that print one and 66,986 / 66,986 that don't, and every +# printed value matches (all are 1; measured 2026-11-02). +_REPORT_FLAGS_BEFORE_NAME = 9 +_JOB_NUMBER_BEFORE_NAME = 8 +_JOB_NUMBER_ON = 0x02 + + +def _setup_job_number(raw: bytes, k: int) -> tuple[Optional[bool], Optional[int]]: + """(shown, number) from the setup block whose name starts at k.""" + if k < _REPORT_FLAGS_BEFORE_NAME: + return None, None + flags = raw[k - _REPORT_FLAGS_BEFORE_NAME] + j = k - _JOB_NUMBER_BEFORE_NAME + return bool(flags & _JOB_NUMBER_ON), int.from_bytes(raw[j:j + 2], "big") # The geophone range sits in the setup's channel blocks, which follow the diff --git a/minimateplus/models.py b/minimateplus/models.py index 81eb9ea..6096342 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -379,6 +379,8 @@ class ProjectInfo: operator: Optional[str] = None # operator / user name sensor_location: Optional[str] = None # sensor location string notes: Optional[str] = None # extended notes + job_number_enabled: Optional[bool] = None # Blastware prints the job number + job_number: Optional[int] = None # kept while switched off # ── Compliance Config ────────────────────────────────────────────────────────── diff --git a/sfm/event_hdf5.py b/sfm/event_hdf5.py index bde0e28..f8c3a4e 100644 --- a/sfm/event_hdf5.py +++ b/sfm/event_hdf5.py @@ -32,6 +32,8 @@ Layout written to `.h5`: client str operator str sensor_location str + job_number int (only when read; kept while not shown) + job_number_enabled bool (Blastware prints the job number) peak_tran_ips float (from 0C; authoritative) peak_vert_ips float peak_long_ips float @@ -257,6 +259,9 @@ def write_event_hdf5( attrs["client"] = (pi.client if pi else "") or "" attrs["operator"] = (pi.operator if pi else "") or "" attrs["sensor_location"] = (pi.sensor_location if pi else "") or "" + if pi is not None and getattr(pi, "job_number", None) is not None: + attrs["job_number"] = int(pi.job_number) + attrs["job_number_enabled"] = bool(pi.job_number_enabled) attrs["peak_tran_ips"] = float(pv.tran if pv and pv.tran is not None else 0.0) attrs["peak_vert_ips"] = float(pv.vert if pv and pv.vert is not None else 0.0) attrs["peak_long_ips"] = float(pv.long if pv and pv.long is not None else 0.0) diff --git a/tests/fixtures/job-number-11-02-26/K557I55Y.I20H b/tests/fixtures/job-number-11-02-26/K557I55Y.I20H new file mode 100755 index 0000000000000000000000000000000000000000..f56537a732086860cd297898c3d9094727d56d17 GIT binary patch literal 1858 zcma)+ZERCz6vxl)I(oUc?R{?P_JQDdIw5WdrRzF2aRc@iMLS&Fi$R5O?XFv4+>*8! zB_Sa(Bt{L1l87c#aTud6!GK?IUE&85d|8)Z6cS{eo8x5&y?q;lK(_07x-pI61LyYK zr+0hKdH%n1&Mg7%5WrR~5>>RQ+6$Jo;3$B$_UGG;IZn2CI2k~kf)W9kaRPKe0hsVo za4mpBfGzjVj6vTLXlQ<-s;U~EIwAvSI>TJaW)uHau$Dm()~h#IEbl)dUkXjj8wWnGIJ=uxy_AhMQj z)dFtJ*W{)RN;ujR>J9BxRA^I!5$X>GlxQ%dp^i|1djEeYMpbyLXq$Uc3^czURkbd) zi*7?z5n%mWbpU*2*q8ROqTwS4tsp@e6qyP*Ggbq(oIN%Ru*n}E32N?qx7K4BzwZHG zIqvR6$cK+A?*`u*jPi%H?uUju-px`It7=2^6F%c0l{#xFR<%#ay&qwhL% z8j35yFz`fX?4I}j87TIFaSErM8QXsny}N!KimSkwUD%Jxz>0249)YtsWH|Zo9F%es zEDcx7)q<6xmfQVrzIW{6jSIhCni&7<^3?SkdMZ0TbNlYSSz^vSN_~YEeyJeZY<4># zvg~j;mN9dp<5$@s%Y;ahWVhL@q9_Og&s&x(A@8b9-U=BEJ(-9P565ByUk?rr#s*@s zp?Ex=Na(trGK@3;rX((h>?(CQm^)l9*@YSL;!y8O;0Z55TH1o#hVjKoI9E5%@eHgs zt^F5ySAt6rr( zUJ$G{ny+^c1C3tg{4b*o+lr6cQjR&l9iI4Ope46Duzr0 z1B0>H@X%0vbR;o0rt5Qtlun~`nPat*UCh|Z3WdfILO4`Q7!knOB%IqcPt*dBamhSU z1J{6^L7H11Gnzw3KDbDo*MC2EY5dQL$*Jo%lc_w*y*cd9s`>tiqBY+ig2%81F{p*^ zU^Q8L>(wR&qo5?cEcz8q4{y4HrPw(pMFQQ}x5d|w|$a7#4559Al=6#v; zo;YSu=ObfR(>aV|@%YK*a@m}RN4_iS&J-Mehm=qvTQM4)854myI8l6UhfF^IsKia3 z6IW8%96O%{vn!WNdU#zo_UzoBhJ9kmGD>VXIaaLZ{Y02Uwr+p6UzYmn>Mv7rIkgap z!D!RSVdSQB%k@-bht@%zChEko${S0Q&%|o6dBgEfh_U^JDa?_|P0yc>@pvJJF*lv7 iIj9>i_g3G*N>eEQqZyXl`GwyUZt=Ipg@Xg-tN#H;Cl|;7 literal 0 HcmV?d00001 diff --git a/tests/fixtures/job-number-11-02-26/K557I55Y_I20H_XML.XML b/tests/fixtures/job-number-11-02-26/K557I55Y_I20H_XML.XML new file mode 100755 index 0000000..9d649bd --- /dev/null +++ b/tests/fixtures/job-number-11-02-26/K557I55Y_I20H_XML.XML @@ -0,0 +1,116 @@ + + +8.0 +Full Histogram +BE9557 +V 10.72-8.17 MiniMate Plus +K557I55Y.I20H +12:54:02 +2019-10-07 +12:54:28 +2019-10-07 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.4 Volts +January 18, 2019 by Instantel +in/s and dB(L) +Landmark - The Standard - Atherton Hotel +Landmark Constructors +Terra-Mechanics, Inc. - D. Bartholomae +Loc 2- Atherton Hotel - 125 S. Atherton + +10.000 +in/s + + +0.425 +in/s + + +0.010 +in/s + + +0.485 +in/s + + +>100 +Hz + + +>100 +Hz + + +>100 +Hz + +12:54:28 +2019-10-07 +12:54:28 +2019-10-07 +12:54:28 +2019-10-07 + +0.645 +in/s + +12:54:28 +2019-10-07 +Linear Weighting + +91.5 +dB(L) + +12:54:28 +2019-10-07 + +>100 +Hz + +7.9 Hz. +3.4 +Passed +7.4 Hz. +3.7 +Passed +7.7 Hz. +3.9 +Passed +20.1 Hz. +585 mv +Passed + + +2019-10-07 12:54:01 - 2019-10-07 12:54:28 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.425>1000.010>1000.485>1000.6450.00091.48>100 + + + + + + diff --git a/tests/fixtures/job-number-11-02-26/T438I4V5.DJ0H b/tests/fixtures/job-number-11-02-26/T438I4V5.DJ0H new file mode 100755 index 0000000000000000000000000000000000000000..9b25a4070ebe04466ed1aa005939bd1b8e58ccf5 GIT binary patch literal 1544 zcma)+QA}G^7{~t?Zr9ru=xxi8Ory6DxYY_~Mhtvw=FqIhxkXXQ@R%pgpAyaRo*B)x^ zu!7l_%AUmMJMf&ptIyZnhm-?M%~>rNuzzu226&b}wDEqeKiJ*f=jrMNx;j0*UesF5 zi~p~N67Of+{UgRCSsDu~q7aBpC%5y4y=Z3vmfAqosjURHuoI7YFztVH@SDl2FoPMN z!lg&JAnipooQMkJVkDl3O7bxwC@Rw@5J<#d6C+ALCS)lk#E%LANl}CjAs7iuM@3;I z9E){K1jdHQH5!iyUJS(~QKtBS@VszHiX7i79F`*_9G-F65)<9G4g6y zmLf?bfbtJ{s9Yi;CF3%JqLlP#74?Y~VYgSCQwb|lTsA(8+5B%Pq8t^Y!jZTlCP^DI z^%Q(Lt_ulxlb|R_Hwmr6tCNI4XZGV~I#_ht@dDbITN(o6XZ$?N z16(Hy6*zxNXg>YHcQ*?c7mCH=?|&{`zp++Y-zfjHdFKw#mUat1lgZ3kthTzkh6cNx zcaS-^&Ea%7c%HZ0?F|j}^>sFz&1$u99LI-JqTlCjaX?j9SMs@BCY#BoGnu)$xokF@ zpU>x43#%1XRZAs0|NH>Y=!La%#zV6(T4kPRX#FhDqI9rEqw8JAg~2M*6EzR(OvB7D z>I|Om-xiwRdGFih-25;3LZSG_wWaGfS4+1y%9~qvd3Mbu_}Cq0&T6yO8#GRrv(eSK zv$2tSt+`wTM^JWNBO)XMvRL?!U!R`vdEE}XT3N~Ea&zg-x%BL8dNxf^*=#PKFRZMt zt?4|B#=dr_x2zwILuLC9nq3&}H--&@k#r zDE*F;WM()8&SI);mT%uG^V|=q7l%4o4vd9jmW;fuR_tov?%k4}?c3s}{~|(D{{avA Bf)@Y) literal 0 HcmV?d00001 diff --git a/tests/fixtures/job-number-11-02-26/T438I4V5_DJ0H_XML.XML b/tests/fixtures/job-number-11-02-26/T438I4V5_DJ0H_XML.XML new file mode 100755 index 0000000..03c6b02 --- /dev/null +++ b/tests/fixtures/job-number-11-02-26/T438I4V5_DJ0H_XML.XML @@ -0,0 +1,117 @@ + + +8.0 +Full Histogram +BE18438 +V 10.72-8.17 MiniMate Plus +T438I4V5.DJ0H +16:48:55 +2019-10-01 +16:48:57 +2019-10-01 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.8 Volts +September 3, 2019 by Instantel +in/s and dB(L) +1 +Univ of Pitt - Scaife Hall-UPMC - Loc 2 +P J Dick, Inc. +Terra-Mechanics, Inc. - D. Harrison +Unit #2 - Station #2 - Loc 2 + +10.000 +in/s + + +0.550 +in/s + + +1.335 +in/s + + +0.270 +in/s + + +N/A +Hz + + +N/A +Hz + + +N/A +Hz + +16:48:57 +2019-10-01 +16:48:57 +2019-10-01 +16:48:57 +2019-10-01 + +1.394 +in/s + +16:48:57 +2019-10-01 +Linear Weighting + +114.4 +dB(L) + +16:48:57 +2019-10-01 + +51 +Hz + +7.5 Hz. +4.0 +Passed +7.5 Hz. +3.9 +Passed +7.6 Hz. +3.7 +Passed +0.0 Hz. +0 mv +Check + + +2019-10-01 16:48:54 - 2019-10-01 16:48:57 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.550N/A1.335N/A0.270N/A1.3940.002114.451 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index fc57beb..1dc7b6a 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -276,3 +276,30 @@ def test_an_imported_file_and_the_backfill_store_its_range(tmp_path): "--db-path", str(tmp_path / "seismo_relay.db"), "--force"]) == 0 with h5py.File(h5, "r") as f: assert f.attrs["geo_range"] == "sensitive" + + +# ── The job number ────────────────────────────────────────────────────────── +# Series IV's 0x1A layout again: report flags at k - 9 (bit 0x02 = job number +# shown) and the number, uint16 BE, at k - 8, kept while switched off. The flag +# matches Blastware's JobNumber on 2,997 / 2,997 DL2 events that print one and +# 66,986 / 66,986 that don't (measured 2026-11-02). Every printed value is 1; +# hidden ones hold real numbers (802, 1012, 1013, 622). + +@pytest.mark.parametrize("rel,enabled,number", [ + ("decode-checker-10-29-26/T1905KDW.5F0W", True, 1), # XML JobNumber 1 + ("job-number-11-02-26/T438I4V5.DJ0H", True, 1), # histogram, XML JobNumber 1 + ("job-number-11-02-26/K557I55Y.I20H", False, 802), # no JobNumber in the XML + ("decode-checker-10-29-26/R352HFZ7.530H", False, 1), +]) +def test_job_number_comes_from_the_file(rel, enabled, number): + pi = read_blastware_file(_FIX / rel).project_info + assert (pi.job_number_enabled, pi.job_number) == (enabled, number) + + +def test_the_h5_carries_the_job_number(tmp_path): + import h5py + from sfm import event_hdf5 + ev = read_blastware_file(_FIX / "job-number-11-02-26/K557I55Y.I20H") + event_hdf5.write_event_hdf5(tmp_path / "e.h5", ev, serial="BE9557") + with h5py.File(tmp_path / "e.h5", "r") as f: + assert (bool(f.attrs["job_number_enabled"]), int(f.attrs["job_number"])) == (False, 802) diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index d030611..b9848de 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -86,9 +86,8 @@ def test_an_extra_reference_row_is_a_mismatch_with_detail(): assert "row_length_disagreements=1" in res["samples.Tran"].detail -def test_job_number_na_and_above_range(): - res = _results("T1905KDW.5F0W") - assert res["JobNumber"].verdict == "sfm_blank" +def test_zc_frequency_na_and_above_range(): + res = _results("T1905KDW.5F0W") # its JobNumber: test_the_job_number_matches_blastware assert res["TranZCFreq"].verdict == "no_reference" # N/A assert res["VertZCFreq"].verdict == "sfm_blank" # >100, SFM has no flag yet @@ -172,3 +171,19 @@ def test_a_sensitive_range_event_now_matches(): for f in ("GeoRange", "TranPPV", "VertPPV", "LongPPV", "PeakVectorSum", "samples.Tran", "samples.Vert", "samples.Long"): assert res[f].verdict == "match", (f, res[f]) + + +def test_the_job_number_matches_blastware(): + assert _results("T1905KDW.5F0W", CARVEOUTS)["JobNumber"].verdict == "match" + + +def test_a_hidden_job_number_is_not_reported(): + # Flag off: Blastware prints no JobNumber, and SFM's side reports none either. + assert sfm_side((FIX / "R352HFZ7.530H").read_bytes()).job_number is None + + +def test_a_job_number_only_sfm_shows_is_a_mismatch(): + side = sfm_side((FIX / "R352HFZ7.530H").read_bytes()) + side.job_number = "1" + res = {r.field: r for r in compare(side, parse_xml_report_file(FIX / "R352HFZ7_530H_XML.XML"))} + assert res["JobNumber"].verdict == "mismatch" -- 2.54.1 From 99b6b315d62783204cb1aa6f01cfd6ad3118b9da Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 16:09:48 -0500 Subject: [PATCH 157/223] docs(changelog): Unreleased -- the job number from the file Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a9c68..855362f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,28 @@ All notable changes to seismo-relay are documented here. (`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored Sensitive events' peaks and `.h5` files. No schema change. +### Added +- **A Blastware file's job number, and whether Blastware shows it.** + - **Where it is:** the setup block has Series IV's `0x1A` layout here too. + The report flags sit at 9 bytes before the setup name, with bit `0x02` + meaning the job number is shown. The number is a uint16 BE at 8 bytes + before the name, and it is kept while switched off. + - **Measured:** the flag matches Blastware's JobNumber on 2,997 / 2,997 DL2 + events that print one, and 66,986 / 66,986 that don't. + - Every printed value is 1, so the value is only proven for 1. + - Hidden ones hold real numbers (802, 1012, 1013, 622). + - **`ProjectInfo.job_number_enabled` / `job_number`**, named as in + `micromate.setup_block`. + - **`write_event_hdf5`** stores both as `.h5` attributes when they were read. + - **Decode checker:** JobNumber 2,997 / 2,997, and 11 of 88 fields fully + match (was 10). 0 regressions. A job number only SFM shows now counts as a + mismatch. + - **Not in the database, the API or the PDF report yet.** That needs a + column. + - ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and + backfill (`backfill_sidecars.py` then `backfill_event_shape.py`). The new + `.h5` attributes are additive. No schema change, no migration. + ### Protocol / Documentation - **`docs/instantel_protocol_reference.md` gains Appendix D.6:** the bytes and DL2 verification for every field SFM reads from a Blastware event file. -- 2.54.1 From 2b886c4f396f230334268d26c7a3ee44dd37c595 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 16:17:44 -0500 Subject: [PATCH 158/223] refactor(sfm): move the page's JavaScript out of sfm_webapp.html into sfm/static/ (no code change) Stack-wide rule since 2026-11-02 (terra-view docs/tmi-stack.md, Terra-View's rule 4): no inline JavaScript, because a test cannot load it. This page's tests had to regex their code out of the HTML. Batch 2 edits both of the page's scripts, so they come out first, verbatim: - sfm/static/device_routing.js: the tested routing rules (157 lines) - sfm/static/sfm_webapp.js: the rest of the page (2,274 lines) The page loads them with - + +

+ + +
@@ -1243,11 +1253,12 @@
+
- +
diff --git a/sfm/static/device_routing.js b/sfm/static/device_routing.js index 512d066..e2f44a0 100644 --- a/sfm/static/device_routing.js +++ b/sfm/static/device_routing.js @@ -44,6 +44,9 @@ const DEVICE_ROUTES = { slow_drip: ['POST', '/device/stop_monitoring_slow_drip', false], call_home_read: ['GET', '/device/call_home', false], call_home_write: ['POST', '/device/call_home', false], + call_home_state: ['GET', '/device/call_home/state', true], + call_home_on: ['POST', '/device/call_home/enable', true], + call_home_off: ['POST', '/device/call_home/disable', true], config_write: ['POST', '/device/config', false], event_waveform: ['GET', '/device/event/{index}/waveform', false], event_file: ['GET', '/device/event/{index}/blastware_file', false], @@ -82,10 +85,13 @@ function controlsFor(unit) { startStop: serialMode && (series === 3 || series === 4), hangup: series === 4, diagnostics: series === 3, - callHomeRead: series === 3, + // by host, the legacy read is Series 3's; by serial, both series (phase 4) + callHomeRead: series === 3 || (serialMode && series === 4), + callHomeChange: serialMode && (series === 3 || series === 4), configWrite: false, callHomeWrite: false, - reasons: { configWrite: 'Coming in phase 5 (#46)', callHomeWrite: 'Coming in phase 4' }, + reasons: { configWrite: 'Coming in phase 5 (#46)', + callHomeWrite: 'By serial: use Call-home On / Off (audited). Other call-home fields wait for the THOR round.' }, }; } @@ -178,18 +184,28 @@ function deviceErrorText(status, body, unit, statusText) { return status === 504 && !(body || {}).sent && unit && unit.host ? `${text} — ${NO_REPLY_HINT}` : text; } -// A start/stop that went out (or may have) is not "failed": its body carries -// `sent` (ChangeUnconfirmed, bench finding #10), and its message says what the -// unit did and names the audit record. -function changeErrorText(verb, status, body, unit, statusText) { - if ((body || {}).sent) return `${verb} monitoring not confirmed: ${errorDetail(body, statusText)}`; - return `${verb} monitoring failed: ${deviceErrorText(status, body, unit, statusText)}`; +// A change that went out (or may have) is not "failed": its body carries `sent` +// (ChangeUnconfirmed, bench finding #10), and its message says what the unit +// did and names the audit record. `label` is the whole name: "Start monitoring", +// "Enable call-home". +function changeErrorText(label, status, body, unit, statusText) { + if ((body || {}).sent) return `${label} not confirmed: ${errorDetail(body, statusText)}`; + return `${label} failed: ${deviceErrorText(status, body, unit, statusText)}`; } // By serial, settings are read-only until phase 5: no empty legacy edit form or // legacy tables, and the settings box shows from the start (#6, #12). function serialPanes(bySerial, settingsRead) { return { configForm: !bySerial, settingsBox: bySerial, settingsPlaceholder: bySerial && !settingsRead, - legacyDeviceTables: !bySerial }; + legacyDeviceTables: !bySerial, callHomeForm: !bySerial, callHomeBox: bySerial }; +} + +// A unit's call-home switch, read by serial (phase 4). `enabled` null is an +// enable byte never measured -- shown with the byte, never as On or Off. +function callHomeRows(state) { + const s = state || {}; + const sw = s.enabled === true ? 'On' : s.enabled === false ? 'Off' + : `Unknown (byte 5 = ${(s.detail || {}).byte5 ?? '?'})`; + return [['Call-home', sw], ['Dial string', s.dial_string || '—'], ['Series', s.series]]; } /* */ diff --git a/sfm/static/sfm_webapp.js b/sfm/static/sfm_webapp.js index 0697cdd..1a707d4 100644 --- a/sfm/static/sfm_webapp.js +++ b/sfm/static/sfm_webapp.js @@ -96,11 +96,71 @@ function applyControls() { hw.disabled = !c.callHomeWrite; hw.title = c.reasons.callHomeWrite; const chr = document.getElementById('ch-read-btn'); chr.disabled = !c.callHomeRead; - const s4 = series === 4 ? 'Not yet available for Series 4' : ''; + const s4 = series === 4 && !c.callHomeRead ? "Series 4: type the unit's serial to read its call-home" : ''; chr.title = s4; document.getElementById('ch-series-note').textContent = s4; + for (const id of ['ch-on-btn', 'ch-off-btn']) { + document.getElementById(id).disabled = !c.callHomeChange || changeInFlight; + } setMonitorButtons(); applyConfigPanes(); + applyCallHomePanes(); +} + +// The Call Home tab by serial (phase 4): the unit's switch and audited On / Off; +// the legacy multi-field form is Series 3 by host only. +let callHomeShownFor = null; +function applyCallHomePanes() { + const serial = normSerial(currentUnit().serial); + const p = serialPanes(Boolean(serial), false); + document.getElementById('ch-legacy').style.display = p.callHomeForm ? '' : 'none'; + document.getElementById('ch-serial').style.display = p.callHomeBox ? 'block' : 'none'; + document.getElementById('ch-write-btn').hidden = !p.callHomeForm; + document.getElementById('ch-clear-btn').hidden = !p.callHomeForm; + if (p.callHomeBox && callHomeShownFor !== serial) { + callHomeShownFor = null; + renderTextTable('ch-state', [['Call-home', 'Not read yet — press Read from Device']]); + } +} + +// `quiet`: the re-read after a change -- the change's own result stays on screen. +async function readCallHomeBySerial({ quiet = false } = {}) { + const btn = document.getElementById('ch-read-btn'); + btn.disabled = true; + if (!quiet) setChStatus('Reading call-home from the unit…'); + try { + const st = await deviceFetch('call_home_state'); + renderTextTable('ch-state', callHomeRows(st)); + callHomeShownFor = normSerial(st.serial); + if (!quiet) setChStatus(`Call-home read from ${st.serial}.`, 'ok'); + } catch (e) { + if (!quiet) setChStatus(`Read failed: ${e.message}`, 'error'); + else renderTextTable('ch-state', [['Call-home', `Re-read failed: ${e.message}`]]); + } finally { + btn.disabled = false; + } +} + +// One audited send, never retried; the body says what the unit did. +async function changeCallHome(on) { + const serial = normSerial(currentUnit().serial); + const label = on ? 'Enable call-home' : 'Disable call-home'; + if (!confirm(`Turn call-home ${on ? 'ON' : 'OFF'} on ${serial}?`)) return; + changeInFlight = true; applyControls(); + setChStatus(`${label}…`); + try { + const r = await deviceRequest(on ? 'call_home_on' : 'call_home_off'); + const body = await r.json().catch(() => ({})); + setChStatus(body.outcome ? changeSummary(body) + : changeErrorText(label, r.status, body, currentUnit(), r.statusText), + r.ok ? 'ok' : 'error'); + } catch (e) { + // No reply is not "nothing sent": the request may have reached the unit. + setChStatus(`${label}: no reply from SFM (${e.message}) — it may have been sent; ` + + `check the unit's state and GET /db/device_commands`, 'error'); + } + changeInFlight = false; applyControls(); + await readCallHomeBySerial({ quiet: true }); } // The Config tab by serial (#6): settings are read-only until phase 5, so the @@ -444,7 +504,7 @@ async function changeMonitoring(action) { if (body.outcome) { setStatus(changeSummary(body), r.ok ? 'ok' : 'error'); } else { - setStatus(changeErrorText(verb, r.status, body, currentUnit(), r.statusText), 'error'); + setStatus(changeErrorText(`${verb} monitoring`, r.status, body, currentUnit(), r.statusText), 'error'); } } catch (e) { // No reply is not "nothing sent": the request may have reached the unit. @@ -862,6 +922,7 @@ function clearCallHomeForm() { async function readCallHome() { if (!devHost()) { setChStatus('Not connected.', 'error'); return; } + if (serialMode()) { await readCallHomeBySerial(); return; } setChStatus('Reading call home config from device…'); document.getElementById('ch-read-btn').disabled = true; try { @@ -2275,6 +2336,9 @@ document.getElementById('api-base').value = window.location.origin; for (const id of ['dev-serial', 'dev-host', 'dev-port']) { document.getElementById(id).addEventListener('input', () => { unitConfirmed = null; applyControls(); }); } +// New controls are wired here, not with onclick= in the HTML (no inline JS). +document.getElementById('ch-on-btn').addEventListener('click', () => changeCallHome(true)); +document.getElementById('ch-off-btn').addEventListener('click', () => changeCallHome(false)); applyControls(); // Reflect any persisted mic-unit preference in the header pill on load diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index 9686eba..37e3578 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -28,7 +28,8 @@ NODE = shutil.which("node") pytestmark = pytest.mark.skipif(NODE is None, reason="node is not installed; the page-logic tests need it") EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "settingsRows", "perIndexLive", "escapeHtml", - "changeSummary", "downloadSummary", "firmwareLabel", "deviceErrorText", "changeErrorText", "serialPanes"] + "changeSummary", "downloadSummary", "firmwareLabel", "deviceErrorText", "changeErrorText", "serialPanes", + "callHomeRows"] def _block() -> str: @@ -108,7 +109,8 @@ def test_controls_confirmed_series3(): def test_controls_confirmed_series4(): c = run(["controlsFor", [_with(S4, {"serial": "UM20147", "series": 4})]])[0] - assert (c["hangup"], c["startStop"], c["diagnostics"], c["callHomeRead"]) == (True, True, False, False) + # phase 4: by serial a Micromate's call-home reads through /device/call_home/state + assert (c["hangup"], c["startStop"], c["diagnostics"], c["callHomeRead"]) == (True, True, False, True) def test_controls_confirmation_drops_when_the_serial_changes(): @@ -124,11 +126,13 @@ def test_controls_a_legacy_identify_confirms_without_a_typed_serial(): assert s == 3 and c["diagnostics"] is True and c["startStop"] is False # start/stop needs a serial -def test_controls_writes_wait_for_phases_4_and_5(): +def test_controls_config_waits_for_phase_5_and_the_legacy_call_home_form_stays_off(): for unit in (_with(S3, {"serial": "BE9441", "series": 3}), _with(S4, {"serial": "UM20147", "series": 4})): c = run(["controlsFor", [unit]])[0] assert c["configWrite"] is False and c["callHomeWrite"] is False - assert c["reasons"] == {"configWrite": "Coming in phase 5 (#46)", "callHomeWrite": "Coming in phase 4"} + assert c["reasons"] == {"configWrite": "Coming in phase 5 (#46)", + "callHomeWrite": "By serial: use Call-home On / Off (audited). Other call-home " + "fields wait for the THOR round."} def test_change_summary(): @@ -272,10 +276,12 @@ def test_a_change_that_was_sent_is_not_called_failed(): # #10: a ChangeUnconfirmed body carries `sent`; anything else is a real failure. sent = {"detail": "start monitoring was sent and acknowledged, but reading the state back failed: x " "-- audit record c7", "sent": "acknowledged", "audit_id": "c7"} - r = run(["changeErrorText", ["Start", 504, sent, S3, "HTTP 504"]], - ["changeErrorText", ["Stop", 503, {**sent, "sent": "unknown"}, S3, "HTTP 503"]], - ["changeErrorText", ["Start", 504, {"detail": "the unit did not answer: no reply"}, S3, "HTTP 504"]], - ["changeErrorText", ["Stop", 409, {"detail": "not BE9441: BE12599 answered"}, S3, "HTTP 409"]]) + r = run(["changeErrorText", ["Start monitoring", 504, sent, S3, "HTTP 504"]], + ["changeErrorText", ["Stop monitoring", 503, {**sent, "sent": "unknown"}, S3, "HTTP 503"]], + ["changeErrorText", ["Start monitoring", 504, {"detail": "the unit did not answer: no reply"}, S3, + "HTTP 504"]], + ["changeErrorText", ["Stop monitoring", 409, {"detail": "not BE9441: BE12599 answered"}, S3, + "HTTP 409"]]) assert r[0] == f"Start monitoring not confirmed: {sent['detail']}" assert r[1] == f"Stop monitoring not confirmed: {sent['detail']}" assert r[2] == f"Start monitoring failed: the unit did not answer: no reply — {HINT}" @@ -287,6 +293,37 @@ def test_serial_mode_hides_the_legacy_forms(): # #6 / #12: by serial, settings are read-only until phase 5 -- no empty edit # form, no empty legacy tables; the settings box shows from the start. r = run(["serialPanes", [True, False]], ["serialPanes", [True, True]], ["serialPanes", [False, False]]) - assert r == [{"configForm": False, "settingsBox": True, "settingsPlaceholder": True, "legacyDeviceTables": False}, - {"configForm": False, "settingsBox": True, "settingsPlaceholder": False, "legacyDeviceTables": False}, - {"configForm": True, "settingsBox": False, "settingsPlaceholder": False, "legacyDeviceTables": True}] + serial = {"configForm": False, "settingsBox": True, "legacyDeviceTables": False, + "callHomeForm": False, "callHomeBox": True} + legacy = {"configForm": True, "settingsBox": False, "settingsPlaceholder": False, "legacyDeviceTables": True, + "callHomeForm": True, "callHomeBox": False} + assert r == [{**serial, "settingsPlaceholder": True}, {**serial, "settingsPlaceholder": False}, legacy] + + + +# ── Call home by serial (phase 4) ───────────────────────────────────────────── + +def test_call_home_routes_need_a_serial(): + r = run(["deviceUrl", ["call_home_on", BLANK]], ["deviceUrl", ["call_home_on", S4]], + ["deviceUrl", ["call_home_off", S3]], ["deviceUrl", ["call_home_state", S4]]) + assert r[0] is None + assert r[1] == {"method": "POST", "path": "/device/call_home/enable?serial=UM20147&host=h&tcp_port=9034"} + assert r[2] == {"method": "POST", "path": "/device/call_home/disable?serial=BE9441&host=h&tcp_port=9034"} + assert r[3] == {"method": "GET", "path": "/device/call_home/state?serial=UM20147&host=h&tcp_port=9034"} + + +def test_call_home_change_needs_a_confirmed_series(): + r = run(["controlsFor", [S3]], ["controlsFor", [_with(S3, {"serial": "BE9441", "series": 3})]], + ["controlsFor", [_with(S4, {"serial": "UM20147", "series": 4})]], + ["controlsFor", [_with(BLANK, {"serial": "BE9441", "series": 3})]]) + assert [c["callHomeChange"] for c in r] == [False, True, True, False] + + +def test_call_home_rows(): + r = run(["callHomeRows", [{"enabled": True, "dial_string": "RADIO RING", "series": 4}]], + ["callHomeRows", [{"enabled": False, "dial_string": None, "series": 3}]], + ["callHomeRows", [{"enabled": None, "dial_string": "RADIO RING", "series": 3, + "detail": {"byte5": "0x07"}}]]) + assert r[0] == [["Call-home", "On"], ["Dial string", "RADIO RING"], ["Series", 4]] + assert r[1] == [["Call-home", "Off"], ["Dial string", "—"], ["Series", 3]] + assert r[2][0] == ["Call-home", "Unknown (byte 5 = 0x07)"] -- 2.54.1 From 51e7dddcb34692285c959d339977793945a14300 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:07:04 -0500 Subject: [PATCH 169/223] test(micromate): corpus counts are floors, and 0x71 is the over-the-ceiling example Two test-side breaks, found by the full suite after phase-4 task 6: - test_micromate_framing's three whole-session tests pinned exact counts of a gitignored corpus (bridges/captures/9-24-26 - micromate2, a symlink into the main checkout). The full copy of the BW VM's captures on 2026-11-02 added sessions: 287 responses / 241 reads / 287 requests, every one passing the same per-frame checks. The counts are now floors (>= 251 / 218 / 251), so a lost file still fails and a grown corpus does not. - test_micromate_opcodes' beyond-the-ceiling permit took 0x7E, enableable since the call-home commit (eeb55ef); 0x71 (the setup write, phase 5) replaces it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/test_micromate_framing.py | 15 ++++++++++++--- tests/test_micromate_opcodes.py | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 3e72f81..0ea1b31 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -373,7 +373,10 @@ def test_whole_captured_sessions_parse_with_no_bad_checksums(): bad = [f for f in frames if not f.checksum_valid] assert not bad, f"{path.name}: {len(bad)} bad checksums" total += len(frames) - assert total == 251, f"expected 251 response frames across the corpus, got {total}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert total >= 251, f"expected at least 251 response frames across the corpus, got {total}" @pytest.mark.skipif( @@ -410,7 +413,10 @@ def test_builder_reproduces_every_captured_read_frame(): ) checked += 1 i = j + 1 - assert checked == 218, f"expected 218 read frames, checked {checked}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert checked >= 218, f"expected at least 218 read frames, checked {checked}" # ── the data section (writes) ───────────────────────────────────────────────── @@ -523,4 +529,7 @@ def test_builder_reproduces_every_captured_request_frame_including_writes(): ) checked += 1 i = j + 1 - assert checked == 251, f"expected 251 request frames, checked {checked}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert checked >= 251, f"expected at least 251 request frames, checked {checked}" diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py index 6b68e35..d5b3f4e 100644 --- a/tests/test_micromate_opcodes.py +++ b/tests/test_micromate_opcodes.py @@ -98,7 +98,7 @@ def test_an_unknown_opcode_is_refused_and_nothing_is_written(sub): assert t.written == [] -@pytest.mark.parametrize("sub", [0xEE, 0x7E, 0xA8]) +@pytest.mark.parametrize("sub", [0xEE, 0x71, 0xA8]) # 0x71 (setup write) stays above the ceiling until phase 5 def test_a_permit_beyond_the_ceiling_is_refused_at_the_wire(sub): p, t = proto([]) with pytest.raises(OpcodeRefused): -- 2.54.1 From 3e1d42e04bb3d580f0401f1792601784d5e52d68 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:07:36 -0500 Subject: [PATCH 170/223] docs: phase 4 built -- call-home enable/disable by serial; bench questions Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 4 ++++ .../2026-10-20-sfm-series4-parity-design.md | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index bd257a4..e71c933 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -236,6 +236,10 @@ Read this first when picking the project back up. `3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write encoder refuses a patch that would not read back -- its offsets are 1024-sps raw ones, #46). + **Phase 4 built 2026-11-02, not yet benched:** call-home on/off by serial for + both series (`GET /device/call_home/state`, `POST /device/call_home/{enable,disable}`, + the page's Call Home tab). The MiniMate frame is Blastware's byte for byte + (`tests/test_s3_call_home_bw_frames.py`, the 4-20-26 captures). **Ring path measured the same night:** with THOR's watchdog off, a call-home reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- the unit takes SFM's connection for the call, times out and does not retry. diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 8d2a104..847772e 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -560,7 +560,21 @@ Each safety piece arrives with its first real use, so nothing sits untested. experiment. - **Refuse writes unless this connection's responses carried Micromate flags** (0xC5/0x03), alongside the serial identity check. -4. **Call-home enable/disable** (row 9). +4. **Call-home enable/disable** (row 9). **Built 2026-11-02** (plan + `docs/superpowers/plans/2026-11-02-sfm-phase4-call-home.md`): `run_change` takes a + `ChangeKind` (`1dd5bfa`); Series 4 reads bit 0 of `0x2C` content[5] and sends + `plan_call_home_enabled` (`eeb55ef`; `ENABLEABLE_WRITES` gains `0x7E`/`0x7F`); + Series 3 reads byte 5 of the *unescaped* block and sends `call_home_image` + (`8612cd9`). The Series-3 frame was gated until reproduced from Blastware: its + 2026-04-20 enable and disable writes (BE11529) are rebuilt byte for byte from the + unit's own reads (`453d42e`), so the gate is open. Routes `GET + /device/call_home/state`, `POST /device/call_home/{enable,disable}`, serial + required (`06fa56d`); the page's Call Home tab by serial (`84c142f`). The + read-back judges the edited bit; the snapshot keeps both blocks and every changed + offset (Series 4's `[118:120]` always moves). **Not yet at the bench.** Bench + questions, one send per go: does a Micromate accept a no-op call-home write + (`even_if_already`)? Does UM20147 accept `0x00` at `[5]` (THOR only ever wrote + `0x04`/`0x05`)? Does either series take a call-home write while monitoring? 5. **Setup push** (row 10): one field first, then several. Each phase is its own implementation plan. **All phases land on -- 2.54.1 From bdd76b8f740070c348e9dcf1824080a1e43a217d Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:23:59 -0500 Subject: [PATCH 171/223] fix(minimateplus): a built call-home image is framed once, never unescaped again (phase-4 review) call_home_image returns the unescaped N + 2 image, but the send path handed it to write_call_home_config, whose write_image unescapes again -- and unescaping is not idempotent: a real 0x10 before 02/03/04 loses its 0x10. A call-in time of 16:02-16:04 (hour 0x10) is exactly that. One such time made the send refuse before the wire yet audited as 'sent, acknowledgement lost'; two made it send a block shifted by two bytes from [101] (num_retries and the time fields wrong). The Blastware-frame test could not see it: it checked the image builder, not the bytes the protocol framed. - MiniMateProtocol.write_call_home_image(image) frames a built image once (0x7E, ack 0x81, 0x7F, ack 0x80), raising ImageRefused before any byte when it is not a whole block; write_call_home_config (the legacy multi-field path) is write_image once + that. Its stale 127-byte docstring is gone. - MiniMateClient.write_call_home_image uses it. - The Series-3 change passes is_refusal=ImageRefused, so a pre-wire refusal is audited as nothing sent (sent = 0), not as a lost ack. Tests drive the real client -> protocol over a stub answering with BE11529's recorded acks: the unit's own read, a 16:02 time, and 16:03 + 16:04 all go out exactly as built; a short image is refused with nothing written. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/client.py | 6 +- minimateplus/protocol.py | 67 +++++++++-------- sfm/device_access/s3.py | 6 +- tests/test_s3_call_home.py | 18 +++++ tests/test_s3_call_home_wire.py | 125 ++++++++++++++++++++++++++++++++ 5 files changed, 186 insertions(+), 36 deletions(-) create mode 100644 tests/test_s3_call_home_wire.py diff --git a/minimateplus/client.py b/minimateplus/client.py index dc8d04e..c17a55a 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -1134,8 +1134,10 @@ class MiniMateClient: def write_call_home_image(self, image: bytes) -> None: """Send a `0x7E` image (`call_home_image`) and its `0x7F` confirm, each ack - checked. No retry: what happened is the caller's to read back.""" - self._require_proto().write_call_home_config(image) + checked -- framed once, never unescaped again. Raises ImageRefused before + any byte goes out for an image that is not a whole block. No retry: what + happened is the caller's to read back.""" + self._require_proto().write_call_home_image(image) def set_call_home_config( self, diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index befd4ee..65ebeb3 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -165,6 +165,10 @@ def write_image(sub: int, data: bytes) -> bytes: return image +class ImageRefused(ValueError): + """A write refused before any byte was sent: the image is not a whole block.""" + + def call_home_enabled(raw: bytes) -> Optional[bool]: """The call-home switch of a `0x2C` reply payload, read UNESCAPED (an escaped byte before it would move the raw index -- bench finding #1's lesson): byte 5, @@ -1172,41 +1176,40 @@ class MiniMateProtocol: def write_call_home_config(self, data: bytes) -> None: """ - Write the auto call home configuration (SUB 0x7E → 0x7F confirm). + Write the call-home block as a read returned it (SUB 0x7E, then 0x7F). - Write sequence (confirmed from 4-20-26 call home settings captures): - SUB 0x7E write 127-byte payload → device acks SUB 0x81 - SUB 0x7F confirm (no data) → device acks SUB 0x80 - - The 127-byte write payload = 125-byte read payload + b'\\x00\\x00'. - The offset field = data[1] + 2 = 0x7C + 2 = 0x7E = 126. - - Write frame format: build_bw_write_frame (minimal DLE stuffing — only - BW_CMD is doubled; all other bytes are RAW). The \\x10\\x03 sequence - within the payload is preserved as-is (device interprets DLE+ETX as the - literal value 0x03 per the inner-frame terminator convention). - - Args: - data: 127-byte write payload (read payload + \\x00\\x00 footer). - Must start with [0x00][0x7C][...] (standard header). - - Raises: - ValueError: if data is not exactly 127 bytes or lacks expected header. - ProtocolError: on timeout or wrong response SUB. + `data` is the 0x2C read payload (125 B, the parser's kept escape bytes + in -- num_retries 3 arrives as 10 03), optionally + 00 00. `write_image` + removes the escapes once and makes the 126-byte image (N = 0x7C, + 2); + `write_call_home_image` sends it. The legacy multi-field path. """ - rsp_sub_confirm = _expected_rsp_sub(SUB_CALL_HOME_CONFIRM) # 0xFF - 0x7F = 0x80 - # 2026-10-27 (#46): the read payload holds the parser's kept escape bytes - # (num_retries 3 arrives as 10 03); write_image removes them, so the - # 127-byte "read + 00 00" goes out as its 126-byte image (N = 0x7C, + 2), - # escaped like every request. No Blastware call-home write is on record - # here to compare against -- inferred from the 77 other write frames. - self._write_block(SUB_CALL_HOME_WRITE, data) - log.debug("write_call_home_config: write acked; sending confirm 0x7F") + self.write_call_home_image(write_image(SUB_CALL_HOME_WRITE, data)) - confirm_frame = build_bw_write_frame(SUB_CALL_HOME_CONFIRM, b"") - self._send(confirm_frame) - self.recv_write_ack(expected_sub=rsp_sub_confirm) - log.debug("write_call_home_config: confirm acked — done") + def write_call_home_image(self, image: bytes) -> None: + """ + Send a call-home image that is already built (`call_home_image`: + unescaped, N + 2 bytes) -- 0x7E, ack 0x81, then the 0x7F confirm, ack 0x80. + + Never through `write_image` again: unescaping is not idempotent, and a + real 0x10 before 02/03/04 in the image -- a call-in time of 16:02-16:04 + -- would lose its 0x10 (phase-4 final review, 2026-11-02). Measured: the + frames equal Blastware's 2026-04-20 enable / disable writes (BE11529), + tests/test_s3_call_home_bw_frames.py and test_s3_call_home_wire.py. + + Raises ImageRefused, before any byte is sent, unless the image is a whole + block: its header N plus the two trailing bytes. + """ + image = bytes(image) + n = int.from_bytes(image[:2], "big") if len(image) >= 2 else -1 + if len(image) != n + 2: + raise ImageRefused(f"write SUB 0x{SUB_CALL_HOME_WRITE:02X}: {len(image)} bytes, but its " + f"header says {n} (+ 2) -- not a whole image; nothing sent") + self._send(build_bw_write_frame(SUB_CALL_HOME_WRITE, image)) + self.recv_write_ack(expected_sub=_expected_rsp_sub(SUB_CALL_HOME_WRITE)) + log.debug("write_call_home_image: write acked; sending confirm 0x7F") + self._send(build_bw_write_frame(SUB_CALL_HOME_CONFIRM, b"")) + self.recv_write_ack(expected_sub=_expected_rsp_sub(SUB_CALL_HOME_CONFIRM)) + log.debug("write_call_home_image: confirm acked — done") # ── Monitoring ──────────────────────────────────────────────────────────── diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 6e5b6ed..2fd16ef 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -13,7 +13,7 @@ from minimateplus.event_file_io import _GEO_INT16_FS from minimateplus.framing import build_bw_write_frame, unescape_reply from minimateplus.protocol import ( SUB_CALL_HOME_CONFIRM, SUB_CALL_HOME_WRITE, SUB_START_MONITORING, SUB_STOP_MONITORING, - call_home_enabled, call_home_image, write_image, + ImageRefused, call_home_enabled, call_home_image, write_image, ) from minimateplus.transport import TcpTransport @@ -418,7 +418,9 @@ class Series3Adapter: even_if_already=even_if_already, audit=audit, address=address, caller=caller, sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s, read_serial=read_serial, read_state=read_state, - describe_plan=describe_plan, send=send, snapshot=snapshot) + describe_plan=describe_plan, send=send, snapshot=snapshot, + # raised before the frame goes out: audited as nothing sent + is_refusal=lambda e: isinstance(e, ImageRefused)) return self._run(address, op, retry=False) def settings(self, address: UnitAddress, serial: str) -> UnitSettings: diff --git a/tests/test_s3_call_home.py b/tests/test_s3_call_home.py index d9271a4..c72c3c5 100644 --- a/tests/test_s3_call_home.py +++ b/tests/test_s3_call_home.py @@ -127,3 +127,21 @@ def test_s3_dry_run_with_an_unknown_byte_5_shows_no_frames(): fake = FakeMiniMateClient(call_home_raw=s3_call_home_raw(0x07)) r = change(adapter(fake), enabled=False, dry_run=True) assert r.plan["steps"] == [] and any("0x07" in w for w in r.plan["warnings"]) + + + +def test_a_pre_wire_refusal_is_recorded_as_nothing_sent(): + # Final review #2: a refusal raised before the frame went out must not be + # audited as "sent, acknowledgement lost". + from minimateplus.protocol import ImageRefused + audit = Audit() + fake = FakeMiniMateClient(write_error=ImageRefused("write SUB 0x7E: not a whole block")) + from sfm.device_access.errors import DeviceError + with pytest.raises(DeviceError) as e: # the adapter wraps it, as it does OpcodeRefused + adapter(fake).change_call_home(TCP, "BE18193", enabled=False, dry_run=False, even_if_already=False, + audit=audit, caller="test", sleep=lambda s: None, + verify_timeout_s=3.0, verify_interval_s=1.0) + assert isinstance(e.value.__cause__, ImageRefused) + ((_, row),) = audit.rows.items() + assert (row["outcome"], row["sent"]) == ("failed", 0) + assert row["error"].startswith("refused before sending") diff --git a/tests/test_s3_call_home_wire.py b/tests/test_s3_call_home_wire.py new file mode 100644 index 0000000..70e0cbc --- /dev/null +++ b/tests/test_s3_call_home_wire.py @@ -0,0 +1,125 @@ +"""The MiniMate call-home send path frames the built image exactly once +(phase-4 final review #1, 2026-11-02). + +`call_home_image` is already unescaped; passing it through `write_image` again +strips any real 0x10 that precedes 02/03/04 -- a call-in time of 16:02-16:04 +(hour 0x10) is exactly that. One such time made the send refuse; two made it +send a block shifted by two bytes. Driven through the real MiniMateClient -> +MiniMateProtocol over a stub answering with the unit's recorded acks (BE11529, +2026-04-20). +""" +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import minimateplus.protocol as mp # noqa: E402 +from minimateplus.client import MiniMateClient # noqa: E402 +from minimateplus.framing import S3FrameParser, build_bw_write_frame # noqa: E402 +from minimateplus.protocol import ( # noqa: E402 + SUB_CALL_HOME, SUB_CALL_HOME_CONFIRM, SUB_CALL_HOME_WRITE, call_home_image, write_image, +) +from test_minimate_write_frames import _payload # noqa: E402 + +FIX = Path(__file__).parent / "fixtures" / "s3-call-home-bw" + + +def _recorded_ack(path: Path, ack_sub: int) -> bytes: + raw, start, p = path.read_bytes(), 0, S3FrameParser() + for i in range(len(raw)): + for f in p.feed(raw[i:i + 1]): + w = raw[start:i + 1] + if f.sub == ack_sub: + return w[w.index(b"\x10\x02"):] + start = i + 1 + raise AssertionError(f"no 0x{ack_sub:02X} ack in {path.name}") + + +ENABLE_S3 = FIX / "raw_s3_20260420_162221_enable_auto_call_home.bin" +ACKS = {SUB_CALL_HOME_WRITE: _recorded_ack(ENABLE_S3, 0xFF - SUB_CALL_HOME_WRITE), + SUB_CALL_HOME_CONFIRM: _recorded_ack(ENABLE_S3, 0xFF - SUB_CALL_HOME_CONFIRM)} + + +class Acks: + def __init__(self): + self.sent, self._buf = [], b"" + + def write(self, data): + data = bytes(data) + self.sent.append(data) + self._buf += ACKS[_payload(data)[2]] + + def read(self, n): + out, self._buf = self._buf[:n], self._buf[n:] + return out + + +def _client(): + t = Acks() + c = MiniMateClient("unused") + c._proto = mp.MiniMateProtocol(t) + return c, t + + +def _fixture_read() -> bytes: + p = FIX / "raw_s3_20260420_162148_pull_call_home_options.bin" + return [bytes(f.data)[11:] for f in S3FrameParser().feed(p.read_bytes()) + if f.sub == 0xFF - SUB_CALL_HOME and len(f.data) > 100][-1] + + +def _as_read(logical: bytes) -> bytes: + """A block as S3FrameParser returns it: each 02/03/04 keeps its 10 escape + (a logical 0x10 arrives as 10 10, which the parser collapses to one 10).""" + out = bytearray() + for b in logical: + out += bytes([0x10, b]) if b in (0x02, 0x03, 0x04) else bytes([b]) + return bytes(out) + + +def _with_times(t1: bytes, t2: bytes = None) -> bytes: + logical = bytearray(write_image(SUB_CALL_HOME_WRITE, _fixture_read())[:-2]) # the N = 124 bytes + logical[101:103] = t1 + if t2 is not None: + logical[105:107] = t2 + return _as_read(bytes(logical)) + + +def _frames(image): + return [build_bw_write_frame(SUB_CALL_HOME_WRITE, image), build_bw_write_frame(SUB_CALL_HOME_CONFIRM, b"")] + + +@pytest.mark.parametrize("enabled", [True, False]) +def test_the_units_own_read_goes_out_framed_once(enabled): + c, t = _client() + image = call_home_image(_fixture_read(), enabled) + c.write_call_home_image(image) + assert t.sent == _frames(image) + + +def test_a_16_02_call_in_time_is_sent_as_read(): + raw = _with_times(b"\x10\x02") + image = call_home_image(raw, False) + assert image[101:103] == b"\x10\x02" # the image itself is right + c, t = _client() + c.write_call_home_image(image) + assert t.sent == _frames(image) + + +def test_two_such_times_are_not_shifted(): + raw = _with_times(b"\x10\x03", b"\x10\x04") + image = call_home_image(raw, True) + c, t = _client() + c.write_call_home_image(image) + assert t.sent == _frames(image) + + +def test_a_malformed_image_is_refused_before_the_wire(): + c, t = _client() + with pytest.raises(mp.ImageRefused): + c.write_call_home_image(call_home_image(_fixture_read(), True)[:-1]) + assert t.sent == [] -- 2.54.1 From 9e03b3f0abae73013a79ddaf67061353c3c154f3 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:23:59 -0500 Subject: [PATCH 172/223] fix(sfm): a Micromate in an unknown run state gets no call-home write, and a lost ack keeps its snapshot (phase-4 review) - s4_change_call_home's read_state now returns an unknown(0xNN) run state as it is, so the change core refuses it (UnitStateUnknown, nothing sent), as start/stop already does; it checked only for calling_home. - run_change records the snapshot on the lost-ack path too: after an ack is lost, what the unit now holds (and, on Series 4, whether [118:120] moved) is what tells whether the write landed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/device_access/change.py | 9 +++++++-- sfm/device_access/s4.py | 5 +++-- tests/test_device_access_s4_call_home.py | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/sfm/device_access/change.py b/sfm/device_access/change.py index ebabd18..17b2660 100644 --- a/sfm/device_access/change.py +++ b/sfm/device_access/change.py @@ -207,13 +207,18 @@ def run_change(*, kind: ChangeKind, serial: str, series: int, dry_run: bool, eve outcome="failed", verified="not_checked", ack=None, error=f"no clean ack: {exc}; the unit is now calling home", states=states([before], after)) + lost_detail: Dict[str, Any] = {"error": f"no clean ack: {exc}"} + lost_states = states([before], after) + snap = _take_snapshot(snapshot) # what the unit holds is what tells whether it landed + if snap is not None: + lost_detail["snapshot"] = lost_states["snapshot"] = snap finish(f"{action} was sent but the acknowledgement was lost ({exc}); the unit " f"now reads {after}", outcome="failed", verified="not_checked", ack=None, - error=f"no clean ack: {exc}", sent=SENT_UNKNOWN, states=states([before], after)) + error=f"no clean ack: {exc}", sent=SENT_UNKNOWN, states=lost_states) return ChangeResult(dry_run=False, sent=True, outcome="failed", verified="not_checked", state_after=after, audit_id=cid, - detail={"error": f"no clean ack: {exc}"}, **base) + detail=lost_detail, **base) seen = [before] diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index fcf1ebb..b0a881a 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -403,8 +403,9 @@ def s4_change_call_home(client: Any, serial: str, *, enabled: bool, dry_run: boo planned: list = [] def read_state() -> str: - if client.read_run_state().name == "calling_home": - return "calling_home" + run = client.read_run_state().name + if run == "calling_home" or run.startswith("unknown"): + return run # the core refuses both; a write waits for a known state block = client.get_call_home_content() reads.append(block) return "enabled" if block[5] & 0x01 else "disabled" diff --git a/tests/test_device_access_s4_call_home.py b/tests/test_device_access_s4_call_home.py index 564d27f..6711810 100644 --- a/tests/test_device_access_s4_call_home.py +++ b/tests/test_device_access_s4_call_home.py @@ -94,3 +94,23 @@ def test_s4_even_if_already_sends_the_no_op_write(): r = change(fake, enabled=True, even_if_already=True) assert len(fake.executed) == 1 assert any("changes nothing" in w for w in r.plan["warnings"]) + + + +def test_s4_unknown_run_state_sends_nothing(): + # Final review #3: a run state never measured is refused, as start/stop does. + from sfm.device_access.errors import UnitStateUnknown + fake = FakeMicromateClient(run_states=[0x07]) + with pytest.raises(UnitStateUnknown): + change(fake, enabled=False) + assert fake.executed == [] + + +def test_a_lost_ack_still_records_what_the_unit_holds(): + # Final review #4: the lost-ack path is where the operator most needs it. + import micromate.protocol as mm_proto + fake = FakeMicromateClient(execute_error=mm_proto.TimeoutError("lost")) + r = change(fake, enabled=False) + assert (r.outcome, r.sent) == ("failed", True) + snap = r.detail["snapshot"] + assert snap["changed_offsets"] == [] and snap["before"] == snap["after"] # the write did not land -- 2.54.1 From 9820a5389f1604f123483a2309d8dcc38e70f911 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:24:13 -0500 Subject: [PATCH 173/223] docs(spec): phase 4's final review -- what it caught before the bench Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../specs/2026-10-20-sfm-series4-parity-design.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index 847772e..fb25005 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -571,7 +571,12 @@ Each safety piece arrives with its first real use, so nothing sits untested. /device/call_home/state`, `POST /device/call_home/{enable,disable}`, serial required (`06fa56d`); the page's Call Home tab by serial (`84c142f`). The read-back judges the edited bit; the snapshot keeps both blocks and every changed - offset (Series 4's `[118:120]` always moves). **Not yet at the bench.** Bench + offset (Series 4's `[118:120]` always moves). The final review, before any send, + caught the Series-3 send path unescaping the built image a second time -- a + 16:02-16:04 call-in time would have been refused as 'sent' or sent shifted -- + fixed with a test through the real protocol (`bdd76b8`), plus a pre-wire refusal + audited as nothing sent, an unknown Series-4 run state refused, and the snapshot + kept on a lost ack (`9e03b3f`). **Not yet at the bench.** Bench questions, one send per go: does a Micromate accept a no-op call-home write (`even_if_already`)? Does UM20147 accept `0x00` at `[5]` (THOR only ever wrote `0x04`/`0x05`)? Does either series take a call-home write while monitoring? -- 2.54.1 From dd9f6dde7a47f28e44c5efc9e923d059cc33e236 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 11:32:57 -0500 Subject: [PATCH 174/223] docs(changelog): Unreleased -- histograms go to the histogram codec Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 855362f..d7d8e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,38 @@ All notable changes to seismo-relay are documented here. - ⚠ **Codec change: bump `TOOL_VERSION` at the next release.** The backfill (`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored Sensitive events' peaks and `.h5` files. No schema change. +- **Histograms go to the histogram codec, and a loud interval no longer hides + a short one.** These were the histograms the decode checker found decoding + wrongly. + - **The codec now follows the record type.** The file decoder used to try the + waveform codec first, whatever `STRT[18]` said. That codec accepted BE9440, + BE9557 and BE17354's 2018 5 s histograms and returned about 5× too many + "samples" (K440HDXX.XH0H: 44,504 against Blastware's 6,976). Only an + unknown type still falls back to trying both, and a chosen codec that + fails is now a decode problem rather than a silent switch. + - **A loud interval no longer breaks the sub-minute layout check.** The check + required each record's "zero word" to be `0000`. That word is the high word + of the interval's PVS², which is non-zero above 1.28 in/s, so a one-block + histogram with a loud interval decoded to nothing (T193KR5M.X90H, + K440HA3C.JM0H, R352HFZ7.530H). + - The check is now the measured relation peak ≤ PVS ≤ √3·peak. It holds + on 34,502,955 / 34,502,955 DL2 sub-minute intervals. + - The trim for a stream with no terminal tail uses the same test. + - **New decode-checker carve-out, `interval-count-is-duration`.** Blastware's + "Number of Intervals" is (stop − start) / interval. When the unit never + wrote the last minute, Blastware's own interval table lists one block + fewer, and SFM matches the table. It covers 8 events. + - **Decode checker:** 462 comparisons fixed, 0 regressions, 16 of 88 fields + fully match (was 11). + - Every DL2 histogram's Tran / Vert / Long interval peaks now match + Blastware (bar the clipped intervals the saturation carve-out covers). + - Channels 70,042 / 70,042. + - Histogram start dates a day off: 26 → 9. + - Peak vector sum mismatches: 45 → 18. + - ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and + backfill (`backfill_sidecars.py` then `backfill_event_shape.py`). Those + files are stored wrongly on prod today, and the backfill rewrites them. No + schema change. ### Added - **A Blastware file's job number, and whether Blastware shows it.** -- 2.54.1 From 8a40eb638a37eaf6cd568288ab146c22ce5f6620 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 12:10:44 -0500 Subject: [PATCH 175/223] fix(decode): a Blastware file's footer is its last 26 bytes -- no more day-late histograms Every DL2 file ends in a valid footer: 0e 08 and two valid times on 70,041 / 70,041. The decoder took the first '0e 08 + plausible year' instead, and 14 files also hold an earlier record, ~1.1 KB before the end, with the stop time followed by zeros: - a histogram started at its own stop -- a day late on BE9558's daily histograms (K558L9XP.FK0H: 2025-10-08 19:10:01 for Blastware's 2025-10-07 19:14:08); T003LCYV.JD0H got no time at all; - a waveform lost its stop, so the trigger was never computed and the stop was stamped instead (K440I4LG.JK0W: 11:14:12 for 11:14:08). The last 26 bytes are now taken when they are a footer; otherwise the old search stands unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/event_file_io.py | 44 +- tests/fixtures/footer-11-03-26/K440I4LG.JK0W | Bin 0 -> 10250 bytes tests/fixtures/footer-11-03-26/K558L9XP.FK0H | Bin 0 -> 47754 bytes tests/fixtures/footer-11-03-26/T003LCYV.JD0H | Bin 0 -> 6504 bytes .../footer-11-03-26/T003LCYV_JD0H_XML.XML | 548 ++++++++++++++++++ tests/test_bw_file_fields.py | 30 + 6 files changed, 606 insertions(+), 16 deletions(-) create mode 100755 tests/fixtures/footer-11-03-26/K440I4LG.JK0W create mode 100755 tests/fixtures/footer-11-03-26/K558L9XP.FK0H create mode 100755 tests/fixtures/footer-11-03-26/T003LCYV.JD0H create mode 100755 tests/fixtures/footer-11-03-26/T003LCYV_JD0H_XML.XML diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index f2a6dfa..0dbc16c 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -1098,22 +1098,34 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # Footer: locate the 0e 08 marker, validating the year is in a sane range. body_start = _bw._WAVEFORM_HEADER_SIZE + 21 - # The 0e 08 + plausible-year footer signature can occur inside the sample - # stream. Collect every candidate and prefer the first whose body yields a - # waveform record chain terminating on the 0x06 marker; fall back to the - # first candidate otherwise. Blast radius measured 2026-08-25: changes the - # chosen footer on exactly 1 of 1,388 series-3 waveform files - # (BE17353/S353L4O5.OX0W, false positive at 3800, real footer at 8576). - footer_candidates = [] - pos = body_start - while True: - pos = raw.find(b"\x0e\x08", pos) - if pos < 0 or pos + 26 > len(raw): - break - yr = (raw[pos + 4] << 8) | raw[pos + 5] - if 2015 <= yr <= 2050: - footer_candidates.append(pos) - pos += 1 + # The footer is the file's last 26 bytes whenever they are one -- 0e 08 and + # two valid times: 70,041 / 70,041 DL2 files (measured 2026-11-03). Taking + # the first "0e 08 + plausible year" instead found, on 14 of them, an + # earlier record ~1.1 KB before the end holding the stop time and zeros: a + # histogram then started at its own stop (a day late on BE9558's daily + # histograms) and a waveform lost its stop, so its trigger time too. + # + # Otherwise the search below stands. The signature can occur inside the + # sample stream, so it prefers the first candidate whose body yields a + # waveform record chain terminating on the 0x06 marker, then the first + # candidate (2026-08-25: BE17353/S353L4O5.OX0W, false positive at 3800, + # real footer at 8576). + end = len(raw) - 26 + if (end >= body_start and raw[end:end + 2] == b"\x0e\x08" + and _bw._decode_ts_be(raw[end + 2:end + 10]) is not None + and _bw._decode_ts_be(raw[end + 10:end + 18]) is not None): + footer_candidates = [end] + else: + footer_candidates = [] + pos = body_start + while True: + pos = raw.find(b"\x0e\x08", pos) + if pos < 0 or pos + 26 > len(raw): + break + yr = (raw[pos + 4] << 8) | raw[pos + 5] + if 2015 <= yr <= 2050: + footer_candidates.append(pos) + pos += 1 footer_pos = -1 for cand in footer_candidates: diff --git a/tests/fixtures/footer-11-03-26/K440I4LG.JK0W b/tests/fixtures/footer-11-03-26/K440I4LG.JK0W new file mode 100755 index 0000000000000000000000000000000000000000..7537a4b07b175498629505c88db4b9eb888364ec GIT binary patch literal 10250 zcma)?dvG0BeaFwaT3Ofj)!nmKiYtPmyZ2rN1UR;Ir4SSHa4b0qB?%#Zz%VJrI0|uV z>@;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03-26/K558L9XP.FK0H b/tests/fixtures/footer-11-03-26/K558L9XP.FK0H new file mode 100755 index 0000000000000000000000000000000000000000..e9d1aebb725c1218d585429013cb28b89a907504 GIT binary patch literal 47754 zcma*wd7w>I-v{u0&e{8%bLV?anc|w~nGBg{GS8WBTwKG&rOYB_Rv9vjkS2wYIikpL zQ}uNGp;)|uET?diz5tLGQQ-; z@Q}x|iSk!ehlk0d)cJKC504-ZTiHc?!M*TEa>oh_ulqVYiaccH6yCTMJeu6GG6>Jv z0v_Y>Sm94r!ehxpRvzK6UWLbzJL>wJxDSu_xGX&qN-ya){$E@gY1jd88E~yz49QEacHvobcv-;LnhUtgOP<&VpwpNBQ}h!n2Xv z>i*3f2hUC(wB+@h`#d}cxnpG%pTD{UJSTaiy8rij!k;A%T5jvL0=F*1b9r1|pP}*a z+~kfrz5}}cB$9_z{cd9;J`Z`&iV>fGUDwaNTy~B@{WNQBac$`FWwI?PLB39Uwa91^uN1e5MPoU{qL|J;ibrf>iT6~1~2XL zOyc_VTL3RZ9D;loG2iZP)6oXgtc(geGX1aY=CP({UtlM`LkLMEci@T%z=gD#XA02~N zCAU@k>R13?joeY==UXqstCNS+`2FM{yau_W>i<$*KWmcPs{P&^j`&*S7+;p_{<}6g z#`jwf5MPHJ<4;N*cwLXn_SIh3uX^MmRew%RLVSIX%lzZYHFyK^pe5_~KiS|7$x%NC zW`Z~JxU4@jj=&p}JC>|J6UxG0AV+@E@DjWUInHli2;S7=GC!Ex8s5y~GQX;p4sT8# zsqXK^g76j|m;GbWo$!|AxIPbc`)x%YQvJh#e-PiAJgBbEgHPdY$Rkw!Uw$6m)^IgG zB)aX(Nl%5hGhDRqXw|>Yx(;t|xQZ9|&rZDy?_juycP!a{7nOm(=<%YWeYe;7ZAbEu zC5|t!^;g7qA`h$UlVJk9GkJs>|NXn*UC1$hz492|mE2L~kKX|AMjlrAd5#Y7?&Rpd zXAXiVk-PO$oL~LA@R!I@KeFid(}UbrpTF%}#P=k3RQ)Vf1f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hX*&Y08K>}$dl60I9cMZ+;0)&3gpHZ@ee3(xS9Vq($VVt%Kzyncsh(w;qU)HmeG z9F0cuzS>SjBk=15K0iN$`5RT0FH%tseqGtvuub4Rj=@u{Lbz^= z`CL20D_~;D0@V5VwXc1%zNwxj{N@YW@X8UCwV#H^p@8pRi*r~y$YV;AcP~E@(4NDe zDY)dd`4dVmr0`u-HM${GJ^i^HpJLxwM#*C+9Ke3czji>^hfncwBPh9u!naZ3gbv(E zWaU27lyQ)fiz)mIx$ATC*)nw@zF+X;eRLM3g?h({GFZbsZwzTU+DJ0#R^1f}85wAD zf41}WgWsKRJ>7op+=Xwy@8}E!yRTlm(RcffZVDwDMR68uyv^=#I-R=P?ZGQiUU=jG zcs#mW*Il~Pnc#3ZY_@n?ywzgSGd5J0m6w$|j~)0hNa3@FslV@5pKdzv4~FShUtgbI zclhw(W5-Ukx3?W{3k1Srxu@4L|(=!VoRT5jAqW?1`f-nf3_Mqj_ax;=2> zL|c0xfS7~b*;(Yya)mqv&Y-6-D+@{VWM^sFSq6neq-7V)FVnlay4t41gztvK7pBtb zNs%~b(l8BohKRF3E6^SA%^Bu6>3?7T$?o?qeRJycxpQsjFMfBa<4Q1uS-jbITQ_|g zW0b`5G{)N|oM(fH^Q#6K*4zEJ zZr$qZzpZaRe&YD?;~!!YKm71STic01d*Ez)Fc>0t<~dKH>u%VS<<8PI%%sO%C{w9} z>6&M7RyY_A^ZbRwW&f&f zpJK}m(F9Y5*U&Qzuf?30IY76&Qc|4O_ULfF`J!(O{p%~eH+#D-clGuL zI|JQUyYj8!a7S0~qk+J5bIJ+B+nF~=*AtTwzckk;-!P%)^ + +8.0 +Full Histogram +BE18003 +V 10.72-8.17 MiniMate Plus +T003LCYV.JD0H +18:04:25 +2025-12-05 +20:30:00 +2025-12-05 + +Tran +Vert +Long +MicL + +145.00 +1 minute +1024 sps +7.0 Volts +March 14, 2025 by Instantel +in/s and dB(L) +I-80-North Fork Bridges-I80 E. Abutment +Fay Company +Terra-Mechanics, Inc - Harrison +Area 2 - Loc 3 - I-80 - East Abutment + +10.000 +in/s + + +0.035 +in/s + + +0.090 +in/s + + +0.045 +in/s + + +11 +Hz + + +43 +Hz + + +37 +Hz + +20:10:25 +2025-12-05 +19:09:25 +2025-12-05 +20:09:25 +2025-12-05 + +0.099 +in/s + +19:09:25 +2025-12-05 +Linear Weighting + +124.7 +dB(L) + +18:19:25 +2025-12-05 + +2.4 +Hz + +7.7 Hz. +3.5 +Passed +7.6 Hz. +3.1 +Passed +7.4 Hz. +3.9 +Passed +20.1 Hz. +767 mv +Passed + + +2025-12-05 18:04:24 - 2025-12-05 20:30:00 "Event Recorded Timer Stop" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.020130.070230.030170.0750.003121.51.9 + + +0.0207.60.070470.025470.0740.003119.1>100 + + +0.020140.080340.030340.0840.002118.33.6 + + +0.0207.80.060470.025210.0640.003121.01.9 + + +0.0205.30.055470.020180.0590.004122.82.1 + + +0.030430.080430.035430.0880.003121.04.2 + + +0.025120.085430.035470.0920.003119.82.1 + + +0.0203.20.055470.025200.0610.003119.4>100 + + +0.0205.50.055730.025370.0620.002117.6>100 + + +0.025110.065430.035430.0720.004121.818 + + +0.025130.075470.030510.0810.002118.63.5 + + +0.025120.065470.030510.0720.003120.0>100 + + +0.025110.060470.025390.0650.003119.92.6 + + +0.020130.070470.030430.0770.003119.712 + + +0.025280.065430.030340.0730.005124.72.4 + + +0.025120.060470.025430.0660.003119.41.9 + + +0.0259.80.065470.025390.0700.003121.05.1 + + +0.025200.075430.030510.0790.003119.02.5 + + +0.025170.060470.020510.0630.004122.12.0 + + +0.0207.60.060470.020390.0640.003120.64.4 + + +0.0207.50.075370.030300.0820.002118.25.0 + + +0.025160.060260.025240.0640.003121.43.6 + + +0.025210.080370.030430.0840.003120.13.4 + + +0.025200.045240.020200.0480.002118.12.6 + + +0.025200.060430.025230.0650.003120.12.1 + + +0.0206.30.045220.020300.0510.002115.92.6 + + +0.030240.070390.030390.0730.004122.82.3 + + +0.0205.40.065470.025430.0700.003120.93.1 + + +0.025110.050470.025170.0570.003121.313 + + +0.020220.060470.030300.0660.004122.03.0 + + +0.025200.070470.035180.0770.003120.64.8 + + +0.0205.10.045220.020300.0510.002116.7>100 + + +0.025160.065470.025430.0700.003120.2>100 + + +0.020130.065470.025230.0700.003119.32.3 + + +0.0203.70.055470.020430.0590.003121.32.2 + + +0.020190.065470.030370.0680.004123.111 + + +0.025220.065470.025430.0700.002118.117 + + +0.025270.055470.025390.0620.002118.6>100 + + +0.0206.30.060430.025430.0650.002116.96.3 + + +0.025120.065430.030430.0720.004122.54.1 + + +0.0202.60.060430.025430.0660.004122.05.7 + + +0.0206.20.060470.025110.0640.004121.91.7 + + +0.025140.070430.030430.0760.004122.11.9 + + +0.025340.070430.030180.0760.003120.115 + + +0.0203.50.065470.025570.0700.004121.81.9 + + +0.025180.065430.025240.0690.002117.62.5 + + +0.025100.065430.030470.0700.004122.02.5 + + +0.0204.20.050220.020140.0560.003119.12.7 + + +0.0201.90.055470.020340.0590.004122.14.3 + + +0.020<1.00.065470.025470.0700.002117.22.1 + + +0.020170.065470.025430.0700.003121.1>100 + + +0.020<1.00.060470.025570.0650.003119.81.9 + + +0.025150.070430.025430.0740.003120.94.7 + + +0.0205.90.050220.020280.0510.002117.1>100 + + +0.025130.070470.030510.0770.002117.41.9 + + +0.025270.055850.030170.0580.003120.21.8 + + +0.020170.055430.020430.0590.004123.13.7 + + +0.020<1.00.065430.030430.0700.003120.4>100 + + +0.0206.60.065430.025430.0700.003119.6>100 + + +0.030170.085430.035570.0920.004122.82.2 + + +0.025240.055470.025390.0620.002117.8>100 + + +0.025120.050230.025260.0580.002116.451 + + +0.025140.055430.025260.0590.003119.02.2 + + +0.025110.070470.035300.0780.002117.21.9 + + +0.025150.090430.040470.0990.003120.24.7 + + +0.025170.065470.030430.0720.003119.63.6 + + +0.0203.60.060570.030280.0620.003119.8>100 + + +0.025320.065470.035270.0740.003120.24.0 + + +0.025160.065430.025240.0690.003119.6>100 + + +0.020160.040240.020220.0470.002117.4>100 + + +0.020190.065470.025430.0700.002116.72.0 + + +0.025160.070390.035510.0800.004121.92.0 + + +0.025120.080430.035270.0870.003119.72.7 + + +0.025200.070470.030510.0760.003119.46.7 + + +0.030200.065430.030510.0720.003121.64.7 + + +0.020<1.00.065390.025260.0690.003119.94.1 + + +0.0254.70.060470.030220.0650.002117.91.5 + + +0.025230.065470.030370.0700.002118.22.2 + + +0.020160.065470.025390.0710.003120.02.9 + + +0.0204.00.045340.020180.0500.003118.7>100 + + +0.0202.90.055230.025170.0620.002118.5>100 + + +0.025470.070470.030470.0750.004122.72.7 + + +0.0259.70.065430.035280.0740.003121.12.0 + + +0.025570.090470.040510.0970.003121.31.9 + + +0.025110.050220.020340.0560.002114.82.3 + + +0.025200.065470.030470.0720.003119.151 + + +0.025130.055430.025430.0610.004122.02.6 + + +0.015<1.00.015180.015120.0260.001108.0>100 + + +0.0202.90.050210.025220.0580.002117.2>100 + + +0.0208.30.060470.030240.0660.003121.51.9 + + +0.0205.80.040230.020230.0470.002114.4>100 + + +0.020120.055430.020390.0590.003121.02.8 + + +0.025130.055220.030200.0660.002117.63.1 + + +0.0207.30.050390.020320.0560.004122.22.5 + + +0.030230.070430.035470.0770.003120.3>100 + + +0.025180.065430.025510.0700.004121.82.0 + + +0.020320.065430.035170.0700.003120.114 + + +0.025170.060260.025230.0650.002116.1>100 + + +0.025200.060230.030240.0700.002116.9>100 + + +0.025130.075470.035510.0810.003121.56.0 + + +0.025180.050210.025220.0560.002117.2>100 + + +0.025220.055430.025180.0590.003119.63.0 + + +0.020<1.00.070470.030470.0770.002118.3>100 + + +0.0208.10.030390.020230.0370.002116.6>100 + + +0.025170.070470.025240.0740.002118.63.3 + + +0.0206.20.065430.030510.0720.003118.82.6 + + +0.020130.035210.020200.0410.001112.8>100 + + +0.025140.075470.030470.0810.004121.71.9 + + +0.025120.065430.030370.0720.004121.92.0 + + +0.025160.065430.025470.0700.003120.615 + + +0.025220.060430.030510.0650.003120.72.0 + + +0.025210.060470.025370.0660.003121.12.1 + + +0.0203.60.065470.030470.0720.004121.9>100 + + +0.030180.075470.030510.0790.003121.5>100 + + +0.025120.075430.035300.0810.003119.41.8 + + +0.025200.050220.025230.0570.002115.0>100 + + +0.025110.060470.025180.0660.003119.12.4 + + +0.025220.065470.030390.0730.003119.02.4 + + +0.025150.070470.030430.0760.003119.72.1 + + +0.025160.050340.025390.0550.002115.9>100 + + +0.0206.20.045340.020300.0490.002117.62.3 + + +0.025270.055240.025160.0610.002115.44.9 + + +0.0253.50.090470.040570.0970.004123.12.1 + + +0.025170.060430.025510.0660.003119.92.3 + + +0.025320.090430.045370.0980.002118.61.9 + + +0.035110.070470.030510.0770.003120.33.7 + + +0.025130.065430.025200.0700.002117.4>100 + + +0.0205.30.050240.025260.0590.002118.2>100 + + +0.025130.055470.025430.0610.002117.1>100 + + +0.020130.060470.025510.0640.002118.34.0 + + +0.020120.035240.020190.0430.002115.7>100 + + +0.020100.065430.030510.0720.002117.8>100 + + +0.025320.065430.025430.0690.004123.32.1 + + +0.020130.065470.030370.0700.003119.64.1 + + +0.0203.80.055230.025240.0620.003120.0>100 + + +0.0207.20.050390.025390.0570.002117.8>100 + + +0.0203.20.050230.025260.0590.002116.62.5 + + +0.0206.20.055230.025370.0620.002118.3>100 + + +0.025130.065470.030240.0720.003120.21.8 + + +0.025180.050320.025340.0570.002116.9>100 + + +0.025130.080470.035510.0870.002118.51.9 + + +0.0206.60.040230.020300.0460.002117.6>100 + + +0.020170.040210.020230.0470.002115.2>100 + + +0.025180.090730.040510.0930.003119.3>100 + + +0.025280.075430.030570.0810.004122.22.2 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index eb9f843..f3a39d2 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -335,3 +335,33 @@ def test_a_loud_interval_does_not_hide_a_short_histogram(name, n): # which the old "first word is 0000" test rejected. ev = read_blastware_file(_FIX / _HD / name) assert len(ev.raw_samples["Tran"]) == n + + +# ── The footer is the file's last 26 bytes ────────────────────────────────── +# Every DL2 file ends in a valid footer (70,041 / 70,041: 0e 08 and two valid +# times). A few also hold an earlier "0e 08 + date" record, ~1.1 KB before +# the end: the stop time followed by zeros. The first-match footer search took +# it, so a histogram started at its own stop -- a day late on BE9558's daily +# histograms -- and a waveform lost its stop and its trigger time. +_FT = "footer-11-03-26" + + +def test_a_histogram_starts_at_its_footer_not_at_an_earlier_stop_record(): + ts = read_blastware_file(_FIX / _FT / "K558L9XP.FK0H").timestamp + # Blastware: 2025-10-07 19:14:08 (SFM read 2025-10-08 19:10:01) + assert (ts.year, ts.month, ts.day, ts.hour, ts.minute) == (2025, 10, 7, 19, 14) + + +def test_a_histogram_with_the_early_record_gets_its_time(): + ts = read_blastware_file(_FIX / _FT / "T003LCYV.JD0H").timestamp + # Blastware: 2025-12-05 18:04:25 (SFM had no time at all) + assert ts is not None + assert (ts.year, ts.month, ts.day, ts.hour, ts.minute) == (2025, 12, 5, 18, 4) + + +def test_a_waveform_with_the_early_record_is_timed_from_its_trigger(): + ev = read_blastware_file(_FIX / _FT / "K440I4LG.JK0W") + ts = ev.timestamp + # Blastware: 2019-09-26 11:14:08, record time 4 s (SFM read the stop, 11:14:12) + assert (ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) == (2019, 9, 26, 11, 14, 8) + assert ev.timestamp_source in ("event_record", "estimate") -- 2.54.1 From e1e8a851c8677d86b9e6d0f7fdddeba6f37edef9 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 12:12:02 -0500 Subject: [PATCH 176/223] docs: where the 1995 default-clock events come from Brian's account: units come back from calibration with the internal battery unplugged, so a comms-test trigger before the date is set carries the default. DL2 holds 17 such events on 6 units, all within 1995-09-01 12:02 .. 09-03 11:24. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- docs/instantel_protocol_reference.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index d3a3b16..8fbdfe4 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -2669,6 +2669,11 @@ Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent. | `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED | > ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly. +> +> **2026-11-03 — where they come from (operator account, Brian):** units come back from calibration with the internal battery unplugged, so an event triggered while testing communications, before anyone sets the date, carries the default. +> - **DL2 (measured):** 17 such events on 6 units (BE9440, BE9557, BE11529, BE17354, BE18189, BE18190). All fall between 1995-09-01 12:02:02 and 1995-09-03 11:24:06, most of them between 12:02 and 13:01 on 1 September. +> - 🔶 **Inferred:** the clock restarts at a fixed default near 1995-09-01 12:00 and runs from power-up. +> - These files still end in a valid footer. SFM reads the 1995 times and reports them as `CLOCK_NOT_SET` (`models.Timestamp`). ### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10) > ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report -- 2.54.1 From fcacc8f28c59ab3ac8f31f099c6ded3610cf929d Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 13:04:13 -0500 Subject: [PATCH 177/223] docs(changelog): Unreleased -- the footer is the file's last 26 bytes Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d8e6d..d2d3d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,30 @@ All notable changes to seismo-relay are documented here. backfill (`backfill_sidecars.py` then `backfill_event_shape.py`). Those files are stored wrongly on prod today, and the backfill rewrites them. No schema change. +- **A Blastware file's footer is its last 26 bytes: no more day-late + histograms.** + - **Measured:** every DL2 file ends in a valid footer (`0e 08` and two valid + times), 70,041 / 70,041. + - **The bug:** the decoder took the first "`0e 08` + plausible year". On 14 + files there is an earlier record, about 1.1 KB before the end, holding the + stop time followed by zeros. + - A histogram then started at its own stop: a day late on BE9558's daily + histograms (K558L9XP.FK0H read 2025-10-08 19:10:01 for Blastware's + 2025-10-07 19:14:08). + - T003LCYV.JD0H got no time at all. + - A waveform lost its stop, so its trigger was never computed and the stop + was stamped instead (K440I4LG.JK0W: 11:14:12 for 11:14:08). + - **The fix:** the last 26 bytes are now taken when they are a footer, and + the old search remains only as the fallback. + - **Decode checker:** event times 6,524 / 6,524 and histogram start dates + 63,518 / 63,518. 13 comparisons fixed, 0 regressions, 18 of 88 fields + fully match (was 16). + - **Also:** the protocol reference records where the 1995 default-clock + events come from (units back from calibration with the battery unplugged; + 17 in DL2). + - ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and + backfill. It moves the stored time of those ~14 events on prod. No schema + change. ### Added - **A Blastware file's job number, and whether Blastware shows it.** -- 2.54.1 From 5a089671e848ac900823b1f12ab3dbdad9716e5e Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 13:05:58 -0500 Subject: [PATCH 178/223] docs: where file-only decoding stands, and that prod's ASCII overlay is scaffolding CLAUDE.md 'Where things stand' now says plainly how prod uses a paired Blastware ASCII report (save_imported_bw overlays its peaks, notes, sample rate and record time onto SFM's decode), that only report-less events run on the decoder alone, and that the overlay is scaffolding to retire at step 3 of the plan. The checker status is brought up to dev: 18 of 88 fields, the remaining groups A-F in the proposed order. README roadmap: the same framing and progress. Protocol reference: - D.3.3: the footer is the file's last 26 bytes; footer[18:24] is not fixed (retracted). - D.6.1: STRT[18] picks the codec. - D.6.3: the job number. - D.6.5: the PVS^2 high word is non-zero above 1.28 in/s (retracted 'reads 0000'); the peak/PVS consistency check; Blastware's Number of Intervals is the monitoring time / the interval. - D.6.7: refreshed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CLAUDE.md | 66 ++++++++++++++++++++------- README.md | 28 +++++++++--- docs/instantel_protocol_reference.md | 67 ++++++++++++++++++++++++---- 3 files changed, 132 insertions(+), 29 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1552b7a..d57b2ad 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,10 +10,27 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as --- -## Where things stand (updated 2026-11-02) +## Where things stand (updated 2026-11-03) Read this first when picking the project back up. +- **🔑 Prod still leans on Blastware's ASCII report, and that is scaffolding.** + - **How it works today:** when a `_ASCII.TXT` report arrives with a + Blastware file, `WaveformStore.save_imported_bw` overlays its peaks, notes, + sample rate and record time onto SFM's decode + (`event_file_io.apply_report_to_event`). + - **Only events without a report** run on the decoder alone: all DL2 events + before 2025, and everything SFM downloads itself. + - **Why that matters:** the overlay made SFM trustworthy from day one. It + also hid how much the decoder could not yet do; until the checker (below) + there was no full list of what Blastware reports. + - **The goal is full function without Blastware (Brian, 2026-10-29).** The + README roadmap has four steps: + 1. the checker ✅ + 2. complete the file-only decode, one field group at a time + 3. switch ingest so reports are kept only for checking (retire the overlay) + 4. stop the watchers forwarding reports + - Until step 3, prod keeps the report as truth wherever one exists. - **🔑 The Series-3 decode checker (2026-10-29; v0.33.0).** - **Goal:** SFM produces everything Blastware reports, from the event file alone (spec and plan in `docs/superpowers/`). @@ -28,25 +45,42 @@ Read this first when picking the project back up. - **Byte layouts** of every field read from the file: `docs/instantel_protocol_reference.md` Appendix **D.6**. - **As of v0.33.0, plus the range fix on `dev` (`057df47`, 2026-11-02):** - - ✅ **Match on every event:** sample rate, record time, pre-trigger, notes, - event type (#41, from STRT[18]), and geophone range (`dev`). + **Where the decoder stands on `dev`** (2026-11-03, run `20261103-121047`): + **18 of 88 fields match on every event**, up from about 6 before v0.33.0. + The four `dev` fixes below share one release and one backfill. + - ✅ **Match on every event:** + - sample rate, record time, pre-trigger, notes and event type (v0.33.0) + - geophone range, job number, event times (6,524 / 6,524) and histogram + start dates (63,518 / 63,518) — `dev` - ✅ **Geophone samples** are exact on **6,524 / 6,524** waveforms in every - year (`dev`). v0.33.0 had 6,491: the 33 others were on the 1.250 in/s - range, 8× high under SFM's old Normal-range assumption. - - ✅ **Histogram PVS** = the stored per-interval PVS²: 69,952 / 70,042. - - ✅ **Mic: one count = 0.25 Pa,** with Blastware's dB offset at 81.9384. It - fails on only a few dozen events. + year (`dev`; v0.33.0 had 6,491, its 33 others being Sensitive-range events + read 8× high). + - ✅ **Histograms** decode to Blastware's own interval table on every DL2 + file: Tran / Vert / Long interval peaks have 0 mismatches (`dev`). + - The codec is now chosen by STRT[18]. The waveform codec had been + claiming 2018 5 s histograms. + - The sub-minute layout check now tests peak ≤ PVS ≤ √3·peak. + - Blastware's "Number of Intervals" is the monitoring time ÷ the interval: + a carve-out, 8 events. + - ✅ **Histogram PVS** = the stored per-interval PVS²: 69,989 / 70,042. + **Mic:** one count = 0.25 Pa, dB offset 81.9384; a few dozen stragglers. - ❌ **Open:** - - histogram start times are 1 s early (#51) - - 35 sub-minute (5 s / 2 s) histograms decode wrongly, plus 2 one-minute - no-mic histograms (`R352HFZ7`-shaped, likely a separate cause) - - 26 histogram start dates are a day off - - the per-interval PVS is not stored + - histogram start times are 1 s early (#51; fixing it moves every stored + histogram by 1 s, and the event key is (serial, time), so it needs a + decision first) + - the mic stragglers: ~20 one-minute histograms with an interval or two off - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out to prove) - - ⬜ **Not read yet:** job number, ZC frequency, acceleration, displacement, - time of peak, sensor check, battery, calibration, units, monitor log. + - ⬜ **Not read yet, in the order proposed** (2026-11-03): + - **A. Setup fields:** trigger source and levels, stop mode, mic type, + display units, firmware version, serial number, calibration, battery. + - **B. Histogram interval detail:** per-interval frequencies (#50: they + assume 1024 sps), per-interval PVS, interval size, stop time. + - **C. #51 timing:** start time, per-interval times, peak times. + - **D. Blastware's waveform calculations:** ZC frequency, acceleration, + displacement, time of peak. + - **E. Sensor check results.** + - **F. Monitor log:** probably not in the event file at all. - 🔶 **#48 is still open.** The event file's setup block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is **each event's own pre-trigger**, not the setting: 253–256 samples at diff --git a/README.md b/README.md index 2b12e08..869c5e2 100644 --- a/README.md +++ b/README.md @@ -621,16 +621,34 @@ Implementation steps (concrete): ### High-impact (unblocks product features) -- [x] **Series III waveform body codec reverse-engineering.** ✅ The body codec is fully decoded (`minimateplus/waveform_codec.py`, `histogram_codec.py`), and verified per-sample against Blastware's own exports. As of v0.33.0, geophone samples are exact on 6,491 / 6,524 DL2 waveforms against their `_XML.XML` reports, across 2016–2026. -- [ ] **SFM produces everything Blastware reports, from the event file alone.** The four-piece plan: +- [x] **Series III waveform body codec reverse-engineering.** ✅ The body codec is fully decoded (`minimateplus/waveform_codec.py`, `histogram_codec.py`), and verified per-sample against Blastware's own exports. Geophone samples are exact on all 6,524 DL2 waveforms against their `_XML.XML` reports, across 2016–2026 (`dev`; v0.33.0 had 6,491, before the geophone range was read from the file). +- [ ] **SFM produces everything Blastware reports, from the event file alone.** + + **Why this matters:** until it's done, prod overlays Blastware's ASCII report onto SFM's decode wherever a report exists. That made SFM trustworthy from day one, but it is scaffolding: the goal is full function without Blastware. + + The four-piece plan: 1. the decode checker ✅ v0.33.0 2. complete the file-only decode, one field group at a time, each proven by the checker - 3. flip ingest so reports are kept only for checking + 3. flip ingest so reports are kept only for checking (retire the overlay) 4. stop the watchers forwarding reports - **Done so far:** setup fields, notes, event type, histogram PVS, mic. + **Done so far: 18 of 88 report fields match on every DL2 event.** + - In v0.33.0: setup fields, notes, event type, histogram PVS, mic. + - On `dev`: + - the geophone range + - the job number + - histograms that decoded wrongly + - the footer: no more day-late histograms; every waveform time exact - **Next:** histogram start times (#51), the 37 histograms that decode wrongly, the job number, the geophone range (Sensitive-range events read 8×), and the values Blastware computes itself (ZC frequency, acceleration, displacement, time of peak), plus the sensor check, battery, calibration and monitor log. Design: `docs/superpowers/specs/2026-10-29-s3-decode-checker-design.md`. + **Next:** + - setup fields still unread: trigger, stop mode, units, serial, calibration, battery + - histogram interval detail: frequencies (#50), per-interval PVS, interval size, stop time + - histogram start times (#51) + - the values Blastware computes itself: ZC frequency, acceleration, displacement, time of peak + - the sensor check results + - the monitor log + + Design: `docs/superpowers/specs/2026-10-29-s3-decode-checker-design.md`. Status detail: CLAUDE.md "Where things stand". - [x] **Series IV (Thor IDF) binary codec reverse-engineering.** ✅ v0.21.0 — `micromate/idf_file.read_idf_file()` decodes both IDFW (waveform body at offset `0x0f1f`, reusing `decode_waveform_v2()`; 87–99% sample fidelity on quiet events) and IDFH (dedicated segment-based decoder: all 859 corpus files decode, 181,071 intervals, peaks within ~1.8% of sidecar values). `WaveformStore.save_imported_idf` now also projects parsed Thor data into a `bw_report` block via `micromate/idf_to_bw_report.py` so Thor events render in the existing Event Report PDF pipeline without a separate renderer. - [ ] **In-app waveform viewer accuracy.** Depends on Series III codec decode. Plot.v1 JSON pipeline + viewer skeleton already exist; will start showing real waveforms automatically once `_decode_a5_waveform` produces correct samples. Series IV waveforms come online when the IDF codec lands. - [ ] **Series IV live-device support.** Once the IDF binary is decoded, extend `micromate/` with `transport.py` / `framing.py` / `protocol.py` / `client.py` mirroring the `minimateplus/` package layout — depends on capturing Thor's wire protocol (TCP / RS-232 captures TBD). diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 8fbdfe4..0240e0e 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-03 | Appendix D.3.3, D.6.1, D.6.3, D.6.5, D.6.7, §8 | ✅ **File-only decode, second pass (on `dev`).** **D.3.3:** the footer is the file's last 26 bytes (70,041 / 70,041); an earlier stop-time record fooled the first-match search on 14 files, making histograms a day late. Its `[18:24]` is **not** fixed (retracted). **D.6.1:** STRT[18] now picks the codec; the waveform codec had claimed 2018 5 s histograms. **D.6.3:** the job number (flags `k − 9` bit `0x02`, uint16 at `k − 8`; 2,997 / 2,997). **D.6.5:** the PVS² high word is non-zero above 1.28 in/s (retracted "reads 0000"), so the layout check now uses peak ≤ PVS ≤ √3·peak (34,502,955 / 34,502,955); Blastware's "Number of Intervals" is the monitoring time ÷ the interval. **§8:** where the 1995 default-clock events come from. 18 of 88 report fields now match on every DL2 event. | | 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). **For #48:** the file's copy of the block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is each event's own pre-trigger, which varies on the same unit on the same day (253–256 samples at 1024 sps), and Blastware reports it per event. So the file says little about whether the live 1A loses its anchor, and #48 stays open. | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | | 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. | @@ -3441,12 +3442,16 @@ The body is reconstructed from the raw A5 bulk waveform stream frames by strippi The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata. +✅ **It is the file's last 26 bytes** (2026-11-03): `0e 08` and two valid times end every one of 70,041 DL2 files. +- ⚠ **Do not search for the first `0e 08` + plausible year.** 14 DL2 files also hold an earlier record of that shape, about 1.1 KB before the end, carrying the stop time followed by zeros. +- Taking it made a histogram start at its own stop (a day late on BE9558's daily histograms). It also cost a waveform its stop, and with it the trigger time. + | Offset | Length | Field | Notes | |---|---|---|---| | 0 | 2 | `0e 08` | Fixed marker | | 2 | 8 | ts1 | Start timestamp (8B big-endian) | | 10 | 8 | ts2 | Stop timestamp (8B big-endian) | -| 18 | 6 | `00 01 00 02 00 00` | Fixed | +| 18 | 6 | varies | ⚠ **Not fixed** (2026-11-03). `00 01 00 02 00 00` in M529LIY6.N00. Elsewhere: `00 21 04 00 00 00` (K558L9XP.FK0H, K439I2WY.RK0H, T1895KDW.6J0H), `00 01 02 00 00 00` (K5575KDW.5L0W), `00 01 00 01 00 00` (S3545KFL.S60W). Not identified | | 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed | **CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. @@ -3633,6 +3638,9 @@ copy in `~/dl2-archive`. Counts below are from that archive unless stated otherw - The filename's `W` / `H` is only a cross-check. On a disagreement SFM logs it and keeps the byte (#41). - Checker, event type: 70,042 / 70,042. +- **It also picks the codec** (2026-11-03). Trying the waveform codec first handed it BE9440, + BE9557 and BE17354's 2018 5 s histograms. It accepted them and returned about 5× too many + "samples" (K440HDXX.XH0H: 44,504 for Blastware's 6,976). #### D.6.2 Recording-setup block — sample rate, pre-trigger, record time ✅ @@ -3689,7 +3697,21 @@ Offsets are from `k`, the first byte of the setup name: ("Seis. Loc:", "Location:", "Project: "). - An empty value means none. - They match Blastware on every DL2 event. -- Not read yet: extended notes, job number. +- Not read yet: extended notes. + +**Job number** ✅ 2026-11-02, in Series IV's `0x1A` layout (`[39]` report flags, `[40:42]` the +number): + +| Offset | Type | Field | +|---|---|---| +| `k − 9` | uint8 | report flags: bit `0x02` = job number shown | +| `k − 8` | uint16 BE | job number, kept while not shown | + +- **The flag** matches Blastware's `JobNumber` on 2,997 / 2,997 DL2 events that print one, and + 66,986 / 66,986 that don't. +- **The value** matches on all 2,997, but every printed value is 1, so it is only proven for 1. + Hidden ones hold real numbers (802, 1012, 1013, 622). +- Bit `0x04` is also seen (2,311 files); it is not identified. #### D.6.4 Geophone range — the setup's channel blocks ✅ 2026-11-01 @@ -3724,7 +3746,11 @@ Each interval stores its peak vector sum **squared**: - **The event's PVS is the largest interval's.** Combining the three channel peaks instead read high on 86% of DL2 histograms, because the peaks can come from different moments. - **Verified:** √value matches Blastware's "Geo PVS" on 34.5 M DL2 sub-minute intervals, and the - event PVS matches on 69,952 / 70,042 events. The rest are the open histogram cases in D.6.7. + event PVS matches on 69,989 / 70,042 events (`dev`, 2026-11-03). +- **A consistency check** (2026-11-03): an interval's vector sum is never below its largest + channel peak, nor above √3 times it, give or take one unit of rounding. That holds on + 34,502,955 / 34,502,955 DL2 sub-minute intervals, and is what the codec now uses to recognise + a sub-minute record layout. - 🔶 On the stream's last block, the "arbitrary bytes at [21:23]" in the 2026-08-25 note are probably the high half of this field (inferred from the layout, not measured). @@ -3737,6 +3763,20 @@ Each interval stores its peak vector sum **squared**: > ⚠ **RETRACTED:** the 2026-08-26 notes (Changelog, §15) read these records as 8 × uint16 > little-endian after a 6-byte header. That was the same big-endian words shifted by one byte. > Their "2-word tail whose first word is 0000" is the PVS², whose high word reads `0000`. +> +> ⚠ **RETRACTED 2026-11-03:** "the high word reads `0000`" holds only on quiet intervals. It is +> non-zero above 1.28 in/s. The layout check required it, so a one-block histogram with a loud +> interval was not recognised at all (T193KR5M.X90H, K440HA3C.JM0H, R352HFZ7.530H). The check is +> now the consistency test above. + +**Blastware's "Number of Intervals" is the monitoring time ÷ the interval** (measured +2026-11-03), from the footer's start and stop: +- It is exact on T193KSWP.FF0H (2,880), M462KSWR.1R0H (1,650) and T193KY0A.740H (6,390). +- When the unit never wrote the last minute, the file holds one block fewer (30 intervals at + 2 s). Blastware's own interval table lists only the stored intervals, which is what SFM + decodes. +- A decode-checker carve-out (`interval-count-is-duration`) covers the 8 DL2 events where the + two differ. #### D.6.6 Mic ✅ v0.33.0 @@ -3751,15 +3791,26 @@ Each interval stores its peak vector sum **squared**: #### D.6.7 Not read from the file yet -- **Fields:** job number, extended notes, ZC frequency, acceleration, displacement, time of - peak, sensor check results, battery, calibration, units, monitor log. +*Updated 2026-11-03. 18 of 88 report fields now match on every DL2 event.* +- **Fields not read yet:** + - trigger source and levels, stop mode, mic type, display units, firmware version, serial + number, calibration, battery + - per-interval frequencies (#50: they assume 1024 sps), per-interval PVS, interval size, + histogram stop time + - extended notes + - the values Blastware computes: ZC frequency, acceleration, displacement, time of peak + - sensor check results + - monitor log - **Open cases:** - histogram start times are 1 s early (#51) - - 35 sub-minute histograms and 2 one-minute mic-off histograms decode wrongly - - 26 histogram start dates are a day off - - the per-interval PVS is not stored + - about 20 one-minute histograms with a mic peak an interval or two off - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out still to prove) +- **Resolved on `dev`, 2026-11-02 → 03:** + - the 37 histograms that decoded wrongly (D.6.1, D.6.5) + - the 26 histogram start dates a day off (D.3.3; 17 of them were the same 5 s files, timed + as waveforms) + - the job number (D.6.3) --- -- 2.54.1 From be5bab478722ba6fd79b5ac8817680526b62c872 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 13:06:19 -0500 Subject: [PATCH 179/223] docs(changelog): Unreleased -- where file-only decoding stands Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d3d8d..cfce416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,6 +114,25 @@ All notable changes to seismo-relay are documented here. `.h5` attributes are additive. No schema change, no migration. ### Protocol / Documentation +- **Where file-only decoding stands, and that prod's ASCII overlay is + scaffolding.** + - **CLAUDE.md "Where things stand"** now says plainly that a paired + Blastware ASCII report overwrites SFM's decode on import, and that only + report-less events run on the decoder alone. The overlay is to be retired + at step 3 of the plan. + - The checker status is brought up to `dev`: 18 of 88 fields match on every + DL2 event, with the remaining groups A–F in the proposed order. The README + roadmap is updated to match. + - **The protocol reference** records: + - the footer as the file's last 26 bytes (D.3.3, with `[18:24]` retracted + as "fixed") + - the codec chosen by STRT[18] + - the job number + - the PVS² high word and the peak / PVS consistency check (retracting + "reads 0000") + - Blastware's interval count + - a refreshed "not read yet" list + - Docs only: no code change, no migration. - **`docs/instantel_protocol_reference.md` gains Appendix D.6:** the bytes and DL2 verification for every field SFM reads from a Blastware event file. - the record type, `STRT[18]` -- 2.54.1 From 6c2eda5f63fea10493d77148e8717f9bc4bcd5ad Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 13:38:39 -0500 Subject: [PATCH 180/223] feat(decode): a Blastware file's identity, battery and trigger settings Group A of the file-only decode, every field matched against every DL2 report (2026-11-03): - Identity block before the setup name, what the live read gets from SUB FE: serial k-202, firmware k-147, DSP version k-138, calibration date k-132 + 'by' k-128, manufacturer k-94, model k-72, firmware minor k-193. Event.device_info (DeviceInfo gains calibration_date / calibrated_by). Serial, Version and Calibration 69,983 / 69,983. - Battery: uint16 hundredths of a volt at k-190 (Event.battery_volts). 69,729 exact; the other 254 are Blastware rounding half up. - Trigger source: the two bytes between the embedded event record's lead and fe 80, a bitmask (0x01 Tran 0x02 Vert 0x04 Long 0x08 MicL 0x200 Manual): 6,493 / 6,493. Event.triggered_by. - Trigger settings in Series IV's 0x1A layout: sources bitmask k-19, stop mode k-31 (0 = Fixed), each channel's float32 level at label+30 (geo in/s, mic psi), mic type code at MicL+4 (2 = Linear Weighting). Geo level 6,447 / 6,447, mic 4,403 / 4,403; Blastware prints a level when its channel is a trigger source and the event was not Manual. The mic level's dB uses 6895 Pa/psi (4,272 / 4,272 against 4,271 at 6894.757). - .h5 attrs for all of them (additive). - Checker: SFM's side reports the ten fields; the mic trigger level follows the report's dB/psi. Carve-out units-is-a-display-preference: dB or psi is Blastware's PC setting when it wrote the report -- DL2's reports switch fleet-wide in 61 clean runs by write time, and no byte of the file separates them. Two tests that pinned BatteryLevel / Calibration as blank now pin the match. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 52 +- minimateplus/decode_check_carveouts.py | 23 +- minimateplus/event_file_io.py | 105 +- minimateplus/models.py | 13 + sfm/event_hdf5.py | 21 + .../setup-fields-11-03-26/K558L4KY.440H | Bin 0 -> 1532 bytes .../K558L4KY_440H_XML.XML | 116 + .../setup-fields-11-03-26/M529I6LG.3Y0W | Bin 0 -> 8370 bytes .../setup-fields-11-03-26/T189HUD6.QE0W | Bin 0 -> 4060 bytes .../T189HUD6_QE0W_XML.XML | 3978 +++++++++++++++++ .../setup-fields-11-03-26/T438L713.RY0W | Bin 0 -> 6532 bytes .../T438L713_RY0W_XML.XML | 3975 ++++++++++++++++ tests/test_bw_file_fields.py | 64 + tests/test_decode_check.py | 52 +- 14 files changed, 8384 insertions(+), 15 deletions(-) create mode 100755 tests/fixtures/setup-fields-11-03-26/K558L4KY.440H create mode 100755 tests/fixtures/setup-fields-11-03-26/K558L4KY_440H_XML.XML create mode 100755 tests/fixtures/setup-fields-11-03-26/M529I6LG.3Y0W create mode 100755 tests/fixtures/setup-fields-11-03-26/T189HUD6.QE0W create mode 100755 tests/fixtures/setup-fields-11-03-26/T189HUD6_QE0W_XML.XML create mode 100755 tests/fixtures/setup-fields-11-03-26/T438L713.RY0W create mode 100755 tests/fixtures/setup-fields-11-03-26/T438L713_RY0W_XML.XML diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 0c19fdd..63f09f0 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -13,6 +13,7 @@ Pure: no I/O, and no import from `sfm/`. """ from __future__ import annotations +import math import re from dataclasses import dataclass from typing import Callable, Optional, Sequence @@ -30,6 +31,50 @@ GEO_IPS_PER_COUNT: float = _GEO_NORMAL_FS_INS / _GEO_INT16_FS _CHANNELS = ("Tran", "Vert", "Long", "MicL") _EVENT_TYPE = {"Waveform": "Full Waveform", "Histogram": "Full Histogram"} +# How Blastware prints the setup fields SFM reads (measured 2026-11-03). +_MONTHS = ("January", "February", "March", "April", "May", "June", "July", + "August", "September", "October", "November", "December") +_TRIGGERED_BY = {0x0001: "Tran", 0x0002: "Vert", 0x0004: "Long", 0x0008: "MicL", 0x0200: "Manual"} +_STOP_MODES = {0: "Fixed"} +_MIC_TYPES = {2: "Linear Weighting"} +_GEO_TRIGGERS, _MIC_TRIGGER = 0x07, 0x08 +# Blastware turns the mic trigger level from psi to dB with 6895 Pa per psi, not +# 6894.757: 4,272 / 4,272 DL2 levels against 4,271 (the odd one 0.01 psi, +# printed 130.8 dB(L), is 130.7498 at the exact constant). +_TRIGGER_PA_PER_PSI = 6895.0 + + +def _setup_values(ev: Event) -> dict[str, object]: + out: dict[str, object] = {} + di = ev.device_info + if di is not None: + out["SerialNumber"] = di.serial + fw = di.firmware_version or "" + if di.dsp_version and fw.startswith("S33") and di.model: + # "V 10.72-8.17 MiniMate Plus" from "10.72", "S338.17" and the model -- + # the only version in DL2, so the rule is proven for it alone. + out["Version"] = f"V {di.dsp_version}-{fw[3:]} {di.model}" + if di.calibration_date and di.calibrated_by: + c = di.calibration_date + out["Calibration"] = f"{_MONTHS[c.month - 1]} {c.day}, {c.year} by {di.calibrated_by}" + out["BatteryLevel"] = ev.battery_volts + out["Trigger"] = _TRIGGERED_BY.get(ev.triggered_by) + out["RecordStopMode"] = _STOP_MODES.get(ev.record_stop_mode) + out["Microphone"] = _MIC_TYPES.get(ev.mic_type) + # dB or psi is Blastware's preference, not the unit's (carve-out + # units-is-a-display-preference); SFM reports dB, the default. + out["Units"] = "in/s and dB(L)" if ev.mic_type is not None else "in/s" + # Blastware prints a trigger level only for a channel that is a trigger + # source, and none for a Manual trigger. + src, manual = ev.trigger_sources or 0, ev.triggered_by == 0x0200 + if src & _GEO_TRIGGERS and not manual: + out["GeoTriggerLevel"] = ev.trigger_level_geo + if src & _MIC_TRIGGER and not manual and ev.trigger_level_mic_psi: + psi = ev.trigger_level_mic_psi + out["MicTriggerLevel psi(L)"] = psi + out["MicTriggerLevel dB(L)"] = 20 * math.log10(psi * _TRIGGER_PA_PER_PSI / 2e-5) + return out + @dataclass class SfmSide: @@ -72,6 +117,7 @@ def sfm_side(raw: bytes) -> SfmSide: if counts["MicL"]: values["MicLPSPL dB(L)"] = mic_count_to_db(max(abs(c) for c in counts["MicL"])) values["MicLPSPL psi(L)"] = pv.micl if pv is not None else None + values.update(_setup_values(ev)) return SfmSide( event=ev, @@ -144,10 +190,10 @@ def _mic_converter(ref: XmlReport) -> Optional[Callable[[int], float]]: def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> FieldResult: if not printed.strip() or printed.strip() == "N/A": return FieldResult(tag, "no_reference", printed, None) - if tag == "MicLPSPL": + if tag in ("MicLPSPL", "MicTriggerLevel"): units = ref.event_units or "" - key = ("MicLPSPL dB(L)" if "dB(L)" in units else - "MicLPSPL psi(L)" if "psi(L)" in units else None) + key = (f"{tag} dB(L)" if "dB(L)" in units else + f"{tag} psi(L)" if "psi(L)" in units else None) value = sfm.values.get(key) if key else None else: value = sfm.values.get(tag) diff --git a/minimateplus/decode_check_carveouts.py b/minimateplus/decode_check_carveouts.py index 244edd2..ff85efb 100644 --- a/minimateplus/decode_check_carveouts.py +++ b/minimateplus/decode_check_carveouts.py @@ -106,4 +106,25 @@ INTERVAL_COUNT_IS_DURATION = Carveout( applies=_interval_count_is_duration, ) -CARVEOUTS: tuple[Carveout, ...] = (SATURATION, INTERVAL_COUNT_IS_DURATION) +_MIC_UNITS = ("in/s and dB(L)", "in/s and psi(L)") + + +def _units_is_a_display_preference(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool: + """Both sides say the event has a mic; they differ only in dB against psi.""" + return (" ".join((res.bw or "").split()) in _MIC_UNITS + and sfm.values.get("Units") in _MIC_UNITS) + + +UNITS_IS_A_DISPLAY_PREFERENCE = Carveout( + id="units-is-a-display-preference", + fields=("Units",), + evidence=("dB(L) or psi(L) is Blastware's display preference on the PC when it wrote the " + "report, not the unit's: in report-write order (the _XML.XML mtimes) DL2's 70,034 " + "reports switch fleet-wide in 61 clean runs, every unit at once, and no byte or " + "bit of the event file separates the two (k-240 .. k+520, nor the 1.2 KB before " + "the footer). 2026-11-03."), + applies=_units_is_a_display_preference, +) + +CARVEOUTS: tuple[Carveout, ...] = (SATURATION, INTERVAL_COUNT_IS_DURATION, + UNITS_IS_A_DISPLAY_PREFERENCE) diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 0dbc16c..8cf6d17 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -25,7 +25,7 @@ import struct from pathlib import Path from typing import Optional, Union -from .models import Event, PeakValues, ProjectInfo, Timestamp +from .models import DeviceInfo, Event, PeakValues, ProjectInfo, Timestamp from . import blastware_file as _bw # avoid circular reference at module load from .bw_ascii_report import BwAsciiReport from . import waveform_codec as _wc @@ -895,17 +895,22 @@ def _ts8(b: bytes) -> Optional[datetime.datetime]: def _embedded_event_record( raw: bytes, end: int, start: Optional[datetime.datetime], stop: Optional[datetime.datetime], record_time: Optional[float], -) -> tuple[Optional[datetime.datetime], str]: - """The trigger time from the instrument's embedded event record, or (None, why). +) -> tuple[Optional[datetime.datetime], str, Optional[int]]: + """The trigger time and trigger source from the instrument's embedded event + record, or (None, why, None). Every `fe 80` before `end` (the footer) is a candidate. One counts only if its lead bytes match, both its times are well formed, the footer's session start <= trigger <= its stop, its stop is the footer's stop or a second before it, and its length agrees with the record time. Exactly one may pass: none, or more than one, is reported rather than guessed between. + + The two bytes between the lead and `fe 80` are the trigger source, a uint16 + BE bitmask: 0x01 Tran, 0x02 Vert, 0x04 Long, 0x08 MicL, 0x200 Manual -- + Blastware's Trigger on 6,493 / 6,493 DL2 waveforms (2026-11-03). """ if start is None or stop is None: - return None, "the footer has no start and stop to check one against" + return None, "the footer has no start and stop to check one against", None found, rejected = [], 0 i = raw.find(_EVENT_RECORD_MARKER, 6) while 0 <= i and i + 18 <= end: @@ -921,15 +926,15 @@ def _embedded_event_record( <= _EVENT_RECORD_SLACK_S[1]) ) if valid: - found.append(trig) + found.append((trig, int.from_bytes(raw[i - 2:i], "big"))) else: rejected += 1 i = raw.find(_EVENT_RECORD_MARKER, i + 1) if len(found) == 1: - return found[0], "" + return found[0][0], "", found[0][1] if found: - return None, f"{len(found)} candidates validate" - return None, (f"{rejected} candidate(s), none valid" if rejected else "no candidate") + return None, f"{len(found)} candidates validate", None + return None, (f"{rejected} candidate(s), none valid" if rejected else "no candidate"), None def _parse_record_time_seconds(raw: bytes) -> Optional[float]: @@ -1047,6 +1052,83 @@ def _setup_geo_range(raw: bytes) -> tuple[Optional[int], Optional[str]]: return None, f"geophone range not read: channel range bytes {found}" +# The identity block before the setup: what the live read gets from SUB FE +# (DeviceInfo). Offsets back from k, the setup name; matched against every DL2 +# report 2026-11-03 -- serial, version and calibration 69,983 / 69,983, the +# battery 69,729 plus 254 that Blastware rounds half up (6.25 -> "6.3 Volts"). +_SERIAL_BEFORE_NAME = 202 # ASCII, NUL-terminated +_BATTERY_BEFORE_NAME = 190 # uint16 BE, hundredths of a volt +_FIRMWARE_MINOR_BEFORE_NAME = 193 # 0x11 = 17 for S338.17, as SUB EA +_FIRMWARE_BEFORE_NAME = 147 # "S338.17" +_DSP_BEFORE_NAME = 138 # "10.72" +_CALIBRATION_BEFORE_NAME = 132 # dd mm yyyy (BE) +_CALIBRATED_BY_BEFORE_NAME = 128 # "Instantel" +_MANUFACTURER_BEFORE_NAME = 94 # "Instantel" +_MODEL_BEFORE_NAME = 72 # "MiniMate Plus" / "BlastMate III" + + +def _cstr(raw: bytes, i: int, limit: int = 40) -> Optional[str]: + if i < 0: + return None + j = raw.find(b"\x00", i, i + limit) + s = raw[i:j if j >= 0 else i + limit].decode("ascii", errors="replace").strip() + return s or None + + +def _setup_identity(raw: bytes, k: int) -> tuple[Optional[DeviceInfo], Optional[float]]: + """(the unit's identity, the battery in volts) from the block before the + setup name at k.""" + if k < _SERIAL_BEFORE_NAME: + return None, None + serial = _cstr(raw, k - _SERIAL_BEFORE_NAME, 16) + if not serial: + return None, None + c = k - _CALIBRATION_BEFORE_NAME + try: + cal = datetime.date(int.from_bytes(raw[c + 2:c + 4], "big"), raw[c + 1], raw[c]) + except ValueError: + cal = None + info = DeviceInfo( + serial=serial, + firmware_minor=raw[k - _FIRMWARE_MINOR_BEFORE_NAME], + firmware_version=_cstr(raw, k - _FIRMWARE_BEFORE_NAME, 9), + dsp_version=_cstr(raw, k - _DSP_BEFORE_NAME, 6), + manufacturer=_cstr(raw, k - _MANUFACTURER_BEFORE_NAME), + model=_cstr(raw, k - _MODEL_BEFORE_NAME), + calibration_date=cal, + calibrated_by=_cstr(raw, k - _CALIBRATED_BY_BEFORE_NAME, 32), + ) + b = k - _BATTERY_BEFORE_NAME + return info, int.from_bytes(raw[b:b + 2], "big") / 100 + + +# Trigger settings, in Series IV's 0x1A layout again: the trigger-source bitmask +# at k - 19 ([29]: 0x07 geophones, 0x08 mic), the stop mode at k - 31 ([17], +# 0 = Fixed), and each channel block's trigger level, a float32 at label + 30 -- +# in/s for a geophone, psi for the mic. The mic block's type code at label + 4 +# is Series IV's (2 = linear). Against every DL2 waveform (2026-11-03): the geo +# level 6,447 / 6,447, the mic level 4,403 / 4,403, and Blastware prints a level +# exactly when its channel is a trigger source and the event was not Manual. +_TRIGGER_SOURCES_BEFORE_NAME = 19 +_STOP_MODE_BEFORE_NAME = 31 +_TRIGGER_LEVEL_AFTER_LABEL = 30 +_MIC_TYPE_AFTER_LABEL = 4 + + +def _setup_trigger(raw: bytes, k: int) -> dict: + out = {"trigger_sources": raw[k - _TRIGGER_SOURCES_BEFORE_NAME], + "record_stop_mode": raw[k - _STOP_MODE_BEFORE_NAME]} + t = raw.find(b"\x00\x00\x01Tran", k, k + _CHANNEL_BLOCK_SPAN) + if t >= 0: + p = t + 3 + _TRIGGER_LEVEL_AFTER_LABEL + out["trigger_level_geo"] = struct.unpack_from(">f", raw, p)[0] + m = raw.find(b"MicL", k, k + _CHANNEL_BLOCK_SPAN) + if m >= 0: + out["trigger_level_mic_psi"] = struct.unpack_from(">f", raw, m + _TRIGGER_LEVEL_AFTER_LABEL)[0] + out["mic_type"] = int.from_bytes(raw[m + _MIC_TYPE_AFTER_LABEL:m + _MIC_TYPE_AFTER_LABEL + 4], "big") + return out + + def read_blastware_file(path: Union[str, Path], *, name: Optional[str] = None) -> Event: """Parse a Blastware event file into an Event: `decode_blastware_bytes` on its bytes, `name` defaulting to the file's own (see there -- never a time source).""" @@ -1236,6 +1318,11 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: ev.geo_range, range_problem = _setup_geo_range(raw) if range_problem: ev.decode_problems.append(range_problem + "; peaks assume the Normal range") + k = _setup_name_at(raw) + if k is not None: + ev.device_info, ev.battery_volts = _setup_identity(raw, k) + for attr, value in _setup_trigger(raw, k).items(): + setattr(ev, attr, value) if is_waveform_body: ev.rectime_seconds = _setup_record_time(raw) ev.total_samples = len(samples["Tran"]) or None @@ -1276,7 +1363,7 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: _rt = _parse_record_time_seconds(raw) _start = (datetime.datetime(ts1.year, ts1.month, ts1.day, ts1.hour, ts1.minute, ts1.second) if ts1 is not None else None) - _trig, _why = _embedded_event_record(raw, footer_pos, _start, _stop, _rt) + _trig, _why, ev.triggered_by = _embedded_event_record(raw, footer_pos, _start, _stop, _rt) if _trig is not None: ev.timestamp_source = "event_record" else: diff --git a/minimateplus/models.py b/minimateplus/models.py index 6096342..99b0b62 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -300,6 +300,10 @@ class DeviceInfo: # ── From SUB 08 (EVENT_INDEX_RESPONSE) ──────────────────────────────────── event_count: Optional[int] = None # stored event count from F7 response 🔶 + # ── From a Blastware event file's identity block (2026-11-03) ───────────── + calibration_date: Optional[datetime.date] = None # e.g. 2019-02-20 ✅ + calibrated_by: Optional[str] = None # e.g. "Instantel" ✅ + def __str__(self) -> str: fw = self.firmware_version or f"?.{self.firmware_minor}" mdl = self.model or "MiniMate Plus" @@ -548,6 +552,15 @@ class Event: # Geophone range from the recording setup, as ComplianceConfig.geo_range: # 0 Normal (10 in/s full scale), 1 Sensitive (1.25 in/s). None: not read. geo_range: Optional[int] = None + # From a Blastware event file (2026-11-03); None when not read. + device_info: Optional["DeviceInfo"] = None # the unit, as SUB FE reports it + battery_volts: Optional[float] = None # at the event + triggered_by: Optional[int] = None # 0x01 Tran 0x02 Vert 0x04 Long 0x08 MicL 0x200 Manual + trigger_sources: Optional[int] = None # setup bitmask: 0x07 geophones, 0x08 mic + trigger_level_geo: Optional[float] = None # in/s, as ComplianceConfig.trigger_level_geo + trigger_level_mic_psi: Optional[float] = None + record_stop_mode: Optional[int] = None # 0 = Fixed + mic_type: Optional[int] = None # 2 = Linear Weighting (as Series IV) # Sensor self-check traces keyed by channel label — the short diagnostic # waveforms the unit records when it pulses each sensor before monitoring diff --git a/sfm/event_hdf5.py b/sfm/event_hdf5.py index f8c3a4e..6c76be5 100644 --- a/sfm/event_hdf5.py +++ b/sfm/event_hdf5.py @@ -34,6 +34,10 @@ Layout written to `.h5`: sensor_location str job_number int (only when read; kept while not shown) job_number_enabled bool (Blastware prints the job number) + battery_volts, triggered_by, trigger_sources, trigger_level_geo_ips, + trigger_level_mic_psi, firmware_version, dsp_version, model, + calibration_date (ISO), calibrated_by + (each only when read from the event file) peak_tran_ips float (from 0C; authoritative) peak_vert_ips float peak_long_ips float @@ -262,6 +266,23 @@ def write_event_hdf5( if pi is not None and getattr(pi, "job_number", None) is not None: attrs["job_number"] = int(pi.job_number) attrs["job_number_enabled"] = bool(pi.job_number_enabled) + # Read from a Blastware file's identity and setup blocks; absent when not read. + for attr, value in ( + ("battery_volts", getattr(event, "battery_volts", None)), + ("triggered_by", getattr(event, "triggered_by", None)), + ("trigger_sources", getattr(event, "trigger_sources", None)), + ("trigger_level_geo_ips", getattr(event, "trigger_level_geo", None)), + ("trigger_level_mic_psi", getattr(event, "trigger_level_mic_psi", None)), + ): + if value is not None: + attrs[attr] = value + di = getattr(event, "device_info", None) + if di is not None: + for attr in ("firmware_version", "dsp_version", "model", "calibrated_by"): + if getattr(di, attr, None): + attrs[attr] = getattr(di, attr) + if getattr(di, "calibration_date", None) is not None: + attrs["calibration_date"] = di.calibration_date.isoformat() attrs["peak_tran_ips"] = float(pv.tran if pv and pv.tran is not None else 0.0) attrs["peak_vert_ips"] = float(pv.vert if pv and pv.vert is not None else 0.0) attrs["peak_long_ips"] = float(pv.long if pv and pv.long is not None else 0.0) diff --git a/tests/fixtures/setup-fields-11-03-26/K558L4KY.440H b/tests/fixtures/setup-fields-11-03-26/K558L4KY.440H new file mode 100755 index 0000000000000000000000000000000000000000..06dd85fe25f39c558f9920d3ef4236d666796f75 GIT binary patch literal 1532 zcma)+Ur-xW6vn?zHe?A&b~i<4l#Xn$wzL+6Bv^`I(E^1rbeIP5)tzM9rosl3)QT^5 zw7xmjjt@Gc<8%gRoZ5#zYk1O*f0{7T&Y%wvC_{^dfj~>4P};2LCMmw~(6hO@xi{yY zJ-_pvT?yP-pi_^u@N z;ToSWzl3j#@J8Fg`uYZRoR`6w-eb;yc=6C#;B{KCdArdV@Om3+>J9*PwKWGka1>eR z{?CREZfC;w9$jHQ+@;1frMvHRZ0pP*^{q1hn|+0dz+rr?gU4#t#D zJxEbI)Mzvui|7bw;aCm3Nh9b>jfW$;@&XH=k4}^%8QMOGYkEivQ3i1>2By=31->e( ze@|4^Y004*BC7C=$;|OYjh5fOdJHuCQzK!$Ca22FR4z{vzP;q#t3~5af9m_I@a>~h z{)m3!=}!%n_7mMa6XFq($`u~qr^;>w?> zvVcc+^;zl?$hPMLe**au$TV7z-D*bxr*J~*ABD+o<%&Z6~{+N>g z^m-CyK4dM_)y&GNM&xg5J{Uk*J&bwkbY^xMzt9lBIENcetg?iFJtmq=;Er%dB%Zbe zh1zZQLM?9?AD#d1rcydPIyyczb@SHjo%zM3dn;=X9&SFC_`AClpT#N^mz3BYq9{qS z>~ihMTPaPh9WIwFOR^|Aolb|tUQ%MS6&DLutJHlw)at2}A!ak_bZR1*OePY;^cfyb zrBV~=$;rt~Hft;|Q_o8ckYrAlW%t%a3%13P(f_%8TTBLV2QDMkoM(CyySd+UOdVW@ z#1lPvRzTTFT%Vu&@`t&FvA?HhW^VmEH@~oS_ul>02OFD@Bw@)^|F%+VEoMk|httWZ z$mouAOS;HJ(J4Bd4!ga;LqO8k@Avk!dg|Pgn9XJ~>5-Ata59xlC6a`bnwUtZ7Z)>` zj6p;qIF3bf%dQ*`6^M-OF&aq%B=9XHhhcPHL+Z6BG%s@0@1#&W*Pdfu2G3Y#KKtat z(CqE&Hzud1rf-uv1haB~ZT;aUV`)93)G`!@!&y+LAWu#m7gL9j2q=$}Q%CAPbDUV* zQiYgVOi$#r`8jbpQBa3iCJ7~Lh?IfUMA|UbWj71vb~7dxQ|4HuI0zCiEi)P*G>TUa zF$4!Ka<5_&j1^-|5-KZ8+Z4fUJlfc>tgYAb0?bqf+{vGFU&M1xq42bLx1JU^H7LG0 F^&j!IjdK71 literal 0 HcmV?d00001 diff --git a/tests/fixtures/setup-fields-11-03-26/K558L4KY_440H_XML.XML b/tests/fixtures/setup-fields-11-03-26/K558L4KY_440H_XML.XML new file mode 100755 index 0000000..95e4224 --- /dev/null +++ b/tests/fixtures/setup-fields-11-03-26/K558L4KY_440H_XML.XML @@ -0,0 +1,116 @@ + + +8.0 +Full Histogram +BE9558 +V 10.72-8.17 MiniMate Plus +K558L4KY.440H +17:04:52 +2025-06-25 +17:05:39 +2025-06-25 + +Tran +Vert +Long +MicL + +1.00 +5 minutes +1024 sps +6.3 Volts +June 13, 2025 by Instantel +in/s and dB(L) +Fay - Locks & Dam No3 -Loc 5 Synthomer +Fay Company +Terra-Mechanics Inc - Harrison +Location #5 Sythomer Plant + +10.000 +in/s + + +2.315 +in/s + + +2.715 +in/s + + +5.115 +in/s + + +10 +Hz + + +85 +Hz + + +19 +Hz + +17:05:39 +2025-06-25 +17:05:39 +2025-06-25 +17:05:39 +2025-06-25 + +5.559 +in/s + +17:05:39 +2025-06-25 +Linear Weighting + +111.8 +dB(L) + +17:05:39 +2025-06-25 + +43 +Hz + +7.7 Hz. +3.9 +Passed +7.5 Hz. +3.8 +Passed +7.5 Hz. +3.7 +Passed +0.0 Hz. +0 mv +Check + + +2025-06-25 17:04:51 - 2025-06-25 17:05:39 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +2.315102.715855.115195.5590.001111.843 + + + + + + diff --git a/tests/fixtures/setup-fields-11-03-26/M529I6LG.3Y0W b/tests/fixtures/setup-fields-11-03-26/M529I6LG.3Y0W new file mode 100755 index 0000000000000000000000000000000000000000..879739e4be746c71dc913cac34f0ad65034f3e97 GIT binary patch literal 8370 zcmeI1U5p#ob;s`=u0A4*ZQjzcnunkhExCT);s4(0ti4S`?`DwLF*2`w?O@nm%f$4E~&$rbM8HJ{{Qnoca737DfQ`d7cQPYcX9CrweN$BUwEf=OPyCBM^hu?Zr_^4x$1Y8~%J{Bg^5KTjei+rWRim}@!|G(icpip)RVy2L zVKLm|3+qhU9V_dctxeap_I(=^Ykgy#KQr*5Rjh80t#4gDUDL`r-xQs`@x+j?D(i`1 zu%UG%hP4s*x-g$EY2EPr`Mkq|eD9uj>j%ZET!Ht=7Av$3m31W?_YQkTi?h79VF>5f z@--c>u(03VFxrJKNPB9|JmP#--&?Y~p6?T|T)nAHGI95WM=JDhzEAs~nq_5=nzNI< z$DW;Mvq@i-o(nc&eb3Z~8+w=E^@6-vU%O(sp-kjiRj_Vi`nBnnGAyc93`WK{>lb-1 z;N7;0;kF{9eo@^TnK05~7#rW(dGQ`PYl=xxFCwW=6=LqD%kZ zi=t>gzdTlc68Y1+YsPE1xRu@Y7C8V>rI|z;*#3% z3e}c0!tBi@ZJVxnxb&X*F58rFu31mNJ2H58`ObBX_vmPTrEeO-^9SZ^~n{>$}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mV?d00001 diff --git a/tests/fixtures/setup-fields-11-03-26/T189HUD6.QE0W b/tests/fixtures/setup-fields-11-03-26/T189HUD6.QE0W new file mode 100755 index 0000000000000000000000000000000000000000..315f41bd7ea9f9745b26cea396e8fdc2ffef460c GIT binary patch literal 4060 zcma)9Yiu0V6+U-&ZI9RMojcBwF2Quh#-)qvEPkbN(gaLG(oosR#7@c&Brx_uwhFtc zcaZ>5HL6;*Lj0hmG@`0dq_(IM^iQRVVn-1z2+`OMkG?|UU5Dn;5R%1%@atN60lLE*0SyXZ{ngb@jX+a9w5F zr13%;B?J_WfWbBy6SfCqal29&ZF2=6s)I*4P55 zj$~{pV^tbTm~3scKM4+s@Y5ggJQ8g-4Smy(9KUo05edbpQYh0F2!{;#vGqzDbA;;- z8PbRmCXA6GVB6H(kMt2ec92TjaMm}Rn-ENxD`W7lAv>h9abbh3B4G-h7*}(IZA3N; zg)<}bSNpzp7nhOhoFU_gh;ypZu1t6iiwu$r1XH>?gEVG|2k!CXMX^{jScAIqN&8?=h7_is zNv@+`f41a1e+9gQ8?PMVah}phCUB~{LVZnB7Y38QLJ=*z_#Q)G%bvJqAsJIp0-`p_ zbK1PiXO6u6{;`?L)z16IcW!Q3Jaf2sPBqlXfKo?Gm4Kx1Wf|I1aUvIMqEcM+YQhZ- zsQctW$EYErsj*fBW$cccu5VxZ?L(8rHBKmWWzmyQEX_N|qw{jUr9hs1*D{6Ynszj3 z9`^#K8&#%fyJp$;Och;19m>Z&=^+hJGYY^Q5rp7?q|O6!q%azh(4|ton*R2%Aathi z)dZb!h7!m=Ah>AwE_WF!qlY;&$flk}u3=}$PFg^X(UB&^f;Q2*LYMQL!72i(0o8Hl zBJj?=iz_AB6Rx;o$Oo|cs=EQy$Gd|IEUl7|?0_{yEa8R=2o~%{Yk?_NQLu~XO#yy2 zHu?jT5@@V3Ru&V7MaTVm zcQwJ9W8-Ksu44|tI1XFTrMT~}Jx!D7U-rj(Zu8qy=Ze>AOYId*u)3L7qk%X_oW(e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s2Fhif}vW&2scC;qj-UY&lOFv6)_z6S;0q>j?0u$MD=-4wYBoOk>Q>ei@b8NFgr6n zJvBKwIrYjbQ&Uq2YIe3zIA1E4Jx}2YhHzwy)lyAV6N2Kf5F@I|@fiL3akIaV4&C9$ zGDz*>rR7-s>fnt+IC1h`d*&A}zULPIIe+rhsWYFPE2)J~FMM`U8VAaOUZ>Nq4;QF0 z+Grvq?4|x+6n7YFj5Ibx!VUG|dcQW$Ju*JBxu?~_quwi(&KC-Eg_*fo1Ta^aEfkBz zQmM4G<2i&U5!1#8rRETDTMa@~pBMg9fhvCx58ufF5d9e)@-klr$AUW?yjQpj z*N#eMq0?9@z4>yYy-eTz<(JzWd4tv!7aLCnd^+(QH_hG=OaAM_mnNLp>B4y|Uk0fx z;8S6Yj|;uGmTBul)>j?87@(9I0vAYtkFjEvB@Y$e{Jj(V^w?Rq;%X2kQ{lf(!z(S^ zw5_$Q`s^zSN8V&Hktzw~5g7Ov!#rZi*XE~PCszOAX+{7M{`d!DR302_Evc>}Mew+} zi9_Hh^bz$jqAyt1zWMjQ?!?-Uo+vYhT1Eko=CS{owvy`j`5#-ISnG-?184};6J?B! c^an&%9Q&+^Rz(fHo77U{wOs|30Mq9G0h=tI1poj5 literal 0 HcmV?d00001 diff --git a/tests/fixtures/setup-fields-11-03-26/T189HUD6_QE0W_XML.XML b/tests/fixtures/setup-fields-11-03-26/T189HUD6_QE0W_XML.XML new file mode 100755 index 0000000..ffb9b60 --- /dev/null +++ b/tests/fixtures/setup-fields-11-03-26/T189HUD6_QE0W_XML.XML @@ -0,0 +1,3978 @@ + + +8.0 +Full Waveform +BE18189 +V 10.72-8.17 MiniMate Plus +T189HUD6.QE0W +14:25:26 +2019-03-11 + +Tran +Vert +Long +MicL + +MicL +0.050 in/s +128.0 dB(L) +-0.250 sec +1.0 sec. +Fixed +1024 sps +6.8 Volts +February 20, 2019 by Instantel +in/s and dB(L) +South. Belt. 55B Pond - 1212 Reissing +Joseph B. Fay Co. +Terra-Mechanics - D. Harrison +Loc #11-1212 Reissing & 259 SR 980 Area + +10.000 +in/s + + +0.015 +in/s + + +0.005 +in/s + + +0.015 +in/s + + +>100 +Hz + + +>100 +Hz + + +73 +Hz + + +0.004 +s + + +0.001 +s + + +0.024 +s + + +0.027 +g + + +0.013 +g + + +0.027 +g + + +0.000 +in + + +0.000 +in + + +0.000 +in + + +0.018 +in/s + + +0.016 +s + +Linear Weighting + +131.0 +dB(L) + + +0.003 +s + + +32 +Hz + +7.6 Hz. +4.0 +Passed +7.6 Hz. +3.7 +Passed +7.7 Hz. +4.2 +Passed +19.3 Hz. +678 mv +Passed + + +2019-03-11 06:00:13 - 2019-03-11 14:25:28 "Event Recorded " + + + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0050.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.0050.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0000.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.005-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.00581.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00587.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.005-81.94 + + +0.0050.0000.000-87.96 + + +0.0050.0000.000-91.48 + + +0.0050.0000.005-93.98 + + +0.0050.0000.000-101.0 + + +0.0050.0000.005-112.3 + + +0.0050.0000.005-119.2 + + +0.0050.0000.000-124.3 + + +0.0050.0000.000-126.9 + + +0.0050.0000.000-128.6 + + +0.0050.0050.000-130.5 + + +0.0050.0000.000-130.9 + + +0.0100.000-0.005-131.0 + + +0.015-0.0050.000-129.4 + + +0.0100.0000.000-125.7 + + +0.0050.0000.000-116.6 + + +0.0000.000-0.005112.0 + + +0.0000.0000.005121.9 + + +0.0000.0000.005124.3 + + +0.0000.0000.005123.8 + + +-0.0050.0000.010121.9 + + +0.0000.0000.010115.9 + + +0.0000.0000.010106.0 + + +0.0000.0000.000-93.98 + + +0.0050.000-0.005-108.0 + + +0.0150.000-0.010-101.0 + + +0.0100.000-0.010-93.98 + + +0.0050.000-0.005103.5 + + +0.0050.000-0.005104.9 + + +0.0000.000-0.005-87.96 + + +0.0000.0000.000-107.0 + + +0.0000.0000.000-116.9 + + +0.0000.0000.005-119.3 + + +0.0000.0000.010-120.7 + + +0.0000.0000.015-120.5 + + +-0.0050.0000.010-118.7 + + +0.0000.0000.010-118.7 + + +0.0000.0000.010-117.4 + + +0.0050.0000.010-118.1 + + +0.0050.0000.005-117.5 + + +0.0050.0050.005-116.7 + + +0.0000.0000.000-116.9 + + +0.0000.0000.000-116.4 + + +0.0000.0000.000-117.5 + + +0.000-0.0050.005-116.7 + + +0.0050.0000.005-114.2 + + +0.005-0.0050.000-109.9 + + +0.000-0.0050.005-109.5 + + +-0.0050.0000.005-111.8 + + +-0.0050.0000.005-112.0 + + +0.0000.0000.000-110.6 + + +0.0000.0050.005-106.5 + + +0.0050.0050.005-97.50 + + +0.0050.0050.00595.92 + + +0.0050.0000.005104.2 + + +0.0050.0000.000100.0 + + +0.0100.000-0.00587.96 + + +0.0100.000-0.005-91.48 + + +0.0100.000-0.005-95.92 + + +0.0100.0000.0000.000 + + +0.0050.000-0.0050.000 + + +0.0050.000-0.005100.0 + + +0.0050.000-0.005110.2 + + +0.0050.000-0.005113.8 + + +0.0000.0000.000115.0 + + +0.0000.0050.005115.2 + + +0.0000.0000.010115.7 + + +0.0000.0000.005116.3 + + +0.0000.0000.005115.9 + + +0.0000.0000.005115.9 + + +0.0050.0000.005116.7 + + +0.0050.0050.005117.2 + + +0.0050.0000.005117.4 + + +0.0050.0050.000118.1 + + +0.0050.0000.000119.0 + + +0.0000.000-0.005118.8 + + +0.0000.0000.000118.1 + + +0.0050.0000.000117.2 + + +0.0000.0050.000117.9 + + +0.0050.000-0.005118.7 + + +0.0000.0000.000118.7 + + +0.0050.0000.000118.1 + + +0.0050.0000.000117.2 + + +0.0050.0000.000116.7 + + +0.0050.0000.005116.4 + + +0.0050.0050.005116.9 + + +0.0000.0000.000117.6 + + +0.0000.0000.000118.2 + + +0.0050.0000.000117.6 + + +0.0050.0000.000116.4 + + +0.0050.0000.000116.3 + + +0.0000.0000.000116.1 + + +0.0000.0000.000115.7 + + +0.0000.0000.005115.2 + + +0.0000.0000.005115.0 + + +0.0050.0000.005115.4 + + +0.0050.0000.005115.4 + + +0.0000.0000.005115.0 + + +0.0050.0000.005115.0 + + +0.0050.0000.005115.0 + + +0.0050.0000.005114.6 + + +0.0050.0000.000114.0 + + +0.0050.0000.005113.8 + + +0.0050.0000.000114.0 + + +0.0050.0000.000114.0 + + +0.0000.0000.000113.3 + + +0.0050.0000.000113.1 + + +0.0050.0000.000113.5 + + +0.0050.000-0.005113.8 + + +0.0050.0000.000113.1 + + +0.0050.0000.000112.3 + + +0.0050.0000.000112.3 + + +0.0050.0000.000112.3 + + +0.0050.0000.000112.0 + + +0.0050.0000.000111.8 + + +0.0050.0000.000112.0 + + +0.0050.0000.000112.0 + + +0.0050.0000.000110.9 + + +0.0050.0000.000110.6 + + +0.0050.0000.000110.9 + + +0.0050.000-0.005111.2 + + +0.0050.0000.000111.2 + + +0.0050.0000.000110.9 + + +0.0050.0000.000110.9 + + +0.0050.000-0.005111.2 + + +0.0050.0000.000110.9 + + +0.0050.0000.000110.6 + + +0.0050.0000.000110.2 + + +0.0050.0000.000110.6 + + +0.0050.0000.000110.6 + + +0.0050.0000.000110.2 + + +0.0050.0000.000110.6 + + +0.0050.0050.000110.2 + + +0.0050.0050.000110.2 + + +0.0000.0000.000109.5 + + +0.0050.0000.000109.5 + + +0.0000.0000.000110.6 + + +0.0050.0000.000110.6 + + +0.0050.0000.000110.2 + + +0.0050.0000.000109.5 + + +0.0050.0000.000109.5 + + +0.0050.0000.000109.2 + + +0.000-0.0050.000108.8 + + +0.0000.0000.000108.8 + + +0.0000.0000.005109.5 + + +0.0050.0000.000109.5 + + +0.0050.0050.000109.2 + + +0.0000.0000.000108.8 + + +0.0000.0000.000109.2 + + +0.0000.0000.000109.2 + + +0.0050.0000.000108.4 + + +0.0050.0000.000108.0 + + +0.0050.0000.000108.0 + + +0.0000.0000.000108.0 + + +0.0000.0000.000107.5 + + +0.0050.0000.000107.0 + + +0.0000.0000.000106.5 + + +0.0000.0000.000107.0 + + +0.0050.0000.000106.5 + + +0.0000.0000.000106.0 + + +0.0050.0000.000106.5 + + +0.0050.0000.000106.5 + + +0.0050.0000.000106.0 + + +0.0050.0000.000104.9 + + +0.0050.0000.000104.2 + + +0.0050.0000.000104.9 + + +0.0050.0000.000104.2 + + +0.0050.0000.000103.5 + + +0.0050.0000.000102.8 + + +0.0050.0000.000102.8 + + +0.0050.0000.000101.9 + + +0.0050.0000.000101.0 + + +0.0050.0000.000101.0 + + +0.0050.0000.000101.0 + + +0.0050.0000.00098.84 + + +0.0050.0000.00097.50 + + +0.0050.0000.00093.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-91.48 + + +0.0050.0000.000-91.48 + + +0.0050.0000.000-93.98 + + +0.0050.0000.000-95.92 + + +0.0050.0000.000-93.98 + + +0.0050.0000.000-93.98 + + +0.0050.0000.000-95.92 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-98.84 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.005-101.9 + + +0.0050.0000.005-101.0 + + +0.0050.0000.005-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.005-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.005-100.0 + + +0.0050.0000.005-100.0 + + +0.0050.0000.005-100.0 + + +0.0000.0000.005-101.0 + + +0.0050.0000.005-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.005-100.0 + + +0.0050.0000.005-100.0 + + +0.0000.0000.005-98.84 + + +0.0000.0000.005-97.50 + + +0.0050.0000.005-97.50 + + +0.0050.0000.005-95.92 + + +0.0050.0000.000-95.92 + + +0.0000.0000.005-95.92 + + +0.0050.0000.005-93.98 + + +0.0000.0000.005-95.92 + + +0.0000.0000.000-95.92 + + +0.0000.0050.005-93.98 + + +0.0050.0000.005-93.98 + + +0.0050.0050.005-93.98 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-91.48 + + +0.0000.0000.000-91.48 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-91.48 + + +0.0050.0000.005-87.96 + + +0.0000.0000.000-87.96 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-91.48 + + +0.0050.0000.005-91.48 + + +0.0000.0000.005-91.48 + + +0.0000.0000.000-91.48 + + +0.0000.0000.005-91.48 + + +0.0050.0000.000-87.96 + + +0.0050.0000.005-87.96 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-93.98 + + +0.0000.0000.000-93.98 + + +0.0000.0000.005-93.98 + + +0.0050.0000.005-93.98 + + +0.0000.0000.000-91.48 + + +0.0000.0000.005-93.98 + + +0.0000.0000.005-93.98 + + +0.0050.0000.000-95.92 + + +0.0050.0000.005-95.92 + + +0.0000.0000.000-95.92 + + +0.0050.0000.000-95.92 + + +0.0000.0000.005-95.92 + + +0.0000.0000.005-97.50 + + +0.0050.0000.005-97.50 + + +0.0000.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0050.0000.005-98.84 + + +0.0050.0050.000-100.0 + + +0.0050.0000.000-98.84 + + +0.0050.0050.005-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.005-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.005-98.84 + + +0.0050.0000.005-100.0 + + +0.0050.0000.000-100.0 + + +0.0000.0000.005-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0000.0000.005-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0000.0000.005-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0000.0000.005-100.0 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-97.50 + + +0.0050.0050.000-98.84 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0050.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0000.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-97.50 + + +0.0000.0000.000-98.84 + + +0.0050.0000.000-97.50 + + +0.0050.0000.005-97.50 + + +0.0050.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-97.50 + + +0.0050.0050.000-95.92 + + +0.0000.0000.000-95.92 + + +0.0050.0000.000-95.92 + + +0.0050.0000.000-95.92 + + +0.0050.0000.000-97.50 + + +0.0050.000-0.005-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0050.000-98.84 + + +0.0000.0000.000-98.84 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0000.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-101.0 + + +0.0050.0000.000-100.0 + + +0.0000.0000.000-100.0 + + +0.0100.0000.005-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.005-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0050.0000.000-100.0 + + +0.0000.0000.000-98.84 + + +0.0000.0000.000-98.84 + + +0.0050.0050.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.005-98.84 + + +0.0050.0000.000-98.84 + + +0.0050.0000.000-98.84 + + +0.0000.0000.000-98.84 + + +0.0050.0000.000-97.50 + + +0.005-0.0050.000-97.50 + + +0.0000.0000.000-97.50 + + +0.0000.0000.005-97.50 + + +0.0050.0000.000-98.84 + + +0.0000.0000.005-97.50 + + +0.0000.0000.000-97.50 + + +0.0050.0000.000-98.84 + + +0.0050.0000.005-97.50 + + +0.0050.0000.005-97.50 + + +0.0000.0000.000-95.92 + + +0.0000.0000.005-95.92 + + +0.0000.0000.005-93.98 + + +0.0050.0000.005-93.98 + + +0.0000.0000.005-95.92 + + +0.0000.0000.005-95.92 + + +0.0000.0000.005-97.50 + + +0.0000.0000.000-97.50 + + +0.0000.0000.005-97.50 + + +0.0000.0000.005-97.50 + + +0.0050.0000.005-95.92 + + +0.0000.0000.005-93.98 + + +0.0000.0000.005-93.98 + + +0.0050.0000.000-91.48 + + +0.0050.0000.000-91.48 + + +0.0000.0000.005-93.98 + + +0.0050.0000.005-91.48 + + +0.0000.0000.005-93.98 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-91.48 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-87.96 + + +0.0000.0000.000-87.96 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-87.96 + + +0.0000.0000.000-91.48 + + +0.0000.0000.005-87.96 + + +0.0050.0000.005-87.96 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-87.96 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0050.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.005-81.94 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.00581.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.005-81.94 + + +0.0050.0000.005-81.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0000.0000.00087.96 + + +0.0000.0000.00587.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00591.48 + + +0.0050.0000.00587.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0000.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00587.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00091.48 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0050.00087.96 + + +0.0050.0050.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00087.96 + + +0.0000.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00587.96 + + +0.0000.0000.00087.96 + + +0.0000.0000.00087.96 + + +0.0000.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0050.0000.00587.96 + + +0.0000.0000.00091.48 + + +0.0000.0000.00091.48 + + +0.0000.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00593.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0000.0050.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00593.98 + + +0.0000.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0050.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0000.0000.00093.98 + + +0.0000.0000.00593.98 + + +0.0050.0000.00593.98 + + +0.0000.0000.00593.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0000.0000.00593.98 + + +0.0050.0000.00093.98 + + +0.0000.0000.00593.98 + + +0.0000.0050.00093.98 + + +0.0000.0000.00093.98 + + +0.0000.0000.00593.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0050.00591.48 + + +0.0050.0000.00593.98 + + +0.0000.0000.00593.98 + + +0.0050.0000.00593.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00093.98 + + +0.0000.0000.00093.98 + + +0.0050.0000.00593.98 + + +0.0050.0000.00593.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00593.98 + + +0.0050.0000.00593.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0000.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00593.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00093.98 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0000.0000.00091.48 + + +0.0050.0000.00091.48 + + +0.0050.0000.00591.48 + + +0.0050.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0000.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00091.48 + + +0.0000.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0050.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.005-0.0050.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0050.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0050.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.00581.94 + + +0.0000.0000.00081.94 + + +0.0000.0050.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.0050.000 + + +0.0000.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.000-0.0050.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0050.005-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0000.0050.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.00581.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00587.96 + + +0.0050.0000.00081.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00087.96 + + +0.0000.0000.00581.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0050.0000.00587.96 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0050.0050.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0050.0050.000 + + +0.0050.0000.00581.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0050.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0050.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.005-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.005-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0050.000 + + +0.0050.0050.00581.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.000-81.94 + + +0.0050.0000.000-87.96 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.005-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-87.96 + + +0.0050.0000.000-87.96 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0000.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.000-81.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.000-81.94 + + +0.0050.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0050.0000.0050.000 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.00581.94 + + +0.0000.0000.00581.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.0050.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00581.94 + + +0.0050.0000.00581.94 + + +0.0000.0000.00087.96 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.00087.96 + + +0.0050.0000.00587.96 + + +0.0050.0000.00581.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00581.94 + + +0.0050.0000.0000.000 + + +0.0000.0000.0000.000 + + +0.0050.0000.0000.000 + + +0.0000.0000.00081.94 + + +0.0000.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0050.0000.00081.94 + + +0.0000.0000.00581.94 + + + + + + + diff --git a/tests/fixtures/setup-fields-11-03-26/T438L713.RY0W b/tests/fixtures/setup-fields-11-03-26/T438L713.RY0W new file mode 100755 index 0000000000000000000000000000000000000000..0640497c9350d1045639df914cf6c54ba44224f2 GIT binary patch literal 6532 zcmd5g3v?94vNf}l>}+UKqgoOVm*`3XA|2wyO1HSX#@t*5B_q=mn?@mv5 zPgiwSS5;S46JS;VOe$MaKBug_WC7@}1&a=56ihGB;*7YVm=Wjqt-6xgm=6Ff00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_ywgUW#!l?TvD=FnmXsc5^PT_ zDJxk#X92b*JWyUzR$NjnOh$~~|N zuY|_pr_!=v2?|{ZxZ?xJ8G^HmN*0&@aVXbUkaIOcO<@0pA* z77ju-q(BP$6VpKVZuH0^9$-|)FDdsgDTPsQ{E{+w@(|E3gTeTbjju5A`tzXAxZ%?K zM)-WvNhE@zOq3nNp;tEgOMQJ}bTA~3?uD6g^o}>6m;3U#4&%(EGy4FHYd3!jy>c#( z8^H{^XXc}d&$o?&Uc*7#2pNcH1kMLS@2}?X9Rl(w9K!Y_xRNzf7MO|5M7&Yt80dJB z<_M3j-q;}7F8pw$;doQ?$L zt5;RDC5A!7h{qv191eV0uty8t(lS6WPs~l6+a1rr&!c;|nG6|hR)U*+CLb-BBaFmp z(7vgMqvwuEwljxok2W?cEy&V^Hm};=6+n)-CRQ4$OU5`p#guBsBtk@PY&Kh3FZ?Ac zTN-w)R!RbLWllw=Fbgp7ygr!>D#>#@L_zZ^jq)zf_UfJ0)e;xRsDs>Fy>t8a?KQh( zxluvJd_H>Vlh`ig2HmRDnW*VzQN(y4(BO#X5a_k<@xzZ}dic5-u3|AiL@7;TCgGWa zSu1c78mfOYd(n2OU~xstsNabuvmBDFO%2eU7ga~L;yvCIJ{l|we2CF`b6K; zeI=5HIpXDVi3TRsRCv8eRz7yk7|GUp-cR8Z7<$;~@=-o4&-`VL3d@rI2Om9b^ziY) zJ;=wyvY6nb^EXcDPEbBNyFRJ&`W{|hw@b3wdJ{CeL_rb|iOGanJ(|T|R?e5W2fEMt b&^vc%9ZE9vHS?Fwn5^H<8hTd<*Khd;1tSXm literal 0 HcmV?d00001 diff --git a/tests/fixtures/setup-fields-11-03-26/T438L713_RY0W_XML.XML b/tests/fixtures/setup-fields-11-03-26/T438L713_RY0W_XML.XML new file mode 100755 index 0000000..2d844e2 --- /dev/null +++ b/tests/fixtures/setup-fields-11-03-26/T438L713_RY0W_XML.XML @@ -0,0 +1,3975 @@ + + +8.0 +Full Waveform +BE18438 +V 10.72-8.17 MiniMate Plus +T438L713.RY0W +07:35:58 +2025-08-12 + +Tran +Vert +Long +MicL + +Vert +0.500 in/s +130.8 dB(L) +-0.250 sec +1.0 sec. +Fixed +1024 sps +6.8 Volts +July 11, 2024 by Instantel +in/s and dB(L) +1 + +1.250 +in/s + + +OORANGE +in/s + + +OORANGE +in/s + + +OORANGE +in/s + + +13 +Hz + + +73 +Hz + + +37 +Hz + + +0.042 +s + + +0.003 +s + + +0.011 +s + + +2.963 +g + + +4.903 +g + + +3.569 +g + + +0.125 +in + + +0.118 +in + + +0.071 +in + + +OORANGE +in/s + + +0.042 +s + +Linear Weighting + +122.4 +dB(L) + + +0.053 +s + + +73 +Hz + +7.3 Hz. +3.8 +Passed +7.6 Hz. +3.5 +Passed +7.4 Hz. +3.9 +Passed +20.1 Hz. +530 mv +Passed + + +2025-08-12 07:35:49 - 2025-08-12 07:35:59 "Event Recorded " + + + + +0.0010.0010.000-81.94 + + +0.0010.000-0.001-81.94 + + +0.0010.001-0.001-81.94 + + +0.0010.000-0.001-81.94 + + +0.0010.000-0.001-81.94 + + +0.001-0.0010.000-81.94 + + +0.001-0.0010.000-81.94 + + +0.001-0.0010.000-81.94 + + +0.0010.000-0.001-81.94 + + +0.000-0.0010.0000.000 + + +0.001-0.001-0.001-81.94 + + +0.001-0.001-0.001-81.94 + + +0.001-0.001-0.002-81.94 + + +0.002-0.001-0.0010.000 + + +0.001-0.0020.000-81.94 + + +0.001-0.0010.0010.000 + + +0.0000.0000.0010.000 + + +0.001-0.001-0.0010.000 + + +0.001-0.001-0.0010.000 + + +0.0010.000-0.002-81.94 + + +0.001-0.001-0.001-81.94 + + +0.001-0.001-0.0010.000 + + +0.0000.000-0.0010.000 + + +0.000-0.001-0.0010.000 + + +0.001-0.0010.0000.000 + + +0.001-0.001-0.001-81.94 + + +0.001-0.001-0.0010.000 + + +0.001-0.001-0.001-81.94 + + +0.0010.000-0.0010.000 + + +0.0020.001-0.001-81.94 + + +0.001-0.001-0.0010.000 + + +0.0010.000-0.0010.000 + + +0.001-0.001-0.0010.000 + + +0.0000.001-0.0010.000 + + +0.000-0.001-0.0010.000 + + +0.0000.000-0.0010.000 + + +0.0010.0000.0000.000 + + +0.0010.001-0.0010.000 + + +0.0010.0000.000-81.94 + + +0.0000.000-0.001-81.94 + + +0.0000.0000.0000.000 + + +0.0010.0000.0000.000 + + +0.0010.0000.000-81.94 + + +-0.0010.000-0.0010.000 + + +-0.001-0.001-0.001-81.94 + + +0.000-0.002-0.002-81.94 + + +-0.001-0.001-0.0010.000 + + +0.0010.000-0.001-81.94 + + +0.0010.0000.001-81.94 + + +0.0010.0010.002-81.94 + + +0.0010.0020.002-81.94 + + +0.0010.0020.003-81.94 + + +0.0010.0000.0020.000 + + +0.001-0.0010.0010.000 + + +-0.001-0.002-0.0020.000 + + +-0.002-0.002-0.0020.000 + + +-0.001-0.001-0.0020.000 + + +0.000-0.001-0.0010.000 + + +0.000-0.0010.002-81.94 + + +0.0010.0000.002-81.94 + + +0.0010.0010.002-81.94 + + +-0.0010.0010.002-81.94 + + +0.0000.0010.002-81.94 + + +0.001-0.0020.0020.000 + + +0.000-0.001-0.00181.94 + + +0.000-0.001-0.002-81.94 + + +0.000-0.001-0.0010.000 + + +0.000-0.003-0.001-81.94 + + +0.000-0.0020.0000.000 + + +0.0000.0000.0000.000 + + +0.0010.0010.002-81.94 + + +0.0010.0010.002-81.94 + + +0.0010.0010.002-81.94 + + +0.0000.0000.0010.000 + + +-0.001-0.001-0.0010.000 + + +-0.0010.000-0.001-81.94 + + +0.000-0.0010.000-81.94 + + +0.000-0.0020.000-81.94 + + +0.000-0.001-0.001-81.94 + + +-0.001-0.0010.000-81.94 + + +0.000-0.0010.001-81.94 + + +0.0010.0010.000-81.94 + + +0.0010.0010.001-81.94 + + +0.0010.0010.002-81.94 + + +0.000-0.0010.0010.000 + + +0.0010.0010.001-81.94 + + +0.0010.0000.000-81.94 + + +0.0010.0010.001-81.94 + + +0.0000.0000.0010.000 + + +0.0010.0010.001-81.94 + + +0.0010.0010.0000.000 + + +0.000-0.001-0.0010.000 + + +0.001-0.001-0.0020.000 + + +-0.0010.0020.0010.000 + + +-0.0010.0060.002-81.94 + + +0.0020.0050.005-81.94 + + +0.003-0.0020.007-81.94 + + +0.002-0.0070.0010.000 + + +-0.003-0.005-0.010-81.94 + + +-0.0070.000-0.013-81.94 + + +-0.005-0.002-0.010-81.94 + + +0.001-0.006-0.004-81.94 + + +0.004-0.0020.001-81.94 + + +0.0020.0050.005-81.94 + + +0.0010.0060.004-81.94 + + +0.0010.0040.003-81.94 + + +0.0020.0030.004-81.94 + + +0.0020.0010.004-81.94 + + +0.0010.0010.002-81.94 + + +0.000-0.002-0.0020.000 + + +-0.001-0.003-0.0060.000 + + +-0.002-0.004-0.0090.000 + + +-0.002-0.003-0.0080.000 + + +-0.001-0.002-0.0040.000 + + +0.0010.001-0.0010.000 + + +0.0020.0040.003-81.94 + + +0.0020.0030.0040.000 + + +0.0020.0040.0040.000 + + +0.0020.0020.00181.94 + + +0.0010.001-0.00181.94 + + +0.001-0.001-0.00181.94 + + +-0.001-0.001-0.0020.000 + + +-0.001-0.001-0.0020.000 + + +0.0000.000-0.0020.000 + + +-0.001-0.001-0.0010.000 + + +0.000-0.001-0.0010.000 + + +0.001-0.001-0.0020.000 + + +-0.001-0.001-0.00281.94 + + +-0.001-0.001-0.0020.000 + + +-0.0010.001-0.00181.94 + + +0.0020.0020.00181.94 + + +0.0010.0010.0020.000 + + +0.001-0.0010.00181.94 + + +-0.001-0.002-0.0020.000 + + +-0.001-0.002-0.0050.000 + + +-0.001-0.001-0.0040.000 + + +0.000-0.001-0.00281.94 + + +0.000-0.001-0.00181.94 + + +-0.001-0.001-0.00181.94 + + +-0.0010.000-0.00281.94 + + +-0.0010.002-0.00181.94 + + +0.0010.0010.0020.000 + + +0.001-0.0010.0020.000 + + +-0.0010.0000.00181.94 + + +-0.0020.001-0.00281.94 + + +-0.0010.001-0.00281.94 + + +0.0000.000-0.0010.000 + + +0.0000.0000.00081.94 + + +0.0010.0000.00181.94 + + +0.0010.0010.0010.000 + + +0.0000.0010.00081.94 + + +0.0000.000-0.00181.94 + + +0.0000.000-0.0020.000 + + +-0.0010.0010.0000.000 + + +-0.0010.0010.0010.000 + + +0.0010.0010.002-81.94 + + +0.0010.0010.0010.000 + + +-0.001-0.001-0.0010.000 + + +-0.0010.000-0.0020.000 + + +0.000-0.001-0.00181.94 + + +0.0010.0000.0010.000 + + +0.001-0.0010.0010.000 + + +0.001-0.0010.00181.94 + + +-0.001-0.001-0.0010.000 + + +-0.0020.000-0.0010.000 + + +-0.0010.000-0.0010.000 + + +-0.0010.0010.00181.94 + + +0.0010.0010.0020.000 + + +-0.0010.0020.0030.000 + + +0.0010.0020.0040.000 + + +-0.0010.0010.0030.000 + + +-0.001-0.0010.0010.000 + + +-0.0010.0010.00181.94 + + +-0.0020.0000.0010.000 + + +-0.001-0.002-0.00281.94 + + +-0.001-0.002-0.00181.94 + + +-0.001-0.001-0.0010.000 + + +-0.0010.0010.0010.000 + + +0.0000.0020.0020.000 + + +0.0000.0020.0020.000 + + +0.0010.0020.0020.000 + + +0.0010.0020.0030.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0010.00181.94 + + +0.001-0.0010.00181.94 + + +0.000-0.0010.00081.94 + + +0.000-0.0010.00081.94 + + +0.0000.0000.00181.94 + + +0.0000.0010.0020.000 + + +0.0010.0030.0040.000 + + +0.0010.0040.0060.000 + + +0.0010.0050.00681.94 + + +0.0010.0050.0060.000 + + +0.0020.0040.0060.000 + + +0.0020.0040.0050.000 + + +0.0010.0040.0050.000 + + +0.0010.0030.0050.000 + + +0.0030.0020.0040.000 + + +0.0030.0010.005-81.94 + + +0.0020.0020.0040.000 + + +0.0020.0040.0070.000 + + +0.0030.0020.0120.000 + + +0.0040.0000.0120.000 + + +0.006-0.0010.0120.000 + + +0.004-0.0010.0090.000 + + +0.002-0.0010.0060.000 + + +0.000-0.0030.00181.94 + + +-0.001-0.005-0.0040.000 + + +-0.004-0.004-0.0110.000 + + +-0.007-0.004-0.0150.000 + + +-0.008-0.004-0.0170.000 + + +-0.009-0.004-0.0170.000 + + +-0.007-0.004-0.0160.000 + + +-0.006-0.004-0.0140.000 + + +-0.004-0.003-0.0110.000 + + +-0.003-0.002-0.00881.94 + + +-0.001-0.001-0.0030.000 + + +0.001-0.0010.0010.000 + + +0.001-0.0020.0020.000 + + +0.003-0.0010.0030.000 + + +0.002-0.0010.0040.000 + + +0.0020.0000.0030.000 + + +0.0010.0000.0020.000 + + +0.0020.0010.00181.94 + + +0.000-0.001-0.00181.94 + + +0.000-0.001-0.0030.000 + + +-0.001-0.002-0.0060.000 + + +-0.001-0.002-0.0070.000 + + +-0.002-0.002-0.0060.000 + + +-0.001-0.002-0.0070.000 + + +-0.001-0.002-0.0060.000 + + +-0.001-0.002-0.00681.94 + + +-0.0010.000-0.0030.000 + + +0.001-0.001-0.00181.94 + + +0.002-0.0020.00181.94 + + +0.001-0.0010.0020.000 + + +0.002-0.0010.00081.94 + + +0.001-0.001-0.00181.94 + + +0.0010.0010.0020.000 + + +0.0010.0030.00481.94 + + +0.0010.0010.00681.94 + + +0.002-0.0010.00681.94 + + +0.001-0.0020.00981.94 + + +-0.0020.0010.01181.94 + + +-0.0070.0020.01681.94 + + +-0.0070.0010.02281.94 + + +-0.0010.0010.02587.96 + + +0.011-0.0010.02787.96 + + +0.015-0.0040.02687.96 + + +0.011-0.0060.01981.94 + + +0.001-0.0040.00781.94 + + +-0.004-0.002-0.00181.94 + + +-0.002-0.004-0.00981.94 + + +-0.002-0.008-0.0160.000 + + +-0.002-0.004-0.0230.000 + + +-0.0120.118-0.058-81.94 + + +-0.0940.575-0.272-98.84 + + +-0.3960.547-0.607-107.0 + + +-0.518-1.227-0.195-95.92 + + +-0.323-1.2510.709107.5 + + +-0.379-1.2511.062110.9 + + +-0.539-1.2510.832108.8 + + +-0.506-1.2510.366101.0 + + +-0.354-1.251-0.089-91.48 + + +-0.226-1.251-0.473-105.5 + + +-0.1540.599-0.775-109.5 + + +-0.1241.251-1.139-112.8 + + +-0.1301.251-1.251-113.5 + + +-0.1600.891-1.251-113.5 + + +-0.2020.644-1.251-113.5 + + +-0.2580.277-1.251-113.5 + + +-0.322-0.286-1.251-113.5 + + +-0.356-0.730-1.251-113.3 + + +-0.349-0.231-1.251-113.3 + + +-0.3280.627-1.251-113.5 + + +-0.3000.600-1.251-113.5 + + +-0.2520.209-0.112-93.98 + + +-0.2040.1361.234111.5 + + +-0.1780.4520.447101.9 + + +-0.1640.596-0.157-97.50 + + +-0.1510.7630.0670.000 + + +-0.1411.2420.421101.0 + + +-0.1261.2511.106110.6 + + +-0.0981.2511.251111.5 + + +-0.0520.9941.251111.8 + + +0.0021.0871.251111.5 + + +0.0411.2511.251111.5 + + +0.0571.2511.251111.5 + + +0.0741.2511.251111.5 + + +0.1091.2511.251111.5 + + +0.1591.2511.251111.5 + + +0.2111.2511.251111.5 + + +0.2711.2511.251111.2 + + +0.3541.2511.251111.2 + + +0.4681.2511.251110.9 + + +0.6151.2511.251111.2 + + +0.7891.2511.251111.2 + + +0.9641.2511.251110.9 + + +1.1331.2511.251110.9 + + +1.2511.2511.251110.6 + + +1.2511.2511.251110.9 + + +1.2511.2511.251110.6 + + +1.2511.2511.251110.6 + + +1.2511.2511.251110.2 + + +1.2511.2510.789104.9 + + +1.2511.2510.055-97.50 + + +1.2511.251-0.036-100.0 + + +1.2511.2510.131-95.92 + + +1.2511.2510.126-97.50 + + +1.2511.251-0.094-112.3 + + +1.2511.251-0.377-122.4 + + +1.2511.251-0.472-119.8 + + +1.2511.251-0.385110.9 + + +1.2511.251-0.324112.8 + + +1.2511.251-0.399108.0 + + +1.2511.251-0.529109.5 + + +1.251-0.069-0.648-93.98 + + +1.251-0.536-0.676-108.8 + + +1.2510.634-0.6360.000 + + +1.2511.152-0.672-102.8 + + +1.2510.754-0.816-111.8 + + +1.2510.554-0.923-107.0 + + +1.2510.071-0.912-107.0 + + +1.251-0.132-0.891-114.4 + + +0.479-0.109-1.169-115.4 + + +-0.638-1.251-1.251-112.0 + + +-0.783-1.251-1.251-113.1 + + +-0.584-1.251-1.251-111.2 + + +-0.884-0.247-1.251-108.0 + + +-1.251-0.546-1.251-113.5 + + +-1.251-0.956-1.251-113.8 + + +-1.251-0.491-1.251-111.2 + + +-1.251-0.244-1.251-114.0 + + +-1.251-0.382-1.251-114.4 + + +-1.251-0.349-1.251-111.8 + + +-1.251-0.176-1.251-113.3 + + +-1.251-0.130-1.251-114.4 + + +-1.251-0.147-1.251-112.8 + + +-1.251-0.177-1.251-113.3 + + +-1.251-0.501-1.251-114.6 + + +-1.251-0.732-1.251-113.5 + + +-1.251-0.635-1.251-113.1 + + +-1.251-0.672-1.251-114.6 + + +-1.251-0.992-1.251-114.0 + + +-1.251-1.126-1.251-113.1 + + +-1.251-1.157-1.251-114.2 + + +-1.251-1.244-1.251-114.0 + + +-1.251-1.251-1.251-112.8 + + +-1.251-1.251-1.149-113.1 + + +-1.251-1.251-1.095-112.6 + + +-1.251-1.251-1.059-110.6 + + +-1.251-1.251-1.011-111.5 + + +-1.251-1.251-0.752-109.9 + + +-1.251-1.251-0.226-93.98 + + +-1.251-1.251-0.030-81.94 + + +-1.251-1.251-0.044-93.98 + + +-1.251-1.2510.02187.96 + + +-1.251-1.2510.04987.96 + + +-1.251-1.2510.09681.94 + + +-1.251-1.2510.17797.50 + + +-1.251-1.2510.20795.92 + + +-1.251-1.2510.24795.92 + + +-1.125-1.2510.336101.0 + + +-1.019-1.2510.431104.2 + + +-0.917-1.2510.492103.5 + + +-0.818-1.2510.542104.9 + + +-0.721-1.2510.603106.0 + + +-0.624-1.2510.668106.5 + + +-0.526-1.2510.739108.0 + + +-0.429-1.2510.781108.4 + + +-0.326-1.2510.789108.4 + + +-0.191-1.2510.975109.9 + + +-0.071-1.2511.132111.2 + + +0.007-1.2511.072110.6 + + +0.079-1.2510.911109.2 + + +0.164-1.2510.817108.8 + + +0.254-1.2510.781108.0 + + +0.334-1.2510.807108.4 + + +0.394-1.2510.921109.9 + + +0.442-1.2511.076110.6 + + +0.502-1.2511.158111.2 + + +0.573-1.2511.159111.2 + + +0.638-1.2511.171111.2 + + +0.692-1.2511.216111.5 + + +0.746-1.2511.251112.0 + + +0.796-1.2511.251111.8 + + +0.842-1.2511.251112.0 + + +0.886-1.2511.251112.0 + + +0.934-1.2511.251111.8 + + +0.983-1.2511.251112.0 + + +1.033-1.2511.251112.0 + + +1.079-1.2511.251111.8 + + +1.122-1.2511.251111.8 + + +1.162-1.2511.251111.5 + + +1.207-1.2511.251111.8 + + +1.249-1.2511.251112.0 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.5 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.8 + + +1.251-1.2511.251111.5 + + +1.251-1.2511.251111.5 + + +1.215-1.2511.251111.5 + + +1.194-1.2511.251111.8 + + +1.172-1.2511.251111.5 + + +1.149-1.1341.251111.5 + + +1.124-1.0641.251111.5 + + +1.096-1.0291.251111.5 + + +1.064-1.0191.251111.8 + + +1.032-1.0051.251111.5 + + +0.996-1.0141.251111.5 + + +0.959-1.0971.251111.5 + + +0.923-1.2411.251111.8 + + +0.886-1.2511.251111.8 + + +0.848-1.2511.251111.5 + + +0.808-1.0461.251111.5 + + +0.766-0.9031.251111.5 + + +0.722-0.8191.251111.5 + + +0.679-0.7891.251111.8 + + +0.636-0.7941.251111.8 + + +0.591-0.7971.251111.5 + + +0.547-0.7811.251111.5 + + +0.503-0.7601.251111.8 + + +0.456-0.8001.251111.8 + + +0.402-0.9611.251111.8 + + +0.317-1.2511.251111.8 + + +0.216-1.2511.251111.5 + + +0.232-1.2511.251111.8 + + +0.341-1.2511.251111.8 + + +0.674-1.2511.251111.8 + + +0.930-1.2511.251111.5 + + +0.584-1.2511.251111.5 + + +0.2720.0441.251111.8 + + +0.2491.2511.251111.8 + + +0.4310.1511.251111.8 + + +0.692-0.0701.251111.8 + + +0.7510.5531.251111.8 + + +0.6401.0521.251111.8 + + +0.6491.1691.251111.8 + + +0.7611.2470.766107.0 + + +0.7511.2510.597104.9 + + +0.6431.251-0.561-107.0 + + +0.6121.251-0.829-110.2 + + +0.6261.251-0.183-98.84 + + +0.5591.2510.14387.96 + + +0.4291.2510.002-87.96 + + +0.3171.251-0.075-93.98 + + +0.2371.2510.0820.000 + + +0.1571.2510.30698.84 + + +0.0701.2510.436102.8 + + +-0.0171.2510.474103.5 + + +-0.0981.2510.500103.5 + + +-0.1801.2510.551104.9 + + +-0.2680.9920.579104.9 + + +-0.3630.8660.551104.9 + + +-0.4640.7390.504103.5 + + +-0.5730.4670.490103.5 + + +-0.6690.2830.450102.8 + + +-0.7500.2470.377101.9 + + +-0.8390.1410.322100.0 + + +-0.926-0.2660.25297.50 + + +-1.012-0.7440.17793.98 + + +-1.106-0.9110.14491.48 + + +-1.187-0.8690.09887.96 + + +-1.247-0.8220.006-81.94 + + +-1.251-0.833-0.091-91.48 + + +-1.251-0.901-0.164-95.92 + + +-1.251-0.988-0.230-98.84 + + +-1.251-1.039-0.311-101.9 + + +-1.251-1.036-0.409-102.8 + + +-1.251-1.014-0.509-105.5 + + +-1.251-1.002-0.605-106.5 + + +-1.251-1.009-0.697-108.0 + + +-1.251-1.028-0.799-108.8 + + +-1.251-1.042-0.998-111.5 + + +-1.251-1.037-1.191-112.8 + + +-1.251-1.012-1.251-113.5 + + +-1.251-0.985-1.251-113.5 + + +-1.251-0.973-1.251-113.3 + + +-1.251-0.985-1.251-113.3 + + +-1.251-1.017-1.251-113.5 + + +-1.251-1.092-1.251-113.5 + + +-1.251-1.251-1.251-113.3 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.3 + + +-1.251-1.251-1.251-113.3 + + +-1.251-1.251-1.251-113.3 + + +-1.251-1.251-1.251-113.3 + + +-1.251-1.251-1.251-113.5 + + +-1.251-1.251-1.251-113.5 + + +-1.034-1.251-1.251-113.5 + + +-0.627-1.251-1.251-113.5 + + +-0.523-1.251-1.251-113.3 + + +-0.448-1.251-1.251-113.3 + + +-0.197-0.876-1.251-113.5 + + +0.087-0.726-1.251-113.5 + + +0.232-0.531-1.251-113.5 + + +0.312-0.387-1.251-113.5 + + +0.420-0.485-1.251-113.5 + + +0.513-0.496-1.251-113.5 + + +0.531-0.356-1.251-113.3 + + +0.454-0.622-1.251-113.8 + + +0.376-0.869-1.251-113.5 + + +0.366-0.680-1.251-113.5 + + +0.364-0.423-1.251-113.5 + + +0.330-0.326-1.251-113.5 + + +0.308-0.231-1.251-113.5 + + +0.332-0.060-1.251-113.5 + + +0.3690.109-1.251-113.5 + + +0.3850.248-1.251-113.3 + + +0.3870.379-1.251-113.8 + + +0.3940.499-1.251-113.8 + + +0.4070.589-1.251-113.5 + + +0.4440.662-1.251-113.5 + + +0.5200.728-1.251-113.5 + + +0.6200.787-1.251-113.5 + + +0.7000.855-1.251-113.5 + + +0.7560.925-1.251-113.5 + + +0.7990.969-1.251-113.5 + + +0.8420.984-1.251-113.5 + + +0.8781.009-1.251-113.3 + + +0.9141.049-1.251-113.3 + + +0.9511.068-1.251-113.5 + + +0.9671.027-1.251-113.5 + + +0.9320.914-1.251-113.5 + + +0.8310.666-1.251-113.5 + + +0.6970.359-1.251-113.5 + + +0.5970.202-1.251-113.5 + + +0.5330.204-1.251-113.5 + + +0.5080.309-1.251-113.5 + + +0.5380.512-1.251-113.5 + + +0.5990.749-1.251-113.5 + + +0.6070.906-1.251-113.5 + + +0.4991.057-1.251-113.5 + + +0.5101.251-1.251-113.5 + + +0.6721.251-1.251-113.5 + + +0.8591.251-1.251-113.5 + + +0.8790.337-1.251-113.5 + + +0.604-1.251-1.251-113.5 + + +0.418-1.251-1.251-113.3 + + +0.522-0.861-1.251-113.5 + + +0.711-0.053-1.251-113.5 + + +0.8440.354-1.251-113.5 + + +0.9340.472-1.251-113.5 + + +1.0070.302-1.251-113.5 + + +1.0990.132-1.251-113.5 + + +1.2040.329-1.251-113.5 + + +1.2510.737-1.251-113.5 + + +1.2511.072-1.251-113.3 + + +1.2511.251-1.251-113.5 + + +1.2511.251-1.251-113.5 + + +1.2511.251-1.251-113.5 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.208-1.251-113.3 + + +1.2511.113-1.251-113.3 + + +1.2510.833-1.251-113.5 + + +1.0800.521-1.251-113.3 + + +1.0430.464-1.251-113.3 + + +1.0570.700-1.251-113.3 + + +1.0741.038-1.251-113.3 + + +1.1061.251-1.251-113.3 + + +1.1461.251-1.251-113.5 + + +1.1861.251-1.251-113.3 + + +1.2391.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.1 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.5 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.251-113.3 + + +1.2511.251-1.046-111.5 + + +1.2511.251-0.926-110.6 + + +1.2511.251-0.807-109.2 + + +1.2511.251-0.696-108.0 + + +1.2511.251-0.600-106.5 + + +1.2511.251-0.520-104.9 + + +1.2511.251-0.454-103.5 + + +1.2511.251-0.391-102.8 + + +1.2511.251-0.327-101.0 + + +1.2511.251-0.269-100.0 + + +1.2511.251-0.217-97.50 + + +1.2511.251-0.161-93.98 + + +1.2511.251-0.096-87.96 + + +1.2511.251-0.036-81.94 + + +1.2511.2510.0170.000 + + +1.2511.2510.07187.96 + + +1.2511.2510.12791.48 + + +1.2511.2510.17895.92 + + +1.2511.2510.21997.50 + + +1.2511.2510.25997.50 + + +1.2511.2510.299100.0 + + +1.2511.2510.334100.0 + + +1.2511.2510.365101.0 + + +1.2511.2510.397102.8 + + +1.2511.2510.431102.8 + + +1.2511.2510.459103.5 + + +1.2511.2510.487104.2 + + +1.2511.2510.518104.9 + + +1.2511.2510.546104.9 + + +1.2511.2510.569105.5 + + +1.2511.2510.595106.0 + + +1.2511.2510.617106.0 + + +1.2511.2510.639106.5 + + +1.2511.2510.657106.5 + + +1.2511.2510.674107.0 + + +1.2511.2510.692107.0 + + +1.2511.2510.710107.5 + + +1.2511.2510.723107.0 + + +1.2511.2510.737107.5 + + +1.2511.2510.754108.0 + + +1.2511.2510.767108.0 + + +1.2511.2510.779108.0 + + +1.2511.2510.791108.4 + + +1.2511.2510.803108.4 + + +1.2511.2510.811108.0 + + +1.2511.2510.820108.4 + + +1.2511.2510.832108.4 + + +1.2511.2510.838108.8 + + +1.2511.2510.844108.4 + + +1.2511.2510.853108.8 + + +1.2511.2510.860108.8 + + +1.2511.2510.864109.2 + + +1.2511.2510.869109.2 + + +1.2511.2510.876109.2 + + +1.1951.2510.881109.2 + + +1.1561.2510.884109.2 + + +1.1191.2510.890109.2 + + +1.0791.2510.894109.2 + + +1.0391.2510.896109.2 + + +1.0021.2510.899109.2 + + +0.9641.2510.902109.2 + + +0.9241.2510.902109.2 + + +0.8871.2510.905109.2 + + +0.8511.2510.909109.2 + + +0.8121.2510.909109.2 + + +0.7741.2510.910109.2 + + +0.7381.2510.911109.2 + + +0.7001.2510.911109.2 + + +0.6621.2510.911109.2 + + +0.6271.2510.911109.2 + + +0.5921.2510.912109.2 + + +0.5561.2510.911109.2 + + +0.5191.2510.911109.2 + + +0.4861.2510.914109.2 + + +0.4511.2510.914109.5 + + +0.4171.2510.912109.2 + + +0.3821.2510.912109.2 + + +0.3471.2510.909109.2 + + +0.3111.2510.905109.2 + + +0.2781.2510.902109.2 + + +0.2441.2510.902109.2 + + +0.2101.2510.899109.2 + + +0.1791.2510.897109.2 + + +0.1501.2510.898109.2 + + +0.1181.2510.897109.2 + + +0.0871.2510.896109.2 + + +0.0571.2510.894108.8 + + +0.0251.2510.892108.8 + + +-0.0061.2510.888108.8 + + +-0.0361.2510.886108.8 + + +-0.0661.2510.883108.8 + + +-0.0971.2510.880108.8 + + +-0.1261.2510.877108.8 + + +-0.1541.2510.875108.8 + + +-0.1831.2510.871108.8 + + +-0.2121.2510.868108.8 + + +-0.2391.2510.866108.8 + + +-0.2671.2510.861108.8 + + +-0.2951.2510.858108.4 + + +-0.3211.2510.855108.4 + + +-0.3471.2510.853108.4 + + +-0.3741.2510.850108.4 + + +-0.3991.2510.846108.4 + + +-0.4231.2510.843108.4 + + +-0.4481.2510.841108.8 + + +-0.4721.2510.836108.4 + + +-0.4971.2510.832108.4 + + +-0.5211.2510.829108.4 + + +-0.5461.2510.824108.4 + + +-0.5691.2510.820108.0 + + +-0.5911.2510.817108.0 + + +-0.6151.2510.812108.0 + + +-0.6361.2510.809108.4 + + +-0.6571.2510.805107.5 + + +-0.6791.2510.801108.0 + + +-0.7021.2510.797108.0 + + +-0.7221.2510.794108.0 + + +-0.7421.2510.789108.0 + + +-0.7631.2510.784108.0 + + +-0.7831.2510.781107.5 + + +-0.8021.2510.777107.5 + + +-0.8221.2510.771107.5 + + +-0.8411.1840.766107.5 + + +-0.8601.1710.762107.0 + + +-0.8781.1560.758107.5 + + +-0.8961.1410.753107.5 + + +-0.9141.1250.749107.5 + + +-0.9311.1110.743107.5 + + +-0.9481.0960.736107.0 + + +-0.9661.0820.730107.0 + + +-0.9841.0680.724106.5 + + +-0.9991.0540.720107.0 + + +-1.0141.0410.717107.0 + + +-1.0271.0280.716107.0 + + +-1.0431.0140.712107.0 + + +-1.0571.0000.707107.0 + + +-1.0720.9860.702107.0 + + +-1.0850.9710.695106.0 + + +-1.1010.9570.687106.0 + + +-1.1160.9420.681106.5 + + +-1.1300.9270.676106.5 + + +-1.1440.9120.670106.5 + + +-1.1560.8980.665106.5 + + +-1.1700.8830.661106.5 + + +-1.1810.8690.655106.0 + + +-1.1920.8560.649106.0 + + +-1.2020.8440.647105.5 + + +-1.2150.8290.641106.0 + + +-1.2260.8150.636105.5 + + +-1.2360.8020.631106.0 + + +-1.2460.7870.625106.0 + + +-1.2510.7740.619105.5 + + +-1.2510.7600.614106.0 + + +-1.2510.7470.609105.5 + + +-1.2510.7330.604105.5 + + +-1.2510.7200.600105.5 + + +-1.2510.7060.595105.5 + + +-1.2510.6930.588104.9 + + +-1.2510.6790.582104.9 + + +-1.2510.6660.577104.9 + + +-1.2510.6540.571104.9 + + +-1.2510.6420.566104.9 + + +-1.2510.6280.562104.9 + + +-1.2510.6140.556104.9 + + +-1.2510.6010.552104.9 + + +-1.2510.5890.546104.2 + + +-1.2510.5740.539104.2 + + +-1.2510.5610.533104.2 + + +-1.2510.5490.527104.2 + + +-1.2510.5360.521104.2 + + +-1.2510.5230.517104.2 + + +-1.2510.5100.511104.2 + + +-1.2510.4970.505104.2 + + +-1.2510.4840.501103.5 + + +-1.2510.4710.496103.5 + + +-1.2510.4600.491103.5 + + +-1.2510.4470.484103.5 + + +-1.2510.4330.480104.2 + + +-1.2510.4210.474103.5 + + +-1.2510.4090.467103.5 + + +-1.2510.3960.461103.5 + + +-1.2510.3820.456102.8 + + +-1.2510.3710.450102.8 + + +-1.2510.3590.445102.8 + + +-1.2510.3490.441102.8 + + +-1.2510.3360.434102.8 + + +-1.2510.3240.430102.8 + + +-1.2510.3140.424102.8 + + +-1.2510.3010.419102.8 + + +-1.2510.2900.412102.8 + + +-1.2510.2770.409101.0 + + +-1.2510.2660.404101.9 + + +-1.2510.2560.397101.9 + + +-1.2510.2430.392101.9 + + +-1.2510.2330.387101.9 + + +-1.2510.2210.381101.9 + + +-1.2510.2100.375101.0 + + +-1.2510.1980.371101.0 + + +-1.2510.1860.366101.0 + + +-1.2510.1760.361101.9 + + +-1.2510.1660.354101.0 + + +-1.2510.1540.349101.0 + + +-1.2510.1450.344101.0 + + +-1.2510.1340.339101.0 + + +-1.2510.1220.334101.0 + + +-1.2510.1120.329100.0 + + +-1.2510.1010.32398.84 + + +-1.2510.0910.318100.0 + + +-1.2510.0810.313100.0 + + +-1.2510.0710.307100.0 + + +-1.2510.0600.304100.0 + + +-1.2510.0500.298100.0 + + +-1.2510.0410.29398.84 + + +-1.2510.0320.28698.84 + + +-1.2510.0200.28298.84 + + +-1.2510.0100.27998.84 + + +-1.2510.0010.27398.84 + + +-1.251-0.0110.26698.84 + + +-1.251-0.0190.26298.84 + + +-1.251-0.0270.25798.84 + + +-1.251-0.0360.25497.50 + + +-1.251-0.0440.25198.84 + + +-1.251-0.0560.24898.84 + + +-1.251-0.0670.24397.50 + + +-1.251-0.0770.23497.50 + + +-1.251-0.0870.22597.50 + + +-1.251-0.0940.21797.50 + + +-1.251-0.1050.21195.92 + + +-1.251-0.1140.20697.50 + + +-1.251-0.1220.20497.50 + + +-1.251-0.1280.20295.92 + + +-1.251-0.1350.20295.92 + + +-1.251-0.1420.20295.92 + + +-1.251-0.1490.19997.50 + + +-1.251-0.1570.19697.50 + + +-1.251-0.1660.19197.50 + + +-1.251-0.1750.18495.92 + + +-1.251-0.1850.17695.92 + + +-1.251-0.1920.16895.92 + + +-1.251-0.2010.16195.92 + + +-1.251-0.2090.15795.92 + + +-1.251-0.2170.15295.92 + + +-1.251-0.2260.14993.98 + + +-1.251-0.2320.14693.98 + + +-1.251-0.2390.14493.98 + + +-1.251-0.2470.13991.48 + + +-1.251-0.2540.13393.98 + + +-1.251-0.2590.13091.48 + + +-1.251-0.2650.12693.98 + + +-1.243-0.2720.12391.48 + + +-1.236-0.2800.12191.48 + + +-1.228-0.2880.11691.48 + + +-1.222-0.2940.11191.48 + + +-1.216-0.3010.10487.96 + + +-1.210-0.3060.09987.96 + + +-1.202-0.3130.09587.96 + + +-1.194-0.3190.09287.96 + + +-1.185-0.3260.08887.96 + + +-1.178-0.3310.08687.96 + + +-1.168-0.3360.08287.96 + + +-1.160-0.3430.07991.48 + + +-1.151-0.3490.07591.48 + + +-1.144-0.3550.07187.96 + + +-1.135-0.3590.06787.96 + + +-1.126-0.3650.06287.96 + + +-1.118-0.3690.05987.96 + + +-1.111-0.3740.05581.94 + + +-1.102-0.3810.05181.94 + + +-1.092-0.3860.04781.94 + + +-1.085-0.3910.04481.94 + + +-1.076-0.3960.04187.96 + + +-1.066-0.4010.03787.96 + + +-1.057-0.4070.0360.000 + + +-1.047-0.4100.03281.94 + + +-1.038-0.4140.0290.000 + + +-1.029-0.4190.0250.000 + + +-1.021-0.4250.0220.000 + + +-1.012-0.4290.0180.000 + + +-1.004-0.4320.0150.000 + + +-0.994-0.4360.0120.000 + + +-0.985-0.4410.0090.000 + + +-0.977-0.4450.006-81.94 + + +-0.967-0.4490.0040.000 + + +-0.957-0.453-0.0010.000 + + +-0.947-0.458-0.00381.94 + + +-0.938-0.461-0.0060.000 + + +-0.929-0.465-0.0090.000 + + +-0.919-0.468-0.012-81.94 + + +-0.911-0.472-0.016-81.94 + + +-0.901-0.476-0.017-81.94 + + +-0.891-0.477-0.021-81.94 + + +-0.881-0.482-0.024-81.94 + + +-0.872-0.486-0.027-81.94 + + +-0.862-0.488-0.029-81.94 + + +-0.853-0.491-0.032-81.94 + + +-0.842-0.494-0.035-81.94 + + +-0.834-0.497-0.037-81.94 + + +-0.823-0.501-0.0390.000 + + +-0.814-0.502-0.041-81.94 + + +-0.804-0.504-0.0440.000 + + +-0.796-0.507-0.047-81.94 + + +-0.786-0.510-0.050-81.94 + + +-0.775-0.511-0.052-87.96 + + +-0.766-0.515-0.055-81.94 + + +-0.757-0.517-0.056-81.94 + + +-0.747-0.519-0.059-87.96 + + +-0.736-0.521-0.061-87.96 + + +-0.726-0.523-0.063-87.96 + + +-0.716-0.526-0.066-81.94 + + +-0.707-0.529-0.068-87.96 + + +-0.697-0.530-0.070-87.96 + + +-0.687-0.531-0.072-87.96 + + +-0.678-0.533-0.074-87.96 + + +-0.669-0.534-0.077-87.96 + + +-0.659-0.536-0.079-87.96 + + +-0.649-0.537-0.082-81.94 + + +-0.639-0.539-0.083-87.96 + + +-0.629-0.541-0.085-87.96 + + +-0.620-0.542-0.086-87.96 + + +-0.610-0.543-0.088-87.96 + + +-0.601-0.545-0.091-87.96 + + +-0.592-0.546-0.092-87.96 + + +-0.581-0.546-0.096-87.96 + + +-0.573-0.547-0.097-91.48 + + +-0.562-0.548-0.097-91.48 + + +-0.551-0.550-0.100-91.48 + + +-0.542-0.550-0.101-91.48 + + +-0.534-0.551-0.102-87.96 + + +-0.523-0.551-0.104-91.48 + + +-0.514-0.552-0.107-91.48 + + +-0.504-0.553-0.108-91.48 + + +-0.495-0.553-0.109-91.48 + + +-0.485-0.553-0.111-91.48 + + +-0.477-0.554-0.112-91.48 + + +-0.467-0.555-0.113-91.48 + + +-0.457-0.555-0.116-91.48 + + +-0.449-0.554-0.116-91.48 + + +-0.439-0.554-0.119-93.98 + + +-0.430-0.556-0.120-91.48 + + +-0.419-0.556-0.121-87.96 + + +-0.411-0.555-0.122-91.48 + + +-0.402-0.556-0.123-91.48 + + +-0.392-0.557-0.124-93.98 + + +-0.382-0.556-0.126-91.48 + + +-0.374-0.556-0.127-91.48 + + +-0.365-0.555-0.129-91.48 + + +-0.356-0.554-0.130-93.98 + + +-0.346-0.554-0.131-91.48 + + +-0.337-0.554-0.132-93.98 + + +-0.329-0.553-0.132-93.98 + + +-0.319-0.552-0.134-93.98 + + +-0.312-0.553-0.136-93.98 + + +-0.303-0.552-0.136-93.98 + + +-0.294-0.552-0.137-93.98 + + +-0.285-0.551-0.138-93.98 + + +-0.276-0.550-0.139-93.98 + + +-0.267-0.550-0.141-93.98 + + +-0.259-0.549-0.141-91.48 + + +-0.251-0.547-0.142-93.98 + + +-0.242-0.546-0.142-93.98 + + +-0.234-0.546-0.143-93.98 + + +-0.224-0.545-0.143-95.92 + + +-0.216-0.544-0.146-93.98 + + +-0.208-0.542-0.146-95.92 + + +-0.199-0.541-0.146-93.98 + + +-0.192-0.540-0.146-93.98 + + +-0.184-0.539-0.147-93.98 + + +-0.176-0.538-0.149-93.98 + + +-0.167-0.536-0.149-95.92 + + +-0.159-0.536-0.149-93.98 + + +-0.151-0.534-0.150-93.98 + + +-0.143-0.532-0.150-93.98 + + +-0.136-0.530-0.151-93.98 + + +-0.126-0.527-0.151-95.92 + + +-0.118-0.527-0.149-95.92 + + +-0.111-0.527-0.150-95.92 + + +-0.104-0.524-0.151-95.92 + + +-0.096-0.522-0.153-95.92 + + +-0.089-0.521-0.155-95.92 + + +-0.081-0.519-0.156-93.98 + + +-0.076-0.519-0.157-95.92 + + +-0.067-0.517-0.157-97.50 + + +-0.060-0.515-0.156-95.92 + + +-0.052-0.512-0.156-95.92 + + +-0.044-0.509-0.156-95.92 + + +-0.036-0.507-0.154-95.92 + + +-0.029-0.506-0.155-95.92 + + +-0.021-0.504-0.155-95.92 + + +-0.015-0.501-0.156-95.92 + + +-0.008-0.499-0.156-95.92 + + +-0.001-0.497-0.156-95.92 + + +0.006-0.496-0.157-95.92 + + +0.012-0.494-0.157-97.50 + + +0.019-0.492-0.157-95.92 + + +0.027-0.490-0.157-97.50 + + +0.034-0.486-0.156-95.92 + + +0.041-0.485-0.156-95.92 + + +0.047-0.484-0.156-97.50 + + +0.052-0.480-0.156-95.92 + + +0.059-0.479-0.156-95.92 + + +0.064-0.476-0.156-95.92 + + +0.072-0.473-0.156-95.92 + + +0.079-0.472-0.157-95.92 + + +0.085-0.470-0.158-97.50 + + +0.091-0.467-0.157-97.50 + + +0.097-0.464-0.156-95.92 + + +0.103-0.462-0.156-97.50 + + +0.109-0.459-0.156-95.92 + + +0.114-0.456-0.156-95.92 + + +0.121-0.453-0.155-95.92 + + +0.126-0.452-0.155-95.92 + + +0.132-0.450-0.155-95.92 + + +0.138-0.447-0.154-95.92 + + +0.144-0.444-0.154-93.98 + + +0.149-0.442-0.153-93.98 + + +0.155-0.439-0.152-95.92 + + +0.161-0.436-0.152-95.92 + + +0.167-0.434-0.153-95.92 + + +0.171-0.432-0.153-95.92 + + +0.176-0.429-0.152-95.92 + + +0.182-0.426-0.151-95.92 + + +0.187-0.424-0.152-95.92 + + +0.192-0.421-0.151-95.92 + + +0.197-0.417-0.151-95.92 + + +0.202-0.415-0.150-95.92 + + +0.207-0.412-0.149-95.92 + + +0.212-0.409-0.149-95.92 + + +0.217-0.407-0.148-95.92 + + +0.222-0.404-0.148-95.92 + + +0.227-0.402-0.147-95.92 + + +0.231-0.397-0.147-95.92 + + +0.236-0.395-0.147-95.92 + + +0.240-0.392-0.146-93.98 + + +0.246-0.389-0.146-95.92 + + +0.249-0.386-0.146-95.92 + + +0.254-0.384-0.144-95.92 + + +0.257-0.381-0.144-95.92 + + +0.261-0.377-0.142-95.92 + + +0.266-0.375-0.142-95.92 + + +0.271-0.371-0.142-95.92 + + +0.274-0.367-0.142-95.92 + + +0.278-0.364-0.140-95.92 + + +0.283-0.362-0.140-95.92 + + +0.286-0.361-0.139-95.92 + + +0.290-0.357-0.138-95.92 + + +0.295-0.354-0.138-93.98 + + +0.299-0.351-0.137-93.98 + + +0.302-0.347-0.136-95.92 + + +0.305-0.345-0.136-93.98 + + +0.309-0.342-0.135-93.98 + + +0.312-0.337-0.134-93.98 + + +0.316-0.335-0.133-93.98 + + +0.321-0.332-0.132-93.98 + + +0.322-0.329-0.132-93.98 + + +0.326-0.327-0.132-93.98 + + +0.328-0.324-0.132-93.98 + + +0.331-0.321-0.130-93.98 + + +0.334-0.319-0.129-91.48 + + +0.337-0.316-0.128-93.98 + + +0.341-0.311-0.127-95.92 + + +0.344-0.309-0.126-93.98 + + +0.347-0.305-0.124-93.98 + + +0.350-0.302-0.124-93.98 + + +0.352-0.300-0.123-91.48 + + +0.356-0.297-0.123-93.98 + + +0.357-0.294-0.124-93.98 + + +0.359-0.292-0.122-93.98 + + +0.362-0.288-0.121-93.98 + + +0.365-0.284-0.120-91.48 + + +0.368-0.282-0.118-93.98 + + +0.370-0.279-0.118-93.98 + + +0.372-0.277-0.117-93.98 + + +0.374-0.274-0.116-95.92 + + +0.376-0.270-0.116-93.98 + + +0.378-0.267-0.114-95.92 + + +0.381-0.265-0.114-93.98 + + +0.382-0.261-0.112-93.98 + + +0.384-0.259-0.112-93.98 + + +0.385-0.256-0.111-93.98 + + +0.388-0.252-0.111-93.98 + + +0.391-0.249-0.109-93.98 + + +0.392-0.247-0.109-93.98 + + +0.392-0.244-0.107-93.98 + + +0.396-0.241-0.106-93.98 + + +0.397-0.238-0.106-93.98 + + +0.397-0.235-0.104-93.98 + + +0.399-0.232-0.104-93.98 + + +0.401-0.229-0.103-91.48 + + +0.402-0.227-0.102-93.98 + + +0.404-0.224-0.102-93.98 + + +0.405-0.221-0.100-93.98 + + +0.406-0.219-0.098-91.48 + + +0.407-0.216-0.098-91.48 + + +0.409-0.213-0.097-91.48 + + +0.409-0.210-0.096-93.98 + + +0.411-0.207-0.094-93.98 + + +0.411-0.204-0.094-91.48 + + +0.413-0.200-0.092-91.48 + + +0.414-0.199-0.092-91.48 + + +0.415-0.196-0.091-91.48 + + +0.416-0.193-0.090-93.98 + + +0.417-0.189-0.090-91.48 + + +0.417-0.189-0.088-93.98 + + +0.418-0.186-0.087-91.48 + + +0.419-0.182-0.086-93.98 + + +0.419-0.179-0.086-91.48 + + +0.420-0.176-0.084-91.48 + + +0.421-0.174-0.082-91.48 + + +0.421-0.172-0.082-91.48 + + +0.421-0.169-0.081-91.48 + + +0.421-0.166-0.080-91.48 + + +0.422-0.164-0.081-87.96 + + +0.423-0.161-0.079-87.96 + + +0.422-0.159-0.077-91.48 + + +0.422-0.155-0.077-91.48 + + +0.424-0.152-0.076-93.98 + + +0.424-0.150-0.075-91.48 + + +0.424-0.147-0.075-93.98 + + +0.424-0.146-0.074-91.48 + + +0.425-0.142-0.071-91.48 + + +0.424-0.141-0.071-93.98 + + +0.424-0.138-0.071-91.48 + + +0.424-0.135-0.069-91.48 + + +0.424-0.132-0.068-91.48 + + +0.424-0.129-0.066-91.48 + + +0.424-0.128-0.066-91.48 + + +0.422-0.126-0.066-91.48 + + +0.423-0.122-0.063-91.48 + + +0.422-0.121-0.062-91.48 + + +0.422-0.118-0.061-91.48 + + +0.421-0.116-0.061-87.96 + + +0.421-0.113-0.061-87.96 + + +0.421-0.112-0.059-87.96 + + +0.421-0.109-0.059-91.48 + + +0.420-0.105-0.057-87.96 + + +0.419-0.104-0.057-91.48 + + +0.418-0.102-0.057-87.96 + + +0.418-0.100-0.055-87.96 + + +0.417-0.097-0.054-91.48 + + +0.417-0.094-0.052-87.96 + + +0.416-0.092-0.052-87.96 + + +0.415-0.091-0.051-87.96 + + +0.415-0.089-0.050-87.96 + + +0.414-0.086-0.049-87.96 + + +0.413-0.084-0.047-87.96 + + +0.413-0.082-0.048-87.96 + + +0.412-0.080-0.046-87.96 + + +0.410-0.079-0.046-87.96 + + +0.409-0.076-0.044-87.96 + + +0.409-0.074-0.044-87.96 + + +0.407-0.072-0.044-87.96 + + +0.406-0.071-0.043-87.96 + + +0.406-0.067-0.042-81.94 + + +0.404-0.065-0.041-81.94 + + +0.402-0.063-0.039-87.96 + + +0.402-0.062-0.037-87.96 + + +0.401-0.061-0.038-87.96 + + +0.399-0.059-0.036-87.96 + + +0.399-0.056-0.037-87.96 + + +0.398-0.054-0.036-87.96 + + +0.396-0.053-0.035-87.96 + + +0.394-0.051-0.033-87.96 + + +0.392-0.048-0.032-87.96 + + +0.392-0.045-0.032-87.96 + + +0.390-0.044-0.031-87.96 + + +0.389-0.044-0.029-87.96 + + +0.388-0.041-0.029-87.96 + + +0.386-0.039-0.029-87.96 + + +0.386-0.039-0.028-87.96 + + +0.384-0.036-0.027-87.96 + + +0.382-0.036-0.026-87.96 + + +0.380-0.033-0.027-81.94 + + +0.379-0.031-0.024-87.96 + + +0.377-0.030-0.024-87.96 + + +0.376-0.027-0.024-87.96 + + +0.374-0.026-0.023-87.96 + + +0.373-0.025-0.021-87.96 + + +0.371-0.024-0.021-87.96 + + +0.369-0.022-0.020-87.96 + + +0.367-0.019-0.019-87.96 + + +0.366-0.017-0.019-81.94 + + +0.365-0.016-0.017-81.94 + + +0.362-0.014-0.019-81.94 + + +0.361-0.013-0.017-87.96 + + +0.359-0.012-0.017-81.94 + + +0.358-0.011-0.015-81.94 + + +0.356-0.008-0.014-87.96 + + +0.354-0.006-0.012-81.94 + + +0.352-0.006-0.012-81.94 + + +0.351-0.004-0.012-81.94 + + +0.349-0.002-0.011-81.94 + + +0.347-0.001-0.010-81.94 + + +0.3440.001-0.008-81.94 + + +0.3420.001-0.009-81.94 + + +0.3410.001-0.007-81.94 + + +0.3390.002-0.006-81.94 + + +0.3360.004-0.006-81.94 + + +0.3350.006-0.006-81.94 + + +0.3330.008-0.006-81.94 + + +0.3310.009-0.005-81.94 + + +0.3290.009-0.004-81.94 + + +0.3270.011-0.0040.000 + + +0.3260.012-0.003-81.94 + + +0.3220.012-0.002-81.94 + + +0.3200.016-0.002-81.94 + + +0.3190.016-0.001-81.94 + + +0.3170.017-0.0010.000 + + +0.3160.019-0.001-81.94 + + +0.3140.0190.001-81.94 + + +0.3110.0210.001-81.94 + + +0.3080.0220.002-81.94 + + +0.3070.0230.002-81.94 + + +0.3040.0240.002-81.94 + + +0.3030.0240.004-81.94 + + +0.3010.0240.004-81.94 + + +0.2980.0260.004-81.94 + + +0.2960.0260.006-81.94 + + +0.2940.0290.0070.000 + + +0.2920.0280.006-81.94 + + +0.2900.0290.007-81.94 + + +0.2870.0300.007-81.94 + + +0.2860.0310.009-81.94 + + +0.2840.0320.009-81.94 + + +0.2810.0340.009-81.94 + + +0.2790.0340.009-81.94 + + +0.2760.0360.011-81.94 + + +0.2740.0360.011-81.94 + + +0.2720.0360.011-81.94 + + +0.2710.0380.012-81.94 + + +0.2680.0390.012-81.94 + + +0.2660.0390.013-81.94 + + +0.2640.0390.012-87.96 + + +0.2620.0410.014-81.94 + + +0.2600.0410.014-81.94 + + +0.2570.0410.015-81.94 + + +0.2560.0420.016-81.94 + + +0.2530.0420.016-81.94 + + +0.2510.0440.0160.000 + + +0.2490.0440.016-81.94 + + +0.2470.0440.017-81.94 + + +0.2440.0450.016-81.94 + + +0.2430.0460.0170.000 + + +0.2410.0460.017-81.94 + + +0.2390.0470.017-81.94 + + +0.2360.0460.017-81.94 + + +0.2340.0480.019-81.94 + + +0.2310.0490.019-81.94 + + +0.2280.0490.019-81.94 + + +0.2270.0500.020-81.94 + + +0.2240.0510.021-81.94 + + +0.2230.0510.021-81.94 + + +0.2210.0510.0200.000 + + +0.2180.0520.021-81.94 + + +0.2160.0510.021-81.94 + + +0.2140.0520.022-81.94 + + +0.2120.0540.022-81.94 + + +0.2100.0520.0220.000 + + +0.2070.0540.0230.000 + + +0.2050.0540.023-81.94 + + +0.2030.0550.0240.000 + + +0.2010.0560.024-81.94 + + +0.1990.0550.0240.000 + + +0.1960.0560.0240.000 + + +0.1940.0570.0250.000 + + +0.1920.0560.025-81.94 + + +0.1900.0570.0250.000 + + +0.1870.0570.0240.000 + + +0.1860.0570.026-81.94 + + +0.1840.0570.0260.000 + + +0.1810.0570.0270.000 + + +0.1780.0580.0270.000 + + +0.1770.0570.0270.000 + + +0.1740.0570.02681.94 + + +0.1720.0570.0270.000 + + +0.1700.0570.0270.000 + + +0.1680.0580.0270.000 + + +0.1670.0590.0290.000 + + +0.1650.0590.0280.000 + + +0.1630.0590.0280.000 + + +0.1610.0610.0310.000 + + +0.1590.0600.0280.000 + + +0.1560.0590.02981.94 + + +0.1540.0590.02881.94 + + +0.1520.0600.02981.94 + + +0.1500.0590.02981.94 + + +0.1480.0600.0290.000 + + +0.1470.0590.0290.000 + + +0.1440.0590.0290.000 + + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index f3a39d2..934741c 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -365,3 +365,67 @@ def test_a_waveform_with_the_early_record_is_timed_from_its_trigger(): # Blastware: 2019-09-26 11:14:08, record time 4 s (SFM read the stop, 11:14:12) assert (ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second) == (2019, 9, 26, 11, 14, 8) assert ev.timestamp_source in ("event_record", "estimate") + + +# ── Group A: identity, battery, trigger ───────────────────────────────────── +# The identity block before the setup name is what the live read gets from +# SUB FE (DeviceInfo): serial k-202, firmware k-147, DSP version k-138, +# calibration date k-132 and "by" k-128, manufacturer k-94, model k-72; the +# battery is a uint16 of hundredths of a volt at k-190. Measured against every +# DL2 report 2026-11-03 (serial, version, calibration 69,983 / 69,983). +import datetime as _dt # noqa: E402 + +_SF = "setup-fields-11-03-26" + + +def test_the_identity_block_is_read(): + # Blastware: BE18189, "V 10.72-8.17 MiniMate Plus", + # "February 20, 2019 by Instantel", "6.8 Volts" + ev = read_blastware_file(_FIX / _SF / "T189HUD6.QE0W") + di = ev.device_info + assert (di.serial, di.firmware_version, di.dsp_version, di.manufacturer, di.model) == ( + "BE18189", "S338.17", "10.72", "Instantel", "MiniMate Plus") + assert di.firmware_minor == 17 + assert (di.calibration_date, di.calibrated_by) == (_dt.date(2019, 2, 20), "Instantel") + assert abs(ev.battery_volts - 6.8) <= 0.05 + 1e-9 + + +def test_the_battery_is_kept_exact(): + # Blastware prints "6.3 Volts" for a stored 6.25: it rounds half up. + assert read_blastware_file(_FIX / _SF / "K558L4KY.440H").battery_volts == 6.25 + + +# (file, Blastware's Trigger as the event record's bitmask, geo level in/s, +# mic level psi or None, mic a trigger source) +@pytest.mark.parametrize("rel,by,geo,mic_psi,mic_src", [ + (f"{_SF}/T189HUD6.QE0W", 0x0008, 0.050, 0.0072, True), # MicL, 128.0 dB(L) + (f"{_SF}/T438L713.RY0W", 0x0002, 0.500, 0.0100, True), # Vert, 130.8 dB(L) + (f"{_SF}/M529I6LG.3Y0W", 0x0004, 0.050, 0.005, True), # Long, 0.005 psi(L) + ("bw-import-fields-10-29-26/R352HIUI.F40W", 0x0001, 0.400, None, False), # Tran + ("decode-checker-10-29-26/T1905KDW.5F0W", 0x0200, None, None, None), # Manual +]) +def test_the_trigger_comes_from_the_file(rel, by, geo, mic_psi, mic_src): + ev = read_blastware_file(_FIX / rel) + assert ev.triggered_by == by + if geo is not None: + assert abs(ev.trigger_level_geo - geo) <= 0.0005 + 1e-9 + if mic_psi is not None: + assert abs(ev.trigger_level_mic_psi - mic_psi) <= 0.0005 + 1e-9 # psi to 3 places, as printed + if mic_src is not None: + assert bool(ev.trigger_sources & 0x08) == mic_src + assert (ev.record_stop_mode, ev.mic_type) == (0, 2) # Fixed, Linear Weighting + + +def test_the_h5_carries_the_setup_fields(tmp_path): + import h5py + from sfm import event_hdf5 + ev = read_blastware_file(_FIX / _SF / "T189HUD6.QE0W") + event_hdf5.write_event_hdf5(tmp_path / "e.h5", ev, serial="BE18189") + with h5py.File(tmp_path / "e.h5", "r") as f: + a = f.attrs + assert abs(float(a["battery_volts"]) - 6.8) <= 0.05 + 1e-9 + assert (int(a["triggered_by"]), int(a["trigger_sources"])) == (0x0008, ev.trigger_sources) + assert abs(float(a["trigger_level_geo_ips"]) - 0.050) <= 0.0005 + 1e-9 + assert abs(float(a["trigger_level_mic_psi"]) - ev.trigger_level_mic_psi) < 1e-9 + assert (str(a["firmware_version"]), str(a["dsp_version"]), str(a["calibration_date"])) == ( + "S338.17", "10.72", "2019-02-20") diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index a37dca5..6c76c80 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -39,7 +39,8 @@ def test_event_type_comes_from_the_bytes(): def test_report_fields_stay_blank(): s = sfm_side((FIX / "T1905KDW.5F0W").read_bytes()) - for tag in ("TranZCFreq", "TranPeakAcceleration", "BatteryLevel", "Calibration", "TranTestResults"): + # (BatteryLevel and Calibration are read since 2026-11-03: test_the_setup_fields_match_blastware) + for tag in ("TranZCFreq", "TranPeakAcceleration", "TranTestResults"): assert s.values.get(tag) is None @@ -66,7 +67,7 @@ def test_full_waveform_row_verdicts(): "notes", "samples.Tran", "samples.Vert", "samples.Long"): assert res[f].verdict == "match", (f, res[f]) assert res["TranZCFreq"].verdict in ("sfm_blank", "no_reference") - assert res["BatteryLevel"].verdict == "sfm_blank" + assert res["BatteryLevel"].verdict == "match" # 6.72 V, printed "6.7 Volts" assert "FileName" not in res @@ -221,3 +222,50 @@ def test_blastware_counting_the_monitoring_time_is_accepted(): def test_the_count_carveout_needs_blastwares_own_table_to_agree_with_sfm(): assert _count_case(30, drop_rows=1).verdict == "mismatch" + + +_GROUP_A = ("SerialNumber", "Version", "Calibration", "BatteryLevel", "Trigger", + "GeoTriggerLevel", "MicTriggerLevel", "RecordStopMode", "Microphone", "Units") + + +@pytest.mark.parametrize("stem,printed", [ + ("T189HUD6.QE0W", set(_GROUP_A)), + ("T438L713.RY0W", set(_GROUP_A)), # 130.8 dB(L): 0.01 psi at 6895 Pa/psi + ("K558L4KY.440H", {"SerialNumber", "Version", "Calibration", "BatteryLevel", + "Microphone", "Units"}), # histogram; battery 6.25 -> "6.3" +]) +def test_the_setup_fields_match_blastware(stem, printed): + sf = FIX.parent / "setup-fields-11-03-26" + res = {r.field: r for r in compare(sfm_side((sf / stem).read_bytes()), + parse_xml_report_file(sf / (stem.replace(".", "_", 1) + "_XML.XML")), + CARVEOUTS)} + assert printed <= set(res) + for f in printed: + assert res[f].verdict == "match", (f, res[f]) + + +def test_a_manual_trigger_matches(): + res = _results("T1905KDW.5F0W", CARVEOUTS) + assert res["Trigger"].verdict == "match" + + +def _units_case(sfm_units): + sf = FIX.parent / "setup-fields-11-03-26" + ref = parse_xml_report_file(sf / "T189HUD6_QE0W_XML.XML") + ref.scalars["Units"] = "in/s and psi(L)" + side = sfm_side((sf / "T189HUD6.QE0W").read_bytes()) + if sfm_units is not None: + side.values["Units"] = sfm_units + return {r.field: r for r in compare(side, ref, CARVEOUTS)}["Units"] + + +def test_dB_or_psi_is_blastwares_display_preference(): + # Blastware writes its report in its PC's current preference; DL2's reports + # switch fleet-wide in 61 clean runs by write time, and no byte in the file + # tells them apart. + r = _units_case(None) + assert (r.verdict, r.carveout) == ("accepted", "units-is-a-display-preference") + + +def test_the_units_carveout_still_needs_the_mic(): + assert _units_case("in/s").verdict == "mismatch" -- 2.54.1 From 8d5a9987c93863c4b5c548f98d4f7218572bd342 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 14:02:27 -0500 Subject: [PATCH 181/223] fix(decode_check): compare a mic level in the unit it is printed in K441LA17.IN0W's report says Units 'in/s and psi(L)' yet prints MicTriggerLevel '125.0 dB(L)'. The value states its own unit, so that is the one compared; the report's Units is the fallback. It was the only MicTriggerLevel mismatch in DL2 (SFM's 0.005158 psi is 125.0 dB). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 4 +++- tests/test_decode_check.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 63f09f0..e3d396b 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -191,7 +191,9 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie if not printed.strip() or printed.strip() == "N/A": return FieldResult(tag, "no_reference", printed, None) if tag in ("MicLPSPL", "MicTriggerLevel"): - units = ref.event_units or "" + # A printed value that states its unit is compared in that unit: + # K441LA17.IN0W's Units say psi(L), its MicTriggerLevel "125.0 dB(L)". + units = printed if ("dB(L)" in printed or "psi(L)" in printed) else (ref.event_units or "") key = (f"{tag} dB(L)" if "dB(L)" in units else f"{tag} psi(L)" if "psi(L)" in units else None) value = sfm.values.get(key) if key else None diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 6c76c80..da1eca3 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -269,3 +269,13 @@ def test_dB_or_psi_is_blastwares_display_preference(): def test_the_units_carveout_still_needs_the_mic(): assert _units_case("in/s").verdict == "mismatch" + + +def test_a_mic_trigger_level_is_read_in_the_unit_it_is_printed_in(): + # K441LA17.IN0W: Units "in/s and psi(L)", yet MicTriggerLevel "125.0 dB(L)". + # The printed value states its own unit; that is the one to compare in. + sf = FIX.parent / "setup-fields-11-03-26" + ref = parse_xml_report_file(sf / "T189HUD6_QE0W_XML.XML") # 128.0 dB(L) + ref.event_units = "in/s and psi(L)" + res = {r.field: r for r in compare(sfm_side((sf / "T189HUD6.QE0W").read_bytes()), ref, CARVEOUTS)} + assert res["MicTriggerLevel"].verdict == "match", res["MicTriggerLevel"] -- 2.54.1 From 5326e99ac2ec06b03527c267024ba25a45963ef8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 14:19:19 -0500 Subject: [PATCH 182/223] fix(sfm): a monitoring MiniMate's call-home says 'stop monitoring first', not 'unknown(0x6E)' Measured at the bench 2026-11-03 (BE9441): while monitoring, a MiniMate answers the 0x2C call-home read with its DEVICE-INFO block ('Instantel', 'MiniMate Plus', its serial) -- as it answers 1A -- and idle again, minutes later, the call-home block. SFM writes back only a block it just read, so a monitoring MiniMate's call-home cannot be changed; the change core already refused (byte 5 read as 'unknown(0x6E)', nothing sent), but said so cryptically. - minimateplus.protocol.is_call_home_block(raw): the block starts with its own length 0x7C and is N (or N + 2) bytes unescaped; the device-info block fails it. - The Series-3 change raises UnitStateUnknown (409) with 'did not return its call-home settings -- a MiniMate answers the call-home read with its device-info block while monitoring; stop monitoring first ... nothing sent', for a dry run too. call_home_state returns enabled = None with that reason. - The page's callHomeRows shows the reason in place of 'Unknown (byte 5 = ...)'. A blind write while monitoring stays untested on purpose. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- minimateplus/protocol.py | 11 ++++++++++ sfm/device_access/s3.py | 22 ++++++++++++++----- sfm/static/device_routing.js | 3 ++- tests/test_s3_call_home.py | 34 +++++++++++++++++++++++++++++ tests/test_webapp_device_routing.py | 7 ++++++ 5 files changed, 71 insertions(+), 6 deletions(-) diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 65ebeb3..f70b62d 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -169,6 +169,17 @@ class ImageRefused(ValueError): """A write refused before any byte was sent: the image is not a whole block.""" +def is_call_home_block(raw: bytes) -> bool: + """Whether a 0x2C reply payload is the call-home block: it starts with its own + length N = 0x7C (00 7C DC on every read on record) and is N (or N + 2) bytes + unescaped. A MONITORING MiniMate answers the read with its device-info block + instead (00 00 00 08 'Instantel' ..., measured 2026-11-03 on BE9441), which + fails this.""" + image = unescape_reply(bytes(raw)) + n = DATA_LENGTHS[SUB_CALL_HOME] + return len(image) >= 3 and int.from_bytes(image[:2], "big") == n and len(image) in (n, n + 2) + + def call_home_enabled(raw: bytes) -> Optional[bool]: """The call-home switch of a `0x2C` reply payload, read UNESCAPED (an escaped byte before it would move the raw index -- bench finding #1's lesson): byte 5, diff --git a/sfm/device_access/s3.py b/sfm/device_access/s3.py index 2fd16ef..4e0cc63 100644 --- a/sfm/device_access/s3.py +++ b/sfm/device_access/s3.py @@ -13,12 +13,12 @@ from minimateplus.event_file_io import _GEO_INT16_FS from minimateplus.framing import build_bw_write_frame, unescape_reply from minimateplus.protocol import ( SUB_CALL_HOME_CONFIRM, SUB_CALL_HOME_WRITE, SUB_START_MONITORING, SUB_STOP_MONITORING, - ImageRefused, call_home_enabled, call_home_image, write_image, + ImageRefused, call_home_enabled, call_home_image, is_call_home_block, write_image, ) from minimateplus.transport import TcpTransport from .errors import (DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent, - WrongUnit, translate) + UnitStateUnknown, WrongUnit, translate) from .change import call_home_change, monitoring_change, run_change from .events import iso_of, make_event_id, stamp_of from .models import (CallHomeState, ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress, @@ -39,6 +39,13 @@ S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use # writes (BE11529, 2026-04-20) byte for byte from the unit's own reads. S3_CALL_HOME_FRAME_VERIFIED = True +# Measured 2026-11-03 (BE9441): while monitoring, a MiniMate answers the 0x2C read +# with its device-info block, as it answers 1A -- its call-home settings cannot be +# read, so they cannot be changed (SFM writes back only a block it just read). +S3_CALL_HOME_WHILE_MONITORING = ("did not return its call-home settings -- a MiniMate answers the " + "call-home read with its device-info block while monitoring; " + "stop monitoring first, then change call-home") + # The 0x1C flag byte (section[1]): the only values ever measured. 0x10 is # BE11529 monitoring (2026-04-08); 0x0B is BE9441 recording a histogram, # confirmed at the unit (2026-10-26). Anything else is refused for a change. @@ -349,11 +356,14 @@ class Series3Adapter: client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S) raw = client.read_call_home_raw() image = unescape_reply(raw) + detail = {"byte5": f"0x{image[5]:02X}" if len(image) > 5 else None, + "block": bytes(raw).hex(), "serial_verified": False} + if not is_call_home_block(raw): + detail["reason"] = f"the unit {S3_CALL_HOME_WHILE_MONITORING}" + return CallHomeState(serial=serial, series=3, enabled=None, dial_string=None, detail=detail) dial = bytes(image[6:46]).split(b"\x00", 1)[0].decode("ascii", errors="replace") or None return CallHomeState(serial=serial, series=3, enabled=call_home_enabled(raw), - dial_string=dial, - detail={"byte5": f"0x{image[5]:02X}" if len(image) > 5 else None, - "block": bytes(raw).hex(), "serial_verified": False}) + dial_string=dial, detail=detail) return self._run(address, op) def change_call_home(self, address: UnitAddress, serial: str, *, enabled: bool, dry_run: bool, @@ -378,6 +388,8 @@ class Series3Adapter: def read_state() -> str: client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S) raw = client.read_call_home_raw() + if not is_call_home_block(raw): + raise UnitStateUnknown(f"{serial} {S3_CALL_HOME_WHILE_MONITORING} -- nothing sent") reads.append(raw) on = call_home_enabled(raw) if on is None: diff --git a/sfm/static/device_routing.js b/sfm/static/device_routing.js index e2f44a0..dcf3a02 100644 --- a/sfm/static/device_routing.js +++ b/sfm/static/device_routing.js @@ -204,8 +204,9 @@ function serialPanes(bySerial, settingsRead) { // enable byte never measured -- shown with the byte, never as On or Off. function callHomeRows(state) { const s = state || {}; + const d = s.detail || {}; const sw = s.enabled === true ? 'On' : s.enabled === false ? 'Off' - : `Unknown (byte 5 = ${(s.detail || {}).byte5 ?? '?'})`; + : d.reason || `Unknown (byte 5 = ${d.byte5 ?? '?'})`; return [['Call-home', sw], ['Dial string', s.dial_string || '—'], ['Series', s.series]]; } /* */ diff --git a/tests/test_s3_call_home.py b/tests/test_s3_call_home.py index c72c3c5..4612127 100644 --- a/tests/test_s3_call_home.py +++ b/tests/test_s3_call_home.py @@ -145,3 +145,37 @@ def test_a_pre_wire_refusal_is_recorded_as_nothing_sent(): ((_, row),) = audit.rows.items() assert (row["outcome"], row["sent"]) == ("failed", 0) assert row["error"].startswith("refused before sending") + + + +# Measured 2026-11-03 (BE9441): while monitoring, a MiniMate answers the 0x2C read +# with its DEVICE-INFO block ("Instantel", "MiniMate Plus", its serial), not its +# call-home block -- as it answers 1A. Idle again, it returns the call-home block. +# SFM says so plainly instead of "run state unknown(0x6E)". + +def device_info_shaped(serial=b"BE9441"): + """Shaped like BE9441's reply (its first bytes: 00 00 00 08 'Instantel').""" + block = b"\x00\x00\x00\x08Instantel".ljust(26, b"\x00") + b"MiniMate Plus".ljust(16, b"\x00") + serial + return block.ljust(126, b"\x00") + + +def test_a_call_home_block_is_told_from_the_device_info_block(): + from minimateplus.protocol import is_call_home_block + assert is_call_home_block(s3_call_home_raw()) is True + assert is_call_home_block(device_info_shaped()) is False + + +@pytest.mark.parametrize("dry_run", [True, False]) +def test_a_monitoring_minimate_is_told_to_stop_first_and_nothing_is_sent(dry_run): + fake = FakeMiniMateClient(call_home_raw=device_info_shaped()) + with pytest.raises(UnitStateUnknown) as e: + change(adapter(fake), enabled=True, dry_run=dry_run) + msg = str(e.value) + assert "monitoring" in msg and "stop" in msg and "nothing sent" in msg + assert e.value.http_status == 409 and fake.writes == [] + + +def test_the_call_home_state_of_a_monitoring_minimate_says_why(): + st = adapter(FakeMiniMateClient(call_home_raw=device_info_shaped())).call_home_state(TCP, "BE18193") + assert st.enabled is None + assert "monitoring" in st.detail["reason"] diff --git a/tests/test_webapp_device_routing.py b/tests/test_webapp_device_routing.py index 37e3578..2ea7ffd 100644 --- a/tests/test_webapp_device_routing.py +++ b/tests/test_webapp_device_routing.py @@ -327,3 +327,10 @@ def test_call_home_rows(): assert r[0] == [["Call-home", "On"], ["Dial string", "RADIO RING"], ["Series", 4]] assert r[1] == [["Call-home", "Off"], ["Dial string", "—"], ["Series", 3]] assert r[2][0] == ["Call-home", "Unknown (byte 5 = 0x07)"] + + + +def test_call_home_rows_say_why_a_switch_did_not_read(): + r = run(["callHomeRows", [{"enabled": None, "dial_string": None, "series": 3, + "detail": {"byte5": "0x6E", "reason": "not readable while monitoring -- stop it first"}}]]) + assert r[0][0] == ["Call-home", "not readable while monitoring -- stop it first"] -- 2.54.1 From f35845d4031c58d473fe49dc49afb7c99d7ea9fa Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 15:32:02 -0500 Subject: [PATCH 183/223] fix(sfm): a Micromate's call-home is refused while monitoring, and only a real call-home block is ever edited Measured at the bench 2026-11-03 (UM20147): monitoring, a Micromate returns its real call-home block and ACKS a call-home write, but does not apply it -- three read-backs unchanged, and its own menu says 'Feature disabled while monitoring'. SFM now refuses up front (UnitStateUnknown, 409: '... is monitoring -- a Micromate ignores call-home changes while monitoring ...; stop monitoring first -- nothing sent'), dry run included, instead of sending a write the unit ignores. And the block must be the call-home block: micromate.writes.is_call_home_content checks its header is its own length (00 7C, N = 124 -- 00 7C DC on every read, UM12947 and UM20147). plan_call_home_enabled refuses any other 126 bytes, the change refuses before sending, and call_home_state says why (enabled = None). At the bench this was checked by eye before the monitoring write. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- micromate/writes.py | 10 +++++++ sfm/device_access/s4.py | 27 ++++++++++++++++--- tests/test_device_access_s4_call_home.py | 34 ++++++++++++++++++++++++ tests/test_micromate_writes.py | 7 +++++ 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/micromate/writes.py b/micromate/writes.py index 61bd3c2..71f2713 100644 --- a/micromate/writes.py +++ b/micromate/writes.py @@ -101,6 +101,13 @@ def plan_stop_monitoring() -> WritePlan: return WritePlan("stop monitoring", (WriteStep(0x97, _CONFIRM, what="stop monitoring"),)) +def is_call_home_content(block: bytes) -> bool: + """Whether 126 bytes are the 0x2C call-home content: its header is its own + length (00 7C, N = 124 -- 00 7C DC on every read on record, UM12947 and + UM20147). A bit is flipped only in a block that carries it.""" + return len(block) == _CALL_HOME_LEN and int.from_bytes(block[0:2], "big") == _CALL_HOME_LEN - 2 + + def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: """Read `0x2C`, flip bit 0 of content[5], send the rest back byte for byte. @@ -113,6 +120,9 @@ def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan: if len(call_home) != _CALL_HOME_LEN: raise ValueError(f"call-home content must be {_CALL_HOME_LEN} B " f"(the size THOR's offset was seen at), got {len(call_home)}") + if not is_call_home_content(call_home): + raise ValueError(f"call-home content's header is {call_home[0:2].hex()}, not its own length " + f"(00 {_CALL_HOME_LEN - 2:02x}) -- not the call-home block; nothing built") b5 = (call_home[5] | 0x01) if enabled else (call_home[5] & 0xFE) data = call_home[:5] + bytes([b5]) + call_home[6:] what = "call-home " + ("enable" if enabled else "disable") diff --git a/sfm/device_access/s4.py b/sfm/device_access/s4.py index b0a881a..57b8f95 100644 --- a/sfm/device_access/s4.py +++ b/sfm/device_access/s4.py @@ -19,12 +19,14 @@ from typing import Any, Callable, Optional, TypeVar from micromate.client import MicromateClient from micromate.opcodes import OpcodeRefused from micromate.protocol import THOR_CHUNK_SIZE -from micromate.writes import plan_call_home_enabled, plan_start_monitoring, plan_stop_monitoring +from micromate.writes import ( + is_call_home_content, plan_call_home_enabled, plan_start_monitoring, plan_stop_monitoring, +) from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport from .errors import ( AuditIncomplete, CallHomeInProgress, ChangeUnconfirmed, DeviceError, EventNotFound, - MalformedReply, StaleEvent, WrongUnit, translate, + MalformedReply, StaleEvent, UnitStateUnknown, WrongUnit, translate, ) from .change import CALL_HOME_MESSAGE, call_home_change, monitoring_change, run_change from .events import iso_of, make_event_id, stamp_of @@ -383,12 +385,24 @@ def _changed_offsets(before: bytes, after: bytes) -> list: if (before[i] if i < len(before) else None) != (after[i] if i < len(after) else None)] +# Measured 2026-11-03 (UM20147): monitoring, a Micromate returns its real call-home +# block and ACKS a write, but does not apply it -- its own menu: "Feature disabled +# while monitoring". So SFM refuses before sending one it would ignore. +S4_CALL_HOME_WHILE_MONITORING = ("is monitoring -- a Micromate ignores call-home changes while " + "monitoring (its own menu: 'Feature disabled while monitoring'); " + "stop monitoring first, then change call-home") +_NOT_CALL_HOME = "returned a block that is not its call-home block (header {}, not 007c)" + + def s4_call_home_state(client: Any, serial: str) -> CallHomeState: """Bit 0 of content[5] is the enable (UM12947 reads 0x05 / 0x04, UM20147 0x01).""" block = client.get_call_home_content() + detail = {"byte5": f"0x{block[5]:02X}" if len(block) > 5 else None, "block": block.hex()} + if not is_call_home_content(block): + detail["reason"] = "the unit " + _NOT_CALL_HOME.format(block[0:2].hex()) + return CallHomeState(serial=serial, series=4, enabled=None, dial_string=None, detail=detail) return CallHomeState(serial=serial, series=4, enabled=bool(block[5] & 0x01), - dial_string=_dial_string(block), - detail={"byte5": f"0x{block[5]:02X}", "block": block.hex()}) + dial_string=_dial_string(block), detail=detail) def s4_change_call_home(client: Any, serial: str, *, enabled: bool, dry_run: bool, @@ -406,7 +420,12 @@ def s4_change_call_home(client: Any, serial: str, *, enabled: bool, dry_run: boo run = client.read_run_state().name if run == "calling_home" or run.startswith("unknown"): return run # the core refuses both; a write waits for a known state + if run == "monitoring" and not reads: + raise UnitStateUnknown(f"{serial} {S4_CALL_HOME_WHILE_MONITORING} -- nothing sent") block = client.get_call_home_content() + if not is_call_home_content(block): + raise UnitStateUnknown(f"{serial} " + _NOT_CALL_HOME.format(block[0:2].hex()) + + " -- nothing sent") reads.append(block) return "enabled" if block[5] & 0x01 else "disabled" diff --git a/tests/test_device_access_s4_call_home.py b/tests/test_device_access_s4_call_home.py index 6711810..af72742 100644 --- a/tests/test_device_access_s4_call_home.py +++ b/tests/test_device_access_s4_call_home.py @@ -114,3 +114,37 @@ def test_a_lost_ack_still_records_what_the_unit_holds(): assert (r.outcome, r.sent) == ("failed", True) snap = r.detail["snapshot"] assert snap["changed_offsets"] == [] and snap["before"] == snap["after"] # the write did not land + + + +# Measured at the bench 2026-11-03 (UM20147): a MONITORING Micromate returns its +# real call-home block and ACKS a write, but does not apply it -- its own menu says +# "Feature disabled while monitoring". SFM refuses up front and says why, rather +# than send a write the unit will ignore. + +@pytest.mark.parametrize("dry_run", [True, False]) +def test_s4_call_home_is_refused_while_monitoring(dry_run): + from sfm.device_access.errors import UnitStateUnknown + fake = FakeMicromateClient(run_states=[0x02]) + with pytest.raises(UnitStateUnknown) as e: + change(fake, enabled=False, dry_run=dry_run) + msg = str(e.value) + assert "monitoring" in msg and "stop" in msg and "nothing sent" in msg + assert fake.executed == [] + + +# The block's header is its own length (00 7C, N = 124); SFM flips a bit only in a +# block that carries it, never in whatever 126 bytes came back. + +def test_s4_a_block_that_is_not_the_call_home_block_sends_nothing(): + from sfm.device_access.errors import UnitStateUnknown + fake = FakeMicromateClient(call_home=bytes(126)) + with pytest.raises(UnitStateUnknown) as e: + change(fake, enabled=False) + assert "not its call-home block" in str(e.value) + assert fake.executed == [] + + +def test_s4_state_of_a_block_that_is_not_the_call_home_block_says_why(): + st = s4_call_home_state(FakeMicromateClient(call_home=bytes(126)), "UM20147") + assert st.enabled is None and "not its call-home block" in st.detail["reason"] diff --git a/tests/test_micromate_writes.py b/tests/test_micromate_writes.py index 5e475d4..f6cdbed 100644 --- a/tests/test_micromate_writes.py +++ b/tests/test_micromate_writes.py @@ -265,3 +265,10 @@ def test_setup_push_refuses_a_block_whose_own_length_header_is_wrong(): bad[0:2] = (int.from_bytes(bad[0:2], "big") + 1).to_bytes(2, "big") with pytest.raises(ValueError, match="header"): plan_setup_push(reads[0x08], reads[0x2E], bytes(bad), "x.mmb") + + + +def test_call_home_refuses_a_block_whose_header_is_not_its_length(): + # 126 bytes, but not the call-home block: its header must be its own length (00 7C). + with pytest.raises(ValueError, match="header"): + plan_call_home_enabled(bytes(126), True) -- 2.54.1 From 789e24be50fd98f05c5ba28e4b4e2017224445ee Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 15:32:02 -0500 Subject: [PATCH 184/223] fix(sfm): the top bar names a Micromate's firmware line; a stale overlay comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The page's top bar Firmware read '—' for a Micromate: Batch 2 gave the Device tab's card firmwareLabel() but not populateDeviceBar. Seen at the bench 2026-11-03; checked in jsdom ('—' before, 'Thor line (version not read)' after). - save_imported_bw's overlay comment said the waveform codec was undecoded and gave +-10 in/s; the overlay now stays because production keeps a paired Blastware report as the record until the file-only decode has no blanks (flagged by the decode-checker session). Comment only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/static/sfm_webapp.js | 2 +- sfm/waveform_store.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sfm/static/sfm_webapp.js b/sfm/static/sfm_webapp.js index 1a707d4..4d7a3a2 100644 --- a/sfm/static/sfm_webapp.js +++ b/sfm/static/sfm_webapp.js @@ -346,7 +346,7 @@ async function loadEventList() { // ── Device bar ───────────────────────────────────────────────────────────────── function populateDeviceBar() { qs('di-serial').textContent = unitInfo.serial || '—'; - qs('di-fw').textContent = unitInfo.firmware_version || unitInfo.firmware || '—'; + qs('di-fw').textContent = firmwareLabel(unitInfo); const cc = unitInfo.compliance_config || {}; qs('di-sr').textContent = cc.sample_rate ? `${cc.sample_rate} sps` : '—'; qs('di-rt').textContent = cc.record_time != null ? `${cc.record_time.toFixed(1)} s` : '—'; diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index 7bce4e8..5ac0788 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -345,14 +345,15 @@ class WaveformStore: exc, ) - # If we have a report, overlay its device-authoritative fields - # (peaks, project, sample_rate, record_time) onto the Event - # BEFORE handing it to db.insert_events(). Without this overlay - # the DB row gets `peak_values` from _peaks_from_samples(), which - # runs the still-undecoded waveform codec on the BW body and - # produces ±10 in/s saturation values on every channel for every - # event. The sidecar JSON had the correct values via - # event_to_sidecar_dict(bw_report=...) but the DB columns didn't. + # If we have a report, overlay its fields (peaks, project, + # sample_rate, record_time) onto the Event BEFORE handing it to + # db.insert_events(). The file decode reads these itself now (the + # decode checker compares it with Blastware's XML reports, DL2's + # 70,042 events); the overlay stays because production keeps a + # paired Blastware report as the record until the file-only decode + # has no blanks. The sidecar's `bw_report` block keeps the report's + # own values either way. (The old reason -- an undecoded codec + # giving ±10 in/s -- has not held since the 2026-08 codec fixes.) if bw_report is not None: try: event_file_io.apply_report_to_event(ev, bw_report) -- 2.54.1 From 2e1c2ba21f63c195aba6563c1ef34d7a2a48a331 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 15:32:51 -0500 Subject: [PATCH 185/223] docs: phase 4 bench -- call-home on/off on both series, idle and monitoring Benched 2026-11-03 on UM20147 and BE9441 (each on its own modem, one send per go): idle, a no-op, off and on all acked, read back and confirmed on each unit's menu; UM20147 accepts 0x00 at [5]. Monitoring, neither series takes a change: a MiniMate answers 0x2C with its device-info block, a Micromate acks and ignores ('Feature disabled while monitoring'). Series 4 [118:120] is a function of the block's content -- XOR 0x6D7D per bit-0 flip on two units, not a nonce. A stop's call-in reached THOR when the ring followed the ack. UM20147's clock is an hour ahead (DST). Spec, both protocol references (Series III: a CRLF row), CLAUDE.md. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- CLAUDE.md | 8 +++- docs/instantel_protocol_reference.md | 1 + docs/micromate_protocol_reference.md | 39 +++++++++++++++++++ .../2026-10-20-sfm-series4-parity-design.md | 21 ++++++++-- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e71c933..ef0ba9f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -236,10 +236,14 @@ Read this first when picking the project back up. `3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write encoder refuses a patch that would not read back -- its offsets are 1024-sps raw ones, #46). - **Phase 4 built 2026-11-02, not yet benched:** call-home on/off by serial for + **Phase 4 built 2026-11-02, benched 2026-11-03:** call-home on/off by serial for both series (`GET /device/call_home/state`, `POST /device/call_home/{enable,disable}`, the page's Call Home tab). The MiniMate frame is Blastware's byte for byte - (`tests/test_s3_call_home_bw_frames.py`, the 4-20-26 captures). + (`tests/test_s3_call_home_bw_frames.py`, the 4-20-26 captures). On both units, + idle, the no-op, off and on writes were all verified and agreed with the unit's + menu. ⚠ **Neither series takes a call-home change while monitoring:** a MiniMate + returns its device-info block, and a Micromate acks the write and ignores it. + SFM refuses both up front. **Ring path measured the same night:** with THOR's watchdog off, a call-home reaches THOR when nobody holds the line, and **is lost when SFM holds it** -- the unit takes SFM's connection for the call, times out and does not retry. diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index bfed858..2977d63 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-03 | call home (SUB 2C / 7E / 7F) | **SFM's call-home write, measured both ways.** SFM's 0x7E image (`write_image` of the 0x2C read with byte 5 set, framed ONCE) and its 0x7F confirm reproduce Blastware's 2026-04-20 enable and disable writes byte for byte (BE11529; `tests/test_s3_call_home_bw_frames.py`). Live on BE9441, idle: a no-op, on and off were all acked (0x81 / 0x80) and read back, and the unit's menu agreed. Only byte 5 changes: no unit-maintained field, unlike Series 4's `[118:120]`. Byte 5 is read from the UNESCAPED block. ⚠ Unescaping is not idempotent, so a built image must never pass through `write_image` again: a call-in time of 16:02-16:04 is `10 02`-`10 04` in the image. ⚠ **While monitoring, the unit answers the 0x2C read with its DEVICE-INFO block** ('Instantel', 'MiniMate Plus', its serial), as it answers 1A. Idle again, minutes later, it returns the call-home block. So a monitoring unit's call-home cannot be read-modify-written; SFM refuses with 'stop monitoring first'. A blind write while monitoring stays untested on purpose. | | 2026-10-29 | §7.6.1, §6 | **The SUB 1A settings fields are read AFTER unescaping (measured, BE9441).** The unit escapes 02/03/04/10 in its replies and `S3FrameParser` keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped mode, sample rate or interval shifts every field after it: BE9441 at Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval, and a Continuous unit read as Single Shot. After `unescape_reply`, every recorded reply (4 settings, two of them Blastware's own writes: 15 min, then 2 s) has one layout: **mode anchor−7, sample rate anchor−6 (u16 BE), histogram interval anchor−4 (u16 BE, s), record time anchor+6 (f32 BE)**. ⚠ The older table's "anchor−7 = constant 0x10" (and mode at anchor−8) was the escape in front of `04` at 1024 sps — right only at that rate. The channel block (`Tran`+28 scale, +33 range, +34 trigger) and the note strings are correct on the RAW bytes and wrong unescaped; 🔶 open: a trigger/alarm float that itself contains 02/03/04/10 would read shifted there. Also measured: **while monitoring, BE9441 answered the 1A reads with its device-info block** (`BE9441`, `Instantel` — the 0x01 reply), so no settings can be read then; the decoder leaves them unknown. The 2026-10-17 anchor question is untouched: every reply measured so far carries the anchor. Fixed in SFM `b320a53`. ⚠ **The write side was not moved:** `_encode_compliance_config` still patches the raw bytes at the 1024-sps offsets (mode anchor−8), which at 2048/4096 sps rewrite the byte in front of the mode (measured on BE9441's 10-25 block); it now refuses a patch whose four fields do not read back as asked (`a72d3a9`) until rewritten on unescaped bytes (#46). | | 2026-10-27 | §3 writes | **⚠ RETRACTS the write-frame model (#46, measured).** Every Blastware request on record re-encodes under the uniform rule (02/03/04/10 escaped, SUM8): 3,869/3,869 frames in the Feb–Apr 2026 captures, plus BE9441's 26 write frames of 2026-10-26. A write's [4:6] is its data LENGTH. Config blocks are their header N + 2 bytes: event index (68) and trigger (82) are written as read plus `02 00` / `00 00` (constant on 15 sends); waveform data (69) and the 2,092-byte compliance image (71) are written whole, the latter in addressed chunks (params[2:4] = address; 1,024 B in March, 512 B with Blastware 10.74). The trailing two bytes are not a CRC and went out stale, so the unit evidently ignores them. "Only BW_CMD doubled", the "DLE-aware checksum", "offset = data[1] + 2" and "chunks 1,027 / 1,055 at offset 0x1004" were these frames read with their escape bytes in. The trigger block is read first (SUB 0x2E, 26 bytes); its byte 5 has been 01 / 03 / 04 by unit and session (meaning unknown). | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index 6783664..9c54cab 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2693,6 +2693,45 @@ noted, which is cheap to collect during any future ACH capture. Neighbouring bytes: `write[117]` is `0x03`, lining up with Series III's `num_retries` of 3, and `write[120:122]` is `00 3c` = 60. +#### Bench 2026-11-03: SFM's own call-home writes to UM20147 + +SFM's audited `POST /device/call_home/{enable,disable}`, one send per go. +Audit records are in the bench DB. + +**Measured, idle:** +- UM20147 reads `content[5] = 0x01` for on. It **accepts `0x00` for off**, a + value THOR was never seen writing. The read-back reads off, and the unit's own + menu said "Auto Call Home: Disabled"; on again, "Enabled". +- **A no-op write is acked** (`0x81`, `0x80`), and `[118:120]` does **not** move: + `8fab` → `8fab`. +- **Flipping bit 0 of `[5]` moves `[118:120]` by XOR `0x6D7D`, both directions:** + `8fab` ↔ `e2d6`. That is the same XOR as UM12947's `0x04` ↔ `0x05` above, on + a different unit with a different block. Writing the original block back + restores the original value (`8fab`). + +This **settles the open question above (hash vs nonce): it is not a per-write +nonce.** The field is a function of the block's content, and the fixed delta +for a fixed bit flip is the signature of a linear checksum (CRC family) over a +region that includes `[5]`. The fixed-delta part is *inferred*. A desk lead: +solve the polynomial from the deltas; the earlier sweep's regions or variants +were wrong. + +**Measured, monitoring:** +- The unit returns its **real** call-home block (`00 7C DC`…). +- It **acks** a `0x7E`/`0x7F` write but **does not apply it**: three read-backs + over 3 s were unchanged, and `[118:120]` did not move. After the stop, + call-home still read on, so the write was **ignored, not staged**. +- Its own menu refuses the call-home screen while monitoring: **"Feature + disabled while monitoring"**. +- SFM therefore refuses a call-home change while monitoring (`f35845d`). + +**Measured, also:** +- A stop with call-home on started a call-in **after** the stop's ack. SFM hung + up within about 1 s, and the call **reached THOR**: the session's histogram + arrived. (2026-10-29 Run A lost the call: there the ring replaced the ack.) +- UM20147's clock read one hour ahead after daylight saving ended (16:09:25 at + 15:09:22 EST). + ⚠ Beyond the enable byte and the dial string, **the field map is not established** — only one setting was varied. Series III's offsets are a starting hypothesis, not a transfer. diff --git a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md index fb25005..21cab8c 100644 --- a/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md +++ b/docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md @@ -576,10 +576,23 @@ Each safety piece arrives with its first real use, so nothing sits untested. 16:02-16:04 call-in time would have been refused as 'sent' or sent shifted -- fixed with a test through the real protocol (`bdd76b8`), plus a pre-wire refusal audited as nothing sent, an unknown Series-4 run state refused, and the snapshot - kept on a lost ack (`9e03b3f`). **Not yet at the bench.** Bench - questions, one send per go: does a Micromate accept a no-op call-home write - (`even_if_already`)? Does UM20147 accept `0x00` at `[5]` (THOR only ever wrote - `0x04`/`0x05`)? Does either series take a call-home write while monitoring? + kept on a lost ack (`9e03b3f`). **Benched 2026-11-03** (UM20147 and BE9441, + each on its own modem; one send per go): + - **Idle, both series:** a no-op, off, and on were each acked and read back, + and each unit's own menu agreed. UM20147 accepts `0x00` at `[5]`. + - **Monitoring, neither series can change call-home:** + - A MiniMate answers the `0x2C` read with its device-info block, so SFM + refuses with "stop monitoring first" (`5326e99`). + - A Micromate returns the real block and acks the write, but ignores it + ("Feature disabled while monitoring" on its own menu). SFM now refuses + up front, and edits only a block whose header is its own length + (`f35845d`). + - **Series 4 `[118:120]`:** a function of the block's content (a fixed XOR of + `0x6D7D` per bit-0 flip, on two units). + - **Batch 1's #9 reconnect worked live:** BE9441's line dropped in the sensor + check, and the start was verified. + - Details: `docs/micromate_protocol_reference.md` (Bench 2026-11-03) and the + Series-III reference's 2026-11-03 row. 5. **Setup push** (row 10): one field first, then several. Each phase is its own implementation plan. **All phases land on -- 2.54.1 From 6c2dbf0463ce223ca14d5b11d74a2305f04eb5e0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 17:15:28 -0500 Subject: [PATCH 186/223] docs(decode_check): the units carve-out cites Instantel's manuals Both settings are documented: the unit's Microphone Units (MiniMate Plus manual s3.9.7, keypad Right Arrow + Setups: psi(L) / dB(L) / Pa(L)) and Blastware's report preference (Blastware manual s4, Preferences > Units and Channel). The report follows Blastware's, as DL2's fleet-wide switches showed. Where the unit's own setting is stored is unmeasured. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check_carveouts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/minimateplus/decode_check_carveouts.py b/minimateplus/decode_check_carveouts.py index ff85efb..1bf3d75 100644 --- a/minimateplus/decode_check_carveouts.py +++ b/minimateplus/decode_check_carveouts.py @@ -122,7 +122,11 @@ UNITS_IS_A_DISPLAY_PREFERENCE = Carveout( "report, not the unit's: in report-write order (the _XML.XML mtimes) DL2's 70,034 " "reports switch fleet-wide in 61 clean runs, every unit at once, and no byte or " "bit of the event file separates the two (k-240 .. k+520, nor the 1.2 KB before " - "the footer). 2026-11-03."), + "the footer). Instantel documents both settings: the unit's own Microphone " + "Units (MiniMate Plus manual 716U0101 Rev 15 §3.9.7: psi(L), dB(L) or Pa(L), " + "keypad Right Arrow + Setups) and Blastware's report preference (Blastware " + "manual 714U0301 Rev 22 §4, Preferences > Units and Channel: Show Mic in dB / " + "in Linear Units). 2026-11-03."), applies=_units_is_a_display_preference, ) -- 2.54.1 From 06a4be9445acb0c2107aa99a77b6da5733a6a2c2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 17:23:07 -0500 Subject: [PATCH 187/223] docs(changelog): Unreleased -- identity, battery and trigger settings from the file Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfce416..b563df4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,48 @@ All notable changes to seismo-relay are documented here. change. ### Added +- **A Blastware file's identity, battery and trigger settings** (group A of the + file-only decode). Every field is matched against every DL2 report + (2026-11-03). + - **Identity block** before the setup name: what the live read gets from + SUB FE. + - serial `k − 202`, firmware `k − 147`, DSP version `k − 138`, firmware + minor `k − 193` + - calibration date `k − 132` and "by" `k − 128` + - manufacturer `k − 94`, model `k − 72` + - Filled into `Event.device_info`; `DeviceInfo` gains `calibration_date` / + `calibrated_by`. + - Serial, Version and Calibration match 70,042 / 70,042. + - **Battery:** uint16 hundredths of a volt at `k − 190` + (`Event.battery_volts`), 70,042 / 70,042. Blastware rounds half up + (6.25 → "6.3 Volts"). + - **Trigger source:** the two bytes between the embedded event record's lead + and `fe 80`, a bitmask (`0x01` Tran, `0x02` Vert, `0x04` Long, `0x08` + MicL, `0x200` Manual). 6,524 / 6,524 (`Event.triggered_by`). + - **Trigger settings,** in Series IV's `0x1A` layout: + - the sources bitmask at `k − 19` + - the stop mode at `k − 31` (0 = Fixed) + - each channel's float32 level at label + 30 (geo in/s, mic psi) + - the mic type code at MicL + 4 (2 = Linear Weighting) + + Blastware prints a level when its channel is a trigger source and the + event wasn't Manual. Geo level 6,484 / 6,484, mic level 4,412 / 4,412 + (its dB uses 6895 Pa/psi). + - **`.h5`:** all of them as attributes (additive). + - **Decode checker:** 444,188 comparisons fixed, 0 regressions, 28 of 88 + fields fully match (was 18). + - A mic level is now compared in the unit it is printed in: K441LA17.IN0W + prints dB under psi Units. + - New carve-out `units-is-a-display-preference` (3,532 events). dB or psi + in a Blastware report is that PC's Blastware preference when it wrote the + report (Blastware manual §4, Preferences → Units and Channel), not the + unit's Microphone Units setting (MiniMate Plus manual §3.9.7). DL2's + reports switch fleet-wide in 61 clean runs by write time, and no byte of + the file separates them. + - Single-value fields are proven for that value only: Version `10.72-8.17`, + stop mode Fixed, mic type Linear. + - ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and + backfill. No schema change. - **A Blastware file's job number, and whether Blastware shows it.** - **Where it is:** the setup block has Series IV's `0x1A` layout here too. The report flags sit at 9 bytes before the setup name, with bit `0x02` -- 2.54.1 From 8f75be5f72ce90b74d3ce4dfe940fad2612c9ca0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 17:24:21 -0500 Subject: [PATCH 188/223] docs: group A in the protocol reference, and the three meanings of mic 'units' Protocol reference: - D.6.8 (new): the identity block (SUB FE's: serial, firmware, DSP version, calibration date and 'by', model; battery), the trigger-source bitmask in the embedded event record, and the trigger settings (sources, stop mode, per-channel levels, mic type) with their DL2 counts. The histogram 'terminal tail' 9c 06 00 42 looks like 9c 06 00 + the serial's B (inferred). - D.6.6: recorded data vs report units vs unit peaks, with the MiniMate Plus (s3.9.7) and Blastware (s4) manual sections. Where the unit stores its own Microphone Units is unmeasured; a keypad test is proposed. - D.6.9 (was D.6.7): refreshed, 28 of 88. CLAUDE.md 'Where things stand' and the README roadmap follow. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CLAUDE.md | 24 +++++++-- README.md | 5 +- docs/instantel_protocol_reference.md | 79 ++++++++++++++++++++++++++-- 3 files changed, 97 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d57b2ad..4ca43e4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,13 +45,28 @@ Read this first when picking the project back up. - **Byte layouts** of every field read from the file: `docs/instantel_protocol_reference.md` Appendix **D.6**. - **Where the decoder stands on `dev`** (2026-11-03, run `20261103-121047`): - **18 of 88 fields match on every event**, up from about 6 before v0.33.0. - The four `dev` fixes below share one release and one backfill. + **Where the decoder stands on `dev`** (2026-11-03, run `20261103-140229`): + **28 of 88 fields match on every event**, up from about 6 before v0.33.0. + The five `dev` fixes below share one release and one backfill. - ✅ **Match on every event:** - sample rate, record time, pre-trigger, notes and event type (v0.33.0) - geophone range, job number, event times (6,524 / 6,524) and histogram start dates (63,518 / 63,518) — `dev` + - group A (`dev`, reference D.6.8): serial, version, calibration, battery, + trigger source, geo and mic trigger levels, stop mode, mic type + - 🔑 **"Units" means three different things — keep them apart** (reference + D.6.6): + - **Recorded data:** the mic samples and interval peaks in the file, as + raw counts with no unit. + - **Report units:** dB(L) or psi(L) in a report. + - A Blastware report uses that PC's Blastware preference at the moment + it wrote the report; carve-out `units-is-a-display-preference`. + - SFM's report uses SFM's own fixed choice. + - **Unit peaks:** the unit's own summary, in its keypad Microphone Units + setting. Shown on its screen, in Blastware's event list, and in the 0C + record. + - Where the unit stores that setting is not measured yet; a keypad test + on a bench unit would show it. - ✅ **Geophone samples** are exact on **6,524 / 6,524** waveforms in every year (`dev`; v0.33.0 had 6,491, its 33 others being Sensitive-range events read 8× high). @@ -72,8 +87,7 @@ Read this first when picking the project back up. - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out to prove) - ⬜ **Not read yet, in the order proposed** (2026-11-03): - - **A. Setup fields:** trigger source and levels, stop mode, mic type, - display units, firmware version, serial number, calibration, battery. + - ~~**A. Setup fields**~~ ✅ done on `dev`. - **B. Histogram interval detail:** per-interval frequencies (#50: they assume 1024 sps), per-interval PVS, interval size, stop time. - **C. #51 timing:** start time, per-interval times, peak times. diff --git a/README.md b/README.md index 869c5e2..3e4724d 100644 --- a/README.md +++ b/README.md @@ -632,16 +632,17 @@ Implementation steps (concrete): 3. flip ingest so reports are kept only for checking (retire the overlay) 4. stop the watchers forwarding reports - **Done so far: 18 of 88 report fields match on every DL2 event.** + **Done so far: 28 of 88 report fields match on every DL2 event.** - In v0.33.0: setup fields, notes, event type, histogram PVS, mic. - On `dev`: - the geophone range - the job number - histograms that decoded wrongly - the footer: no more day-late histograms; every waveform time exact + - serial, version, calibration, battery, trigger source and levels, stop mode, mic type + - A Blastware report's dB/psi is its PC's preference, not anything in the event file: a carve-out. **Next:** - - setup fields still unread: trigger, stop mode, units, serial, calibration, battery - histogram interval detail: frequencies (#50), per-interval PVS, interval size, stop time - histogram start times (#51) - the values Blastware computes itself: ZC frequency, acceleration, displacement, time of peak diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 0240e0e..3a29aa7 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-03 (2) | Appendix D.6.6, D.6.8 (NEW), D.6.9 | ✅ **Identity, battery and trigger, from the file.** **D.6.8:** the identity block before the setup name is SUB FE's (serial `k − 202`, firmware `k − 147`, DSP `k − 138`, calibration `k − 132` + by `k − 128`, model `k − 72`; battery uint16 /100 at `k − 190`); all 70,042 / 70,042. The embedded event record's two unknown bytes are the **trigger source** bitmask (6,524 / 6,524). Trigger sources `k − 19`, stop mode `k − 31`, per-channel trigger level float32 at label + 30, mic type at MicL + 4 (Series IV's code). **D.6.6:** recorded data vs report units vs unit peaks, with the manual sections; a Blastware report's dB/psi is the PC's preference. 🔶 `9c 06 00 42` (the histogram "terminal tail") looks like `9c 06 00` + the serial's `B`. 28 of 88 report fields now match on every DL2 event. | | 2026-11-03 | Appendix D.3.3, D.6.1, D.6.3, D.6.5, D.6.7, §8 | ✅ **File-only decode, second pass (on `dev`).** **D.3.3:** the footer is the file's last 26 bytes (70,041 / 70,041); an earlier stop-time record fooled the first-match search on 14 files, making histograms a day late. Its `[18:24]` is **not** fixed (retracted). **D.6.1:** STRT[18] now picks the codec; the waveform codec had claimed 2018 5 s histograms. **D.6.3:** the job number (flags `k − 9` bit `0x02`, uint16 at `k − 8`; 2,997 / 2,997). **D.6.5:** the PVS² high word is non-zero above 1.28 in/s (retracted "reads 0000"), so the layout check now uses peak ≤ PVS ≤ √3·peak (34,502,955 / 34,502,955); Blastware's "Number of Intervals" is the monitoring time ÷ the interval. **§8:** where the 1995 default-clock events come from. 18 of 88 report fields now match on every DL2 event. | | 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). **For #48:** the file's copy of the block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is each event's own pre-trigger, which varies on the same unit on the same day (253–256 samples at 1024 sps), and Blastware reports it per event. So the file says little about whether the live 1A loses its anchor, and #48 stays open. | | 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. | @@ -3789,12 +3790,80 @@ Each interval stores its peak vector sum **squared**: - **Verified:** interval psi mismatches fell from 42,783 to 26, and mic peak mismatches from 345 to 40. -#### D.6.7 Not read from the file yet +**Three things share the word "units". Keep them apart** (2026-11-03): -*Updated 2026-11-03. 18 of 88 report fields now match on every DL2 event.* +| Name | What it is | Its units are set by | Where it shows | +|---|---|---|---| +| **Recorded data** | the mic samples and interval peaks in the event file | nothing: they are raw counts | the event file | +| **Report units** | dB(L) or psi(L) in a report | Blastware's report: the PC's preference (Blastware manual 714U0301 Rev 22 §4, Preferences → Units and Channel). SFM's report: SFM's own fixed choice (PDF PSPL in dB(L), plot in psi) | a Blastware report, an SFM report | +| **Unit peaks** | the peaks the unit works out for its own summary | the unit's Microphone Units setting: psi(L), dB(L) or Pa(L), on the keypad (Right Arrow + Setups) or from Compliance Setup → Special Setups (MiniMate Plus manual 716U0101 Rev 15 §3.9.7) | the unit's screen, Blastware's event list, the 0C record on a live download | + +- A Blastware report converts the recorded counts in its PC's preference. That is why DL2's + reports flip dB ↔ psi fleet-wide, in 61 clean runs by report-write time. The decode checker's + `units-is-a-display-preference` carve-out covers it. +- 🔶 **Where the unit stores its own setting, and its unit peaks, is not measured.** Blastware's + event list must read the unit peaks from somewhere, so they are probably in the event file, + perhaps near the embedded event record. +- **To settle it (proposed, not done):** on a bench unit, change Microphone Units on the keypad, + then diff a read-only `1A` read and a short recorded event. + +#### D.6.8 Identity, battery and trigger ✅ 2026-11-03 + +**The identity block** sits before the setup name. It is what the live read gets from SUB FE +(`DeviceInfo`); offsets are from `k`: + +| Offset | Content | DL2 | +|---|---|---| +| `k − 202` | serial number, NUL-terminated | 70,042 / 70,042 | +| `k − 193` | firmware minor (`0x11` = 17), as SUB EA | — | +| `k − 190` | battery, uint16 BE, hundredths of a volt | 70,042 / 70,042 (Blastware rounds half up: 6.25 → "6.3 Volts") | +| `k − 147` | firmware, `"S338.17"` | | +| `k − 138` | DSP version, `"10.72"` | Version 70,042 / 70,042 as `V {DSP}-{firmware after "S33"} {model}`; only `10.72-8.17` occurs, so the rule is proven for that alone | +| `k − 132` | calibration date, `dd mm yyyy` (BE year) | Calibration 70,042 / 70,042 as `{Month} {d}, {yyyy} by {k − 128}` | +| `k − 128` | calibrated by, `"Instantel"` | | +| `k − 94` | manufacturer, `"Instantel"` | | +| `k − 72` | model, `"MiniMate Plus"` / `"BlastMate III"` | | + +- `k − 180 … k − 149` hold eight float32s (1.0, 8.0, then 1.0s). Not identified. +- 🔶 **Inferred, not measured:** the three bytes before the serial are `9c 06 00`. With the + serial's `B` (0x42) that makes `9c 06 00 42`, the histogram codec's "terminal tail". It looks + like the start of this record rather than the end of a block. Every serial starts with B + (BE… / BA…). + +**The trigger source** is in the embedded event record (§7.8.9). The two bytes between its lead +`00 28 05 00` and `fe 80`, a uint16 BE bitmask, were "unknown" until now: + +| Value | Blastware's Trigger | +|---|---| +| `0x0001` | Tran | +| `0x0002` | Vert | +| `0x0004` | Long | +| `0x0008` | MicL | +| `0x0200` | Manual | + +That holds on 6,524 / 6,524 waveforms. + +**Trigger settings,** in Series IV's `0x1A` layout: + +| Offset | Content | DL2 | +|---|---|---| +| `k − 19` | trigger sources: `0x07` geophones, `0x08` mic (`0x80` seen once, not identified) | — | +| `k − 23` | active sensors, `0x0f` (all four) | 69,975, `0x07` on 8 mic-less files | +| `k − 31` | stop mode: 0 = Fixed | 6,524 / 6,524, the only value in DL2 | +| channel label + 30 | float32 trigger level: geophones in/s, mic psi | geo 6,484 / 6,484, mic 4,412 / 4,412 | +| MicL + 4 | mic type code: 2 = Linear Weighting, as Series IV | 70,034 / 70,034, the only value | + +- **Blastware prints a trigger level only when its channel is a trigger source** and the event + was not Manual. +- **For the mic level in dB, Blastware converts with 6895 Pa per psi.** That gives 4,272 / 4,272; + the exact 6894.757 gives 4,271, failing one boundary case (0.01 psi → "130.8 dB(L)"). +- **The file's channel block is the 1A's, 4 bytes earlier.** Compare the 1A's scale constant at + +28 and range at +33 with the file's +24 and +29. + +#### D.6.9 Not read from the file yet + +*Updated 2026-11-03. 28 of 88 report fields now match on every DL2 event.* - **Fields not read yet:** - - trigger source and levels, stop mode, mic type, display units, firmware version, serial - number, calibration, battery - per-interval frequencies (#50: they assume 1024 sps), per-interval PVS, interval size, histogram stop time - extended notes @@ -3811,6 +3880,8 @@ Each interval stores its peak vector sum **squared**: - the 26 histogram start dates a day off (D.3.3; 17 of them were the same 5 s files, timed as waveforms) - the job number (D.6.3) + - identity, battery, trigger source and trigger settings (D.6.8); Units is Blastware's + preference (D.6.6) --- -- 2.54.1 From 67b3ef8d0ac8421b35758991c1811fa68fbe4cf0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 17:24:40 -0500 Subject: [PATCH 189/223] docs(changelog): Unreleased -- group A in the protocol reference Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b563df4..7996c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,6 +156,16 @@ All notable changes to seismo-relay are documented here. `.h5` attributes are additive. No schema change, no migration. ### Protocol / Documentation +- **Group A in the protocol reference, and the three meanings of mic + "units".** + - **D.6.8:** the identity block, the trigger-source bitmask and the trigger + settings. + - **D.6.6:** recorded data vs report units vs unit peaks, with the + MiniMate Plus and Blastware manual sections. CLAUDE.md carries the same + glossary. + - 🔶 Inferred: the histogram "terminal tail" `9c 06 00 42` is `9c 06 00` + plus the serial's `B`. + - Docs only: no code change, no migration. - **Where file-only decoding stands, and that prod's ASCII overlay is scaffolding.** - **CLAUDE.md "Where things stand"** now says plainly that a paired -- 2.54.1 From 2b698e74cff7189518d20d6dcac457c07744e4fa Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 17:34:27 -0500 Subject: [PATCH 190/223] feat(decode): a histogram's interval detail -- frequencies (#50), vector sums, interval size, stop Group B of the file-only decode, measured on DL2 2026-11-03: - Frequency = (sample rate / 2) / half-period: 527,915 / 527,915 cells at 1024 sps and 1,725 / 1,725 at 2048. #50: half_period_to_hz took a fixed 512 and halved every 2048-sps frequency; it now takes the rate (default 1024). Blastware prints 'N/A' for a half-period of 0, '>100' ('>200' at 2048) at 5 samples or fewer, '<1.0' below 1 Hz. - Each interval's vector sum, sqrt(PVS^2) at the event's range: 771,354 / 771,354. - Interval size: uint16 seconds at k - 40 (Series IV [8:10]). - Stop: the footer's (2,995 / 2,999 sampled; 4 print a second earlier). Event gains histogram_interval_sec, interval_half_periods, interval_pvs and stop_time; the .h5 gains /intervals/half_period/, /intervals/pvs_ips and a histogram_interval_sec attr. The decoder walks a histogram once (histogram_codec.channels_from_records) and takes the event's PVS from the same records. The checker compares each interval column, number or Blastware's word; the test that pinned Tran Freq Hz as blank now pins the match. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 60 +++++++-- minimateplus/event_file_io.py | 41 +++++-- minimateplus/histogram_codec.py | 29 +++-- minimateplus/models.py | 5 + sfm/event_hdf5.py | 21 ++++ .../T190LD42.T00H | Bin 0 -> 1550 bytes .../T190LD42_T00H_XML.XML | 116 ++++++++++++++++++ tests/test_bw_file_fields.py | 42 +++++++ tests/test_decode_check.py | 23 +++- tests/test_histogram_codec.py | 7 ++ 10 files changed, 312 insertions(+), 32 deletions(-) create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD42.T00H create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD42_T00H_XML.XML diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index e3d396b..5904375 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -15,12 +15,13 @@ from __future__ import annotations import math import re -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Callable, Optional, Sequence from .bw_xml_report import XmlReport from .event_file_io import (_GEO_FS_BY_RANGE, _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, decode_blastware_bytes) +from .histogram_codec import half_period_to_hz from .models import Event from .waveform_codec import mic_count_to_db @@ -85,6 +86,26 @@ class SfmSide: channels: list[str] # channels with decoded data, in Tran/Vert/Long/MicL order counts: dict[str, list[int]] # waveform samples or histogram interval peaks geo_ips_per_count: float = GEO_IPS_PER_COUNT # at the event's range, as SFM read it + # interval column -> SFM's value per interval (a number, or Blastware's word) + interval_values: dict[str, list[object]] = field(default_factory=dict) + + +def interval_frequency(halfp: int, sample_rate: int) -> object: + """An interval's frequency as Blastware prints it: "N/A" for a half-period + of 0, ">100" (">200" at 2048 sps) at 5 samples or fewer, "<1.0" below 1 Hz, + else (sample rate / 2) / half-period in Hz. Measured on ~3.1 M DL2 cells, + 2026-11-03 (#50: the rate, not a fixed 512).""" + if halfp == 0: + return "N/A" + hz = half_period_to_hz(halfp, sample_rate) + if hz is None: + return f">{round(100 * sample_rate / 1024)}" + return "<1.0" if hz < 1.0 else hz + + +def _interval_size(seconds: int) -> str: + n, unit = (seconds // 60, "minute") if seconds % 60 == 0 else (seconds, "second") + return f"{n} {unit}{'' if n == 1 else 's'}" def sfm_side(raw: bytes) -> SfmSide: @@ -118,6 +139,17 @@ def sfm_side(raw: bytes) -> SfmSide: values["MicLPSPL dB(L)"] = mic_count_to_db(max(abs(c) for c in counts["MicL"])) values["MicLPSPL psi(L)"] = pv.micl if pv is not None else None values.update(_setup_values(ev)) + if ev.stop_time is not None: + values.update(HistogramStopDate=ev.stop_time.strftime("%Y-%m-%d"), + HistogramStopTime=ev.stop_time.strftime("%H:%M:%S")) + if ev.histogram_interval_sec: + values["IntervalSize"] = _interval_size(ev.histogram_interval_sec) + interval_values: dict[str, list[object]] = {} + if ev.interval_half_periods and ev.sample_rate: + for ch, hps in ev.interval_half_periods.items(): + interval_values[f"{ch} Freq Hz"] = [interval_frequency(h, ev.sample_rate) for h in hps] + if ev.interval_pvs: + interval_values["Geo PVS in/s"] = list(ev.interval_pvs) return SfmSide( event=ev, @@ -128,6 +160,7 @@ def sfm_side(raw: bytes) -> SfmSide: channels=[ch for ch in _CHANNELS if counts[ch]], counts=counts, geo_ips_per_count=_GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) / _GEO_INT16_FS, + interval_values=interval_values, ) @@ -214,9 +247,11 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie return FieldResult(tag, "match" if ok else "mismatch", printed, _render(value, printed)) -def _cell_diff(value: float, printed: str) -> Optional[float]: +def _cell_diff(value: object, printed: str) -> Optional[float]: """|value - printed| when the cell disagrees, else None; inf for a cell that - is not a number.""" + is not a number. A word on SFM's side (">100", "N/A") must be printed.""" + if isinstance(value, str): + return None if _same_text(value, printed) else float("inf") p = _printed_number(printed) if p is None: return float("inf") @@ -285,14 +320,19 @@ def series_pairs(sfm: SfmSide, ref: XmlReport, if field.startswith("intervals."): title = field[len("intervals."):] columns = ref.interval_columns or [] - convert = _interval_converter(title, sfm) - counts = sfm.counts.get(title.partition(" ")[0], []) - if convert is None or not counts or title not in columns: + if title not in columns: return None i = columns.index(title) cells = [row[i] if i < len(row) else "" for _, row in (ref.intervals or [])] - pairs = [(j, cell, convert(c)) for j, (cell, c) in enumerate(zip(cells, counts))] - return pairs, abs(len(cells) - len(counts)) + values = sfm.interval_values.get(title) + if values is None: + convert = _interval_converter(title, sfm) + counts = sfm.counts.get(title.partition(" ")[0], []) + if convert is None or not counts: + return None + values = [convert(c) for c in counts] + pairs = [(j, cell, v) for j, (cell, v) in enumerate(zip(cells, values))] + return pairs, abs(len(cells) - len(values)) return None @@ -302,7 +342,9 @@ def _compare_series(field: str, n_bw: int, sfm: SfmSide, ref: XmlReport) -> Fiel return FieldResult(field, "sfm_blank", f"{n_bw} rows", None) pairs, row_len = got diffs = [(j, d) for j, cell, v in pairs if (d := _cell_diff(v, cell)) is not None] - n_sfm = len(sfm.counts.get(field.split(".", 1)[1].partition(" ")[0], [])) + title = field.split(".", 1)[1] + n_sfm = (len(sfm.interval_values[title]) if title in sfm.interval_values + else len(sfm.counts.get(title.partition(" ")[0], []))) return _series_result(field, n_bw, n_sfm, diffs, row_len) diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 8cf6d17..f86311a 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -19,6 +19,7 @@ import datetime import hashlib import json import logging +import math import os import re import struct @@ -30,7 +31,7 @@ from . import blastware_file as _bw # avoid circular reference at module load from .bw_ascii_report import BwAsciiReport from . import waveform_codec as _wc from .waveform_codec import decode_waveform_v2, decoded_to_adc_counts -from .histogram_codec import decode_histogram_body, interval_pvs +from .histogram_codec import channels_from_records, decode_histogram_body, decode_histogram_body_full # Reference pressure for dB(L) → psi conversion (20 µPa expressed in psi). # Same constant as sfm/sfm_webapp.html so server-side and browser-side @@ -862,6 +863,7 @@ _RECTIME_OFFSET_BEFORE_MARKER = 30 # 2026-10-29). Offsets are from the first byte of the name. _SETUP_NAME_RE = re.compile(rb"\x1c\x08([\x20-\x7e]{1,40})\x00") _SAMPLE_RATE_BEFORE_NAME = 42 # uint16 BE, samples per second +_INTERVAL_BEFORE_NAME = 40 # uint16 BE, histogram interval in seconds (2 / 5 / 15 / 60 / 300) _PRETRIG_BEFORE_NAME = 36 # float32 BE, seconds, negative (-0.25, -0.0625 ...) _RECTIME_BEFORE_NAME = 30 # float32 BE, seconds (the marker's offset above) _SAMPLE_RATES = (1024, 2048, 4096) @@ -1277,8 +1279,10 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: problems = [] if record_type is None: problems.append(f"unknown record type byte 0x{type_byte:02x} at STRT[18]") + hist_records = None if record_type == "Histogram": - decoded = decode_histogram_body(body) + hist_records = decode_histogram_body_full(body) + decoded = channels_from_records(hist_records) is_waveform_body = False elif record_type == "Waveform": decoded = decode_waveform_v2(body) @@ -1287,7 +1291,8 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: decoded = decode_waveform_v2(body) is_waveform_body = decoded is not None if decoded is None: - decoded = decode_histogram_body(body) + hist_records = decode_histogram_body_full(body) + decoded = channels_from_records(hist_records) if decoded is None: log.warning( "%s: body codec failed to decode (body starts %s) — " @@ -1414,14 +1419,28 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # The geophone full scale is the file's range; Normal when it wasn't read. geo_fs = _GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) ev.peak_values = _peaks_from_samples(samples, geo_fs) if has_samples else None - if not is_waveform_body and ev.peak_values is not None: - # A histogram stores each interval's vector sum (squared); the event's - # is the largest. Combining the channel peaks instead read high on 86% - # of DL2's histograms -- they can come from different moments. - pvs = interval_pvs(body) - if pvs: - ev.peak_values.peak_vector_sum = ( - max(pvs) * _HIST_GEO_COUNTS_PER_UNIT * geo_fs / _GEO_INT16_FS) + ev.stop_time = ts2 + if hist_records: + # A histogram stores each interval's vector sum (squared), and each + # channel's half-period: Blastware's per-interval Geo PVS (771,354 / + # 771,354 DL2 cells) and frequency, (sample rate / 2) / half-period. + unit_ins = _HIST_GEO_COUNTS_PER_UNIT * geo_fs / _GEO_INT16_FS + ev.interval_pvs = [math.sqrt(r["pvs_sq"]) * unit_ins for r in hist_records] + ev.interval_half_periods = { + ch: [r[key] for r in hist_records if r[key] is not None] + for ch, key in (("Tran", "t_halfp"), ("Vert", "v_halfp"), + ("Long", "l_halfp"), ("MicL", "m_halfp"))} + if not ev.interval_half_periods["MicL"]: + del ev.interval_half_periods["MicL"] + k = _setup_name_at(raw) + if k is not None and k >= _INTERVAL_BEFORE_NAME: + ev.histogram_interval_sec = int.from_bytes( + raw[k - _INTERVAL_BEFORE_NAME:k - _INTERVAL_BEFORE_NAME + 2], "big") or None + if not is_waveform_body and ev.peak_values is not None and ev.interval_pvs: + # The event's vector sum is the largest interval's. Combining the + # channel peaks instead read high on 86% of DL2's histograms -- they + # can come from different moments. + ev.peak_values.peak_vector_sum = max(ev.interval_pvs) ev._a5_frames = None # not recoverable from BW file return ev diff --git a/minimateplus/histogram_codec.py b/minimateplus/histogram_codec.py index 3a4f7e6..16b6f0f 100644 --- a/minimateplus/histogram_codec.py +++ b/minimateplus/histogram_codec.py @@ -156,10 +156,11 @@ _BLOCK_MARKER = 10 # 16-count-unit output (1 unit = 0.005 in/s = 16 ADC counts). _GEO_LSB_INS = 0.005 -# Frequency formula: freq_Hz = _FREQ_NUMERATOR / half_period_samples. -# Empirically determined to be 512 (= sample_rate / 2, where sample rate -# is 1024 sps for the standard MiniMate Plus configuration). -_FREQ_NUMERATOR = 512 +# Frequency formula: freq_Hz = (sample_rate / 2) / half_period_samples. +# ⚠ RETRACTED 2026-11-03 (#50): "a fixed numerator of 512". 512 is sample_rate +# / 2 at 1024 sps only; at 2048 sps it halved every frequency. Measured on DL2: +# 527,915 / 527,915 cells at 1024 sps and 1,725 / 1,725 at 2048. +_FREQ_NUMERATOR = 512 # sample_rate / 2 at the default 1024 sps def _is_data_block(block: bytes) -> bool: @@ -300,7 +301,11 @@ def decode_histogram_body(body: bytes) -> Optional[dict]: to get 1-count ADC values, then ``count / 32767 * 10.0`` for in/s) - Mic channel: use ``waveform_codec.mic_count_to_db(count)`` """ - records = _walk_auto(body) + return channels_from_records(_walk_auto(body)) + + +def channels_from_records(records: Optional[List[dict]]) -> Optional[dict]: + """``decode_histogram_body``'s per-channel peaks, from records already walked.""" if not records: return None return { @@ -338,17 +343,19 @@ def interval_pvs(body: bytes) -> Optional[List[float]]: return [math.sqrt(r["pvs_sq"]) for r in records] if records else None -def half_period_to_hz(halfp: int) -> Optional[float]: - """Convert a half-period in samples to frequency in Hz. +def half_period_to_hz(halfp: int, sample_rate: int = 1024) -> Optional[float]: + """Convert a half-period in samples to frequency in Hz: + ``(sample_rate / 2) / halfp``. Returns ``None`` for half-period ≤ 5 — the device emits values in - that range when the measured zero-crossing rate exceeds 100 Hz - (the BW display reports `>100 Hz` for such cases). Callers can - treat ``None`` as the `>100 Hz` sentinel. + that range when the measured zero-crossing rate exceeds 100 Hz at + 1024 sps (the BW display reports `>100`, `>200` at 2048 sps). Callers + can treat ``None`` as that sentinel. A half-period of 0 is Blastware's + "N/A"; it also returns None. """ if halfp <= 5: return None - return _FREQ_NUMERATOR / halfp + return (sample_rate / 2) / halfp def geo_count_to_ins(count: int) -> float: diff --git a/minimateplus/models.py b/minimateplus/models.py index 99b0b62..f65e00c 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -561,6 +561,11 @@ class Event: trigger_level_mic_psi: Optional[float] = None record_stop_mode: Optional[int] = None # 0 = Fixed mic_type: Optional[int] = None # 2 = Linear Weighting (as Series IV) + stop_time: Optional[datetime.datetime] = None # the footer's stop + # A histogram's per-interval detail (2026-11-03); None for a waveform. + histogram_interval_sec: Optional[int] = None # as ComplianceConfig.histogram_interval_sec + interval_half_periods: Optional[dict] = None # channel -> half-period per interval, samples + interval_pvs: Optional[list] = None # each interval's vector sum, in/s # Sensor self-check traces keyed by channel label — the short diagnostic # waveforms the unit records when it pulses each sensor before monitoring diff --git a/sfm/event_hdf5.py b/sfm/event_hdf5.py index 6c76be5..a40c559 100644 --- a/sfm/event_hdf5.py +++ b/sfm/event_hdf5.py @@ -38,6 +38,10 @@ Layout written to `.h5`: trigger_level_mic_psi, firmware_version, dsp_version, model, calibration_date (ISO), calibrated_by (each only when read from the event file) + histogram_interval_sec int (histograms) + /intervals (histograms, when read) + half_period/ uint16 samples per interval; Hz = (sample rate / 2) / it + pvs_ips float32 each interval's vector sum, in/s peak_tran_ips float (from 0C; authoritative) peak_vert_ips float peak_long_ips float @@ -273,6 +277,7 @@ def write_event_hdf5( ("trigger_sources", getattr(event, "trigger_sources", None)), ("trigger_level_geo_ips", getattr(event, "trigger_level_geo", None)), ("trigger_level_mic_psi", getattr(event, "trigger_level_mic_psi", None)), + ("histogram_interval_sec", getattr(event, "histogram_interval_sec", None)), ): if value is not None: attrs[attr] = value @@ -304,6 +309,22 @@ def write_event_hdf5( compression="gzip", compression_opts=4, shuffle=True, ) + # /intervals — a histogram's per-interval detail as the file holds it: + # each channel's half-period in samples (frequency = (sample rate / 2) + # / half-period; 0 is Blastware's "N/A") and each interval's vector sum. + half_periods = getattr(event, "interval_half_periods", None) + interval_pvs = getattr(event, "interval_pvs", None) + if half_periods or interval_pvs: + igrp_iv = f.create_group("intervals") + if half_periods: + hgrp = igrp_iv.create_group("half_period") + for ch, hps in half_periods.items(): + hgrp.create_dataset(ch, data=np.asarray(hps, dtype="uint16"), + compression="gzip", compression_opts=4, shuffle=True) + if interval_pvs: + igrp_iv.create_dataset("pvs_ips", data=np.asarray(interval_pvs, dtype="float32"), + compression="gzip", compression_opts=4, shuffle=True) + # /samples_int16 — optional raw ADC counts (preserved for analysis # tools that want pre-conversion data). Cheap to include. if include_int16: diff --git a/tests/fixtures/histogram-intervals-11-03-26/T190LD42.T00H b/tests/fixtures/histogram-intervals-11-03-26/T190LD42.T00H new file mode 100755 index 0000000000000000000000000000000000000000..8fb7ec07c7af581ff68ef9608be99031fde329c7 GIT binary patch literal 1550 zcma)+Uu;uV9LK-+(zSQ}chBv*p$6r2WM-h9+ghZI4aVk(Bi*v>4>9qn>8_(%Zs%=5 z@rgu)`#YCGI01BP$y7v3sd3nzg=Z562Kxt%RY9?~3JM^#;VC;z33dVK5FKEcK?^+a z!qQoEJdU$gbaXX^nszthbp?WW&YTR$=k}cd_R}A;->9_=1OlOkrd>c&W5cdyxU9At z|DA>cHxraP-WNZbT#tMEJ?yXm771wmchEcuHbEBbu(hST-fH{o&^0=* zaCrh(wnzh%i{Xeq%=^`7LLZK4BYZ$j9UVoVo_JM_rdrVL4>kIG6ME_}KakL0^Y7Qy z2oLy!&o}qSqK7Foc`O!J;~bswn5t30fyi;*nK&{U(T-y%sp`Bpazt&xpsMQ;e~(Hr zS}dC6-CDH4&tHt_dMugHFrdbgJe-KOfL?rCi2M24PMo&l|Jy6B^8Q3*n4{~>l&TG@ z!@M_&?77bG;;%hY1+3n&F!Y`-*+CqoOzCE8- zTpCTr(0V>ptPgKT;xg(hV8QC&lGAnrt|uQ`>+8&_q;=M{`A5_=!vIc}hdO|#f1+R8 z&K^Kb0IO3}(WV$sAEN%uD|M&|!uXh~+*Av&^(E>(zdu0DP8bVR`KG+oE>g2SxQcJ6 zxTxZB5IfA(LEa<*70sY95lJFhypv+wFF`98SBV(k@Ao&1z+R>I;EdpHPyE zg~H@yHk%=(Gnp)DGM~>Eip7P6g_2RC8^GEb6oD4f{GwbF&lQ6Vc4<+>M*J3Z>hNcb4z2FlkEM z`34VG+D#rNo4XN+msIVouJ(GXyk)92B$vzOaMtL literal 0 HcmV?d00001 diff --git a/tests/fixtures/histogram-intervals-11-03-26/T190LD42_T00H_XML.XML b/tests/fixtures/histogram-intervals-11-03-26/T190LD42_T00H_XML.XML new file mode 100755 index 0000000..9984619 --- /dev/null +++ b/tests/fixtures/histogram-intervals-11-03-26/T190LD42_T00H_XML.XML @@ -0,0 +1,116 @@ + + +8.0 +Full Histogram +BE18190 +V 10.72-8.17 MiniMate Plus +T190LD42.T00H +13:29:24 +2025-12-08 +13:29:37 +2025-12-08 + +Tran +Vert +Long +MicL + +1.00 +1 minute +2048 sps +6.7 Volts +June 13, 2025 by Instantel +in/s and dB(L) +I-80-North Fork-Area 3-462Richardsvilel +Fay Company +Terra-Mechanics Inc.- Harrison +Loc #8 - Area 3- 462 Richardsville Road + +10.000 +in/s + + +1.280 +in/s + + +2.615 +in/s + + +1.120 +in/s + + +15.5 +Hz + + +64 +Hz + + +17.7 +Hz + +13:29:37 +2025-12-08 +13:29:37 +2025-12-08 +13:29:37 +2025-12-08 + +2.644 +in/s + +13:29:37 +2025-12-08 +Linear Weighting + +107.0 +dB(L) + +13:29:37 +2025-12-08 + +51 +Hz + +7.4 Hz. +4.2 +Passed +7.6 Hz. +3.4 +Passed +7.3 Hz. +3.7 +Passed +0.0 Hz. +0 mv +Check + + +2025-12-08 13:29:23 - 2025-12-08 13:29:37 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +1.28015.52.615641.12017.72.6440.001107.051 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index 934741c..401182d 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -429,3 +429,45 @@ def test_the_h5_carries_the_setup_fields(tmp_path): assert abs(float(a["trigger_level_mic_psi"]) - ev.trigger_level_mic_psi) < 1e-9 assert (str(a["firmware_version"]), str(a["dsp_version"]), str(a["calibration_date"])) == ( "S338.17", "10.72", "2019-02-20") + + +# ── Group B: histogram interval detail ────────────────────────────────────── +# Interval size is the setup's uint16 seconds at k - 40 (Series IV [8:10]); the +# stop is the footer's. Each interval keeps its half-periods and its vector sum +# (PVS^2). Frequency = (sample rate / 2) / half-period: 527,915 / 527,915 cells +# at 1024 sps and 1,725 / 1,725 at 2048 (#50: the old fixed 512 halved every +# 2048-sps frequency). Measured 2026-11-03. +from minimateplus.histogram_codec import half_period_to_hz # noqa: E402 + +_HB = "histogram-intervals-11-03-26" + + +@pytest.mark.parametrize("rel,sr,freqs,pvs,stop", [ + # Blastware: 1 minute; Tran 32, Vert 47, Long 14, MicL 47 Hz; PVS 1.358; stop 12:49:33 + ("decode-checker-10-29-26/T004JTRF.ME0H", 1024, + {"Tran": 32, "Vert": 47, "Long": 14, "MicL": 47}, 1.358, (2022, 12, 28, 12, 49, 33)), + # Blastware: 1 minute at 2048 sps; Tran 15.5, Vert 64, Long 17.7, MicL 51 Hz; PVS 2.644 + (f"{_HB}/T190LD42.T00H", 2048, + {"Tran": 15.5, "Vert": 64, "Long": 17.7, "MicL": 51}, 2.644, (2025, 12, 8, 13, 29, 37)), +]) +def test_histogram_interval_detail_comes_from_the_file(rel, sr, freqs, pvs, stop): + ev = read_blastware_file(_FIX / rel) + assert (ev.sample_rate, ev.histogram_interval_sec) == (sr, 60) + for ch, hz in freqs.items(): + got = half_period_to_hz(ev.interval_half_periods[ch][0], ev.sample_rate) + d = 1 if isinstance(hz, float) else 0 + assert abs(got - hz) <= 0.5 * 10 ** -d + 1e-9, (ch, got, hz) + assert abs(ev.interval_pvs[0] - pvs) <= 0.0005 + 1e-9 + t = ev.stop_time + assert (t.year, t.month, t.day, t.hour, t.minute, t.second) == stop + + +def test_the_h5_carries_the_interval_detail(tmp_path): + import h5py + from sfm import event_hdf5 + ev = read_blastware_file(_FIX / _HB / "T190LD42.T00H") + event_hdf5.write_event_hdf5(tmp_path / "e.h5", ev, serial="BE18190") + with h5py.File(tmp_path / "e.h5", "r") as f: + assert int(f.attrs["histogram_interval_sec"]) == 60 + assert list(f["intervals/half_period/Vert"][:]) == ev.interval_half_periods["Vert"] + assert abs(float(f["intervals/pvs_ips"][0]) - 2.644) <= 0.0005 + 1e-9 diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index da1eca3..503023a 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -96,7 +96,7 @@ def test_zc_frequency_na_and_above_range(): def test_mic_units_pick_the_conversion(): res = _results("T004JTRF.ME0H") # psi(L) assert res["intervals.MicL Peak dB(L)"].verdict in ("match", "mismatch") - assert res["intervals.Tran Freq Hz"].verdict == "sfm_blank" + assert res["intervals.Tran Freq Hz"].verdict == "match" # read since 2026-11-03 fields = set(_results("R352HFZ7.530H")) # no mic assert not any(f.startswith(("samples.MicL", "intervals.MicL")) for f in fields) @@ -279,3 +279,24 @@ def test_a_mic_trigger_level_is_read_in_the_unit_it_is_printed_in(): ref.event_units = "in/s and psi(L)" res = {r.field: r for r in compare(sfm_side((sf / "T189HUD6.QE0W").read_bytes()), ref, CARVEOUTS)} assert res["MicTriggerLevel"].verdict == "match", res["MicTriggerLevel"] + + +@pytest.mark.parametrize("path", [FIX / "T004JTRF.ME0H", + FIX.parent / "histogram-intervals-11-03-26" / "T190LD42.T00H"]) +def test_histogram_interval_detail_matches_blastware(path): + ref = parse_xml_report_file(path.with_name(path.name.replace(".", "_", 1) + "_XML.XML")) + res = {r.field: r for r in compare(sfm_side(path.read_bytes()), ref, CARVEOUTS)} + for f in ("IntervalSize", "HistogramStopDate", "HistogramStopTime", "intervals.Tran Freq Hz", + "intervals.Vert Freq Hz", "intervals.Long Freq Hz", "intervals.MicL Freq Hz", + "intervals.Geo PVS in/s"): + assert res[f].verdict == "match", (f, res[f]) + + +@pytest.mark.parametrize("halfp,sr,want", [ + (0, 1024, "N/A"), (5, 1024, ">100"), (5, 2048, ">200"), (1024, 1024, "<1.0"), +]) +def test_blastwares_interval_frequency_words(halfp, sr, want): + # N/A for a half-period of 0, ">100" / ">200" at 5 samples or fewer, "<1.0" + # below 1 Hz -- on ~3.1 M DL2 cells, 2026-11-03. + from minimateplus.decode_check import interval_frequency + assert interval_frequency(halfp, sr) == want diff --git a/tests/test_histogram_codec.py b/tests/test_histogram_codec.py index 9b6522a..3236ef2 100644 --- a/tests/test_histogram_codec.py +++ b/tests/test_histogram_codec.py @@ -695,3 +695,10 @@ def test_third_block_still_rejects_a_mismatched_counter(): + _mk_multi_block(ivs, ctr=257) + _mk_multi_block(ivs, ctr=999)) # counter jumps — not consecutive assert detect_multi_interval_stride(body) != 12 + 20 * 4 + + +def test_half_period_to_hz_follows_the_sample_rate(): + """#50: (sample rate / 2) / half-period, measured on 1,725 / 1,725 cells at + 2048 sps; the old fixed 512 halved them.""" + assert half_period_to_hz(6, 2048) == pytest.approx(1024 / 6) + assert half_period_to_hz(6) == pytest.approx(512 / 6) # 1024 sps by default -- 2.54.1 From 13f2769736fc05628c235c71ff8600354074aa76 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:02:51 -0500 Subject: [PATCH 191/223] feat(decode_check): an OORANGE interval vector sum is saturation Blastware prints OORANGE for an interval's vector sum when it exceeds the range in an interval where Blastware also clamped a channel: 17 / 17 DL2 cells, SFM's sum 10.01 .. 17.33 in/s (sqrt 3 x 10.005). The saturation carve-out now covers intervals.Geo PVS in/s with that rule, per interval, as it already did for PeakVectorSum. The 4 other cells left mismatching sit 4e-6 past a rounding boundary (Blastware's arithmetic is a hair lower) and stay mismatches. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check_carveouts.py | 22 +++- .../T190LD5Q.LD0H | Bin 0 -> 1838 bytes .../T190LD5Q_LD0H_XML.XML | 116 ++++++++++++++++++ tests/test_decode_check.py | 25 ++++ 4 files changed, 161 insertions(+), 2 deletions(-) create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD5Q_LD0H_XML.XML diff --git a/minimateplus/decode_check_carveouts.py b/minimateplus/decode_check_carveouts.py index 1bf3d75..e1d05c9 100644 --- a/minimateplus/decode_check_carveouts.py +++ b/minimateplus/decode_check_carveouts.py @@ -68,6 +68,21 @@ def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool: got = series_pairs(sfm, ref, res.field) if got is None or got[1]: return False + if res.field == "intervals.Geo PVS in/s": + # Per interval, as PeakVectorSum: an OORANGE vector sum, SFM's sum within + # three channels at the ceiling, and a channel Blastware itself clamped in + # that interval. 17 / 17 DL2 cells, SFM 10.01 .. 17.33 (2026-11-03). + cols = ref.interval_columns or [] + peaks = [cols.index(c) for c in ("Tran Peak in/s", "Vert Peak in/s", "Long Peak in/s") + if c in cols] + rows = ref.intervals or [] + differing = [(j, cell, v) for j, cell, v in got[0] + if isinstance(v, str) or not matches_printed(v, cell)] + return bool(differing) and all( + cell.strip() == "OORANGE" and not isinstance(v, str) + and r - _TOL <= v <= 3 ** 0.5 * r * 1.01 + and any(_clamped(rows[j][1][p], r) for p in peaks if p < len(rows[j][1])) + for j, cell, v in differing) differing = [(cell, v) for _, cell, v in got[0] if not matches_printed(v, cell)] return bool(differing) and all( _clamped(cell, r) and _at_ceiling(v, r) @@ -79,10 +94,13 @@ SATURATION = Carveout( id="saturation", fields=("TranPPV", "VertPPV", "LongPPV", "PeakVectorSum", "samples.Tran", "samples.Vert", "samples.Long", - "intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s"), + "intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s", + "intervals.Geo PVS in/s"), evidence=("Blastware clamps a clipped channel to the range maximum and prints OORANGE; " "the file holds counts past full scale (32016 counts = 10.005 in/s observed). " - "scratch/verify_against_ascii.py, 2026-08-28."), + "scratch/verify_against_ascii.py, 2026-08-28. An interval's vector sum prints " + "OORANGE when it exceeds the range in an interval with a clamped channel: 17 / 17 " + "DL2 cells, 2026-11-03."), applies=_saturation, ) diff --git a/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H b/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H new file mode 100755 index 0000000000000000000000000000000000000000..238a9b8e1bccfb2c4c91bb91dd694cd035037c46 GIT binary patch literal 1838 zcma)-TW}Lq7{|X&(`1{=UXrCc*r_K)pchioG(apAiUqWqV(kTo@j+v2;!MFo(iQ}P0!i8irYMs2JDY+!!vo)*vzu(b z+wc6(ZUkVq1GFizcuJx-ML4L2Nv9l&s^N&TiFC>Ft$om;M&Fi0@g`_<`#tXUQ8m7qtc$Ae zxL2!kkTkk|OTC?u&}Iycy%*_~dkM7mMq~v8)&;kb*65bLpt22mVzNrs2e-&g&@HQK z(A_R$j1mdONShL>cas-_sv3z!73h*9F%pP|ngCB^o}akMY$bxF$bV|}%A_+I3=>%U zL0neCa+s`-#^o63vS}6It42M#)u4jh40ND&)iB3U!WeNCpykxQ`v5Bg$y7wC*Hv1K z%XfS;_-fF5gRI6MKdNRE_-ZjK5LGrkepLNy;HyLT_DCpz7XzFIFZOORoMkRRDL}J- z0}HVH+tR~*u?Va<;LlbEY9RUpRF{Gg3U|tE<_WMu!|ZjrzAG`&1N-l}rvL69b8%nve|4-(=;B8!WzI7qR3$OhbD*&4iIqP z!@a|Brn$%xfO!T^XK^!bfdys~pCeMiz{$^ceR*smJ$!C#d>n};Zr;jH z=5No;{PnkB9Cr|ZDH4@gZ8nbMXjz>{lB78}oRWlCNToAz93t6@NM>)D3K_-Tn>k;N}n$JnX+L)9ZEp27K82_fKw}r zL~XE;Dd0u9FLVYNa&U-x`gtMpoDh_rAn7Ni+w z`@o&?k;f>CyRV$Q9Jt*hQRFKs@LIaP*)IPkPRd3)=Dhx6-&*ZfMh)Ctxne S&b~)H58o#){P%!s3;qE{> + +8.0 +Full Histogram +BE18190 +V 10.72-8.17 MiniMate Plus +T190LD5Q.LD0H +11:00:49 +2025-12-09 +11:00:59 +2025-12-09 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.9 Volts +June 13, 2025 by Instantel +in/s and dB(L) +I-80-North Fork-Area 3-462Richardsvilel +Fay Company +Terra-Mechanics Inc.- Harrison +Loc #8 - Area 3- 462 Richardsville Road + +10.000 +in/s + + +2.140 +in/s + + +OORANGE +in/s + + +2.830 +in/s + + +>100 +Hz + + +85 +Hz + + +34 +Hz + +11:00:59 +2025-12-09 +11:00:59 +2025-12-09 +11:00:59 +2025-12-09 + +OORANGE +in/s + +11:00:59 +2025-12-09 +Linear Weighting + +106.0 +dB(L) + +11:00:59 +2025-12-09 + +85 +Hz + +7.4 Hz. +4.4 +Passed +7.6 Hz. +3.5 +Passed +7.3 Hz. +3.9 +Passed +20.5 Hz. +691 mv +Passed + + +2025-12-09 11:00:48 - 2025-12-09 11:00:59 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +2.140>100OORANGE852.83034OORANGE0.001106.085 + + + + + + diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 503023a..8edaca6 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -300,3 +300,28 @@ def test_blastwares_interval_frequency_words(halfp, sr, want): # below 1 Hz -- on ~3.1 M DL2 cells, 2026-11-03. from minimateplus.decode_check import interval_frequency assert interval_frequency(halfp, sr) == want + + +def _pvs_oorange(unclamp=False): + hb = FIX.parent / "histogram-intervals-11-03-26" + ref = parse_xml_report_file(hb / "T190LD5Q_LD0H_XML.XML") # Geo PVS OORANGE, Vert OORANGE + if unclamp: + cols = ref.interval_columns + t, row = ref.intervals[0] + row = list(row) + row[cols.index("Vert Peak in/s")] = "0.500" + ref.intervals[0] = (t, row) + res = {r.field: r for r in compare(sfm_side((hb / "T190LD5Q.LD0H").read_bytes()), ref, CARVEOUTS)} + return res["intervals.Geo PVS in/s"] + + +def test_an_oorange_interval_vector_sum_is_saturation(): + # Blastware prints OORANGE for an interval's vector sum above the range when + # it clamped a channel in that interval: 17 / 17 DL2 cells, SFM's sum + # 10.01 .. 17.33 (= sqrt 3 x 10.005). + r = _pvs_oorange() + assert (r.verdict, r.carveout) == ("accepted", "saturation") + + +def test_an_oorange_vector_sum_needs_a_clamped_channel_in_that_interval(): + assert _pvs_oorange(unclamp=True).verdict == "mismatch" -- 2.54.1 From 0238e4d3f3c0dd053b55d0b876151fb27c65a77b Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:12:14 -0500 Subject: [PATCH 192/223] docs(spec): phase 5 -- changing a unit's settings by serial Brian's intent (UM6047's trigger, notes typos, the backup unit), the flow, the first-version fields, and what is measured: Series 3's compliance block has Series 4's 0x1A layout; a whole 1A read assembles to the 2,090 bytes Blastware writes back (exact on both 10-26 writes); Blastware writes 00 00 at [26:28] and a per-unit constant after the block. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-11-03-sfm-phase5-settings-design.md | 339 ++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md diff --git a/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md b/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md new file mode 100644 index 0000000..a26aec4 --- /dev/null +++ b/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md @@ -0,0 +1,339 @@ +# Phase 5: changing a unit's settings by serial (design) + +**Date:** 2026-11-03. **Status:** draft for Brian. Phase 5 of +`docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` (row 10, "change +recording settings"; build phase 5, "setup push: one field first, then several"). +**Branch:** `feat/series4-sfm-parity`. + +## Intent (Brian, 2026-11-03) + +Change **any** of a unit's settings from SFM, and make it as easy and reliable as +possible. The goal is to fix what makes Blastware finicky. Three real cases: + +- **One wrong number on a deployed unit.** UM6047 was out monitoring with its + geophone trigger at 0.03 instead of 0.300. Brian remoted into the THOR PC, + stopped it (it called in), changed the setup, made sure it was *sent*, then + restarted monitoring. +- **A typo in the notes.** +- **A backup unit.** The unit set up at the office fails in the field, so a backup + from the truck goes in with blank or stale notes and settings. There is no + computer in the field, so the office re-does the whole setup remotely, by hand, + while the person in the field stands by to press Start or power-cycle if the + link breaks. + +What is wrong with THOR, as Brian and his dad experience it: + +- The same screen edits a setup on disk and views a unit's setup. +- Setups get saved under random number strings. +- Editing a setup does not change the unit; you verify separately that it was sent. + +Saved setups as templates would be acceptable. Not knowing whether you are +changing the unit or a file is not. + +## Goals, non-goals, anti-goals + +**Goals** + +- Edit the unit's **live** settings, both series. +- Show exactly what will change, **old → new**, before anything is sent. +- After sending, **re-read the unit** and show what it now holds. +- Make every refusal say why, in plain words. + +**Non-goals (this phase)** + +- Templates, saved setups, copying from another unit. +- Restarting monitoring. **Brian presses Start**, as today; SFM never restarts on + its own. +- Setting the unit's clock. That is a later call-home receiver rule. +- Fields not yet decoded. "Any and all" grows as decoding grows. + +**Anti-goals: things that would make it a failure even if it "works"** + +- Any doubt about whether the unit changed. +- A screen where a file and a unit look alike, or a name SFM made up. +- Writing a byte SFM did not just read. Every byte SFM does not deliberately change + goes back exactly as read. The one exception is a byte that Blastware's (or + THOR's) own writes always set to a fixed value. Each such byte is named in the + codec with its evidence (so far: Series 3 `[26:28]` → `00 00`; my call, below). +- Sending to a monitoring unit. +- A retry. A write is sent once; what happened is read back. + +## Measured basis + +**1. Series 4 (Micromate): the `0x1A` setup content map.** Measured from 47 +keypad snapshots on UM20147 and checksum-verified. `micromate/setup_block.py` +(`decode_setup`) reads it, with 69 tests on 15 fixtures. + +| content | field | +|---|---| +| `[5]` | record mode | +| `[6:8]` | sample rate | +| `[8:10]` | histogram interval | +| `[12:16]` | pre-trigger, f32, negative | +| `[17]` | stop mode | +| `[18:22]` | record time, f32 | +| `[23]` | auto-stop | +| `[25]` | active sensors | +| `[29]` | trigger sources | +| `[30:34]` | distance | +| `[34:38]` | charge | +| `[39]` | report flags | +| `[40:42]` | job number | +| `[42:86]` | setup name | +| `[122+64n]` / `[144+64n]` | notes (label / value) | +| from `[1708]` | 48-byte channel blocks: sensor code `+4:8`, trigger `+30` (geo in/s, mic psi) | + +The CRC-16/AUG-CCITT over `[0:2088]` is stored at `[2090:2092]`; THOR's write +omits it and the unit recomputes it. + +- **The push sequence (from THOR's captures)** is `0xDA` (name) → `0x68`/`0x73` + (`0x08` preferences) → `0x82`/`0x83` (`0x2E` trigger) → `0x71`/`0x72` (`0x1A` + setup). `micromate.writes.plan_setup_push` reproduces THOR's frames (phase 2). +- **Not yet mapped on Series 4:** alarm level, geophone range, GPS, aux I/O, SLM + options. + +**2. Series 3 (MiniMate) uses the same layout. Measured 2026-11-03.** The +compliance image as Blastware writes it is logical (unescaped), 2,092 bytes, with +`N = 2090` at `[0:2]` and the channel block "Tran" at `[1708]`. +`micromate.setup_block.decode_setup` reads it correctly: + +- **BE9441's 10-26 write** (`tests/fixtures/minimate-bench-10-26-26-histogram`, + two whole sends): name, mode, 4096 sps, interval, record time 20 s, trigger + 0.04 in/s, mic linear, job number and the notes all decode. Only the CRC fails + (Series 3's tail goes out stale). +- **BE11529's nine 2026-04-20 Blastware writes** (`bridges/captures/4-20-26/`, + every one with a whole image) each changed exactly the expected bytes: + + | Blastware changed | bytes that moved | + |---|---| + | histogram interval (×4) | `[8:10]` | + | recording mode (×3) | `[5]` | + | geophone range | `1737` / `1785` / `1833`, the range byte at each geophone channel label `+29` | + +- **The live `SUB 1A` read starts the same block.** Measured on the first data + frame of each of the four recorded reads (`_settings_replies` in + `tests/test_s3_compliance_anchor_fields.py`): unescaped, each carries `N = 2090` + 12 bytes before the old "anchor", and content `[5]` reads 1 / 4 / 3 / 3. That + anchor (`be 80 00 00 00 00`) is content `[12:18]`, pre-trigger −0.25 plus stop + mode Fixed. So Series 3 can be read by content offset rather than by anchor + search, which survives an Auto-stop unit (the open question of 2026-10-17). +- **A whole `1A` read assembles to exactly the 2,090 content bytes** (measured + 2026-11-03 on BE9441's 10-26 recording, 12 reads). Unescape each data frame and + take `data[11:]`. Every frame but the last then starts with one `00` byte that is + not content; drop it. This holds for Blastware's read (four 512-byte frames plus + 42) and SFM's (two 1024-byte frames plus 42). + - **The round trip is exact.** Blastware re-read the block after each of its two + writes, and each re-read equals the image it had just written, all 2,090 bytes. + - **While monitoring**, the read returns `0e 'BE9441' …` (the device-info block), + as the 10-29 finding says. The unit was monitoring for 5 of the 12 reads. +- **Bytes `[26:28]`: Blastware always writes `00 00`** (all 11 writes), though the + unit reads `01 7f` after a monitoring session (BE9441 10-26, BE11529 4-20 15:19). + The unit sets them again by itself. Meaning unknown. +- **The two bytes after the block are Blastware's own.** Blastware sends a per-unit + constant: `7c ea` on all nine of BE11529's writes, `0c e9` on both of BE9441's. + It is not the block's CRC-16/AUG, and no reply in BE9441's three-hour session + contains it. SFM's `write_image` sends `00 00` there. Since a read never returns + those bytes, the read-back cannot show what the unit did with them. +- **The mode byte is shared, but its codes are not.** Series 3: `00` Single Shot, + `01` Continuous, `03` Histogram, `04` Histogram + Continuous. Series 4: `01` + Waveform, `02` Manual, `03` Histogram, `04` Combo. +- **Rules from the checker's file-side work** (seismo-relay-b6, 2026-11-03; it + measured the same content offsets on 70,042 event files and found nothing that + contradicts one shared map): + - A bitmask byte is patched **bit by bit, never rebuilt**. The trigger-sources + byte `[29]` showed an unidentified `0x80` bit on one unit. + - On Series 3, stop mode (`0` Fixed) and mic type (`2` linear) are proven for + one value each. They are not offered for writing. + - An event file's `[12:16]` is that event's captured pre-trigger, not the + setting. SFM writes only from a live read, so this matters only to anyone + tempted to build a write from a file. +- **Series-3-only fields** (measured on Series 3, not Series 4): the geophone range + byte at channel `+29`; the alarm level at channel `+38` (checker-measured on + event files; live raw `+42`). + +**3. Series 3 write frames are measured (#46).** Writes use uniform escaping with +a length field. The compliance image goes in 512-byte addressed chunks. `0x68` is +written as read plus `02 00`, `0x82` plus `00 00`. The sequence is +`68→73 | 71×n→72 | 82→83 | 69→74→72`. `push_config_raw` refuses any block that +is not whole. `tests/test_minimate_write_frames.py` rebuilds Blastware's frames +byte for byte. + +**4. Monitoring.** + +- **Series 3:** while monitoring, the unit answers `1A` (and `0x2C`) with its + device-info block (measured 10-29 and 11-03). +- **Series 4:** it refuses call-home setup while monitoring ("Feature disabled + while monitoring", measured 11-03). +- **A stop with call-home on makes the unit call in** (measured 10-25, 10-29, + 11-03). + +**5. Series 4 specifics.** + +- `0x1A` reads the keypad's edit buffer live: unsaved keypad edits show in the + read, and a push would commit them. +- Loading a `.MMB` replaces the active config byte for byte. The push writes + under the active setup's name (`0xDA`). + +## The flow + +1. **Read.** `GET /device/settings?serial=…` (it exists) returns the unit's + settings. The page shows them on the Config tab under **"On the unit BE9441 — + read 14:03"**, never anything that looks like a file. +2. **Edit and preview.** The operator changes fields, then **Preview**: a dry run. + SFM re-reads the unit's blocks on the same line, builds the new blocks, and + returns one row per field: **old → new**, plus any warnings. Nothing is sent. +3. **Send.** The same request, live, is an audited change: + - identity check, audit row, one send, never retried, read back; + - **refused with "stop monitoring first"** if the unit is monitoring, noting + that the stop makes it call in when call-home is on; + - **refused** if the unit's settings changed since the preview. The preview + carries a revision (a hash of the blocks read), and the live call must + match it. +4. **Verify.** Re-read the blocks. Every changed field must read its new value. + Every other decoded field, and every byte SFM did not deliberately change, must + read as before. The page shows **"the unit now holds"**: field, old, new, now. + Known unit-maintained bytes (the Series-4 CRC) are compared as the unit's own + checksum (`crc_ok`), not byte for byte. +5. **Start** stays the operator's button. + +## Fields in the first version (Brian approved the list) + +| field | Series 3 | Series 4 | +|---|---|---| +| geophone trigger level | yes (channel `+30`) | yes (channel `+30`) | +| alarm level | yes (channel `+38`; measure live) | not mapped, so not offered | +| notes: the four note slots, by the unit's own labels | yes (`Project:`, `Client:`, `User Name:`, `Seis. Loc:` on BE9441) | yes (`Location`, `Client`, `Company`, `General Notes`) | +| recording mode | yes (`[5]`; values as measured on Series 3) | yes (`[5]`; Series-4 codes) | +| sample rate | yes | yes | +| record time | yes | yes | +| histogram interval | yes | yes | +| geophone range | yes (channel `+29`) | not mapped, so not offered | +| job number (+ shown on report) | yes | yes | + +A field is offered only where it is measured for that series. Values are refused +unless they are among the measured choices: sample rates 1024/2048/4096, +intervals 2/5/15/60/300/900 s, and each series' measured mode codes. + +- **Numbers (my call; no unit limits are written down anywhere in the repo):** + - Refuse any value outside the span seen on real units. The builder derives + each span from the DL2 XML reports, the fixtures and the captures, and records + it in the codec with its source. SFM then never sends a value no unit has + been seen to hold. A span can be widened later on evidence. + - A geophone trigger or alarm must also be at or below the range's full scale + (10 / 1.25 in/s). When range and trigger change in one request, check the + trigger against the **new** range. + - **Units:** refuse a level write unless the channel's unit string reads the + measured one (`in.` for a geophone). A unit set to Metric is unmeasured. +- **Notes:** edited by slot, under the label the unit itself shows (labels can be + renamed and are not identifiers). The value is at most its field width less + one byte, printable ASCII. + - Not in v1: Series 3's fifth slot, `Extended Notes` (value `\n` on BE9441). + Blastware's extended notes are unmeasured and may live elsewhere. + - Not in v1: Series 4's 16-byte field at content `[1064]` (`Loc 1` on + UM12947), undecoded. + +## Architecture + +- **One setup-block codec for both series.** Keep `micromate/setup_block.py` as + the field map and add `encode_setup(content, changes) -> content`: field patches + only, every other byte as given. It stays a pure codec library: no I/O, no + `sfm` imports, no import cycle with `minimateplus`. Series-specific fields (the + Series-3 range and alarm) are marked by series. +- **Series 3 read.** Assemble the `1A` read into the logical 2,090-byte block: + unescape, strip the 12-byte reply prefix and the inter-frame headers + (`read_compliance_config`). Decode it by content offset. +- **Series 3 write.** The patched logical block plus the tail becomes the + compliance image for `push_config_raw`. Event index (`0x08`), trigger (`0x2E`) + and waveform data (`0x09`) are echoed as read, in Blastware's sequence. + - On `0x09`, Blastware echoed the unit's bytes on all nine April writes + (`[200:202]` = `8c 76` read and written). Only BE9441's 10-26 writes changed + them (`17 17` read, `78 76` written, and read back so). The meaning is + unknown, so SFM echoes. + - **The raw-offset `_encode_compliance_config` is retired.** +- **The legacy write (`/device/config`, `/device/config/project`) is retired (my + call).** It retries a whole write on a TCP error, is not audited, does no + read-back, does not refuse a monitoring unit, and needs no serial: every + anti-goal at once. Its only user is the webapp's by-host Config form, and + Terra-View does not call it. Its routes answer with a pointer to the by-serial + change, and the by-host form becomes read-only. +- **Series 4 write.** `plan_setup_push(prefs, trigger, patched_setup, name)`. + - **No setup files in the operator's view (Brian, 2026-11-03).** "We treat the + Micromate setups just like Minimate setups … the unit just has its settings, + and we change it based on the job. We don't send setups to the unit." A + backup unit is usually on whatever setup its previous job left. So SFM + rewrites the setup the unit is running, in place, under its own name. It + never asks for a file or a name, and never creates one. The name may show as + a read-only detail, since the unit's screen shows it. + - The name comes from the `0x41` read, unstripped. + - Refuse `factory.MMB` and any target that is not the active setup (spec). The + refusal says it plainly: "this unit is running its factory setup; load any + other setup on its keypad, then try again." Brian says the team does not use + the factory setup, so this should be rare. + - `ENABLEABLE_WRITES` gains `0xDA 0x68 0x73 0x82 0x83 0x71 0x72`. + - The keypad edit buffer: warn in the preview that a unit with someone in its + menu would have those edits committed. The check the spec names, `0x1A` + against the active `.MMB` via `0x94`/`0x48`, is a bench question first. +- **The change path.** It keeps run_change's guarantees: identity, audit, one + send, read back, `ChangeUnconfirmed` with `sent`/`audit_id`. The "state" is a + set of fields, so either `run_change` takes a verify function or a sibling core + shares its parts. The builder decides; the guarantees do not change. The audit + row keeps the per-field changes, both blocks (hex) and the verdict. +- **Routes.** `POST /device/settings/change?serial=…` (serial required) with body + `{changes: {field: value}, revision}` and `dry_run`, `caller`. The response is + per-field `old` / `new` / `now`, through `_change_response`. A dry run needs no + revision and returns one. **A live call without the revision of a preview is + refused** (my call): nothing reaches a unit unless someone saw old → new. +- **Page.** The Config tab by serial becomes the unit's edit form: Preview → Send + (confirm) → "the unit now holds". New logic goes in + `sfm/static/device_routing.js` with Node tests, and glue in + `sfm/static/sfm_webapp.js` (no inline JS). + +## Verification + +- **Series 3, byte for byte.** For each of the 11 Blastware compliance writes, + apply the new encoder to the read before it (or the previous image), with the + fields Blastware changed. It must reproduce Blastware's content `[0:2090]`. The + two trailing bytes are compared separately, since they are Blastware's constant. + Ten writes change one field. BE9441's 16:26 write changes five things: mode, + sample rate 2048 → 4096, interval, the mic in the sensors byte `[25]`, and + `[26:28]`. That one is tested with all of them, through the codec, though v1's + page does not offer the sensors byte. + The frames rebuild through `push_config_raw`'s path (the #46 tests). +- **Series 3, read side.** The assembly rule above, pinned as a test on the 12 + reads of BE9441's 10-26 recording. Each read-back equals the write before it. +- **Series 4.** THOR's setup-push captures still reproduce, with no field changed. + Any capture where THOR changed a field becomes a byte-for-byte test. +- **Bench, with Brian's go per send, per series:** + 1. A dry run of a trigger change, then send, read back, check the unit's menu, + and change it back. + 2. A notes change. + 3. A several-field "backup unit" change. + 4. A dry run while monitoring, expecting the refusal. + +## Calls I made (Claude), for Brian to check + +- **Series 3 `[26:28]` goes out as `00 00`, as Blastware writes it**, rather than + the `01 7f` the unit may read. Measured beats inferred: Blastware's value is on + 11 accepted writes, and writing back `01 7f` has never been tried. +- **The two bytes after the Series 3 block stay `00 00`**, as `write_image` sends + them (a unit accepted that in the April 2026 test). Blastware's per-unit + constant cannot be derived from anything SFM reads. The first bench write checks + that the unit takes the block, and its menu shows the change. +- **The `0x09` block is echoed as read**, as Blastware did on all nine April writes. +- **Numbers are bounded by what real units have been seen to hold**, and level + writes are refused unless the channel's unit string is the measured `in.`. +- **Notes are edited by slot under the unit's own labels**, four slots on each + series. Series 3 extended notes and Series 4's separate location field wait. +- **The legacy by-host write is retired**; the by-host form becomes read-only. +- **A live send needs a preview's revision.** +- **Preview re-reads the unit** rather than trusting the page's copy, and Send + refuses if the unit changed since the preview. +- **The edit form lives on the Config tab, by serial**, replacing the legacy + read-modify-write form for units reached by serial. + +## Left to the builder + +- The module layout for the shared codec, within the no-cycle, pure-codec rule. +- `run_change` generalised versus a sibling core. +- The exact revision hash. +- Page layout details. -- 2.54.1 From 42933f76df69b69ebadf4a7b2a1ebd3feca533d0 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:29:00 -0500 Subject: [PATCH 193/223] docs(changelog): Unreleased -- histogram interval detail, #50 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7996c43..f2a3af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,34 @@ All notable changes to seismo-relay are documented here. change. ### Added +- **A histogram's interval detail: frequencies, vector sums, interval size and + stop** (group B of the file-only decode). Measured on DL2 2026-11-03. + - **Frequency** = (sample rate / 2) / half-period: 527,915 / 527,915 cells + at 1024 sps and 1,725 / 1,725 at 2048. + - ✅ **Fixes #50.** `half_period_to_hz` used a fixed 512 and halved every + 2048-sps frequency. It now takes the rate (default 1024). + - Blastware prints "N/A" for a half-period of 0, ">100" (">200" at 2048) + at 5 samples or fewer, and "<1.0" below 1 Hz. + - **Each interval's vector sum**, √PVS² at the event's range. + - **Interval size:** uint16 seconds at `k − 40` (Series IV `[8:10]`). + - **Stop time:** the footer's. + - **`Event` gains** `histogram_interval_sec`, `interval_half_periods`, + `interval_pvs` and `stop_time`. + - **The `.h5` gains** `/intervals/half_period/` and `/intervals/pvs_ips`, + plus a `histogram_interval_sec` attribute. + - **Decoder:** a histogram is now walked once + (`histogram_codec.channels_from_records`). + - **Decode checker:** 508,080 comparisons fixed, 0 regressions, 34 of 88 + fields fully match (was 28). + - Frequencies on all four channels, interval size and stop date match + every DL2 histogram. + - Interval vector sum: 63,497 match, plus 17 clipped intervals now under + the saturation carve-out. Blastware prints OORANGE when the sum exceeds + the range in an interval where it clamped a channel (17 / 17). + - 4 cells sit 4e-6 past a rounding boundary and stay mismatches. + - 58 stop times are Blastware a second earlier, part of #51. + - ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and + backfill. The `.h5` additions are additive. No schema change. - **A Blastware file's identity, battery and trigger settings** (group A of the file-only decode). Every field is matched against every DL2 report (2026-11-03). -- 2.54.1 From 2c4ae8c4ef3fdce11295c2b727324f11ea2a31df Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:29:53 -0500 Subject: [PATCH 194/223] docs: group B in the protocol reference (D.6.9), #50 retracted Interval size (k - 40), the stop (footer ts2), frequency = (sample rate / 2) / half-period with Blastware's words for N/A, >100 / >200 and <1.0, and each interval's vector sum with its OORANGE rule. The old fixed-512 frequency formula is retracted in place. CLAUDE.md and the README roadmap follow: 34 of 88. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CLAUDE.md | 11 ++++--- README.md | 4 +-- docs/instantel_protocol_reference.md | 46 +++++++++++++++++++++++----- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4ca43e4..133f79f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,9 +45,10 @@ Read this first when picking the project back up. - **Byte layouts** of every field read from the file: `docs/instantel_protocol_reference.md` Appendix **D.6**. - **Where the decoder stands on `dev`** (2026-11-03, run `20261103-140229`): - **28 of 88 fields match on every event**, up from about 6 before v0.33.0. - The five `dev` fixes below share one release and one backfill. + **Where the decoder stands on `dev`** (2026-11-03, run `20261103-180306`): + **34 of 88 fields match on every event**, up from about 6 before v0.33.0. + The six `dev` fixes below share one release and one backfill. Group B + (histogram interval detail, reference D.6.9) is done, which also fixed #50. - ✅ **Match on every event:** - sample rate, record time, pre-trigger, notes and event type (v0.33.0) - geophone range, job number, event times (6,524 / 6,524) and histogram @@ -88,8 +89,8 @@ Read this first when picking the project back up. (a carve-out to prove) - ⬜ **Not read yet, in the order proposed** (2026-11-03): - ~~**A. Setup fields**~~ ✅ done on `dev`. - - **B. Histogram interval detail:** per-interval frequencies (#50: they - assume 1024 sps), per-interval PVS, interval size, stop time. + - ~~**B. Histogram interval detail**~~ ✅ done on `dev`. Frequencies (#50), + per-interval PVS, interval size, stop. - **C. #51 timing:** start time, per-interval times, peak times. - **D. Blastware's waveform calculations:** ZC frequency, acceleration, displacement, time of peak. diff --git a/README.md b/README.md index 3e4724d..6fb2f80 100644 --- a/README.md +++ b/README.md @@ -632,7 +632,7 @@ Implementation steps (concrete): 3. flip ingest so reports are kept only for checking (retire the overlay) 4. stop the watchers forwarding reports - **Done so far: 28 of 88 report fields match on every DL2 event.** + **Done so far: 34 of 88 report fields match on every DL2 event.** - In v0.33.0: setup fields, notes, event type, histogram PVS, mic. - On `dev`: - the geophone range @@ -640,10 +640,10 @@ Implementation steps (concrete): - histograms that decoded wrongly - the footer: no more day-late histograms; every waveform time exact - serial, version, calibration, battery, trigger source and levels, stop mode, mic type + - histogram interval detail: frequencies (#50 fixed), per-interval PVS, interval size, stop - A Blastware report's dB/psi is its PC's preference, not anything in the event file: a carve-out. **Next:** - - histogram interval detail: frequencies (#50), per-interval PVS, interval size, stop time - histogram start times (#51) - the values Blastware computes itself: ZC frequency, acceleration, displacement, time of peak - the sensor check results diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 3a29aa7..e4839e2 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-03 (3) | Appendix D.6.9 (NEW), D.6.10 | ✅ **Histogram interval detail.** Interval size = uint16 seconds at `k − 40`; stop = footer ts2. Frequency = (sample rate / 2) / half-period, 527,915 / 527,915 cells at 1024 sps and 1,725 / 1,725 at 2048 — **#50 retracted** (a fixed 512 halved 2048-sps frequencies). Blastware's words: `N/A` (half-period 0), `>100` / `>200` (≤ 5 samples), `<1.0`. Per-interval vector sum √PVS²: 63,497 histograms; `OORANGE` when over range with a clamped channel, 17 / 17. 34 of 88 report fields now match on every DL2 event. | | 2026-11-03 (2) | Appendix D.6.6, D.6.8 (NEW), D.6.9 | ✅ **Identity, battery and trigger, from the file.** **D.6.8:** the identity block before the setup name is SUB FE's (serial `k − 202`, firmware `k − 147`, DSP `k − 138`, calibration `k − 132` + by `k − 128`, model `k − 72`; battery uint16 /100 at `k − 190`); all 70,042 / 70,042. The embedded event record's two unknown bytes are the **trigger source** bitmask (6,524 / 6,524). Trigger sources `k − 19`, stop mode `k − 31`, per-channel trigger level float32 at label + 30, mic type at MicL + 4 (Series IV's code). **D.6.6:** recorded data vs report units vs unit peaks, with the manual sections; a Blastware report's dB/psi is the PC's preference. 🔶 `9c 06 00 42` (the histogram "terminal tail") looks like `9c 06 00` + the serial's `B`. 28 of 88 report fields now match on every DL2 event. | | 2026-11-03 | Appendix D.3.3, D.6.1, D.6.3, D.6.5, D.6.7, §8 | ✅ **File-only decode, second pass (on `dev`).** **D.3.3:** the footer is the file's last 26 bytes (70,041 / 70,041); an earlier stop-time record fooled the first-match search on 14 files, making histograms a day late. Its `[18:24]` is **not** fixed (retracted). **D.6.1:** STRT[18] now picks the codec; the waveform codec had claimed 2018 5 s histograms. **D.6.3:** the job number (flags `k − 9` bit `0x02`, uint16 at `k − 8`; 2,997 / 2,997). **D.6.5:** the PVS² high word is non-zero above 1.28 in/s (retracted "reads 0000"), so the layout check now uses peak ≤ PVS ≤ √3·peak (34,502,955 / 34,502,955); Blastware's "Number of Intervals" is the monitoring time ÷ the interval. **§8:** where the 1995 default-clock events come from. 18 of 88 report fields now match on every DL2 event. | | 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). **For #48:** the file's copy of the block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is each event's own pre-trigger, which varies on the same unit on the same day (253–256 samples at 1024 sps), and Blastware reports it per event. So the file says little about whether the live 1A loses its anchor, and #48 stays open. | @@ -3860,21 +3861,51 @@ That holds on 6,524 / 6,524 waveforms. - **The file's channel block is the 1A's, 4 bytes earlier.** Compare the 1A's scale constant at +28 and range at +33 with the file's +24 and +29. -#### D.6.9 Not read from the file yet +#### D.6.9 Histogram interval detail ✅ 2026-11-03 -*Updated 2026-11-03. 28 of 88 report fields now match on every DL2 event.* +**Interval size** is a uint16 count of seconds at `k − 40` (Series IV `[8:10]`): 2, 5, 15, 60 or +300. It matches Blastware's IntervalSize ("1 minute", "5 seconds", …) on 63,518 / 63,518 DL2 +histograms. **The stop** is the footer's ts2: 63,460 / 63,518. The other 58 are Blastware a +second earlier, the #51 family. + +**Each interval's frequency** comes from its half-period in samples: +`frequency = (sample rate / 2) / half-period`. That matches 527,915 / 527,915 printed cells at +1024 sps and 1,725 / 1,725 at 2048. +- ⚠ **RETRACTED (#50):** "frequency = 512 / half-period". 512 is half the sample rate at + 1024 sps only; at 2048 sps it halved every frequency. + +Blastware prints these words instead of a number, on ~3.1 M DL2 cells: + +| half-period / frequency | printed | +|---|---| +| half-period 0 | `N/A` | +| half-period ≤ 5 samples | `>100` at 1024 sps, `>200` at 2048 | +| below 1 Hz | `<1.0` | +| below 10 Hz (20 at 2048) | one decimal | +| otherwise | a whole number | + +All four channels match every DL2 histogram. + +**Each interval's vector sum** is √PVS² (D.6.5) at the event's range: 63,497 histograms match. +- Blastware prints `OORANGE` for an interval's vector sum above the range when it also clamped + a channel in that interval: 17 / 17 cells. The decode checker's saturation carve-out covers + it. +- 4 cells sit about 4e-6 past a rounding boundary. Blastware's arithmetic is a hair lower; they + stay counted as mismatches. + +#### D.6.10 Not read from the file yet + +*Updated 2026-11-03. 34 of 88 report fields now match on every DL2 event.* - **Fields not read yet:** - - per-interval frequencies (#50: they assume 1024 sps), per-interval PVS, interval size, - histogram stop time - extended notes - the values Blastware computes: ZC frequency, acceleration, displacement, time of peak - sensor check results - monitor log - **Open cases:** - - histogram start times are 1 s early (#51) + - histogram start times are 1 s early (#51), and so are 58 stop times - about 20 one-minute histograms with a mic peak an interval or two off - - Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out still to - prove) + - Blastware prints `OORANGE` when an event's vector sum alone exceeds the range, with no + clamped channel (a carve-out still to prove; the interval version is proven, D.6.9) - **Resolved on `dev`, 2026-11-02 → 03:** - the 37 histograms that decoded wrongly (D.6.1, D.6.5) - the 26 histogram start dates a day off (D.3.3; 17 of them were the same 5 s files, timed @@ -3882,6 +3913,7 @@ That holds on 6,524 / 6,524 waveforms. - the job number (D.6.3) - identity, battery, trigger source and trigger settings (D.6.8); Units is Blastware's preference (D.6.6) + - histogram interval detail: frequencies (#50), vector sums, interval size, stop (D.6.9) --- -- 2.54.1 From e8242aaadc311a54677613c353f8e3684b2359eb Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:30:08 -0500 Subject: [PATCH 195/223] docs(changelog): Unreleased -- group B in the protocol reference Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a3af3..c00fc6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -184,6 +184,13 @@ All notable changes to seismo-relay are documented here. `.h5` attributes are additive. No schema change, no migration. ### Protocol / Documentation +- **Group B in the protocol reference (D.6.9):** + - interval size, the stop, and per-interval frequency, with Blastware's + words (`N/A`, `>100` / `>200`, `<1.0`) + - each interval's vector sum, with its OORANGE rule + - #50's fixed-512 formula is retracted in place + - CLAUDE.md and the README roadmap follow + - Docs only. - **Group A in the protocol reference, and the three meanings of mic "units".** - **D.6.8:** the identity block, the trigger-source bitmask and the trigger -- 2.54.1 From dba891d504671cf276e8d73fbe84fbf999481a38 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:35:29 -0500 Subject: [PATCH 196/223] docs(spec): phase 5 -- the Micromate schedule check; work hours is next A scheduled start loads the setup it names, so a change to another setup would be undone at the next start: read schedule.dat and refuse that case. Configurable work-hours recording, without THOR's scheduler or setup files, is the agreed next project. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../2026-11-03-sfm-phase5-settings-design.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md b/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md index a26aec4..1a9dd02 100644 --- a/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md +++ b/docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md @@ -45,6 +45,13 @@ changing the unit or a file is not. - Restarting monitoring. **Brian presses Start**, as today; SFM never restarts on its own. - Setting the unit's clock. That is a later call-home receiver rule. +- **Writing the Micromate scheduler.** Next project, agreed 2026-11-03: + "record during work hours" as a plain, **configurable** setting on the unit's + page, both series, no schedule library and no setup files. On the Micromate, + it relies on the firmware's setup-less scheduler start (found in the firmware, + never sent; one bench session). On the MiniMate, its own timer setting + (undecoded). Brian's dad despises THOR's scheduler; Brian is willing to retire + it in SFM. - Fields not yet decoded. "Any and all" grows as decoding grows. **Anti-goals: things that would make it a failure even if it "works"** @@ -264,6 +271,17 @@ intervals 2/5/15/60/300/900 s, and each series' measured mode codes. rewrites the setup the unit is running, in place, under its own name. It never asks for a file or a name, and never creates one. The name may show as a read-only detail, since the unit's screen shows it. + - **The scheduler can undo a change (Brian, 2026-11-03, with THOR's Manage + Schedules screen).** Work-hours Micromates run a THOR schedule, e.g. Start + Monitoring 07:00 with setup `Mele-PWSA-Carroll -Loc 4`, stop 18:30, repeat + daily. THOR sends the schedule with its setup, and each scheduled start loads + the setup it names. So the preview and the send read `schedule.dat` (format + decoded, reference *The schedule record format*), read-only. A start action + naming a setup other than the one being changed blocks the send: "this unit's + schedule loads at 07:00, which would replace this change." When the + schedule names the active setup (the usual case after a scheduled start), the + change survives, and the preview says when the next scheduled start is. + SFM never writes the schedule in this phase. - The name comes from the `0x41` read, unstripped. - Refuse `factory.MMB` and any target that is not the active setup (spec). The refusal says it plainly: "this unit is running its factory setup; load any -- 2.54.1 From 71609e71ab9e303211bf2352a486f9ca4b7e2ae7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:51:53 -0500 Subject: [PATCH 197/223] docs(plan): phase 5 -- changing a unit's settings by serial Seven tasks: the Series 3 read assembly, one settings codec for both series, the Micromate schedule read, each series' audited change, the route (and the legacy write retired), and the page. Spans measured from 75,958 Blastware reports. Bench after the final review, Brian's go per send. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- .../plans/2026-11-03-sfm-phase5-settings.md | 519 ++++++++++++++++++ 1 file changed, 519 insertions(+) create mode 100644 docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md diff --git a/docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md b/docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md new file mode 100644 index 0000000..c1a0066 --- /dev/null +++ b/docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md @@ -0,0 +1,519 @@ +# Phase 5: Changing a Unit's Settings by Serial — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** An operator edits a unit's live settings in SFM, by serial, on either series: preview old → new, send once (audited), and see what the unit now holds. + +**Architecture:** +- **One pure settings codec for both series** (`micromate/setup_fields.py`), on the measured shared 2,090-byte layout. +- **Each series' adapter supplies reads, the plan and the send** to the existing `run_change` core, unchanged. + - Its "state" is a read-back verdict: `as asked` / `unchanged` / `differs`. + - Series 3 sends through `push_config_raw`; Series 4 through `plan_setup_push`. + - Series 4 also reads the unit's schedule, read-only, to refuse a change that a scheduled start would undo. +- **One audited route**, `POST /device/settings/change`. The legacy by-host write is retired. + +**Tech Stack:** Python 3 (FastAPI, pytest), vanilla JS tested in Node (`tests/test_webapp_device_routing.py`). + +**Spec:** `docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md` (approved by Brian 2026-11-03). Parent spec: `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`. + +## Global Constraints + +- **Worktree and branch:** work in `~/seismo-relay-parity` on `feat/series4-sfm-parity`. Check `git branch --show-current` before every commit; never commit to `main`; push every commit. +- **Python:** `/home/serversdown/seismo-relay/.venv/bin/python -m pytest …` from the worktree root. +- **The suite has 16 known failures.** + - Run the full suite once before Task 1 and save the failure list in the plan workspace as `baseline-failures.txt`. + - Before every commit, run the suite, read the failure list, and confirm it equals the baseline. + - Commit in a separate call, never chained to the test run. +- **No live device traffic** in any task. The bench is after the final review, with Brian's explicit go per send. + - Never port 8200. + - Never write modem baud or modem type. + - Never send `0xA2`. +- **`CHANGELOG.md` is not touched** on this branch; it is written on `dev` at the merge. +- **No inline JavaScript.** New page logic goes in `sfm/static/device_routing.js` (DOM-free, Node-tested); glue goes in `sfm/static/sfm_webapp.js`. +- **`docs/instantel_protocol_reference.md` is CRLF.** Edit it only with the Edit tool. Keep its rows in date order. +- **Off-limits (the checker session's files):** `minimateplus/event_file_io.py`, `histogram_codec.py`, `waveform_codec.py`, `bw_xml_report.py`, `decode_check*.py`. +- **`TOOL_VERSION` is unchanged:** nothing here changes event decoding. Operational consequence: none; no migration, no backfill. +- **Grade every protocol claim** in comments and docs as measured or inferred. +- **Mutation checks:** after a mutate/restore, delete the module's `__pycache__/*.pyc` before the confirming run. + +## Review Focus + +1. **A Micromate with no schedule file, or a schedule read that fails.** + - A body with no records means no conflict, and the change proceeds. + - A read that raises refuses the change in plain words. + - Owner: Task 4; tests `test_no_schedule_records_is_no_conflict` and `test_an_unreadable_schedule_refuses`. +2. **A float that is stored as f32.** 0.3 reads back as 0.30000001192. + - The verdict compares bytes with the image written, never floats, so it reads `as asked`. + - Owner: Task 2; test `test_f32_values_read_back_as_asked`. +3. **A stale or foreign revision** after a keypad edit, or a preview of another unit. + - The send is refused with 409, nothing is sent, and no audit row is written. + - Owner: Tasks 4 and 5; tests `test_s4_stale_revision_sends_nothing` and `test_s3_stale_revision_sends_nothing`. +4. **Range and trigger changed in one request.** The trigger is checked against the **new** range. + - Owner: Task 2; test `test_trigger_checked_against_the_new_range`. +5. **Notes at the edges.** + - `""` clears a note. + - 41 bytes is accepted; 42 is refused; non-ASCII is refused. + - Labels are never written. + - Owner: Task 2; tests `test_note_edges` and `test_note_labels_are_never_written`. + +--- + +## File Structure + +| file | responsibility | +|---|---| +| `minimateplus/protocol.py` | **Series 3 assembly:** `assemble_compliance_content`, `is_compliance_content`, `MiniMateProtocol.read_compliance_content`. **Writes:** `push_config_raw`'s pre-check raises `ImageRefused`. | +| `minimateplus/client.py` | **Added:** `read_compliance_content()` and `read_settings_blocks()`. **Deleted:** `apply_config`, `set_project_info`, `_encode_compliance_config`. | +| `micromate/setup_block.py` | **Added:** `with_crc(content)`. | +| `micromate/setup_fields.py` (new) | **The shared, pure settings codec:** field registry, `editable_fields`, `check_changes`, `encode_setup`, `field_values`, `settings_state`, `revision`. | +| `micromate/schedule.py` (new) | **Pure:** `parse_schedule`, `ScheduleEntry`, `schedule_conflicts`. | +| `micromate/protocol.py` | **Added:** `read_file(path)`, using `0x94` then `0x48` pages. | +| `micromate/client.py` | **Added:** `read_schedule()`, `get_active_setup_raw()`, `get_prefs_content()`, `get_trigger_content()`, `get_setup_content()`. | +| `micromate/opcodes.py` | `ENABLEABLE_WRITES` gains the setup-push SUBs. | +| `sfm/device_access/errors.py` | **Added:** `SettingsChanged` and `ChangeRefused`, both 409. | +| `sfm/device_access/change.py` | **Added:** `settings_change()`. | +| `sfm/device_access/s4.py` | `s4_settings` moves onto the codec. **Added:** `s4_change_settings`. | +| `sfm/device_access/s3.py` | `Series3Adapter.settings` moves onto the codec. **Added:** `Series3Adapter.change_settings`. | +| `sfm/device_access/access.py` | **Added:** `DeviceAccess.change_settings`. | +| `sfm/server.py` | **Added:** `POST /device/settings/change`. `/device/config` and `/device/config/project` return 410. | +| `sfm/static/device_routing.js`, `sfm/static/sfm_webapp.js`, `sfm/sfm_webapp.html` | The edit form. | +| `tests/device_access_fakes.py` | The fakes gain settings blocks, a schedule, and writes. | + +--- + +### Task 1: Series 3 — assemble a settings read into the logical block + +**Measured basis (spec, 2026-11-03):** unescape each `1A` data frame and take `data[11:]`. Every frame but the last starts with one non-content `00` byte; drop it. The result is 2,090 bytes with `N = 2090` at `[0:2]`. + +**Files:** +- Modify: `minimateplus/protocol.py`, near `read_compliance_config` (≈ line 913) +- Modify: `minimateplus/client.py` +- Modify: `docs/instantel_protocol_reference.md` (one dated row, 2026-11-03) +- Test: `tests/test_s3_settings_read.py` (new) + +**Interfaces:** +- Produces: + - `assemble_compliance_content(frames: list[bytes]) -> bytes`. `frames` is each data reply's `frame.data`, escapes kept, in order. + - `is_compliance_content(block: bytes) -> bool`: `len == 2090` and `int.from_bytes(block[0:2], "big") == 2090`. + - `COMPLIANCE_CONTENT_LEN = 2090`. + - `MiniMateProtocol.read_compliance_content() -> bytes`: + - sends the same probe and B/C/D requests as `read_compliance_config`; + - a missing data frame raises `ProtocolError` (no `continue`); + - returns the assembled bytes **without** judging them, so a monitoring unit's device-info answer comes back for the caller to recognise. + - `MiniMateClient.read_compliance_content() -> bytes`. + - `MiniMateClient.read_settings_blocks() -> dict` with keys `event_index`, `compliance`, `trigger` and `waveform`. Each value is the bytes its existing read returns: + - `event_index`: `proto.read_event_index()` + - `compliance`: `read_compliance_content()` + - `trigger`: `proto.read_trigger_config()` + - `waveform`: `proto.read_waveform_data_raw()` + +- [ ] **Step 1: Write the failing tests** in `tests/test_s3_settings_read.py`. Use `tests/fixtures/minimate-bench-10-26-26-histogram` (`unit_replies.bin` parsed with `S3FrameParser`). Group the `0xE5` frames into reads: a frame with `len(data) == 11` starts each read. Take the write images from `tests/test_minimate_write_frames.py` (`WRITES[0:13]`, `WRITES[13:26]`; the `0x71` payloads `[16:]` joined). + +```python +def test_reads_assemble_to_2090_bytes(): # all 12 reads, both frame patterns (5 and 3 frames) + assert all(len(assemble_compliance_content(r)) == 2090 for r in READS) + +def test_a_read_after_a_blastware_write_equals_the_write(): + assert assemble_compliance_content(READS[1]) == IMAGES[0][:2090] + assert assemble_compliance_content(READS[2]) == IMAGES[1][:2090] + +def test_a_monitoring_units_answer_is_not_settings(): # READS[3:8] start 0e 'BE9441' + assert [is_compliance_content(assemble_compliance_content(r)) for r in READS[3:8]] == [False] * 5 + assert all(is_compliance_content(assemble_compliance_content(r)) for r in READS[:3] + READS[8:]) + +def test_read_compliance_content_refuses_a_missing_frame(): + ... # a fake transport that answers the probe and frame B, then times out: ProtocolError, nothing assembled +``` + +- [ ] **Step 2: Run them.** `…pytest tests/test_s3_settings_read.py -q`. Expected: FAIL (ImportError: `assemble_compliance_content`). +- [ ] **Step 3: Implement** the Produces block in `protocol.py` and `client.py`. Use `unescape_reply` from `minimateplus.framing`. The docstring cites the measurement and its fixture. +- [ ] **Step 4: Run them.** Expected: PASS (4 passed). +- [ ] **Step 5: Add a reference row** to `docs/instantel_protocol_reference.md` (Edit tool; CRLF), dated 2026-11-03, measured. Cover: + - the assembly rule; + - the round trip (2 of 2); + - `[26:28]`: Blastware writes `00 00` (11 of 11), and the unit sets `01 7f` after monitoring; + - the trailing two bytes: a per-unit Blastware constant (`7c ea` BE11529 ×9, `0c e9` BE9441 ×2), not the CRC, and never in a reply; + - `0x09 [200:202]`: echoed 9 of 9 in April; changed on 10-26 (`17 17` → `78 76`). +- [ ] **Step 6: Run the full suite** and compare the failure list with the baseline. **Then commit** (separate call): `feat(s3): assemble a settings read into the 2,090-byte block`. + +--- + +### Task 2: The shared settings codec + +**Files:** +- Create: `micromate/setup_fields.py` +- Modify: `micromate/setup_block.py`: add `with_crc(content: bytes) -> bytes`, which returns the content with `CRC-16/AUG-CCITT` over `[0:N-2]` written BE at `[N:N+2]`. +- Test: `tests/test_setup_fields.py` (new) + +**Interfaces:** +- Consumes: Task 1's `assemble_compliance_content`, used in tests only. The codec itself imports nothing from `minimateplus` and nothing from `sfm`. +- Produces (all pure). Each `content` is the 2,090-byte (Series 3) or 2,092-byte (Series 4) block. + - `editable_fields(content: bytes, series: int) -> list[dict]`. Each dict has `field`, `label`, `kind` (`"number"`, `"choice"`, `"text"` or `"bool"`) and `value`, plus as relevant `unit`, `min`, `max`, `choices` (a list of `{value, label}`) and `maxlength`. + - `field_values(content: bytes, series: int) -> dict[str, Any]`: the same fields, values only. + - `check_changes(content: bytes, series: int, changes: dict) -> dict`: returns the normalised changes, or raises `SettingsValueError(ValueError)` with a plain sentence. It has two kinds of check: static (names, types, choices, spans) and content-dependent (unit strings, the trigger against the range). + - `encode_setup(content: bytes, series: int, changes: dict) -> bytes`: + - same length as `content`; + - only the changed fields' bytes move; + - bit fields are patched bit by bit; + - Series 3 also sets `[26:28] = 00 00` (`S3_BLASTWARE_FIXED`); + - Series 4 returns `with_crc(...)`. + - `settings_state(before: bytes, written: bytes, now: bytes, *, series: int) -> str`. It compares `[0:2090]`: + - `"as asked"` if `now` equals `written` (Series 4 also needs `crc_ok(now)`); + - else `"unchanged"` if `now` equals `before`; + - else `"differs"`. + - `revision(blocks: list[bytes]) -> str` = `hashlib.sha256(b"".join(blocks)).hexdigest()[:16]`. + - `S3_ALARM_WRITE_MEASURED = False`. While False, `geo_alarm_ips` is shown (read-only, `kind` plus `"readonly": True`) and refused in `check_changes`. + +**The field registry** (content offsets; channel `k` = `1708 + 48·k`, `k` = 0, 1, 2 for the geophones): + +| field | series | bytes | values (exact) | +|---|---|---|---| +| `record_mode` | 3 | `[5]` | `single_shot`=0, `continuous`=1, `histogram`=3, `histogram_continuous`=4 | +| `record_mode` | 4 | `[5]` | `waveform`=1, `manual`=2, `histogram`=3, `combo`=4 | +| `sample_rate` | 3, 4 | `[6:8]` u16 BE | {1024, 2048, 4096} | +| `histogram_interval_s` | 3, 4 | `[8:10]` u16 BE | {2, 5, 15, 60, 300, 900} | +| `record_time_s` | 3, 4 | `[18:22]` f32 BE | 1.0 ≤ v ≤ 20.0 | +| `geo_trigger_ips` | 3, 4 | ch k `+30` f32 BE, all three | 0.005 ≤ v ≤ 0.6, and ≤ the (new) range's full scale (10.0 / 1.25) | +| `geo_range` | 3 | ch k `+29` u8, all three | `normal`=0, `sensitive`=1 | +| `geo_alarm_ips` | 3 (gated) | ch k `+38` f32 BE, all three | 0.005 ≤ v ≤ full scale | +| `job_number` | 3, 4 | `[40:42]` u16 BE | 0 ≤ v ≤ 65535 | +| `job_number_shown` | 3, 4 | `[39]` bit `0x02` | bool | +| `note_1` … `note_4` | 3, 4 | value `[144+64n : 186+64n]`; label `[122+64n : 144+64n]` read only | printable ASCII 0x20–0x7E, ≤ 41 bytes, zero-filled to 42 | + +Where the spans come from, recorded in the module as comments: +- **Trigger and record time:** 75,958 Blastware reports, 2016–2026, scanned 2026-11-03. 7,586 print a trigger: 0.005–0.500 in/s, 20 values, all in/s. 7,631 print a record time: 1.0–10.0 s. +- **The tops of the spans:** BE11529's 2026-04-20 writes and the UM20147 fixtures (trigger 0.6, record time 11), and BE9441's 10-26 setup (record time 20). +- **Job number:** bounded by its encoding (UM20147 keypad 0 → 1 → 1234). The read-back verifies it. + +**A level write is refused** unless all three geophone channels' unit string, `ch +34:+38` with NULs and `.` stripped, equals `in`. Measured: `in.` and `in` both occur on UM20147. A unit set to Metric is unmeasured. + +- [ ] **Step 1: Write the failing tests** in `tests/test_setup_fields.py`: + +```python +def test_s3_reproduces_every_blastware_write(): + # BE11529's 9 April images (bridges/captures/4-20-26/**/raw_bw_*.bin), in time order (the HHMMSS in + # the name): before = the previous image; the first (151921) uses the assembled 1A read in its own + # raw_s3 capture if that read is whole, else it is skipped (say so in the test). BE9441's 2 images: + # before = the assembled READS[0], then image 1. changes = field_values(after) for every field whose + # value differs. Assert encode_setup(before, 3, changes)[:2090] == after[:2090]. + # The 16:26 write also moves [25] (mic on): include `_sensors_mic` as a test-only patch helper, + # not a registry field. + +def test_s4_fixture_pairs_reproduce(): + # for every ordered pair (a, b) of tests/fixtures/micromate-setup/*.bin whose differing bytes outside + # [2090:2092] all lie inside registry fields: encode_setup(a, 4, {f: field_values(b)[f] for differing f}) == b + +def test_trigger_checked_against_the_new_range(): ... # Series 3: {"geo_range": "sensitive", "geo_trigger_ips": 0.6} passes; a fake full scale below 0.6 refuses +def test_spans_refuse_outside_values(): ... # 0.004 and 0.61 in/s; 0.9 and 20.1 s; sample rate 8192; interval 30 +def test_field_not_offered_for_the_series(): ... # geo_range on series 4 -> SettingsValueError naming the series +def test_alarm_is_read_only_until_measured(): ... # Series 3 geo_alarm_ips -> SettingsValueError while S3_ALARM_WRITE_MEASURED is False +def test_metric_unit_string_refuses_level_writes(): ... # ch +34 = b"mm\x00\x00" -> SettingsValueError; b"in.\x00" and b"in\x00\x00" pass +def test_note_edges(): ... # "" clears; 41 bytes ok; 42 refused; "café" refused +def test_note_labels_are_never_written(): ... # changing note_2 moves only [208:250] +def test_bit_fields_keep_unknown_bits(): ... # [39] = 0x81: job_number_shown True -> 0x83, False -> 0x81 +def test_s3_fixed_bytes(): ... # any S3 encode sets [26:28] = 00 00 +def test_s4_encode_recomputes_the_crc(): ... # crc_ok(encode_setup(fixture, 4, {"job_number": 7})) +def test_f32_values_read_back_as_asked(): ... # written = encode(0.3); settings_state(before, written, written) == "as asked" +def test_settings_state(): ... # "as asked" / "unchanged" / "differs"; S4 with a bad CRC -> "differs" +def test_revision_is_stable_and_content_sensitive(): ... +``` + +- [ ] **Step 2: Run them.** Expected: FAIL (ModuleNotFoundError: `micromate.setup_fields`). +- [ ] **Step 3: Implement** `micromate/setup_fields.py` and `with_crc`. Decode via the registry (not via `decode_setup`, whose notes are keyed by label). Note labels come from the unit and are display only. +- [ ] **Step 4: Run them.** Expected: PASS. Then mutation-check `S3_BLASTWARE_FIXED` (remove it: the Blastware-write test fails), delete the `.pyc`, and restore. +- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(codec): one settings codec for both series, on the shared layout`. + +--- + +### Task 3: Micromate — read the schedule file + +**Measured basis:** reference *The scheduler, and a generic file transfer* and *The schedule record format*. +- `0x94 ` opens a file for read; `offset` = the path's length, and the payload is the path, unpadded. +- `0x48` reads the next page, repeated until an all-zero 11-byte response. +- The file is 260-byte records. `[4]` is the half-hour slot. `[6]` is the action bitmask: 2 start-with-setup, 4 stop, 8 self-check, 16 ACH. `[7]` is the name length; `[8:260]` is the name. + +**Files:** +- Create: `micromate/schedule.py` +- Modify: `micromate/protocol.py` (`read_file`), `micromate/client.py` +- Modify: `docs/micromate_protocol_reference.md`: one line under the scheduler section saying SFM reads it (read-only) from 2026-11-03. +- Test: `tests/test_micromate_schedule.py` (new) + +**Interfaces:** +- Produces: + - `SCHEDULE_PATH = "\\system\\schedule\\schedule.dat"`. + - `MicromateProtocol.read_file(path: str) -> bytes`: the concatenated content of each `0x48` page after the page-0 descriptor, stopping at the all-zero response; at most 64 pages, else `ProtocolError`. + - `MicromateClient.read_schedule() -> bytes`. + - `MicromateClient.get_active_setup_raw() -> str`: the `0x41` name up to its NUL, **not** stripped. + - `MicromateClient.get_prefs_content() -> bytes` (`0x08`), `get_trigger_content() -> bytes` (`0x2E`) and `get_setup_content() -> bytes` (`0x1A`), each `_content(...)` of its read. + - `@dataclass(frozen=True) class ScheduleEntry`: `index: int`, `time: str` (`"HH:MM"`), `day: int`, `action_bits: int`, `actions: tuple[str, ...]`, `setup: str`. + - `parse_schedule(body: bytes) -> list[ScheduleEntry]`: 260-byte records; a record with `[4:8]` all zero and no name ends the list. `actions` names the bits 2/4/8/16 as `start_with_setup`, `stop`, `self_check` and `call_home`; any other bit becomes `unknown(0xNN)`. + - `schedule_conflicts(entries, active_setup: str) -> list[ScheduleEntry]`: start entries whose setup, compared case-insensitively after `strip()`, is not the active setup. + +- [ ] **Step 1: Write the failing tests.** Parse the bodies from `bridges/captures/9-24-26 - micromate2/raw_s3_20260924_191835_read_scheduler.bin` (frames 0–4), and from the two `raw_*_20260925_*` captures, with `MicromateFrameParser`. + +```python +def test_the_read_capture_parses(): # 2 records: start-with-setup 07:30 (40-char name), call_home 19:30 (no name) +def test_the_five_entry_schedule_parses(): # 07:30 start TEST1.mmb, 08:00 stop, 08:30 self_check, 09:00 start test2.mmb, 19:30 call_home +def test_conflicts_are_case_insensitive(): # active "test1.MMB" -> only the test2.mmb start conflicts +def test_no_schedule_records_is_no_conflict(): assert schedule_conflicts(parse_schedule(bytes(524)), "x.mmb") == [] +def test_read_file_sends_the_path_unpadded_and_stops_at_zeros(): ... # a fake protocol: 0x94 offset 0x001D, then 0x48 until all-zero +def test_get_active_setup_raw_keeps_spaces(): ... # " LOC 4 .mmb " survives +``` + +- [ ] **Step 2: Run them.** Expected: FAIL (ModuleNotFoundError: `micromate.schedule`). +- [ ] **Step 3: Implement** the Produces block. `read_file` builds `0x94` with `build_request(0x94, len(path), bytes(10), path.encode("ascii"))`. Both SUBs are already in `READ_SUBS`. +- [ ] **Step 4: Run them.** Expected: PASS. +- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(micromate): read the schedule file (read-only)`. + +--- + +### Task 4: Change-path pieces and the Series 4 settings change + +**Files:** +- Modify: `sfm/device_access/errors.py`, `sfm/device_access/change.py`, `micromate/opcodes.py`, `sfm/device_access/s4.py`, `tests/device_access_fakes.py` +- Modify: `tests/test_micromate_execute.py`, `tests/test_micromate_opcodes.py`. Their over-ceiling example `0x71` becomes enableable here; use `0xA8` (delete one event) instead. +- Test: `tests/test_device_access_s4_settings.py` (new) + +**Interfaces:** +- Consumes: + - Task 2: `editable_fields`, `field_values`, `check_changes`, `encode_setup`, `settings_state`, `revision`. + - Task 3: `read_schedule`, `parse_schedule`, `schedule_conflicts`, `get_active_setup_raw`, and the content getters. + - `micromate.writes.plan_setup_push(prefs, trigger, setup, name)`. +- Produces: + - `class SettingsChanged(DeviceError)`, `http_status = 409`. + - `class ChangeRefused(DeviceError)`, `http_status = 409`. + - `settings_change() -> ChangeKind("change settings", "as asked", "applied")`. + - `ENABLEABLE_WRITES = frozenset({0x96, 0x97, 0x7E, 0x7F, 0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72})`. + - `s4_settings(client, serial) -> UnitSettings`. It keeps every current field, plus `detail["editable"] = editable_fields(setup, 4)`. The revision comes only from a preview (dry run), never from this read. + - `s4_change_settings(client, serial, *, changes: dict, revision: Optional[str], dry_run: bool, audit, address, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`. + +**`s4_change_settings` behaviour**, through `run_change` (`even_if_already=False`): + +- **`read_state`, first call:** + - Read the run state. + - `calling_home` and `unknown*` are returned as they are. + - `monitoring` raises `UnitStateUnknown(f"{serial} is monitoring -- stop it first (a stop makes it call in if call-home is on) -- nothing sent")`. + - Read the name (raw), prefs, trigger and setup. + - `check_changes` (a `SettingsValueError` becomes `BadRequest`). + - When live, `revision([name.encode("ascii"), prefs, trigger, setup])` must equal the request's. Otherwise raise `SettingsChanged("the unit's settings changed since the preview -- preview again; nothing sent")`. + - `image = encode_setup(setup, 4, changes)`. + - Read the schedule; a read error is kept as a blocking reason. + - Return `settings_state(setup, image, setup, series=4)`. +- **Later calls:** read the setup and return `settings_state(before, image, now, series=4)`. +- **`describe_plan`:** + - `plan_setup_push(prefs, trigger, image, name).describe()`, plus `fields` = `{f: {label, old, new}}` for the changed fields, `revision`, `warnings` and `blocked`. + - `warnings` always includes: "this reads the unit's keypad edit buffer: if someone is in its menu, their unsaved edits are sent too". + - `blocked`: + - the name is `factory.MMB` (case-insensitive): "this unit is running its factory setup; load any other setup on its keypad, then try again"; + - each schedule conflict: "this unit's schedule loads at , which would replace this change"; + - a schedule read error: "could not read this unit's schedule () -- SFM will not change a unit whose schedule it cannot check"; + - `plan_setup_push` raising `ValueError` (a block size or header THOR's offsets were never seen at, or a failed checksum): "this unit's -- SFM has not seen a block like it". + - When `blocked` is non-empty, `steps` is `[]`, and a live call raises `ChangeRefused("; ".join(blocked) + " -- nothing sent")`. + - When the schedule names the active setup, `warnings` adds: "the unit's schedule loads this setup at ; the change survives it". +- **`send`:** `client.protocol.execute(plan)`, as `s4_change_call_home` does. +- **`snapshot`:** + - `fields`: `{f: {label, old, new, now}}`; + - `before` / `after` hex of the setup; + - `changed_offsets`; + - `prefs` and `trigger`: before hex only. +- **`is_refusal`**, **`is_ring`** and **`pre_send`**: as in `s4_change_call_home`. + +**Validation order:** a live call without `revision` is refused before any I/O, in Task 6's `DeviceAccess` (not here). + +- [ ] **Step 1: Write the failing tests.** Extend `FakeMicromateClient` with: + - `setup` (default: `tests/fixtures/micromate-setup/um20147_baseline.bin`'s last 2,092 bytes); + - `prefs`, `trigger` and `active_name` (default `"test2.mmb"`); + - `schedule_body` (default `bytes(524)`) and `schedule_error`; + - `execute` applies a setup-push plan's `0x71` data to `self.setup` (re-adding the CRC with `with_crc`), so a read-back sees it. + +```python +def test_s4_dry_run_previews_old_to_new_and_sends_nothing(): # fields == {"geo_trigger_ips": {"label": ..., "old": 0.5, "new": 0.3}}; revision present; fake.executed == [] +def test_s4_trigger_change_sends_the_push_and_verifies(): # subs [0xDA,0x68,0x73,0x82,0x83,0x71,0x72]; outcome sent/ok; state_after "as asked" +def test_s4_stale_revision_sends_nothing(): # SettingsChanged; fake.executed == []; audit has no rows +def test_s4_already_as_asked_is_skipped(): # outcome skipped, nothing executed +def test_s4_monitoring_is_refused(dry_run in (True, False)): # "stop it first" and "nothing sent" +def test_s4_factory_setup_is_refused_live_and_shown_in_preview(): +def test_s4_schedule_conflict_blocks(): # schedule starts "other.mmb" at 07:00 -> ChangeRefused naming other.mmb and 07:00 +def test_s4_schedule_on_the_active_setup_warns_only(): +def test_an_unreadable_schedule_refuses(): +def test_no_schedule_records_is_no_conflict(): # bytes(524) -> sent +def test_s4_a_lost_ack_records_what_the_unit_holds(): # execute_error -> outcome failed, sent True, snapshot present +def test_s4_unseen_block_size_is_blocked(): # prefs 91 B -> preview blocked; live ChangeRefused; nothing executed +def test_setup_push_subs_are_now_enableable(): +``` + +- [ ] **Step 2: Run them.** Expected: FAIL (ImportError: `s4_change_settings`). +- [ ] **Step 3: Implement** the Produces block and update `s4_settings`. In the two opcode tests, swap the over-ceiling example to `0xA8`. +- [ ] **Step 4: Run them**, plus `tests/test_micromate_execute.py`, `tests/test_micromate_opcodes.py`, `tests/test_micromate_writes.py` (THOR's setup-push frames still reproduce) and `tests/test_device_access_s4_call_home.py`. Expected: PASS. +- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(s4): change a Micromate's settings by serial, audited, schedule-checked`. + +--- + +### Task 5: The Series 3 settings change + +**Files:** +- Modify: `sfm/device_access/s3.py`, `minimateplus/client.py` (`push_config_raw` pre-check), `tests/device_access_fakes.py` +- Test: `tests/test_device_access_s3_settings.py` (new) + +**Interfaces:** +- Consumes: + - Task 1: `read_compliance_content`, `read_settings_blocks`, `is_compliance_content`. + - Task 2: the codec. + - Task 4: `settings_change`, `SettingsChanged`, `ChangeRefused`. + - `MiniMateClient.push_config_raw(event_index, compliance, trigger, waveform)`. +- Produces: + - `push_config_raw` raises `ImageRefused` (from `minimateplus.protocol`) when its pre-check refuses a block, before any frame. + - `Series3Adapter.settings(address, serial) -> UnitSettings`. It is built on `read_compliance_content` and the codec, with the same top-level fields as today, plus `detail["editable"]`. A non-settings answer raises `UnitStateUnknown(S3_SETTINGS_WHILE_MONITORING)`. + - `S3_SETTINGS_WHILE_MONITORING = "did not return its settings -- a MiniMate answers this way while monitoring; stop monitoring first"`. + - `Series3Adapter.change_settings(address, serial, *, changes, revision, dry_run, audit, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`, through `run_change` and `self._run(address, op, retry=False)`: + - `read_serial`: `client.connect().serial`. + - **`read_state`, first call:** + - Wake, then `read_settings_blocks()`. + - A non-settings `compliance` raises `UnitStateUnknown(f"{serial} {S3_SETTINGS_WHILE_MONITORING} -- nothing sent")`. + - `check_changes`, and the live revision check over `[event_index, compliance, trigger, waveform]`. + - Compute `image = encode_setup(...)` and return `settings_state(...)`. + - **Later calls:** wake, `read_compliance_content()`, then the verdict. + - **`describe_plan`:** + - `steps` in Blastware's order: 68 (event index, as read), 73, 71 (settings block, 2,092 B), 72, 82 (trigger, as read), 83, 69 (waveform data, as read), 74, 72. Each step has `sub`, `what` and `data_len`. + - `fields`, `revision` and `warnings` as Series 4. The warning: "the two bytes after the settings block go out as 00 00 (Blastware sends its own constant; effect unmeasured)". + - **`send`:** `client.push_config_raw(event_index, image, trigger, waveform)`. + - **`is_refusal`:** `isinstance(e, ImageRefused)`. + - **`snapshot`:** as Series 4, without prefs and trigger. + +- [ ] **Step 1: Write the failing tests.** Extend `FakeMiniMateClient` with: + - `settings_blocks`: the default compliance is BE9441's assembled 10-26 read 2; `event_index`, `trigger` and `waveform` are the `0x68`, `0x82` and `0x69` payloads (`[16:]`) of `WRITES[13:26]` in `tests/test_minimate_write_frames.py`, each minus its two trailing bytes (a write is the read plus two); + - `push_config_raw` records its four arguments and makes the compliance the new `read_compliance_content`; + - `monitoring_settings=True` returns a device-info-shaped block. + +```python +def test_s3_settings_read_uses_the_codec(): # editable includes geo_range; record_mode "histogram"; notes by slot with unit labels +def test_s3_dry_run_previews_and_sends_nothing(): +def test_s3_trigger_change_sends_the_units_own_blocks(): # push args: event_index/trigger/waveform == the read blocks; compliance == encode_setup(...) +def test_s3_change_verifies_by_read_back(): # outcome sent/ok, state_after "as asked", snapshot fields old/new/now +def test_s3_stale_revision_sends_nothing(): +def test_s3_monitoring_is_refused(dry_run in (True, False)): +def test_s3_a_refused_image_is_audited_as_nothing_sent(): # push_config_raw raises ImageRefused -> row sent 0, "refused before sending" +def test_push_config_raw_precheck_raises_image_refused(): # a 2,089-byte compliance block -> ImageRefused, no frame written +``` + +- [ ] **Step 2: Run them.** Expected: FAIL (AttributeError: `change_settings`). +- [ ] **Step 3: Implement** the Produces block. +- [ ] **Step 4: Run them**, plus `tests/test_s3_call_home.py`, `tests/test_minimate_write_frames.py` and `tests/test_device_access_*`. Expected: PASS, except the tests Task 6 deletes or rewrites. If one fails here only because it pins `apply_config`, leave it for Task 6 and note that in the ledger. +- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(s3): change a MiniMate's settings by serial on the shared codec`. + +--- + +### Task 6: Device access, the route, and retiring the legacy write + +**Files:** +- Modify: `sfm/device_access/access.py`, `sfm/server.py`, `minimateplus/client.py` +- Delete: `poc_set_project.py`. Remove `exp_compliance_only` (and its registration) from `experiments.py`. + - **Ruling (spec: "the legacy write is retired"):** both write a live unit through the retired encoder, which #46 found wrong. Git keeps them. +- Modify tests: + - `tests/test_s3_compliance_anchor_fields.py`: remove its write-side tests (the encoder is gone). + - `tests/test_minimate_write_frames.py`: `test_apply_config_writes_the_units_own_trigger_block` moves to Task 5's `test_s3_trigger_change_sends_the_units_own_blocks`; delete it here. + - `tests/test_server_series3_guard.py`: drop `apply_config` from `WRITES` and its fake method. + - `tests/test_server_device_access.py`: `/device/config` now 410. +- Test: `tests/test_device_access_settings.py` (new), `tests/test_server_settings_change.py` (new) + +**Interfaces:** +- Consumes: Task 4's `s4_change_settings` and Task 5's `Series3Adapter.change_settings`. +- Produces: + - `DeviceAccess.change_settings(address, serial, *, changes: dict, revision: Optional[str], dry_run: bool = False, caller: str = "api") -> ChangeResult`: + - `normalise_serial`, then `series_for_serial`; + - `changes` must be a non-empty dict, else `BadRequest`; + - a live call without `revision` raises `BadRequest("preview first: a live change needs the revision from its preview -- nothing sent")`; + - a live call with no audit log raises `NotSupported` (as `set_call_home`); + - `_dispatch(..., change=True)` with `verify_timeout_s=_SETTINGS_VERIFY_TIMEOUT_S = 2.0` and `verify_interval_s=_SETTINGS_VERIFY_INTERVAL_S = 1.0`. + - `POST /device/settings/change`: + - query: `serial` (required), `host`, `tcp_port`, `port`, `baud`, `dry_run`, `caller`; + - JSON body `{"changes": {...}, "revision": "..."}`; + - returns `_change_response(...)`; + - added to `_SERIAL_AWARE_PATHS`. + - `POST /device/config` and `POST /device/config/project` return **410** with `{"detail": "retired: change a unit's settings by serial with POST /device/settings/change (audited, previewed, read back)"}`. Remove the cache-dirty hooks that only these routes called; keep the read routes. + - Delete `MiniMateClient.apply_config`, `set_project_info` and `_encode_compliance_config`, and any import left orphaned. + +- [ ] **Step 1: Write the failing tests:** + +```python +def test_live_change_without_revision_is_refused_before_io(): # factory never called +def test_empty_changes_is_a_bad_request(): +def test_change_settings_dispatches_by_series_with_change_true(): +def test_route_dry_run_returns_fields_and_revision(): # 200, body.plan.fields, body.plan.revision +def test_route_verified_change_is_200_and_mismatch_409(): +def test_route_unconfirmed_carries_sent_and_audit_id(): +def test_route_refusal_is_409_with_reason(): # ChangeRefused / SettingsChanged / monitoring +def test_legacy_config_routes_are_gone(): # both 410, nothing reaches a client factory +def test_settings_change_is_serial_aware(): # in _SERIAL_AWARE_PATHS; a UM serial goes to the Series-4 path +``` + +- [ ] **Step 2: Run them.** Expected: FAIL (404 / AttributeError). +- [ ] **Step 3: Implement** the Produces block, the deletions, and the test updates listed under Files. +- [ ] **Step 4: Run them**, plus `tests/test_server_*.py`. Expected: PASS. Check that `grep -rn "apply_config\|set_project_info\|_encode_compliance_config" --include=*.py .` finds only comments and history. +- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(sfm): POST /device/settings/change; retire the legacy config write`. + +--- + +### Task 7: The page — edit, preview, send, "the unit now holds" + +**Files:** +- Modify: `sfm/static/device_routing.js`, `sfm/static/sfm_webapp.js`, `sfm/sfm_webapp.html` +- Modify: `CLAUDE.md` (the "Where things stand" Series-4 parity line: phase 5 built, bench pending), and the spec's status line ("Built 2026-11-xx; bench pending"). +- Test: `tests/test_webapp_device_routing.py` (extend `EXPORTS` and cases), `tests/test_webapp_static.py` + +**Interfaces:** +- Consumes: `UnitSettings.detail.editable` / `.revision`, and the `ChangeResult` shapes from Tasks 4–6. +- Produces (DOM-free, in `device_routing.js`): + - `DEVICE_ROUTES.settings_change = ['POST', '/device/settings/change', true]`; remove `config_write`. + - `controlsFor(unit)`: `configWrite: serialMode && (series === 3 || series === 4)`; `reasons.configWrite: 'By serial only: Preview, then Send (audited).'` + - `settingsFormFields(st) -> Array<{field, label, kind, value, unit?, min?, max?, choices?, maxlength?, readonly?}>`: from `st.detail.editable`, in that order. + - `settingsChanges(fields, edited) -> object`: only fields whose edited value differs. Numbers compare as numbers; read-only fields are ignored. + - `settingsPreviewRows(body) -> Array<[label, old, new]>`, from `body.plan.fields`. + - `settingsBlockedText(body) -> string`: `body.plan.blocked` joined; `''` if none. + - `settingsResultRows(body) -> Array<[label, old, new, now]>`, from `body.detail.snapshot.fields`. +- **Page behaviour** (`sfm_webapp.js` glue; HTML ids `cfg-edit`, `cfg-preview-btn`, `cfg-send-btn`, `cfg-preview`, `cfg-result`): + - The serial-mode Config pane heading reads **"On the unit — read "**. + - The form is built from `settingsFormFields`. + - **Preview** POSTs a dry run and shows old → new, warnings and blocked reasons. It keeps `revision` and enables **Send** only when nothing is blocked and something changes. + - **Send** asks `confirm()` naming the serial and the fields, then POSTs live with the kept revision and shows "the unit now holds" rows. Errors go through `changeErrorText`. + - Editing any field after a preview disables **Send** until the next preview. + - The by-host legacy form loses its write button. Its read stays. + - No inline script; listeners via `addEventListener`. + +- [ ] **Step 1: Write the failing Node-run cases** in `tests/test_webapp_device_routing.py`: + - `controlsFor` gives `configWrite` true by serial for both series, and false by host; + - `settingsChanges` returns only differing fields and compares `0.30` with `0.3` as equal; + - `settingsPreviewRows` / `settingsResultRows` / `settingsBlockedText` on bodies shaped as Task 6 returns them; + - `deviceUrl('settings_change', unit)` → `/device/settings/change?serial=…`; + - `config_write` is no longer a route. + + In `tests/test_webapp_static.py`, assert the page has no inline `