057df47460acd3cae921b6aed0df7e557577ae56
165
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e9d352ad99 |
docs: the decode checker's first full run; correct the #53 note
First full run over DL2's 70,042 report-paired events (22 min, --jobs 4): every expectation the spec set holds. Setup and notes match everywhere; geophone samples are exact on 6,491/6,524 waveforms across 2016-2026, the other 33 being the 1.250 in/s range read 8x on SFM's Normal assumption; every histogram is typed as a waveform without its filename (#41); the three #53 files are the only waveform time mismatches. New findings: histogram PVS, mic psi, mic dB on ~1,000 events, ~37 sub-minute histograms, 26 histogram start dates. The #53 note is corrected in place: those files decode as waveforms with Blastware's full sample count; only their time falls back to the footer start. scratch/verify_bw_fields_against_xml.py is retired -- the checker replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 |
||
|
|
6bdd140c29 |
docs(plan): the Series 3 decode checker, task by task -- and T438HGTZ is not truncated
Eight tasks: the XML report parser, SFM's side from the bytes alone, the field-by-field comparison, carve-outs (saturation first), the parallel runner, the summary and grouped detail report, run-to-run changes with a one-event view, and the first full run checked against what is known. While pinning the plan's test values on real files: T438HGTZ.B30W, called "3 samples short" by the setup-field harness, matches Blastware exactly. Its Tran, Vert and MicL end 3 samples before Long, and Blastware's own sample table does the same -- its last three rows carry only the Long cell. The harness compared Tran's length with the table's row count. The spec now says so, and the plan compares samples row by row by running channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 |
||
|
|
af703808db |
docs(spec): the Series 3 decode checker -- SFM's file-only decode against Blastware's XML reports
The first of four pieces toward SFM producing everything Blastware reports from the event file alone: compare every field, sample and histogram interval with DL2's 70,042 _XML.XML reports (2016-2026), report what matches, what doesn't and what SFM can't produce yet, grouped for diagnosis, run after run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 |
||
|
|
7100d8344a |
docs(reference): point §7.8.9's open items at the Series-III audit, #53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MUHR251NLznsFvPSrfegqL |
||
|
|
f91949be89 |
fix(decode): a Series-3 waveform's time comes from the instrument's embedded event record
Brian's requirements: the instrument's data is the only time source; a filename is a cross-check, never a fallback (an event SFM receives itself has none). The record (found by reading a seismo_lab Inspector dump; Series-III reference §7.8.9): 00 28 05 00 ?? ?? | fe 80 | trigger | stop, times dd mm yyyy(BE) 00 hh mm ss. Measured on 7,935 waveforms (DL2 + prod store): exactly one candidate validates in every file; trigger = Blastware's report 1,320/1,320, = filename 7,935/7,935, = the unit's 0C record 10/10. Provenance (requirement 6, measured): in Blastware's download of 8 BE9441 events the record -- with 24 B before and 22 after -- occurs exactly once in the unit's own A5 reply payloads; SFM-only downloads (no Blastware) carry it too. It is instrument data, not Blastware's. - _embedded_event_record(): every fe 80 before the footer is a candidate; it counts only with the lead bytes, two well-formed times (zero byte zero), footer ts1 <= trigger <= stop, stop = footer ts2 or a second before, and a length matching the record time. Exactly one must count; none or several is a decode problem, never a guess. - Without one: the footer estimate, timestamp_source 'estimate', a decode_problems entry, a WARNING. No filename fallback. - A filename that disagrees is logged; the decoded time is kept. A paired report fills in only without a validated record (apply_report_to_event, the sidecar dict overlay, event_to_sidecar_dict) and is logged when it disagrees. - decode_blastware_bytes(raw, name=None): no file or name needed; save_imported_bw uses it (no temp file). Event gains timestamp_source and decode_problems; the sidecar records both. - Histograms unchanged (#51): their record (fe f5) is noted, not used. Tests: raw bytes with no name (ZI0, 7 BE12844 oracles), a disagreeing name, each validation rule alone, two valid candidates, no filename fallback, report precedence, sidecar. 7 mutants, each caught. Real data, decoded with no name: 7,961/7,961 waveforms on the record, 0 disagreements with filename or report; 10,433/10,433 prod histograms unchanged. Suite: only the 16 known failures. Open (reported, not changed): 3 DL2 files named as waveforms whose body the waveform codec does not recognise keep the footer start, 4 s off, as on dev. None in prod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MUHR251NLznsFvPSrfegqL |
||
|
|
a74d3c9b00 |
docs(series4): loading a setup is an exact replacement -- plus the prefs block, a checksum rule, and the firmware's own unit constants
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 |
||
|
|
56b8aac4cb |
docs(series4): the 0x1A field map from a keypad pass -- a CRC, an edit buffer, and three mic blocks that are not channels
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 |
||
|
|
66171ffe36 |
docs(series4): the 0x1A channel blocks -- graded, because one of these is strong
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
|
||
|
|
711277131a |
feat(micromate): a config diff harness -- and the blocks turn out to be bit-stable
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 |
||
|
|
7645c91ae2 |
docs(series4): monitor-while-calling-home blocks erase, and THOR calls it success
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 |
||
|
|
08d2d31a09 |
docs(series4): a complete ACH session captured -- and 0xA2 is a loaded gun
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 |
||
|
|
90ac7ff76a |
docs(series4): SOLVED -- call-home is an in-band wake signal, not a dial-out
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 |
||
|
|
52d18b0d5d |
docs(series4): OBSERVED -- THOR's ACH side is POLL, byte-identical to ours
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 |
||
|
|
67de2c18da |
fix(tooling): mm_client_check reported THOR's request count, not its own
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 |
||
|
|
bdf4909d2a |
docs(series4): no Micromate has ever been observed calling home
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 |
||
|
|
338ce4fea7 |
docs(series4): CORRECTED -- cellular cost is NOT independent of payload
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
|
||
|
|
423608ccd1 |
perf(micromate): 16 KB per request, not 1024 -- 14x fewer round trips
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 |
||
|
|
248ddc9cda |
docs(series4): RETRACTED -- there is no 0x5A streaming mode; offset is a byte count
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 |
||
|
|
faac59b283 |
verify(micromate): the uint32 chunk offset is confirmed -- 72,560 B in 71 chunks
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 |
||
|
|
9c28b586bb |
fix(micromate): the 0x5A chunk offset is a uint32 -- a 64 KB cap was one event away
UM20147 holds a 72,560-byte event. chunk_params() wrote the offset as a uint16 at params[2:4], because every offset THOR was observed to send fits in two bytes (largest 0x3400 = 13,312), which caps a download at 65,536 B -- so that event could not have been fetched at all. params[0:4] is demonstrably ONE 4-byte field: chunk 0 puts the 4-byte event key there. Writing the offset as a uint32 BE in the same slot is BYTE-IDENTICAL for every offset below 65,536, so nothing verified against THOR's 74 captured frames changes -- the replay test still matches all of them -- and the range extends to 4 GB. Above 64 KB this is inference and the docstring says so: the field's width is established, the device's handling of a non-zero high byte is not. Also newly reachable: at offset 1 MiB params[1] is 0x10, which must go out as `10 10`. Nothing below 64 KB can produce that, so the uint32 change is what first makes the case possible -- and an unescaped 0x10 in 5A params is the exact bug that cost the Series III walk a release. Tested. THIS IS THE SERIES III 64 KB PAGE-BOUNDARY BUG WEARING A DIFFERENT HAT. There, parse_strt_end_offset() discards the key's page byte and the walk crashes once a unit's buffer crosses 64 KB; that one is still open. The transferable lesson: an address field whose high bytes are zero in every capture is not a narrow field, it is an untested one. Same mistake, found twice, in code written years apart. Confirmed in the same run: 0x06 content[0:4] IS the event count -- UM20147 holds 5 events and reads 5, making it three for three across both firmware lines (0->0, 6->6, 5->5). And content[4:8] is a CONSTANT, not a count: it reads 9 on a unit with 6 events and on a unit with 5. list_events() still walks to the sentinel; the count is worth adopting as a pre-check, not a replacement. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
e95d8e3b8c |
docs(changelog): Series-4 live client, verified on hardware
Folded into the existing Unreleased sections rather than adding new headings. Added: the three new micromate/ modules with 98 offline tests, the hardware verification across both transports and both firmware lines, and bridges/mm_client_check.py. Changed: the six spec rules the captures refuted before any code shipped; the 0x0C peak-vector-sum resolution and the decoder self-check it enables; the ~0.65 s per-round-trip cellular cost and what it implies for design; event keys colliding across units; and setup names being spelled three ways by three commands. Fixed: scratch/mm_frame_parse.py accepting either checksum rule, which is why it could not falsify either. Migration: None -- corrected the previous entry's claim that nothing under micromate/ was touched, which this merge makes false. The new modules are additive, micromate/idf_file.py (the codec) is untouched, no TOOL_VERSION bump, and no backfill is owed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
a5237bb3b4 |
docs(series4): RESOLVED -- the 0x0C float is the PER-SAMPLE peak vector sum
Exact to 0.000% on all four bench waveforms, against a PVS recomputed from the decoded samples. The offset (Tran label - 12) is now established rather than inferred: four independent confirmations plus a fifth on the other firmware line. RETRACTION. The previous entry observed the float running 2-5% above max(T,V,L) and concluded it was NOT the peak vector sum, "because computed PVS runs higher than both". That computed PVS was sqrt(T^2+V^2+L^2) from the three REPORTED CHANNEL PEAKS, which is an upper bound on the real quantity rather than the quantity -- the channel maxima do not occur at the same instant, so combining them overstates the true peak. Every row of the old table is in fact consistent with max(T,V,L) <= stored <= sqrt(sum of squares). I also got this wrong in the other direction today and want it recorded. On UM20147's event the stored float matched sqrt(sum of peak squares) to 0.048%, and I called it the vector sum on that basis. It is not -- that event's peaks merely happen to be nearly coincident in time. The six CB events separated the two formulas immediately, with errors to -9.5%. ONE SAMPLE AGREEING WITH A FORMULA IS NOT EVIDENCE WHEN A SECOND FORMULA FITS IT EQUALLY WELL. Why it is worth having: it is a FREE SELF-CHECK ON THE DECODER. The device computed this number from the same samples we decode, independently of our codec, so a mismatch means the decode is wrong. Given this codebase's history of silent channel truncation -- walker bugs that shorten a channel and raise nothing -- a per-event invariant costing one float comparison is cheap insurance, and worth wiring into the download path. Also added the full 0x0C field map from real UM20147 bytes: timestamp, the record-type byte, sensor-location label, setup name, serial, the PVS float and the four channel labels with their offsets. Noted in passing: the setup name appears as "test2" in 0x0C, "test2.MMB" in 0x41 and "test2.mmb" in 0x40 -- three commands, three spellings of one file, in one session. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
7d1b033a05 |
docs(series4): BD download works -- and event keys COLLIDE across units
UM20147, event 055d4a81, 4,796 B, type read as histogram from the 0x0C byte and decoded as .IDFH on the first try. The chunk walk, the offset arithmetic, the 11-byte chunk prefix and the record-type byte all hold on the Thor firmware line unchanged. That closes the last BD gap. The type byte is now 7 events across both firmware lines -- 4 waveform, 3 histogram -- correct every time. Still not a large sample; the fallback stays. THE FINDING THAT MATTERS: UM20147's first event key is 055d4a81. So is UM12947's. Different units, different sizes (4,796 vs 4,076 B), different contents, identical key. This confirms keys are a sequential counter, and adds the consequence: the counter starts from the same value on every unit, so a key is MEANINGLESS WITHOUT ITS SERIAL. Anything that stores, deduplicates or addresses Series IV events must key on (serial, event_key). A store keyed on the event key alone silently treats one unit's event as a duplicate of another's, and the failure is invisible -- the second event is simply never ingested. Series III has a related hazard the ACH server already handles: its counter resets after an erase, so keys are reused WITHIN a unit, which is why ach_state.json tracks max_downloaded_key per serial. Series IV inherits that and adds cross-unit collision on top. Incidentally resolved: memory free is a usable signal after all. Run 1 showed 15,000,000 free and no events; run 3 showed 14,799,296 free, idle, with events stored. The earlier ambiguity was monitoring overhead confounding it, not memory being meaningless. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
080fb92ba2 |
test(micromate): real 11.0BD fixtures replace the synthesised ones
UM20147 captured over USB with mm_client_check.py --capture, read out with
scratch/mm_frame_parse.py: 11 frames each direction, 0 bad checksums. The two
BD-specific response data sections are now verbatim fixtures; only the frame
wrapper is rebuilt, which is sound because the framing is verified 251/251
elsewhere in the same file, and the reconstruction is pinned against the
payload length the parser reported.
Every field lands where the forward-offset model says it should:
data[0] = 0x30 = 48 = 59 - 11 (CB declares 0x2C = 44; the +4 holds)
content[1] = 0x0e monitoring
content[2:10] = 30 Sep 2026 14:00:49 matches the wall clock
content[34:36] = 3.50 V
content[36:44] = 15,000,000 total / 14,848,448 free
AND THE WARNING IS NOW DEMONSTRATED ON THE UNIT IT PREDICTED. Series III reads
battery from data[-10:-8], which on this block is e1 c0 -> 577.92 V. That is
the exact figure the A/B section named, and there is now a test asserting it,
so the reason the offsets are forward cannot be quietly refactored away.
Two corrections to the reference:
1. The four extra BD bytes are `0f a0 00 04`, not `0f a0 00 00`. Only the
first two look fixed. Nothing reads them, but the last is not padding.
2. POLL content[3] VARIES BETWEEN UNITS -- 0x50 on UM12947, 0x56 on UM20147.
It is printable in both cases ("P" and "V"), which is a second, independent
reason the POLL block cannot be parsed by scanning for printable runs: a
scan returns "PInstantel" on one unit and "VInstantel" on the other. The
fixed offset content[4] was the right call for a reason I had not seen.
The model string sits at content[26] on both firmware lines; only its tail
differs, so anchoring on "MM/" remains correct.
98 micromate tests pass. Full suite unchanged at 16 pre-existing failures.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
ea229ed19d |
docs(series4): monitoring reads confirmed, and setup-name case is inconsistent
Two findings from a UM20147 run that was only meant to capture fixture bytes. 1. A MONITORING UNIT ANSWERS READS NORMALLY. UM20147 was read while actively monitoring -- monitoring=True on both indicators, which agree -- and served POLL, serial, state, monitor status and a 5-entry setup walk with no special handling. This confirms the SESSION_RESET finding with our own client. Series III REQUIRES a bare 41 03 before POLL or a monitoring unit will not answer over TCP. That was inferred from its absence in THOR's captures; it is now demonstrated directly, on the other firmware line, by a client that never sends one. (THOR's refusal to send a SETUP while monitoring is a write restriction -- reads are unaffected.) Monitoring moves two values, so neither is stable to compare against: battery drifted 3.55 -> 3.50 V and memory free 15,000,000 -> 14,848,448. 2. SETUP-NAME CASE IS NOT CONSISTENT BETWEEN COMMANDS. Same unit, same session, same file: 0x41 reported "test2.MMB" and 0x40 reported "test2.mmb". A run 45 minutes earlier reported "test2.mmb" from both, so it is not fixed per command either; what changed between is that the unit started monitoring. Cause is a guess from two samples. The consequence does not depend on it: compare setup file names CASE-INSENSITIVELY. An exact-string test of "is the active setup one I know about?" answers no on this unit. Worth fixing before it is a field bug, since name matching is on the path for anything that replaces THOR's setup/scheduler coupling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
b55e4e946a |
verify(micromate): 11.0BD confirmed on hardware -- every inference held
UM20147 read over USB by mm_client_check.py. The Thor firmware line was entirely inference until now, and two of its three differences were covered only by SYNTHESISED test frames. All three held: - flags = 0x03 identifies the line -> reported firmware_line="thor". That is only reachable if `10 03` in the flags position destuffs before indexing, since 0x03 is ETX -- so the escaped-flags case is confirmed too. - the model string is shorter -> reported "MM/ISEE/S" exactly. Anchoring the search on b"MM/" rather than a fixed span is what made this work. - the 0x1C block is 4 bytes longer with the extras TRAILING, so from-the-start offsets survive -> battery 3.55 V and a clock correct to the second. That last one is the one that mattered. Series III's from-the-end offsets would have given this unit 577.92 V, which is why mm_client_check watches for an impossible voltage: it is a free self-check on exactly the inference most likely to be wrong. Also clean: serial UM20147, 5 setups (factory.MMB -> test2.mmb), active setup test2.mmb, 15,000,000 B total and free, 21 reads / 2,165 B in. "One protocol stack drives the whole fleet regardless of firmware line" -- the headline finding of 2026-09-23 -- is now demonstrated by a working client rather than by matching response SUBs. Test and docstring claims downgraded from inference to confirmed where the hardware settled them, and left as synthesised-frame notes where it did not: the BEHAVIOUR is confirmed but raw BD bytes are still not in the repo. Added --capture DIR to mm_client_check: writes a raw_bw_*/raw_s3_* pair in the layout scratch/mm_frame_parse.py already reads, so a run on an unfamiliar unit becomes a test fixture without setting up a relay. Verified by round-tripping its own output through that parser: 28 frames, 0 bad checksums. Still not covered: a download from a BD unit (UM20147 had no events stored, so the chunk walk remains CB-only), raw BD fixture bytes, a monitoring unit, a nearly-full buffer, and the inbound call-home session. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
0d6eb1621f |
verify(micromate): read client works on real hardware, both transports
Run against UM12947 by bridges/mm_client_check.py, read-only, over the USB-B CDC-ACM port and over the RX55 to TCP :9034. THE WIRE BYTES ARE IDENTICAL ON BOTH PATHS -- 11,580 B in and 761 B out, to the byte, with matching identity, state and a 24-entry setup walk. The protocol does not care which physical layer it runs over, which is the thing the modem path needed to prove. Three findings, one of them a correction to my own prediction: 1. THE MODEM NEEDS FEWER READS, NOT MORE. 36 against USB's 83. The tool's banner claimed the opposite. The modem coalesces -- it buffers ~1 s then forwards one large TCP segment, where CDC-ACM delivers many small chunks. That is reassuring rather than alarming: the risk was a frame arriving split across reads, and the modem splits LESS than USB does. Banner fixed to state the measured numbers instead of a guess. 2. ~0.65 s PER ROUND TRIP over cellular, independent of payload size. A 1,024 B chunk and a 16 B state read cost the same. list_setups() takes 16.05 s over the modem against 0.46 s over USB, for 24 commands. This is the number that matters for SFM's design: over cellular, minimise round trips, not bytes. Enumerating setups costs 16 s -- cache it, never refresh it on a timer. A 13 KB event is 14 chunks ~ 8.4 s of latency against ~0.03 s of data, which makes the unconfirmed single-request 0x5A streaming mode worth its two-minute bench test on its own. 3. THERE IS A RECORD-TYPE FIELD: 0x0C content[11], 0x07 waveform, 0x08 histogram. The reference says no type field is known and that the type must be carried out of the chain walk. Found by diffing the six bench events' 0x0C records against their known types -- exactly one byte separates the groups and is constant within each -- then confirmed by predicting the right suffix for 6 of 6 on a blind re-run. Six events split 4/2 is thin evidence for a byte that could be a counter or a channel count, so it is recorded as a strong candidate, not settled, and mm_client_check keeps a fallback: it tries the other suffix on failure and says when the guess was wrong. Also flagged: the reference's claim that the type comes from SUB 0x0A's length is not visible in the download capture, where 0x0A is a standalone monitor-log walk after the last chain entry, not a per-event probe. END TO END: all six bench events assembled by read_event_file() from captured 0x5A responses decode with the existing codec -- 4 waveforms at 12,288 / 12,288 / 12,288 / 8,192 samples and 2 histograms. No new codec work needed; /db/import/idf_file ingests a directly downloaded event unchanged. Not covered: 11.0BD (still pure inference), a monitoring unit, a nearly-full buffer, and the inbound call-home session. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
f09b7dcaaf |
feat(micromate): client layer -- connect, state, setups; read-only
Step 3 of docs/micromate_client_spec.md: micromate/client.py, two models in micromate/models.py, 26 offline tests. Every response constant in the tests is a real captured data section from UM12947. Field offsets were measured rather than taken from the spec, which turned up one general rule and one trap: THE RESPONSE SHAPE. Every response carries an 11-byte prefix and content starts at data[11]. One rule, every command. THE TRAP: data[0] is the content length & 0xFF, with no high byte anywhere in the prefix. It is therefore correct for every response under 256 bytes -- most of them -- and then reports 44 for a 2,092-byte setup block, 30 for a 286-byte monitor-log record, and 0 for a 1,024-byte download chunk. 182 of 251 captured responses agree with a naive read; the 69 that disagree are exactly the ones >= 256 bytes. That is the third length in this protocol read too narrow, after payload[9]-vs-payload[8:10] in the probe response. The client takes content as data[11:] and lets the frame's own length bound it -- nothing needs the declared length, since the frame already knows how long it is. Also measured: - POLL content[3] is 0x50, printable as "P", immediately before "Instantel". A generic printable-run scan therefore returns "PInstantel" -- it caught a test, not a unit. Vendor comes from a fixed offset; the model is found by searching for "MM/", which is structural rather than positional and so survives the Thor line's shorter "MM/ISEE/S". - The setup walk terminates on an EMPTY NAME, not an error: 23 responses, 22 names, factory.MMB first through TEST1.mmb last. - The 0x1C clock has an unidentified byte at content[6]; the hour is at content[7]. The protocol reference's 0x1C section already had this right and names the byte -- its one-line summary in the divergences list reads as six contiguous fields and is the version not to trust. Re-verified against three captures: 19:12:25, 19:13:34 and 01:14:05 against filenames stamped 19:12:14, 19:12:14 and 01:14:03. - Battery and memory are read FORWARD from content start, never backward from the end. This block is 4 bytes longer on the Thor line; the Series III from-the-end offsets give a 11.0BD unit 577.92 V. A test appends the four trailing bytes and asserts the forward offsets survive. connect() is narrower than the spec asked. The spec said to mirror Thor's POLL -> SERIAL -> 0x49 -> POLL "because it is known-good"; measurement showed that is Thor's connection check (3 of 8 sessions) and its fourth frame repeats its first. So connect() sends the three reads that gather something, and 0x01 is not read at all -- Thor never reads it, its layout is unmapped, and firmware_line comes free from any response's flags byte. If a unit ever refuses the next command after a cold connect, put the fourth POLL back and record it. A dead clock battery yields device_time=None rather than failing the whole state read; an unreadable active setup yields active_setup=None rather than failing connect. Both are real device states. Still verified only against 11.0CB and only over USB. The BD offsets follow from the extra bytes being trailing, which is documented but not something this code has seen. Full suite unchanged at 16 pre-existing failures; 445 passed, up 26. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
a7e3a8f20a |
feat(micromate): protocol layer -- reads only, verified against Thor's frames
Step 2 of docs/micromate_client_spec.md: micromate/protocol.py plus 35 offline tests. Reads only; nothing here writes, erases or changes monitoring state. The tests replay Thor's captured responses through a scripted transport and assert the bytes we emit are the bytes Thor emits -- including a full replay of the six-event download session, all 56 0x5A frames byte-for-byte. A passing test therefore means a real unit has already answered exactly that frame. Measuring the spec's command table against the captures found three more errors in it, on top of the three the framing work found: 1. SUB 0x0A is the MONITOR-LOG WALK, not a keyed "event header, 30 B list record" read. The same request repeated returns successive 297-byte records -- serial, mode, thresholds -- until an 11-byte ack ends the list. The device holds the cursor; nothing in the request selects a record, and all nine captured frames carry identical params. Structural divergence worth noting: Series III reaches the same data via a record-type discriminator on its event chain, so partials and events share one walk. Here the monitor log has its own cursor and the event chain never sees it. 2. 0x1E/0x1F carry token 0xFE at params[7]. The protocol reference documents all-zero params -- that was our own browse probing, which also worked. Thor sends 0xFE on browse and download alike. 3. SUB 0x01 (device info) is never read by Thor in any captured session. Its 0xFFFF offset comes from our own probes, so it is the one read in the table with no Thor precedent. Flagged in the docstring. Two useful negatives, both from absence rather than presence: - No SESSION_RESET (41 03). Series III needs that 2-byte signal or a monitoring unit will not answer POLL over TCP. Zero occurrences across all 8 sessions, including 40 frames exchanged with a unit that WAS monitoring. - No universal preamble. The only invariant is that a session opens with POLL; POLL -> SERIAL -> 0x49 -> POLL is Thor's connection check and appears in 3 of 8 sessions. Setup pushes and scheduler reads open differently. Two deliberate divergences from the Series III sibling: - strict_checksums defaults True and RAISES. minimateplus logs and continues because its parser cannot always tell an inner-frame delimiter from a checksum byte; that does not apply here, where the rule is exact on 251/251 frames. The lenient default is instructive -- it hid a wrong checksum rule for two days. - read_event_file() raises ShortRead rather than returning a truncated event. The expected length is known up front, so the check is free, and a silently short event is the failure mode this codebase keeps hitting. Every exchange resets the parser before sending, so a leftover frame is discarded rather than answered with -- expected_sub catches a mismatched SUB, but a same-SUB leftover would sail through with data for the wrong key. File transfer (0x94/0x48) is deliberately out of scope: it needs a data-carrying request frame, which is the frame type writes use, and that boundary is worth keeping crisp in a read-only pass. Full suite unchanged at 16 pre-existing failures (missing gitignored fixtures); 419 passed, up 35. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
5fe99568a2 |
feat(micromate): framing layer -- and three spec rules the bytes refuted
Step 1 of docs/micromate_client_spec.md: micromate/framing.py plus 31 offline tests. Every rule was checked against the captures BEFORE being written, which is the only reason this commit is not a bug. Three things the spec asserted are wrong, all of which fail silently: 1. Requests are NOT plain Series III frames. A Micromate escapes four byte values -- 0x02 0x03 0x04 0x10 -- where Series III escapes one. minimateplus.build_bw_frame reproduces 161 of Thor's 218 captured read frames; build_request() reproduces 218/218. The 57 it missed include EVERY 0x5A download (offset 0x0400 puts a literal 0x04 in offset_hi) and the scheduler enable. An unescaped 0x03/0x04 terminates the frame, so the unit never answers -- indistinguishable from a dead unit, and event download would have hit it on the first request ever sent. 2. The checksum is plain SUM8 of the destuffed payload, not the DLE-aware variant. 251/251 both directions. The DLE-aware form is correct paired with Series III destuffing, which leaves an escaped byte as two bytes; after uniform destuffing it subtracts the correction twice and disagrees with the wire on 55 of 251 responses. scratch/mm_frame_parse.py shipped with exactly that pairing and looked clean only because it accepts either rule -- so it labelled those 55 "SUM8" and never flagged one bad. "Zero bad checksums" was true and carried no information. A tool that tries N candidate rules cannot falsify any of them. Fixed to validate against SUM8 alone. 3. SUB 0x5A is a 1024-byte chunk loop, not one request per event. Thor's form, verified on all six bench events (4,076 -> 13,424 B): chunks = ceil(size/1024), offset = min(1024, size - 1024*i) as a byte count, params[2:4] = the byte offset, response data = offset + 11. sum(offsets) == size exactly, every time. This does not retract the earlier single-request observation -- that used offset_hi = 0x10, which in Series III is the bulk-stream marker, so it is plausibly a distinct streaming mode returning several frames. Those captures never landed in the repo, so it cannot be re-derived. Implement Thor's form; the other is worth one bench test. Also: a 0x10 inside request params needs no special handling (settled -- Thor sends it, the wire doubles it), so the planned NotImplementedError guard is gone. declared_length -> probe_length, because it is only meaningful in a probe reply and Thor never probes. Synthesised test frames are marked and each says what it stands in for. The flags=0x03 case is the only coverage of the Thor firmware line -- it wants a real 11.0BD capture next time UM20147 is on a bench. No writes. Read-path framing only; nothing here can originate a command. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
a7631a8179 |
docs(series4): RESOLVED -- FTDI cable AND a cold boot; modems bridge one session
The cable swap alone did not fix it. A probe immediately after fitting a genuine FTDI cable (lsusb 0403:6001, FT232) returned the same "connected, no reply". A COLD BOOT of the unit was also required -- power button held five seconds through the two-stage battery-disconnect prompt, powered back up with the cable already attached. THOR connected the moment it finished booting, and an independent probe returned UM12947, idle, over cellular. So the Micromate's USB host does not rescan on hot-swap: it enumerates that port at boot and, having once failed to identify a device, does not try again. Changing the cable is a power-cycle operation -- and anyone swapping one in the field who probes immediately will conclude the new cable is faulty too. Full chain: an FTDI or CDC-ACM cable, AND a cold boot with it attached. SEPARATELY CONFIRMED, by accident: these modems bridge ONE TCP session to serial at a time. With THOR connected, the probe got "TCP ok, NO REPLY"; with THOR disconnected and nothing else changed, the same probe returned the serial number. The PAD accepts a second connection and then never forwards it -- it does not refuse and does not close. That makes "connected but no reply" ambiguous between a broken serial path and somebody else already holding the unit, and mm_probe reported only the former -- which would push a diagnosis in exactly the wrong direction, on the very fault we spent two days chasing. Its verdict now names both causes, tells you to eliminate contention first, and includes the cable-chipset and cold-boot steps. Recorded as an SFM design constraint: our receiver and THOR cannot both hold a unit, and during any migration both will exist. "Another client holds this unit" has to be a distinct visible state. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
8a1d1c3f17 |
docs(series4): spec the live client, so tomorrow is implementation not design
Turns docs/micromate_protocol_reference.md into a build plan for the missing half of micromate/ -- it is codec-only today with no way to talk to a unit. Layout mirrors minimateplus/: framing, protocol, client. Transport is REUSED -- minimateplus/transport.py is byte-level and protocol-agnostic, and already handles the RV50/RV55 habit of emitting RING/CONNECT to a caller. But minimateplus/framing is deliberately NOT shared: the two framings differ in ways that look small and are not, and a shared module would accumulate `if series ==` branches until neither case is readable. Records the three things that make S3FrameParser useless on Series IV (bare STX, 0xC5/0x03 flags, uniform 10 XX -> XX destuffing with no inner-frame carve-out), and the traps that have already cost time: the declared length is a uint16 BE and reading it as a byte under-reads SUB 0x1A by 47x; SUB 0x1C is four bytes longer on the Thor line so parse forward not backward, or a BD unit reports 577.92 V; the monitoring flag must be tested non-zero; and the SUB byte itself can arrive DLE-escaped, so destuff before indexing. Scope is READ-ONLY, stated with the reasoning: no command has ever been originated against a unit by this project, and keeping that true through the read client means the first thing we ever send to a customer's instrument is a deliberate decision rather than a side effect of a client that grew a method. Tests are specified to embed frames as hex constants rather than read fixtures, since bridges/captures/ and tests/fixtures/ are both gitignored -- with a table of which cases matter and why, and a round-trip assertion against scratch/mm_frame_parse.py, which is already known good across three sessions at zero bad checksums. Steps 1-2 need no hardware. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
5fa181fb79 |
docs(series4): confirmed -- the cable came home with the failed unit
Removes the last caveat. The Benfei (Prolific PL2303) on the bench is physically the cable from the failed office setup, not a substitute picked up later. The chain has no inference left: that cable is a PL2303; the Micromate USB host has no Prolific driver in either firmware line; a laptop on the same cable and modem round-trips perfectly; the Micromate on it never answered. The FTDI cable arriving 2026-09-26 is now a confirmation rather than a test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
0659543a15 |
docs(series4): the 2026-09-22 failure is accounted for -- the timeline was wrong
An earlier draft said the Prolific-cable finding did not fit the timeline, since the unit was described as working and then degrading, which a cable that never enumerates cannot do. The timeline was what needed correcting. From the operator: the initial setup was ONE modem and ONE cable, and it worked. Two Micromates then had to be deployed, so a second cable was fetched to run both at once -- and only one of the two ever worked. The other never talked over its modem at any point, was never deployed, and a MiniMate Plus went out in its place. That Micromate came back to the bench, and the cable on it is a Benfei (Prolific PL2303). So nothing degraded. The "worked at first" was the single-cable setup before the split. One unit working and one not, configured side by side, is the signature of a mixed cable supply rather than a unit fault. Still worth confirming whether that cable travelled home with the unit or was picked up at the bench; if it travelled with it there is no inference left. The FTDI cable arriving 2026-09-26 settles it either way -- same unit, same modem, one variable. Records a corollary: "just deploy a Series III instead" works partly because a MiniMate Plus has a DB-9 port directly on the unit, with no USB-to-serial adapter in the path and therefore no chipset to get wrong. That workaround has been routing around this exact failure mode. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
4a96e1a2b2 |
docs(series4): the bench cable was confirmed a Benfei (Prolific)
Closes the identification chain: firmware has no Prolific driver, a laptop answers on that cable where the Micromate does not, lsusb reported PL2303, purchasing history shows both FTDI and Prolific cables in circulation, and the physical cable on the bench is a Benfei. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
062d65ba69 |
docs(series4): purchasing history corroborates the cable finding
TMI's order history shows TWO kinds of USB-to-serial cable in circulation:
Sabrent USB 2.0 to serial FTDI chipset -> Micromate has a driver
Benfei USB to RS-232 Prolific PL2303 -> no driver
So both types are in the supply and indistinguishable by eye. A unit handed the
wrong one has no working modem port and nothing about the cable says so. That
moves the PL2303 explanation from "a theory about one odd cable" to a known mix.
Adds the identification note: check chipset with lsusb, not appearance -- FTDI is
VID 0403, Prolific 067b -- and flags that counterfeit FTDI chips are common in
cheap cables, carrying FTDI's VID without behaving like one. An embedded host
with a single driver is far less forgiving than Linux.
Also records honestly that this does NOT fit the 2026-09-22 field outage as
reported: a Prolific cable never enumerates, so it cannot fail gradually, and
that unit was described as working before degrading. Notes the one story where
it would fit -- if the initial success was over the USB PC port or a bench test
before deployment, the modem path would have been broken from deployment onward
and the recollection would be conflating two connection types. Plausible,
unverified, recorded as such. Identifying that unit's cable settles it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
8a0134070b |
docs(series4): soften the cable finding -- well-supported, not proven
The operator pushed back on calling this solved, correctly. Adjusting the wording to match what the evidence actually carries. What IS supported: on this bench setup, the modem and cable work bidirectionally (laptop round trip, 700 ms), the same cable/modem pairing answers for a laptop and not for the Micromate, and neither firmware image contains a Prolific driver. Observation plus mechanism. What is NOT: that this explains the field failures. Those cables cannot be inspected, and the timeline does not fit -- a wrong cable fails from the first packet, and that unit reportedly worked before degrading. A gap in the bench claim itself, now stated: "no driver" is inferred from ABSENCE of strings. usbHostDelete_* reads like a complete per-class list, which is good evidence, but driver code can exist without a matching string and the USB enumeration path has not been disassembled. Names the test that removes the inference entirely: try an FTDI cable (VID 0403) on the same modem. Either it works or it does not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
84ca10eb3c |
docs(series4): the Micromate USB host is FTDI + CDC-ACM only -- not Prolific
A Micromate on an RX55 was unreachable from THOR. Isolated layer by layer with
bridges/mm_probe.py, and the answer turned out to be the cable.
The USB-A port is a HOST port with a fixed driver set, identical in both firmware
lines:
CDCACM FTDI MFS (mass storage) PRINTER HUB HC USBH
11 FTDISER strings and 22 CDCACM strings in each image, and ZERO matches for
prolific / pl2303 / cp210 / ch34 / silabs in either. So a Prolific PL2303 cable
(VID 067b) cannot work with a Micromate on any firmware -- no driver, no
enumeration, no serial path. It needs an FTDI cable (VID 0403) or CDC-ACM.
The isolation method is the part worth keeping. Eliminated in turn: public IP
(static APN), firewall (probe got TCP connect in 268 ms from a whitelisted
source), network path, baud, the unit's modem-type setting, and THOR itself
(the probe bypasses it). Then the decisive pair -- a Linux box was swapped in
for the unit on the SAME cable and modem:
* POLL arrived at the serial side byte-perfect
* a canned reply came back over TCP, full round trip in 700 ms
So the modem, PAD config, firewall and network are all clean, and the only
element that changed is what sits at the end of the cable. Substituting a
known-good device converts "the unit is not answering" into "the unit is not
receiving" -- very different problems. Adds scratch/fake_unit.py for that.
Flagged: this explains the BENCH setup conclusively. It does NOT establish the
cause of the 2026-09-22 field outage, which reportedly worked at first and
degraded -- a wrong cable would not do that. Kept separate until that unit's
cable is identified.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
7b2aa871bd |
docs(series4): record a known-good RV55 config, and the office topology it reveals
Read off a Micromate modem deployed and working for months. Recorded because
this knowledge currently lives only in a modem's web UI, and TMI has seven
working units to diff a misbehaving one against -- the fastest diagnostic
available.
Serial: PAD mode, 115200 8N1, flow control None. (Series III units use 38400 --
a modem moved between series needs this changed and nobody would think to.)
PAD: TCP, auto-answer ON, listening port 9034, destination 50.197.32.91:12345,
idle timeout 2 min, data forwarding 500 ms, MTU 1304, TCP keepalive OFF.
Cellular: APN mw01.VZWSTATIC -- Verizon's static-IP APN, which confirms the fleet
has fixed addresses and rules out any "the IP moved" explanation.
TOPOLOGY this answers: the office ACH listener is on port 12345 at 50.197.32.91,
and field modems listen on 9034 for THOR to dial in. Both were open questions.
Two things worth questioning in the config, flagged as hypothesis not finding:
* TCP keepalive is Off, so nothing detects a half-open session from the modem
side -- the 2-minute idle timeout is the only reaper.
* An idle timer can be held open indefinitely by a client that keeps writing.
THOR polls every 30 s (measured). If it holds a session the unit stopped
answering on and keeps writing into it, each write plausibly resets the idle
timer, the session never ages out, the PAD's single slot stays occupied, and
all new inbound fails -- while ACEmanager answers on its own service.
Whether one-directional traffic resets that timer is NOT confirmed, and the
single-slot behaviour is untested on a real modem. mm_probe --slots tests
the latter directly.
Adds an ordered diff checklist for a misbehaving modem, noting that "listen for
connections" and "destination address" fail in opposite directions -- inbound
broken with call-home working points at the listener; call-home broken with
inbound working points at the destination.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
a404d70791 |
docs(series4): THOR leaks event subscriptions -- evidence from its own log
The office THOR PC's log for 2026-09-22 contains a textbook WPF defect, visible
without any instrumentation.
85% of a day's logging is one message: "UnitOperatingModeViewModel - Start/stop
monitoring request timed out: False", 178 of 209 lines. Only 12 lines describe
an actual operation.
Grouping that message by exact timestamp to the millisecond -- so each group is
ONE logical event -- the count per event grows over the day:
11:48 1-4
13:36-13:40 2-4
15:16 3
16:03-16:07 6
22:00-22:06 12
1 -> 12 over ten hours of uptime. Twelve identical lines sharing a single
millisecond is not twelve events; it is one event dispatched to twelve handlers.
That is a subscription leak, and the class name identifies it. THOR is .NET/WPF
("App thread", ViewModel naming), where a view model subscribing on view-open and
never unsubscribing on view-close is the archetypal case.
Consequences that follow directly: N grows without bound with uptime and usage;
every notification does N times the work; and a restart resets N to 1 -- matching
the operator's report that only restarting recovers a degraded session. The only
five "timed out: True" entries in the file sit at the very top, an episode caught
just before rotation.
Claim discipline stated explicitly in the doc. ESTABLISHED: the handler count
grows. STRONG INFERENCE: it is a subscription leak. NOT ESTABLISHED: that it
caused the 2026-09-22 field outage -- this log does not cover that window and the
link between leaked handlers and a dead TCP path is unproven.
Includes a ten-minute confirmation procedure: restart THOR, note the burst size,
open and close a unit detail view ten times, re-count.
Three lessons for SFM: unsubscribe on teardown or use weak events; log once per
event rather than once per handler; and log what CHANGED -- 178 "timed out:
False" lines are noise that buried the five that mattered, which is plausibly why
this went unnoticed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
992b84df51 |
docs(series4): modem settings live in SysParm.cfg, not the setup -- deliberately
Settled by a clean experiment. The call-modem setting was changed on the keypad from 'generic' to 'USB to PC', then the ACTIVE SETUP was switched from TEST1 to test2 on the device. The setting did not change. So it is device-global, in the SysParm.cfg the firmware strings already hinted at alongside SysPref.bMonitorScheduler -- not a per-setup field. That closes a hypothesis this document was chasing: the ~102 bytes a .MMB file carries beyond the 2,090-byte config block are NOT where this lives. Those bytes remain unexplained but are no longer a candidate. CORRECTS an over-reading in an earlier commit. "The call-home block (0x2C) was byte-identical across 218 samples today" does not bear on this question: the last 0x2C sample was at 13:30:23 and the keypad change came around 13:35, so no sample exists on the far side of it. Why the split is right, and the operator's reading of it: you do not want modem settings reachable remotely, because getting them wrong over the air destroys the connection you would need to put them back, and the unit must then be visited. So SUB 0x2C is not an incomplete view of the modem configuration -- it is the deliberately-chosen subset that is SAFE to change remotely (enable, dial string, retries, timings), and the unreachable remainder is unreachable on purpose. Records the design principle for SFM: for settings whose misconfiguration destroys the channel you would use to fix them, either do not expose them for remote write, or require commit/confirm with automatic rollback (apply, require a call-back within N minutes, revert otherwise). Always allow READING them, so an operator can diagnose a unit they cannot reconfigure. Instantel chose the first option and given the failure mode that is worth copying rather than improving on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL |
||
|
|
8b6c89da42 |
docs(series4): a live monitoring unit displayed as Idle -- and a flag I got wrong
The operator's test: start monitoring from the unit's keypad and see whether THOR
notices. It does not.
At 13:21:15, verified by an independent probe through the same relay:
unit on the wire 0x49 data[11]=0x02, 0x1C data[12]=0x0c -> MONITORING
THOR last contact 13:10:37 (a stop-monitoring command it issued itself)
THOR display Connected . Monitoring Mode: Idle . Last Updated 1:04:22
A unit is actively recording and THOR shows it as Idle. Had an event triggered
in that window THOR would not have known and would not have collected it. That
is the operational consequence of the wedge -- not a wrong indicator, but a
monitoring system that has silently stopped monitoring its monitor.
Further detail: THOR DID contact the unit at 13:10:37 and read MONITOR_STATUS,
yet Last Updated still reads 1:04:22. A successful exchange does not refresh
that timestamp; only the full status check does. The one honest field on the
screen is honest about the wrong thing, which makes it useless as a staleness
indicator exactly when staleness is the problem.
CORRECTS a documented constant. SUB 0x1C data[12] was recorded as "0x0E
monitoring / 0x00 idle". It read 0x0E on 2026-09-24 and 0x0C on 2026-09-25, both
while monitoring, so it carries sub-state in its low bits and is not a flag. Test
for NON-ZERO, never against a constant -- an implementation comparing to 0x0E
would have reported this unit idle. Same caution noted for 0x49 data[11], which
has only ever been seen as 0x02.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
d93ebe2322 |
docs(series4): correct a sloppy count -- the conclusion holds, the evidence did not
The claim "THOR connections since 13:04:22 : 0" was an artifact of a time filter
(13:0[4-9]) that silently dropped everything from 13:10 onward. THOR had in fact
connected four times, at 13:10:03-13:10:37. Recorded rather than quietly fixed:
the number was stated as proven and it was wrong.
Inspecting those four connections shows the conclusion survives, for a better
reason than the one originally given. They were user-initiated commands, not
polling:
13:10:03 POLL -> SUB_96 (start monitoring) 13:10:05 MONITOR_STATUS
13:10:35 POLL -> SUB_97 (stop monitoring) 13:10:37 MONITOR_STATUS
Single commands a human clicked, each followed by one status read. Neither the
eleven-command status check nor the three-command connection check appears
anywhere in the window.
So automatic polling still has not resumed since 13:03:10 -- 16 minutes by
13:19:53 -- and every THOR connection in that window was operator-initiated:
the refresh at 13:04:21, then start and stop monitoring at 13:10.
Updates finding 3 from "three minutes of healthy link produced zero connection
attempts" to the stronger and now properly-evidenced "sixteen minutes produced no
AUTOMATIC attempts at all, only ones initiated by hand".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
cfc715c02f |
docs(series4): THOR shows "Connected" for 11 minutes after it stopped checking
Closes the question the last two commits left open -- what the UI actually shows
during the dead window. It is the bad case.
Captured at 13:15, eleven minutes after THOR's last contact with the unit:
Connection Status : Connected <- false
Last Updated : 09/25/2026 01:04:22 PM <- true, and that is the REFRESH
Notification : "Unable to download event(s) ... Did not receive
response from unit." (01:03:31 PM)
Three separable points:
* The green tile is false -- it reports a live connection not exercised for
eleven minutes.
* Last Updated is TRUE, and is the only honest field on the screen. THOR knows
when it last succeeded; it renders that as small grey text under the unit
name, unhighlighted and unmarked as stale, beneath a large green Connected
tile. The operator must read a timestamp and do arithmetic to find out the
headline is wrong.
* The failure THOR did report was the DOWNLOAD, not the poller stopping. The
two are treated as unrelated; nothing states that automatic checking ceased.
So the state is not merely undisplayed: THOR holds the data that would reveal it
and presents a contradicting summary instead.
Adds design consequence 0, ahead of the others because it is the highest-value
fix and the cheapest: connection status must EXPIRE. If the last successful
check is older than a small multiple of the interval, the state is stale/unknown,
never Connected. THOR already has the timestamp; it just does not let it
invalidate the summary.
Same screen independently corroborates four of our decodes: memory 14.94/15.00 MB
against the exact 15,000,000-byte total from SUB 0x1C; Unit Date/Time 01:04:20 PM
against the device clock at 0x1C data[13:21]; Scheduler Enabled against 0x47; and
Auto Call Home Disabled against the write[5]=0x04 observed in the 0x7E capture.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
eccd28ea0d |
docs(series4): "not polling" and "unreachable" are different states
Follow-up to the reproduced wedge, and the sharpest point to come out of it --
the operator's observation, demonstrated directly.
At 13:10:44, six and a half minutes after THOR's last connection of any kind:
THOR connections since 13:04:22 : 0
independent POLL through the same relay, same moment : succeeds
The unit is reachable. The link is fine. THOR is simply not asking.
So whatever THOR's UI reports in that window is wrong. "Connected/OK" is false
because nothing has been checked for minutes. "Disconnected/unreachable" is also
false because the unit answers on demand. The true state -- "I have given up
checking this unit" -- is not one THOR can display.
An operator therefore cannot separate "the unit is down" from "the poller is
asleep", and those demand completely different responses: a site visit versus a
mouse click.
This settles a question the previous commit left open. It does not matter much
whether stopping after one retry is intentional or a defect: the reporting is
wrong either way, since both plausible displays misrepresent reality.
Sharpens design consequence 4 accordingly -- a unit's displayed state should be
one of: checks passing, checks failing (with attempt count and last error), or
not being checked (with why, and a way to resume). Collapsing the last two into
a single indicator is the root of this failure being undiagnosable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
04b1ef3e04 |
docs(series4): REPRODUCED -- THOR stops polling after a drop mid-download
The field failure on UM12947 ("wouldn't stay connected, refresh did nothing, no
way to view a connection attempt") reproduced on the bench, with timestamps.
THOR was mid-bulk-download when the link was faulted. Sequence:
13:02:50 connection dies mid-transfer (165 BULK_DOWNLOAD frames in)
13:03:10 THOR reconnects once after 20 s, sends SUB_1F to resume, fails
13:03:33 link fully restored and healthy
13:04:21 operator clicks Refresh -> full 11-command check, all correct
13:06:27 still nothing. That refresh is the ONLY connection since 13:03:10.
Before the fault THOR had connected every 30 s without a miss for over an hour.
Establishes four things:
* one retry then give up -- no backoff, no further attempts
* the automatic poll loop dies too, not just the download
* it does not recover when the link returns (3 min of healthy link, nothing)
* Refresh works but only once -- it does NOT restart the automatic loop
The fourth is the dangerous one: Refresh makes the UI report a healthy unit while
nothing is watching it. Silent failure that looks like success. It also explains
why the field symptom resists characterisation -- the unit is reachable the whole
time; THOR has simply stopped asking and says nothing about it.
CAVEAT, recorded prominently: what THOR experienced was a TCP close mid-download,
not the silent link intended. mm_link.py mistook socket.timeout (which subclasses
OSError) for a closed socket, so 200 ms of quiet closed the connection -- the
relay killed the link it was meant to be faking a fault on. Fixed in this commit.
The run stands as a drop-mid-download test, arguably the more realistic case.
Single trial; true blackhole and clean drop not yet tested.
Adds four design consequences for SFM: unbounded retry with backoff; a manual
check must restart the automatic loop or the UI must say it is stopped; surface
the poll loop's own state (last success, last attempt, next attempt, consecutive
failures -- all four invisible here); and distinguish "unit unreachable" from "we
stopped checking", which present identically in THOR.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
f1215ef9d9 |
docs(series4): REFUTE the half-period theory -- the connection dial sets a count
The prediction was sharp and it was wrong. I hypothesised the connection check
ran at half the status period, predicting 30 s when status is set to 60 s.
Measured: 60.5 s. Recorded rather than quietly deleted.
Three configurations now measured, each over many cycles:
status 10 / conn 10 -> status 10.1 s conn: none ever ran 0 per cycle
status 30 / conn 10 -> status 30.4 s conn 15.2 s 2 per cycle
status 60 / conn 30 -> status 60.5 s conn 60.5 s 1 per cycle
The status dial is honoured in all three, within ~1%. The connection dial is
honoured in none. What holds across all three is a count, not a period:
separate connection checks per status cycle = (status / connection) - 1
Consequences: setting the two dials equal yields ZERO connection checks, so every
connection is the expensive eleven-command status read -- and that is the
configuration that looks like the default. "Every 30 s" with status at 60 s
gives one check per minute, half the advertised rate. No simple scale factor
describes the observed cadences either (10 -> 15.2, 30 -> 60.5).
Still unexplained: the phase within a cycle. At status 30 / conn 10 the two short
checks landed at T+10.1 and T+25.3 where an evenly divided cycle would put them at
T+10 and T+20. The count rule holds; the phase does not follow from it.
Also adds a traffic table across the three configurations: 563 MB/month at
10 s/10 s, 147 MB/month at the current 60 s/30 s, against 9 MB/month for a
POLL + MONITOR_STATUS check at 60 s.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
61e8a5e220 |
docs(series4): two poll checks, and only the status dial is honoured
Corrects the previous commit. It claimed both intervals were set to 5 s, taken
from a screenshot that turned out to predate the operator's change -- they were at
10 s. The "setting + 5 s" pattern I inferred from that does not survive, and is
removed.
What a longer capture with asymmetric intervals (connection 10 s, status 30 s)
actually shows:
There are TWO distinct checks, not one. The eleven-command sequence is the
status check; there is also a three-command connection check, POLL -> SERIAL ->
0x49.
With both dials EQUAL the connection check never runs separately at all -- every
connection observed was the full eleven commands. It only appears once the
intervals differ. That alone explains much of "changing the settings does
nothing": at equal values you only ever get the expensive one.
Steady state over 14 consecutive cycles:
FULL at T short at T+10.1
short at T+25.3 FULL at T+30.4
status check set 30 s -> observed 30.4 s honoured
connection check set 10 s -> observed 15.2 s 52% slow
27 consecutive connection-check gaps, all 15.1-15.3 s. Systematic, not jitter.
15.2 s is exactly half of 30.4 s and the two are phase-locked 2:1, suggesting the
connection check runs at half the STATUS period rather than on its own setting.
Flagged as a hypothesis with a sharp prediction: at status 60 s the connection
check should land at 30 s whatever its dial says. Worth settling before SFM
offers a similar control -- a dial that silently does nothing is worse than no
dial.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
d522d31d63 |
docs(series4): what THOR's "status check" actually is -- 11 commands, 563 MB/month
First capture through bridges/mm_link.py, with THOR polling a unit over the bench
link at "check connection every 5 s / check status every 5 s".
A status check is ELEVEN commands, not one:
POLL -> DEVICE_INFO -> 0x49 -> 0x5C -> MONITOR_STATUS -> SETUP_NAME_READ
-> STORAGE_RANGE -> 0x02 -> OPERATOR -> 0x47 -> CALLHOME_CFG
Each check opens a NEW TCP connection, runs all eleven exchanges in ~300 ms and
closes it. Measured over 21 consecutive checks: 236 B out, 936 B back, plus a
full handshake each time -- about 2.2 KB per check.
At the observed cadence that is 18.8 MB/day, 563 MB/month, per unit. On a
metered cellular plan that is real money, and most of it is waste: the check
re-reads the call-home config, operator name, active setup name and full device
info every ten seconds, none of which changes. SETUP_NAME_READ alone returns 274
bytes a time. POLL + MONITOR_STATUS answers "alive?" and "monitoring?" in two
commands and 131 bytes.
Both intervals set to 5 s yields one combined pass every 10.1 s, steady across
eight measured connections. So the two settings are not independent 5-second
timers, which is a plausible reason changing them appears to do nothing.
REVISES an earlier hypothesis. Because idle polling reconnects every cycle, a
silently-dead link is LESS dangerous while idle than I assumed -- a dead socket
fails at connect and the next cycle retries. The exposure is during OPERATIONS:
THOR held one connection from 00:30 to 00:47 last night while downloading events
and pushing setups. A link dying mid-operation leaves it waiting on a socket the
OS will not fail for ~2 h. The blackhole test should therefore be run during a
download, not while idle.
Also fixes a mislabel in mm_link.py: the SUB byte is DLE-escaped when its value is
0x02/0x03/0x04/0x10, so reading it raw reported SUB 0x02 as "SUB_10".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|
||
|
|
96a8831472 |
docs(series4): pin down what the ACH config's volatile field is NOT
Followed up the write[118:120] field flagged in the previous commit. A third
sample plus a brute-force sweep rules out most of the obvious explanations.
Samples: 43 23 at 00:50 (idle), still 43 23 at 01:16 twenty-six minutes later,
then 2e 5e after a config write. Thor echoes back whatever it last read --
including a value that no longer matches the config it is sending -- and the
write is accepted regardless.
Ruled out:
* a clock or timer -- identical across 26 minutes of idle; only a write moved it
* a counter -- it decreased, 17187 -> 11870
* computed by Thor -- Thor demonstrably sends a stale value
* a standard CRC16 -- swept all 65,536 polynomials x init {0x0000,0xFFFF} x all
four reflection combinations over four candidate regions.
No match. Recorded so the sweep is not repeated.
It behaves like a unit-computed hash: a one-byte input change scattered the output
(XOR 0x6D7D) where a sum would move by 1. But two samples cannot separate that
from a nonce regenerated per write.
Operationally it does not matter, which is the point: the unit does not validate
the field on input, so read-modify-write with the rest of the block echoed
verbatim is provably safe. Never synthesise or zero it.
Notes what would resolve it -- several config writes with times recorded, cheap to
collect during any future ACH capture.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ru8Lg9HkkYvX9VWWo65SmL
|