3 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 7c010e42a4 docs(claude): leave the next config step written down -- load a setup and diff it
Brian's hypothesis from the end of the 10-17 pass: selecting a .MMB
repopulates the active config, so a single load moves every field that
differs between two setups -- a check of the whole map in one step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-17 02:41:13 -04:00
serversdownandClaude Opus 5.5 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
2026-10-17 02:22:00 -04:00
serversdownandClaude Opus 5.5 75cbe23214 fix(micromate): config watcher no longer overwrites the previous session -- and checks the 0x1A CRC
`watch` saved every session as `watch-000..NNN`, so each run silently
overwrote the last.  Harmless while those snapshots were clock ticks; data
loss once they were findings.  Labels now default to `watch-MMDD-HHMM-NNN`
(`--prefix` overrides).

Each 0x1A change also prints its trailer check: CRC-16/AUG-CCITT over
content[0:2088], stored BE at content[2090:2092].  Measured on 47/47
snapshots of UM20147 plus UM12947's 9-24 capture; a mismatch means a short
or corrupt read, or a layout this does not assume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-17 02:22:00 -04:00
4 changed files with 261 additions and 36 deletions

No files matched your search

+43 -28
View File
@@ -10,7 +10,7 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as
--- ---
## Where things stand (updated 2026-10-14) ## Where things stand (updated 2026-10-17)
Read this first when picking the project back up. Read this first when picking the project back up.
@@ -40,33 +40,48 @@ Read this first when picking the project back up.
about a dozen fields read; `0x2C`, `0x2E`, `0x08`, `0x01` are fetched and about a dozen fields read; `0x2C`, `0x2E`, `0x08`, `0x01` are fetched and
undecoded. Finishing it needs a bench session varying one setting at a time, undecoded. Finishing it needs a bench session varying one setting at a time,
as was done for Series III — not desk work. as was done for Series III — not desk work.
- **Config decoding is set up and waiting on ONE keypad press (2026-10-15).** - **Config decoding: first keypad pass done (2026-10-17).** 47 snapshots of
`scratch/mm_config_diff.py` is the loop — read-only, four subcommands UM20147 while settings were changed on its keypad; every byte that moved is
(`volatile` / `snap` / `watch` / `diff`). Baseline and the noise mask are accounted for. `0x1A` content now reads: record mode `[5]` (`01` Waveform,
saved under `scratch/mm_config_snaps/UM20147/` (gitignored). `02` Manual, `03` Histogram, `04` Combo), sample rate `[6:8]`, histogram
**The method is verified viable: all five config blocks are bit-stable** interval `[8:10]` s, pre-trigger `[12:16]` f32 **negative** s, stop mode
(0 bytes moved across repeated reads), so any byte that changes between two `[17]`, record time `[18:22]` f32, auto-stop `[23]`, active-sensor and
snapshots *is* the setting — no noise floor to subtract. That was the open trigger-source bitmasks `[25]` / `[29]` (`0x07` geo, `0x08` mic), trigger
question. level at channel `+30` (geo in/s, mic **psi**). Full table, grades and
**Start here:** run `watch`, change exactly one setting on the unit's keypad, method in `docs/micromate_protocol_reference.md` → *The `0x1A` field map
and it prints the changed runs with content-relative offsets and each from a keypad pass*.
plausible field type. **Sample rate first** — a large distinctive power of two 🔑 **`0x1A` ends in a CRC-16/AUG-CCITT** over `content[0:2088]`, stored BE at
pins endianness in one shot where a boolean toggle teaches nothing. `[2090:2092]` — 47/47 plus a second unit. Thor's write **omits** it (the
⚠ Settings do **not** have to be changed from THOR. The unit's own keypad unit computes it), so it is a read-side integrity check, not a write
works: no Windows VM, and no contending for the modem's single TCP session. obligation. Not yet wired into `micromate/`.
⚠ `sg dialout -c "..."` is needed to open `/dev/ttyACM0` — the `dialout` ⚠ **The six channel blocks are 3 geophones + the active mic (block 4) + the
membership is in `/etc/group` but shells started before it was added do not stored linear / sound-level mic setups (5, 6).** Read the mic from block 4
see it, and the failure looks like a dead unit. and branch on its `+4:8` code (`2` linear, `9` SLM); labels and unit strings
⚠ `watch-001`..`005` in the snapshot dir are **clock ticks, not findings** — are re-rendered by keypad saves and are not identifiers.
taken before the mask covered the minutes byte. ⚠ **`0x1A` reads the keypad's edit buffer live** — unsaved values show while
🔑 **`channel+24` (f32 BE) reads `3.1030800342559814` on every geo channel.** someone is in the menu; a discard reverts them.
Over 10,000 that is `_GEO_LSB_IPS` to 1.1e-8, and it implies 32,226.05 counts 🔶 **Possible Series III bug, inferred only:** S3's 6-byte "stable anchor"
full scale — the documented figure exactly. The LSB previously rested only on `be 80 00 00 00 00` sits exactly where Series IV keeps pre-trigger (−0.25 s)
intersecting 991,415 rounding constraints from Thor's exports; **the unit + stop mode (Fixed). An S3 unit in Auto stop mode would then lose the
reports it directly.** Two independent derivations, eight digits. anchor and decode no mode / rate / interval / record time. One BW capture
⚠ The rest of the channel-block map in the reference is **graded** — one in Auto mode settles it — see the 2026-10-17 row in
measured, two inferred, two explicitly flagged as guesses. Respect the grades; `instantel_protocol_reference.md`.
`+4` "channel type" and the `+8:24` uint16 split are single-setup guesses. Harness: `scratch/mm_config_diff.py watch` (now per-session snapshot labels
and a built-in CRC check). ⚠ `sg dialout -c "..."` is still needed to open
`/dev/ttyACM0` from shells started before the `dialout` membership.
⚠ **When diffing, get the operator's own account of what was pressed** before
labelling a run — twice on 10-17 a run was attributed to the setting that
had been *asked for*, and both were wrong.
Not yet mapped: job number, scaled distance, GPS, aux I/O, SLM options,
four unknown head runs, channel `+46:48`.
**Start here next: load a different setup and diff it.** Brian's
hypothesis: selecting a `.MMB` repopulates the active config, so every
field that differs between the two setups moves at once. Any run that
doesn't land on a mapped field or a text field is an unmapped field, so one
load checks the whole map. Use two setups with *known* differences.
Inferred prediction: the `.MMB` *is* the block (Thor's `0x71` body is 91%
identical to the `0x1A` read), so the trailer after a load should be the
file's own CRC.
- **🔑 ACH / call-home, captured end to end (2026-10-14).** A Micromate signals - **🔑 ACH / call-home, captured end to end (2026-10-14).** A Micromate signals
`RADIO RING`; **two paths exist and timing decides which**: if anything `RADIO RING`; **two paths exist and timing decides which**: if anything
already holds the modem's single TCP session the ring rides that connection, already holds the modem's single TCP session the ring rides that connection,
+9
View File
@@ -11,6 +11,7 @@
| Date | Section | Change | | Date | Section | Change |
|---|---|---| |---|---|---|
| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. |
| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. | | 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. |
| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. | | 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. |
| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). | | 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). |
@@ -702,6 +703,14 @@ the anchor).
> reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant. > reconfigured (e.g. 15 min = `\x03\x84`). Only the 6-byte suffix is constant.
> Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`. > Code in `client.py` uses `buf.find(b'\xbe\x80\x00\x00\x00\x00', 0, 150)`.
> 🔶 **2026-10-17 — the 6-byte suffix may not be constant either (INFERRED from Series IV).**
> On a Micromate the same position holds `[pre-trigger f32 BE, negative seconds][record stop mode]`,
> measured setting by setting: `be 80 00 00` = −0.25 s, and `00 00` = Fixed (Auto reads `00 01`).
> Every S3 unit this anchor was confirmed on would have been at those defaults. If S3 shares the layout,
> a unit in **Record Stop Mode = Auto** returns `be 80 00 00 00 01`, `find()` returns −1, and the four
> anchor-relative fields silently go undecoded. **Not yet measured on S3** — one BW capture in Auto
> mode settles it. Until then, treat a missing anchor as this, not as DLE jitter.
> ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the > ✅ **2026-04-02 — CORRECTED:** Search range was `cfg[40:100]`. With the
> compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental > compliance-config orphaned-send bug fixed (§7.6.2), the 44-byte accidental
> header padding is gone and the anchor now appears at `cfg[11]`. Search range > header padding is gone and the anchor now appears at `cfg[11]`. Search range
+168
View File
@@ -1292,12 +1292,25 @@ residual is S3's rounded display value, not a real difference).
- that `+46:48` is a per-channel enable or trigger-source flag. It is the only - that `+46:48` is a per-channel enable or trigger-source flag. It is the only
byte separating three otherwise identical blocks, which is suggestive and byte separating three otherwise identical blocks, which is suggestive and
nothing more. nothing more.
> ⚠ **2026-10-17: not trigger source, and not enable.** Trigger sources are a
> bitmask at `content[29]` and active sensors one at `content[25]`; neither
> change moved `+46:48`, nor did anything else in a 47-snapshot pass. Its
> purpose is unknown.
**GUESSED — do not build on these:** **GUESSED — do not build on these:**
- `+4` as a uint32 "channel type" (reads 1 / 1 / 1 / 2 / 2 / 9 across the six). - `+4` as a uint32 "channel type" (reads 1 / 1 / 1 / 2 / 2 / 9 across the six).
Six observations from a single setup, correlating with channel kind. That is Six observations from a single setup, correlating with channel kind. That is
the entire basis. the entire basis.
> ✅ **2026-10-17: promoted, with one asymmetry.** Switching Mic Type to Sound
> Level rewrote block 4's code `2 → 9` and nothing else in the config moved, so
> the mic type has no byte of its own: this field *is* it. Geophone blocks
> read `0` while the geophones are deactivated. ⚠ Deactivating the mic did
> **not** zero block 4's code. See *The `0x1A` field map from a keypad pass*.
- ⚠ **2026-10-17: "six channels" is itself wrong.** Blocks 1–3 are the
geophones, **block 4 is the active mic**, and blocks 5 and 6 are the stored
settings of the linear and sound-level mic respectively. `LMic` and `SMic`
are not channels.
- `+8:24` as eight uint16 BE values. Geo reads 74, 10, 40, 21, 1275, 525, 3, 0; - `+8:24` as eight uint16 BE values. Geo reads 74, 10, 40, 21, 1275, 525, 3, 0;
mic reads 200, 50, 10, 10, 1500, 500, 5, 0. Field boundaries unverified — the mic reads 200, 50, 10, 10, 1500, 500, 5, 0. Field boundaries unverified — the
uint16 split is an assumption, not a reading. uint16 split is an assumption, not a reading.
@@ -1306,6 +1319,161 @@ residual is S3's rounded display value, not a real difference).
see which of these offsets moves. A field whose purpose is guessed and which see which of these offsets moves. A field whose purpose is guessed and which
never moves when the matching setting changes is simply wrong. never moves when the matching setting changes is simply wrong.
### The `0x1A` field map from a keypad pass (UM20147, 2026-10-17)
Method: `scratch/mm_config_diff.py watch` polling all six blocks every 2 s while
settings were changed on the unit's **own keypad**, one at a time. **47
snapshots. Every byte that moved is accounted for by a named setting, and
nothing outside `0x1A` moved at all.** Snapshots:
`scratch/mm_config_snaps/UM20147/s1017-watch-*` and `watch-1017-0150-*`.
⚠ **Grades.** "Measured" below means: the operator named the setting and its
before/after value, and the bytes moved accordingly. Two attributions made
*before* the operator confirmed what was pressed were wrong, and were retracted
in the session — the mode enum and the sensors mask both briefly carried the
wrong label. A diff tells you which bytes moved, never which setting moved them.
Offsets are into **content** (`data[11:]`, 2,092 bytes).
| offset | field | encoding | grade |
|---|---|---|---|
| `[0:2]` | length echo, `0x082a` = 2090 = content minus the CRC | u16 BE | inferred (arithmetic); Thor zeroes it on write |
| `[2:5]` | `64 00 00` | — | unknown, never moved |
| `[5]` | **record mode** | `01` Waveform · `02` Waveform Manual · `03` Histogram · `04` Histogram Combo | **measured**, all four, screen-confirmed |
| `[6:8]` | **sample rate**, sps | u16 BE | **measured** (1024 → 2048) |
| `[8:10]` | **histogram interval**, seconds | u16 BE | **measured** (2…11, 30, 300; `01 2c` settles the width) |
| `[10:12]` | `00 00` | — | unknown, never moved |
| `[12:16]` | **pre-trigger**, *negative* seconds | f32 BE | **measured**, all four: `be80`=−0.25 `bf00`=−0.5 `bf40`=−0.75 `bf80`=−1.0 |
| `[17]` | **record stop mode** | `00` Fixed · `01` Auto Record | **measured**; u8 vs u16 BE `[16:18]` unresolved |
| `[18:22]` | **record time**, seconds | f32 BE | **measured** (10 → 11) |
| `[23]` | **auto stop after**, seconds | u8 (or u16 BE `[22:24]`) | **measured** (3 → 1) |
| `[25]` | **active sensors** | bitmask: `0x07` geophones, `0x08` mic | **measured**, all three options |
| `[26:28]` | `05 3f` | — | unknown, never moved |
| `[29]` | **trigger sources** | same bits as `[25]` | **measured**, both directions; mic bit screen-confirmed |
| `[2090:2092]` | **CRC** | see below | **measured**, 47/47 + a second unit |
Mode enum ⚠: the **menu** order is Histogram → Combo → Waveform → Manual
(`03 04 01 02`), so the screen order is not the encoding. The values match
Series III's (`01` Continuous, `03` Histogram, `04` Histogram+Continuous) —
**the byte sits one position later than the S3 analogy predicted**, the
encoding does not differ. There is no Single Shot (S3 `00`).
A framing question, answered in passing: `0x03` is ETX, and it
appeared as a literal value twice (record mode `03`, interval 3 s). The block
stayed 2,103 bytes both times — **the Series-4 read path destuffs an escaped
ETX correctly**, which is exactly the case that shifted every later field by
one on Series III.
#### The channel blocks are 3 geophones, 1 active mic, and 2 stored mic setups
`content[1708] + 48n`. The 10-15 section above called these six channels;
**they are not**:
| block | role |
|---|---|
| 1–3 | Tran, Vert, Long |
| **4** | **the active microphone** — a byte-for-byte copy of block 5 or 6 |
| 5 | the linear-mic settings, kept while not selected |
| 6 | the sound-level-mic settings, kept while not selected |
**Measured:** Mic Type → Sound Level copied block 6 into block 4 byte-for-byte;
→ Linear copied block 5 back, **carrying a 140 dB trigger set while Linear was
active** — so block 5 is a store, not a template. Nothing else in the config
moved: **there is no separate mic-type byte**; block 4's `+4:8` code (`2`
linear, `9` sound level) *is* the type.
⚠ **For a decoder: read the mic from block 4 only, and branch on its code.**
Blocks 5 and 6 are the settings of whichever mic is *not* fitted; decoding
either as a channel reports a sensor that is not there.
| offset | field | grade |
|---|---|---|
| `+4:8` | sensor code: `1` geophone, `2` linear mic, `9` sound-level mic, `0` geophone deactivated | measured; ⚠ deactivating the mic left block 4 at `2` |
| `+30` | **trigger level**, f32 BE — geophones **in/s**; mic **psi**, whatever the display unit | **measured** (geo 0.5 → 0.6; mic 131 → 140 dB) |
The keypad has **one** geophone trigger level and writes it to all three blocks;
the per-channel slots exist (Thor may set them separately — untested). A mic
trigger edit writes block 4 **and** its store (block 5).
Mic trigger: `0.0102915 psi` → 70.957 Pa → **130.999 dB** re 20 µPa (screen: 131);
`0.0290064 psi` → **139.9997 dB** (screen: 140). **Reading is solved.** ⚠
**Writing is not:** the textbook conversion of 140 dB is `0.0290075`, 617 ULPs
away, and the implied Pa/psi differs between the two values (6895.29 vs
6895.03), so the firmware's dB → psi rule is not a single constant. A writer
cannot byte-match it yet.
#### Labels and unit strings are cosmetic — keypad saves re-render them
- Block 5's label went `LMic` → `Mic` on a **geophone** trigger-level save.
- All three geophone unit strings went `in.` / `/s.` → `in` / `/s` when Active
Sensors changed. **One-way**: re-activating did not restore the dots.
The same setup reads differently after Thor wrote it and after the keypad saved
it. **Key channels on block position and the `+4:8` code, never on a string.**
Why some saves re-render and others do not is unknown (inferred: the firmware
rebuilds whatever blocks the edited screen owns, in its own spelling).
#### The CRC
```
CRC-16/AUG-CCITT poly 0x1021, init 0x1D0F, refin/refout false, xorout 0
over content[0:2088] (content[2088:2090] = 00 00 is NOT covered)
stored big-endian at content[2090:2092]
```
Identified from a single sample-rate diff by testing all 65,536 polynomials
against `crc(a) ⊕ crc(b)` (linearity makes the range start irrelevant), then
confirmed on absolute values. `0x1021` was the only catalogued polynomial among
~30 chance hits. Equivalent forms — CCITT-FALSE (`init 0xFFFF`) over two zero
bytes plus the content — are the same algorithm; leading zeros only move the
effective init. **Verified: 47/47 snapshots on UM20147, every state predicted
before comparing, and UM12947's 9-24 read (`3cfd`), a different unit and setup.**
Revisiting a state reproduces its trailer exactly — no counter in the block.
⚠ **A writer does not send it.** Thor's `0x71` data is `content[0:2090]`
(aligns at shift 0, 1902/2090 equal) — it stops before the CRC and zeroes the
length echo. The unit computes both. **Its use is read-side integrity:** every
`0x1A` read can now check itself, which on a codec repeatedly bitten by silently
short data is the cheap guard worth wiring in.
#### `0x1A` reads the keypad's EDIT BUFFER, live
**Measured, two independent tests:** a scrolled-to, unsaved record mode appeared
in `0x1A` immediately; backing out with *discard* restored it. A second discard
reverted **two fields at once** (mode and an interval changed 13 times) to a
block byte-identical to the last saved state. Pressing *save* moved no byte.
When an edit reaches the buffer depends on the widget — **measured** per widget:
| widget | reaches `0x1A` | seen on |
|---|---|---|
| list | on **every scroll step** | record mode, active sensors, mic type |
| spinner popup | on **Enter** | histogram interval |
| sub-window | only on back-out → **save to setup file** | Record Time window (pre-trigger, stop mode, auto stop) |
A fast list scroll can pass a value inside one poll; the watcher then never sees
it (Histogram was skipped once). Pause on each value.
⚠ **Consequence:** a `0x1A` read taken while someone is in the setup menu
returns values that may never be committed — and may differ from the `.MMB` file
of the same name. Rare in the field; worth one line wherever SFM reports a
unit's config.
#### Negative results
- **`0x2E` never moved** — not under trigger level, trigger enable, or anything
else. Whatever "trigger" config it holds, these settings are not it.
- `0x08`, `0x01`, `0x2C` never moved. The bit-stability also holds across days:
the 10-17 baseline was byte-identical to 10-15's.
#### Not yet mapped
Location / Client / Company / Notes (already mapped from Thor's 9-24 write —
not re-checked here), Job Number, Scaled Distance, GPS, Aux I/O, the sound-level
mic's own options (response, weighting, LN1/LN2 — SMic `+8:24` holds `10, 90`,
the manual's example LN1/LN2, **guessed**), the four unknown head runs above,
and `+46:48`.
## The write path — observed end to end (2026-09-24) ## The write path — observed end to end (2026-09-24)
⚠ **We have still never sent a write command to a unit.** Thor did every write ⚠ **We have still never sent a write command to a unit.** Thor did every write
+41 -8
View File
@@ -138,6 +138,30 @@ def _interps(a: bytes, b: bytes, off: int, run: int) -> list[str]:
return out return out
def crc16_aug_ccitt(data: bytes) -> int:
"""CRC-16/AUG-CCITT: poly 0x1021, init 0x1D0F, no reflection, xorout 0."""
c = 0x1D0F
for x in data:
c ^= x << 8
for _ in range(8):
c = ((c << 1) ^ 0x1021) & 0xFFFF if c & 0x8000 else (c << 1) & 0xFFFF
return c
def crc_status_1a(raw: bytes) -> str:
"""Check 0x1A's trailer: CRC over content[0:2088], stored BE at [2090:2092].
Found 2026-10-17 from one keypad diff and confirmed on 23 snapshots plus
UM12947's 9-24 capture. A mismatch means a short or corrupt read -- or
that the layout is not what this assumes, which is worth knowing too.
"""
c = raw[CONTENT:]
if len(c) < 2092:
return f"CRC n/a (content {len(c)} B < 2092)"
want, got = crc16_aug_ccitt(c[:2088]), int.from_bytes(c[2090:2092], "big")
return f"CRC ok ({got:04x})" if want == got else f"CRC MISMATCH computed {want:04x}, stored {got:04x}"
def _runs(a: bytes, b: bytes, ignore: set[int]) -> list[tuple[int, int]]: def _runs(a: bytes, b: bytes, ignore: set[int]) -> list[tuple[int, int]]:
"""Contiguous runs of differing offsets, skipping known-volatile ones.""" """Contiguous runs of differing offsets, skipping known-volatile ones."""
diff = [i for i in range(min(len(a), len(b))) diff = [i for i in range(min(len(a), len(b)))
@@ -226,15 +250,21 @@ def cmd_diff(serial: str, a_label: str, b_label: str) -> None:
def cmd_watch(mm: MicromateClient, serial: str, interval: float, def cmd_watch(mm: MicromateClient, serial: str, interval: float,
duration: float) -> None: duration: float, prefix: str | None = None) -> None:
"""Poll the config blocks and report each change as it lands. """Poll the config blocks and report each change as it lands.
A round trip per setting means walking to the unit and back for every A round trip per setting means walking to the unit and back for every
field. This instead lets one person stand at the keypad changing settings field. This instead lets one person stand at the keypad changing settings
one at a time while every change is timestamped here, so a whole session is one at a time while every change is timestamped here, so a whole session is
one pass. Each distinct state is also saved as `watch-NNN`, so the one pass. Each distinct state is also saved as `<prefix>-NNN`, so the
sequence can be re-diffed offline afterwards without the unit. sequence can be re-diffed offline afterwards without the unit.
The prefix defaults to `watch-MMDD-HHMM`, i.e. one per session. It used to
be a fixed `watch-`, so every run silently overwrote the previous run's
snapshots -- harmless while they were clock ticks, data loss once they
were findings.
""" """
prefix = prefix or time.strftime("watch-%m%d-%H%M")
vpath = SNAP_ROOT / serial / "volatile.json" vpath = SNAP_ROOT / serial / "volatile.json"
vol = json.loads(vpath.read_text()) if vpath.is_file() else {} vol = json.loads(vpath.read_text()) if vpath.is_file() else {}
if not vol: if not vol:
@@ -243,11 +273,11 @@ def cmd_watch(mm: MicromateClient, serial: str, interval: float,
print(f"watching every {interval:g}s" print(f"watching every {interval:g}s"
+ (f" for {duration:g}s" if duration else " until Ctrl-C")) + (f" for {duration:g}s" if duration else " until Ctrl-C"))
print("change ONE setting at a time on the unit's keypad; each change is") print("change ONE setting at a time on the unit's keypad; each change is")
print("timestamped below and saved as watch-NNN.\n") print(f"timestamped below and saved as {prefix}-NNN.\n")
prev = read_all(mm) prev = read_all(mm)
save(serial, "watch-000", prev) save(serial, f"{prefix}-000", prev)
print(f"[{time.strftime('%H:%M:%S')}] baseline captured (watch-000)") print(f"[{time.strftime('%H:%M:%S')}] baseline captured ({prefix}-000)")
for k, v in sorted(prev.items()): for k, v in sorted(prev.items()):
print(f" {k:20s} {len(v):5d} B") print(f" {k:20s} {len(v):5d} B")
print() print()
@@ -270,7 +300,7 @@ def cmd_watch(mm: MicromateClient, serial: str, interval: float,
if not hits: if not hits:
continue continue
n += 1 n += 1
label = f"watch-{n:03d}" label = f"{prefix}-{n:03d}"
save(serial, label, cur) save(serial, label, cur)
print(f"[{time.strftime('%H:%M:%S')}] CHANGE #{n} ({label})") print(f"[{time.strftime('%H:%M:%S')}] CHANGE #{n} ({label})")
for name, runs, la, lb in hits: for name, runs, la, lb in hits:
@@ -284,11 +314,13 @@ def cmd_watch(mm: MicromateClient, serial: str, interval: float,
f"{a[off:off + run].hex()} -> {b[off:off + run].hex()}") f"{a[off:off + run].hex()} -> {b[off:off + run].hex()}")
for line in _interps(a, b, off, run): for line in _interps(a, b, off, run):
print(f" {line}") print(f" {line}")
if name == "1A_compliance":
print(f" {crc_status_1a(cur[name])}")
print(flush=True) print(flush=True)
prev = cur prev = cur
except KeyboardInterrupt: except KeyboardInterrupt:
print("\nstopped.") print("\nstopped.")
print(f"{n} change(s) recorded; snapshots watch-000..watch-{n:03d} under") print(f"{n} change(s) recorded; snapshots {prefix}-000..{prefix}-{n:03d} under")
print(f" {SNAP_ROOT / serial}") print(f" {SNAP_ROOT / serial}")
@@ -305,6 +337,7 @@ def main() -> int:
w = sub.add_parser("watch", help="poll and report each change as it lands") w = sub.add_parser("watch", help="poll and report each change as it lands")
w.add_argument("--interval", type=float, default=2.0) w.add_argument("--interval", type=float, default=2.0)
w.add_argument("--duration", type=float, default=0.0, help="0 = until Ctrl-C") w.add_argument("--duration", type=float, default=0.0, help="0 = until Ctrl-C")
w.add_argument("--prefix", help="snapshot label prefix (default: watch-MMDD-HHMM)")
d = sub.add_parser("diff", help="diff two saved snapshots") d = sub.add_parser("diff", help="diff two saved snapshots")
d.add_argument("a") d.add_argument("a")
d.add_argument("b") d.add_argument("b")
@@ -334,7 +367,7 @@ def main() -> int:
elif a.cmd == "volatile": elif a.cmd == "volatile":
cmd_volatile(mm, serial, a.n) cmd_volatile(mm, serial, a.n)
elif a.cmd == "watch": elif a.cmd == "watch":
cmd_watch(mm, serial, a.interval, a.duration) cmd_watch(mm, serial, a.interval, a.duration, a.prefix)
elif a.cmd == "diff": elif a.cmd == "diff":
cmd_diff(serial, a.a, a.b) cmd_diff(serial, a.a, a.b)
finally: finally: