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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
- 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
23 more snapshots of UM20147, keypad-driven.
MEASURED: loading a .MMB replaces the active config byte-for-byte -- three
loads, each moving exactly the fields that differ, the loaded block identical
to the file's saved state, no load marker. The setup name's spelling
(.MMB/.mmb) depends on whether it was saved or loaded.
MEASURED: job number [40:42], report flags [39] (0x02 job no., 0x08 scaled
distance; 0x01 unknown); distance [30:34] in metres and charge weight
[34:38] in kg, converted bit-exactly with ft / 3.2808 and lb / 2.21 -- the
firmware's own constants, not the textbook ones. Scaled distance is not
stored. Location confirmed at [144].
MEASURED: 0x08 is the preferences block (display units at content[31]),
not an event index; switching units moves nothing in 0x1A. 0x1A, 0x08 and
0x2E share one checksum rule (N = content[0:2]; CRC over [0:N-2] at
[N:N+2]); 0x2C has none. 0x2C session timeout is at [118:120], encoding
unknown; modem baud is in none of the six blocks.
CORRECTED IN PLACE: the 9-24 notes-label offset (0x8A -> 0x7A) and
channel-block start (0x06BC -> 0x06AC), both 16-byte slips.
RULE: never write modem baud or modem type remotely -- the remote link is
the modem port.
No codec, store or DB change; no backfill.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
47 snapshots of UM20147 while settings were changed on its own keypad, one
at a time. Every byte that moved is accounted for; nothing outside 0x1A
moved.
MEASURED (operator named setting + values): record mode [5] (01 Waveform,
02 Manual, 03 Histogram, 04 Combo -- S3's encoding, one byte later than the
S3 analogy put it), sample rate [6:8], histogram interval [8:10] s,
pre-trigger [12:16] f32 negative s (all four values), stop mode [17], record
time [18:22] f32, auto-stop [23], active-sensor and trigger-source bitmasks
[25]/[29], trigger level at channel +30 (geo in/s, mic psi).
MEASURED: the trailer is CRC-16/AUG-CCITT over content[0:2088] -- 47/47 and
a second unit. Thor's write omits it, so it is read-side integrity, not a
write obligation.
MEASURED: blocks 1-3 are geophones, block 4 is the ACTIVE mic (a byte copy
of 5 or 6), 5 and 6 are the stored linear / SLM mic setups. No separate
mic-type byte; block 4's +4:8 code is the type. Promotes the 10-15 "+4
channel type" guess; retracts "+46:48 is a trigger-source flag" in place.
MEASURED: 0x1A reads the keypad's edit buffer live; discard reverts;
commit timing differs by widget (list / spinner / sub-window).
INFERRED, Series III: the 6-byte "stable anchor" sits exactly where Series
IV keeps pre-trigger (-0.25 s) + stop mode (Fixed). An S3 unit in Auto
stop mode would lose it and decode no mode/rate/interval/record time. Not
measured on S3; noted in instantel_protocol_reference.md, code untouched.
No codec, store or DB change; no backfill.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
and two are guesses
Six 48-byte channel blocks at content[1708], stride exactly 48: Tran, Vert,
Long, Mic, LMic, SMic. (Mic is 3 chars, so a 4+-printable scan misses it and
the stride looks like 96 across that gap.)
RECORDED IN THREE EXPLICIT GRADES, because I wrote them in one voice first and
that is the failure mode this reference already carries retractions for -- the
0x0C float from a single sample, the cost model fitted to sub-1 KB responses,
offset detector v1. All three were an interpretation presented with the
confidence of a measurement.
MEASURED, and the one worth having: channel+24 is a float32 BE reading
3.1030800342559814 on all three geo channels. Divided by 10,000 that is
0.00031030800342559815 -- the documented _GEO_LSB_IPS to 1.1e-8. It implies
10.0/3.10308 = 3.222605 V full scale, which at 10,000 counts/V gives 32226.05
counts, the documented figure exactly.
That is an INDEPENDENT confirmation of a number that until now rested purely on
statistical inference: _GEO_LSB_IPS was pinned by intersecting 991,415 rounding
constraints from Thor's own CSV exports. The unit reports it directly. Two
unrelated derivations agreeing to eight digits. It is also almost exactly half
Series III's 6.206053 (ratio 1.99997, the residual being S3's rounded display
value).
Also measured: the units strings ("in."/"/s.", "psi"/"(L)", "dB"/"(A)") are
literal ASCII, and Tran/Vert/Long are byte-identical EXCEPT +47, which reads
0x01 on Tran and Vert and 0x00 on Long.
INFERRED (one setup, one unit): that +24 is the calibration constant rather than
another field holding the same number -- the arithmetic proves the number, not
the field's purpose; and that +47 is an enable or trigger-source flag.
GUESSED, explicitly flagged not to build on: +4 as a uint32 "channel type", from
six correlated observations in a single setup; and +8:24 as eight uint16 BE
values, where the split itself is an assumption.
TOOLING FIX in the same commit, from a real miss: the volatile baseline ran four
reads over eight seconds, so it never crossed a minute boundary and never saw
the minutes byte. Five "changes" then came in a row that were just the clock.
Hours and the date would have slipped through identically. An empirical noise
floor only catches what moves WHILE sampling, so 0x1C's known clock span
(content[2:10]) is now seeded regardless, and the report says which bytes were
observed versus seeded. Memory-free is deliberately left unmasked -- it moves
only when the unit records, which is worth being told about.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
The Series III config map was built by changing one setting and seeing which
bytes moved. Whether that method transfers to Series IV depended on an
unmeasured question: how much of a config block moves ON ITS OWN. If a block
carries a clock or a counter, every diff arrives polluted and there is no way to
tell the real answer from the noise in a single pair.
MEASURED ON UM20147 (11.0BD), FOUR READS BACK TO BACK, NOTHING TOUCHED:
0x1A compliance 2103 B 0 bytes moved
0x2C call home 137 B 0
0x2E trigger 39 B 0
0x08 event index 101 B 0
0x01 device info 163 B 0
0x1C monitor status 59 B 2 (and those two are explained below)
Every config block held every byte still, so the method transfers directly and
needs no noise floor subtracted. That was the open question.
scratch/mm_config_diff.py drives it: `volatile` establishes the floor, `snap`
saves a labelled read of all five blocks, `diff` reports changed runs with each
plausible field interpretation (u8/u16be/u32be/f32be) and reports any volatile
bytes separately rather than silently hiding them.
CORRECTION TO content[6] OF 0x1C, long recorded only as "NOT the hour": it is a
sub-second tick, ~4020 counts/second in steps of exactly 4, wrapping at 256 --
about a 64 ms period, consistent with the low 6 bits of a millisecond counter.
Consequence worth knowing: a 0x1C block is never byte-identical to itself, so
any "has the status block changed?" check answers yes ~15 times a second.
Compare named fields, never whole blocks.
I nearly recorded that byte wrong, and the trap is cheap enough to document:
sampled once per second it reads as a smooth monotonic counter at ~16/s with a
16-second wrap. Twelve consecutive samples supported it. It is aliasing -- a
64 ms counter read once a second is noise that happens to look tidy. Measure a
counter back to back before trusting any rate from spaced samples.
Also: the settings do not have to be changed from THOR. The unit's own keypad
works, which needs no Windows VM and does not contend for the modem's single
TCP session.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
Manual 11.4.4: a Micromate can call home WHILE IT CONTINUES TO MONITOR, or pause
monitoring and send. UM12947 is on the former, which is why the captured session
logged "CANNOT DOWNLOAD MONITOR LOG" and "CANNOT DELETE ALL EVENTS -- The unit is
monitoring".
THOR REPORTS THAT SESSION AS "SESSION COMPLETED SECCESSFULLY" ANYWAY. The
refusals are INFO lines. From outside, a unit quietly accumulating looks
identical to one being managed correctly.
Correcting my own framing from earlier today: I flagged "Delete Events and Logs
from Unit = Yes" as a risk to the test data. It is TMI's normal and necessary
fleet setting -- without it a unit fills up and re-offers every event on every
call. A unit left on monitor-while-calling-home is the misconfigured one, and
drifts toward a full buffer by itself.
DESIGN CONSEQUENCE FOR SFM: a receiver cannot rely on erase to manage storage.
The erase can fail for a reason the unit considers normal, so the server-side
high-water mark is LOAD-BEARING rather than an optimisation -- it is the only
thing preventing a full re-download every session. Series III's ach_state.json
(downloaded_keys / max_downloaded_key) is the pattern and has to carry over
deliberately.
Also a detectable fleet-health signal: "memory filling AND deletes refused" is
visible on every call from 0x06's event count and 0x1C's memory fields. Worth
surfacing precisely because THOR calls it success.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
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.
EVERY COMMAND IN A REAL ACH SESSION IS ONE WE ALREADY IMPLEMENT -- POLL, SERIAL,
STORAGE_RANGE, MONITOR_STATUS, STATE, ARM_EVENT, EVENT_FIRST/NEXT, EVENT_RECORD,
BULK_DOWNLOAD -- except one.
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, and THOR's log at that
instant reads "StartMonitoringAfterCallhome / Switching unit back to monitoring".
So on series IV it means 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. This is the most dangerous collision found
in this protocol: minimateplus and micromate already share a transport, and
sending 0xA2 to a MiniMate Plus to "end a session" erases it. Any shared path
must dispatch on series before that byte goes near a wire.
It also corroborates the firmware string found by static analysis in September,
CMD_EXIT_CALL_HOME_DELETE_EVENTS_START_MONITORING.
TWO CORRECTIONS TO EARLIER ENTRIES OF MINE:
- 0x06 content[4:8] was recorded on 2026-10-01 as "9 on both units regardless of
count -- a constant, not a count". It reads 47 here, where THOR's log twelve
minutes earlier reported "Monitor Log count: 45" on the same unit. It is
almost certainly the monitor-log count; both units reading 9 just meant both
held 9 records.
- SUB 0x49 was recorded as 0x00 idle / 0x02 monitoring. It reads 0x03 throughout
this session, ten for ten -- a distinct in-call-home state. Precisely why the
rule is "test for non-zero": a client checking == 0x02 would call a unit
mid-call-home idle.
Also softened the claim that mm_ach_server is "built on the wrong model".
ListenerAchTcp HAS now accepted a connection -- when nothing else holds the
modem's single session, the unit dials out and the listener takes it; when THOR
already holds a connection, the ring rides that instead. Both paths are real.
The listener model is valid, it just loses the race against anything already
connected -- which explains every failed probe and relay attempt today as
contention rather than bugs.
And noted: THOR rewrites a unit's stored IP from the call-home source address, so
a relay silently poisons THOR's record of where that unit lives.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
From THOR's own ACH log, 4,414 lines, UM12947 over an RX55. This overturns the
model this document has carried from the start and explains every confusing
result of the past weeks.
A MICROMATE DOES NOT DIAL ANYBODY. It emits the ASCII string "RADIO RING" over
its serial port, and that text travels up a TCP connection THE SERVER ALREADY HAS
OPEN TO THE UNIT. The server recognises it and runs a session on that same
connection.
17:18:17 TcpClientSystemNet #1: RADIO RING IS RECEIVED FROM IP:63.45.161.30 Port:9034
17:18:17 ListenerAchRadioRing #2 RADIO RING IS DETECTED
17:18:17 ConnectorWorkerThread Process Request: ReadSerialNumber
17:18:18 ListenerAchRadioRing #3 RADIO RING UNIT SERIAL NUMBER = UM12947
17:18:18 ACHManager #8 RADIO RING STARTED A NEW SESSION
TcpClientSystemNet is THOR's outbound TCP CLIENT -- the ring arrives on the
connection THOR itself opened to unit:9034, the ordinary call-UP path. No
inbound connection, no dial, nothing to accept. THOR keeps that connection alive
on purpose: UnitWatchDogTimer reconnects continuously, 1,039 log lines in 37
minutes.
THOR's OTHER ACH path was never used. ListenerAchTcp logs "Waiting for a ACH
connection on Port 12346" and in 4,414 lines NEVER ACCEPTED ONE. All twelve ACH
events came through ListenerAchRadioRing.
CONSEQUENCE: bridges/mm_ach_server.py is built on the wrong model for this
deployment. It listens for an inbound connection -- ListenerAchTcp's model, the
one THOR never exercises here. The right shape is a POLLER that holds an
outbound connection to each unit, watches the stream for RADIO RING, identifies
the unit, and runs a session on the same socket.
That also dissolves the single-session contention that dogged every experiment
today: the receiver must hold the modem's one session slot PERMANENTLY. Our
probes and MITM attempts were not fighting a bug, they were fighting the design.
Also captured: the full ACH state machine (15 steps), the eight request types
with counts, and two corroborations -- StartMonitoringAfterCallhome matches the
firmware string found by static analysis in September, and ReadEventRecordCount
returning "Event count: 19" independently supports the SUB 0x06 event-count
finding.
Flagged, unexplained: events are addressed as 90000001 (length 4076) in THOR's
ACH path, where our chain walk returns 055d4a81 for an event of exactly that
length. Same event, different address space.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
First capture of THOR's half of a Micromate call-home, taken with ach_mitm.py
between UM12947's modem and a THOR 1.5.0.29 ACH server on port 8070.
THOR sends POLL (SUB 0x5B, offset 0x0030) and NOTHING ELSE -- four times over
~21 s, then gives up. No greeting, no answer to the RADIO RING, no CONNECT.
And that POLL is BYTE-IDENTICAL to what micromate.protocol builds:
build_request(SUB_POLL, 0x0030) reproduces all four frames exactly.
So the ACH session is PULL, and bridges/mm_ach_server.py already implements it
correctly. The "inbound call-home session" -- carried for weeks as the last
protocol unknown -- was never a separate protocol at all. It is the ordinary
command set on an inbound socket, exactly as series III's 72 captured sessions
suggested it would be.
THE OPEN PROBLEM IS NOW CLEARLY ELSEWHERE. In the same capture the unit sent
only "RADIO RING", four times, and never a protocol frame. THOR polled four
times and got nothing -- identically to our own server in three attempts the
same afternoon. THE VENDOR'S OWN SOFTWARE FAILS THE SAME WAY WE DO, which
eliminates the receiver as a suspect and places the fault between modem and
unit.
Established: cellular healthy (151 ms connect, outbound dial works), bytes do
reach us from the unit's side, modem serial config matches spec (115200 8N1, no
flow control, PAD/TCP), cable is FTDI and cold-booted with it attached. Not
established: whether the unit or the modem emits "RADIO RING" -- it is the
literal string in this unit's own 0x2C dial-string field, and the cheap
disambiguation is to disconnect the unit and see if it still appears.
Next step is a config diff against a working deployed unit's modem, not more
protocol work.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
The download line computed `size // 1024` -- THOR's chunk size -- while the
download used the 16 KB default. So a 72,560 B event that took 5 requests was
printed as "71 chunks", and I nearly read a working 16 KB download as a broken
1 KB one. A diagnostic that misreports what it did is worse than one that says
nothing.
Now prints the real count and the size used: "5 req @ 16384 B".
Verified by counting the frames in a capture of that run: 5 x SUB 0x5A at
offsets 0x4000 0x4000 0x4000 0x4000 0x1b70, summing to exactly 72,560. That is
also the FIRST time the 16 KB chunk size has run through the real download loop
on hardware -- previously only the probe had issued 16 KB single requests, and
the loop itself had only been exercised at 1024 B against THOR's frames and at
16 KB against simulated responses.
Also recorded: USB identification for the Micromate's own ports. Its PC port is
2504:0300 (Instantel Inc. MICROMATE COM PORT), appearing as CDC-ACM, against
0403 FTDI and 067b Prolific for the USB-A host-port cables. Address it by
/dev/serial/by-id/ and not /dev/ttyACM<n>, because the number moves whenever
another CDC-ACM device appears -- which has already cost a session aimed at a
TMI-Seismo MCU by mistake.
And: passing one through to a Proxmox guest hot-plugs with no VM restart via
`qm set <vmid> -usb0 host=2504:0300`. UM20147 is now on tmi-dev (10.0.0.44)
this way, which means the unit can be driven from the dev VM directly instead of
relaying commands.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
Correcting an implication I made. The 72 ach_inbound_* sessions in
bridges/captures/ are MiniMate Plus, and I framed the Series III ACH setup as
though it transfers to a Micromate. It is not known to.
What we actually have for Series IV is prior, not observation:
- THOR manual 6.2 and the firmware's own strings
(CMD_EXIT_CALL_HOME_DELETE_EVENTS_START_MONITORING, "Call Home Deleting
Events") say the unit dials in and waits to be told what to do -- server-driven,
the same shape as Series III's pull model.
- UM12947's 0x2C dial string reads literally "RADIO RING", which is modem ANSWER
vocabulary rather than a destination. With the RV50 debug string
ATQ1 ATE0 ATS0=2 ... RADIO RING -- ATS0=2 being auto-answer-after-2-rings --
that reads as the unit arranging to ACCEPT calls, i.e. the call-UP path. Which
argues the ACH destination lives in the modem, as it does for series III.
If both priors hold, mm_ach_server.py is just MicromateClient on an inbound
socket and the unknown evaporates. But there is a specific failure mode worth
naming in advance:
THE MICROMATE DEMONSTRABLY TALKS AT TO ITS MODEM. If it drives an AT dial for
call-home, that exchange happens on the SERIAL LINK and a TCP listener sees none
of it. So the first experiment has an AMBIGUOUS NULL -- no connection could mean
the trigger did not fire, or that the interesting part is invisible from the
network. The escalation is a serial-level capture between unit and modem, not
more fiddling with the server.
Recorded in both the protocol reference and the server's own docstring, so
whoever runs the experiment reads the caveat before being puzzled by a silence.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
I had it as "~0.65 s per round trip, independent of payload size", and based
design advice on it ("minimise round trips, not bytes"). The first claim is
wrong and the second is too strong.
Every measurement behind it had a SMALL payload -- 59 B status, 266 B setup
records, 1024 B download chunks. With the byte term small and similar across all
of them, per-command cost looked constant. It was a narrow-range fit
extrapolated past its evidence.
Measured against a 14,176 B single response on UM12947 over an RX55:
1,024 B 0.67 s 8,192 B 3.59 s
2,048 B 1.22 s 14,176 B 6.25 s
4,096 B 2.13 s
t ~ 0.21 s + bytes / 2,350 -- fits within +/-11% over a 14x size range
The old 0.65 s figure was right FOR A 1 KB RESPONSE and is that model evaluated
at 1 KB. Round trips still cost (0.21 s each; 24 of them for a setup walk is
still 16 s), but bytes cost more than round trips on anything over ~500 B, and
that reverses the advice: for STATUS work minimise commands, for DOWNLOADS the
floor is throughput and batching does not beat it.
So the 16 KB chunk size is a ~30% win, not 14x. UM20147's 72,560-byte event is
~46 s at THOR's 1024 B and ~32 s at 16,384 B, because ~31 s of it is bytes on the
wire. Still worth keeping -- 30% faster, and 14x fewer requests is 14x fewer
chances for a link to drop mid-download -- but the earlier "~3.2 s" projection
was wrong and is withdrawn.
Corrected in all four places it had propagated: the protocol reference, the
CHUNK_SIZE comment, the probe's verdict, and mm_client_check's banner. The probe
now also prints a net time per measurement, since its raw timings include the
idle gap while the control reads to frame completion -- comparing them directly
was misleading.
Also confirmed in the same run: 16 KB-class responses survive a cellular PAD.
1,024 / 2,048 / 4,096 / 8,192 / 14,176 B all arrived in one frame, byte-identical,
over an RX55. 14,176 B is UM12947's largest event so the ceiling itself was not
reached, but a 14 KB response crossing the PAD intact is what needed proving.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
The chunk-size ceiling, measured on UM20147 with every size checked
byte-for-byte against a known-good download:
1024 / 2048 / 4096 / 8192 / 16384 -> served in full
32768 / 65535 -> SILENTLY CLAMPED to 16384
The clamp is the important part: a 32,768 B request returns 16,384 B of perfectly
good data and no error. Nothing in the response says it was truncated; the
length is the only signal.
THAT DICTATES HOW THE LOOP MUST BE WRITTEN. read_event_file() now tracks its
offset by BYTES RECEIVED rather than striding by chunk index. A fixed stride
would either fail on a clamp or skip the bytes it never collected; tracking what
actually arrived makes a clamp cost one extra request, and makes the loop
self-correcting against any short response -- precisely the failure mode that has
bitten the Series III side repeatedly.
Consequence of that change, recorded because it reverses an earlier decision: a
short chunk is NO LONGER AN ERROR. It used to raise, on the principle that a
silently short event is this codebase's recurring bug. But the device returns
short legitimately, and the real protection is the offset arithmetic plus the
final total-length check -- which still raises on a genuinely truncated event.
The test was rewritten rather than deleted, and says why.
CHUNK_SIZE = 16384. For UM20147's events: 4,796 B goes 5 requests -> 1,
30,230 B goes 30 -> 2, and 72,560 B goes 71 -> 5. Over cellular at ~0.65 s per
round trip that is ~46 s -> ~3.2 s on the large one.
Measured on one unit over USB, so THOR_CHUNK_SIZE = 1024 stays available and the
replay tests pin it -- reproducing THOR's exact traffic is one argument away, and
client.download_event()/get_event() take chunk_size for a link where large
responses are not surviving.
Full suite: 472 passed, 16 pre-existing failures unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
Measured directly on UM20147. offset 0x1014 (4,116) returned one frame of 4,127
B data = 4,116 B of file; offset 0x111c (4,380) returned 4,391 B = 4,380 B. So
`offset` is simply a BYTE COUNT, the device returns exactly offset + 11 bytes in
one frame, and page_key is offset // 256. `0x1000` is not a bulk-stream marker;
it is part of the number. One model now covers every 0x5A request ever observed,
THOR's and ours.
The 2026-09-23 note that offset_word = 0x1000 + 2*pages returned an entire 11 KB
event is therefore wrong -- 0x102C is 4,140, and 4,140 bytes is what it would
have returned. Most likely the 11,049 figure was the whole capture rather than
one frame's payload. Those captures never landed in the repo so the error cannot
be traced further, and does not need to be: the live measurement is unambiguous.
The probe tried BOTH escapings of offset_hi, which is why this negative counts --
a malformed frame would have produced the same silence. The escaped form
answered, so the uniform escape set holds for 0x10 in offset_hi too, and the
Series III exception does not carry over.
AND THE NEGATIVE TURNED UP SOMETHING BETTER. In establishing that offset is a
byte count, the unit served 4,380 bytes in a SINGLE frame. 1024 is THOR's
choice, not the device's limit. Since a round trip costs ~0.65 s over cellular
regardless of payload, and a 72,560-byte event is 71 requests ~ 46 s at THOR's
chunk size, the ceiling is worth knowing precisely: the offset field is a uint16,
so 65,535 B per request would make that same event 2 requests, ~1.3 s.
mm_stream_probe.py repurposed to walk ascending request sizes, checking each
against a known-good chunk-loop download so a pass means byte-identical output
rather than a plausible length.
micromate/protocol.py still uses 1024 -- THOR's value, the one with captures
behind it. Raising it is a one-constant change once the ceiling is MEASURED, and
it should not be raised on inference.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
UM20147's event 055d4a83 downloaded at exactly its promised size over USB,
exercising the carry into params[1] on chunks 64-70. The uint32 reading was
inference for one commit; it is now evidence, and the 64 KB cap that would have
made this event unfetchable is closed.
Worth noting what the same run prices: 71 chunks x ~0.65 s is roughly 46 SECONDS
for one 72 KB histogram over cellular, against 0.2 s over USB. That is the
round-trip cost model doing real work -- the bytes are nothing, the commands are
everything. A unit holding several events this size is a multi-minute call, so
the untested single-request offset_hi = 0x10 streaming mode (which would collapse
a download to one round trip) moves up the list.
Docstrings and the protocol reference downgraded from "inference" to "confirmed"
only where the hardware actually settled it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL