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