diff --git a/docs/micromate_protocol_reference.md b/docs/micromate_protocol_reference.md index bd62c55..535f452 100644 --- a/docs/micromate_protocol_reference.md +++ b/docs/micromate_protocol_reference.md @@ -2308,7 +2308,110 @@ events (already solved — `0x08`/`0x1E`/`0x0A`/`0x5A`), keep our own high-water mark, and *optionally* erase. **The erase opcodes are the only genuinely missing piece**, and they remain on the unsafe list. -### 🔑🔑 SOLVED 2026-10-14 — call-home is an IN-BAND WAKE SIGNAL, not a dial-out +### 🔑🔑 CAPTURED 2026-10-14 — a complete, working ACH session + +MITM between UM12947's modem and THOR 1.5.0.29. **101 request frames, 101 +responses, 0 bad checksums, 34,872 B of event data in 65 seconds.** +`bridges/captures/mitm-october/ach_mitm_20261014_182612/` + +🔑 **Every command in a real ACH session is one we already implement — except +one.** + +| SUB | name | count | +|---|---|---| +| `0x5B` | POLL | 36 | +| `0x5A` | BULK_DOWNLOAD | 27 | +| `0x49` | STATE | 10 | +| `0x0C` | EVENT_RECORD | 8 | +| `0x1F` | EVENT_NEXT | 7 | +| `0x06` | STORAGE_RANGE | 4 | +| `0x1C` | MONITOR_STATUS | 3 | +| `0x93` | ARM_EVENT | 3 | +| `0x15` | SERIAL | 1 | +| `0x1E` | EVENT_FIRST | 1 | +| **`0xA2`** | **see below** | **1** | + +Session shape — note THOR polls between *every* command: + +``` +POLL POLL SERIAL POLL STORAGE_RANGE POLL MONITOR_STATUS POLL STATE POLL +ARM_EVENT EVENT_FIRST POLL EVENT_RECORD POLL STATE POLL + [ EVENT_NEXT POLL EVENT_RECORD POLL STATE POLL BULK_DOWNLOAD... ] x n +POLL STORAGE_RANGE POLL STATE POLL 0xA2 +``` + +#### ⚠⚠ `SUB 0xA2` ends a call-home — and COLLIDES with Series III's ERASE + +The session's final command is `0xA2` at `offset = 0xFFFF`, answered `0x5D`. +THOR's log at that instant: + +``` +TX: SENT REQUEST: StartMonitoringAfterCallhome +WARN Switching unit back to monitoring; IP: 63.45.161.30 +SESSION COMPLETED SECCESSFULLY +``` + +So on Series IV, **`0xA2` = exit call-home and resume monitoring.** + +⚠⚠ **On Series III, `0xA2` → `0x5D` is CONFIRM ERASE** — the last step of +`0xA3 → 0x1C → 0x06 → 0xA2`, after which the unit's memory is cleared. +**Same opcode, same response SUB, opposite consequence.** + +That is the most dangerous collision found in this protocol. Any code path shared +between the two families — and `minimateplus` and `micromate` already share a +transport — must dispatch on series *before* `0xA2` goes near a wire. Sending it +to a MiniMate Plus to "end a session" erases it. + +It also corroborates the firmware string found by static analysis in September: +`CMD_EXIT_CALL_HOME_DELETE_EVENTS_START_MONITORING`. + +#### ⚠ Correction: `0x06` content[4:8] is NOT a constant + +Recorded on 2026-10-01 as "**9** on both units regardless of count — a constant, +not a count". It reads **47** here, four times in one session, where THOR's log +twelve minutes earlier reported **`Monitor Log count: 45`** on the same unit. + +It is almost certainly the **monitor-log record count**. Both units reading 9 +earlier simply meant both held 9 monitor-log records. ⚠ Two samples and a +near-miss (47 vs 45, twelve minutes and an active monitoring session apart), so +treat as a strong candidate rather than settled. + +`content[0:4]` remains the event count — **8** here, consistent. + +#### ⚠ Correction: `SUB 0x49` has a third state value + +Recorded as `0x00` idle / `0x02` monitoring. Throughout this ACH session it reads +**`0x03`**, ten times out of ten — so there is a distinct *in-call-home* state. + +**This is exactly why the rule is "test for non-zero".** A client checking +`== 0x02` would report a unit mid-call-home as idle. + +#### ⚠ THOR rewrites a unit's stored IP from the call-home source + +After this session THOR showed UM12947's connection details as +`TCP: 127.0.0.1 - Port: 9034` — the address the MITM connected *from*. THOR +learns a unit's address from its inbound call, which makes sense for units on +dynamic IPs and means **a relay silently poisons THOR's record of where that unit +lives.** + +### 🔑 Both ACH paths are real — and which one runs depends on timing + +> #### ⚠ Softened 2026-10-14 — "mm_ach_server is built on the wrong model" +> +> An earlier entry concluded the inbound-listener model was wrong because +> `ListenerAchTcp` had never accepted a connection. It has now: +> +> | condition | path taken | +> |---|---| +> | THOR already holds a connection to the unit | `ListenerAchRadioRing` — the ring rides that connection | +> | nothing is connected | the modem **dials out**, `ListenerAchTcp` accepts | +> +> Both are real. The listener model is valid; it simply **loses whenever +> something already holds the modem's single session slot.** That also explains +> every failed probe and relay attempt of 2026-10-14: they were not bugs, they +> were contention with THOR's `UnitWatchDogTimer`, which reconnects continuously. + +### 🔑 Call-home can also be an IN-BAND WAKE SIGNAL, not a dial-out From THOR's own ACH log (1.5.0.29, 4,414 lines, UM12947 over an RX55). **This overturns the model this document has carried since the beginning**, and it