12 Commits
Author SHA1 Message Date
serversdown fb14a8f7bb Merge pull request 'Release v0.33.0 — SFM reads Series-3 events from the file alone' (#56) from dev into main
Reviewed-on: #56
2026-11-01 14:33:00 -05:00
serversdown e9c01ce8d4 Merge pull request 'Release v0.32.0 — event times you can trust, and Series 4 mapped' (#54) from dev into main
Reviewed-on: #54
2026-10-27 11:00:59 -04:00
serversdown d2258dad4e Merge pull request 'Release v0.31.0 — report parity + the inverted rescue (0.29.0 → 0.31.0)' (#40) from dev into main
Reviewed-on: #40
2026-09-18 16:46:41 -04:00
serversdown e050e602c2 Merge pull request 'Release v0.29.0 — offset detector + false_trigger_reason + BlastMate serials (0.27.0→0.29.0)' (#36) from dev into main
Reviewed-on: #36
2026-09-07 15:57:37 -04:00
serversdown fc1c7c7936 Merge pull request 'Docs/claude.md corrections' (#35) from dev into main
Reviewed-on: #35
2026-08-29 15:48:33 -04:00
serversdown 7d0d12079b Merge pull request 'v0.27.0 Decoder fixes, offset exploration and testing.' (#34) from dev into main
Reviewed-on: #34
2026-08-28 22:40:34 -04:00
serversdown 5203aab849 Merge pull request 'update to 0.26.0. Big chonking update including 0.23, 0.24, and 0.25 as well.' (#33) from dev into main
Reviewed-on: #33
2026-08-27 13:43:00 -04:00
serversdown 5b65718b72 Merge pull request 'v0.23.0 - ZC freq in events store' (#31) from dev into main
Reviewed-on: #31
2026-08-06 12:12:19 -04:00
serversdown 483762607e Merge pull request 'Update to v0.22.0' (#30) from dev into main
Reviewed-on: #30
2026-07-03 15:35:20 -04:00
serversdown d0b66368d5 Merge pull request 'update to v0.21.1, thor data import successful' (#29) from dev into main
Reviewed-on: #29
2026-06-01 16:54:23 -04:00
serversdown 2eb1d25028 Merge pull request 'v0.20.0 -- Full s3 event parse and PDF creation.' (#28) from dev into main
Reviewed-on: #28
2026-05-28 17:54:31 -04:00
claude cc821f9ee3 hotfix: fix dockerfile on main to fix import bug on prod 2026-05-21 20:42:15 +00:00
238 changed files with 11081 additions and 108569 deletions

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
# Line endings (2026-11-12): source and docs are stored and checked out with LF,
# whatever tool or OS wrote them. The protocol reference and seismo_lab.py were
# CRLF, so any rewrite outside the Edit tool turned them into whole-file diffs.
*.py text eol=lf
*.md text eol=lf
*.js text eol=lf
*.html text eol=lf
*.css text eol=lf
*.json text eol=lf
*.toml text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.csv text eol=lf
*.cfg text eol=lf
*.ini text eol=lf
# Test fixtures are recorded bytes -- Blastware's own reports and exports, unit
# captures, event files -- kept byte for byte as ground truth: never converted.
tests/fixtures/** -text
-728
View File
@@ -4,734 +4,6 @@ All notable changes to seismo-relay are documented here.
---
## Unreleased
### Added
- **ZC frequency, peak displacement and times of peak come from the unit's own
event summary** (group D, part 2 of the file-only decode;
`feat/waveform-zc-displacement`, merged 2026-11-06). Measured on DL2
2026-11-05.
- **Where they are:** every event file carries the unit's per-channel
summary right after its embedded event record. It is a chain of
`[length][id][payload]` records, ids `0x32`–`0x35`, each holding min, max,
peak sample, half-period and a displacement integral (reference D.6.12).
Blastware prints these values as they are.
- **ZC frequency** = (rate / 2) / half-period, on every record type. It
matches 25,966 / 25,966 waveform and 253,958 / 253,958 histogram channel
values, including the words (">100", "N/A", "<1.0"). Above range the value
is Blastware's threshold, flagged, as when it comes from a report.
- **Peak displacement** = half the integral (new
`PeakValues.*_peak_disp_in`): 19,479 / 19,479.
- **Times of peak and the vector-sum time** now come from the unit's peak
samples. They differ from the samples' own only on O117I1NK.R70W, whose
stored samples wrap at the trigger. Blastware's own sample table has the
same wrapped values.
- **Why recomputing failed:** from the samples, ZC frequency had matched 46%
and displacement 84%. The unit computes them at full resolution.
- **Peak acceleration** stays Blastware's own computation from the samples.
The unit stores its own largest step too (`[15:21]`, inferred), and
Blastware ignores it.
- **Decode checker:** 59 of 88 fields now match on every DL2 event, 47 before
group D (run `20261105-140021`, 0 regressions). Still open: O117I1NK's three
accelerations and S353I5PZ.EP0W's Vert acceleration.
- ⚠ **Operational:** codec change.
- The next release bumps `TOOL_VERSION`, then runs `backfill_sidecars.py`
and `backfill_event_shape.py`: about 8 h on the NAS (v0.34.0's took
13:13 → 21:16 on 2026-11-05).
- No schema change, no migration, and no stored time moves.
- **Report-less events gain a ZC frequency** in the existing `*_zc_freq` /
`*_zc_above_range` columns, so Terra-View shows a frequency where it
showed "—".
- Report-paired events keep the report's values, which are equal. A
report's "<1.0" still overlays as no value until the overlay is retired.
- Displacement and times of peak are not stored in the DB or `.h5` yet.
- **Sensor check results come from the unit's own records** (group E of the
file-only decode; `feat/sensor-check-results`, merged 2026-11-07). Measured
on DL2 2026-11-06.
- **Where they are:** the header of each sensor-check record (`0x3c` Tran ..
`0x3f` MicL), whose traces `minimateplus/sensor_check.py` already decoded
(reference D.6.13).
- **What it holds:** channel type, status, frequency × 10, ratio × 10 and
amplitude in mV.
- **Blastware prints them as they are:**
- 209,943 / 209,943 geophone frequencies and ratios
- 69,975 / 69,975 mic frequencies and amplitudes
- the result: "Passed" at status 0, "Check" at any other, "Disabled"
when the check is off
- **"Check" is the unit's own verdict.** K559L6N1's Tran is a Check at
8.1 Hz and 3.3, inside every passing range. SFM keeps the status code; its
bits are not decoded.
- New `Event.sensor_check_results`: channel → `SensorCheckResult`, with
`result`, `status`, `freq_hz`, `ratio` and `amplitude_mv`.
- **The tail of every event file is one record chain:** event record →
unit's summary → sensor checks → footer. It ends exactly at the file's end
on all 70,041 DL2 files.
- SFM now reads none of it unless it does.
- An unknown id inside an intact chain leaves only that record unread.
Before, it left everything after it unread too.
- **Decode checker:** 71 of 88 fields now match on every DL2 event, 59
before (run `20261106-125854`, 0 regressions). All 12 sensor-check fields
match on every event that has them.
- ⚠ **Operational:** codec change.
- Rides the next release's `TOOL_VERSION` bump and backfill with group D
part 2.
- No schema change and no migration.
- The results are on the decoded event only. They are not stored in the
DB, sidecar or `.h5` yet. Report-paired events keep the report's values
in the sidecar.
- **The Monitor Log line comes from the file's footer** (group F;
`feat/monitor-log`, merged 2026-11-09). Measured on DL2 2026-11-08.
- Blastware prints one line per event: the footer's start and stop, then
words for the footer's flag word `[18:20]` (reference D.6.14).
- The words: Event Recorded, then how the session ended — Keyboard, Remote
or Modem Exit, Timer Stop, Selfcheck Passed, Battery Low or Memory Full
Exit.
- Rebuilt that way it equals Blastware's line character for character on
69,983 / 69,983 DL2 lines.
- One line sets two session-end bits and prints the higher, so the order
of the others is inferred.
- Footer `[20:22]` is the trigger source again. `[24:26]` is still unknown.
- New `Event.monitor_log`: `MonitorLogLine(start, stop, flags,
description)`. It is read only when the record chain is whole, which
proves the footer.
- **Decode checker:** 72 of 88 fields now match on every DL2 event, 71
before (run `20261108-034313`, 0 regressions).
- ⚠ **Operational:** codec change. It rides the next release's
`TOOL_VERSION` bump and backfill. No schema change. The line is on the
decoded event only: not stored in the DB, sidecar or `.h5` yet.
- **Over range from the unit's own peaks: Blastware's `OORANGE`**
(`feat/decode-last-fields`, merged 2026-11-11; measured on DL2 2026-11-09;
reference D.6.15).
- **The rule:** a peak past full scale, 2,000 units (32,000 counts on
either geophone range; the mic in counts), is `OORANGE`. It holds per
channel and per histogram interval, from the unit's summary peaks, which
stay true where the stored samples clip or wrap.
- **The vector sum** is `OORANGE` exactly when a geophone is over: 43 / 43,
and never on its own (38 / 38 numeric, up to 14.49 in/s). That retracts
the open "vector sum alone" carve-out.
- **The report's "Out of Range" line** marks the mic over: 18 / 18.
- New `PeakValues.tran/vert/long/mic/pvs_over_range`, and
`event_file_io.over_full_scale()`.
- **Checker:** it matches `OORANGE` only by the flag, and a flag against a
printed number is a mismatch. The `saturation` carve-out now accepts no
DL2 event; it stays for a file without the unit's summary.
- **The checker reads each mic value in the unit Blastware printed.**
- The peak is read in its own `<Units>`, and a sample table by its cells
(a dB value is never under 60, psi never over 1). Blastware's event
`Units` line does not hold for the mic on every report.
- New carve-out `mic-units-mixed`, with evidence: a report that mixes dB
and psi in one mic column, or prints one unit in both mic columns of a
histogram row, is accepted when every differing cell is SFM's own value
in the other unit. 40 DL2 fields; a cell matching neither stays a
mismatch.
- **Decode checker:** **80 of 88 fields now match on every DL2 event**, 72
before (run `20261109-144544`, 0 regressions). What is left is 16 values
in two causes, left as they are by decision (Brian, 2026-11-11):
- the vector sum's last digit on 4 waveform/histogram twins: Blastware's is
about 1.5 ppm lower, cause unknown, and no fitted factor is applied;
- 4 accelerations: O117I1NK ×3 and S353I5PZ Vert.
- ⚠ **Operational:** codec change.
- It rides the next release's `TOOL_VERSION` bump and backfill.
- No schema change.
- The over-range flags are on the decoded event only: not stored in the
DB, sidecar or `.h5` yet.
### Fixed
- **The mic's own range: a range-1 mic reads an eighth.**
- The mic's channel block has a range byte at the geophones' offset
(label + 29). At `1` each count is 0.25 / 8 Pa.
- It is set on 7 DL2 events, and SFM read their mic 8× high, e.g.
K557J1XQ.GF0W: 79.4 dB(L), not 97.5.
- It is independent of the geophone range.
- New `Event.mic_range`.
- ⚠ **Operational:** after the next release's backfill those events' DB
`mic_ppv`, and their `.h5` mic samples, drop 8×. Report-paired events
keep the report's value.
- **The mic dB offset is 81.938216**, not 81.9384.
- Every count Blastware printed in DL2 (1,704 in sample tables, 520 in
histogram intervals, 494 histogram peaks) leaves
[81.9382058, 81.9382266].
- It fixes mic values one digit off at a rounding edge (count 463: 135.2,
not 135.3).
- Operational: dB is not stored. SFM's own reports change in the last
digit at most.
- **The test suite runs green, with 0 failures.** The 16 long-standing "known
failures" were two stale tests:
- 15 ASCII-report tests read from a removed `decode-re/` folder;
- 1 expected 0.0 where the decoder deliberately leaves peaks unknown.
A report-pairing test that the same stale path had been skipping now runs.
- **A unit without a mic keeps its sensor-check traces.** The trace decoder
required all four records `0x3c`–`0x3f`, so BE16352 (no `0x3f`) had none in
its `.h5`: all 8 of its DL2 events. Its three geophone traces are now decoded.
- ⚠ Operational: they appear after the next release's backfill.
- **The decode checker reads the mic's above-range ZC flag under its real name**
(`mic_zc_above_range`). A mic ">100" could never match before.
- **An escaped checksum is the checksum, not data (#58;
`fix/escaped-checksum`, merged 2026-11-12).** Measured on every recorded
Series-3 reply.
- **The bug:** a MiniMate sends a checksum of 02, 03 or 04 as `10 X`.
`S3FrameParser` kept that `10` as the reply's last data byte, so the reply
read one byte long.
- **The evidence:** 60 recordings, March to October 2026, three units.
SUM8 of the unescaped payload is the checksum on 7,747 / 7,747 replies;
272 arrived escaped, and every one checks as an escape pair.
- **What it misread:**
- live status (SUB 1C): battery and memory are counted from the end. 12 of
760 recorded status replies read 419.84 V and 251,654,656 bytes, for
6.76 V and 983,026;
- the call-home read (SUB 2C) came out one byte long, and SFM refused the
unit as "monitoring".
- The settings and waveform reads already took only what they asked for
(benched 2026-11-04); those trims stay as guards.
- **The 5A file builder had compensated since April.** With the parser
fixed, that rule would drop a real `0x10` ending a chunk (one A5 chunk in
ten ends in one), so it is removed. The 8 recorded BE9441 events still
build byte for byte as Blastware's own files.
- **`.a5.pkl` frames:** `A5_PICKLE_VERSION` 2. `load_a5` drops the stray
`0x10` from version-1 frames; all 28 pickles on the dev box rebuild
byte-identical.
- **`checksum_valid` now sums the unescaped payload**, and every recorded
reply checks. It had read about a third of good replies as bad; nothing
decides on it.
- Operational: none for stored events (prod's Series-3 events arrive through
`save_imported_bw`, which keeps no frames). No schema change, no
`TOOL_VERSION` bump, no backfill.
### Protocol / Documentation
- **Reference D.6.12 (new):**
- the unit's event summary: its layout, and what Blastware prints from it
- why recomputing failed
- the two odd 2019 files
- group D part 1 (time of peak, acceleration with the fitted g),
documented there too
- **Reference §7.8.9:** its "constant, meaning ❓" bytes amended in place. They
are the vector-sum peak's sample, then the next record's lead.
- **Reference D.6.11 and CLAUDE.md:** the 59 / 88 status. Leads for E: records
`0x3c` / `0x3d`, probably the sensor check. Leads for F: a waveform's
monitor log may be its event record's start and stop.
- **Reference D.2 and D.4.2, corrected in place:** an `.MLG` stores its dates
little-endian, and its record flags are the event footer's flag word and
trigger source, little-endian. Measured on the 4 bench `.MLG` files; a
BE9441 session lines up 20 / 20 with its event files. `write_mlg()` writes
dates big-endian; nothing calls it.
- **Reference D.6.14 (new):** the monitor log. **D.3.3:** footer `[18:24]`
identified: flags, trigger source and zero.
- **Reference D.6.13 (new):**
- the record chain to the footer
- the sensor-check header and what Blastware prints from it
- **Reference D.3.3:** the footer is the chain's last record (`00 1a`, id `0e`).
- **Reference D.6.12:** its "`0x3c` / `0x3d`, before and after" retracted in
place. It is one record per channel.
- **Reference D.6.15 (new):** over range.
- **Reference D.6.6, corrected in place:** the mic's range byte; the dB offset
(the old window was too high); Blastware's mic unit labels and the mixed
columns.
- **Reference D.3.3:** the footer's last two bytes are a CRC-16/AUG-CCITT (init
`0x1D0F`), big-endian, over the footer record from its length prefix `00 1a`
through footer `[0:22]`. It holds on 70,041 / 70,041 DL2 files. Found by the
`.MLG` session; it retracts 2026-11-08's "no common CRC-16 fits".
- **Reference D.6.11 and CLAUDE.md:** the 80 / 88 status, and the two causes
left by decision.
- **Reference D.6, "Reading a mismatch":** 256, 4,096 and 65,536 mean a number
outgrew its 8-, 12- or 16-bit box. Every case so far is listed (Brian's
observation, 2026-11-05).
## v0.34.0 — 2026-11-04
**SFM reaches Series-4 parity, and reads most of Blastware's report from the
event file alone.**
Two lines of work ship together.
**Series-4 parity** (`feat/series4-sfm-parity`). One device door, by serial,
for both series. Each change is audited, identity-checked, sent once and read
back. Benched on BE9441 and UM20147.
- reads and downloads
- start / stop monitoring
- call-home on / off
- settings changes (preview → send → read back)
It also fixes MiniMate request framing (#46) and the 5A walk across a 64 KB
page.
**The file-only decode, groups A–D.** 47 of Blastware's 88 report fields now
match on every DL2 event, about 6 before v0.33.0. Eight more match on all but
one or two of 6,524 waveforms.
- **Fixed:**
- Sensitive-range events no longer read 8× high
- histograms the waveform codec had claimed, and short histograms with a
loud interval, now decode
- histograms are no longer a day late
- every histogram's start and stop are Blastware's own (#51), not a second
early
- interval frequencies follow the sample rate (#50)
- **New from the file:**
- the job number
- the unit's serial, version, calibration date and battery
- the trigger source and levels
- each interval's frequencies, vector sum and time
- the peak dates and times
- a waveform's time of peak and peak acceleration
- **Events are identified by unit + time + type:** a waveform and its histogram
may share a second.
Prod still overlays a paired ASCII report onto the decode. That overlay is the
plan's step 3 and is not part of this release.
⚠ **This release migrates the events table and owes a backfill that moves every
Series-3 histogram's stored time by one second.** See *Migration*.
### Fixed
- ✅ **MiniMate requests and config writes are framed as Blastware frames them
(#46; `feat/series4-sfm-parity`).**
- Every request escapes 02 / 03 / 04 / 10.
- A config write is an ordinary escaped request carrying a whole block (as
read, plus two bytes). All four blocks are checked before the first frame.
- SFM's frames equal Blastware's in the 2026-04-20 and 2026-10-26 captures.
Benched on BE9441 2026-11-04.
- ✅ **The 5A walk crosses a unit's 64 KB page.** The walk is 32-bit linear
(the CLAUDE.md "KNOWN BUG"); BE9441's page-crossing events rebuild Blastware's
own files byte for byte.
- A one-event download is whole or an error.
- A non-first event's stream has no metadata pages.
- **A MiniMate settings read is assembled as content** (measured at the bench
2026-11-04).
- Unescape each 1A frame and drop the one non-content byte that starts every
frame but the last: 2,090 bytes headed by N = 2090.
- The read takes exactly the length it asked for. When a reply's checksum
byte is itself escaped (about 1 frame in 85), the parser leaves its 0x10 in
the data. It hit the first live read; the recordings never had it. The
waveform-data read now trims it too.
- **A live download is held to its record type (#51):** a same-second
waveform / histogram twin is no longer skipped as "already stored". An untyped
row at that second still counts as stored.
- Smaller wire fixes from the parity benches:
- SUB 0x15's serial is cut at its first NUL.
- 0x1C reads a histogram run as monitoring.
- A MiniMate that boots on connect is waited for.
- A start's read-back waits out the sensor check and wakes the unit.
- A built call-home image is framed once.
- ✅ **#51: events are identified by unit + time + type, and histograms take
Blastware's times.**
- **The new key.** The events table was `UNIQUE(serial, timestamp)`, one
event per unit per second. A waveform and its histogram share a second
legitimately: 209 times in prod's 2026-09-30 store. The key is now
`UNIQUE(serial, timestamp, record_type)` (agreed with Brian 2026-11-03).
- **Migration 3** rebuilds the table from its own definition with only the
key swapped, in one transaction. Every column, row and id is kept, and
the indexes are recreated.
- **Lookups:** the upsert, the estimate guard and the restamp match on
type. The restamp also re-types a file's own row in place. An untyped
event still dedups against an untyped row.
- **Histogram times.** A histogram's start and stop now come from its own
event record (lead `00 28 05 00`, source `04 00`, marker `fe f5`). That is
Blastware's Histogram Start and Stop on 63,490 / 63,490 DL2 histograms; the
footer's start was a second early on 97%. Without a validated record, the
footer stands and the decoder logs a decode problem.
- **Interval times and peak times follow:**
- each interval's printed time is its end, start + (i + 1) × interval,
capped at the stop (2,308,524 / 2,308,524 rows; `interval_times`)
- each peak's date and time is its interval's
- **Decode checker:** 760,410 comparisons fixed, 0 regressions, **47 of 88**
fields fully match (was 34). Histogram start and stop times, interval
times and the ten peak date/time fields match every DL2 histogram.
- **Rehearsed on a copy of prod's 2026-09-30 snapshot (15,432 events):**
- The migration kept every row identical, rebuilt the indexes and passed
the integrity check, in 0.27 s.
- `backfill_sidecars.py`: 11,944 files, 0 errors. 9,852 Series-3
histograms moved +1 s in place, with no id lost and review state
untouched. The 209 same-second pairs coexist, and 0 collisions were
refused. (It also created 341 rows for store files that never had one:
the known one-time behaviour, not duplicates.)
- `backfill_event_shape.py`: exit 0, `cleared_stale` 0.
- ⚠ **Schema migration + codec change.** SFM migrates the events table by
itself on first start: back up `seismo_relay.db` first. The release
backfill (`backfill_sidecars.py` then `backfill_event_shape.py`) moves
every Series-3 histogram's stored time by one second, in place.
- Terra-View pairs twins by peak values and reads rows by id: no change
needed there.
- Note for Terra-View's changelog: Series-3 histograms move forward one
second, so an event can cross a deployment-window edge.
- Three tests that pinned the old footer start now pin the record's. The
estimate-guard test's neighbour is now the same type.
- **A Blastware file's geophone range comes from its setup, so Sensitive
events no longer read 8× high.**
- **Where it is:** in the setup's channel blocks, the byte 29 after each
geophone label. `0x00` is Normal (10 in/s full scale), `0x01` is Sensitive
(1.25 in/s). SFM's live 1A read has the same byte at label+33.
- **Measured:** it matches Blastware's GeoRange on 70,042 / 70,042 DL2
events, all three channels agreeing on every one (35 Sensitive).
- **Before:** SFM assumed Normal, so every Sensitive event's peaks, vector
sum and `.h5` samples read 8× high.
- **`Event.geo_range`** is new: 0 or 1, or None when it isn't read (the
channels disagree, an unknown value, or a missing block). None comes with
a `decode_problems` entry, and peaks then assume Normal as before.
- **`decode_blastware_bytes`** scales peaks and the histogram vector sum by
the range.
- **`event_hdf5.write_event_hdf5`:** `geo_range` now defaults to None,
meaning the event's own range, else Normal. An explicit argument still
wins.
- **`waveform_store.save_imported_bw` and `scripts/backfill_sidecars.py`**
no longer force `"normal"`. The `waveform_store` line was agreed with the
parity session, which owns that file.
- **Decode checker:** GeoRange 70,042 / 70,042, and geophone samples exact
on **6,524 / 6,524** waveforms (was 6,491). PPV mismatches about halved,
and 10 of 88 fields fully match (was 6). 70,287 comparisons fixed, 0
regressions.
- ⚠ **Codec change: bump `TOOL_VERSION` at the next release.** The backfill
(`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored
Sensitive events' peaks and `.h5` files. No schema change.
- **Histograms go to the histogram codec, and a loud interval no longer hides
a short one.** These were the histograms the decode checker found decoding
wrongly.
- **The codec now follows the record type.** The file decoder used to try the
waveform codec first, whatever `STRT[18]` said. That codec accepted BE9440,
BE9557 and BE17354's 2018 5 s histograms and returned about 5× too many
"samples" (K440HDXX.XH0H: 44,504 against Blastware's 6,976). Only an
unknown type still falls back to trying both, and a chosen codec that
fails is now a decode problem rather than a silent switch.
- **A loud interval no longer breaks the sub-minute layout check.** The check
required each record's "zero word" to be `0000`. That word is the high word
of the interval's PVS², which is non-zero above 1.28 in/s, so a one-block
histogram with a loud interval decoded to nothing (T193KR5M.X90H,
K440HA3C.JM0H, R352HFZ7.530H).
- The check is now the measured relation peak ≤ PVS ≤ √3·peak. It holds
on 34,502,955 / 34,502,955 DL2 sub-minute intervals.
- The trim for a stream with no terminal tail uses the same test.
- **New decode-checker carve-out, `interval-count-is-duration`.** Blastware's
"Number of Intervals" is (stop − start) / interval. When the unit never
wrote the last minute, Blastware's own interval table lists one block
fewer, and SFM matches the table. It covers 8 events.
- **Decode checker:** 462 comparisons fixed, 0 regressions, 16 of 88 fields
fully match (was 11).
- Every DL2 histogram's Tran / Vert / Long interval peaks now match
Blastware (bar the clipped intervals the saturation carve-out covers).
- Channels 70,042 / 70,042.
- Histogram start dates a day off: 26 → 9.
- Peak vector sum mismatches: 45 → 18.
- ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and
backfill (`backfill_sidecars.py` then `backfill_event_shape.py`). Those
files are stored wrongly on prod today, and the backfill rewrites them. No
schema change.
- **A Blastware file's footer is its last 26 bytes: no more day-late
histograms.**
- **Measured:** every DL2 file ends in a valid footer (`0e 08` and two valid
times), 70,041 / 70,041.
- **The bug:** the decoder took the first "`0e 08` + plausible year". On 14
files there is an earlier record, about 1.1 KB before the end, holding the
stop time followed by zeros.
- A histogram then started at its own stop: a day late on BE9558's daily
histograms (K558L9XP.FK0H read 2025-10-08 19:10:01 for Blastware's
2025-10-07 19:14:08).
- T003LCYV.JD0H got no time at all.
- A waveform lost its stop, so its trigger was never computed and the stop
was stamped instead (K440I4LG.JK0W: 11:14:12 for 11:14:08).
- **The fix:** the last 26 bytes are now taken when they are a footer, and
the old search remains only as the fallback.
- **Decode checker:** event times 6,524 / 6,524 and histogram start dates
63,518 / 63,518. 13 comparisons fixed, 0 regressions, 18 of 88 fields
fully match (was 16).
- **Also:** the protocol reference records where the 1995 default-clock
events come from (units back from calibration with the battery unplugged;
17 in DL2).
- ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and
backfill. It moves the stored time of those ~14 events on prod. No schema
change.
### Added
- **Series-4 parity in SFM: everything by serial, for both series**
(`feat/series4-sfm-parity`, merged 2026-11-04; spec
`docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`).
- **One door, `DeviceAccess`.**
- A unit is addressed by its serial: UM is Series 4, BE / BA is Series 3.
The unit's own answer is checked before anything is sent.
- A Micromate's line is held between requests and released when idle or
on RADIO RING.
- One connection per unit; 423 while busy.
- **Reads, both series:** `GET /device/info`, `/device/monitor/status`,
`/device/settings`, `/device/events` and `POST /device/events/download`.
- A download is stored as the watcher stores it, through the Blastware /
IDF import path, typed.
- It never overwrites a stored event.
- SFM's MiniMate files carry Blastware's W/H type letter.
- **Changes, both series, each audited** (a `device_commands` row per
attempt), identity-checked, sent once, never retried, read back:
- start / stop monitoring;
- call-home on / off: `GET /device/call_home/state`,
`POST /device/call_home/{enable,disable}`;
- **settings**, `POST /device/settings/change`.
- **Settings, in detail:**
- A preview (dry run) shows old → new and returns a revision; a live
change must carry it, covering the unit's block and the changes asked for.
- Fields: record mode, sample rate, histogram interval, record time,
geophone trigger, the four notes, job number and its report flag, and
(MiniMate) range and alarm.
- Limits are the units' own, from Instantel's manuals, checked on the
block that would result.
- Refused before anything is sent: a monitoring unit, a stale preview, a
Micromate on its factory setup, or one whose schedule would load another
setup. SFM reads `schedule.dat`, read-only.
- **One settings codec for both series** (`micromate/setup_fields.py`): a
MiniMate's settings block is Series IV's `0x1A` layout. All 11 Blastware
compliance writes reproduce from the block before them.
- **The page:**
- units by serial, with the series badge from the unit's own answer;
- the events list and download, start / stop, the Call Home tab;
- the Config tab's Preview → Send → "the unit now holds";
- page JavaScript in `sfm/static/`, tested through Node (no inline JS).
- **Benched on BE9441 and UM20147:** phase 4 on 2026-11-03, phase 5 on
2026-11-04. Every change was acknowledged, read back and confirmed on the
unit's screen; both units were restored byte for byte.
- ⚠ A MiniMate's open setup menu loses a remote change when the operator
presses Cancel or Save (the menu writes its whole-block copy back). The
preview warns.
- ⚠ The Micromate scheduler switch is in no block SFM reads, so a leftover
schedule blocks a change even with the scheduler Off.
- ⚠ **Operational:** additive schema only. SFM creates `device_commands`, or
adds `sent` / `states` to an older one, on first start; this branch does not
touch `events`. No `TOOL_VERSION` bump and no backfill from this branch:
event decoding is unchanged. Production ingest (the watchers) is untouched;
the new device routes are used only from SFM's page and API.
- **A waveform's time of peak, vector-sum time and peak acceleration** (group D,
part 1 of the file-only decode). Measured on DL2 2026-11-04.
- **Time of peak** = (first peak sample − pre-trigger samples) / sample rate,
per channel including the mic.
- **The vector sum's time**: the same, on √(T² + V² + L²).
- **Peak acceleration** = the largest |v[i+1] − v[i]| × sample rate / g, which
the manuals describe as "subtracts two velocity readings and divides the
result by the elapsed time between them".
- Blastware's g is fitted: every printed acceleration in DL2 bounds it, and
together they leave [386.2236, 386.2240] in/s².
- That is 9.81 m/s² (386.2205) plus an offset not explained, as with the
mic's fitted dB offset. The standard 9.80665 m/s² fits 17,806 of
19,479 values; the fitted value fits 19,475.
- **`PeakValues` gains** `*_time_of_peak`, `pvs_time` and `*_peak_accel_g`,
filled for waveforms only.
- **Decode checker:** 52,177 comparisons fixed, 0 regressions. Times of peak
are 6,523 / 6,524 on every channel, peak acceleration 6,522–6,523 / 6,524.
Every miss is in two 2019 files (O117I1NK.R70W on all channels, S353I5PZ
on Vert), not yet explained.
- **Not shipped yet:** peak displacement and ZC frequency. They follow the
manuals' methods (half the largest half-cycle integral; the half-cycle at
the peak), but match only 84% and 46%, so Blastware does something more.
- ⚠ **Codec change:** it rides this release's `TOOL_VERSION` bump and
backfill. No schema change; the new values are not stored in the DB or
the `.h5` yet.
- **A histogram's interval detail: frequencies, vector sums, interval size and
stop** (group B of the file-only decode). Measured on DL2 2026-11-03.
- **Frequency** = (sample rate / 2) / half-period: 527,915 / 527,915 cells
at 1024 sps and 1,725 / 1,725 at 2048.
- ✅ **Fixes #50.** `half_period_to_hz` used a fixed 512 and halved every
2048-sps frequency. It now takes the rate (default 1024).
- Blastware prints "N/A" for a half-period of 0, ">100" (">200" at 2048)
at 5 samples or fewer, and "<1.0" below 1 Hz.
- **Each interval's vector sum**, √PVS² at the event's range.
- **Interval size:** uint16 seconds at `k − 40` (Series IV `[8:10]`).
- **Stop time:** the footer's.
- **`Event` gains** `histogram_interval_sec`, `interval_half_periods`,
`interval_pvs` and `stop_time`.
- **The `.h5` gains** `/intervals/half_period/<ch>` and `/intervals/pvs_ips`,
plus a `histogram_interval_sec` attribute.
- **Decoder:** a histogram is now walked once
(`histogram_codec.channels_from_records`).
- **Decode checker:** 508,080 comparisons fixed, 0 regressions, 34 of 88
fields fully match (was 28).
- Frequencies on all four channels, interval size and stop date match
every DL2 histogram.
- Interval vector sum: 63,497 match, plus 17 clipped intervals now under
the saturation carve-out. Blastware prints OORANGE when the sum exceeds
the range in an interval where it clamped a channel (17 / 17).
- 4 cells sit 4e-6 past a rounding boundary and stay mismatches.
- 58 stop times are Blastware a second earlier, part of #51.
- ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and
backfill. The `.h5` additions are additive. No schema change.
- **A Blastware file's identity, battery and trigger settings** (group A of the
file-only decode). Every field is matched against every DL2 report
(2026-11-03).
- **Identity block** before the setup name: what the live read gets from
SUB FE.
- serial `k − 202`, firmware `k − 147`, DSP version `k − 138`, firmware
minor `k − 193`
- calibration date `k − 132` and "by" `k − 128`
- manufacturer `k − 94`, model `k − 72`
- Filled into `Event.device_info`; `DeviceInfo` gains `calibration_date` /
`calibrated_by`.
- Serial, Version and Calibration match 70,042 / 70,042.
- **Battery:** uint16 hundredths of a volt at `k − 190`
(`Event.battery_volts`), 70,042 / 70,042. Blastware rounds half up
(6.25 → "6.3 Volts").
- **Trigger source:** the two bytes between the embedded event record's lead
and `fe 80`, a bitmask (`0x01` Tran, `0x02` Vert, `0x04` Long, `0x08`
MicL, `0x200` Manual). 6,524 / 6,524 (`Event.triggered_by`).
- **Trigger settings,** in Series IV's `0x1A` layout:
- the sources bitmask at `k − 19`
- the stop mode at `k − 31` (0 = Fixed)
- each channel's float32 level at label + 30 (geo in/s, mic psi)
- the mic type code at MicL + 4 (2 = Linear Weighting)
Blastware prints a level when its channel is a trigger source and the
event wasn't Manual. Geo level 6,484 / 6,484, mic level 4,412 / 4,412
(its dB uses 6895 Pa/psi).
- **`.h5`:** all of them as attributes (additive).
- **Decode checker:** 444,188 comparisons fixed, 0 regressions, 28 of 88
fields fully match (was 18).
- A mic level is now compared in the unit it is printed in: K441LA17.IN0W
prints dB under psi Units.
- New carve-out `units-is-a-display-preference` (3,532 events). dB or psi
in a Blastware report is that PC's Blastware preference when it wrote the
report (Blastware manual §4, Preferences → Units and Channel), not the
unit's Microphone Units setting (MiniMate Plus manual §3.9.7). DL2's
reports switch fleet-wide in 61 clean runs by write time, and no byte of
the file separates them.
- Single-value fields are proven for that value only: Version `10.72-8.17`,
stop mode Fixed, mic type Linear.
- ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and
backfill. No schema change.
- **A Blastware file's job number, and whether Blastware shows it.**
- **Where it is:** the setup block has Series IV's `0x1A` layout here too.
The report flags sit at 9 bytes before the setup name, with bit `0x02`
meaning the job number is shown. The number is a uint16 BE at 8 bytes
before the name, and it is kept while switched off.
- **Measured:** the flag matches Blastware's JobNumber on 2,997 / 2,997 DL2
events that print one, and 66,986 / 66,986 that don't.
- Every printed value is 1, so the value is only proven for 1.
- Hidden ones hold real numbers (802, 1012, 1013, 622).
- **`ProjectInfo.job_number_enabled` / `job_number`**, named as in
`micromate.setup_block`.
- **`write_event_hdf5`** stores both as `.h5` attributes when they were read.
- **Decode checker:** JobNumber 2,997 / 2,997, and 11 of 88 fields fully
match (was 10). 0 regressions. A job number only SFM shows now counts as a
mismatch.
- **Not in the database, the API or the PDF report yet.** That needs a
column.
- ⚠ **Codec change:** it rides the next release's `TOOL_VERSION` bump and
backfill (`backfill_sidecars.py` then `backfill_event_shape.py`). The new
`.h5` attributes are additive. No schema change, no migration.
### Removed
- **`POST /device/config` and `POST /device/config/project` answer 410**,
pointing at `POST /device/settings/change`. Terra-View does not call them.
Removed with them, because they wrote a live unit through the encoder #46
found wrong:
- `MiniMateClient.apply_config`, `set_project_info` and
`_encode_compliance_config`;
- `poc_set_project.py`, and `experiments.py`'s EXP6.
### Protocol / Documentation
- **The parity benches in both protocol references:**
- Series III: the settings write measured end to end, the escaped-checksum
stray byte, the keypad menu writing its whole-block copy back, the alarm at
channel +38, and `[26:28]` re-set while monitoring.
- Series IV: the first setup push, with the unit's CRC equal to SFM's; the
schedule read on a real unit; the scheduler switch in none of the blocks.
- Spec and plan: `docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md`,
`docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md`.
- **Histogram timing in the protocol reference (D.6.10):**
- the histogram's own event record
- the interval-time and peak-time rules
- "histograms stay on ts1" retracted in place
- CLAUDE.md records the unit + time + type key
- Docs only.
- **Group B in the protocol reference (D.6.9):**
- interval size, the stop, and per-interval frequency, with Blastware's
words (`N/A`, `>100` / `>200`, `<1.0`)
- each interval's vector sum, with its OORANGE rule
- #50's fixed-512 formula is retracted in place
- CLAUDE.md and the README roadmap follow
- Docs only.
- **Group A in the protocol reference, and the three meanings of mic
"units".**
- **D.6.8:** the identity block, the trigger-source bitmask and the trigger
settings.
- **D.6.6:** recorded data vs report units vs unit peaks, with the
MiniMate Plus and Blastware manual sections. CLAUDE.md carries the same
glossary.
- 🔶 Inferred: the histogram "terminal tail" `9c 06 00 42` is `9c 06 00`
plus the serial's `B`.
- Docs only: no code change, no migration.
- **Where file-only decoding stands, and that prod's ASCII overlay is
scaffolding.**
- **CLAUDE.md "Where things stand"** now says plainly that a paired
Blastware ASCII report overwrites SFM's decode on import, and that only
report-less events run on the decoder alone. The overlay is to be retired
at step 3 of the plan.
- The checker status is brought up to `dev`: 18 of 88 fields match on every
DL2 event, with the remaining groups A–F in the proposed order. The README
roadmap is updated to match.
- **The protocol reference** records:
- the footer as the file's last 26 bytes (D.3.3, with `[18:24]` retracted
as "fixed")
- the codec chosen by STRT[18]
- the job number
- the PVS² high word and the peak / PVS consistency check (retracting
"reads 0000")
- Blastware's interval count
- a refreshed "not read yet" list
- Docs only: no code change, no migration.
- **`docs/instantel_protocol_reference.md` gains Appendix D.6:** the bytes
and DL2 verification for every field SFM reads from a Blastware event file.
- the record type, `STRT[18]`
- the recording-setup block: sample rate, pre-trigger, record time and the
four notes
- the geophone range
- each histogram interval's PVS²
- the mic scale
- **Retracted in place:**
- `STRT[20]` as the record time: it is `00` on every DL2 file.
- The 2026-08-26 reading of sub-minute histogram records as little-endian:
they are big-endian from byte 5 (#47/#49), and the "2-word tail" is the
PVS². This is corrected in CLAUDE.md too.
- **#48 is still open.** The event file's setup block puts the pre-trigger where
the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is
**each event's own pre-trigger**, not the unit's setting: it varies on the
same unit on the same day, and Blastware reports it per event. So the files
say little about whether the live 1A read loses its anchor. (Corrected the
same day; the first version read the file's value as the setting.)
- **CLAUDE.md "Where things stand"** now reflects the range fix.
- Docs only: no code change, no migration.
### Migration
⚠ **Schema migration and backfill.** Rehearsed twice on a copy of prod's
2026-09-30 snapshot (15,432 events), before and after the parity merge, with
identical results.
**Before you start:**
- `TOOL_VERSION` is bumped to **0.34.0**, which gates the regeneration, so no
`--force` is needed.
- **Back up `seismo_relay.db` first.**
**Then:**
1. **Deploy.** On first start SFM migrates the database by itself.
- The events table is re-keyed `UNIQUE(serial, timestamp, record_type)`
(Migration 3): every row and id is kept and the indexes are rebuilt.
Rehearsal: 0.27 s, every row identical, integrity ok.
- `device_commands` is created.
2. **In the `sfm` container, `python scripts/backfill_sidecars.py`** re-decodes
every event file. ⚠ **Plan an overnight run:** the store holds about 64,000
events after the 2200-day watcher forward, at about 1.5 files/s on the NAS,
so roughly 12 hours.
- **Every Series-3 histogram's time moves forward one second, in place**,
with id and review state kept. Rehearsal: 9,852 moved, 0 refused, no id
lost.
- **The same-second waveform/histogram pairs coexist** (209 in the
snapshot).
- It also creates a row for any store file that never had one (341 in the
snapshot): the known one-time behaviour, not duplicates.
- **Report-less events** pick up every new field. **Report-paired events**
keep the report's overlaid peaks, notes, sample rate and record time.
3. **`python scripts/backfill_event_shape.py --db-path bridges/captures/seismo_relay.db
--store-root bridges/captures/waveforms`** recomputes shape and offset
metrics. Rehearsal: exit 0, `cleared_stale` 0.
**Terra-View** needs no change: it pairs twins by peak values and reads rows by
id. Moving a histogram forward one second can carry an event across a
deployment-window edge.
**Series-4** event times do not move.
## v0.33.0 — 2026-11-01
**SFM reads Series-3 events from the file alone, and proves it against
+38 -436
View File
@@ -2,7 +2,7 @@
Ground-up Python replacement for **Blastware**, Instantel's Windows-only software for
managing MiniMate Plus seismographs. Connects over direct RS-232 or cellular modem
(Sierra Wireless RV50 / RV55). Current version: **v0.34.0**.
(Sierra Wireless RV50 / RV55). Current version: **v0.33.0**.
Stack-level context — which repo owns what, and how the three project versions
pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as
@@ -10,27 +10,10 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as
---
## Where things stand (updated 2026-11-05)
## Where things stand (updated 2026-11-01)
Read this first when picking the project back up.
- **🔑 Prod still leans on Blastware's ASCII report, and that is scaffolding.**
- **How it works today:** when a `_ASCII.TXT` report arrives with a
Blastware file, `WaveformStore.save_imported_bw` overlays its peaks, notes,
sample rate and record time onto SFM's decode
(`event_file_io.apply_report_to_event`).
- **Only events without a report** run on the decoder alone: all DL2 events
before 2025, and everything SFM downloads itself.
- **Why that matters:** the overlay made SFM trustworthy from day one. It
also hid how much the decoder could not yet do; until the checker (below)
there was no full list of what Blastware reports.
- **The goal is full function without Blastware (Brian, 2026-10-29).** The
README roadmap has four steps:
1. the checker ✅
2. complete the file-only decode, one field group at a time
3. switch ingest so reports are kept only for checking (retire the overlay)
4. stop the watchers forwarding reports
- Until step 3, prod keeps the report as truth wherever one exists.
- **🔑 The Series-3 decode checker (2026-10-29; v0.33.0).**
- **Goal:** SFM produces everything Blastware reports, from the event file
alone (spec and plan in `docs/superpowers/`).
@@ -42,110 +25,27 @@ Read this first when picking the project back up.
`~/dl2-archive/checker-runs/` and is never committed.
- **The rule:** every mismatch is SFM's bug unless a carve-out with evidence
covers it.
- **Byte layouts** of every field read from the file:
`docs/instantel_protocol_reference.md` Appendix **D.6**.
**Where the decoder stands on `dev`** (2026-11-09, run `20261109-144544`):
**80 of 88 fields match on every event**, up from about 6 before v0.33.0,
47 before group D and 59 after it. Every other field matches or is accepted
under a carve-out with its evidence.
- Groups A, B, C and D part 1 shipped in v0.34.0 (#50, #51).
- D part 2 (the unit's own summary), E (the sensor check), F (the monitor
log), over range and the mic fixes are on `dev` and owe the next release
a backfill.
- Left: 16 values in two causes -- the vector sum's last digit on 4
waveform/histogram twins, and 4 accelerations (reference D.6.11). Brian
decided 2026-11-11 to leave both as they are, documented.
- 🔑 **Events are keyed unit + time + type:** `UNIQUE(serial, timestamp,
record_type)` (#51, Migration 3 in `sfm/database.py`, `dev`).
- A waveform and its histogram may share a second: 209 times in prod's
2026-09-30 store.
- Any lookup "by event" must include the type.
- An untyped event still dedups against an untyped row.
- Rehearsed on a copy of the prod snapshot: rows and ids kept, 9,852
histograms moved +1 s in place.
- ✅ **Match on every event:**
- sample rate, record time, pre-trigger, notes and event type (v0.33.0)
- geophone range, job number, event times (6,524 / 6,524) and histogram
start dates (63,518 / 63,518) — `dev`
- group A (`dev`, reference D.6.8): serial, version, calibration, battery,
trigger source, geo and mic trigger levels, stop mode, mic type
- group B (`dev`, D.6.9): interval frequencies, vector sums, size, stop
- group C (`dev`, D.6.10): histogram start and stop from the histogram's
own event record, interval times, and the peak dates and times
- group D (D.6.12): ZC frequency on every record type, peak displacement,
times of peak and the vector-sum time.
- These are **the unit's own values**, stored in the file right after
the event record. Blastware prints them; recomputing from the samples
reached only 46% and 84%.
- Peak acceleration is Blastware's own computation from the samples
(fitted g 386.2238): 6,522–6,523 / 6,524. The unit stores its own
too, which Blastware ignores. The misses are O117I1NK.R70W, whose
samples wrap at the trigger, and S353I5PZ.EP0W Vert (open).
- group E (D.6.13): sensor check frequency, ratio, mic amplitude and
result, every record type. Also the unit's own, in each sensor-check
record's header. "Check" is the unit's status code, not a limit SFM can
recompute.
- group F (D.6.14): the Monitor Log line. It is the footer's start and
stop plus words from the footer's flag word (Modem Exit, Timer Stop,
Keyboard Exit…), character for character on 69,983 / 69,983.
- 🔑 **The tail of every event file is one record chain** (D.6.13):
event record → unit summary → sensor checks → footer, each
`[length][id][payload]`. It ends exactly at the file's end on all 70,041
DL2 files, and SFM reads none of it otherwise.
- 🔑 **"Units" means three different things — keep them apart** (reference
D.6.6):
- **Recorded data:** the mic samples and interval peaks in the file, as
raw counts with no unit.
- **Report units:** dB(L) or psi(L) in a report.
- A Blastware report uses that PC's Blastware preference at the moment
it wrote the report; carve-out `units-is-a-display-preference`.
- SFM's report uses SFM's own fixed choice.
- **Unit peaks:** the unit's own summary, in its keypad Microphone Units
setting. Shown on its screen, in Blastware's event list, and in the 0C
record.
- Where the unit stores that setting is not measured yet; a keypad test
on a bench unit would show it.
- ✅ **Geophone samples** are exact on **6,524 / 6,524** waveforms in every
year (`dev`; v0.33.0 had 6,491, its 33 others being Sensitive-range events
read 8× high).
- ✅ **Histograms** decode to Blastware's own interval table on every DL2
file: Tran / Vert / Long interval peaks have 0 mismatches (`dev`).
- The codec is now chosen by STRT[18]. The waveform codec had been
claiming 2018 5 s histograms.
- The sub-minute layout check now tests peak ≤ PVS ≤ √3·peak.
- Blastware's "Number of Intervals" is the monitoring time ÷ the interval:
a carve-out, 8 events.
- ✅ **Histogram PVS** = the stored per-interval PVS²: 69,989 / 70,042.
**Mic:** one count = 0.25 Pa (an eighth at mic range 1, the mic block's
label + 29), dB offset 81.938216 (2026-11-09; 81.9384 was too high).
- ✅ **Over range (D.6.15):** a peak past 2,000 units (32,000 counts; the
mic in counts) is Blastware's `OORANGE`, per channel and per interval; the
vector sum is `OORANGE` exactly when a geophone is, never on its own.
- 🔑 **Blastware's mic unit labels don't hold on every report** (D.6.6): the
peak carries its own `<Units>`, a sample table's cells say its unit, and
a few reports mix dB and psi in one column (carve-out `mic-units-mixed`).
**As of v0.33.0:**
- ✅ **Match on every event:** sample rate, record time, pre-trigger, notes,
and event type (#41, from STRT[18]).
- ✅ **Geophone samples** are exact on 6,491 / 6,524 waveforms in every year.
The 33 others are the 1.250 in/s range, 8× under SFM's Normal-range
assumption.
- ✅ **Histogram PVS** = the stored per-interval PVS²: 69,919 / 70,042.
- ✅ **Mic: one count = 0.25 Pa,** with Blastware's dB offset at 81.9384. It
fails on only a few dozen events.
- ❌ **Open:**
- the vector sum's last digit on 4 waveform/histogram twins: Blastware's
value is ~1.5 ppm lower, cause unknown (no factor applied)
- 4 accelerations (D.6.12)
- ⬜ **Not read yet, in the order proposed** (2026-11-03):
- ~~**A. Setup fields**~~ ✅ done on `dev`.
- ~~**B. Histogram interval detail**~~ ✅ done on `dev`. Frequencies (#50),
per-interval PVS, interval size, stop.
- ~~**C. #51 timing**~~ ✅ done on `dev`.
- ~~**D. Blastware's waveform calculations**~~ ✅ done. ZC frequency,
displacement and time of peak are the unit's own (D.6.12); acceleration
is Blastware's.
- ~~**E. Sensor check results**~~ ✅ done (D.6.13). Plus the traces of a
unit without a mic, which the trace decoder had been dropping.
- ~~**F. Monitor log**~~ ✅ done (D.6.14): in the footer after all.
- 🔶 **#48 is still open.** The event file's setup block puts the pre-trigger
where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though,
it is **each event's own pre-trigger**, not the setting: 253–256 samples at
1024 sps, alternating on the same unit on the same day, and reported that
way by Blastware. So the files say little about whether the live 1A read
loses its anchor (reference D.6.2).
- histogram start times are 1 s early (#51)
- 35 sub-minute (5 s / 2 s) histograms decode wrongly, plus 2 one-minute
no-mic histograms (`R352HFZ7`-shaped, likely a separate cause)
- 26 histogram start dates are a day off
- the per-interval PVS is not stored
- Blastware prints `OORANGE` when the vector sum alone exceeds the range
(a carve-out to prove)
- ⬜ **Not read yet:** job number, ZC frequency, acceleration, displacement,
time of peak, sensor check, battery, calibration, range, units, monitor
log.
- **The Series-4 LIVE wire protocol is reverse-engineered end to end
(2026-09-25).** `docs/micromate_protocol_reference.md` is the Series-4
Rosetta Stone, sibling to `instantel_protocol_reference.md`. **A Micromate
@@ -156,31 +56,9 @@ Read this first when picking the project back up.
by 47x). Read path, event chain, setups, scheduler, monitoring control and
per-event delete are all mapped — **and as of 2026-10-14 so is the inbound
call-home session.** There are no protocol unknowns left.
~~⚠ **No command has ever been originated against a unit by this project.**
⚠ **No command has ever been originated against a unit by this project.**
Every write was performed by THOR while we recorded. That line is worth
keeping.~~ **Retracted 2026-10-25:** the first commands this project
originated against a **Micromate** were `0x96` / `0x97` (start / stop
monitoring) to **UM20147 on 2026-10-25**, sent by SFM at the bench with
Brian's go for each send — 4 sends, each acked and read back, each audited.
(This line was always about Series 4: the `minimateplus` stack has sent
Series-III writes — start/stop, config push, erase, call-home config — since
April 2026.) Every *other* Micromate write (call-home, setup push, delete,
scheduler) is still THOR-only, never sent by us. Details:
`docs/micromate_protocol_reference.md` → *The first commands this project
originated against a Micromate*.
**Series-4 write path, phase 2 is done (2026-10-22):** the write encoder, a
send-side opcode gate and write *plans* for start/stop, call-home enable and
the setup rewrite, reproduced byte for byte against THOR's captured frames.
`bridges/mm_dry_run.py` prints a write's planned frames from a live unit's
reads (run on UM20147: sizes equal UM12947's). `MicromateProtocol._send`
refuses every write opcode except one start/stop plan at a time through
`execute()`, on a connection with a fresh Micromate reply, and refuses `0xA2`
always. The only transmit path for a write is `execute()`, reached only from
SFM's serial-named start/stop routes through `sfm/device_access` (identity,
state, audit, read-back, never retried); the Series-3 `minimateplus` stack
and raw-socket bench bridges are outside the gate. The reproduction's
breadth is one distinct input per block (the five pushes share the same name,
prefs and trigger block).
keeping.
- **✅ `micromate/` HAS a live client (2026-10-02).** `framing.py`,
`protocol.py`, `client.py` + models, **119 tests**, mirroring the
`minimateplus/` stack and reusing its `transport.py` unchanged. Connect over
@@ -251,147 +129,8 @@ Read this first when picking the project back up.
— `micromate/setup_block.py`, measured fields only, checksum-verified,
69 tests on 15 real fixtures (`tests/fixtures/micromate-setup/`, force-
added). `bridges/mm_client_check.py` prints it; Brian matched every line
against UM20147's screen.
✅ **SFM speaks Series 4 by serial (phase 1a, 2026-10-20):** `/device/info`,
`/device/monitor/status` and `/device/settings` take `serial` and return one
shared shape for both series through `sfm/device_access/`. Micromate lines
are held open (one call-up, keep-alive 60 s, idle hang-up 5 min, released on
RADIO RING); MiniMates still reconnect per request. Without `serial` the
legacy Series-3 path is unchanged.
✅ **Phase 1b (2026-10-21) lists and downloads events by serial for both
series** -- the MiniMate list comes from headers only (no 5A), and a download
is checked and stored in SFM's DB (`db_event_id`). Bench-checked on UM20147:
5 events, a waveform that verified, a histogram, one call-up for the whole
sequence. ~~⚠ The MiniMate header walk is **unproven on a unit; a MiniMate
bench check is owed before the branch merges.**~~ **2026-10-25, first
MiniMate bench run (BE9441, serial cable):** the header walk listed 20
events correctly, and the check found four bugs, all fixed and tested on its
logged bytes.
1. **Every non-first event SFM assembled was 2 bytes short.** The body
builder assumed the 0x1002/0x1004 metadata pages in every 5A stream; it
now reads each A5 reply's echoed address. This also affected legacy
`get_events` and `ach_server.py` files. Blastware's own files were not
affected.
2. **A reboot mid-download stored a partial event as a success.** A strict
5A stream now raises on any early end. The reboot itself was ours: the 5A
request had a bare `0x02` checksum, which the unit reads as STX. A 5A
checksum in {02, 03, 04, 10} is now DLE-escaped (re-run 2026-10-26).
3. **The unit boots when its port opens** and ignores a POLL sent before the
`Operating System` banner. Startup now waits for it.
4. **The 0x15 serial is a C string** (`"BE9441\x00?"`).
Series-3 downloads are now checked against the unit's own 0C peaks before
being stored. **Re-run 2026-10-26:** every event that does not cross a
64 KB page downloaded whole and verified (events 0, 1, 3, 4, 10). ~~The two
that cross one (events 2, 19) are refused by name.~~ **Later the same day the
page bug was fixed** (see the ✅ FIXED entry below): a fresh 8 events, 4 of them
crossing a page, all downloaded byte-identical to Blastware's own files. Stale
id gives 409, a repeat gives `already_stored`, also against Blastware's imported
copy. **Evening 2026-10-26 (measured):** a 71 KB histogram (139 requests, two
64 KB crossings) downloaded byte-identical to Blastware's, and SFM **stopped**
the unit through the new audited path (acked, read back idle). That needed
`d990466`: the 0x1C flag reads **0x0B** during a histogram run (only 0x10 had
been measured), and the status decode had to unescape before counting from the
end. **Start too (2026-10-27 00:12):** idle → monitoring, verified -- once a
start's read-back waited out the ~30 s sensor check and re-sent the wake
(`9886422`, `ca5c401`; a monitoring MiniMate answers nothing until woken, and
nothing during its sensor check). Still owed before merge: #47 from dev, and
`persist_download` aligned with dev's waveform-time restamp (spec).
- **Phase 1c: the SFM webapp by serial (2026-10-29), built; bench pass owed.**
`sfm/sfm_webapp.html` has a **Serial** field beside host/port. With one, the
Live tabs use the serial-based routes for both series: identify, status (now
with the unit's clock and event count), settings (read-only), the event list
with a Download per row (checked, stored, then opened from the store), and
audited start/stop (asks first, one send, shows the ChangeResult as it is).
Hang up appears for a Series 4. Every series-specific control follows the
unit's own `/device/info` answer, never the typed serial, and drops the
moment the serial, host or port is edited. Config and call-home **writes are
off for both series** (phases 5 and 4); Diagnostics is enabled only for a
confirmed Series 3. Without a serial every read behaves as before.
The page keeps every routing and button rule in one block of pure functions
between `/* <device-routing> */` markers, run through **Node** by
`tests/test_webapp_device_routing.py` (skipped when `node` is absent); a
static test fails if a `/device/` URL is built anywhere else.
**Server side:** the legacy Series-3 writes and erase -- `POST /device/config`
(and `/config/project`), `/events/erase`, `/rescue` (when it disables ACH or
erases), `POST /device/call_home` -- read the unit's serial (or reuse the one
`connect()` read) and refuse 409, nothing sent, unless it is Series 3 and,
when `serial=` was given, that unit. 0xA2 is CONFIRM ERASE on a MiniMate and
ends a call-home on a Micromate. The stop tools (legacy `monitor/start|stop`,
`stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt: 0x96/0x97 mean
the same on both series, and the blind tools must reach a unit too wedged to
answer.
**Bench pass done 2026-10-29** (both series, each on its own modem): 16
findings in the spec (*Left open by the 1c bench*) -- the S3 settings decode
reads escaped bytes (#1), S3 downloads skip the file reader (#8), the S3
start read-back does not reconnect after the modem drops the line (#9), an
audit `sent: null` (#15), and page polish.
**Batch 1 fixed (2026-10-29):** #1 (`b320a53`, settings read after unescaping:
mode −7, rate −6, interval −4, record time +6), #9 (`ce441a0`, one reconnect for
the read-back), #8 (`9492e49`, downloads stored through `save_imported_bw`; since
2026-11-02 everything comes from the file -- peaks, vector sum, mic and the range
it was recorded at -- and the unit's 0C summary is only the download check). #2 came with the
`dev` merge. **#15 retracted** -- `sent` NULL is "unknown", by design.
Final review fixes: `dbd8a91` (wake before the reconnect's identity read),
`3a1d34a` ("already stored" by Blastware name too), `a72d3a9` (the 1A write
encoder refuses a patch that would not read back -- its offsets are 1024-sps
raw ones, #46).
**Phase 4 built 2026-11-02, benched 2026-11-03:** call-home on/off by serial for
both series (`GET /device/call_home/state`, `POST /device/call_home/{enable,disable}`,
the page's Call Home tab). The MiniMate frame is Blastware's byte for byte
(`tests/test_s3_call_home_bw_frames.py`, the 4-20-26 captures). On both units,
idle, the no-op, off and on writes were all verified and agreed with the unit's
menu. ⚠ **Neither series takes a call-home change while monitoring:** a MiniMate
returns its device-info block, and a Micromate acks the write and ignores it.
SFM refuses both up front.
**Phase 5 built 2026-11-03, benched 2026-11-04:** change a unit's settings by serial,
both series (`POST /device/settings/change`; the Config tab's Preview, then Send).
Spec `docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md`.
- 🔑 **A MiniMate's settings block IS Series IV's `0x1A` layout** (measured):
the 1A read assembles to 2,090 bytes headed by N = 2090, and all 11
Blastware compliance writes reproduce from the block before them. One codec
serves both series: `micromate/setup_fields.py`.
- Limits are the units' own, from Instantel's manuals (Brian). A live send
needs its preview's revision; refused up front: monitoring, a Micromate on
its factory setup or whose schedule would load another setup.
- Retired: `/device/config` (410), `apply_config`, `_encode_compliance_config`.
- **Benched 2026-11-04, both series:** every change acknowledged, read back,
and confirmed on the unit's screen; both units restored byte for byte. The
MiniMate alarm write is measured and now on.
- ⚠ **A MiniMate's open setup menu wins:** a change sent while it is open is
lost when the operator presses Cancel or Save (the menu writes its whole-block
copy back). The preview warns; nobody in the menus while the office sends.
- ~~⚠ An escaped checksum byte leaves a stray `0x10` in a Series-3 reply's data
(about 1 frame in 85).~~ **Fixed in the parser (#58, 2026-11-06, measured):**
a checksum of 02/03/04 arrives as `10 X`, and that `10` is never data (7,747 /
7,747 recorded replies check). It had misread 1C battery/memory (419.84 V) and
the 2C call-home read; the 5A file builder's own compensation is gone with it,
and pre-fix `.a5.pkl` frames are converted on load (pickle version 2).
- ⚠ The Micromate scheduler switch is not in any block SFM reads, so a leftover
schedule blocks a change even with the scheduler Off.
**Ring path measured the same night:** with THOR's watchdog off, a call-home
reaches THOR when nobody holds the line, and **is lost when SFM holds it** --
the unit takes SFM's connection for the call, times out and does not retry.
While THOR polls a unit, SFM gets no reply and does not disturb THOR.
✅ **Line hold decided (Brian, 2026-10-29): keep it as is for now; the
long-term fix is SFM handling auto call-ins itself.** The ring-path merge gate
is settled. THOR's log: `C:\THORDATA\Logs\`.
Next: a short fix plan for the findings, then phases 4 and 5.
- **✅ Phase 3: start / stop monitoring by serial (2026-10-23) — built,
reviewed, and bench-verified on UM20147 (2026-10-25).** Start acked in
0.46 s and read back as monitoring at the first 2 s poll (during the sensor
check); stop acked in 0.12 s, then `0x49` read a new value **`0x01` for ~18 s**
(inferred: the unit's call-home attempts after a stop — refused as unmeasured
until settled) before idle; a stop while idle is a harmless 10 ms no-op. The
Series-3 path is unproven on a unit (MiniMate bench check owed). Both
series go through one safety core, `sfm/device_access/change.py`: a fresh
identity read, the run state (calling home or never measured is refused),
`dry_run` (the exact frames, nothing sent), a row in the new
`device_commands` audit table (`GET /db/device_commands`; `sent` says whether
a frame went out, `states` keeps every read), one send never retried, then a
read-back. The HTTP status is an allow-list -- only a dry run, a skip or a
send read back as made is a 200 -- and a failure after the send says so and
names its audit record.
against UM20147's screen. Not yet in SFM — nothing there uses the
Micromate client.
- **🔑 ACH / call-home, captured end to end (2026-10-14).** A Micromate signals
`RADIO RING`; **two paths exist and timing decides which**: if anything
already holds the modem's single TCP session the ring rides that connection,
@@ -472,39 +211,7 @@ Read this first when picking the project back up.
4th-decimal tick and are Thor's own rounding — no single linear LSB can
reproduce every printed value (the constraints are infeasible by 7e-5
relative), so do NOT retune `_GEO_LSB_IPS`.
- **✅ FIXED 2026-10-26 (`887e75d`) — was: "KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB."**
Kept below as history. The fix came from a recording of Blastware downloading all 8 of
BE9441's events, 4 crossing a page (`tests/fixtures/minimate-bench-10-26-26-blastware/`):
- **Every MiniMate request DLE-escapes 02, 03, 04 and 10**, payload and checksum alike
(748/748 re-encode). `build_bw_frame` had escaped only 0x10.
- **A 5A request is an ordinary request carrying a LENGTH and a 4-byte linear ADDRESS.**
The walk: the event's start, +0x200 carrying into the page byte, then TERM at the
next boundary for the remainder.
- **The old model misread the same bytes.** The "offset 0x1002" is length 0x0200
escaped; the "metadata pages at 0x1002/0x1004" are event 0's chunks at 0x0200 and
0x0400; the 16-bit counter could not leave its page.
- **Verified on BE9441**, live: all 8 events, including 4 page crossings, downloaded
whole and matched the unit's own peaks.
⚠ Sections below that describe "partial DLE stuffing", "11-byte params", "offset_hi
0x10 raw" and "metadata pages 0x1002/0x1004" are that misreading. They are retracted
here, not deleted.
**Review follow-ups (2026-10-26):** the walk's chunk cap is now sized from STRT (a
caller's 128 cut every event past ~66 KB; 2,545 of 63,500 archived histograms are
bigger); a STRT claiming less than one chunk or more than 4 MiB is refused as a
misread; a TERM is sent only for a true tail. Still open, none measured: an event
ending exactly on a chunk step sends a zero-length TERM (as the old code did; 1 in
512, never seen); with no STRT the legacy walk still reads `max_chunks` blind.
🔶 **Inferred only, do not act on it without a capture:** `build_bw_write_frame`
("raw except BW_CMD", "DLE-aware checksum") carries the same fingerprints as the
retracted 5A model: SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and
Blastware escapes `03` in write data. A write whose payload holds a bare
02/03/04/10 may be malformed. One Blastware config-write capture settles it.
🔑 **Replies follow the same rule (measured, 748/748; 7,747 / 7,747 across every
recording, #58):** every 02/03/04/10 escaped, the checksum too, and checksum = SUM8
of the unescaped payload. The "S3 checksums frequently fail" belief was
`S3FrameParser` summing its output with the `10` of `10 02/03/04` still in it
(fixed 2026-11-06: `checksum_valid` holds on every recorded reply).
~~**⚠ KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB.**~~
- **⚠ KNOWN BUG — the 5A walk breaks once a unit's buffer crosses 64 KB.**
`parse_strt_end_offset()` returns only `(end_key[2] << 8) | end_key[3]`,
discarding the key's page byte. An event starting at `0x0111F2A2` and ending
at `0x0112_1010` therefore reads `end_offset = 0x1010` — *behind* its own
@@ -522,22 +229,8 @@ Read this first when picking the project back up.
over) needs a BW capture of a spanning event first. Do not ship layer one
alone without a loud truncation warning — a silently short event is the
failure mode this codec has been bitten by repeatedly.
**Narrowed 2026-10-26 (BE9441, measured):**
- The one-event download now refuses a spanning event by name (502), before
any chunk.
- STRT carries the full 32-bit end key, so the page is there to use.
- A read-only test walk carrying the page byte got a proper reply for the
first chunk in the next page (`01 12 01 2c`). The second chunk, params
`… 01 12 03 2c`, got none: a raw `0x03` inside the params.
- Pages after `0x11` have counters with `02`/`03`/`04` bytes. Page `0x11`
has none, because event 1 skips `0x0000`–`0x05FF`.
- How Blastware encodes those bytes is the one unknown left. The capture to
take: Blastware downloading BE9441 event 2 (`0111c92c`) or 19 (`0118a4ca`)
through the recording bridge. Blastware's own files for both are fixtures
(`tests/fixtures/minimate-bench-10-25-26/blastware/`), as byte-exact targets.
- **Open, not blocking:** ~~14 sensitive-range files show an exact 8x
(= 10.0/1.25) units discrepancy~~ (**resolved on `dev` 2026-11-02:** the
range is read from the file, reference D.6.4); `scripts/backfill_sidecars.py --force` also
- **Open, not blocking:** 14 sensitive-range files show an exact 8x
(= 10.0/1.25) units discrepancy; `scripts/backfill_sidecars.py --force` also
inserts DB rows for store files that have none (one-time per store) and the
dry-run does not report that count.
- **After any codec change, regenerate the store** — `backfill_sidecars.py`
@@ -766,9 +459,6 @@ minimateplus/ ← Python client library (primary focus)
per-sample decoder — see "Waveform body codec" section below)
sfm/server.py ← FastAPI REST server exposing device data over HTTP
sfm/sfm_webapp.html ← the SFM page; its JavaScript is in sfm/static/ (no inline JS,
sfm/static/ ← a stack-wide rule since 2026-11-02): device_routing.js holds the
DOM-free rules (Node-tested), sfm_webapp.js the page glue
seismo_lab.py ← Tkinter GUI (Bridge + Analyzer + Console tabs)
bridges/
mm_probe.py ← name the fault behind a dead unit (4 verdicts, read-only)
@@ -798,7 +488,7 @@ Full read pipeline + write pipeline + erase pipeline + monitor log + call home c
| Event header / first key | 1E | ✅ |
| Waveform header | 0A | ✅ |
| Waveform record (peaks, timestamp, project) | 0C | ✅ |
| **Bulk waveform stream (event-time metadata + full waveform)** | **5A** | ✅ **(2026-10-26: a LENGTH read at a 32-bit ADDRESS, every 02/03/04/10 escaped — the model in the rest of this cell is retracted, see "✅ FIXED 2026-10-26")** byte-perfect against BW captures (v0.14.3, 2026-05-05) — STRT-bounded chunk walk + correct event-N probe counter + DLE-stuffed `0x10` bytes in params + concatenate-only file body assembly. All 17 5A request frames in the 5-1-26 3-sec capture reproduce byte-for-byte. |
| **Bulk waveform stream (event-time metadata + full waveform)** | **5A** | ✅ **byte-perfect against BW captures (v0.14.3, 2026-05-05)** — STRT-bounded chunk walk + correct event-N probe counter + DLE-stuffed `0x10` bytes in params + concatenate-only file body assembly. All 17 5A request frames in the 5-1-26 3-sec capture reproduce byte-for-byte. |
| Event advance / next key | 1F | ✅ |
| **Write commands (push config to device)** | **68–83** | ✅ new v0.8.0 |
| **Erase all events** | **0xA3 → 0x1C → 0x06 → 0xA2** | ✅ new v0.9.0 |
@@ -950,14 +640,6 @@ block still covers exactly one minute:
| 15 s | 4 | 92 |
| 2 s | 30 | 612 |
> ⚠ **CORRECTED in v0.32.0 (#47/#49), recorded here 2026-11-02.** The
> records are **big-endian, starting at byte 5**. Each holds a uint16 peak
> and a uint16 half-period per channel, then the interval's **PVS² as a
> uint32 BE**. Record = 4 × channels + 4 bytes: 20 with the mic, 16
> without. `stride = 12 + n × record`. The little-endian reading below was
> the same words shifted by one byte. Its "2-word tail" is the PVS²
> (reference D.6.5).
`stride = 12 + n * 20`. Block = `[00][segment][ctr uint16 LE][0a][00]`,
then n x 20-byte records of 8 x uint16 **LITTLE**-endian values
(`T_peak, T_halfp, V_peak, V_halfp, L_peak, L_halfp, M_peak, M_halfp`)
@@ -965,7 +647,6 @@ plus a 2-word tail whose first word is `0000` on every real interval,
then a 6-byte block trailer.
⚠ The standard 32-byte block is BIG-endian; this variant is LITTLE-endian.
*(Retracted: both are big-endian; see the box above.)*
Recovers **415 files** (216 on BE18193, 199 on BE9440) that decoded to
nothing. Ground truth `BE9440/K440L3AQ.T70H` matches its BW ASCII export
@@ -993,9 +674,6 @@ block has its own tail signature. Two long-standing errors:
`1e 0a 00 00`, with arbitrary bytes at `[21:23]`. Rejecting it
dropped the final interval of nearly every histogram — frequently the
one holding the event peak, so the file's PPV read low.
- **`[21:25]` is the interval's PVS² as a uint32 BE** (v0.33.0, reference
D.6.5). The "arbitrary bytes" above are probably its high half
(inferred).
Verified against 1211 production histograms paired with their BW ASCII
exports: **1211/1211 decode exactly** (interval count plus every
@@ -1004,14 +682,11 @@ with zero mismatches. Before: 1 of 1196.
### What's NOT solved
- ~~**MicL channel conversion to dB(L)** — the codec emits MicL as
- **MicL channel conversion to dB(L)** — the codec emits MicL as
raw ADC counts (same format as geo channels), but BW's ASCII export
shows mic in dB(L) with ~6 dB quantization steps. Need to map
ADC counts → dB(L) for direct comparison; likely
`dB = 20*log10(|counts|) + offset` or similar.~~ **Solved in v0.33.0.**
One count = 0.25 Pa, and dB(L) = 81.938216 + 20·log10(|count|), an offset
measured from Blastware's printed values (reference D.6.6; 81.9384 until
2026-11-09).
`dB = 20*log10(|counts|) + offset` or similar.
- **Variable-prefix segment descriptors** — 3 of the 75 ground-truth
production events still truncate. The walk reaches a segment header
whose channel-id field is preceded by a *variable-width* prefix (2, 4
@@ -1142,14 +817,6 @@ S3→BW (response):
## Critical protocol gotchas (hard-won — do not re-derive)
### SUB 5A — bulk waveform stream — NON-STANDARD frame format
> ⚠ **RETRACTED 2026-10-26 (measured): it is a standard frame.** The payload is
> `[10 00 5A 00][length BE][address BE 4][zeros 6]` with a SUM8 checksum, and every
> 02/03/04/10 is DLE-escaped (`s3_stuff`, `build_5a_request`). "offset_hi 0x10 raw" was
> the length 0x0200 escaped (`10 02 00`). The "DLE-aware checksum" is SUM8 of the
> unescaped payload. The "partial stuffing" carve-outs were the escape rule seen half.
> All 540 of Blastware's 5A requests rebuild byte for byte
> (`tests/test_5a_blastware_walk.py`). The text below is history.
**Always use `build_5a_frame()` for SUB 5A. Never use `build_bw_frame()` for SUB 5A.**
@@ -1190,9 +857,6 @@ the 1-2-26 BW TX capture (10 frames). Difference (3) confirmed against the 5-1-
"bwcap3sec" capture (17 frames, all match byte-for-byte after fix).
### SUB 5A — chunk counter formula (REWRITTEN 2026-05-01 — see 5-1-26 captures)
> ⚠ **SUPERSEDED 2026-10-26:** a chunk is addressed by a full 32-bit address, stepping
> +0x200 across page boundaries; no event-1 special case (see `read_bulk_waveform_stream`).
> ⚠️ **Everything that came before this rewrite was WRONG in important ways.** The previous
> formula `max(key4[2:4], 0x0400) + (chunk_num - 1) * 0x0400` happened to *work* for events
@@ -1277,11 +941,6 @@ several events should read 0x1002/0x1004 only once at the start.
`read_bulk_waveform_stream`.
### SUB 5A — STRT record encodes end_offset (NEW 2026-05-01)
> ⚠ **SUPERSEDED 2026-10-26:** the end is the FULL 32-bit `end_key`
> (`parse_strt_end_key`), read after removing the reply's escape bytes. The 16-bit
> `end_offset` below was the 64 KB page bug, and misread any end whose low bytes held
> an escaped 02/03/04.
The first A5 response (probe response, or the first chunk for event 2+) contains a STRT
record at byte offset 17 of the `data` field. Layout:
@@ -1311,11 +970,6 @@ Verified across 3 events:
| 5-1-26 "copy 2nd address" / DA event 2 | `011121F2` | `0111417E` | `0x417E` (event 2 span 0x1F8C = 8,076 B) |
### SUB 5A — TERM frame formula (FINALIZED 2026-05-01)
> ⚠ **SUPERSEDED 2026-10-26:** TERM is `build_5a_request(next_boundary, end -
> next_boundary)`: a read of the remainder at the next 32-bit boundary. "offset_word"
> is that length; "params[2:4]" are the address's low bytes. The tables below still
> hold as numbers.
The TERM frame fetches the partial last chunk *and* the file footer. It is **not** a simple
"goodbye" frame — its response payload contains the bytes between the last full 0x0200-aligned
@@ -1351,11 +1005,6 @@ are wrong; the device's response under that path is a tiny 101-byte device-side
(arrived only after we walked the entire post-event buffer), not the proper file footer.
### SUB 5A — fixed metadata pages 0x1002 and 0x1004 (NEW 2026-05-01)
> ⚠ **RETRACTED 2026-10-26 (measured):** these are not fixed global pages. They are the
> first event's own chunks at addresses 0x0200 and 0x0400, which escape to `10 02 00` and
> `10 04 00` on the wire. A non-first event has no such reads because it does not start at
> 0x0000. Their strings are still read as described below.
Two chunk addresses are GLOBAL device/session metadata, not event-specific:
@@ -1380,18 +1029,12 @@ locates the ASCII strings via label scans (`Project:`, `Client:`, `User Name:`,
dump the structural layout if more session-global fields need to be extracted.
### SUB 5A — params are 11 bytes for chunk frames, 10 for termination
> ⚠ **RETRACTED 2026-10-26:** every 5A request has the standard 10 params bytes (address +
> 6 zeros). The "11th byte" was the length's low byte, read as params.
`bulk_waveform_params()` returns 11 bytes (extra trailing `0x00`). The 11th byte was
confirmed from the BW wire capture. `bulk_waveform_term_params()` returns 10 bytes.
Do not swap them.
### SUB 5A — event-time metadata source (FINALIZED 2026-05-05)
> ⚠ **AMENDED 2026-10-26:** the strings come from the first event's chunks at 0x0200 and
> 0x0400, not from "global pages read once per session" (see the retraction above).
The metadata strings come from the two fixed metadata pages at counter `0x1002` and
`0x1004` (see "SUB 5A — fixed metadata pages 0x1002 and 0x1004" above). These pages
@@ -1433,11 +1076,6 @@ that's an old-walk artifact (the broken `0x0400`-step formula occasionally caugh
pages instead.
### SUB 5A — end-of-stream (FINALIZED 2026-05-01)
> ⚠ **AMENDED 2026-10-26:** a reply's `page_key` is not a page. It is the echoed
> length plus an escape byte the parser keeps: all 532 chunk replies read `0x0010` and
> the 8 TERMs `0x0000`/`0x0001`. The walk relies on it only for the mid-stream
> terminator check, and now sends TERM only for a tail (< 0x200).
Under the v0.14.0+ STRT-bounded walk the stream ends cleanly:
@@ -1603,7 +1241,6 @@ Confirmed from the 5-1-26 "Download All" capture:
1F → null sentinel
```
(⚠ 2026-10-26: the walk starts at the 0x46 key itself, as a plain 32-bit address.)
This is why event 2's first 5A chunk is at `start_key + 0x46` — that's the address of the
"real start" 0x46-record, distinct from the `0x2C`-record at the raw boundary. Use the
`0x46` keys as the input to `read_bulk_waveform_stream`, not the `0x2C` keys.
@@ -1708,7 +1345,7 @@ Do NOT use fixed absolute offsets for sample_rate or record_time.
| trigger_level_geo | float32 BE, located in channel block |
| alarm_level_geo | float32 BE, adjacent to trigger_level_geo |
| geo_hardware_constant (adc_scale_factor) | float32 BE at **channel_label+28** in both read (E5) and write (SUB 71) payloads — reads **6.206053** on BOTH tested units (BE11529 and BE18189); identical across all geo channels (Tran/Vert/Long) and all captures. **Confirmed 2026-04-17 from Interface Handbook §4.5**: this is the **ADC-to-velocity scale factor** = 1/sensitivity = (in/s per V). Firmware uses it as: `PPV (in/s) = ADC_voltage × 6.206053`. Cross-check: `1.61133 V (ADC full-scale) × 6.206053 = 10.000 in/s` (Normal range ✅). Do NOT write this field — it is a hardware/firmware constant. |
| geo_range (sensitivity selector) | **uint8 at channel_label+33** in both read (E5) and write (SUB 71) payloads (an event file's setup copy has it at label+29: reference D.6.4) — **CONFIRMED 2026-04-20** from 4-20-26 geo sensitivity captures: `0x00` = Normal 10.000 in/s (standard gain), `0x01` = Sensitive 1.250 in/s (high gain). Present in all three geo channel blocks (Tran, Vert, Long). **NOTE: `channel_label+20` reads `0x01` on ALL captures regardless of range setting — it is NOT this field.** Note: the "SUB 71 write offset = +29" that appears in earlier analysis was an artifact of incorrect BW-style destuffing applied to write frame data — write frame data is RAW, so the literal `0x10` bytes in the channel block header are preserved, and the offset is the same as in the E5 read payload. |
| geo_range (sensitivity selector) | **uint8 at channel_label+33** in both read (E5) and write (SUB 71) payloads — **CONFIRMED 2026-04-20** from 4-20-26 geo sensitivity captures: `0x00` = Normal 10.000 in/s (standard gain), `0x01` = Sensitive 1.250 in/s (high gain). Present in all three geo channel blocks (Tran, Vert, Long). **NOTE: `channel_label+20` reads `0x01` on ALL captures regardless of range setting — it is NOT this field.** Note: the "SUB 71 write offset = +29" that appears in earlier analysis was an artifact of incorrect BW-style destuffing applied to write frame data — write frame data is RAW, so the literal `0x10` bytes in the channel block header are preserved, and the offset is the same as in the E5 read payload. |
| setup_name | ASCII, null-padded, in cfg body |
| project / client / operator / sensor_location | ASCII, label-value pairs |
@@ -1822,32 +1459,12 @@ for 0x10 records).
GET /device/info?port=COM5 ← serial
GET /device/info?host=1.2.3.4&tcp_port=9034 ← cellular
GET /device/events?host=1.2.3.4&tcp_port=9034&baud=38400
GET /device/events?serial=UM20147&host=...&tcp_port=... ← list with event_id, either series (no 5A on a MiniMate)
POST /device/events/download?serial=UM20147&event_id=...&host=... ← download, check, store; returns db_event_id
GET /device/event?host=1.2.3.4&tcp_port=9034&index=0
GET /device/monitor/status?host=1.2.3.4&tcp_port=9034 ← battery, memory, mode
POST /device/monitor/start?host=1.2.3.4&tcp_port=9034 ← start recording
POST /device/monitor/stop?host=1.2.3.4&tcp_port=9034 ← stop recording
POST /device/monitor/start?serial=UM20147&host=...&tcp_port=...&dry_run=&even_if_already= ← audited start, either series
POST /device/monitor/stop?serial=UM20147&host=...&tcp_port=...&dry_run=&even_if_already= ← audited stop, either series
GET /device/settings?serial=UM20147&host=1.2.3.4&tcp_port=9034 ← shared-model settings, either series
POST /device/hangup?host=1.2.3.4&tcp_port=9034 ← release a held Series-4 line
```
`serial=` (UM = Series 4, BE/BA = Series 3) on `/device/info`, `/connect`,
`/monitor/status`, `/settings` returns the shared model, uncached; on `/events` and
`/events/download` it lists and downloads by `event_id`; on `/monitor/start` and
`/monitor/stop` it runs the audited change (`dry_run=true` returns the frames and sends
nothing; `even_if_already=true` sends even when the unit is already in that state). A
`UM` serial on any other `/device/*` route is 501; any request taking the legacy
Series-3 path at a held Series-4 address is 409.
The legacy Series-3 writes and erase (`POST /device/config`, `/config/project`,
`/events/erase`, `/rescue`, `POST /device/call_home`) take an optional `serial=` and
refuse 409, nothing sent, when the unit at the address does not answer as Series 3
or is not the named unit. The stop tools (`monitor/start|stop` without a serial,
`stop_monitoring_blind`, `_slow_drip`, `_spam`) are exempt by design.
SFM must run a single uvicorn worker (locks and held lines are per process).
Server retries once on `ProtocolError` for TCP connections (handles cold-boot timing).
### DB read endpoints (query seismo_relay.db written by ach_server.py)
@@ -1858,7 +1475,6 @@ GET /db/events?serial=BE11529&from_dt=&to_dt=&limit= ← triggered events, ne
GET /db/monitor_log?serial=BE11529&from_dt=&to_dt= ← monitoring intervals, newest first
GET /db/sessions?serial=BE11529&limit=50 ← ACH call-home sessions, newest first
PATCH /db/events/{id}/false_trigger?value=true ← flag/unflag false triggers
GET /db/device_commands?serial=UM20147&limit=100 ← start/stop audit trail (sent, states), newest first
```
DB file: `bridges/captures/seismo_relay.db` (default; override with `--db-path` at startup).
@@ -1870,30 +1486,17 @@ All DB endpoints are read-only except `PATCH /db/events/{id}/false_trigger`.
| Capture | Location | Contents |
|---|---|---|
| 1-2-26 | `bridges/captures/1-2-26/` | SUB 5A BW TX frames — confirmed 5A frame format, 11-byte params, DLE-aware checksum (⚠ that model retracted 2026-10-26: a standard frame, length + 32-bit address) |
| 1-2-26 | `bridges/captures/1-2-26/` | SUB 5A BW TX frames — confirmed 5A frame format, 11-byte params, DLE-aware checksum |
| 3-11-26 | `bridges/captures/3-11-26/` | Full compliance setup write, Aux Trigger capture |
| 3-31-26 | `bridges/captures/3-31-26/` | Complete event download cycle (148 BW / 147 S3 frames) — confirmed 1E/0A/0C/1F sequence; only 1 event stored so token=0xFE appeared to work |
| 4-3-26 | `bridges/captures/4-3-26/` | Browse-mode S3 capture with 2+ events — confirmed all-zero params for 1F, 1F response layout, null sentinel, 0A context requirement |
| 4-27-26 | `bridges/captures/4-27-26/` | BW "open 2sec waveform" + "copy event to disk" + paired SFM "seismo_dl" — first proof that SFM was over-reading 5× past event end. BW reads 14 chunks at 0x0200 increments + TERM at end_offset; SFM was reading 37 chunks at 0x0400 increments. STRT end_key field located. |
| 5-1-26 | `bridges/captures/5-1-26/comcheck/` | Three sub-captures: SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945`/`_171216`). Confirmed: TERM frame formula across 3 events; metadata pages 0x1002/0x1004 are global (read once per session) (⚠ retracted 2026-10-26: event 1's chunks at 0x0200/0x0400); event-1 vs event-N chunk-pattern split; WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundaries. |
| 5-1-26 | `bridges/captures/5-1-26/comcheck/` | Three sub-captures: SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945`/`_171216`). Confirmed: TERM frame formula across 3 events; metadata pages 0x1002/0x1004 are global (read once per session); event-1 vs event-N chunk-pattern split; WAVEHDR length 0x46 vs 0x2C disambiguates real events from boundaries. |
---
## Write commands (SUBs 68–83) — confirmed 2026-04-07
> ⚠ **RETRACTED 2026-10-27 (#46, measured): write frames are ordinary requests.**
> Every 02/03/04/10 is escaped and the checksum is SUM8 of the payload, as in every
> request. The length field [4:6] is the data's length. A config block is its own
> length N + 2 bytes; the compliance image (2,092) goes in addressed chunks
> (params[2:4]; 512 B now, 1,024 B in March). This re-encodes all 3,869 Blastware
> requests from February to April, plus 26 write frames from 2026-10-26. The
> "raw except BW_CMD", "DLE-aware checksum", "offset = data[1] + 2" and "71×3 at
> 0x1004" below were the same frames read with their escape bytes in. The trigger
> block is READ (SUB 0x2E) -- its byte 5 differs by unit -- not a fixed blob.
> Code: `build_bw_write_frame`, `protocol.write_image`, `b5037b0`. The text below
> is history.
All confirmed from 3-11-26 BW TX capture (`raw_bw_20260311_170151.bin`, frames 102–112).
### Write frame format — CRITICAL: minimal DLE stuffing
@@ -2053,8 +1656,7 @@ A re-analysis in the prior session incorrectly concluded `section[1]` is always
and is device-specific. The 2026-04-09 re-analysis confirms `section[1]` was right.
**IMPORTANT — `frame.data` has checksum already stripped** by `S3FrameParser._finalise()`
(`raw_payload` = the body less its checksum, and less the `10` of an escaped one since #58;
`data = raw_payload[5:]`). There is NO trailing checksum byte in
(`raw_payload = body[:-1]`; `data = raw_payload[5:]`). There is NO trailing checksum byte in
`section`. All relative-from-end offsets must account for this.
Battery and memory fields are present in **both** states:
@@ -2469,7 +2071,7 @@ body) because writing a dial string may require DLE escaping for embedded contro
- **Database** — SQLite store for events + monitor log entries; dedup by key; queryable
- **Histograms** — decode histogram-mode A5 data (noise floor tracking)
- **Blastware-compatible file output** — `write_blastware_file()` and `write_mlg()` implemented. `blastware_filename()` generates correct Blastware filenames (AB0 for direct, AB0W/AB0H for ACH). **SFM's own MiniMate downloads carry the W/H letter (2026-10-30):** `with_type_letter()` reads it from the file's STRT[18] (#41) on all three naming paths (device-access download, `WaveformStore.save`, the legacy `/device/event/{i}/blastware_file`); Blastware's direct downloads leave it off. **Confirmed BYTE-PERFECT against BW reference (v0.14.3, 2026-05-05):** when fed the BW 5-1-26 3-sec capture's A5 frames, the SFM-built file matches BW's saved `M529LKIQ.G10` byte-for-byte (8708 bytes, 0 differences). Live SFM downloads of event 0 (3-sec) and event 1 (3-sec continuation) both open cleanly in Blastware with full Event Reports, frequency analysis, and waveform plots. Body assembly is just contiguous concatenation of frame contributions in stream order (probe → meta@0x1002 → meta@0x1004 → samples → TERM); no stripping, no overlay, no special handling. Histogram+Continuous mode deferred (5A stream for those events embeds histogram interval records that may need different handling — untested under v0.14.x). Extension mapping: extensions encode timestamp (AB0T for ACH, AB0 for direct), NOT recording mode. Filename format: `<prefix_letter><serial3><4-char-base36-stem><ext>`
- **Blastware-compatible file output** — `write_blastware_file()` and `write_mlg()` implemented. `blastware_filename()` generates correct Blastware filenames (AB0 for direct, AB0W/AB0H for ACH). **Confirmed BYTE-PERFECT against BW reference (v0.14.3, 2026-05-05):** when fed the BW 5-1-26 3-sec capture's A5 frames, the SFM-built file matches BW's saved `M529LKIQ.G10` byte-for-byte (8708 bytes, 0 differences). Live SFM downloads of event 0 (3-sec) and event 1 (3-sec continuation) both open cleanly in Blastware with full Event Reports, frequency analysis, and waveform plots. Body assembly is just contiguous concatenation of frame contributions in stream order (probe → meta@0x1002 → meta@0x1004 → samples → TERM); no stripping, no overlay, no special handling. Histogram+Continuous mode deferred (5A stream for those events embeds histogram interval records that may need different handling — untested under v0.14.x). Extension mapping: extensions encode timestamp (AB0T for ACH, AB0 for direct), NOT recording mode. Filename format: `<prefix_letter><serial3><4-char-base36-stem><ext>`
**Serial encoding (CONFIRMED 2026-04-22):** `prefix_letter = chr(ord('B') + floor(serial_numeric / 1000))`, `serial3 = f"{serial_numeric % 1000:03d}"`. Examples: BE6907→H907, BE11529→M529, BE14036→P036, BE17353→S353, BE18003→T003. The prefix letter encodes the production generation (batch of 1000 units).
@@ -2505,7 +2107,7 @@ body) because writing a dial string may require DLE escaping for embedded contro
| Folder / File | Contents |
|---|---|
| `1-2-26/` | First SUB 5A BW TX capture — established 5A frame format (raw offset_hi, DLE-aware checksum). 10 frames verified. (⚠ model retracted 2026-10-26) |
| `1-2-26/` | First SUB 5A BW TX capture — established 5A frame format (raw offset_hi, DLE-aware checksum). 10 frames verified. |
| `3-11-26/raw_bw_20260311_170151.bin` | Full compliance write + event download (SUBs 68→83 confirmed, frames 102–112) |
| `3-31-26/` | Single-event download (148 BW / 147 S3 frames) — 1E/0A/0C/1F sequence confirmed (single event so token=0xFE appeared to work in either branch) |
| `4-2-26/` | Download-mode BW TX capture — POLL×3 requirement confirmed (frames 68-73 between 1F and first 5A) |
@@ -2517,7 +2119,7 @@ body) because writing a dial string may require DLE escaping for embedded contro
| `4-20-26/geo sensitivity/` | Geo sensitivity changes: 1.25 in/s (Sensitive), 10 in/s (Normal) |
| `4-20-26/call home settings/` | Call home config read/write captures |
| `4-27-26/` | BW "open 2sec waveform" + "copy event to disk" + paired SFM "seismo_dl" — first proof of 5× SFM over-read. STRT end_key field located. |
| **`5-1-26/comcheck/`** | **Triplet of captures that nailed the v0.14.0 walk:** SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945` / `_171216`). Confirmed: TERM frame formula across 3 events, metadata pages 0x1002/0x1004 are global session metadata (⚠ retracted 2026-10-26: event 1's chunks at 0x0200/0x0400), event-1 vs event-N chunk pattern split, WAVEHDR off=0x46 vs 0x2C disambiguates real events from boundaries. |
| **`5-1-26/comcheck/`** | **Triplet of captures that nailed the v0.14.0 walk:** SFM 3-sec download (`seismo_dl_…`), BW comms-check + 3-sec download (`bwcap3sec/`), BW second-event download + "Download All" (`raw_*_170945` / `_171216`). Confirmed: TERM frame formula across 3 events, metadata pages 0x1002/0x1004 are global session metadata, event-1 vs event-N chunk pattern split, WAVEHDR off=0x46 vs 0x2C disambiguates real events from boundaries. |
| **`5-1-26/comcheck/bwcap3sec/`** | **The byte-perfect reference for v0.14.3.** All 17 BW 5A request frames (probe, 2 metadata, 13 samples, TERM) reproduce byte-for-byte from SFM's framing helpers — including the `10 10 00` DLE-stuffed counter for sample @ 0x1000 that was the long-standing failure mode. |
| `5-4-26/` | BW MITM captures of "copy 3sec / 2sec / Download All" + paired SFM session (`seismo_dl_20260504_145701`) showing the +0x46 event-N probe bug producing 110-chunk runaway walk. Cross-references against 5-1-26 confirmed device behavior is identical. |
+6 -59
View File
@@ -1,4 +1,4 @@
# seismo-relay `v0.34.0`
# seismo-relay `v0.33.0`
A ground-up replacement for **Blastware** — Instantel's aging Windows-only
software for managing seismographs. Supports both the **MiniMate Plus
@@ -95,25 +95,6 @@ over direct RS-232 or cellular modem (Sierra Wireless RV50 / RV55).
>
> ⚠ The deploy owes a backfill; it does not move event times. See the
> changelog's *Migration*.
>
> **v0.34.0 (2026-11-04)** reaches Series-4 parity and reads most of
> Blastware's report from the event file alone.
> - **Series-4 parity:** one device door by serial for both series, with
> reads, downloads, start/stop, call-home and settings changes, each audited
> and read back. MiniMate request framing is fixed (#46).
> - **The file-only decode:** 47 of Blastware's 88 report fields match on
> every DL2 event, and 8 more on all but one or two.
> - Sensitive-range events are no longer 8× high.
> - Histograms decode correctly and carry Blastware's own times (#51).
> - Interval frequencies follow the sample rate (#50).
> - New from the file: the job number, serial, version, calibration,
> battery, trigger source and levels, interval detail, peak times and
> peak acceleration.
> - **Events are identified by unit + time + type.**
>
> ⚠ The deploy migrates the events table and owes an overnight backfill that
> moves every Series-3 histogram time by one second. See the changelog's
> *Migration*.
> See [CHANGELOG.md](CHANGELOG.md) for full version history.
---
@@ -232,25 +213,10 @@ via a thread-safe `_LiveCache` (plain Python dict + `threading.Lock`):
| `POST` | `/device/monitor/start` | Sends SUB 0x96; immediately evicts status cache |
| `POST` | `/device/monitor/stop` | Sends SUB 0x97; immediately evicts status cache |
| `POST` | `/device/call_home` | Reads, patches specified fields, writes back to device |
| `GET` | `/device/settings` | Recording settings in the shared model, either series; serial required; never cached |
| `POST` | `/device/hangup` | Releases a held Series-4 line now; `{"hung_up": bool}` |
| `GET` | `/device/events?serial=` | Lists a unit's events, either series, each with an opaque `event_id` (`serial:key:timestamp`). A MiniMate list reads headers only (no bulk download), on the normal timeout, and gives `record_type: null` (its event record does not say waveform or histogram; not decoded yet). A lost walk reply fails the list rather than shortening it (a lost event-record reply still lists that event, without a timestamp) |
| `POST` | `/device/events/download?serial=&event_id=` | Downloads one event, checks it, and stores it in SFM's database; returns `db_event_id` (file at `GET /db/events/{db_event_id}/blastware_file`). A stale `event_id` (unit erased or wrapped since the list) gets **409** without downloading, for both series; an `event_id` from another unit gets **422**, before any I/O. An event already stored — by an earlier download, or by THOR's or Blastware's call-home watcher — returns its existing row and changes nothing (same `db_event_id`, `inserted: false`, `detail.already_stored: true`). The unit is busy for the whole download; other requests to it get 423 |
**Cache bypass** — All cached endpoints accept `?force=true` to skip the cache and
force a fresh read from the device.
**Serial-named requests (Series 3 and 4)** — `/device/info`, `/device/connect`,
`/device/monitor/status` and `/device/settings` accept `serial` (`UM...` = Series 4
Micromate, `BE...`/`BA...` = Series 3 MiniMate Plus) and return one shared model
for either series. Serial-named requests are **not cached** and ignore `force`.
Without `serial` the legacy Series-3 behaviour is unchanged. Any other `/device/*`
route given a `UM` serial answers **501** ("not supported for Series 4 yet"), and any
request that takes the legacy Series-3 path (no `serial`, or a `BE`/`BA` serial on a
route that does not take one) at an address holding a Series-4 line answers **409**
(use `POST /device/hangup` first). Series-4 lines are held open between requests, so
SFM must run a **single uvicorn worker**: locks and held lines are per process.
**Cache stats** — `GET /cache/stats` returns hit/miss counts and TTL info; `DELETE /cache/device`
clears the device cache immediately.
@@ -655,35 +621,16 @@ Implementation steps (concrete):
### High-impact (unblocks product features)
- [x] **Series III waveform body codec reverse-engineering.** ✅ The body codec is fully decoded (`minimateplus/waveform_codec.py`, `histogram_codec.py`), and verified per-sample against Blastware's own exports. Geophone samples are exact on all 6,524 DL2 waveforms against their `_XML.XML` reports, across 2016–2026 (`dev`; v0.33.0 had 6,491, before the geophone range was read from the file).
- [ ] **SFM produces everything Blastware reports, from the event file alone.**
**Why this matters:** until it's done, prod overlays Blastware's ASCII report onto SFM's decode wherever a report exists. That made SFM trustworthy from day one, but it is scaffolding: the goal is full function without Blastware.
The four-piece plan:
- [x] **Series III waveform body codec reverse-engineering.** ✅ The body codec is fully decoded (`minimateplus/waveform_codec.py`, `histogram_codec.py`), and verified per-sample against Blastware's own exports. As of v0.33.0, geophone samples are exact on 6,491 / 6,524 DL2 waveforms against their `_XML.XML` reports, across 2016–2026.
- [ ] **SFM produces everything Blastware reports, from the event file alone.** The four-piece plan:
1. the decode checker ✅ v0.33.0
2. complete the file-only decode, one field group at a time, each proven by the checker
3. flip ingest so reports are kept only for checking (retire the overlay)
3. flip ingest so reports are kept only for checking
4. stop the watchers forwarding reports
**Done so far: 47 of 88 report fields match on every DL2 event.**
- In v0.33.0: setup fields, notes, event type, histogram PVS, mic.
- On `dev`:
- the geophone range
- the job number
- histograms that decoded wrongly
- the footer: no more day-late histograms; every waveform time exact
- serial, version, calibration, battery, trigger source and levels, stop mode, mic type
- histogram interval detail: frequencies (#50 fixed), per-interval PVS, interval size, stop
- histogram start, stop, interval and peak times (#51 fixed); events keyed unit + time + type
- A Blastware report's dB/psi is its PC's preference, not anything in the event file: a carve-out.
**Done so far:** setup fields, notes, event type, histogram PVS, mic.
**Next:**
- the values Blastware computes itself: ZC frequency, acceleration, displacement, time of peak
- the sensor check results
- the monitor log
Design: `docs/superpowers/specs/2026-10-29-s3-decode-checker-design.md`. Status detail: CLAUDE.md "Where things stand".
**Next:** histogram start times (#51), the 37 histograms that decode wrongly, the job number, the geophone range (Sensitive-range events read 8×), and the values Blastware computes itself (ZC frequency, acceleration, displacement, time of peak), plus the sensor check, battery, calibration and monitor log. Design: `docs/superpowers/specs/2026-10-29-s3-decode-checker-design.md`.
- [x] **Series IV (Thor IDF) binary codec reverse-engineering.** ✅ v0.21.0 — `micromate/idf_file.read_idf_file()` decodes both IDFW (waveform body at offset `0x0f1f`, reusing `decode_waveform_v2()`; 87–99% sample fidelity on quiet events) and IDFH (dedicated segment-based decoder: all 859 corpus files decode, 181,071 intervals, peaks within ~1.8% of sidecar values). `WaveformStore.save_imported_idf` now also projects parsed Thor data into a `bw_report` block via `micromate/idf_to_bw_report.py` so Thor events render in the existing Event Report PDF pipeline without a separate renderer.
- [ ] **In-app waveform viewer accuracy.** Depends on Series III codec decode. Plot.v1 JSON pipeline + viewer skeleton already exist; will start showing real waveforms automatically once `_decode_a5_waveform` produces correct samples. Series IV waveforms come online when the IDF codec lands.
- [ ] **Series IV live-device support.** Once the IDF binary is decoded, extend `micromate/` with `transport.py` / `framing.py` / `protocol.py` / `client.py` mirroring the `minimateplus/` package layout — depends on capturing Thor's wire protocol (TCP / RS-232 captures TBD).
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env python3
"""Dry run a Micromate write against a live unit: do the reads, print the plan.
Sends READS only. The write frames are built from the unit's own blocks and
printed for review -- step 1 of the bench protocol for every first live write
(parity spec, Testing). The protocol's opcode gate refuses every write SUB on
this connection, so nothing else can go out even by mistake.
sg dialout -c ".venv/bin/python bridges/mm_dry_run.py /dev/ttyACM0 call-home-off"
.venv/bin/python bridges/mm_dry_run.py --host 10.0.0.5 --tcp-port 9034 setup-rewrite
The JSON carries a `reads` block (length of each block read, and for
setup-rewrite the blocks themselves in hex) so the plan can be checked against
what the unit actually said.
⚠ `0x1A` reads the keypad's edit buffer live. A setup read taken while someone
is in the unit's menu includes their unsaved edits, and pushing that plan would
commit them.
⚠ The setup-rewrite JSON embeds the unit's whole `0x1A` block (job number,
notes), so do not paste it anywhere public.
"""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from micromate.client import CONTENT, MicromateClient # noqa: E402
from micromate.writes import ( # noqa: E402
plan_call_home_enabled, plan_setup_push, plan_start_monitoring, plan_stop_monitoring,
)
from minimateplus.transport import SerialTransport, TcpTransport # noqa: E402
ACTIONS = ("start", "stop", "call-home-on", "call-home-off", "setup-rewrite")
def _content(data: bytes) -> bytes:
"""The protocol's read_* methods return the response data with its 11-byte prefix."""
return bytes(data)[CONTENT:]
def main() -> int:
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
ap.add_argument("port", nargs="?", help="serial port, e.g. /dev/ttyACM0")
ap.add_argument("action", choices=ACTIONS)
ap.add_argument("--host")
ap.add_argument("--tcp-port", type=int, default=9034)
ap.add_argument("--baud", type=int, default=115200)
a = ap.parse_args()
if not (a.port or a.host):
ap.error("give a serial port or --host")
transport = TcpTransport(a.host, port=a.tcp_port) if a.host else SerialTransport(a.port, a.baud)
mm = MicromateClient(transport) # no execute(): nothing here can transmit a write
mm.open()
try:
info = mm.connect()
p = mm.protocol
reads = {}
if a.action == "start":
plan = plan_start_monitoring()
elif a.action == "stop":
plan = plan_stop_monitoring()
elif a.action.startswith("call-home"):
ch = _content(p.read_call_home_config())
reads["0x2C"] = {"len": len(ch)}
plan = plan_call_home_enabled(ch, a.action == "call-home-on")
else:
name = mm.get_active_setup()
prefs = _content(p.read_event_index())
trig = _content(p.read_trigger_config())
setup = _content(p.read_compliance_config())
reads = {"active_setup": name,
"0x08": {"len": len(prefs), "hex": prefs.hex()},
"0x2E": {"len": len(trig), "hex": trig.hex()},
"0x1A": {"len": len(setup), "hex": setup.hex()}}
plan = plan_setup_push(prefs, trig, setup, name)
out = plan.describe()
out["unit"] = {"serial": info.serial, "firmware_line": info.firmware_line}
out["reads"] = reads
print(json.dumps(out, indent=1))
finally:
mm.close()
return 0
if __name__ == "__main__":
sys.exit(main())
File diff suppressed because it is too large. Load diff
+2 -310
View File
@@ -1782,36 +1782,6 @@ Do **not** retune `_GEO_LSB_IPS` — this is corroboration, not a correction.
- **Scheduler / call-home writes.** `callhome.MMB` is a file too, so it may go
through the same `0xDA` + block-write shape with a different target name.
### Write-plan dry run on a second unit and firmware line (2026-10-22)
Firmware, stated as line and version separately. UM20147: Thor firmware line
(flags `0x03`, measured 2026-10-22), version 11.0BD per the 2026-09-30 check;
UM12947: Blastware firmware line (flags `0xC5` in all 152 responses of the
seven write sessions), version 11.0CB.
2026-10-22 — UM20147 block sizes equal UM12947's: `0x1A`
content 2092 B, `0x08` 90 B, `0x2E` 28 B, `0x2C` 126 B (all CRCs good where a
CRC applies). Its dry-run plans (`bridges/mm_dry_run.py`) have the same SUB
order, offsets and data lengths as THOR's frames from UM12947: `0x96` / `0x97`
(offset `0xFFFF`, 0 B); `0x7E` @ `0x007E` 126 B + `0x7F`; `0xDA` @ `0x0100` 256 B,
`0x68` @ `0x005A` 88 B, `0x73`, `0x82` @ `0x001C` 28 B, `0x83`, `0x71` @ `0x082C`
2090 B, `0x72`. So THOR's write offsets apply to both firmware lines **as far
as size goes** (measured, one unit each; **nothing sent** -- reads only; the
opcode gate was armed throughout and refused nothing, because no write was
attempted). Not shown: that 11.0BD *accepts* these
frames. The call-home on/off plans differ in exactly one data byte (`[5]`);
the setup-rewrite `0x71` data equals the unit's `0x1A` content `[3:2090]` behind
three zero bytes.
🔶 **Unobserved:** UM20147 call-home `content[5]` reads `0x01` (THOR's UM12947:
`0x04`/`0x05`). Our "off" plan writes `0x00`, which no capture shows being
written. Unobserved; settle at the phase-4 bench.
Breadth of the reproduction (measured): across the five pushes, the `0xDA`,
`0x68` and `0x82` inputs are byte-identical (one distinct name, prefs and
trigger block), and the three no-edit `0x71` reproductions are the same frame.
So each block was reproduced from one distinct input, not five.
### ✅ `0xDA` CREATES setup files (confirmed on the device, 2026-09-24)
`TEST1.mmb` did not exist on the unit before the push. Afterwards it is
@@ -1925,15 +1895,6 @@ at `payload[3:5]`:
| 2nd | `0x0002` | 535 B | the file body |
| 3rd | `0x0000` | 11 B | all zeros = **end of file** |
✅ **SFM reads the schedule this way, read-only (2026-11-03, phase 5)** --
`MicromateProtocol.read_file` / `MicromateClient.read_schedule`, frames equal to
THOR's byte for byte (`tests/test_micromate_schedule.py`). Two details the table
above leaves out: the `0x94` request carries **`params[3] = 1`**, and the **first**
`0x48` carries **`params[7] = 1`** (the later ones all-zero params); both `0x48`
offsets are `0xFFFF`. A long file is **written** in 1,024-byte `0x8E` pieces
(the five-entry *actioncheck* schedule went as 1,024 + 280). ⚠ Unmeasured: what
`0x94` / `0x48` return for a unit with no schedule file.
⚠ This is the single most consequential find of the session, because it is not
specific to the scheduler. **`callhome.MMB` is a file too**, and the call-home
config is the last unsolved piece of the project. Reading it should be a
@@ -2226,13 +2187,6 @@ having: nothing else read so far reports the unit's own time.
↑ data[11]: 0x02 monitoring, 0x00 idle
```
> **Amended 2026-10-25.** There are four values now. `0x03` is a call-home
> session; see *Correction: `SUB 0x49` has a third state value*. `0x01` reads
> for about 18 s after a stop; its meaning is inferred to be a call-home attempt
> that has not connected. See *The first commands this project originated against a Micromate*.
> `0x02` was also read 2.5 s after a start, while the screen showed the sensor
> check.
**A second monitoring indicator, in a 21-byte response instead of `0x1C`'s 60.**
Different encoding from `0x1C`'s flag (`0x02` vs `0x0E`), so they are separate
fields, not the same byte read twice. For a polling client this is the cheaper
@@ -2573,28 +2527,6 @@ POLL 0x15 0x49 POLL 0x1C 0x15 0x49 0x06
0x93 0x06 0x93 0x1E 0x0A×9 ← re-walk the list
```
**2026-10-21 -- direct-by-key download equals the interleaved download (measured, one unit over USB, 5 events listed, 1 waveform compared).**
On UM20147 (`/dev/ttyACM0`), with `list_events()` having walked the cursor to the
end of the chain, `download_event(ref, chunk_size=1024)` of `055d4a82` returned
30,230 B, byte-identical to the same event fetched inside `iter_events()` at the
cursor, and to the file SFM stored through the server (30,230 B).
So `0x5A` does not need the cursor parked at the event, at least on this unit
and event; not tried on a BD unit, over cellular, or on a histogram.
`s4_download_event` was not changed.
**2026-10-21 -- in Histogram Combo, a histogram's `0x0C` peaks equal the largest
waveform recorded inside it (measured, UM20147, 2 histogram/waveform pairs).**
UM20147's list showed histogram 13:27:33 and waveform 13:27:43 with identical
peaks and PVS to the last float bit, and likewise histogram 13:28:09 and
waveform 13:59:33 (31 minutes apart, before the next histogram at 13:59:53).
Not a listing bug: the histogram file's *own* interval data peaks at vert 5,021 /
tran 735 / long 675 counts = 1.5581 / 0.2281 / 0.2095 in/s at 0.000310308 in/s
per count, the waveform's peaks exactly. The histogram's record reports the
maximum over its whole window. 🔶 Inferred: the record is finalised when the
window closes but stamped with its start, which is how it can carry the peak of
a waveform that triggered later inside it. Do not "fix" equal peaks across
such a pair.
**`SUB 0x93` → ack `0x6C`** is sent before every event, with empty params and an
all-zero ack. It is the Series IV analogue of Series III's `1E(token=0xFE)` arm
step, and it is simpler: no token, no params.
@@ -2702,82 +2634,10 @@ noted, which is cheap to collect during any future ACH capture.
Neighbouring bytes: `write[117]` is `0x03`, lining up with Series III's
`num_retries` of 3, and `write[120:122]` is `00 3c` = 60.
#### Bench 2026-11-03: SFM's own call-home writes to UM20147
SFM's audited `POST /device/call_home/{enable,disable}`, one send per go.
Audit records are in the bench DB.
**Measured, idle:**
- UM20147 reads `content[5] = 0x01` for on. It **accepts `0x00` for off**, a
value THOR was never seen writing. The read-back reads off, and the unit's own
menu said "Auto Call Home: Disabled"; on again, "Enabled".
- **A no-op write is acked** (`0x81`, `0x80`), and `[118:120]` does **not** move:
`8fab` → `8fab`.
- **Flipping bit 0 of `[5]` moves `[118:120]` by XOR `0x6D7D`, both directions:**
`8fab` ↔ `e2d6`. That is the same XOR as UM12947's `0x04` ↔ `0x05` above, on
a different unit with a different block. Writing the original block back
restores the original value (`8fab`).
This **settles the open question above (hash vs nonce): it is not a per-write
nonce.** The field is a function of the block's content, and the fixed delta
for a fixed bit flip is the signature of a linear checksum (CRC family) over a
region that includes `[5]`. The fixed-delta part is *inferred*. A desk lead:
solve the polynomial from the deltas; the earlier sweep's regions or variants
were wrong.
**Measured, monitoring:**
- The unit returns its **real** call-home block (`00 7C DC`…).
- It **acks** a `0x7E`/`0x7F` write but **does not apply it**: three read-backs
over 3 s were unchanged, and `[118:120]` did not move. After the stop,
call-home still read on, so the write was **ignored, not staged**.
- Its own menu refuses the call-home screen while monitoring: **"Feature
disabled while monitoring"**.
- SFM therefore refuses a call-home change while monitoring (`f35845d`).
**Measured, also:**
- A stop with call-home on started a call-in **after** the stop's ack. SFM hung
up within about 1 s, and the call **reached THOR**: the session's histogram
arrived. (2026-10-29 Run A lost the call: there the ring replaced the ack.)
- UM20147's clock read one hour ahead after daylight saving ended (16:09:25 at
15:09:22 EST).
⚠ Beyond the enable byte and the dial string, **the field map is not
established** — only one setting was varied. Series III's offsets are a starting
hypothesis, not a transfer.
#### Bench 2026-11-04: SFM's first setup push (UM20147)
SFM's audited `POST /device/settings/change`, one send per go (Brian at the
unit). Notes: `~/bench-logs/2026-11-04-sfm-settings/`.
**Measured:**
- **The setup push works as THOR's.** Trigger 0.6 → 0.5, then a five-field
change (Location, Client, job number + its report flag, record time), then a
full restore. Each send was THOR's seven frames, acknowledged in THOR's order
(`25 97 8C 7D 7C 8E 8D`), read back as sent, and confirmed in the unit's menu.
The setup block ended byte for byte as found, CRC included.
- **The unit's recomputed CRC equals SFM's** (`with_crc`): after the first push
the stored block equalled SFM's computed image byte for byte, CRC `ea8d`
included.
- **`schedule.dat` read on a real unit** (`0x94` → `0x6B`; `0x48` → descriptor
`04 00 … 01 … 01`, body, all-zero end). UM20147 holds a leftover THOR
schedule: repeat on, 07:00, start monitoring with
`Fay - Commercial Street - Irish Center.mmb`. The unit runs `test2.MMB`, so
SFM blocked the change, as designed.
- 🔑 **The scheduler On/Off switch is in none of the blocks SFM reads.** With
the keypad switch Off, then On (saved), these were byte for byte identical:
`0x08` prefs, `0x2E`, `0x1A`, `0x2C`, `0x41` and `schedule.dat`. The
firmware's `SysPref.bMonitorScheduler` lives elsewhere. THOR's end-of-push
`0x47` pair (`params[7]` 1 then 3; replies `04 00 … 0N … 00 01`) was only
ever captured with the switch On. **Next:** a THOR bridge recording with the
switch Off (parked for the work-hours project).
- **While monitoring**, a settings preview and a live attempt were both refused
on the run state before any block was read (409, nothing sent, 0 write frames).
- **With call-home off, a stop goes straight to idle** (`monitoring` →
`idle`): no calling-home state and no ring.
- Call-home `0x01` ↔ `0x00` was taken again, both ways. The plan's
"unobserved" warning is retired for those values.
## What the THOR manual settles about the ACH session (2026-09-24)
Source: `manuals/723U0201 THOR Operator Manual Rev 08.pdf` §6.2, §3.6.
@@ -3010,58 +2870,6 @@ There is no inbound connection, no dial, nothing to accept.
to every unit continuously — 1,039 lines of it in 37 minutes. The call-home
mechanism depends on that connection existing.
> **2026-10-29 (Brian, operator-reported; not measured by us):** the watchdog's
> interval is a THOR setting. It can check every 5 s, every hour, or never. The
> 1,039 lines above were taken at whatever that THOR was set to, so "continuously"
> describes that setting, not THOR's fixed behaviour. Two things are still
> unmeasured: whether a check holds the line open afterwards or drops it, and
> how a unit's call-home reaches THOR when the watchdog is set to never (the
> modem dialling out to `ListenerAchTcp`, presumably, which this capture never
> saw used). The ring-path bench test in the parity spec now varies this
> setting on purpose.
#### THOR's logs, and what the 2026-10-29 log showed
**Location: `C:\THORDATA\Logs\` on the THOR PC** (Brian, 2026-10-29). The main
log is `thor.log.<YYYY-MM-DD>`.
Measured from that day's log (UM20147 added as a bench test unit, on a fleet-config
RX55 at `63.45.161.30`):
- **Watchdog cadence on this THOR:** per unit, `GET UNIT Connection STATUS` →
`ReadSerialNumber` → "received connected" every **~15 s**, with
`GET UNIT STATUS` → `ReadUnitStatus` reads in between.
- **`Unit_CommandOutOfRange` follows `ReadUnitStatus` for every unit** (UM20146,
UM13981, UM14133, UM6047, UM11719, UM11402, UM12420, UM20147), so it is
fleet-wide noise, not a fault of one unit. 🔶 Inferred: THOR's status read
includes a command the firmware rejects.
- **After a manual Disconnect in THOR (19:48:07), UM20147 stopped answering
anyone.** Until then THOR read its serial every ~15 s. After it, SFM's
call-ups (19:51:35, 19:52, 20:01) were accepted by the modem and got **zero
bytes** back, and THOR's own reconnect at 19:57:10 logged `Mismatch connection
found for 63.45.161.30:9034` four times, then "lost connection" at 19:57:38.
Cause not yet known (a unit reset and a modem power cycle did not restore it
by 20:01; it answered again at 20:16:51 after another reset and time). See the
parity spec's ring-path bench notes.
#### A call-home that rings on someone else's connection is lost (2026-10-29)
Measured with THOR's watchdog off and auto call-home on. SFM held UM20147's line
and sent a stop (`0x97`, 20:21:13.001); the unit answered with `RADIO RING`
instead of the ack (20:21:13.7). SFM hung up, then reconnected 0.1 s later for a
status read, and the unit answered it. The unit's screen: "connecting..." →
"call home data transfer..." for under a minute → idle. **It did not retry**,
and THOR never saw the call. The same stop from the keypad with nobody on the
line reached THOR through `ListenerAchTcp` (above).
🔶 Inferred: the unit counts the connection its ring rode up as the call and
waits for the server to run the session; a receiver that is not THOR (or not
running an ACH session) swallows the call-home. One observation.
While THOR **holds** the line (polling every ~5–15 s), a second TCP connection to
the modem is accepted but receives **nothing** (SFM: 0 bytes in 10 s), and THOR's
own reads continue to be answered -- measured 20:44:35.9.
#### THOR has a second, unused ACH path
`ListenerAchTcp` logs `Waiting for a ACH connection on :: Port 12346` — and in
@@ -3070,17 +2878,6 @@ own reads continue to be answered -- measured 20:44:35.9.
units that genuinely dial, on some other modem arrangement) but is not what a
PAD-connected Micromate uses.
> ⚠ **RETRACTED 2026-10-29 (measured):** the listener *is* used by a
> PAD-connected Micromate, whenever nothing holds the modem's session. With
> THOR's watchdog off and nobody connected, UM20147's call-home (keypad stop)
> arrived as `ListenerAchTcp - Connection accepted from 63.45.161.30:36648`
> (20:37:28.5), THOR read the serial, and `RADIO RING` then came **up that
> connection** to start the session. So both paths are real and timing decides:
> the ring rides an existing connection (10-14, THOR's watchdog), or the modem
> dials its destination (here `50.197.32.91:12345`, the office) and the ring
> follows. THOR's listener port is **12345** (Brian, 2026-10-29); the 12346 in
> the 10-14 log was that day's setup.
#### What this means for a homebrew receiver
⚠ **`bridges/mm_ach_server.py` is built on the wrong model for this deployment.**
@@ -4316,110 +4113,8 @@ assumed:
device will not stop it and the ack will not distinguish it. That guard has
to live in SFM.
## ✅ The first commands this project originated against a Micromate: start and stop on UM20147 (2026-10-25)
These were the first frames this project ever sent to a **Micromate** that
change its state. Every Micromate write before this one was THOR's, recorded
while we watched. (Series III is different: the `minimateplus` stack has sent
writes — start/stop, config push, erase, call-home config — since April 2026.)
Brian gave a go at the bench for each send.
**Setup.**
- **Unit:** UM20147, firmware `11.0BD` (Thor line, reply flags `0x03`), on USB
CDC-ACM `/dev/ttyACM0`.
- **Sensors:** none attached.
- **Active setup:** `BENCH01`.
- **Sender:** SFM's `POST /device/monitor/start|stop?serial=UM20147` (branch
`feat/series4-sfm-parity` at `b1c87ec`), with every TX frame and every
validated RX frame logged at millisecond resolution.
- **Path:** each send went through the phase-3 safety core in this order:
1. a fresh serial read;
2. a `0x49` state read;
3. the audit row written;
4. one `execute()`;
5. read back every 2 s.
### What was sent and what came back (measured)
| time (EDT) | sent | ack | ack latency | `0x49` content[0] afterwards |
|---|---|---|---|---|
| 15:43:47.430 | `0x96` `41021010009600ffff00000000000000000000a403` | `0x69`, 11 zero bytes | **464 ms** | `0x02` at the first read, 2.0 s after the ack |
| 15:45:51.922 | `0x97` `41021010009700ffff00000000000000000000a503` | `0x68`, 11 zero bytes | **116 ms** | **`0x01` on all 9 reads from +2.1 s to +18.2 s**, then `0x00` from +20.3 s |
| 15:52:42.645 | `0x97` (unit already idle; `even_if_already`) | `0x68`, 11 zero bytes | **10 ms** | `0x00`, unchanged |
| 15:53:51.871 | `0x97` (idle again, screen watched) | `0x68`, 11 zero bytes | **10 ms** | `0x00`, unchanged |
- **The frames.** Both are THOR's own bytes, offset `0xFFFF` included. The phase-2
bench question "is offset `0x0000` honoured" was not tested and does not need
to be.
- **`0x1C` `data[12]` agrees.** It read `0x00` idle before the start, `0x0E` at
the start's read-back and at the stop's preamble, and `0x00` again at +20 s.
`0x0E` is the same monitoring value UM12947 showed on 2026-09-24. `0x1C` was
not read during the `0x01` window.
- **The start's screen** showed a sensor check, then monitoring. With no sensors
attached, the check passed without complaint (Brian, watching).
- **The start's state.** `0x49` already read `0x02` at +2.5 s, so the state
byte very probably reads monitoring *during* the sensor check. That is
inferred, not measured: the check's length on screen was not timed.
Consequence: a second start sent during the check would see "monitoring" and
be skipped, not sent.
- **One histogram was recorded and closed.** The event is timestamped
15:44:01, 14 s after the start, which is roughly the length of the sensor
check. The event count went 5 → 6 at the stop (`UM20147_20261025154401.IDFH`,
7,976 B).
- Its peaks are 0.00186 in/s on all three channels, identical, because no
sensors were attached.
- Free memory fell 4,096 B at the start and another 4,096 B by the stop. The
same 4 KiB step was seen in the 2026-09-24 session.
- **The stop's screen.** The unit tried to call home right after the stop. Brian
says it always does this when taken out of monitor mode. It never connected,
because it has no modem, and it ran out of attempts. A watch of `0x49`
once a second from 15:47:19 to 15:49:50 read `0x00` throughout.
- **A stop sent to an idle unit is harmless.** It was acked in 10 ms, twice.
Nothing changed: not the state, the event count, free memory or the screen,
and there was no call-home attempt. The ~10x shorter ack suggests the
firmware skips its close-down work. This settles the spec's open question
"what does a stop-while-stopped do".
### 🔶 `0x49` content[0] = `0x01`: a fourth state value (value measured, meaning inferred)
The values are now `0x00` idle, `0x02` monitoring and `0x03` in a call-home
session (10 of 10 reads, 2026-10-14). The new one is **`0x01`, for about 18 s
right after a stop**.
**Inferred meaning: a call-home *attempt* in progress, dialling and not
connected.** It is distinct from `0x03`, a call-home *session* that has
connected. The timing fits: the `0x01` window opened 2 s after the stop, on
screen the unit was trying to call home, and it closed when the attempts ran
out.
**Not excluded:** `0x01` could instead mean "stopping, closing the record", with
the call-home attempts overlapping it. Two tests would separate them:
- a stop with call-home-after-event switched off;
- a stop on a unit whose modem connects, where the inference predicts
`0x01` → `0x03`. This fits into the ring-path Run A/B.
**What SFM does with it.** `read_run_state()` names it `unknown(0x01)`, so the
change path refuses any start or stop in that window ("never been measured --
nothing sent", HTTP 409). That is deliberate: name it only once its meaning is
measured. The stop's read-back simply kept polling through it, because `0x01`
is not idle, and the stop verified at +20 s, well inside the 60 s window.
### Audit rows (SFM `device_commands`, scratch bench DB)
All four rows read `outcome=sent`, `verified=ok`, `sent=1`, caller
`bench-brian`. Their `states` columns:
- **start:** `idle → [idle, monitoring] → monitoring`
- **stop:** `monitoring → [monitoring, 9 × unknown(0x01), idle] → idle`
- **the two forced stops:** `idle → [idle, idle] → idle`, each carrying the note
that the read-back cannot show the send changed anything.
## ⚠ Untested and unsafe-until-agreed
> ✅ **Retracted in part (2026-10-25):** the opening line below was true until
> 2026-10-25. Start and stop (`0x96` / `0x97`) have now been **originated by
> SFM** against UM20147. See *The first commands this project originated against a Micromate*. Every
> other item in this section remains never-sent.
**Nothing below has been sent to a unit by us, and nothing should be without an
explicit decision.**
@@ -4436,15 +4131,12 @@ is known; our encoder is unwritten and unproven.
`0x55`. **Destructive.** Series III's `0xA3`/`0xA2` erase-all has *not* been
seen on Series IV and may not exist
- **Start / stop monitoring** (`0x96` / `0x97`) — observed via Thor 2026-09-24,
acks `0x69` / `0x68`. ✅ **Originated by SFM 2026-10-25** on UM20147 (4 sends,
all acked and verified) — no longer untested
acks `0x69` / `0x68`
- **Scheduler enable** (`0x47`) — observed; `params[7]` semantics still unclear
Every one of these is now *observed*. **None has ever been originated by us**,
and that is the line that still matters: the wire format is known, our encoder is
unwritten and unproven. *(2026-10-25: true still of every item here except
start/stop, which SFM originated at the bench — see the retraction note at the
top of this section.)*
unwritten and unproven.
- `0x1F` (advance event pointer) — non-destructive on Series III but it does
move device state, so it is parked with the rest
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,207 +0,0 @@
# SFM phase 1c — the webapp on the serial-based endpoints, plus wrong-series safeguards
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** The SFM standalone page (`sfm/sfm_webapp.html`) drives both series through the serial-based device endpoints. In addition, no MiniMate-only write or erase can reach a unit that has not identified itself as Series 3.
**Architecture:**
- **Server:** one helper refuses the legacy Series-3 write/erase routes unless the unit's own serial (read on the same connection) says Series 3.
- **Page:** the series routing and button rules live in a marked block of pure functions, tested through Node. The DOM wiring calls those functions and nothing else to build a `/device/` URL or decide a button's state.
**Tech Stack:** Python 3.10 / FastAPI (`sfm/server.py`), vanilla JS in one HTML file, pytest. Node 20 (`~/.local/bin/node`) runs the page-logic tests.
**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` covers "The webapp", "Scope: the parity table" rows 1–5 and 7, and "Build phases" 1c. The design agreed with Brian on 2026-10-28 is recorded in the Global Constraints below.
## Global Constraints
- Work in worktree `~/seismo-relay-parity`, on branch `feat/series4-sfm-parity`. Never commit to `main`. Check with `git branch --show-current` before every commit.
- Run tests with `/home/serversdown/seismo-relay/.venv/bin/python -m pytest -q -p no:cacheprovider`. The baseline is **16 known failures** (15 in `test_bw_ascii_report.py`, 1 in `test_event_file_io.py`). Read the failure list before committing. A `pytest | tail` exits 0.
- **Serial optional:** with a serial, the Live tabs use the serial-based endpoints: `/device/info`, `/device/monitor/status`, `/device/settings`, `/device/events`, `POST /device/events/download`, and `POST /device/monitor/start|stop` (all with `serial=`), plus `POST /device/hangup?host=&tcp_port=`. With the serial blank, every read behaves exactly as today.
- **Series comes from the unit's reply.** The badge and every series-specific control follow the `series` field of the last `/device/info` reply, and only if its `serial` equals the typed one. A typed serial alone never enables a series-specific control.
- **Write buttons:**
- Start/stop use the audited serial path for both series.
- Config write and Call-Home write are **disabled for both series**. Their tooltips read exactly "Coming in phase 5 (#46)" and "Coming in phase 4".
- Diagnostics (erase, rescue, slow drip, blind stop) is enabled only when the confirmed series is 3.
- Hang up is shown only when the confirmed series is 4.
- **Start feedback:** while a start is in flight, show "Starting — the unit runs its sensor check first (about 35 s)". The legacy 60-second `_pollMonitorConfirm` loop is not used in serial mode.
- **Results are reported as SFM returned them:** outcome, verified, state before → after, and the first 8 characters of the audit id. HTTP error `detail` strings are shown verbatim.
- **Speed (Brian):** no new request may be added to a path unless the plan says why. The server identity check reuses the serial that `connect()` already reads. On `rescue` and `POST /device/call_home` it adds exactly one SUB 0x15 read.
- No codec, store or DB change. The legacy `/device/*` routes keep their URLs and parameters (a new optional `serial` is added).
## Review Focus
1. **A typed `BE…` serial at an address that holds a Micromate.** The server must refuse every guarded route with 409 and send no write. In the page, Diagnostics stays disabled until `/device/info` answers Series 3. Pinned by Task 1 (`test_guarded_route_refuses_a_unit_that_answers_as_series4`) and Task 2 (`controls: typed serial is not confirmation`).
2. **The serial is edited after a successful identify.** The confirmation must stop counting the moment the typed serial no longer matches. Pinned by Task 2 (`controls: confirmation drops when the serial changes`).
3. **Lower-case or space-padded serials** (`" be9441 "`) are normalised the same way the server normalises them. Pinned by Task 2 (`seriesFromSerial` and `unitQuery` cases).
4. **A start that times out (504) or reads back a mismatch (409).** The page must show the server's detail and the audit id, never "started". Pinned by Task 2 (`changeSummary` cases for `failed`/`mismatch`) and Task 5 (an error-path render).
5. **A download that is already stored** (`inserted: false`) is reported as "already stored" and still opens the stored event. Pinned by Task 2 (`downloadSummary`).
---
### Task 1: Server — legacy Series-3 writes refuse a unit that isn't Series 3
**Files:**
- Modify: `sfm/server.py`:
- `device_config` (~1107), `device_events_erase` (~1427), `device_rescue` (~1763), the `device_call_home` POST (~2066);
- `device_config_project` passes `serial` through.
- Modify: `minimateplus/client.py`: add `MiniMateClient.read_serial()`.
- Test: create `tests/test_server_series3_guard.py`.
**Interfaces:**
- Produces: `MiniMateClient.read_serial(self) -> str`. Requires an open, polled session. It runs the SUB 0x15 read (`self._require_proto().read(SUB_SERIAL_NUMBER)`) and returns `_decode_serial_number(...).serial`.
- Produces: `sfm.server._require_series3(unit_serial: Optional[str], expected: Optional[str]) -> None`. It raises `HTTPException(409, detail)` when either:
- `series_for_serial(unit_serial)` is not 3 (an unknown serial counts as not 3), with detail `f"the unit at this address answers as {unit_serial!r}, not a Series-3 unit -- nothing sent"`; or
- `expected` is given and `normalise_serial(expected) != normalise_serial(unit_serial)`, with detail `f"the unit at this address is {unit_serial}, not {expected} -- nothing sent"`.
- Each guarded route gains `serial: Optional[str] = Query(None, description=_SERIAL_DOC)`. It calls the guard right after it knows the unit's serial, and before its first write:
- `device_config` and `device_events_erase`: `info = client.connect()` → `_require_series3(info.serial, serial)`;
- `device_rescue` and `device_call_home` (POST): after `client.poll()` → `_require_series3(client.read_serial(), serial)`.
- Not guarded, and each gets a one-line comment saying why: legacy `monitor/start|stop`, `stop_monitoring_blind`, `stop_monitoring_slow_drip`, `stop_monitoring_spam`. They send only `0x96`/`0x97`, which mean the same on both series (measured 2026-10-25/27), and the rescue tools must work on a unit too wedged to answer.
- [ ] **Step 1: Write the failing tests** in `tests/test_server_series3_guard.py`. Use `monkeypatch.setattr(srv, "_build_client", factory)` as `tests/test_server_device_access.py:398` does. The fake client records every call:
- `test_guarded_route_refuses_a_unit_that_answers_as_series4[route]`: parametrise over the four routes. The fake's `connect()` returns a `DeviceInfo(serial="UM20147")`, or its `read_serial()` returns `"UM20147"`. Assert `HTTPException.status_code == 409`, and that the recorded calls contain no write method (`delete_all_events`, `apply_config`, `set_call_home_config`, `stop_monitoring`).
- `test_guarded_route_refuses_a_different_series3_unit`: the unit answers `"BE9441"`, the request names `serial="BE12599"`, so the response is 409 with `"not BE12599"` in the detail.
- `test_guarded_route_proceeds_for_the_named_series3_unit`: the unit answers `"BE9441"` with `serial="be9441 "` (normalised), and the write method is called once.
- `test_unguarded_stop_routes_send_without_an_identity_read`: `stop_monitoring_blind` (it writes through a bare `TcpTransport`; stub `srv.TcpTransport`) sends its stop frames, and nothing builds a client or reads a serial.
- [ ] **Step 2: Run them.** `…pytest tests/test_server_series3_guard.py -q` → FAIL (`_require_series3` / `read_serial` don't exist).
- [ ] **Step 3: Implement** `read_serial`, `_require_series3`, the `serial` query parameter, and the four guard calls as specified.
- [ ] **Step 4: Run** the new tests plus `tests/test_server_device_access.py` → PASS. Then the full suite → only the 16 known failures.
- [ ] **Step 5: Commit** `fix(sfm): legacy Series-3 writes and erase refuse a unit that does not answer as Series 3`.
### Task 2: Page — the device-routing block (pure functions) and its Node-run tests
**Files:**
- Modify: `sfm/sfm_webapp.html`. Add one `<script>` block, delimited by the lines `/* <device-routing> */` and `/* </device-routing> */`. It must not touch `document` or `fetch`.
- Test: create `tests/test_webapp_device_routing.py`. It extracts the block, appends `module.exports = {…}`, and runs cases through `node -e` (via `subprocess`, reading JSON on stdout). Skip with a clear reason if `shutil.which("node")` is `None`.
**Interfaces (Produces, used by Tasks 3–6):**
- `seriesFromSerial(serial) -> 3 | 4 | null`: trims and upper-cases; `UM…` → 4, `BE…`/`BA…` → 3 (prefix plus at least one more character), anything else → `null`. Mirrors `sfm/device_access/series.py`.
- `unitQuery(unit) -> string`, where `unit = {serial, host, tcpPort}`:
- serial mode: `serial=<NORMALISED>&host=<h>&tcp_port=<p>`;
- blank serial: `host=<h>&tcp_port=<p>`;
- every value goes through `encodeURIComponent`.
- `deviceUrl(action, unit, params = {}) -> {method, path}`: `path` is relative, e.g. `/device/info?serial=…`. Actions:
- `info`, `status`, `settings`, `events` → GET;
- `download` (needs `params.event_id`), `start`, `stop` → POST;
- `hangup` → POST, with no `serial` (host/port only);
- legacy actions: `storage_range`, `index`, `erase`, `rescue`, `blind_stop`, `slow_drip`, `call_home_read` (GET `/device/call_home`), `call_home_write`, `config_write` (POST `/device/config`).
`settings`, `download` and `hangup` with a blank serial return `null`, since there is no legacy equivalent. Unknown actions throw.
- `confirmedSeries(unit) -> 3 | 4 | null`, where `unit.confirmed = {serial, series}` comes from the last `/device/info` reply:
- returns `unit.confirmed.series` only when the normalised typed serial equals `unit.confirmed.serial`;
- with a blank typed serial, returns `unit.confirmed.series` from a legacy identify;
- otherwise `null`.
- `controlsFor(unit) -> {startStop, hangup, diagnostics, callHomeRead, configWrite, callHomeWrite, reasons}`, all booleans except `reasons`:
- `startStop` = serial mode and `confirmedSeries ∈ {3, 4}`;
- `hangup` = `confirmedSeries === 4`;
- `diagnostics` = `confirmedSeries === 3`;
- `callHomeRead` = `confirmedSeries === 3`;
- `configWrite` = `callHomeWrite` = `false`;
- `reasons` = `{configWrite: "Coming in phase 5 (#46)", callHomeWrite: "Coming in phase 4"}`.
- `changeSummary(body) -> string`, for a ChangeResult JSON (`action, outcome, verified, state_before, state_after, audit_id, plan`):
- `dry_run` → `"<action>: dry run — would send <subs comma-joined>"`;
- `skipped` → `"<action>: already <state_before> — nothing sent"`;
- `sent` + `ok` → `"<action>: confirmed — <state_before> → <state_after> (audit <id8>)"`;
- anything else → `"<action>: <outcome>, <verified> (audit <id8>)"`.
- `downloadSummary(body) -> string`, for an EventDownload JSON:
- `inserted: false` → `"already stored — <stored_filename>"`;
- otherwise `"stored <stored_filename>, <filesize> bytes, check: <detail.check>"`.
- [ ] **Step 1: Write the failing test file.** Each case is `(function, args, expected)` and runs as `node` evaluating `JSON.stringify(fn(...args))`. Cases that must be present:
- `seriesFromSerial`: `"UM20147"`→4, `" be9441 "`→3, `"BA123"`→3, `"BE"`→null, `"XX1"`→null.
- `unitQuery`: serial mode upper-cases and trims; blank serial omits `serial=`; a host with `&` is encoded.
- `deviceUrl`: `info` with a serial → `{method:"GET", path:"/device/info?serial=BE9441&host=h&tcp_port=9034"}`; `hangup` → no `serial`; `settings` with a blank serial → `null`; `download` carries `event_id`.
- controls (named for Review Focus 1 and 2):
- **typed serial is not confirmation**: typed `BE9441` with `confirmed:null` → `diagnostics:false, startStop:false`;
- **confirmed S3**: diagnostics true, hangup false;
- **confirmed S4**: hangup true, diagnostics false, callHomeRead false;
- **confirmation drops when the serial changes**: confirmed `{serial:"BE9441",series:3}` with typed `BE9442` → all false;
- config/call-home write always false, with the exact reason strings.
- `changeSummary`: one case per outcome, including `failed` with `verified:"not_checked"` and `sent` with `verified:"mismatch"`.
- `downloadSummary`: inserted and already-stored.
- [ ] **Step 2: Run** → FAIL (no block in the page).
- [ ] **Step 3: Implement** the block in the page, just before the existing main `<script>`'s first function. Exactly the functions above, no DOM.
- [ ] **Step 4: Run** → PASS. Full suite → only the 16 known failures.
- [ ] **Step 5: Commit** `feat(webapp): the device-routing rules as pure functions, tested through Node`.
### Task 3: Page — unit bar, series badge, Device tab and status panel, Hang up
**Files:** Modify `sfm/sfm_webapp.html`. Test: extend `tests/test_webapp_device_routing.py` with the static check below.
**Interfaces:**
- Consumes: `unitQuery`, `deviceUrl`, `confirmedSeries`, `controlsFor` (Task 2).
- Produces: a page-level `currentUnit()` returning `{serial, host, tcpPort, confirmed}`. `confirmed` is held in a module variable set only by `connectUnit()` from the `/device/info` reply (`{serial: body.serial, series: body.series}`), and cleared whenever the serial or host field changes. Also `applyControls()`, which sets every series-specific control's `disabled`/`hidden` state and tooltip from `controlsFor(currentUnit())`. Tasks 4–6 call `applyControls()` after any state change.
- [ ] **Step 1: Write the failing static test.** `test_every_device_url_is_built_by_deviceUrl`: outside the device-routing block, the page source contains no `` `${api()}/device/ `` and no `'/device/` string literal. The `deviceUrl` call sites are the only way to build one.
- [ ] **Step 2: Run** → FAIL (today's page builds them by hand).
- [ ] **Step 3: Implement.**
- A **Serial** input beside host/port, `id="dev-serial"`, with placeholder `"BE…/BA… or UM… (optional)"`.
- A badge `id="series-badge"` showing `Series 3` / `Series 4` from `confirmedSeries`, or hidden.
- `connectUnit()` and `refreshMonitorStatus()` go through `deviceUrl('info'|'status', …)`. The Device tab and status panel render `UnitInfo`/`UnitStatus` fields with "—" for null (`device_time` and `event_count` are null on Series 3).
- A **Hang up** button `id="hangup-btn"`, visible only when `controlsFor().hangup`, which POSTs `deviceUrl('hangup')`.
- Convert every remaining hand-built `/device/` URL to `deviceUrl` (legacy actions included), so the static test passes. With a blank serial, behaviour is unchanged.
- [ ] **Step 4: Run** the page tests and the full suite → PASS, only the 16 known failures.
- [ ] **Step 5: Commit** `feat(webapp): name a unit by serial; series badge from the unit's own answer; Hang up for Series 4`.
### Task 4: Page — Events tab by serial
**Files:** Modify `sfm/sfm_webapp.html`.
**Interfaces:**
- Consumes: `deviceUrl('events'|'download')`, `downloadSummary` (Task 2), `currentUnit()` (Task 3), and the existing `openSidecarModal(dbEventId)` (~line 2780).
- [ ] **Step 1: Implement.** In serial mode, the Events tab lists `EventList.events`: index, `timestamp`, `record_type`, PVS and peaks, or "—". Each row has a **Download** button that POSTs `deviceUrl('download', unit, {event_id})`, shows `downloadSummary(body)` in the status bar, and then calls `openSidecarModal(body.db_event_id)` when it isn't null. HTTP errors show `detail` verbatim. With a blank serial, the existing legacy list and waveform behaviour is unchanged.
- [ ] **Step 2: Verify** the page tests and the full suite → only the 16 known failures. The bench check covers the live behaviour.
- [ ] **Step 3: Commit** `feat(webapp): list and download events by serial, for both series`.
### Task 5: Page — Start/Stop through the audited path
**Files:** Modify `sfm/sfm_webapp.html`.
**Interfaces:**
- Consumes: `deviceUrl('start'|'stop')`, `changeSummary`, `controlsFor().startStop` (Task 2).
- [ ] **Step 1: Implement.**
- In serial mode, `startMonitoring()`/`stopMonitoring()` `confirm()` with `"Start monitoring on <serial>?"` / `"Stop monitoring on <serial>?"`.
- Then POST once (never retried). While a start is in flight, show "Starting — the unit runs its sensor check first (about 35 s)".
- Show `changeSummary(body)` for any JSON body, including a 409/502 ChangeResult; show `detail` verbatim for an error without one (e.g. 504).
- Then call `refreshMonitorStatus()`.
- Buttons are enabled only by `controlsFor().startStop`.
- In serial mode the legacy `_pollMonitorConfirm` isn't called. With a blank serial, the legacy behaviour is unchanged.
- [ ] **Step 2: Verify** the page tests and the full suite → only the 16 known failures. Task 2's `changeSummary` cases cover the 409/`mismatch` and `failed` bodies; the bench check covers the live behaviour.
- [ ] **Step 3: Commit** `feat(webapp): start/stop through the audited serial path, with the honest result`.
### Task 6: Page — Config, Call Home and Diagnostics gating
**Files:** Modify `sfm/sfm_webapp.html`.
**Interfaces:**
- Consumes: `deviceUrl('settings'|'call_home_read'|…)`, `controlsFor()` (Task 2), `applyControls()` (Task 3).
- [ ] **Step 1: Implement.**
- **Config tab:** in serial mode, **Read** shows `UnitSettings` (setup name, record mode, sample rate, record time, histogram interval, geo trigger, notes, with "—" for null). **Write** is disabled for both series, with the tooltip from `reasons.configWrite`.
- **Call Home tab:** read enabled only by `callHomeRead`; for Series 4 it says "Not yet available for Series 4". Write is disabled, with `reasons.callHomeWrite`.
- **Diagnostics:** every button is enabled only by `controlsFor().diagnostics`; the erase confirmation stays as is. Diagnostics requests pass `serial` when one is typed, so the server guard (Task 1) checks it as well.
- With a blank serial, the legacy reads are unchanged, while writes and erase follow `controlsFor`. A legacy identify (blank serial) that answers as BE… confirms Series 3.
- [ ] **Step 2: Verify** the page tests and the full suite → only the 16 known failures.
- [ ] **Step 3: Commit** `feat(webapp): config and call-home writes wait for phases 4-5; Diagnostics only for a confirmed Series-3 unit`.
### Task 7: Docs
**Files:** `CLAUDE.md` (the SFM REST API section, and "Where things stand"), `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` (the 1c entry in Build phases).
- [ ] **Step 1:** Document:
- the legacy-route Series-3 guard (which routes, why the stop tools are exempt);
- the page's serial mode;
- the `node` requirement for `tests/test_webapp_device_routing.py`.
No CHANGELOG (feature branch).
- [ ] **Step 2: Commit** `docs: phase 1c -- the webapp by serial, and the Series-3 guard on legacy writes`.
**After Task 7 (controller, with Brian, not an implementer task):** a bench pass on BE9441 and UM20147, through the bridge or cellular:
- identify;
- status;
- settings read;
- events list and one download each;
- one audited start/stop each (Brian's go per send);
- for the Micromate, Hang up;
- Diagnostics disabled on UM20147, and enabled only after BE9441 identifies.
@@ -1,172 +0,0 @@
# SFM 1c bench fixes, Batch 1 — Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Fix the three reliability findings from the 2026-10-29 bench that put wrong or missing data in front of a user: MiniMate settings read from escaped bytes (#1), a MiniMate start reported failed because the read-back did not survive a dropped modem line (#9), and MiniMate downloads stored without the file reader (#8).
**Architecture:** Three independent fixes on `feat/series4-sfm-parity` (merged up with `dev` at `342c696`), each behind its own tests on recorded BE9441 bytes. #1 changes only the four anchor-relative fields of the live `SUB 1A` decode; #9 adds one guarded reconnect to the Series-3 start read-back; #8 stores Series-3 downloads through the same Blastware-file import path production uses (`WaveformStore.save_imported_bw`), the way Series 4 already uses `save_imported_idf`.
**Tech Stack:** Python 3.10, pytest; `minimateplus` (client, framing, blastware_file), `sfm` (device_access, event_ingest, waveform_store).
**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` → *Left open by the 1c bench (2026-10-29)*, items 1, 8, 9 (and 15, retracted below).
## Global Constraints
- Branch `feat/series4-sfm-parity` only; push each commit; never `main`; no `CHANGELOG.md` edits (feature branch).
- **Reliability before speed** (Brian, 2026-10-29): no change removes a check; a start/stop is still sent exactly once, never retried.
- **File boundary with the S3 decode-checker session:** do not edit `minimateplus/event_file_io.py`, `histogram_codec.py`, `waveform_codec.py`, `bw_xml_report.py`, `decode_check*.py`.
- `docs/instantel_protocol_reference.md` is CRLF: edit it with the Edit tool only.
- Tests: `/home/serversdown/seismo-relay/.venv/bin/python -m pytest -q -p no:cacheprovider`; the baseline is exactly 16 known failures (15 `test_bw_ascii_report.py`, `test_event_file_io.py::test_save_imported_bw_without_report_works_unchanged`).
- Store consequence (state it in the commit and docs): #8 changes how **new** live downloads are stored; existing rows and files are untouched; no backfill, no migration.
## Review Focus
1. A modem that closes the line cleanly (FIN) during the read-back shows as silence, not an `OSError`: no reconnect, the result stays "sent, not checked", nothing re-sent. (Task 2 test.)
2. A MiniMate on a serial cable: never reconnect in the read-back — opening its port reboots the unit (measured 2026-10-25). (Task 2 test.)
3. A settings read while the unit is monitoring returns the device-info block, not the settings block (measured 2026-10-29): mode, sample rate, interval and record time must come back `None`, not garbage. (Task 1 test.)
4. Downloading an event twice, or one the watcher already imported, must not add a second row. (Task 3 tests.)
5. The channel block (trigger level, range, scale) and the note strings must read exactly as before: only the four anchor fields move to unescaped bytes. (Task 1 test.)
## Retraction carried by this plan
**#15 is not a bug.** `device_commands.sent` is documented as `1 acknowledged, 0 nothing sent, NULL unknown` (`sfm/database.py:148`, `change.py:12-14`); a stop answered by a ring instead of its ack is exactly "unknown", and the row's `error` text already says the frame was sent. Task 4 retracts it in the spec.
---
### Task 1: The live settings decode reads its four anchor fields from unescaped bytes (#1)
**Files:**
- Modify: `minimateplus/client.py` — `_decode_compliance_config_into` (~line 2312), its anchor block (~2385–2440)
- Create: `tests/test_s3_compliance_anchor_fields.py`
**Interfaces:** Produces nothing new; `_decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None` keeps its signature. `info.compliance_config` fields `recording_mode`, `sample_rate`, `histogram_interval_sec`, `record_time` change meaning only for escaped replies.
Measured layout once escapes are removed (`framing.unescape_reply`), from every distinct recorded reply: **mode `anchor−7` (u8), sample rate `anchor−6` (u16 BE), histogram interval `anchor−4` (u16 BE, s), record time `anchor+6` (f32 BE)**. The channel block and strings are correct on the raw bytes and must stay there (unescaped, `"Tran"+28` reads 0.0 instead of 6.2061).
- [ ] **Step 1: Write the failing tests** — a helper collects every `SUB 0xE5` frame from `tests/fixtures/minimate-bench-10-25-26/*_rx.bin` and `tests/fixtures/minimate-bench-10-26-26-histogram/unit_replies.bin` whose `data` contains the anchor, de-duplicated by the 18 bytes around it (`S3FrameParser().feed`).
```python
@pytest.mark.parametrize("fixture,expect", [ # (mode, sample_rate, interval_s, record_time_s)
("10-25", (1, 4096, 5, 5.0)), # Continuous
("10-26a", (4, 2048, 2, 20.0)), # Histogram + Continuous
("10-26b", (3, 4096, 900, 20.0)), # Blastware's 16:26 write: Histogram, 15 min
("10-26c", (3, 4096, 2, 20.0)), # Blastware's 16:27 write: back to 2 s (tonight's unit)
])
def test_anchor_fields_read_from_unescaped_bytes(fixture, expect): ...
# decode the frame's data with _decode_compliance_config_into(DeviceInfo())
# assert (cc.recording_mode, cc.sample_rate, cc.histogram_interval_sec, round(cc.record_time, 2)) == expect
def test_channel_block_still_reads_from_raw_bytes():
# data = the 10-26c frame-B data + the next E5 frame whose data contains b"Tran"
# assert cc.trigger_level_geo == pytest.approx(0.04, abs=1e-4)
# assert cc.geo_adc_scale == pytest.approx(6.2061, abs=1e-3) and cc.geo_range == 0
def test_a_reply_without_the_settings_block_reads_as_unknown():
# the recorded SUB 0xFE (device info) reply data -- what a monitoring BE9441 returned for 1A
# assert all four anchor fields are None
```
The fixture labels are the test's own: number the de-duplicated replies in file order and map them to the four expectations above (assert there are exactly four).
- [ ] **Step 2: Run** `…pytest -q tests/test_s3_compliance_anchor_fields.py` → FAIL: `10-25` reads mode 0, `10-26c` reads sample rate 0 and interval 4098 (today's decoder on escaped bytes).
- [ ] **Step 3: Implement** — in the anchor block, search `_ANCHOR` in `logical = unescape_reply(data)` (same `0:150` window) and read the four fields from `logical` at the offsets above; leave every other read on `data`. Update the layout comment to the measured logical layout and note the old "anchor−7 constant 0x10" was the escape before `04` at 1024 sps.
- [ ] **Step 4: Run** the new tests, then the full suite → only the 16 known failures.
- [ ] **Step 5: Commit** `fix(minimateplus): read a MiniMate's mode, sample rate, interval and record time after removing escapes (#1)`.
### Task 2: The Series-3 start read-back reconnects once after a dropped line (#9)
**Files:**
- Modify: `sfm/device_access/s3.py` — `change_monitoring`'s `read_state` (~line 230)
- Modify: `tests/device_access_fakes.py` — `FakeMiniMateClient`: add `read_serial()` (returns `serial_reported`, default the unit's serial; records `"read_serial"`) and `wake_errors=` (exceptions raised by successive `wake()` calls)
- Test: `tests/test_device_access_change.py`
**Interfaces:** Consumes `MiniMateClient.read_serial()` (exists), `normalise_serial` (`sfm/device_access/series.py`). No new public names.
Behaviour: in `read_state`, an `OSError` from `_woken_state(client)` (Broken pipe / reset / aborted — measured: `[Errno 32] Broken pipe` at BE9441's first wake after the sensor check) **on a TCP address, the first time only**: log a warning "the line dropped during the read-back — reconnecting to read the state (nothing is re-sent)", `client.close()`, `client.open()`, require `normalise_serial(client.read_serial()) == serial` (else raise `WrongUnit`), then `_woken_state(client)`. A second `OSError`, any other error, or a serial-cable address propagates as today.
- [ ] **Step 1: Write the failing tests**
```python
def test_series3_start_read_back_reconnects_after_a_dropped_line():
fake = FakeMiniMateClient(monitor_states=[False, True], wake_errors=[BrokenPipeError(32, "Broken pipe")])
r = access3(fake).start_monitoring(TCP3, "BE18193")
assert (r.outcome, r.verified, r.state_after) == ("sent", "ok", "monitoring")
assert fake.writes == ["start_monitoring"] and fake.opened == 2 and "read_serial" in fake.calls
def test_series3_read_back_reconnects_only_once():
fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")] * 2)
with pytest.raises(ChangeUnconfirmed): access3(fake).start_monitoring(TCP3, "BE18193")
assert fake.writes == ["start_monitoring"] and fake.opened == 2
def test_series3_read_back_reconnect_refuses_a_different_unit():
fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[BrokenPipeError(32, "x")], serial_reported="BE11529")
with pytest.raises(ChangeUnconfirmed) as e: access3(fake).start_monitoring(TCP3, "BE18193")
assert e.value.http_status == 409 and fake.writes == ["start_monitoring"]
def test_series3_read_back_does_not_reconnect_on_a_serial_cable():
# address with port=, no host: opening a MiniMate's port reboots it
... assert fake.opened == 1 and raises ChangeUnconfirmed
def test_series3_read_back_silence_is_not_a_dropped_line():
fake = FakeMiniMateClient(monitor_states=[False], wake_errors=[NoAnswer("quiet")])
... raises ChangeUnconfirmed; fake.opened == 1; writes == ["start_monitoring"]
```
(`serial_reported` applies to `read_serial()` only; `connect()` keeps returning the real serial so the pre-send identity check passes. Use the module's existing `access3`, `TCP3` helpers; add a serial-cable `UnitAddress` beside `TCP3`.)
- [ ] **Step 2: Run** them → the reconnect tests FAIL (no reconnect today); the last two may already pass — keep them as guards.
- [ ] **Step 3: Implement** `read_state` as described (a closed-over `reconnected` flag).
- [ ] **Step 4: Run** `tests/test_device_access_change.py`, then the full suite → only the 16 known failures.
- [ ] **Step 5: Commit** `fix(sfm): a MiniMate start's read-back reconnects once when the modem dropped the line (#9)`.
### Task 3: MiniMate downloads are stored through the Blastware-file import path (#8)
**Files:**
- Modify: `minimateplus/blastware_file.py` — add `blastware_file_bytes(event: Event, a5_frames: list) -> bytes`; `write_blastware_file` writes its result (no behaviour change)
- Modify: `sfm/device_access/models.py` — `DownloadedEvent.bw_bytes: Optional[bytes] = field(default=None, repr=False)` (Series 3: the assembled Blastware file)
- Modify: `sfm/device_access/s3.py` — `download_event` fills `bw_bytes` from the verified event's frames
- Modify: `sfm/waveform_store.py` — `save_imported_bw(..., source_kind: str = "bw-import")` writes it into the sidecar's `source.kind`
- Modify: `sfm/event_ingest.py` — `persist_download`'s Series-3 branch
- Test: `tests/test_event_ingest.py`, `tests/test_5a_blastware_walk_histogram.py`
**Interfaces:** Produces `blastware_file_bytes(event, a5_frames) -> bytes`; `DownloadedEvent.bw_bytes`; `save_imported_bw(bw_bytes, source_path, *, serial_hint=None, bw_report_text=None, source_kind="bw-import") -> tuple[Event, dict]`.
Behaviour: Series 3 mirrors Series 4 — `ev, rec = store.save_imported_bw(dl.bw_bytes, source_path=Path(dl.filename), serial_hint=dl.serial, source_kind="sfm-live")`, then the existing `db.insert_events(...)`. No `backfill_series3_event` on this path (the file's setup block supplies sample rate and record time, #44/#45); no overlay of the live `0C` peaks (data comes from the binary — they stay the download *check*). A download with no `bw_bytes` raises `IngestError("…the download carried no event file; nothing was stored")`. The "Waveform" label on a live histogram stays until the checker session's #41 (record type from `STRT[18]`) lands on `dev`.
- [ ] **Step 1: Write the failing tests**
```python
# tests/test_5a_blastware_walk_histogram.py, beside the existing K441LTON.900 comparison:
def test_blastware_file_bytes_is_blastwares_file():
# the walk's frames for key 0111f210 -> blastware_file_bytes(ev, frames) == (FIX/"blastware"/"K441LTON.900").read_bytes()
# tests/test_event_ingest.py
def test_a_series3_histogram_download_is_stored_from_its_file(tmp_path):
bw = (HIST_FIX / "K441LTON.900").read_bytes() # byte-identical to SFM's download (sha f10f39a8…)
out = persist_download(DownloadedEvent(event_id="BE9441:0111f210:20261026170036", serial="BE9441",
series=3, filename="K441LTON.900", verified=None, bw_bytes=bw,
timestamp=datetime.datetime(2026, 10, 26, 17, 0, 36)), store=WaveformStore(tmp_path / "w"), db=SeismoDb(tmp_path / "s.db"))
# assert the stored file's sha256 == hashlib.sha256(bw).hexdigest()
# assert plot_json_from_hdf5(<h5>)["channels"]["Tran"]["values"] (non-empty: the histogram decoded)
# assert the sidecar's source.kind == "sfm-live" and the row's sample_rate == 4096
def test_the_small_mic_off_histogram_is_stored_with_samples(tmp_path): # K441LTOK.QZ0, refused on 10-29
def test_a_repeat_series3_download_adds_no_row(tmp_path): # persist twice: one row; second inserted False
def test_a_series3_download_with_no_file_stores_nothing_and_says_so(tmp_path) # replaces the no-event test
```
Rewrite `test_a_series3_event_is_backfilled_then_stored_as_series3` to the new contract (bytes in, `save_imported_bw` called with `source_kind="sfm-live"`, no backfill); keep `test_downloading_an_event_the_watcher_stored_writes_nothing_series3` passing unchanged.
- [ ] **Step 2: Run** them → FAIL (`bw_bytes` / `blastware_file_bytes` / `source_kind` do not exist).
- [ ] **Step 3: Implement** the five file changes above.
- [ ] **Step 4: Run** `tests/test_event_ingest.py tests/test_5a_blastware_walk_histogram.py tests/test_device_access_events.py tests/test_server_device_access.py`, then the full suite → only the 16 known failures.
- [ ] **Step 5: Commit** `fix(sfm): store a MiniMate download through the Blastware-file import path, as production does (#8)` — body states: new live downloads only; existing rows untouched; no backfill or migration.
### Task 4: Docs
**Files:** the spec (*Left open by the 1c bench*), `docs/instantel_protocol_reference.md` (CRLF — Edit tool), `CLAUDE.md` ("Where things stand").
- [ ] **Step 1:** Spec: mark #1, #8, #9 fixed (commit ids); **retract #15 in place** (by design: `sent` NULL = sent without acknowledgement); #2 fixed by the `dev` merge (`342c696`).
- [ ] **Step 2:** Instantel reference, a dated change-log row + §7.6.1 note: the measured logical `1A` layout (mode −7, rate −6, interval −4, record time +6 after unescaping; the old "anchor−7 constant 0x10" was the escape before `04`); while monitoring, BE9441 answered the `1A` reads with its device-info block (measured 2026-10-29); the channel block is read on raw bytes, so a trigger/alarm float containing `02/03/04/10` would read shifted — open, unmeasured.
- [ ] **Step 3:** CLAUDE.md: one line under the 1c entry — Batch 1 done (#1, #8, #9), #15 retracted.
- [ ] **Step 4: Commit** `docs: 1c bench Batch 1 -- #1, #8, #9 fixed; #15 retracted; the 1A layout after unescaping`.
@@ -1,245 +0,0 @@
# Phase 4 — Call-home enable/disable Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Turn a unit's automatic call-home on or off from SFM, for both series, through the audited change path start/stop already uses: identity check → audit → one send → read back → audit.
**Architecture:** `run_change` (`sfm/device_access/change.py`) becomes kind-agnostic: a `ChangeKind` says what the change is called and which state means it took. Each series supplies a call-home state read (`"enabled"` / `"disabled"`, plus Series 4's `"calling_home"`) and a send built from the block it read moments before. Series 4 sends `micromate.writes.plan_call_home_enabled` (frames already equal to THOR's). Series 3 patches byte 5 of the unescaped `0x2C` image and sends it through the existing `0x7E`/`0x7F` path. A gate keeps that send refused until its frame is reproduced from a Blastware capture. New serial-keyed routes, and the page's Call Home tab by serial gets On/Off buttons.
**Tech Stack:** Python 3 / FastAPI (SFM), pytest; page JS in `sfm/static/` tested with Node.
**Spec:** `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` — row 9 of the job table, "The safety layer" (tiers, read-back: "call-home → re-read `0x2C` and compare the edited bytes"), the per-operation table (`call-home enable/disable | read 0x2C → 0x7E (126 B content, offset 0x007E) → 0x7F | re-read 0x2C`), build phase 4.
## Global Constraints
- Branch `feat/series4-sfm-parity`, worktree `~/seismo-relay-parity`. Never commit to `main`. Push every commit. No `CHANGELOG.md` edits (written on `dev` at merge).
- **No live write without Brian's explicit go, per send.** Dry runs and tests only, until the bench task.
- A write is never retried (`DeviceAccess._dispatch(change=True)`); never send `0xA2`; never write modem baud or modem type.
- File boundary with the decode-checker session: do not edit `minimateplus/event_file_io.py`, `histogram_codec.py`, `waveform_codec.py`, `bw_xml_report.py`, `decode_check*.py`.
- No inline JavaScript: new page logic goes in `sfm/static/device_routing.js` (DOM-free, Node-tested); `sfm/static/sfm_webapp.js` only applies it (stack-wide rule, 2026-11-02).
- Series 4: read-modify-write. Send back every byte of the block as read except bit 0 of `content[5]`. Never synthesise or zero `content[118:120]` (unit-maintained; it changes after a config write).
- Series 3: read the enable byte from the **unescaped** block (the lesson of bench finding #1). `0x00` off, `0x01` on (measured April 2026, BE11529). Any other value is `unknown(0xNN)` and nothing is sent.
- Speed is secondary to reliability: no new round trips beyond the reads the change needs.
- Test command: `/home/serversdown/seismo-relay/.venv/bin/python -m pytest -q -p no:cacheprovider`. Baseline: exactly 16 known failures (15 in `tests/test_bw_ascii_report.py`, `tests/test_event_file_io.py::test_save_imported_bw_without_report_works_unchanged`). Read the failure list before committing.
## Review Focus
1. A change requested while a Micromate is calling home (run state `0x03`) → 503, nothing sent, the line released (the existing `CallHomeInProgress` path).
2. A MiniMate whose unescaped byte 5 is neither `0x00` nor `0x01` → state `unknown(0xNN)`: a dry run still shows it, a live change sends nothing (`UnitStateUnknown`, 409).
3. A read-back where other bytes changed (Series 4 `[118:120]` always does) → verified on the edited bit alone; the changed offsets are recorded in the result and the audit row, never a mismatch.
4. Already in the requested state → skipped with no send, unless `even_if_already` (the bench's no-op write is exactly that experiment).
5. A live Series-3 call-home change before its frame has been reproduced from a Blastware capture → 501 before any connection. A dry run works.
---
### Task 1: `run_change` takes a `ChangeKind`
**Files:**
- Modify: `sfm/device_access/change.py` (signature and the three derived names at the top of `run_change`; the finish paths that build `detail` and `states`)
- Modify: `sfm/device_access/s3.py` (`change_monitoring`), `sfm/device_access/s4.py` (`s4_change_monitoring`) — call sites only
- Test: `tests/test_device_access_change_kind.py` (new)
**Interfaces:**
- Produces:
- `@dataclass(frozen=True) class ChangeKind: action: str; want: str; became: str` in `change.py`.
- `monitoring_change(start: bool) -> ChangeKind` gives exactly today's values: `("start monitoring", "monitoring", "started")` / `("stop monitoring", "idle", "stopped")`.
- `call_home_change(enabled: bool) -> ChangeKind` gives `("enable call-home", "enabled", "enabled")` / `("disable call-home", "disabled", "disabled")`.
- `run_change(*, kind: ChangeKind, serial, series, dry_run, even_if_already, audit, address, caller, sleep, verify_timeout_s, verify_interval_s, read_serial, read_state, describe_plan, send, is_refusal=_never, is_ring=_never, pre_send=None, snapshot: Optional[Callable[[], Dict[str, Any]]] = None) -> ChangeResult`. `start` is gone.
- `snapshot`: called once, after the read-back loop, on the two normal finish paths (verified `ok` or `mismatch`). Its dict goes in `detail["snapshot"]` and the audit row's `states["snapshot"]`. A snapshot that raises is recorded as `{"error": str(exc)}` and does not change the outcome.
- [ ] **Step 1: Write the failing tests** (fake callables, no device, the `Audit` fake pattern from `tests/test_device_access_change.py`):
- `test_monitoring_kinds_are_todays_names`: `monitoring_change(True) == ChangeKind("start monitoring", "monitoring", "started")`, and likewise for stop.
- `test_a_call_home_change_is_verified_by_its_own_state`: `kind=call_home_change(False)`, states `["enabled", "disabled"]` → `(outcome, verified, state_after) == ("sent", "ok", "disabled")`, and `result.action == "disable call-home"`.
- `test_a_call_home_read_back_that_did_not_change_is_a_mismatch`: states `["enabled", "enabled", "enabled", "enabled"]` with verify `(3.0, 1.0)` → `("failed", "mismatch")`.
- `test_the_snapshot_is_kept_in_the_result_and_the_audit`: `snapshot=lambda: {"after": "ab"}` → `result.detail["snapshot"] == {"after": "ab"}` and the audit row's `states["snapshot"] == {"after": "ab"}`.
- `test_a_failing_snapshot_does_not_change_the_outcome`: a snapshot raising `RuntimeError("x")` → still `("sent", "ok")`, `detail["snapshot"] == {"error": "x"}`.
- [ ] **Step 2: Run** `pytest tests/test_device_access_change_kind.py -v`. Expected: FAIL (`ImportError: cannot import name 'ChangeKind'`).
- [ ] **Step 3: Implement.** Replace `start` with `kind` in `run_change`, deriving `action`, `want` and `became` from `kind`. Add the snapshot as specified. Update the two call sites to `kind=monitoring_change(start)`, keeping their own `start` parameter.
- [ ] **Step 4: Run** the new file plus `tests/test_device_access_change.py tests/test_device_access_s3_events.py tests/test_server_device_access.py`. Expected: all pass, with the existing start/stop tests unchanged.
- [ ] **Step 5: Commit** `refactor(sfm): run_change takes a ChangeKind -- start/stop unchanged, call-home next (phase 4)`.
### Task 2: Series 4 — read call-home, change it
**Files:**
- Modify: `micromate/opcodes.py` (`ENABLEABLE_WRITES`), `micromate/client.py` (new method)
- Modify: `sfm/device_access/models.py` (new `CallHomeState`), `sfm/device_access/s4.py` (two new functions)
- Modify: `tests/device_access_fakes.py` (`FakeMicromateClient` call-home support), `tests/test_micromate_execute.py:37` (the ceiling assertion)
- Test: `tests/test_device_access_s4_call_home.py` (new)
**Interfaces:**
- Consumes: Task 1's `ChangeKind`, `call_home_change`, `run_change(snapshot=…)`.
- Produces:
- `ENABLEABLE_WRITES = frozenset({0x96, 0x97, 0x7E, 0x7F})`.
- `MicromateClient.get_call_home_content() -> bytes`: the 126-byte content, `_content(self.protocol.read_call_home_config())`.
- `@dataclass class CallHomeState: serial: str; series: int; enabled: Optional[bool]; dial_string: Optional[str]; detail: Dict[str, Any]` (`detail["byte5"]` as `"0xNN"`, `detail["block"]` as hex).
- `s4_call_home_state(client, serial) -> CallHomeState`: enabled is bit 0 of `content[5]`; the dial string is `content[6:46]` up to its first NUL, decoded as ASCII.
- `s4_change_call_home(client, serial, *, enabled, dry_run, even_if_already, audit, address, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`:
- `read_state` returns `"calling_home"` when `client.read_run_state().name == "calling_home"`, else `"enabled"` / `"disabled"` from `content[5] & 1`. It keeps the last content it read.
- `describe_plan`: `plan_call_home_enabled(last_content, enabled).describe()`, so the plan is built from the read `run_change` made just before.
- `send` executes that same plan object.
- `snapshot` returns `{"before": hex, "after": hex, "changed_offsets": [...]}`, comparing the first and last content read.
- `pre_send`, `is_refusal` and `is_ring` are as in `s4_change_monitoring`.
- [ ] **Step 1: Fake support.**
- `FakeMicromateClient(call_home=<126-byte content>)`, defaulting to UM12947's enabled read from `tests/fixtures/micromate-writes` (the reads `tests/test_micromate_writes.py::_call_home_reads` uses), plus a `read_call_home_config()` on `_FakeProtocol` returning `bytes(11) + content`.
- `execute(plan)` applies a `0x7E` step's data as the new content, then replaces `[118:120]` with its bitwise complement, mimicking the unit-maintained field (the default read already holds `2e 5e`, so a fixed value would not change it).
- [ ] **Step 2: Write the failing tests:**
- `test_s4_call_home_state_reads_the_enable_bit_and_dial_string`: on the default content (UM12947, `[5] = 0x05`) → `enabled is True`, `dial_string == "RADIO RING"`, `detail["byte5"] == "0x05"`.
- `test_s4_dry_run_shows_thors_frames`: dry run `enabled=False` → `result.plan` frames equal `plan_call_home_enabled(content, False).describe()["steps"]` frames, and `fake.executed == []`.
- `test_s4_disable_sends_7e_7f_and_verifies`: live `enabled=False` → `("sent", "ok", "disabled")`; executed plan subs `[0x7E, 0x7F]`.
- `test_s4_unit_maintained_bytes_do_not_make_a_mismatch`: same run → `verified == "ok"` and `detail["snapshot"]["changed_offsets"] == [5, 118, 119]`.
- `test_s4_no_change_while_calling_home`: `run_states=[0x03]` → `CallHomeInProgress`, nothing executed.
- `test_s4_already_enabled_is_skipped`: `enabled=True` on enabled content → `outcome == "skipped"`, nothing executed. With `even_if_already=True` → executed once, and the plan carries the "changes nothing" warning.
- Update `test_micromate_execute.py:37` to the new four-SUB set.
- [ ] **Step 3: Run** the new file. Expected: FAIL (`ImportError: s4_call_home_state`).
- [ ] **Step 4: Implement** as specified in Interfaces.
- [ ] **Step 5: Run** the new file plus `tests/test_micromate_execute.py tests/test_micromate_writes.py tests/test_device_access_change.py`. Expected: pass.
- [ ] **Step 6: Commit** `feat(sfm): Series-4 call-home state and audited enable/disable (phase 4)`.
### Task 3: Series 3 — read call-home, change it (live send gated)
**Files:**
- Modify: `minimateplus/protocol.py` (two pure functions next to `write_image`), `minimateplus/client.py` (two methods)
- Modify: `sfm/device_access/s3.py` (gate constant + two adapter methods)
- Modify: `tests/device_access_fakes.py` (`FakeMiniMateClient` call-home support)
- Test: `tests/test_s3_call_home.py` (new)
**Interfaces:**
- Consumes: Task 1, and Task 2's `CallHomeState`.
- Produces:
- `call_home_enabled(raw: bytes) -> Optional[bool]` in `minimateplus/protocol.py`: `unescape_reply(raw)[5]`, `0x01` → True, `0x00` → False, else None.
- `call_home_image(raw: bytes, enabled: bool) -> bytes`: `write_image(SUB_CALL_HOME_WRITE, raw)` with byte 5 set to `0x01`/`0x00` and every other byte unchanged. Raises `ValueError` when the image's byte 5 is not `0x00`/`0x01`.
- `MiniMateClient.read_call_home_raw() -> bytes` (the protocol's `read_call_home_config()`) and `MiniMateClient.write_call_home_image(image: bytes) -> None` (the protocol's `write_call_home_config(image)`: `0x7E` then `0x7F`, each ack checked).
- `S3_CALL_HOME_FRAME_VERIFIED = False` in `sfm/device_access/s3.py`. Task 4 flips it.
- `Series3Adapter.call_home_state(address, serial) -> CallHomeState`: `wake`, then `read_call_home_raw()`. The dial string is the unescaped `[6:46]` up to its first NUL. `detail` carries `byte5`, `block` (raw hex) and `serial_verified: False`, as status does.
- `Series3Adapter.change_call_home(address, serial, *, enabled, dry_run, even_if_already, audit, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`:
- When `not dry_run and not S3_CALL_HOME_FRAME_VERIFIED`, raise `NotSupported("a MiniMate call-home write waits until its frame has been reproduced from a Blastware capture -- nothing sent")` before `_run`.
- Otherwise use `run_change(kind=call_home_change(enabled), retry=False)` with:
- `read_serial` = `client.connect()`, as for start/stop;
- `read_state` = `wake` + `read_call_home_raw()`, giving `enabled` / `disabled` / `unknown(0xNN)` and keeping the last raw;
- `describe_plan` = the steps `[{"sub": "0x7E", "frame": build_bw_write_frame(0x7E, image).hex()}, {"sub": "0x7F", "frame": build_bw_write_frame(0x7F, b"").hex()}]`;
- `send` = `client.write_call_home_image(image)`, returning `{"subs": ["0x81", "0x80"]}`;
- `snapshot` as in Task 2, over unescaped images.
- [ ] **Step 1: Fake support.**
- `FakeMiniMateClient(call_home_raw=<125 B>)`. The default is built from the documented 4-20-26 layout: `00 7C DC 00 00`, `[5] = 0x01`, `[6:46] = b"RADIO RING"` NUL-padded, `[117:119] = 10 03`, zeros elsewhere to 125 bytes.
- `read_call_home_raw()` steps and returns it.
- `write_call_home_image(image)` records `self.writes.append("call_home")` and stores the image for the next read.
- [ ] **Step 2: Write the failing tests:**
- `test_s3_enable_byte_reads_from_the_unescaped_block`: on the default raw → `call_home_enabled(raw) is True`. A raw with an escape spliced in before byte 5 (`00 7C 10 03 00 00 01 …`) still reads True.
- `test_s3_image_changes_only_byte_5`: `call_home_image(raw, False)` differs from `write_image(0x7E, raw)` at index 5 only, and its length is 126 (N `0x7C` + 2).
- `test_s3_image_refuses_an_unknown_byte_5`: raw with unescaped `[5] = 0x07` → `ValueError`.
- `test_s3_call_home_state`: through `Series3Adapter` with the fake → `enabled is True`, `dial_string == "RADIO RING"`, `detail["serial_verified"] is False`; the calls include `"wake"` before `"read_call_home_raw"`.
- `test_s3_live_change_is_refused_until_the_frame_is_verified`: `dry_run=False` → `NotSupported` (501), the factory never called.
- `test_s3_dry_run_shows_both_frames`: `dry_run=True` → plan steps `0x7E`/`0x7F`, `fake.writes == []`.
- `test_s3_change_once_verified` (monkeypatch `S3_CALL_HOME_FRAME_VERIFIED = True`): live `enabled=False` → `("sent", "ok", "disabled")`, `fake.writes == ["call_home"]`, `detail["snapshot"]["changed_offsets"] == [5]`.
- `test_s3_unknown_byte_5_sends_nothing` (gate open): raw with `[5] = 0x07` → `UnitStateUnknown`, no write.
- [ ] **Step 3: Run** the new file. Expected: FAIL (`ImportError: call_home_enabled`).
- [ ] **Step 4: Implement** as specified.
- [ ] **Step 5: Run** the new file plus `tests/test_device_access_change.py tests/test_server_series3_guard.py`. Expected: pass.
- [ ] **Step 6: Commit** `feat(sfm): Series-3 call-home state and audited enable/disable, live send gated until its frame is verified (phase 4)`.
### Task 4: Reproduce Blastware's Series-3 call-home write (opens the gate)
**Precondition:** Brian has found a capture of Blastware changing call-home settings, from the BW VM (CLAUDE.md names it `4-20-26/call home settings/`, BE11529), and copied the BW-TX and S3-RX files into `tests/fixtures/s3-call-home-bw/`. **If no capture exists, skip this task.** The gate stays shut, the Series-3 half of the bench (Task 7) starts by recording one, and this task runs after it.
**Files:**
- Create: `tests/fixtures/s3-call-home-bw/` (Brian's files, added with `git add -f` if they match an ignore rule) and `tests/test_s3_call_home_bw_frames.py`
- Modify: `sfm/device_access/s3.py` (`S3_CALL_HOME_FRAME_VERIFIED = True`, with a comment naming the test)
- [ ] **Step 1: Write the test** `test_sfm_builds_blastwares_call_home_write`:
1. Parse the S3-RX file with `S3FrameParser`, taking each `0xD3` data reply (`data[11:]`) in order. Parse the BW-TX file for the `0x7E` and `0x7F` request frames, using the #46 parser in `tests/test_minimate_write_frames.py` (`_frames`, `_payload`; import or copy them).
2. For each `0x7E`, work out what Blastware asked for: the unescaped byte 5 of its image.
3. Assert `build_bw_write_frame(0x7E, call_home_image(prev_read, wanted)) == bw_7e_frame` and `build_bw_write_frame(0x7F, b"") == bw_7f_frame`.
4. If Blastware also changed fields other than byte 5 in that write, assert only on writes where byte 5 is the sole difference from the read, and record the count.
- [ ] **Step 2: Run it.** Expected: PASS, with at least one write asserted. A FAIL means SFM's frame is not Blastware's: stop, record the byte differences in the spec's phase-4 notes, and leave the gate shut.
- [ ] **Step 3: Flip the gate**, then run `tests/test_s3_call_home.py`. The "refused until verified" test now fails by design: change it to assert the gate's comment names this test, and keep the monkeypatched tests.
- [ ] **Step 4: Commit** `test(s3): SFM's call-home write equals Blastware's, frame for frame -- opens the live send`.
### Task 5: DeviceAccess and the serial routes
**Files:**
- Modify: `sfm/device_access/access.py` (two methods, two constants), `sfm/server.py` (three routes, `_SERIAL_AWARE_PATHS`)
- Test: `tests/test_device_access_call_home.py`, plus additions to `tests/test_server_device_access.py`
**Interfaces:**
- Consumes: Tasks 2 and 3.
- Produces:
- `DeviceAccess.call_home_state(address, serial) -> CallHomeState` (a read, via `_dispatch`).
- `DeviceAccess.set_call_home(address, serial, *, enabled: bool, dry_run=False, even_if_already=False, caller="api") -> ChangeResult` (`change=True`). It uses `_CALL_HOME_VERIFY_TIMEOUT_S = 3.0` and `_CALL_HOME_VERIFY_INTERVAL_S = 1.0`, at most 3 read-backs one second apart, not the monitoring window.
- Routes:
- `GET /device/call_home/state?serial=&host=&tcp_port=` → the `CallHomeState` as a dict.
- `POST /device/call_home/enable` and `/device/call_home/disable`, taking `serial` (required), `host`, `tcp_port`, `dry_run`, `even_if_already` and `caller`, through `_change_response`. The statuses are the start/stop route's, including Batch 2's `sent`/`audit_id` on an unconfirmed change.
- All three go in `_SERIAL_AWARE_PATHS`. The legacy `GET`/`POST /device/call_home` stay unchanged, and outside that set.
- [ ] **Step 1: Write the failing tests:**
- `test_set_call_home_dispatches_by_series`: a `UM` serial reaches the S4 function and a `BE` serial the S3 adapter, using the fakes from Tasks 2 and 3.
- `test_set_call_home_is_never_retried`: an S4 held line that drops → raised, executed once.
- `test_call_home_routes_need_a_serial`: no `serial` → 422.
- `test_enable_route_returns_the_change_result`: a fake access → 200 and the body's `action == "enable call-home"`.
- `test_legacy_call_home_post_still_refuses_a_micromate_serial`: `_device_guard("/device/call_home", {"serial": "UM20147"})` → 501, unchanged.
- `test_call_home_routes_are_serial_aware`: the three new paths are in `_SERIAL_AWARE_PATHS`.
- [ ] **Step 2: Run.** Expected: FAIL (`AttributeError: set_call_home`).
- [ ] **Step 3: Implement**, mirroring `start_monitoring` / `device_monitor_start`.
- [ ] **Step 4: Run** the new and modified test files plus `tests/test_server_series3_guard.py`. Expected: pass.
- [ ] **Step 5: Commit** `feat(sfm): call-home state and enable/disable by serial -- GET /device/call_home/state, POST /device/call_home/{enable,disable} (phase 4)`.
### Task 6: The page — Call Home by serial
**Files:**
- Modify: `sfm/static/device_routing.js` (routes, `controlsFor`, `serialPanes`, `changeErrorText`, new `callHomeRows`), `sfm/static/sfm_webapp.js` (glue), `sfm/sfm_webapp.html` (a state box and two buttons in the Call Home tab)
- Test: `tests/test_webapp_device_routing.py`, plus a jsdom run of `page_files_load.js` in the scratchpad (not committed)
**Interfaces:**
- Consumes: Task 5's routes and Batch 2's `serialPanes` / `changeErrorText`.
- Produces:
- `DEVICE_ROUTES`:
- `call_home_state: ['GET', '/device/call_home/state', true]`
- `call_home_on: ['POST', '/device/call_home/enable', true]`
- `call_home_off: ['POST', '/device/call_home/disable', true]`
- `controlsFor(unit).callHomeChange = serialMode && (series === 3 || series === 4)`. `callHomeWrite` (the legacy multi-field form) stays `false`, with `reasons.callHomeWrite = 'By serial: use Call-home On / Off (audited). Other call-home fields wait for the THOR round.'`
- `serialPanes(...)` gains `callHomeForm: !bySerial` and `callHomeBox: bySerial`. Batch 2's existing test gets the two keys added.
- `changeErrorText(label, status, body, unit, statusText)` takes the whole label (`"Start monitoring"`, `"Enable call-home"`) and returns `` `${label} not confirmed: …` `` / `` `${label} failed: …` ``. Update its two callers and Batch 2's test.
- `callHomeRows(state) -> [[label, value], …]` returns:
- `['Call-home', 'On' | 'Off' | 'Unknown (byte 5 = 0xNN)']`
- `['Dial string', … or '—']`
- `['Series', 3 | 4]`
- [ ] **Step 1: Write the failing Node tests:**
- `test_call_home_routes_need_a_serial`: `deviceUrl('call_home_on', BLANK)` → null; with S4 → `{method: 'POST', path: '/device/call_home/enable?serial=UM20147&host=h&tcp_port=9034'}`.
- `test_call_home_change_needs_a_confirmed_series`: typed but unconfirmed → false; confirmed 3 → true; confirmed 4 → true; legacy → false.
- `test_call_home_rows`: `{enabled: true, dial_string: 'RADIO RING', series: 4}` → `[['Call-home','On'],['Dial string','RADIO RING'],['Series',4]]`; `{enabled: null, detail: {byte5: '0x07'}, series: 3}` → first row `['Call-home','Unknown (byte 5 = 0x07)']`.
- Update the `changeErrorText` and `serialPanes` tests to the new shapes.
- [ ] **Step 2: Run** `pytest tests/test_webapp_device_routing.py`. Expected: FAIL (`callHomeRows` is not defined).
- [ ] **Step 3: Implement the routing functions**, then the glue:
- By serial, the Call Home tab hides the legacy form and shows the state box via `serialPanes`, in `applyControls`.
- `readCallHome()` uses `call_home_state` and renders `callHomeRows`.
- `changeCallHome(on)` asks `confirm()` with the serial and on/off, sends `call_home_on`/`call_home_off`, reports with `changeSummary` / `changeErrorText('Enable call-home' | 'Disable call-home', …)`, then re-reads the state.
- The buttons are enabled by `controlsFor().callHomeChange`.
- HTML: `#ch-state` (a `dev-table`), `#ch-on-btn` and `#ch-off-btn` inside a `#ch-serial` box; the existing form goes in `#ch-legacy`.
- [ ] **Step 4: Run** the Node tests (pass), then the jsdom check. Extend `page_files_load.js` with:
- S4: Call Home read → rows shown, legacy form hidden;
- Off → `POST /device/call_home/disable?serial=UM20147…` sent after confirm, status from `changeSummary`;
- legacy mode: form shown;
- no script errors.
- [ ] **Step 5: Commit** `feat(sfm): the page's Call Home tab by serial -- state and audited On / Off (phase 4)`.
### Task 7: Docs, and the bench session (Brian's go per send)
**Files:**
- Modify: the spec (a "Phase 4" entry after phase 3's under Build phases), `CLAUDE.md` ("Where things stand"), and `docs/micromate_protocol_reference.md` / `docs/instantel_protocol_reference.md` (CRLF: Edit tool or byte-safe writes) for whatever the bench measures
- [ ] **Step 1: Docs before the bench.**
- Spec: what was built, with commit IDs; the gate's state; the bench questions below.
- CLAUDE.md: one status line.
- Commit `docs: phase 4 built -- call-home enable/disable by serial; bench questions`.
- [ ] **Step 2: Bench, UM20147 on its modem, idle.** One send per go:
- (a) dry run `disable`, showing frames and warnings, including "0x00 is unobserved";
- (b) `enable` with `even_if_already` (the no-op write: does a Micromate accept it?);
- (c) `disable`: read-back, the unit's screen, and the snapshot's changed offsets;
- (d) `enable`, back to how it was.
- Record each audit id and `[118:120]` before/after.
- [ ] **Step 3: Bench, BE9441 on its modem, idle.**
- If Task 4 did not run: first record Blastware changing call-home on BE9441 through the bridge, then run Task 4.
- Then (a) to (d) as above.
- [ ] **Step 4: One unit monitoring** (Brian picks which): a dry run, then one `disable` / `enable` pair. This settles whether a unit accepts a call-home write while monitoring. Unmeasured; nothing in the code assumes either answer.
- [ ] **Step 5: Record the results** in the spec and the protocol references (measured, with audit ids), and commit `docs: phase 4 bench -- call-home on/off on both series`.
@@ -1,525 +0,0 @@
# Phase 5: Changing a Unit's Settings by Serial — Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** An operator edits a unit's live settings in SFM, by serial, on either series: preview old → new, send once (audited), and see what the unit now holds.
**Architecture:**
- **One pure settings codec for both series** (`micromate/setup_fields.py`), on the measured shared 2,090-byte layout.
- **Each series' adapter supplies reads, the plan and the send** to the existing `run_change` core, unchanged.
- Its "state" is a read-back verdict: `as asked` / `unchanged` / `differs`.
- Series 3 sends through `push_config_raw`; Series 4 through `plan_setup_push`.
- Series 4 also reads the unit's schedule, read-only, to refuse a change that a scheduled start would undo.
- **One audited route**, `POST /device/settings/change`. The legacy by-host write is retired.
**Tech Stack:** Python 3 (FastAPI, pytest), vanilla JS tested in Node (`tests/test_webapp_device_routing.py`).
**Spec:** `docs/superpowers/specs/2026-11-03-sfm-phase5-settings-design.md` (approved by Brian 2026-11-03). Parent spec: `docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md`.
## Global Constraints
- **Worktree and branch:** work in `~/seismo-relay-parity` on `feat/series4-sfm-parity`. Check `git branch --show-current` before every commit; never commit to `main`; push every commit.
- **Python:** `/home/serversdown/seismo-relay/.venv/bin/python -m pytest …` from the worktree root.
- **The suite has 16 known failures.**
- Run the full suite once before Task 1 and save the failure list in the plan workspace as `baseline-failures.txt`.
- Before every commit, run the suite, read the failure list, and confirm it equals the baseline.
- Commit in a separate call, never chained to the test run.
- **No live device traffic** in any task. The bench is after the final review, with Brian's explicit go per send.
- Never port 8200.
- Never write modem baud or modem type.
- Never send `0xA2`.
- **`CHANGELOG.md` is not touched** on this branch; it is written on `dev` at the merge.
- **No inline JavaScript.** New page logic goes in `sfm/static/device_routing.js` (DOM-free, Node-tested); glue goes in `sfm/static/sfm_webapp.js`.
- **`docs/instantel_protocol_reference.md` is CRLF.** Edit it only with the Edit tool. Keep its rows in date order.
- **Off-limits (the checker session's files):** `minimateplus/event_file_io.py`, `histogram_codec.py`, `waveform_codec.py`, `bw_xml_report.py`, `decode_check*.py`.
- **`TOOL_VERSION` is unchanged:** nothing here changes event decoding. Operational consequence: none; no migration, no backfill.
- **Grade every protocol claim** in comments and docs as measured or inferred.
- **Mutation checks:** after a mutate/restore, delete the module's `__pycache__/*.pyc` before the confirming run.
## Review Focus
1. **A Micromate with no schedule file, or a schedule read that fails.**
- A body with no records means no conflict, and the change proceeds.
- A read that raises refuses the change in plain words.
- Owner: Task 4; tests `test_no_schedule_records_is_no_conflict` and `test_an_unreadable_schedule_refuses`.
2. **A float that is stored as f32.** 0.3 reads back as 0.30000001192.
- The verdict compares bytes with the image written, never floats, so it reads `as asked`.
- Owner: Task 2; test `test_f32_values_read_back_as_asked`.
3. **A stale or foreign revision** after a keypad edit, or a preview of another unit.
- The send is refused with 409, nothing is sent, and no audit row is written.
- Owner: Tasks 4 and 5; tests `test_s4_stale_revision_sends_nothing` and `test_s3_stale_revision_sends_nothing`.
4. **Range and trigger changed in one request.** The trigger is checked against the **new** range.
- Owner: Task 2; test `test_trigger_checked_against_the_new_range`.
5. **Notes at the edges.**
- `""` clears a note.
- 41 bytes is accepted; 42 is refused; non-ASCII is refused.
- Labels are never written.
- Owner: Task 2; tests `test_note_edges` and `test_note_labels_are_never_written`.
---
## File Structure
| file | responsibility |
|---|---|
| `minimateplus/protocol.py` | **Series 3 assembly:** `assemble_compliance_content`, `is_compliance_content`, `MiniMateProtocol.read_compliance_content`. **Writes:** `push_config_raw`'s pre-check raises `ImageRefused`. |
| `minimateplus/client.py` | **Added:** `read_compliance_content()` and `read_settings_blocks()`. **Deleted:** `apply_config`, `set_project_info`, `_encode_compliance_config`. |
| `micromate/setup_block.py` | **Added:** `with_crc(content)`. |
| `micromate/setup_fields.py` (new) | **The shared, pure settings codec:** field registry, `editable_fields`, `check_changes`, `encode_setup`, `field_values`, `settings_state`, `revision`. |
| `micromate/schedule.py` (new) | **Pure:** `parse_schedule`, `ScheduleEntry`, `schedule_conflicts`. |
| `micromate/protocol.py` | **Added:** `read_file(path)`, using `0x94` then `0x48` pages. |
| `micromate/client.py` | **Added:** `read_schedule()`, `get_active_setup_raw()`, `get_prefs_content()`, `get_trigger_content()`, `get_setup_content()`. |
| `micromate/opcodes.py` | `ENABLEABLE_WRITES` gains the setup-push SUBs. |
| `sfm/device_access/errors.py` | **Added:** `SettingsChanged` and `ChangeRefused`, both 409. |
| `sfm/device_access/change.py` | **Added:** `settings_change()`. |
| `sfm/device_access/s4.py` | `s4_settings` moves onto the codec. **Added:** `s4_change_settings`. |
| `sfm/device_access/s3.py` | `Series3Adapter.settings` moves onto the codec. **Added:** `Series3Adapter.change_settings`. |
| `sfm/device_access/access.py` | **Added:** `DeviceAccess.change_settings`. |
| `sfm/server.py` | **Added:** `POST /device/settings/change`. `/device/config` and `/device/config/project` return 410. |
| `sfm/static/device_routing.js`, `sfm/static/sfm_webapp.js`, `sfm/sfm_webapp.html` | The edit form. |
| `tests/device_access_fakes.py` | The fakes gain settings blocks, a schedule, and writes. |
---
### Task 1: Series 3 — assemble a settings read into the logical block
**Measured basis (spec, 2026-11-03):** unescape each `1A` data frame and take `data[11:]`. Every frame but the last starts with one non-content `00` byte; drop it. The result is 2,090 bytes with `N = 2090` at `[0:2]`.
**Files:**
- Modify: `minimateplus/protocol.py`, near `read_compliance_config` (≈ line 913)
- Modify: `minimateplus/client.py`
- Modify: `docs/instantel_protocol_reference.md` (one dated row, 2026-11-03)
- Test: `tests/test_s3_settings_read.py` (new)
**Interfaces:**
- Produces:
- `assemble_compliance_content(frames: list[bytes]) -> bytes`. `frames` is each data reply's `frame.data`, escapes kept, in order.
- `is_compliance_content(block: bytes) -> bool`: `len == 2090` and `int.from_bytes(block[0:2], "big") == 2090`.
- `COMPLIANCE_CONTENT_LEN = 2090`.
- `MiniMateProtocol.read_compliance_content() -> bytes`:
- sends the same probe and B/C/D requests as `read_compliance_config`;
- a missing data frame raises `ProtocolError` (no `continue`);
- returns the assembled bytes **without** judging them, so a monitoring unit's device-info answer comes back for the caller to recognise.
- `MiniMateClient.read_compliance_content() -> bytes`.
- `MiniMateClient.read_settings_blocks() -> dict` with keys `event_index`, `compliance`, `trigger` and `waveform`. Each value is the bytes its existing read returns:
- `event_index`: `proto.read_event_index()`
- `compliance`: `read_compliance_content()`
- `trigger`: `proto.read_trigger_config()`
- `waveform`: `proto.read_waveform_data_raw()`
- [ ] **Step 1: Write the failing tests** in `tests/test_s3_settings_read.py`. Use `tests/fixtures/minimate-bench-10-26-26-histogram` (`unit_replies.bin` parsed with `S3FrameParser`). Group the `0xE5` frames into reads: a frame with `len(data) == 11` starts each read. Take the write images from `tests/test_minimate_write_frames.py` (`WRITES[0:13]`, `WRITES[13:26]`; the `0x71` payloads `[16:]` joined).
```python
def test_reads_assemble_to_2090_bytes(): # all 12 reads, both frame patterns (5 and 3 frames)
assert all(len(assemble_compliance_content(r)) == 2090 for r in READS)
def test_a_read_after_a_blastware_write_equals_the_write():
assert assemble_compliance_content(READS[1]) == IMAGES[0][:2090]
assert assemble_compliance_content(READS[2]) == IMAGES[1][:2090]
def test_a_monitoring_units_answer_is_not_settings(): # READS[3:8] start 0e 'BE9441'
assert [is_compliance_content(assemble_compliance_content(r)) for r in READS[3:8]] == [False] * 5
assert all(is_compliance_content(assemble_compliance_content(r)) for r in READS[:3] + READS[8:])
def test_read_compliance_content_refuses_a_missing_frame():
... # a fake transport that answers the probe and frame B, then times out: ProtocolError, nothing assembled
```
- [ ] **Step 2: Run them.** `…pytest tests/test_s3_settings_read.py -q`. Expected: FAIL (ImportError: `assemble_compliance_content`).
- [ ] **Step 3: Implement** the Produces block in `protocol.py` and `client.py`. Use `unescape_reply` from `minimateplus.framing`. The docstring cites the measurement and its fixture.
- [ ] **Step 4: Run them.** Expected: PASS (4 passed).
- [ ] **Step 5: Add a reference row** to `docs/instantel_protocol_reference.md` (Edit tool; CRLF), dated 2026-11-03, measured. Cover:
- the assembly rule;
- the round trip (2 of 2);
- `[26:28]`: Blastware writes `00 00` (11 of 11), and the unit sets `01 7f` after monitoring;
- the trailing two bytes: a per-unit Blastware constant (`7c ea` BE11529 ×9, `0c e9` BE9441 ×2), not the CRC, and never in a reply;
- `0x09 [200:202]`: echoed 9 of 9 in April; changed on 10-26 (`17 17` → `78 76`).
- [ ] **Step 6: Run the full suite** and compare the failure list with the baseline. **Then commit** (separate call): `feat(s3): assemble a settings read into the 2,090-byte block`.
---
### Task 2: The shared settings codec
**Files:**
- Create: `micromate/setup_fields.py`
- Modify: `micromate/setup_block.py`: add `with_crc(content: bytes) -> bytes`, which returns the content with `CRC-16/AUG-CCITT` over `[0:N-2]` written BE at `[N:N+2]`.
- Test: `tests/test_setup_fields.py` (new)
**Interfaces:**
- Consumes: Task 1's `assemble_compliance_content`, used in tests only. The codec itself imports nothing from `minimateplus` and nothing from `sfm`.
- Produces (all pure). Each `content` is the 2,090-byte (Series 3) or 2,092-byte (Series 4) block.
- `editable_fields(content: bytes, series: int) -> list[dict]`. Each dict has `field`, `label`, `kind` (`"number"`, `"choice"`, `"text"` or `"bool"`) and `value`, plus as relevant `unit`, `min`, `max`, `choices` (a list of `{value, label}`) and `maxlength`.
- `field_values(content: bytes, series: int) -> dict[str, Any]`: the same fields, values only.
- `check_changes(content: bytes, series: int, changes: dict) -> dict`: returns the normalised changes, or raises `SettingsValueError(ValueError)` with a plain sentence. It has two kinds of check: static (names, types, choices, limits) and content-dependent (unit strings, the trigger against the range).
- `encode_setup(content: bytes, series: int, changes: dict) -> bytes`:
- same length as `content`;
- only the changed fields' bytes move;
- bit fields are patched bit by bit;
- Series 3 also sets `[26:28] = 00 00` (`S3_BLASTWARE_FIXED`);
- Series 4 returns `with_crc(...)`.
- `settings_state(before: bytes, written: bytes, now: bytes, *, series: int) -> str`. It compares `[0:2090]`:
- `"as asked"` if `now` equals `written` (Series 4 also needs `crc_ok(now)`);
- else `"unchanged"` if `now` equals `before`;
- else `"differs"`.
- `revision(blocks: list[bytes]) -> str` = `hashlib.sha256(b"".join(blocks)).hexdigest()[:16]`.
- `S3_ALARM_WRITE_MEASURED = False`. While False, `geo_alarm_ips` is shown (read-only, `kind` plus `"readonly": True`) and refused in `check_changes`.
**The field registry** (content offsets; channel `k` = `1708 + 48·k`, `k` = 0, 1, 2 for the geophones):
| field | series | bytes | values (exact) |
|---|---|---|---|
| `record_mode` | 3 | `[5]` | `single_shot`=0, `continuous`=1, `histogram`=3, `histogram_continuous`=4 |
| `record_mode` | 4 | `[5]` | `waveform`=1, `manual`=2, `histogram`=3, `combo`=4 |
| `sample_rate` | 3, 4 | `[6:8]` u16 BE | {1024, 2048, 4096} |
| `histogram_interval_s` | 3, 4 | `[8:10]` u16 BE | {2, 5, 15, 60, 300, 900} |
| `record_time_s` | 3 | `[18:22]` f32 BE | 1.0 ≤ v ≤ `S3_MAX_RECORD_S[sample_rate]` = {1024: 104, 2048: 52, 4096: 26}, and ≤ 13 when `record_mode` is `histogram_continuous` (the **new** mode and rate if they change too) |
| `record_time_s` | 4 | `[18:22]` f32 BE | 1.0 ≤ v ≤ 90.0 |
| `geo_trigger_ips` | 3, 4 | ch k `+30` f32 BE, all three | 0.005 ≤ v ≤ 10.0, a multiple of 0.001 (within 1e-9), and ≤ the (new) range's full scale (10.0 / 1.25) |
| `geo_range` | 3 | ch k `+29` u8, all three | `normal`=0, `sensitive`=1 |
| `geo_alarm_ips` | 3 (gated) | ch k `+38` f32 BE, all three | 0.005 ≤ v ≤ full scale |
| `job_number` | 3, 4 | `[40:42]` u16 BE | 1 ≤ v ≤ 9999 |
| `job_number_shown` | 3, 4 | `[39]` bit `0x02` | bool |
| `note_1` … `note_4` | 3, 4 | value `[144+64n : 186+64n]`; label `[122+64n : 144+64n]` read only | printable ASCII 0x20–0x7E, ≤ 41 bytes, zero-filled to 42 |
The limits are **the units' own, from Instantel's manuals** (Brian, 2026-11-03), cited in the module as comments:
- **Trigger** 0.005–10 in/s, steps of 0.001: MiniMate Plus manual 716U0101 Rev 15, Appendix *Series III Specifications*; Micromate manual 721U0201 Rev 06, *Geophone Trigger Level*.
- **Record time:**
- Micromate 1–90 s (*Record Time*).
- MiniMate: §4.4's *Maximum Record Times*, 1 MB unit, channels 1–4; §3.8.9, 13 s in Histogram Combo.
- **Job number** 1–9999: both manuals.
**A level write is refused** unless all three geophone channels' unit string, `ch +34:+38` with NULs and `.` stripped, equals `in`. Measured: `in.` and `in` both occur on UM20147. A unit set to Metric is unmeasured.
- [ ] **Step 1: Write the failing tests** in `tests/test_setup_fields.py`:
```python
def test_s3_reproduces_every_blastware_write():
# BE11529's 9 April images (bridges/captures/4-20-26/**/raw_bw_*.bin), in time order (the HHMMSS in
# the name): before = the previous image; the first (151921) uses the assembled 1A read in its own
# raw_s3 capture if that read is whole, else it is skipped (say so in the test). BE9441's 2 images:
# before = the assembled READS[0], then image 1. changes = field_values(after) for every field whose
# value differs. Assert encode_setup(before, 3, changes)[:2090] == after[:2090].
# The 16:26 write also moves [25] (mic on): include `_sensors_mic` as a test-only patch helper,
# not a registry field.
def test_s4_fixture_pairs_reproduce():
# for every ordered pair (a, b) of tests/fixtures/micromate-setup/*.bin whose differing bytes outside
# [2090:2092] all lie inside registry fields: encode_setup(a, 4, {f: field_values(b)[f] for differing f}) == b
def test_trigger_checked_against_the_new_range(): ... # Series 3: {"geo_range": "sensitive", "geo_trigger_ips": 2.0} refuses (above 1.25); 1.25 passes; {"geo_trigger_ips": 2.0} alone on Normal passes
def test_limits_refuse_outside_values(): ... # 0.004 and 10.001 in/s; 0.3005 (not a 0.001 step); job 0 and 10000; S4 0.9 and 90.1 s;
# S3 at 4096 sps: 26 ok, 26.1 refused; S3 histogram_continuous: 13 ok, 13.1 refused;
# S3 {"sample_rate": 1024, "record_time_s": 100} passes from a 4096 sps block (the new rate counts);
# sample rate 8192; interval 30
def test_field_not_offered_for_the_series(): ... # geo_range on series 4 -> SettingsValueError naming the series
def test_alarm_is_read_only_until_measured(): ... # Series 3 geo_alarm_ips -> SettingsValueError while S3_ALARM_WRITE_MEASURED is False
def test_metric_unit_string_refuses_level_writes(): ... # ch +34 = b"mm\x00\x00" -> SettingsValueError; b"in.\x00" and b"in\x00\x00" pass
def test_note_edges(): ... # "" clears; 41 bytes ok; 42 refused; "café" refused
def test_note_labels_are_never_written(): ... # changing note_2 moves only [208:250]
def test_bit_fields_keep_unknown_bits(): ... # [39] = 0x81: job_number_shown True -> 0x83, False -> 0x81
def test_s3_fixed_bytes(): ... # any S3 encode sets [26:28] = 00 00
def test_s4_encode_recomputes_the_crc(): ... # crc_ok(encode_setup(fixture, 4, {"job_number": 7}))
def test_f32_values_read_back_as_asked(): ... # written = encode(0.3); settings_state(before, written, written) == "as asked"
def test_settings_state(): ... # "as asked" / "unchanged" / "differs"; S4 with a bad CRC -> "differs"
def test_revision_is_stable_and_content_sensitive(): ...
```
- [ ] **Step 2: Run them.** Expected: FAIL (ModuleNotFoundError: `micromate.setup_fields`).
- [ ] **Step 3: Implement** `micromate/setup_fields.py` and `with_crc`. Decode via the registry (not via `decode_setup`, whose notes are keyed by label). Note labels come from the unit and are display only.
- [ ] **Step 4: Run them.** Expected: PASS. Then mutation-check `S3_BLASTWARE_FIXED` (remove it: the Blastware-write test fails), delete the `.pyc`, and restore.
- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(codec): one settings codec for both series, on the shared layout`.
---
### Task 3: Micromate — read the schedule file
**Measured basis:** reference *The scheduler, and a generic file transfer* and *The schedule record format*.
- `0x94 <path>` opens a file for read; `offset` = the path's length, and the payload is the path, unpadded.
- `0x48` reads the next page, repeated until an all-zero 11-byte response.
- The file is 260-byte records. `[4]` is the half-hour slot. `[6]` is the action bitmask: 2 start-with-setup, 4 stop, 8 self-check, 16 ACH. `[7]` is the name length; `[8:260]` is the name.
**Files:**
- Create: `micromate/schedule.py`
- Modify: `micromate/protocol.py` (`read_file`), `micromate/client.py`
- Modify: `docs/micromate_protocol_reference.md`: one line under the scheduler section saying SFM reads it (read-only) from 2026-11-03.
- Test: `tests/test_micromate_schedule.py` (new)
**Interfaces:**
- Produces:
- `SCHEDULE_PATH = "\\system\\schedule\\schedule.dat"`.
- `MicromateProtocol.read_file(path: str) -> bytes`: the concatenated content of each `0x48` page after the page-0 descriptor, stopping at the all-zero response; at most 64 pages, else `ProtocolError`.
- `MicromateClient.read_schedule() -> bytes`.
- `MicromateClient.get_active_setup_raw() -> str`: the `0x41` name up to its NUL, **not** stripped.
- `MicromateClient.get_prefs_content() -> bytes` (`0x08`), `get_trigger_content() -> bytes` (`0x2E`) and `get_setup_content() -> bytes` (`0x1A`), each `_content(...)` of its read.
- `@dataclass(frozen=True) class ScheduleEntry`: `index: int`, `time: str` (`"HH:MM"`), `day: int`, `action_bits: int`, `actions: tuple[str, ...]`, `setup: str`.
- `parse_schedule(body: bytes) -> list[ScheduleEntry]`: 260-byte records; a record with `[4:8]` all zero and no name ends the list. `actions` names the bits 2/4/8/16 as `start_with_setup`, `stop`, `self_check` and `call_home`; any other bit becomes `unknown(0xNN)`.
- `schedule_conflicts(entries, active_setup: str) -> list[ScheduleEntry]`: start entries whose setup, compared case-insensitively after `strip()`, is not the active setup.
- [ ] **Step 1: Write the failing tests.** Parse the bodies from `bridges/captures/9-24-26 - micromate2/raw_s3_20260924_191835_read_scheduler.bin` (frames 0–4), and from the two `raw_*_20260925_*` captures, with `MicromateFrameParser`.
```python
def test_the_read_capture_parses(): # 2 records: start-with-setup 07:30 (40-char name), call_home 19:30 (no name)
def test_the_five_entry_schedule_parses(): # 07:30 start TEST1.mmb, 08:00 stop, 08:30 self_check, 09:00 start test2.mmb, 19:30 call_home
def test_conflicts_are_case_insensitive(): # active "test1.MMB" -> only the test2.mmb start conflicts
def test_no_schedule_records_is_no_conflict(): assert schedule_conflicts(parse_schedule(bytes(524)), "x.mmb") == []
def test_read_file_sends_the_path_unpadded_and_stops_at_zeros(): ... # a fake protocol: 0x94 offset 0x001D, then 0x48 until all-zero
def test_get_active_setup_raw_keeps_spaces(): ... # " LOC 4 .mmb " survives
```
- [ ] **Step 2: Run them.** Expected: FAIL (ModuleNotFoundError: `micromate.schedule`).
- [ ] **Step 3: Implement** the Produces block. `read_file` builds `0x94` with `build_request(0x94, len(path), bytes(10), path.encode("ascii"))`. Both SUBs are already in `READ_SUBS`.
- [ ] **Step 4: Run them.** Expected: PASS.
- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(micromate): read the schedule file (read-only)`.
---
### Task 4: Change-path pieces and the Series 4 settings change
**Files:**
- Modify: `sfm/device_access/errors.py`, `sfm/device_access/change.py`, `micromate/opcodes.py`, `sfm/device_access/s4.py`, `tests/device_access_fakes.py`
- Modify: `tests/test_micromate_execute.py`, `tests/test_micromate_opcodes.py`. Their over-ceiling example `0x71` becomes enableable here; use `0xA8` (delete one event) instead.
- Test: `tests/test_device_access_s4_settings.py` (new)
**Interfaces:**
- Consumes:
- Task 2: `editable_fields`, `field_values`, `check_changes`, `encode_setup`, `settings_state`, `revision`.
- Task 3: `read_schedule`, `parse_schedule`, `schedule_conflicts`, `get_active_setup_raw`, and the content getters.
- `micromate.writes.plan_setup_push(prefs, trigger, setup, name)`.
- Produces:
- `class SettingsChanged(DeviceError)`, `http_status = 409`.
- `class ChangeRefused(DeviceError)`, `http_status = 409`.
- `settings_change() -> ChangeKind("change settings", "as asked", "applied")`.
- `ENABLEABLE_WRITES = frozenset({0x96, 0x97, 0x7E, 0x7F, 0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72})`.
- `s4_settings(client, serial) -> UnitSettings`. It keeps every current field, plus `detail["editable"] = editable_fields(setup, 4)`. The revision comes only from a preview (dry run), never from this read.
- `s4_change_settings(client, serial, *, changes: dict, revision: Optional[str], dry_run: bool, audit, address, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`.
**`s4_change_settings` behaviour**, through `run_change` (`even_if_already=False`):
- **`read_state`, first call:**
- Read the run state.
- `calling_home` and `unknown*` are returned as they are.
- `monitoring` raises `UnitStateUnknown(f"{serial} is monitoring -- stop it first (a stop makes it call in if call-home is on) -- nothing sent")`.
- Read the name (raw), prefs, trigger and setup.
- `check_changes` (a `SettingsValueError` becomes `BadRequest`).
- When live, `revision([name.encode("ascii"), prefs, trigger, setup])` must equal the request's. Otherwise raise `SettingsChanged("the unit's settings changed since the preview -- preview again; nothing sent")`.
- `image = encode_setup(setup, 4, changes)`.
- Read the schedule; a read error is kept as a blocking reason.
- Return `settings_state(setup, image, setup, series=4)`.
- **Later calls:** read the setup and return `settings_state(before, image, now, series=4)`.
- **`describe_plan`:**
- `plan_setup_push(prefs, trigger, image, name).describe()`, plus `fields` = `{f: {label, old, new}}` for the changed fields, `revision`, `warnings` and `blocked`.
- `warnings` always includes: "this reads the unit's keypad edit buffer: if someone is in its menu, their unsaved edits are sent too".
- `blocked`:
- the name is `factory.MMB` (case-insensitive): "this unit is running its factory setup; load any other setup on its keypad, then try again";
- each schedule conflict: "this unit's schedule loads <setup> at <HH:MM>, which would replace this change";
- a schedule read error: "could not read this unit's schedule (<error>) -- SFM will not change a unit whose schedule it cannot check";
- `plan_setup_push` raising `ValueError` (a block size or header THOR's offsets were never seen at, or a failed checksum): "this unit's <message> -- SFM has not seen a block like it".
- When `blocked` is non-empty, `steps` is `[]`, and a live call raises `ChangeRefused("; ".join(blocked) + " -- nothing sent")`.
- When the schedule names the active setup, `warnings` adds: "the unit's schedule loads this setup at <HH:MM>; the change survives it".
- **`send`:** `client.protocol.execute(plan)`, as `s4_change_call_home` does.
- **`snapshot`:**
- `fields`: `{f: {label, old, new, now}}`;
- `before` / `after` hex of the setup;
- `changed_offsets`;
- `prefs` and `trigger`: before hex only.
- **`is_refusal`**, **`is_ring`** and **`pre_send`**: as in `s4_change_call_home`.
**Validation order:** a live call without `revision` is refused before any I/O, in Task 6's `DeviceAccess` (not here).
- [ ] **Step 1: Write the failing tests.** Extend `FakeMicromateClient` with:
- `setup` (default: `tests/fixtures/micromate-setup/um20147_baseline.bin`'s last 2,092 bytes);
- `prefs`, `trigger` and `active_name` (default `"test2.mmb"`);
- `schedule_body` (default `bytes(524)`) and `schedule_error`;
- `execute` applies a setup-push plan's `0x71` data to `self.setup` (re-adding the CRC with `with_crc`), so a read-back sees it.
```python
def test_s4_dry_run_previews_old_to_new_and_sends_nothing(): # fields == {"geo_trigger_ips": {"label": ..., "old": 0.5, "new": 0.3}}; revision present; fake.executed == []
def test_s4_trigger_change_sends_the_push_and_verifies(): # subs [0xDA,0x68,0x73,0x82,0x83,0x71,0x72]; outcome sent/ok; state_after "as asked"
def test_s4_stale_revision_sends_nothing(): # SettingsChanged; fake.executed == []; audit has no rows
def test_s4_already_as_asked_is_skipped(): # outcome skipped, nothing executed
def test_s4_monitoring_is_refused(dry_run in (True, False)): # "stop it first" and "nothing sent"
def test_s4_factory_setup_is_refused_live_and_shown_in_preview():
def test_s4_schedule_conflict_blocks(): # schedule starts "other.mmb" at 07:00 -> ChangeRefused naming other.mmb and 07:00
def test_s4_schedule_on_the_active_setup_warns_only():
def test_an_unreadable_schedule_refuses():
def test_no_schedule_records_is_no_conflict(): # bytes(524) -> sent
def test_s4_a_lost_ack_records_what_the_unit_holds(): # execute_error -> outcome failed, sent True, snapshot present
def test_s4_unseen_block_size_is_blocked(): # prefs 91 B -> preview blocked; live ChangeRefused; nothing executed
def test_setup_push_subs_are_now_enableable():
```
- [ ] **Step 2: Run them.** Expected: FAIL (ImportError: `s4_change_settings`).
- [ ] **Step 3: Implement** the Produces block and update `s4_settings`. In the two opcode tests, swap the over-ceiling example to `0xA8`.
- [ ] **Step 4: Run them**, plus `tests/test_micromate_execute.py`, `tests/test_micromate_opcodes.py`, `tests/test_micromate_writes.py` (THOR's setup-push frames still reproduce) and `tests/test_device_access_s4_call_home.py`. Expected: PASS.
- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(s4): change a Micromate's settings by serial, audited, schedule-checked`.
---
### Task 5: The Series 3 settings change
**Files:**
- Modify: `sfm/device_access/s3.py`, `minimateplus/client.py` (`push_config_raw` pre-check), `tests/device_access_fakes.py`
- Test: `tests/test_device_access_s3_settings.py` (new)
**Interfaces:**
- Consumes:
- Task 1: `read_compliance_content`, `read_settings_blocks`, `is_compliance_content`.
- Task 2: the codec.
- Task 4: `settings_change`, `SettingsChanged`, `ChangeRefused`.
- `MiniMateClient.push_config_raw(event_index, compliance, trigger, waveform)`.
- Produces:
- `push_config_raw` raises `ImageRefused` (from `minimateplus.protocol`) when its pre-check refuses a block, before any frame.
- `Series3Adapter.settings(address, serial) -> UnitSettings`. It is built on `read_compliance_content` and the codec, with the same top-level fields as today, plus `detail["editable"]`. A non-settings answer raises `UnitStateUnknown(S3_SETTINGS_WHILE_MONITORING)`.
- `S3_SETTINGS_WHILE_MONITORING = "did not return its settings -- a MiniMate answers this way while monitoring; stop monitoring first"`.
- `Series3Adapter.change_settings(address, serial, *, changes, revision, dry_run, audit, caller, sleep, verify_timeout_s, verify_interval_s) -> ChangeResult`, through `run_change` and `self._run(address, op, retry=False)`:
- `read_serial`: `client.connect().serial`.
- **`read_state`, first call:**
- Wake, then `read_settings_blocks()`.
- A non-settings `compliance` raises `UnitStateUnknown(f"{serial} {S3_SETTINGS_WHILE_MONITORING} -- nothing sent")`.
- `check_changes`, and the live revision check over `[event_index, compliance, trigger, waveform]`.
- Compute `image = encode_setup(...)` and return `settings_state(...)`.
- **Later calls:** wake, `read_compliance_content()`, then the verdict.
- **`describe_plan`:**
- `steps` in Blastware's order: 68 (event index, as read), 73, 71 (settings block, 2,092 B), 72, 82 (trigger, as read), 83, 69 (waveform data, as read), 74, 72. Each step has `sub`, `what` and `data_len`.
- `fields`, `revision` and `warnings` as Series 4. The warning: "the two bytes after the settings block go out as 00 00 (Blastware sends its own constant; effect unmeasured)".
- **`send`:** `client.push_config_raw(event_index, image, trigger, waveform)`.
- **`is_refusal`:** `isinstance(e, ImageRefused)`.
- **`snapshot`:** as Series 4, without prefs and trigger.
- [ ] **Step 1: Write the failing tests.** Extend `FakeMiniMateClient` with:
- `settings_blocks`: the default compliance is BE9441's assembled 10-26 read 2; `event_index`, `trigger` and `waveform` are the `0x68`, `0x82` and `0x69` payloads (`[16:]`) of `WRITES[13:26]` in `tests/test_minimate_write_frames.py`, each minus its two trailing bytes (a write is the read plus two);
- `push_config_raw` records its four arguments and makes the compliance the new `read_compliance_content`;
- `monitoring_settings=True` returns a device-info-shaped block.
```python
def test_s3_settings_read_uses_the_codec(): # editable includes geo_range; record_mode "histogram"; notes by slot with unit labels
def test_s3_dry_run_previews_and_sends_nothing():
def test_s3_trigger_change_sends_the_units_own_blocks(): # push args: event_index/trigger/waveform == the read blocks; compliance == encode_setup(...)
def test_s3_change_verifies_by_read_back(): # outcome sent/ok, state_after "as asked", snapshot fields old/new/now
def test_s3_stale_revision_sends_nothing():
def test_s3_monitoring_is_refused(dry_run in (True, False)):
def test_s3_a_refused_image_is_audited_as_nothing_sent(): # push_config_raw raises ImageRefused -> row sent 0, "refused before sending"
def test_push_config_raw_precheck_raises_image_refused(): # a 2,089-byte compliance block -> ImageRefused, no frame written
```
- [ ] **Step 2: Run them.** Expected: FAIL (AttributeError: `change_settings`).
- [ ] **Step 3: Implement** the Produces block.
- [ ] **Step 4: Run them**, plus `tests/test_s3_call_home.py`, `tests/test_minimate_write_frames.py` and `tests/test_device_access_*`. Expected: PASS, except the tests Task 6 deletes or rewrites. If one fails here only because it pins `apply_config`, leave it for Task 6 and note that in the ledger.
- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(s3): change a MiniMate's settings by serial on the shared codec`.
---
### Task 6: Device access, the route, and retiring the legacy write
**Files:**
- Modify: `sfm/device_access/access.py`, `sfm/server.py`, `minimateplus/client.py`
- Delete: `poc_set_project.py`. Remove `exp_compliance_only` (and its registration) from `experiments.py`.
- **Ruling (spec: "the legacy write is retired"):** both write a live unit through the retired encoder, which #46 found wrong. Git keeps them.
- Modify tests:
- `tests/test_s3_compliance_anchor_fields.py`: remove its write-side tests (the encoder is gone).
- `tests/test_minimate_write_frames.py`: `test_apply_config_writes_the_units_own_trigger_block` moves to Task 5's `test_s3_trigger_change_sends_the_units_own_blocks`; delete it here.
- `tests/test_server_series3_guard.py`: drop `apply_config` from `WRITES` and its fake method.
- `tests/test_server_device_access.py`: `/device/config` now 410.
- Test: `tests/test_device_access_settings.py` (new), `tests/test_server_settings_change.py` (new)
**Interfaces:**
- Consumes: Task 4's `s4_change_settings` and Task 5's `Series3Adapter.change_settings`.
- Produces:
- `DeviceAccess.change_settings(address, serial, *, changes: dict, revision: Optional[str], dry_run: bool = False, caller: str = "api") -> ChangeResult`:
- `normalise_serial`, then `series_for_serial`;
- `changes` must be a non-empty dict, else `BadRequest`;
- a live call without `revision` raises `BadRequest("preview first: a live change needs the revision from its preview -- nothing sent")`;
- a live call with no audit log raises `NotSupported` (as `set_call_home`);
- `_dispatch(..., change=True)` with `verify_timeout_s=_SETTINGS_VERIFY_TIMEOUT_S = 2.0` and `verify_interval_s=_SETTINGS_VERIFY_INTERVAL_S = 1.0`.
- `POST /device/settings/change`:
- query: `serial` (required), `host`, `tcp_port`, `port`, `baud`, `dry_run`, `caller`;
- JSON body `{"changes": {...}, "revision": "..."}`;
- returns `_change_response(...)`;
- added to `_SERIAL_AWARE_PATHS`.
- `POST /device/config` and `POST /device/config/project` return **410** with `{"detail": "retired: change a unit's settings by serial with POST /device/settings/change (audited, previewed, read back)"}`. Remove the cache-dirty hooks that only these routes called; keep the read routes.
- Delete `MiniMateClient.apply_config`, `set_project_info` and `_encode_compliance_config`, and any import left orphaned.
- [ ] **Step 1: Write the failing tests:**
```python
def test_live_change_without_revision_is_refused_before_io(): # factory never called
def test_empty_changes_is_a_bad_request():
def test_change_settings_dispatches_by_series_with_change_true():
def test_route_dry_run_returns_fields_and_revision(): # 200, body.plan.fields, body.plan.revision
def test_route_verified_change_is_200_and_mismatch_409():
def test_route_unconfirmed_carries_sent_and_audit_id():
def test_route_refusal_is_409_with_reason(): # ChangeRefused / SettingsChanged / monitoring
def test_legacy_config_routes_are_gone(): # both 410, nothing reaches a client factory
def test_settings_change_is_serial_aware(): # in _SERIAL_AWARE_PATHS; a UM serial goes to the Series-4 path
```
- [ ] **Step 2: Run them.** Expected: FAIL (404 / AttributeError).
- [ ] **Step 3: Implement** the Produces block, the deletions, and the test updates listed under Files.
- [ ] **Step 4: Run them**, plus `tests/test_server_*.py`. Expected: PASS. Check that `grep -rn "apply_config\|set_project_info\|_encode_compliance_config" --include=*.py .` finds only comments and history.
- [ ] **Step 5: Run the full suite** and compare with the baseline. **Commit:** `feat(sfm): POST /device/settings/change; retire the legacy config write`.
---
### Task 7: The page — edit, preview, send, "the unit now holds"
**Files:**
- Modify: `sfm/static/device_routing.js`, `sfm/static/sfm_webapp.js`, `sfm/sfm_webapp.html`
- Modify: `CLAUDE.md` (the "Where things stand" Series-4 parity line: phase 5 built, bench pending), and the spec's status line ("Built 2026-11-xx; bench pending").
- Test: `tests/test_webapp_device_routing.py` (extend `EXPORTS` and cases), `tests/test_webapp_static.py`
**Interfaces:**
- Consumes: `UnitSettings.detail.editable` / `.revision`, and the `ChangeResult` shapes from Tasks 4–6.
- Produces (DOM-free, in `device_routing.js`):
- `DEVICE_ROUTES.settings_change = ['POST', '/device/settings/change', true]`; remove `config_write`.
- `controlsFor(unit)`: `configWrite: serialMode && (series === 3 || series === 4)`; `reasons.configWrite: 'By serial only: Preview, then Send (audited).'`
- `settingsFormFields(st) -> Array<{field, label, kind, value, unit?, min?, max?, choices?, maxlength?, readonly?}>`: from `st.detail.editable`, in that order.
- `settingsChanges(fields, edited) -> object`: only fields whose edited value differs. Numbers compare as numbers; read-only fields are ignored.
- `settingsPreviewRows(body) -> Array<[label, old, new]>`, from `body.plan.fields`.
- `settingsBlockedText(body) -> string`: `body.plan.blocked` joined; `''` if none.
- `settingsResultRows(body) -> Array<[label, old, new, now]>`, from `body.detail.snapshot.fields`.
- **Page behaviour** (`sfm_webapp.js` glue; HTML ids `cfg-edit`, `cfg-preview-btn`, `cfg-send-btn`, `cfg-preview`, `cfg-result`):
- The serial-mode Config pane heading reads **"On the unit <SERIAL> — read <HH:MM>"**.
- The form is built from `settingsFormFields`.
- **Preview** POSTs a dry run and shows old → new, warnings and blocked reasons. It keeps `revision` and enables **Send** only when nothing is blocked and something changes.
- **Send** asks `confirm()` naming the serial and the fields, then POSTs live with the kept revision and shows "the unit now holds" rows. Errors go through `changeErrorText`.
- Editing any field after a preview disables **Send** until the next preview.
- The by-host legacy form loses its write button. Its read stays.
- No inline script; listeners via `addEventListener`.
- [ ] **Step 1: Write the failing Node-run cases** in `tests/test_webapp_device_routing.py`:
- `controlsFor` gives `configWrite` true by serial for both series, and false by host;
- `settingsChanges` returns only differing fields and compares `0.30` with `0.3` as equal;
- `settingsPreviewRows` / `settingsResultRows` / `settingsBlockedText` on bodies shaped as Task 6 returns them;
- `deviceUrl('settings_change', unit)` → `/device/settings/change?serial=…`;
- `config_write` is no longer a route.
In `tests/test_webapp_static.py`, assert the page has no inline `<script>` body and loads both static files.
- [ ] **Step 2: Run them.** `…pytest tests/test_webapp_device_routing.py tests/test_webapp_static.py -q`. Expected: FAIL (`settingsChanges` is not a function).
- [ ] **Step 3: Implement** the Produces block and the page behaviour.
- [ ] **Step 4: Run them.** Expected: PASS. Then run the page under the jsdom harness pattern from phase 4 (`smoke/page_files_load.js` in the scratchpad): the page loads with no console error, and a stubbed dry-run body renders the preview rows.
- [ ] **Step 5: Update `CLAUDE.md`** and the spec status line. **Run the full suite** and compare with the baseline. **Commit:** `feat(webapp): edit a unit's settings by serial: preview, send, read back`.
---
## After the build: final review, then the bench
The bench is not a task: it runs after the whole-branch review and its fixes, with Brian at the units, and **each send needs his explicit go**. Run SFM with `ringkit/sfm_parity.py` (port 8299; never 8200). Order:
1. **Read-only, both units:**
- `GET /device/settings` by serial; Brian matches it against each unit's screen.
- UM20147: `read_schedule` (measure what a unit with no schedule answers, and whether `0x08` shows the scheduler switch).
2. **Dry runs** of a trigger change on each unit. Read the preview with Brian.
3. **One field per unit**, with Brian's go:
- the trigger (UM20147 0.5 → 0.3; BE9441 0.04 → 0.05);
- read back; Brian checks the unit's menu;
- change it back, with another go.
4. **A notes change** on each (go).
5. **A several-field "backup unit" change** on each (go).
6. **Refusals:**
- a dry run while monitoring (expect the refusal);
- UM20147 with a schedule naming another setup, if Brian sets one up in THOR (expect the block).
7. **Alarm level (Series 3):**
- one write with Brian's go, read back and checked on BE9441's menu;
- only then flip `S3_ALARM_WRITE_MEASURED`, in its own commit naming the bench result.
Record everything in the spec's bench section and both protocol references (measured), then the devlog.
File diff suppressed because it is too large. Load diff
@@ -1,403 +0,0 @@
# Phase 5: changing a unit's settings by serial (design)
**Date:** 2026-11-03. **Status:** approved by Brian 2026-11-03; built 2026-11-03
(plan `docs/superpowers/plans/2026-11-03-sfm-phase5-settings.md`); **benched 2026-11-04** on both
series (results at the end). Phase 5 of
`docs/superpowers/specs/2026-10-20-sfm-series4-parity-design.md` (row 10, "change
recording settings"; build phase 5, "setup push: one field first, then several").
**Branch:** `feat/series4-sfm-parity`.
## Intent (Brian, 2026-11-03)
Change **any** of a unit's settings from SFM, and make it as easy and reliable as
possible. The goal is to fix what makes Blastware finicky. Three real cases:
- **One wrong number on a deployed unit.** UM6047 was out monitoring with its
geophone trigger at 0.03 instead of 0.300. Brian remoted into the THOR PC,
stopped it (it called in), changed the setup, made sure it was *sent*, then
restarted monitoring.
- **A typo in the notes.**
- **A backup unit.** The unit set up at the office fails in the field, so a backup
from the truck goes in with blank or stale notes and settings. There is no
computer in the field, so the office re-does the whole setup remotely, by hand,
while the person in the field stands by to press Start or power-cycle if the
link breaks.
What is wrong with THOR, as Brian and his dad experience it:
- The same screen edits a setup on disk and views a unit's setup.
- Setups get saved under random number strings.
- Editing a setup does not change the unit; you verify separately that it was sent.
Saved setups as templates would be acceptable. Not knowing whether you are
changing the unit or a file is not.
## Goals, non-goals, anti-goals
**Goals**
- Edit the unit's **live** settings, both series.
- Show exactly what will change, **old → new**, before anything is sent.
- After sending, **re-read the unit** and show what it now holds.
- Make every refusal say why, in plain words.
**Non-goals (this phase)**
- Templates, saved setups, copying from another unit.
- Restarting monitoring. **Brian presses Start**, as today; SFM never restarts on
its own.
- Setting the unit's clock. That is a later call-home receiver rule.
- **Writing the Micromate scheduler.** Next project, agreed 2026-11-03:
"record during work hours" as a plain, **configurable** setting on the unit's
page, both series, no schedule library and no setup files. On the Micromate,
it relies on the firmware's setup-less scheduler start (found in the firmware,
never sent; one bench session). On the MiniMate, its own timer setting
(undecoded). Brian's dad despises THOR's scheduler; Brian is willing to retire
it in SFM.
- Fields not yet decoded. "Any and all" grows as decoding grows.
**Anti-goals: things that would make it a failure even if it "works"**
- Any doubt about whether the unit changed.
- A screen where a file and a unit look alike, or a name SFM made up.
- Writing a byte SFM did not just read. Every byte SFM does not deliberately change
goes back exactly as read. The one exception is a byte that Blastware's (or
THOR's) own writes always set to a fixed value. Each such byte is named in the
codec with its evidence (so far: Series 3 `[26:28]` → `00 00`; my call, below).
- Sending to a monitoring unit.
- A retry. A write is sent once; what happened is read back.
## Measured basis
**1. Series 4 (Micromate): the `0x1A` setup content map.** Measured from 47
keypad snapshots on UM20147 and checksum-verified. `micromate/setup_block.py`
(`decode_setup`) reads it, with 69 tests on 15 fixtures.
| content | field |
|---|---|
| `[5]` | record mode |
| `[6:8]` | sample rate |
| `[8:10]` | histogram interval |
| `[12:16]` | pre-trigger, f32, negative |
| `[17]` | stop mode |
| `[18:22]` | record time, f32 |
| `[23]` | auto-stop |
| `[25]` | active sensors |
| `[29]` | trigger sources |
| `[30:34]` | distance |
| `[34:38]` | charge |
| `[39]` | report flags |
| `[40:42]` | job number |
| `[42:86]` | setup name |
| `[122+64n]` / `[144+64n]` | notes (label / value) |
| from `[1708]` | 48-byte channel blocks: sensor code `+4:8`, trigger `+30` (geo in/s, mic psi) |
The CRC-16/AUG-CCITT over `[0:2088]` is stored at `[2090:2092]`; THOR's write
omits it and the unit recomputes it.
- **The push sequence (from THOR's captures)** is `0xDA` (name) → `0x68`/`0x73`
(`0x08` preferences) → `0x82`/`0x83` (`0x2E` trigger) → `0x71`/`0x72` (`0x1A`
setup). `micromate.writes.plan_setup_push` reproduces THOR's frames (phase 2).
- **Not yet mapped on Series 4:** alarm level, geophone range, GPS, aux I/O, SLM
options.
**2. Series 3 (MiniMate) uses the same layout. Measured 2026-11-03.** The
compliance image as Blastware writes it is logical (unescaped), 2,092 bytes, with
`N = 2090` at `[0:2]` and the channel block "Tran" at `[1708]`.
`micromate.setup_block.decode_setup` reads it correctly:
- **BE9441's 10-26 write** (`tests/fixtures/minimate-bench-10-26-26-histogram`,
two whole sends): name, mode, 4096 sps, interval, record time 20 s, trigger
0.04 in/s, mic linear, job number and the notes all decode. Only the CRC fails
(Series 3's tail goes out stale).
- **BE11529's nine 2026-04-20 Blastware writes** (`bridges/captures/4-20-26/`,
every one with a whole image) each changed exactly the expected bytes:
| Blastware changed | bytes that moved |
|---|---|
| histogram interval (×4) | `[8:10]` |
| recording mode (×3) | `[5]` |
| geophone range | `1737` / `1785` / `1833`, the range byte at each geophone channel label `+29` |
- **The live `SUB 1A` read starts the same block.** Measured on the first data
frame of each of the four recorded reads (`_settings_replies` in
`tests/test_s3_compliance_anchor_fields.py`): unescaped, each carries `N = 2090`
12 bytes before the old "anchor", and content `[5]` reads 1 / 4 / 3 / 3. That
anchor (`be 80 00 00 00 00`) is content `[12:18]`, pre-trigger −0.25 plus stop
mode Fixed. So Series 3 can be read by content offset rather than by anchor
search, which survives an Auto-stop unit (the open question of 2026-10-17).
- **A whole `1A` read assembles to exactly the 2,090 content bytes** (measured
2026-11-03 on BE9441's 10-26 recording, 12 reads). Unescape each data frame and
take `data[11:]`. Every frame but the last then starts with one `00` byte that is
not content; drop it. This holds for Blastware's read (four 512-byte frames plus
42) and SFM's (two 1024-byte frames plus 42).
- **The round trip is exact.** Blastware re-read the block after each of its two
writes, and each re-read equals the image it had just written, all 2,090 bytes.
- **While monitoring**, the read returns `0e 'BE9441' …` (the device-info block),
as the 10-29 finding says. The unit was monitoring for 5 of the 12 reads.
- **Bytes `[26:28]`: Blastware always writes `00 00`** (all 11 writes), though the
unit reads `01 7f` after a monitoring session (BE9441 10-26, BE11529 4-20 15:19).
The unit sets them again by itself. Meaning unknown.
- **The two bytes after the block are Blastware's own.** Blastware sends a per-unit
constant: `7c ea` on all nine of BE11529's writes, `0c e9` on both of BE9441's.
It is not the block's CRC-16/AUG, and no reply in BE9441's three-hour session
contains it. SFM's `write_image` sends `00 00` there. Since a read never returns
those bytes, the read-back cannot show what the unit did with them.
- **The mode byte is shared, but its codes are not.** Series 3: `00` Single Shot,
`01` Continuous, `03` Histogram, `04` Histogram + Continuous. Series 4: `01`
Waveform, `02` Manual, `03` Histogram, `04` Combo.
- **Rules from the checker's file-side work** (seismo-relay-b6, 2026-11-03; it
measured the same content offsets on 70,042 event files and found nothing that
contradicts one shared map):
- A bitmask byte is patched **bit by bit, never rebuilt**. The trigger-sources
byte `[29]` showed an unidentified `0x80` bit on one unit.
- On Series 3, stop mode (`0` Fixed) and mic type (`2` linear) are proven for
one value each. They are not offered for writing.
- An event file's `[12:16]` is that event's captured pre-trigger, not the
setting. SFM writes only from a live read, so this matters only to anyone
tempted to build a write from a file.
- **Series-3-only fields** (measured on Series 3, not Series 4): the geophone range
byte at channel `+29`; the alarm level at channel `+38` (checker-measured on
event files; live raw `+42`).
**3. Series 3 write frames are measured (#46).** Writes use uniform escaping with
a length field. The compliance image goes in 512-byte addressed chunks. `0x68` is
written as read plus `02 00`, `0x82` plus `00 00`. The sequence is
`68→73 | 71×n→72 | 82→83 | 69→74→72`. `push_config_raw` refuses any block that
is not whole. `tests/test_minimate_write_frames.py` rebuilds Blastware's frames
byte for byte.
**4. Monitoring.**
- **Series 3:** while monitoring, the unit answers `1A` (and `0x2C`) with its
device-info block (measured 10-29 and 11-03).
- **Series 4:** it refuses call-home setup while monitoring ("Feature disabled
while monitoring", measured 11-03).
- **A stop with call-home on makes the unit call in** (measured 10-25, 10-29,
11-03).
**5. Series 4 specifics.**
- `0x1A` reads the keypad's edit buffer live: unsaved keypad edits show in the
read, and a push would commit them.
- Loading a `.MMB` replaces the active config byte for byte. The push writes
under the active setup's name (`0xDA`).
## The flow
1. **Read.** `GET /device/settings?serial=…` (it exists) returns the unit's
settings. The page shows them on the Config tab under **"On the unit BE9441 —
read 14:03"**, never anything that looks like a file.
2. **Edit and preview.** The operator changes fields, then **Preview**: a dry run.
SFM re-reads the unit's blocks on the same line, builds the new blocks, and
returns one row per field: **old → new**, plus any warnings. Nothing is sent.
3. **Send.** The same request, live, is an audited change:
- identity check, audit row, one send, never retried, read back;
- **refused with "stop monitoring first"** if the unit is monitoring, noting
that the stop makes it call in when call-home is on;
- **refused** if the unit's settings changed since the preview. The preview
carries a revision (a hash of the blocks read), and the live call must
match it.
4. **Verify.** Re-read the blocks. Every changed field must read its new value.
Every other decoded field, and every byte SFM did not deliberately change, must
read as before. The page shows **"the unit now holds"**: field, old, new, now.
Known unit-maintained bytes (the Series-4 CRC) are compared as the unit's own
checksum (`crc_ok`), not byte for byte.
5. **Start** stays the operator's button.
## Fields in the first version (Brian approved the list)
| field | Series 3 | Series 4 |
|---|---|---|
| geophone trigger level | yes (channel `+30`) | yes (channel `+30`) |
| alarm level | yes (channel `+38`; measure live) | not mapped, so not offered |
| notes: the four note slots, by the unit's own labels | yes (`Project:`, `Client:`, `User Name:`, `Seis. Loc:` on BE9441) | yes (`Location`, `Client`, `Company`, `General Notes`) |
| recording mode | yes (`[5]`; values as measured on Series 3) | yes (`[5]`; Series-4 codes) |
| sample rate | yes | yes |
| record time | yes | yes |
| histogram interval | yes | yes |
| geophone range | yes (channel `+29`) | not mapped, so not offered |
| job number (+ shown on report) | yes | yes |
A field is offered only where it is measured for that series. Values are refused
unless they are among the measured choices: sample rates 1024/2048/4096,
intervals 2/5/15/60/300/900 s, and each series' measured mode codes.
- **Numbers: the units' own limits (Brian, 2026-11-03: "I want to use the actual
unit limits, not just what we have done in the past").** From Instantel's
operator manuals in `~/seismo-relay/manuals/`:
- **Geophone trigger:** 0.005–10 in/s in steps of 0.001 (MiniMate Plus manual
716U0101 Rev 15, Appendix *Series III Specifications*; Micromate manual
721U0201 Rev 06, *Geophone Trigger Level*). It is also capped at the range's
full scale (10 / 1.25 in/s). When range and trigger change in one request,
check the trigger against the **new** range.
- **Record time:**
- Micromate: 1–90 s (*Record Time*).
- MiniMate: from 1 s to the manual's §4.4 *Maximum Record Times* for a
1 MB unit, four channels, at the chosen sample rate: 104 s at 1024 sps,
52 s at 2048, 26 s at 4096. In Histogram Combo, 13 s (§3.8.9). The units
measured report about 960 KB in total memory (BE11529: 983,026 bytes), the
1 MB model.
- **Job number:** 1–9999 (both manuals).
- **The read-back is the safety net.** A unit that does not take a value (for
instance, cuts a record time to what its memory allows) shows as not taken,
with what it actually holds.
- Values seen across 75,958 Blastware reports (2016–2026) sit well inside these
limits: trigger 0.005–0.500 in/s, record time 1–10 s, job number 1.
- **Units:** refuse a level write unless the channel's unit string reads the
measured one (`in.` for a geophone). A unit set to Metric is unmeasured.
- **Notes:** edited by slot, under the label the unit itself shows (labels can be
renamed and are not identifiers). The value is at most its field width less
one byte, printable ASCII.
- Not in v1: Series 3's fifth slot, `Extended Notes` (value `\n` on BE9441).
Blastware's extended notes are unmeasured and may live elsewhere.
- Not in v1: Series 4's 16-byte field at content `[1064]` (`Loc 1` on
UM12947), undecoded.
## Architecture
- **One setup-block codec for both series.** Keep `micromate/setup_block.py` as
the field map and add `encode_setup(content, changes) -> content`: field patches
only, every other byte as given. It stays a pure codec library: no I/O, no
`sfm` imports, no import cycle with `minimateplus`. Series-specific fields (the
Series-3 range and alarm) are marked by series.
- **Series 3 read.** Assemble the `1A` read into the logical 2,090-byte block:
unescape, strip the 12-byte reply prefix and the inter-frame headers
(`read_compliance_config`). Decode it by content offset.
- **Series 3 write.** The patched logical block plus the tail becomes the
compliance image for `push_config_raw`. Event index (`0x08`), trigger (`0x2E`)
and waveform data (`0x09`) are echoed as read, in Blastware's sequence.
- On `0x09`, Blastware echoed the unit's bytes on all nine April writes
(`[200:202]` = `8c 76` read and written). Only BE9441's 10-26 writes changed
them (`17 17` read, `78 76` written, and read back so). The meaning is
unknown, so SFM echoes.
- **The raw-offset `_encode_compliance_config` is retired.**
- **The legacy write (`/device/config`, `/device/config/project`) is retired (my
call).** It retries a whole write on a TCP error, is not audited, does no
read-back, does not refuse a monitoring unit, and needs no serial: every
anti-goal at once. Its only user is the webapp's by-host Config form, and
Terra-View does not call it. Its routes answer with a pointer to the by-serial
change, and the by-host form becomes read-only.
- **Series 4 write.** `plan_setup_push(prefs, trigger, patched_setup, name)`.
- **No setup files in the operator's view (Brian, 2026-11-03).** "We treat the
Micromate setups just like Minimate setups … the unit just has its settings,
and we change it based on the job. We don't send setups to the unit." A
backup unit is usually on whatever setup its previous job left. So SFM
rewrites the setup the unit is running, in place, under its own name. It
never asks for a file or a name, and never creates one. The name may show as
a read-only detail, since the unit's screen shows it.
- **The scheduler can undo a change (Brian, 2026-11-03, with THOR's Manage
Schedules screen).** Work-hours Micromates run a THOR schedule, e.g. Start
Monitoring 07:00 with setup `Mele-PWSA-Carroll -Loc 4`, stop 18:30, repeat
daily. THOR sends the schedule with its setup, and each scheduled start loads
the setup it names. So the preview and the send read `schedule.dat` (format
decoded, reference *The schedule record format*), read-only. A start action
naming a setup other than the one being changed blocks the send: "this unit's
schedule loads <name> at 07:00, which would replace this change." When the
schedule names the active setup (the usual case after a scheduled start), the
change survives, and the preview says when the next scheduled start is.
SFM never writes the schedule in this phase.
- The name comes from the `0x41` read, unstripped.
- Refuse `factory.MMB` and any target that is not the active setup (spec). The
refusal says it plainly: "this unit is running its factory setup; load any
other setup on its keypad, then try again." Brian says the team does not use
the factory setup, so this should be rare.
- `ENABLEABLE_WRITES` gains `0xDA 0x68 0x73 0x82 0x83 0x71 0x72`.
- The keypad edit buffer: warn in the preview that a unit with someone in its
menu would have those edits committed. The check the spec names, `0x1A`
against the active `.MMB` via `0x94`/`0x48`, is a bench question first.
- **The change path.** It keeps run_change's guarantees: identity, audit, one
send, read back, `ChangeUnconfirmed` with `sent`/`audit_id`. The "state" is a
set of fields, so either `run_change` takes a verify function or a sibling core
shares its parts. The builder decides; the guarantees do not change. The audit
row keeps the per-field changes, both blocks (hex) and the verdict.
- **Routes.** `POST /device/settings/change?serial=…` (serial required) with body
`{changes: {field: value}, revision}` and `dry_run`, `caller`. The response is
per-field `old` / `new` / `now`, through `_change_response`. A dry run needs no
revision and returns one. **A live call without the revision of a preview is
refused** (my call): nothing reaches a unit unless someone saw old → new.
- **Page.** The Config tab by serial becomes the unit's edit form: Preview → Send
(confirm) → "the unit now holds". New logic goes in
`sfm/static/device_routing.js` with Node tests, and glue in
`sfm/static/sfm_webapp.js` (no inline JS).
## Verification
- **Series 3, byte for byte.** For each of the 11 Blastware compliance writes,
apply the new encoder to the read before it (or the previous image), with the
fields Blastware changed. It must reproduce Blastware's content `[0:2090]`. The
two trailing bytes are compared separately, since they are Blastware's constant.
Ten writes change one field. BE9441's 16:26 write changes five things: mode,
sample rate 2048 → 4096, interval, the mic in the sensors byte `[25]`, and
`[26:28]`. That one is tested with all of them, through the codec, though v1's
page does not offer the sensors byte.
The frames rebuild through `push_config_raw`'s path (the #46 tests).
- **Series 3, read side.** The assembly rule above, pinned as a test on the 12
reads of BE9441's 10-26 recording. Each read-back equals the write before it.
- **Series 4.** THOR's setup-push captures still reproduce, with no field changed.
Any capture where THOR changed a field becomes a byte-for-byte test.
- **Bench, with Brian's go per send, per series:**
1. A dry run of a trigger change, then send, read back, check the unit's menu,
and change it back.
2. A notes change.
3. A several-field "backup unit" change.
4. A dry run while monitoring, expecting the refusal.
## Bench 2026-11-04 (results)
Brian at BE9441 and UM20147, each on its own modem; every send with his go.
Notes: `~/bench-logs/2026-11-04-sfm-settings/`.
- **Both series change correctly.** Each change was acknowledged, read back as
sent, and confirmed on the unit's own screen; both units ended byte for byte as
found.
- BE9441: trigger each way, a note, several fields at once, the alarm, a full
restore.
- UM20147: trigger, several fields (two notes, job number and its flag, record
time), a full restore. The unit's recomputed CRC equalled SFM's.
- **Fixed at the bench (`9992b25`):** the first live MiniMate read came back one
byte long. An escaped checksum byte leaves its `0x10` behind (about 1 frame in
85; the recordings never had it). The read now takes exactly the lengths it
asked for, and so does the waveform read (`c790e20`).
- **🔑 The keypad menu wins.** A MiniMate change sent while its setup menu is
open is acknowledged and read back, then lost when the operator presses Cancel
or Save: the menu writes its copy of the whole block back. SFM cannot see this
happen; the MiniMate preview now warns. Rule for the field-plus-office routine:
nobody in the unit's menus while the office sends.
- **The MiniMate alarm write is measured**, so it is now writable (`55c7b7b`).
- **Refused while recording, both series, nothing sent.** A recording MiniMate
sometimes leaves a preview at "no answer" rather than the refusal.
- **The Micromate scheduler switch is in no block SFM reads.** UM20147 carries a
leftover THOR schedule (Fay setup, 07:00 daily) with the switch Off; SFM blocks
it, a false alarm here. The bench used a scratch-only override.
- Next: a THOR bridge recording to find the switch (parked for work hours).
- Meanwhile, worth considering: let the operator confirm "scheduler off" in the
preview.
## Calls I made (Claude), for Brian to check
- **Series 3 `[26:28]` goes out as `00 00`, as Blastware writes it**, rather than
the `01 7f` the unit may read. Measured beats inferred: Blastware's value is on
11 accepted writes, and writing back `01 7f` has never been tried.
- **The two bytes after the Series 3 block stay `00 00`**, as `write_image` sends
them (a unit accepted that in the April 2026 test). Blastware's per-unit
constant cannot be derived from anything SFM reads. The first bench write checks
that the unit takes the block, and its menu shows the change.
- **The `0x09` block is echoed as read**, as Blastware did on all nine April writes.
- **Level writes are refused unless the channel's unit string is the measured
`in.` / `in`** (a unit set to Metric is unmeasured).
- **Notes are edited by slot under the unit's own labels**, four slots on each
series. Series 3 extended notes and Series 4's separate location field wait.
- **The legacy by-host write is retired**; the by-host form becomes read-only.
- **A live send needs a preview's revision.**
- **Preview re-reads the unit** rather than trusting the page's copy, and Send
refuses if the unit changed since the preview.
- **The edit form lives on the Config tab, by serial**, replacing the legacy
read-modify-write form for units reached by serial.
## Left to the builder
- The module layout for the shared codec, within the no-cycle, pure-codec rule.
- `run_change` generalised versus a sibling core.
- The exact revision hash.
- Page layout details.
+107
View File
@@ -60,6 +60,7 @@ from minimateplus.framing import build_bw_frame, SESSION_RESET
from minimateplus.client import (
MiniMateClient,
_decode_compliance_config_into,
_encode_compliance_config,
)
from minimateplus.models import DeviceInfo
@@ -461,6 +462,111 @@ def exp_fewer_polls(host: str, port: int) -> tuple[str, str, dict]:
t.disconnect()
# ══════════════════════════════════════════════════════════════════════════════
# EXP6 — Compliance-only write (71×3→72), skip event index + trigger + waveform
# ══════════════════════════════════════════════════════════════════════════════
#
# Blastware's full write sequence: 68→73 | 71×3→72 | 82→83 | 69→74→72
# We want to know: can we write ONLY the compliance block (71×3→72)?
#
# Test procedure:
# 1. Read current compliance config (SUB 1A)
# 2. Patch the "notes" field to a test marker
# 3. Write ONLY 71×3→72 (skip 68, 73, 82, 83, 69, 74, final 72)
# 4. Read back (SUB 1A) and verify the change was written
# 5. Restore original value
#
# If PASS: we can push individual config fields without touching event index,
# trigger config, or waveform data — huge simplification.
# If FAIL: the device needs the full write sequence (may reject partial write).
#
# SAFETY: We restore original data in a finally block. If the restore write
# fails, the device will have the test marker in "notes" — harmless but visible.
_EXP6_MARKER = "[exp6-test]"
def exp_compliance_only(host: str, port: int) -> tuple[str, str, dict]:
"""Write compliance block alone (71×3→72), verify, and restore."""
client, info = connect_client(host, port)
original_raw: Optional[bytes] = None
try:
proto = client._proto
if proto is None:
return "FAIL", "Could not get protocol handle from client", {}
# 1. Read current compliance
print(" Reading current compliance config (SUB 1A)…")
original_raw = proto.read_compliance_config()
print(f" Got {len(original_raw)} bytes of compliance config")
# Find current notes value for display
info_obj = DeviceInfo()
_decode_compliance_config_into(original_raw, info_obj)
cc = info_obj.compliance_config
orig_notes = cc.notes if cc else "(unknown)"
print(f" Current notes field: {orig_notes!r}")
# 2. Build modified payload with test marker in notes
test_notes = _EXP6_MARKER
modified_raw = _encode_compliance_config(
original_raw,
notes=test_notes,
)
print(f" Encoded modified compliance payload ({len(modified_raw)} bytes)")
print(f" Patching notes: {orig_notes!r} → {test_notes!r}")
# 3. Write ONLY the compliance block: 71×3 → 72
print(" Writing compliance ONLY (71×3→72) — skipping 68/73/82/83/69/74…")
proto.write_compliance_config_raw(modified_raw)
print(" Write complete — device acked 71×3→72")
# 4. Read back and verify
print(" Reading back compliance config to verify…")
readback_raw = proto.read_compliance_config()
readback_info = DeviceInfo()
_decode_compliance_config_into(readback_raw, readback_info)
rb_cc = readback_info.compliance_config
readback_notes = rb_cc.notes if rb_cc else "(decode failed)"
print(f" Read-back notes: {readback_notes!r}")
write_worked = (readback_notes == test_notes)
print(f" Write verified: {write_worked}")
details = {
"original_notes": orig_notes,
"written_notes": test_notes,
"readback_notes": readback_notes,
"write_verified": write_worked,
}
if write_worked:
return "PASS", "Compliance-only write works! No event index or trigger writes needed.", details
else:
return "FAIL", f"Write was not reflected in read-back (got {readback_notes!r})", details
except ProtocolError as exc:
return "FAIL", f"Protocol error: {exc}", {}
finally:
# Restore original compliance data regardless of outcome
if original_raw is not None:
print(" Restoring original compliance config…")
try:
proto2 = client._proto
if proto2:
proto2.write_compliance_config_raw(
_encode_compliance_config(original_raw) # no-op patch = verbatim
)
print(" Restore complete")
else:
print(" WARNING: protocol handle gone — could not restore")
except Exception as exc_r:
print(f" WARNING: restore failed: {exc_r}")
client.close()
# ══════════════════════════════════════════════════════════════════════════════
# Registry + main
# ══════════════════════════════════════════════════════════════════════════════
EXPERIMENTS = {
@@ -469,6 +575,7 @@ EXPERIMENTS = {
"no_5a": ("EXP3", exp_no_5a, "Event record (0C) without bulk waveform (5A)"),
"skip_1e": ("EXP4", exp_skip_1e, "0A/0C with cached key — skip initial 1E"),
"fewer_polls": ("EXP5", exp_fewer_polls, "1 POLL before 5A instead of Blastware's 3"),
"compliance_only": ("EXP6", exp_compliance_only, "Compliance-only write (71×3→72), no other blocks"),
}
+6 -93
View File
@@ -2,8 +2,7 @@
client.py — high-level API for a live Micromate (Series IV).
Owns the transport, turns raw payloads into models. Read-only, like the layer
below it: nothing here writes, erases, or changes monitoring state, and the
protocol's opcode gate (`micromate.opcodes`) enforces that in code.
below it: nothing here writes, erases, or changes monitoring state.
with MicromateClient(TcpTransport("63.45.161.30", 9034)) as mm:
info = mm.connect()
@@ -40,15 +39,8 @@ from typing import Optional
from minimateplus.transport import BaseTransport
from .models import (
MicromateDeviceInfo,
MicromateEventRef,
MicromateRunState,
MicromateSetup,
MicromateState,
)
from .models import MicromateDeviceInfo, MicromateEventRef, MicromateSetup, MicromateState
from .protocol import MicromateProtocol, ProtocolError
from .schedule import SCHEDULE_PATH
from .setup_block import decode_setup
log = logging.getLogger(__name__)
@@ -61,11 +53,6 @@ CONTENT = 11
# two of them disagree with docs/micromate_protocol_reference.md.
_STATE_FLAG = 0 # 0x49: 0x00 idle, 0x02 monitoring
# 0x06 storage range. content[0:4] is the event count: 3/3 against the chain
# walk, and THOR's ReadEventRecordCount agrees. content[4:8] is very likely
# the monitor-log count -- graded a strong candidate, not settled, so not exposed.
_SR_EVENT_COUNT = slice(0, 4)
_MS_FLAG = 1 # 0x1C: monitoring flag — test NON-ZERO
_MS_DAY, _MS_MONTH, _MS_YEAR = 2, 3, slice(4, 6)
_MS_UNKNOWN_6 = 6 # ⚠ sub-second tick (~4020/s, step 4, 64 ms wrap) — NOT the hour
@@ -141,10 +128,7 @@ class MicromateClient:
self._transport.disconnect()
def is_open(self) -> bool:
# `is_connected` is a PROPERTY on BaseTransport. Calling it raised
# TypeError on every real transport; only a test double that defined
# it as a method hid that.
return bool(self._transport.is_connected)
return self._transport.is_connected()
def __enter__(self) -> "MicromateClient":
self.open()
@@ -277,23 +261,6 @@ class MicromateClient:
raw=data,
)
def get_event_count(self) -> int:
"""`SUB 0x06` -- events stored. One read; no chain walk."""
c = _content(self._proto.read_storage_range())
if len(c) < 4:
raise ProtocolError(f"storage range content is {len(c)} B, need at least 4")
return int.from_bytes(c[_SR_EVENT_COUNT], "big")
def read_unsolicited(self) -> bytes:
"""Whatever the unit sent unprompted. **Sends nothing.**
One transport read. Bytes between commands are noise to the protocol
(every request resets the parser), so reading them here takes nothing
the protocol needs. A session calls this while idle to notice
RADIO RING without waiting for its next keep-alive.
"""
return self._transport.read(4096)
@staticmethod
def _parse_clock(c: bytes) -> Optional[datetime.datetime]:
"""The unit's own clock, in its own local time.
@@ -334,28 +301,6 @@ class MicromateClient:
"""`SUB 0x41` — the loaded `.MMB` file name, e.g. `TEST1.mmb`."""
return _cstring(_content(self._proto.read_active_setup_name()))
def get_active_setup_raw(self) -> str:
"""The `0x41` name exactly as stored, up to its NUL -- NOT stripped, so a
setup push writes back the very name the unit holds."""
return _content(self._proto.read_active_setup_name()).split(b"\x00")[0].decode("ascii", "replace")
def get_prefs_content(self) -> bytes:
"""`SUB 0x08` -- the preferences block's content (a setup push sends it back)."""
return _content(self._proto.read_event_index())
def get_trigger_content(self) -> bytes:
"""`SUB 0x2E` -- the trigger block's content (a setup push sends it back)."""
return _content(self._proto.read_trigger_config())
def get_setup_content(self) -> bytes:
"""`SUB 0x1A` -- the setup block's content, undecoded (2,092 B, CRC last).
⚠ The keypad's edit buffer: unsaved menu edits come back too."""
return _content(self._proto.read_compliance_config())
def read_schedule(self) -> bytes:
"""`schedule.dat`, read-only (`micromate.schedule.parse_schedule` reads it)."""
return self._proto.read_file(SCHEDULE_PATH)
def get_setup(self, *, verify: bool = True) -> MicromateSetup:
"""`SUB 0x1A` — what the unit is set to, decoded. One read.
@@ -394,37 +339,16 @@ class MicromateClient:
# ── Events ────────────────────────────────────────────────────────────────
def serial(self, *, refresh: bool = False) -> str:
def serial(self) -> str:
"""The unit's serial, cached from `connect()` or read on demand.
Needed by anything that handles an event, because an event key is
ambiguous without it — see `MicromateEventRef`.
`refresh=True` forces a fresh `0x15` read. A change operation passes it
right before writing, so the identity check never runs against a serial
cached from an earlier call-up (a modem may have moved to another unit).
"""
if refresh or self._serial is None:
if self._serial is None:
self._serial = _cstring(_content(self._proto.read_serial()))
return self._serial
# Anything else reads unknown(0x..): the safe default, which the change path refuses.
_RUN_STATES = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"}
def get_call_home_content(self) -> bytes:
"""The `0x2C` call-home block's 126-byte content (bit 0 of [5] is the
enable, [6:46] the dial string; [118:120] is unit-maintained)."""
return _content(self.protocol.read_call_home_config())
def read_run_state(self) -> MicromateRunState:
"""`SUB 0x49` -> the unit's run state, with the in-call-home value kept
(connect()'s `monitoring` bool flattens 0x03 into True)."""
c = _content(self._proto.read_state())
if not c:
raise ProtocolError("0x49 state reply has no content")
code = c[_STATE_FLAG]
return MicromateRunState(code, self._RUN_STATES.get(code, f"unknown(0x{code:02X})"))
def list_events(self, *, with_records: bool = True) -> list[MicromateEventRef]:
"""Walk the event chain. `0x93 → 1E`, then `0x93 → 1F` until the sentinel.
@@ -601,17 +525,6 @@ class MicromateClient:
Histograms are not verified: `samples` is empty for them.
"""
return self.fetch_event(ref, verify=verify, tolerance=tolerance,
chunk_size=chunk_size)[1]
def fetch_event(self, ref: MicromateEventRef, *, verify: bool = True,
tolerance: float = 0.01, chunk_size: Optional[int] = None):
"""`get_event()`, returning the raw bytes too: `(blob, result)`.
For a caller that stores the file AND wants the self-check: the bytes go
to the waveform store unchanged, and a DecodeMismatch stops them being
stored at all.
"""
if not ref.record_type:
raise ValueError(
f"event {ref.key_hex}: record_type is unknown, so the codec "
@@ -642,7 +555,7 @@ class MicromateClient:
)
if err is not None:
log.debug("event %s: PVS agrees to %+.4f%%", ref.uid, 100 * err)
return blob, result
return result
@staticmethod
def decode_error(ref: MicromateEventRef, result) -> Optional[float]:
+4 -30
View File
@@ -126,14 +126,12 @@ def checksum(payload: bytes) -> int:
# ── Request builder ───────────────────────────────────────────────────────────
def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: bytes = b"") -> bytes:
def build_request(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes:
"""Build a host→unit command frame.
⚠ Do **not** substitute `minimateplus.framing.build_bw_frame()` here, even
though the payload layout is identical. That builder escaped only `0x10`,
so it reproduced just **161 of Thor's 218** captured read frames. (Since
2026-10-26 it escapes the same four values -- a MiniMate wants them too -- but
the Micromate framing differs in other ways; keep the two builders apart.) The 57 it
though the payload layout is identical. That builder escapes only `0x10`,
so it reproduces just **161 of Thor's 218** captured read frames. The 57 it
gets wrong are not edge cases:
* every `SUB 0x5A` bulk download — `offset = 0x0400` puts a literal
@@ -152,9 +150,6 @@ def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: by
Thor asks for `0xFFFF` and gets the whole block — so this is
usually `0xFFFF`, not Series III's probe-then-data pair.
params: exactly 10 bytes at payload[6:16].
data: the write section after params (empty for every read and for
write confirms). Escaped and checksummed exactly like the rest
of the payload -- reproduces all 33 data-carrying THOR frames.
A `0x10` inside `params` is fine and needs no special handling: Thor sends
`SUB 0x5A` with `params = 00 00 10 00 …` and the wire carries `10 10`.
@@ -167,32 +162,11 @@ def build_request(sub: int, offset: int = 0, params: bytes = bytes(10), data: by
if not 0 <= sub <= 0xFF:
raise ValueError(f"sub must be a single byte, got {sub:#x}")
payload = (bytes([MM_CMD, 0x00, sub, 0x00, (offset >> 8) & 0xFF, offset & 0xFF])
+ params + bytes(data))
payload = bytes([MM_CMD, 0x00, sub, 0x00, (offset >> 8) & 0xFF, offset & 0xFF]) + params
body = payload + bytes([checksum(payload)])
return bytes([ACK, STX]) + stuff(body) + bytes([ETX])
def request_sub(frame: bytes) -> int:
"""The SUB of a built host->unit frame (`41 02 <stuffed body> 03`).
Used by the protocol's send-side opcode gate, which must see exactly what is
about to go on the wire rather than trust the caller's word for it.
"""
if len(frame) < 5 or frame[0] != ACK or frame[1] != STX or frame[-1] != ETX:
raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}")
body = unstuff(frame[2:-1])
if len(body) < 17 or body[0] != MM_CMD:
raise ValueError(f"not a host->unit request frame: {bytes(frame[:8]).hex()}")
# Canonical form only: what this check reads must be exactly what the unit
# parses. An unescaped 02/03/04, a `10 XX` outside {02,03,04,10} or a
# trailing lone DLE would be read one way here and another by the unit.
if stuff(body) != frame[2:-1]:
raise ValueError(
f"not a canonical request frame (stuffing differs): {bytes(frame[:8]).hex()}")
return body[2]
# ── Response frame ────────────────────────────────────────────────────────────
@dataclass
-8
View File
@@ -155,14 +155,6 @@ class IdfReport:
)
@dataclass(frozen=True)
class MicromateRunState:
"""`SUB 0x49` content[0]. 0x00 idle, 0x02 monitoring, 0x03 calling home
(ten of ten in the 10-14 ACH session); anything else is named, not guessed."""
code: int
name: str
# ── IdfPeaks / IdfProjectInfo / IdfSensorCheck (narrow grouping types) ───────
-117
View File
@@ -1,117 +0,0 @@
"""Micromate (Series IV) opcode table: which SUBs write, and which collide.
One place, as the parity spec requires. The gate is an ALLOWLIST: a SUB is
transmitted only if it is a catalogued read (READ_SUBS) or a catalogued write
that arrives through `MicromateProtocol.execute` (one call's permission, capped at
ENABLEABLE_WRITES; the connection itself holds none). An unknown SUB is refused -- clock-set
and delete-all have Series-IV opcodes nobody has catalogued yet, and "unknown
means read" is the wrong default. `MicromateProtocol._send` consults it
on every outgoing frame, so a write cannot reach a unit by a path nobody
thought about -- a scratch tool calling `protocol._send`, a hand-built frame, a
method added later.
Every SUB here was seen as a host->unit request in THOR's captures
(`docs/micromate_protocol_reference.md`). The table classifies REQUESTS: a few
of these values are also ACK SUBs of other commands (0x71 acks 0x8E, 0x72 acks
0x8D), which is irrelevant to a send-side check.
"""
from __future__ import annotations
from types import MappingProxyType
from typing import Dict, FrozenSet, Mapping
_WRITE_SUBS: Dict[int, str] = {
0x47: "scheduler enable/disable",
0x68: "setup push: preferences block (0x08)",
0x71: "setup push: setup block (0x1A)",
0x72: "setup push: setup confirm",
0x73: "setup push: preferences confirm",
0x7E: "call-home config write (0x2C)",
0x7F: "call-home config confirm",
0x82: "setup push: trigger block (0x2E)",
0x83: "setup push: trigger confirm",
0x8D: "file open for write",
0x8E: "file body write",
0x96: "start monitoring",
0x97: "stop monitoring",
0xA2: "end call-home",
0xA8: "delete one event",
0xAA: "delete-event confirm",
0xDA: "setup push: file name",
}
# Same SUB, opposite consequence on the other series (not the same bytes:
# Series III's CONFIRM ERASE carries offset 0x0000 and token 0xFE, THOR's 0xA2
# carries offset 0xFFFF). Never transmitted on
# Series IV, allowed or not: if a Series-III unit is at the address (a moved
# modem, a stale IP), it would execute the other meaning. Lifting an entry is
# a spec change, not a parameter.
_CROSS_SERIES_COLLISIONS: Dict[int, str] = {
0xA2: "CONFIRM ERASE on Series III -- erases every stored event; "
"'end call-home' on Series IV",
}
_READ_SUBS: Dict[int, str] = {
0x01: "device info",
0x06: "storage range",
0x08: "event index / preferences block",
0x0A: "monitor log",
0x0C: "event record",
0x15: "serial number",
0x1A: "setup block",
0x1C: "monitor status",
0x1E: "event first",
0x1F: "event next",
0x2C: "call-home config",
0x2E: "trigger config",
0x3F: "setup list first",
0x40: "setup list next",
0x41: "active setup",
0x48: "file read next page",
0x49: "state",
0x5A: "bulk download",
0x5B: "poll",
0x93: "arm event",
0x94: "file open for read",
}
# Read-only views: a stray .pop() anywhere in the process cannot disable a gate.
WRITE_SUBS: Mapping[int, str] = MappingProxyType(_WRITE_SUBS)
CROSS_SERIES_COLLISIONS: Mapping[int, str] = MappingProxyType(_CROSS_SERIES_COLLISIONS)
READ_SUBS: Mapping[int, str] = MappingProxyType(_READ_SUBS)
# The write SUBs any code may transmit at all -- through MicromateProtocol.execute,
# one call at a time. Raising this is a spec change, reviewed like one: delete
# (0xA8/0xAA), raw file writes (0x8D/0x8E -- they could reach the modem
# settings) and 0xA2 never belong here without one. Phase 4 (2026-11-02) added
# the call-home write and its confirm (spec row 9: enable/disable only).
# Phase 5 (2026-11-03) added the setup push -- name, preferences, trigger and setup
# blocks with their confirms -- for changing a unit's settings by serial (spec row 10).
ENABLEABLE_WRITES = frozenset({0x96, 0x97, 0x7E, 0x7F,
0xDA, 0x68, 0x73, 0x82, 0x83, 0x71, 0x72}) # + the setup push (phase 5)
class OpcodeRefused(RuntimeError):
"""A frame was stopped before it reached the wire."""
def check_transmit(sub: int, allowed_writes: FrozenSet[int] = frozenset()) -> None:
"""Raise OpcodeRefused unless `sub` may go on the wire.
Precedence: (1) a cross-series collision is refused always; (2) a
SUB in neither READ_SUBS nor WRITE_SUBS is unknown and refused whatever
`allowed_writes` says; (3) a catalogued write is refused unless in
`allowed_writes`.
"""
if sub in CROSS_SERIES_COLLISIONS:
raise OpcodeRefused(
f"refused to transmit SUB 0x{sub:02X}: {CROSS_SERIES_COLLISIONS[sub]}")
if sub not in READ_SUBS and sub not in WRITE_SUBS:
raise OpcodeRefused(
f"refused to transmit SUB 0x{sub:02X}: unknown opcode -- not in "
"micromate.opcodes; catalogue it first (allowing it does not help)")
if sub in WRITE_SUBS and sub not in allowed_writes:
raise OpcodeRefused(
f"refused to transmit SUB 0x{sub:02X} ({WRITE_SUBS[sub]}): writes are "
"not enabled on this connection")
+22 -123
View File
@@ -4,24 +4,13 @@ protocol.py — one method per Micromate (Series IV) wire command.
Returns raw payload bytes. Interpretation belongs in ``client.py``; this layer
knows frames, offsets and sequencing, and nothing about what a field means.
Scope: **reads, plus start/stop monitoring through `execute()` only --
enforced** (in this package: the Series-3 `minimateplus` stack and raw-socket
bench bridges are outside the gate). Every outgoing frame passes
`micromate.opcodes.check_transmit()` in `_send`: a write opcode is refused
unless it arrives through `execute()` (the connection itself holds no write
permission), `execute()` can permit only SUBs under `ENABLEABLE_WRITES`
(`0x96` / `0x97`), and `0xA2` -- CONFIRM ERASE on Series III -- is refused
always. The one caller of `execute()` is SFM's change path,
`sfm/device_access/s4.py` (a test pins that). The gate is an allowlist: a SUB
not catalogued in `opcodes` (read or write) is refused as unknown. No command
has ever been originated against a unit by this project; every write in ``docs/micromate_protocol_reference.md`` was performed
by THOR while we recorded. The first thing this codebase ever sends to a
customer's instrument should be a decision someone made on purpose, not a side
effect of a client that grew a method. Write frames are *built* in
``micromate.writes`` as reviewable plans; building one sends nothing.
``execute(plan)`` is the only write path: one call's permission, at most
``ENABLEABLE_WRITES``, and only on a connection that has had Micromate-flagged
replies.
Scope: **reads only.** Nothing here writes, erases, or changes monitoring
state. That is deliberate and worth keeping — no command has ever been
originated against a unit by this project; every write in
``docs/micromate_protocol_reference.md`` was performed by THOR while we
recorded. The first thing this codebase ever sends to a customer's instrument
should be a decision someone made on purpose, not a side effect of a client
that grew a method.
Every offset and params layout below was read off THOR's own frames in
``bridges/captures/9-24-26 - micromate2/`` rather than taken from the spec
@@ -50,18 +39,11 @@ import logging
import math
import struct
import time
from typing import TYPE_CHECKING, Optional
from typing import Optional
from minimateplus.transport import BaseTransport
from .framing import (
FLAGS_BLASTWARE, FLAGS_THOR, MicromateFrame, MicromateFrameParser,
build_request, request_sub,
)
from .opcodes import ENABLEABLE_WRITES, OpcodeRefused, check_transmit
if TYPE_CHECKING:
from .writes import WritePlan
from .framing import MicromateFrame, MicromateFrameParser, build_request
log = logging.getLogger(__name__)
@@ -93,8 +75,6 @@ SUB_STATE = 0x49
SUB_BULK_DOWNLOAD = 0x5A
SUB_POLL = 0x5B
SUB_ARM_EVENT = 0x93
SUB_FILE_READ_NEXT = 0x48 # file transfer: next page of the file opened by 0x94
SUB_FILE_OPEN_READ = 0x94 # file transfer: open a file by path, for reading
# ⚠ Reads are SINGLE-STEP. Series III probes at offset 0 to learn the length,
# then reads again at that length; a Micromate returns the whole block when
@@ -104,10 +84,6 @@ READ_ALL = 0xFFFF
# The two commands that do NOT use READ_ALL, and the data length each returned
# on UM12947 (firmware 11.0CB).
_FILE_OPEN_PARAMS = bytes([0, 0, 0, 1, 0, 0, 0, 0, 0, 0])
_FILE_FIRST_PAGE_PARAMS = bytes([0, 0, 0, 0, 0, 0, 0, 1, 0, 0])
_MAX_FILE_PAGES = 64
_OFFSETS = {
SUB_POLL: 0x0030, # 59 B — the one offset THOR treats as a constant
SUB_SERIAL: 0x000A, # 21 B
@@ -237,9 +213,8 @@ def chunk_params(key4: bytes, byte_offset: int) -> bytes:
⚠ This is the **Series III 64 KB page-boundary bug in a new guise** — there,
`parse_strt_end_offset()` discards the key's page byte and the `5A` walk
crashed once a unit's buffer crossed 64 KB (fixed 2026-10-26: a Blastware
recording showed its 5A address is a plain 32-bit linear one, like this).
The lesson that transfers: an address field whose high bytes are zero
crashes once a unit's buffer crosses 64 KB, which is *still open* on that
side. The lesson that transfers: an address field whose high bytes are zero
in every capture is not a narrow field, it is an untested one.
"""
if byte_offset == 0:
@@ -289,7 +264,6 @@ class MicromateProtocol:
self._strict = strict_checksums
self._parser = MicromateFrameParser()
self._pending: list[MicromateFrame] = []
self.last_flags: Optional[int] = None
# ── Identity and state ────────────────────────────────────────────────────
@@ -315,19 +289,10 @@ class MicromateProtocol:
return self._read(SUB_DEVICE_INFO)
def read_state(self) -> bytes:
"""`0x49` → `0xB6`. A cheap state check; 16 B of data.
"""`0x49` → `0xB6`. A cheap monitoring check; 16 B.
`data[11]` (content[0]) is the run state. Measured: `0x00` idle,
`0x02` monitoring (every monitoring sample so far), and `0x03` while
calling home (ten reads of ten in the captured 2026-10-14 ACH
session). No other value has been seen.
`MicromateClient.read_run_state` matches those three exactly and names
anything else `unknown(0x..)`, which the change path refuses;
`connect()`'s `monitoring` tests non-zero, so `0x03` reads True there.
⚠ `0x0E` and `0x0C` (both read while monitoring, so "test for
non-zero") belong to `SUB 0x1C` `data[12]`, a separate field -- not to
this byte. See the reference's `0x49` and `0x1C` sections.
⚠ Test `data[11]` for **non-zero**, never against a constant — it has
read both `0x0E` and `0x0C` while monitoring.
"""
return self._read(SUB_STATE)
@@ -382,31 +347,6 @@ class MicromateProtocol:
"""
return self._read(SUB_SETUP_NEXT)
# ── Files, by path (read-only) ────────────────────────────────────────────
def read_file(self, path: str) -> bytes:
"""A file off the unit, by full path: `0x94` + the path opens it, then
`0x48` pages follow until an all-zero reply. The first `0x48` reply is a
descriptor, not file content. Frames are THOR's exactly (UM12947 reading
`schedule.dat`, 2026-09-24): `0x94` carries `params[3] = 1` and the path,
unpadded, as data with offset = its length; the first `0x48` carries
`params[7] = 1`, the rest none. Returns the content (each page's data
after its 11-byte prefix), joined.
"""
raw = path.encode("ascii")
self._request(build_request(SUB_FILE_OPEN_READ, len(raw), _FILE_OPEN_PARAMS, raw),
0xFF - SUB_FILE_OPEN_READ)
body = bytearray()
for page in range(_MAX_FILE_PAGES):
f = self._exchange(SUB_FILE_READ_NEXT,
params=_FILE_FIRST_PAGE_PARAMS if page == 0 else bytes(10))
if page == 0:
continue # the descriptor
if not any(f.data):
return bytes(body)
body += f.data[11:]
raise ProtocolError(f"{path}: no end of file after {_MAX_FILE_PAGES} pages")
# ── Event chain ───────────────────────────────────────────────────────────
def arm_event(self) -> MicromateFrame:
@@ -557,58 +497,18 @@ class MicromateProtocol:
) -> MicromateFrame:
if offset is None:
offset = _OFFSETS.get(sub, READ_ALL)
# `_request` starts every exchange clean (drops any half-frame and any
# stashed frame): this is a strict request/response protocol, so anything
# already buffered when we send is stale.
return self._request(build_request(sub, offset, params), 0xFF - sub,
timeout=timeout)
def _request(self, frame: bytes, expected_sub: int, *, timeout: Optional[float] = None,
permit: frozenset = frozenset()) -> MicromateFrame:
"""Clean slate, send one frame, receive its reply. The one sequence
every exchange -- read or execute -- goes through."""
# Start every exchange clean: drop any half-frame and any frame left
# stashed by the last one. This is a strict request/response protocol,
# so anything already buffered when we send is by definition stale, and
# `expected_sub` would reject it anyway — better to discard it here than
# to raise a confusing UnexpectedResponse one command later.
self._parser.reset()
self._pending.clear()
self._send(frame, permit=permit)
return self._recv_one(expected_sub=expected_sub, timeout=timeout,
self._send(build_request(sub, offset, params))
return self._recv_one(expected_sub=0xFF - sub, timeout=timeout,
reset_parser=False)
def execute(self, plan: "WritePlan") -> list[MicromateFrame]:
"""Transmit a `micromate.writes.WritePlan` -- the only write path.
Permission is granted for this call alone, one step at a time, and only
for SUBs under `ENABLEABLE_WRITES`. Refuses unless the last reply on
this connection carried Micromate flags (0xC5 / 0x03). Each step's ack
is awaited before the next is sent. Never retries: a timeout raises,
and what happened is the caller's to find out by reading the unit back.
"""
# Deferred: writes -> setup_block -> protocol would be circular at import.
from .writes import WritePlan
if not isinstance(plan, WritePlan):
raise TypeError(f"execute takes a WritePlan, got {type(plan).__name__}")
beyond = {st.sub for st in plan.steps} - ENABLEABLE_WRITES
if beyond:
raise OpcodeRefused(
"plan holds SUB(s) above the write ceiling: "
+ ", ".join(f"0x{s:02X}" for s in sorted(beyond)))
if self.last_flags not in (FLAGS_BLASTWARE, FLAGS_THOR):
raise OpcodeRefused(
"no Micromate-flagged reply seen on this connection -- "
"refusing to write")
acks = []
for step in plan.steps:
acks.append(self._request(step.frame, step.ack_sub,
permit=frozenset({step.sub})))
return acks
def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None:
# The gate sees the bytes about to go out, not the caller's intent.
# `permit` is passed only via _request, from execute(), for one step.
frame = bytes(frame)
# Trust means the most recent request got a validated Micromate reply.
self.last_flags = None
# The ceiling is enforced here, where frames leave, whatever was permitted.
check_transmit(request_sub(frame), permit & ENABLEABLE_WRITES)
def _send(self, frame: bytes) -> None:
log.debug("TX %d bytes: %s", len(frame), frame.hex())
self._transport.write(frame)
@@ -662,5 +562,4 @@ class MicromateProtocol:
raise UnexpectedResponse(
f"expected SUB 0x{expected_sub:02X}, got 0x{frame.sub:02X}"
)
self.last_flags = frame.flags
return frame
-75
View File
@@ -1,75 +0,0 @@
"""schedule.py -- a Micromate's schedule file, parsed. Pure; read-only by design.
THOR's scheduler lives in a file on the unit, `\\system\\schedule\\schedule.dat`,
read by path (`MicromateProtocol.read_file`). The format is decoded in
docs/micromate_protocol_reference.md, *The schedule record format* (measured on
UM12947, 2026-09-24/25): 260-byte records,
[0] record 0 only: 3 = repeat on, 2 = repeat off
[4] half-hour slot, 0-47
[5] day (3 in every record seen -- undetermined)
[6] action bitmask: 2 start monitoring with setup, 4 stop, 8 self-check,
16 auto call home
[7] setup-name length
[8:260] setup name (empty for actions that take none)
Why SFM reads it (phase 5): each scheduled start LOADS the setup it names. A
settings change to any other setup would be replaced at the next start, so SFM
refuses that change -- `schedule_conflicts`. SFM never writes the schedule.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import List, Tuple
SCHEDULE_PATH = "\\system\\schedule\\schedule.dat"
_RECORD = 260
_NAME_MAX = _RECORD - 8
_ACTIONS = ((0x02, "start_with_setup"), (0x04, "stop"), (0x08, "self_check"), (0x10, "call_home"))
_KNOWN_BITS = sum(bit for bit, _ in _ACTIONS)
@dataclass(frozen=True)
class ScheduleEntry:
index: int
time: str # "HH:MM", from the half-hour slot
day: int # the raw byte; undetermined
action_bits: int
actions: Tuple[str, ...] # named bits; any other set bit as "unknown(0xNN)"
setup: str # "" when the action takes no setup
def _actions(bits: int) -> Tuple[str, ...]:
named = tuple(name for bit, name in _ACTIONS if bits & bit)
unknown = tuple(f"unknown(0x{1 << i:02x})" for i in range(8)
if bits & (1 << i) and not (1 << i) & _KNOWN_BITS)
return named + unknown
def parse_schedule(body: bytes) -> List[ScheduleEntry]:
"""The entries in a schedule file body. A record with nothing in [4:8] and
no name ends the list (the file is padded with zeros)."""
out: List[ScheduleEntry] = []
for i in range(len(body) // _RECORD):
r = body[i * _RECORD:(i + 1) * _RECORD]
n = min(r[7], _NAME_MAX)
name = r[8:8 + n].decode("ascii", "replace") if n else ""
if not any(r[4:8]) and not name:
break
slot = r[4]
out.append(ScheduleEntry(index=i, time=f"{slot // 2:02d}:{(slot % 2) * 30:02d}", day=r[5],
action_bits=r[6], actions=_actions(r[6]), setup=name))
return out
def _same_setup(a: str, b: str) -> bool:
return a.strip().casefold() == b.strip().casefold()
def schedule_conflicts(entries: List[ScheduleEntry], active_setup: str) -> List[ScheduleEntry]:
"""The scheduled starts that would load a setup other than `active_setup`
(compared ignoring case and surrounding spaces: THOR and the keypad disagree
on case, e.g. `factory.MMB` / `test2.mmb`)."""
return [e for e in entries
if "start_with_setup" in e.actions and e.setup and not _same_setup(e.setup, active_setup)]
-14
View File
@@ -88,20 +88,6 @@ def crc_ok(content: bytes) -> bool:
return _crc16_aug_ccitt(content[: n - 2]) == int.from_bytes(content[n : n + 2], "big")
def with_crc(content: bytes) -> bytes:
"""`content` with its trailing checksum recomputed: CRC-16/AUG-CCITT over
``[0:N-2]``, stored big-endian at ``[N:N+2]`` (the rule `crc_ok` checks).
THOR's write omits the checksum and the unit computes its own; this keeps a
patched block self-consistent so a plan's integrity check still means
something."""
n = int.from_bytes(content[0:2], "big")
if n < 2 or len(content) < n + 2:
raise ValueError(f"block header says {n} but the block is {len(content)} B")
out = bytearray(content)
out[n : n + 2] = _crc16_aug_ccitt(content[: n - 2]).to_bytes(2, "big")
return bytes(out)
def _f32(c: bytes, offset: int) -> float:
return struct.unpack_from(">f", c, offset)[0]
-439
View File
@@ -1,439 +0,0 @@
"""setup_fields.py -- the settings an operator can change, for both series (phase 5).
Pure byte interpretation: no I/O, no device, no `sfm` and no `minimateplus`
imports. Every offset is into the settings block's CONTENT:
* Series 4: the `0x1A` content, 2,092 bytes (N = 2090, then its CRC).
* Series 3: the 1A read assembled by `minimateplus.protocol.
assemble_compliance_content`, 2,090 bytes (N = 2090, no CRC in the read).
**One layout.** Measured 2026-11-03: Blastware's MiniMate compliance image IS
Series IV's `0x1A` content layout (`decode_setup` reads it), and each of
BE11529's nine 2026-04-20 Blastware writes moved exactly the bytes of the field
it changed. Series 4's offsets are from the 47-snapshot keypad pass on UM20147
(2026-10-17/19). Fields measured on one series only are offered on that series
only.
**Limits are the units' own, from Instantel's manuals** (Brian, 2026-11-03: "I
want to use the actual unit limits, not just what we have done in the past"):
* geophone trigger 0.005-10 in/s in steps of 0.001 -- MiniMate Plus manual
716U0101 Rev 15, Appendix *Series III Specifications*; Micromate manual
721U0201 Rev 06, *Geophone Trigger Level* -- and at most the range's full
scale;
* record time: Micromate 1-90 s (*Record Time*); MiniMate up to §4.4's
*Maximum Record Times* for a 1 MB unit, channels 1-4, at the sample rate,
and 13 s in Histogram Combo (§3.8.9);
* job number 1-9999 (both manuals).
What a unit does not take, the read-back shows (`settings_state`).
tests/test_setup_fields.py holds this to Blastware's writes and the keypad
fixtures byte for byte.
"""
from __future__ import annotations
import hashlib
import math
import struct
from typing import Any, Dict, List, Optional, Set
from .setup_block import crc_ok, with_crc
class SettingsValueError(ValueError):
"""A requested change SFM will not make, said plainly. Nothing is sent."""
# ── Layout ──────────────────────────────────────────────────────────────────
_MODE = 5
_SAMPLE_RATE = slice(6, 8) # u16 BE
_HIST_INTERVAL = slice(8, 10) # u16 BE seconds
_RECORD_TIME = 18 # f32 BE seconds
_REPORT_FLAGS = 39 # bit 0x02 = job number on the report (measured both series)
_JOB_SHOWN = 0x02
_JOB_NUMBER = slice(40, 42) # u16 BE
_NOTE_LABEL, _NOTE_VALUE, _NOTE_STRIDE, _NOTES = 122, 144, 64, 4
_NOTE_LABEL_WIDTH, _NOTE_WIDTH = 22, 42
NOTE_MAX = _NOTE_WIDTH - 1 # a NUL always ends the value
_CHANNELS, _CHANNEL_SIZE, _GEOPHONES = 1708, 48, (0, 1, 2)
_CH_RANGE = 29 # u8: 0 Normal (10 in/s), 1 Sensitive (1.25 in/s) -- Series 3, measured
_CH_TRIGGER = 30 # f32 BE, in/s for a geophone
_CH_UNIT = slice(34, 38) # "in." / "in" (the keypad re-renders it); NOT an identifier
_CH_ALARM = 38 # f32 BE -- Series 3; write measured at the bench 2026-11-04
_FULL_SCALE = {0: 10.0, 1: 1.25}
_RANGES = {"normal": 0, "sensitive": 1}
# Blastware writes these bytes as a fixed value on every write on record (11 of 11,
# both units); the unit reads `01 7f` there after a monitoring session. Meaning
# unknown -- SFM writes what Blastware writes. Series 3 only.
S3_BLASTWARE_FIXED = {26: b"\x00\x00"}
# Measured at the bench 2026-11-04 (BE9441, Brian's go): 1.0 -> 1.5 -> 1.0 in/s,
# each acknowledged, read back, and shown in the unit's own setup menu; the write
# moved exactly channel +39 of the three geophones (the f32 at +38).
S3_ALARM_WRITE_MEASURED = True
MODES = {
3: {"single_shot": 0x00, "continuous": 0x01, "histogram": 0x03, "histogram_continuous": 0x04},
4: {"waveform": 0x01, "manual": 0x02, "histogram": 0x03, "combo": 0x04},
}
_MODE_LABELS = {
"single_shot": "Single Shot", "continuous": "Continuous", "histogram": "Histogram",
"histogram_continuous": "Histogram + Continuous", "waveform": "Waveform", "manual": "Manual",
"combo": "Combo",
}
SAMPLE_RATES = (1024, 2048, 4096)
INTERVALS = (2, 5, 15, 60, 300, 900)
TRIGGER_MIN, TRIGGER_MAX, TRIGGER_STEP = 0.005, 10.0, 0.001
RECORD_MIN_S = 1.0
S4_MAX_RECORD_S = 90.0
S3_MAX_RECORD_S = {1024: 104.0, 2048: 52.0, 4096: 26.0}
S3_COMBO_MAX_RECORD_S = 13.0
JOB_MIN, JOB_MAX = 1, 9999
_SERIES_FIELDS = {
3: ("record_mode", "sample_rate", "histogram_interval_s", "record_time_s", "geo_trigger_ips",
"geo_range", "geo_alarm_ips", "job_number", "job_number_shown",
"note_1", "note_2", "note_3", "note_4"),
4: ("record_mode", "sample_rate", "histogram_interval_s", "record_time_s", "geo_trigger_ips",
"job_number", "job_number_shown", "note_1", "note_2", "note_3", "note_4"),
}
_LEVELS = ("geo_trigger_ips", "geo_alarm_ips")
def _ch(k: int) -> int:
return _CHANNELS + _CHANNEL_SIZE * k
def _f32(c: bytes, offset: int) -> float:
return struct.unpack_from(">f", c, offset)[0]
def _shown(v: float) -> float:
"""An f32 as an operator typed it: 0.30000001192 is 0.3."""
return round(v, 6)
def _note_offsets(n: int) -> tuple:
label = _NOTE_LABEL + n * _NOTE_STRIDE
value = _NOTE_VALUE + n * _NOTE_STRIDE
return label, value
def _note_label(c: bytes, n: int) -> str:
start, _ = _note_offsets(n)
raw = c[start:start + _NOTE_LABEL_WIDTH].split(b"\x00")[0]
text = raw.decode("ascii", "replace").strip().rstrip(":").strip()
return text or f"Note {n + 1}"
def _note_value(c: bytes, n: int) -> str:
_, start = _note_offsets(n)
return c[start:start + _NOTE_WIDTH].split(b"\x00")[0].decode("ascii", "replace")
def field_bytes(series: int) -> Dict[str, Set[int]]:
"""Every byte each field may move, by content offset."""
def chans(rel: int, width: int) -> Set[int]:
return {_ch(k) + rel + i for k in _GEOPHONES for i in range(width)}
out = {
"record_mode": {_MODE},
"sample_rate": set(range(6, 8)),
"histogram_interval_s": set(range(8, 10)),
"record_time_s": set(range(_RECORD_TIME, _RECORD_TIME + 4)),
"geo_trigger_ips": chans(_CH_TRIGGER, 4),
"geo_range": chans(_CH_RANGE, 1),
"geo_alarm_ips": chans(_CH_ALARM, 4),
"job_number": set(range(40, 42)),
"job_number_shown": {_REPORT_FLAGS},
}
for n in range(_NOTES):
_, v = _note_offsets(n)
out[f"note_{n + 1}"] = set(range(v, v + _NOTE_WIDTH))
return {f: out[f] for f in _SERIES_FIELDS[series]}
# ── Reading ─────────────────────────────────────────────────────────────────
def _mode_name(c: bytes, series: int) -> str:
code = c[_MODE]
for name, value in MODES[series].items():
if value == code:
return name
return f"unknown(0x{code:02x})"
def _range_code(c: bytes) -> int:
return c[_ch(0) + _CH_RANGE]
def _full_scale(c: bytes, series: int, range_name: Optional[str] = None) -> Optional[float]:
if series == 4:
return _FULL_SCALE[0] # Series 4's range byte is not mapped; 10 in/s is the hardware's
code = _RANGES[range_name] if range_name is not None else _range_code(c)
return _FULL_SCALE.get(code)
def _s3_max_record(rate: int, mode: str) -> Optional[float]:
top = S3_MAX_RECORD_S.get(rate)
if top is None:
return None
return min(top, S3_COMBO_MAX_RECORD_S) if mode == "histogram_continuous" else top
def _unit_string(c: bytes) -> List[str]:
return [c[_ch(k) + _CH_UNIT.start:_ch(k) + _CH_UNIT.stop].replace(b"\x00", b"")
.replace(b".", b"").decode("ascii", "replace") for k in _GEOPHONES]
def editable_fields(content: bytes, series: int) -> List[Dict[str, Any]]:
"""The fields an operator can change, described for a form: field, label,
kind ("number" / "choice" / "text" / "bool"), value, and as relevant unit,
min, max, step, choices [{value, label}], maxlength, readonly."""
c = content
rate = int.from_bytes(c[_SAMPLE_RATE], "big")
mode = _mode_name(c, series)
out: List[Dict[str, Any]] = [
{"field": "record_mode", "label": "Record mode", "kind": "choice", "value": mode,
"choices": [{"value": n, "label": _MODE_LABELS[n]} for n in MODES[series]]},
{"field": "sample_rate", "label": "Sample rate", "kind": "choice", "value": rate, "unit": "sps",
"choices": [{"value": r, "label": f"{r} sps"} for r in SAMPLE_RATES]},
{"field": "histogram_interval_s", "label": "Histogram interval", "kind": "choice",
"value": int.from_bytes(c[_HIST_INTERVAL], "big"),
"choices": [{"value": s, "label": f"{s} s" if s < 60 else f"{s // 60} min"} for s in INTERVALS]},
{"field": "record_time_s", "label": "Record time", "kind": "number", "unit": "s",
"value": _shown(_f32(c, _RECORD_TIME)), "min": RECORD_MIN_S,
"max": S4_MAX_RECORD_S if series == 4 else _s3_max_record(rate, mode)},
{"field": "geo_trigger_ips", "label": "Geophone trigger", "kind": "number", "unit": "in/s",
"value": _shown(_f32(c, _ch(0) + _CH_TRIGGER)), "min": TRIGGER_MIN,
"max": min(TRIGGER_MAX, _full_scale(c, series) or TRIGGER_MAX), "step": TRIGGER_STEP},
]
if series == 3:
code = _range_code(c)
name = next((n for n, v in _RANGES.items() if v == code), f"unknown(0x{code:02x})")
out.append({"field": "geo_range", "label": "Geophone range", "kind": "choice", "value": name,
"choices": [{"value": "normal", "label": "Normal (10 in/s)"},
{"value": "sensitive", "label": "Sensitive (1.25 in/s)"}]})
out.append({"field": "geo_alarm_ips", "label": "Geophone alarm", "kind": "number",
"unit": "in/s", "value": _shown(_f32(c, _ch(0) + _CH_ALARM)),
"min": TRIGGER_MIN, "max": _full_scale(c, 3) or TRIGGER_MAX,
"step": TRIGGER_STEP, "readonly": not S3_ALARM_WRITE_MEASURED})
out.append({"field": "job_number", "label": "Job number", "kind": "number",
"value": int.from_bytes(c[_JOB_NUMBER], "big"), "min": JOB_MIN, "max": JOB_MAX, "step": 1})
out.append({"field": "job_number_shown", "label": "Job number on report", "kind": "bool",
"value": bool(c[_REPORT_FLAGS] & _JOB_SHOWN)})
for n in range(_NOTES):
out.append({"field": f"note_{n + 1}", "label": _note_label(c, n), "kind": "text",
"value": _note_value(c, n), "maxlength": NOTE_MAX})
return out
def field_values(content: bytes, series: int) -> Dict[str, Any]:
return {d["field"]: d["value"] for d in editable_fields(content, series)}
def field_rows(before: bytes, written: bytes, series: int, fields, now: Optional[bytes] = None) -> Dict[str, Dict[str, Any]]:
"""For each changed field: its label, the value the unit had (old), the value
sent (new) and, given a read-back, what the unit now holds (now)."""
a, w = field_values(before, series), field_values(written, series)
n = field_values(now, series) if now is not None else None
labels = {d["field"]: d["label"] for d in editable_fields(written, series)}
out: Dict[str, Dict[str, Any]] = {}
for f in fields:
row: Dict[str, Any] = {"label": labels[f], "old": a[f], "new": w[f]}
if n is not None:
row["now"] = n[f]
out[f] = row
return out
# ── Checking ────────────────────────────────────────────────────────────────
def _number(field: str, v: Any) -> float:
if isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v):
raise SettingsValueError(f"{field} must be a number, not {v!r}")
return float(v)
def _integer(field: str, v: Any) -> int:
if isinstance(v, bool) or not isinstance(v, int):
raise SettingsValueError(f"{field} must be a whole number, not {v!r}")
return v
def check_changes(content: bytes, series: int, changes: Dict[str, Any]) -> Dict[str, Any]:
"""The changes, normalised -- or SettingsValueError naming the first one SFM
will not make, and why. Checks names, types and the units' own limits, then
what depends on this unit's block: its unit strings and its range."""
if series not in _SERIES_FIELDS:
raise SettingsValueError(f"Series {series} has no settings SFM can change")
if not isinstance(changes, dict) or not changes:
raise SettingsValueError("no settings to change")
allowed = _SERIES_FIELDS[series]
out: Dict[str, Any] = {}
for field, v in changes.items():
if field not in allowed:
raise SettingsValueError(f"{field} is not a setting SFM can change on a Series {series} unit")
if field == "record_mode":
if v not in MODES[series]:
raise SettingsValueError(f"record_mode must be one of {', '.join(MODES[series])}, not {v!r}")
out[field] = v
elif field == "sample_rate":
if _integer(field, v) not in SAMPLE_RATES:
raise SettingsValueError(f"sample_rate must be one of {SAMPLE_RATES}, not {v}")
out[field] = v
elif field == "histogram_interval_s":
if _integer(field, v) not in INTERVALS:
raise SettingsValueError(f"histogram_interval_s must be one of {INTERVALS} s, not {v}")
out[field] = v
elif field == "geo_range":
if v not in _RANGES:
raise SettingsValueError(f"geo_range must be normal or sensitive, not {v!r}")
out[field] = v
elif field in ("geo_trigger_ips", "geo_alarm_ips"):
if field == "geo_alarm_ips" and not S3_ALARM_WRITE_MEASURED:
raise SettingsValueError("the alarm level is shown but not changed yet: a MiniMate "
"alarm write has never been measured (the bench measures it)")
x = _number(field, v)
if not TRIGGER_MIN <= x <= TRIGGER_MAX:
raise SettingsValueError(f"{field} must be {TRIGGER_MIN}-{TRIGGER_MAX} in/s, not {x}")
if abs(x - round(x, 3)) > 1e-9:
raise SettingsValueError(f"{field} must be in steps of {TRIGGER_STEP} in/s, not {x}")
out[field] = round(x, 3)
elif field == "record_time_s":
out[field] = _number(field, v)
elif field == "job_number":
if not JOB_MIN <= _integer(field, v) <= JOB_MAX:
raise SettingsValueError(f"job_number must be {JOB_MIN}-{JOB_MAX}, not {v}")
out[field] = v
elif field == "job_number_shown":
if not isinstance(v, bool):
raise SettingsValueError(f"job_number_shown must be true or false, not {v!r}")
out[field] = v
else: # note_1 .. note_4
if not isinstance(v, str):
raise SettingsValueError(f"{field} must be text, not {v!r}")
if any(not 0x20 <= ord(ch) <= 0x7E for ch in v):
raise SettingsValueError(f"{field} must be plain printable ASCII (no accents, tabs or "
"line breaks)")
if len(v) > NOTE_MAX:
raise SettingsValueError(f"{field} is {len(v)} characters; the unit holds {NOTE_MAX}")
out[field] = v
# What depends on this unit's block, with the NEW mode / rate / range if they change
# too -- checked on the block that would RESULT, so a one-field change (the range,
# the rate, the mode) cannot leave a value the unit already holds over its limit
# (final review, 2026-11-03).
c = content
if any(f in out for f in ("record_time_s", "sample_rate", "record_mode")):
t = out.get("record_time_s", _shown(_f32(c, _RECORD_TIME)))
held = "" if "record_time_s" in out else f" (the unit holds {t:g} s; change the record time too)"
if series == 4:
top: Optional[float] = S4_MAX_RECORD_S
else:
rate = out.get("sample_rate", int.from_bytes(c[_SAMPLE_RATE], "big"))
top = _s3_max_record(rate, out.get("record_mode", _mode_name(c, series)))
if top is None:
raise SettingsValueError(f"this unit's sample rate ({rate}) has no record-time limit "
"in the manual -- set the sample rate too")
if not RECORD_MIN_S <= t <= top:
raise SettingsValueError(f"record_time_s must be {RECORD_MIN_S}-{top:g} s here, not {t}{held}")
if any(f in out for f in (*_LEVELS, "geo_range")):
units = _unit_string(c)
if any(u != "in" for u in units):
raise SettingsValueError(f"this unit's geophone channels read {units}, not in/s -- only "
"in/s is measured, so SFM will not change a level or the range")
full = _full_scale(c, series, out.get("geo_range"))
if full is None:
raise SettingsValueError("this unit's geophone range byte is not a value ever measured")
held_levels = {"geo_trigger_ips": _CH_TRIGGER, "geo_alarm_ips": _CH_ALARM}
for f in _LEVELS:
if f not in _SERIES_FIELDS[series]:
continue
v = out.get(f, _shown(_f32(c, _ch(0) + held_levels[f])))
if v > full:
held = "" if f in out else " (the unit holds it)"
raise SettingsValueError(f"{f} {v} in/s is above the range's full scale ({full} in/s){held}")
return out
# ── Writing ─────────────────────────────────────────────────────────────────
def encode_setup(content: bytes, series: int, changes: Dict[str, Any]) -> bytes:
"""`content` with only the changed fields' bytes moved. `changes` should
come from check_changes; this patches, it does not judge. Bit fields are
patched bit by bit. Series 3 also writes Blastware's fixed bytes; Series 4
gets its checksum recomputed."""
out = bytearray(content)
for field, v in changes.items():
if field == "record_mode":
out[_MODE] = MODES[series][v]
elif field == "sample_rate":
out[_SAMPLE_RATE] = int(v).to_bytes(2, "big")
elif field == "histogram_interval_s":
out[_HIST_INTERVAL] = int(v).to_bytes(2, "big")
elif field == "record_time_s":
struct.pack_into(">f", out, _RECORD_TIME, float(v))
elif field == "geo_trigger_ips":
for k in _GEOPHONES:
struct.pack_into(">f", out, _ch(k) + _CH_TRIGGER, float(v))
elif field == "geo_alarm_ips":
for k in _GEOPHONES:
struct.pack_into(">f", out, _ch(k) + _CH_ALARM, float(v))
elif field == "geo_range":
for k in _GEOPHONES:
out[_ch(k) + _CH_RANGE] = _RANGES[v]
elif field == "job_number":
out[_JOB_NUMBER] = int(v).to_bytes(2, "big")
elif field == "job_number_shown":
out[_REPORT_FLAGS] = (out[_REPORT_FLAGS] | _JOB_SHOWN) if v else (out[_REPORT_FLAGS] & ~_JOB_SHOWN)
elif field.startswith("note_") and field[5:].isdigit() and 1 <= int(field[5:]) <= _NOTES:
_, start = _note_offsets(int(field[5:]) - 1)
out[start:start + _NOTE_WIDTH] = v.encode("ascii").ljust(_NOTE_WIDTH, b"\x00")
else:
raise SettingsValueError(f"{field} is not a setting SFM can change")
if series == 3:
for offset, value in S3_BLASTWARE_FIXED.items():
out[offset:offset + len(value)] = value
return bytes(out)
return with_crc(bytes(out))
# ── Reading back ────────────────────────────────────────────────────────────
_COMPARED = 2090
def settings_state(before: bytes, written: bytes, now: bytes, *, series: int) -> str:
"""What a read of the unit says about a change, from the bytes alone:
"as asked" (it holds what was written), "unchanged" (it holds what it had),
or "differs". Floats are never compared -- 0.3 is the same f32 both ways.
Series 4 also needs the unit's own checksum to hold. Series 3 bytes that
differ only in Blastware's fixed bytes count as as asked: nothing the operator
asked for is different."""
a, w, n = before[:_COMPARED], written[:_COMPARED], now[:_COMPARED]
if series == 4 and not crc_ok(now):
return "differs"
if n == w:
return "as asked"
if series == 3:
fixed = {o + i for o, v in S3_BLASTWARE_FIXED.items() for i in range(len(v))}
if len(n) == len(w) and all(n[i] == w[i] for i in range(len(n)) if i not in fixed):
return "as asked"
if n == a:
return "unchanged"
return "differs"
def revision(blocks: List[bytes]) -> str:
"""A short fingerprint of the blocks a preview read; a live change must match it."""
return hashlib.sha256(b"".join(bytes(b) for b in blocks)).hexdigest()[:16]
def changes_bytes(changes: Dict[str, Any]) -> bytes:
"""The normalised changes, canonically: part of a preview's revision, so a live
change must ask for exactly what was previewed (final review, 2026-11-03)."""
import json
return json.dumps(changes, sort_keys=True, separators=(",", ":")).encode("ascii")
-194
View File
@@ -1,194 +0,0 @@
"""Write plans for a Micromate: the exact frames a write would send, in order.
A plan is what a dry run returns. Building one sends nothing; transmitting it
is `MicromateProtocol.execute(plan)` and nothing else: the connection holds no
write permission of its own (see `micromate.opcodes`).
Every input is the unit's OWN read of the block being written (content, i.e.
response data[11:]), and every plan sends back exactly what was read except
the one thing the operation changes. THOR works the same way, and the
reproduction tests hold the plans to THOR's frames byte for byte.
Offsets are THOR's observed constants. 🔶 Each was seen at one block size
only, so a plan refuses a block of any other size rather than guess.
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import FrozenSet, List, Tuple
from .framing import build_request
from .opcodes import CROSS_SERIES_COLLISIONS, WRITE_SUBS, OpcodeRefused
from .setup_block import crc_ok
_CONFIRM = 0xFFFF
_CALL_HOME_OBSERVED = (0x00, 0x01, 0x04, 0x05) # content[5] values units have held
# block content sizes THOR's offsets were observed at (all on UM12947 / 11.0CB)
_PREFS_LEN, _TRIGGER_LEN, _SETUP_LEN, _CALL_HOME_LEN = 90, 28, 2092, 126
_NAME_FIELD = 256
@dataclass(frozen=True)
class WriteStep:
sub: int
offset: int
data: bytes = b""
params: bytes = field(default=bytes(10))
what: str = ""
def __post_init__(self) -> None:
# Freeze the bytes: a caller's bytearray must not change a validated step.
object.__setattr__(self, "data", bytes(self.data))
object.__setattr__(self, "params", bytes(self.params))
if len(self.params) != 10:
raise ValueError(f"params must be 10 bytes, got {len(self.params)}")
if not 0 <= self.offset <= 0xFFFF:
raise ValueError(f"offset 0x{self.offset:X} does not fit a uint16")
if not 0 <= self.sub <= 0xFF:
raise ValueError(f"SUB {self.sub!r} does not fit a byte")
@property
def ack_sub(self) -> int:
return 0xFF - self.sub
@property
def frame(self) -> bytes:
return build_request(self.sub, self.offset, self.params, self.data)
def describe(self) -> dict:
return {"sub": f"0x{self.sub:02X}", "what": self.what,
"offset": f"0x{self.offset:04X}", "data_len": len(self.data),
"expect_ack": f"0x{self.ack_sub:02X}", "frame": self.frame.hex()}
@dataclass(frozen=True)
class WritePlan:
action: str
steps: Tuple[WriteStep, ...]
warnings: Tuple[str, ...] = ()
def __post_init__(self) -> None:
# Copy: a caller's list must not be able to add a step after validation.
object.__setattr__(self, "steps", tuple(self.steps))
object.__setattr__(self, "warnings", tuple(self.warnings))
for s in self.steps:
if not isinstance(s, WriteStep):
raise TypeError(f"a plan holds WriteStep objects, got {type(s).__name__}")
if s.sub in CROSS_SERIES_COLLISIONS:
raise OpcodeRefused(
f"a plan cannot hold SUB 0x{s.sub:02X}: {CROSS_SERIES_COLLISIONS[s.sub]}")
if s.sub not in WRITE_SUBS:
raise ValueError(f"SUB 0x{s.sub:02X} is not a write opcode")
@property
def subs(self) -> FrozenSet[int]:
return frozenset(s.sub for s in self.steps)
def frames(self) -> List[bytes]:
return [s.frame for s in self.steps]
def describe(self) -> dict:
return {"action": self.action, "sends_nothing": True,
"warnings": list(self.warnings),
"steps": [s.describe() for s in self.steps]}
def plan_start_monitoring() -> WritePlan:
return WritePlan("start monitoring", (WriteStep(0x96, _CONFIRM, what="start monitoring"),))
def plan_stop_monitoring() -> WritePlan:
return WritePlan("stop monitoring", (WriteStep(0x97, _CONFIRM, what="stop monitoring"),))
def is_call_home_content(block: bytes) -> bool:
"""Whether 126 bytes are the 0x2C call-home content: its header is its own
length (00 7C, N = 124 -- 00 7C DC on every read on record, UM12947 and
UM20147). A bit is flipped only in a block that carries it."""
return len(block) == _CALL_HOME_LEN and int.from_bytes(block[0:2], "big") == _CALL_HOME_LEN - 2
def plan_call_home_enabled(call_home: bytes, enabled: bool) -> WritePlan:
"""Read `0x2C`, flip bit 0 of content[5], send the rest back byte for byte.
Bit 0 of `[5]` is the enable. 🔶 UM12947 (THOR's unit) read 0x05 enabled /
0x04 disabled, bit 2 set in both; UM20147 reads 0x01 (measured, phase-2 dry
run). So on UM20147 "off" writes 0x00 -- measured at the bench 2026-11-03
(and again 11-04): 0x01 <-> 0x00 acknowledged, read back, and matched in the
unit's own menu. A value outside those four still carries a warning.
`[118:120]` is unit-maintained and THOR echoes it.
"""
if len(call_home) != _CALL_HOME_LEN:
raise ValueError(f"call-home content must be {_CALL_HOME_LEN} B "
f"(the size THOR's offset was seen at), got {len(call_home)}")
if not is_call_home_content(call_home):
raise ValueError(f"call-home content's header is {call_home[0:2].hex()}, not its own length "
f"(00 {_CALL_HOME_LEN - 2:02x}) -- not the call-home block; nothing built")
b5 = (call_home[5] | 0x01) if enabled else (call_home[5] & 0xFE)
data = call_home[:5] + bytes([b5]) + call_home[6:]
what = "call-home " + ("enable" if enabled else "disable")
start = call_home[5]
warnings = []
if start not in _CALL_HOME_OBSERVED or b5 not in _CALL_HOME_OBSERVED:
warnings.append(f"content[5] 0x{start:02X} -> 0x{b5:02X}: no unit has been seen "
"holding this value (0x04/0x05 UM12947 by THOR, 0x00/0x01 UM20147 "
"by SFM); it is unobserved")
if b5 == start:
warnings.append(f"the unit is already call-home {'enabled' if enabled else 'disabled'}"
" -- this write changes nothing")
return WritePlan(what, (
WriteStep(0x7E, 0x007E, data, what="call-home config write"),
WriteStep(0x7F, _CONFIRM, what="call-home config confirm"),
), tuple(warnings))
def _checked(block: bytes, size: int, label: str) -> bytes:
if len(block) != size:
raise ValueError(f"{label} block size {len(block)} B is not the {size} B "
"THOR's offset was observed at -- refusing to guess")
if int.from_bytes(block[0:2], "big") != size - 2:
raise ValueError(f"{label} block's own header says "
f"{int.from_bytes(block[0:2], 'big')}, expected {size - 2} -- "
"not the block it claims to be")
if not crc_ok(block):
raise ValueError(f"{label} block failed its checksum -- refusing to write a "
"corrupt read back to the unit")
return block
def plan_setup_push(prefs: bytes, trigger: bytes, setup: bytes, name: str) -> WritePlan:
"""Rewrite a setup as THOR does: read 0x08, 0x2E, 0x1A, send each back.
No field editing here (phase 5). Each block goes back with its length echo
[0:3] zeroed; the unit recomputes the CRCs, so 0x68 and 0x71 drop the CRC
slot and 0x82 sends it zeroed -- exactly THOR's frames.
⚠ `0x1A` reads the keypad's edit buffer live. A setup read taken while
someone is in the unit's menu includes their unsaved edits, and pushing
this plan would commit them.
The name goes out exactly as given. `MicromateClient.get_active_setup()`
strips whitespace, so a setup name with leading or trailing spaces would
not round-trip through it; phase 5 decides whether to take the unstripped
name from the 0x41 read.
"""
_checked(prefs, _PREFS_LEN, "preferences (0x08)")
_checked(trigger, _TRIGGER_LEN, "trigger (0x2E)")
_checked(setup, _SETUP_LEN, "setup (0x1A)")
try:
raw = name.encode("ascii")
except UnicodeEncodeError:
raise ValueError(f"setup name must be ASCII: {name!r}") from None
if not raw or b"\x00" in raw or len(raw) >= _NAME_FIELD:
raise ValueError(f"setup name must be 1-{_NAME_FIELD - 1} ASCII bytes "
f"with no NUL: {name!r}")
return WritePlan(f"setup push: {name}", (
WriteStep(0xDA, 0x0100, raw.ljust(_NAME_FIELD, b"\x00"), what="setup file name"),
WriteStep(0x68, 0x005A, bytes(3) + prefs[3:88], what="preferences block"),
WriteStep(0x73, _CONFIRM, what="preferences confirm"),
WriteStep(0x82, 0x001C, bytes(3) + trigger[3:26] + bytes(2), what="trigger block"),
WriteStep(0x83, _CONFIRM, what="trigger confirm"),
WriteStep(0x71, 0x082C, bytes(3) + setup[3:2090], what="setup block"),
WriteStep(0x72, _CONFIRM, what="setup confirm"),
))
+85 -90
View File
@@ -104,11 +104,17 @@ M529LIY6 (example event) using raw_s3_20260403_153508.bin capture):
DLE strip rule (applied AFTER slicing):
Strip any 0x10 byte that is immediately followed by 0x02, 0x03, or 0x04.
This undoes the DLE-escape that S3FrameParser preserves as literal pairs.
Applied to frame.data[skip:] + bytes([frame.chk_byte]) together, then
conditionally exclude the trailing chk_byte from the output.
chk_byte absorption (retired 2026-11-06, #58):
The escape 0x10 of a checksum sent as `10 02/03/04` used to stay at the end
of frame.data, and this builder dropped it here. The parser now drops it,
so a 0x10 ending frame.data is real data (one A5 chunk in ten ends in one).
chk_byte absorption:
When frame.data[-1] == 0x10 AND frame.chk_byte ∈ {0x02, 0x03, 0x04},
the last byte of frame.data is the DLE prefix of a split DLE+chk pair.
Including chk_byte in the strip buffer allows the pair to be stripped as
a unit. After stripping, the trailing chk_byte is ALWAYS removed — because
_strip_inner_frame_dles keeps the byte after the DLE (the chk_byte value),
and that value is the checksum, never payload. This applies to all three
cases (chk ∈ {0x02, 0x03, 0x04}) identically.
MLG CRC:
The algorithm that produces the 2-byte CRC at the start of each MLG record
@@ -291,16 +297,29 @@ def _frame_body_bytes(frame: S3Frame, skip: int) -> bytes:
Extract the waveform body contribution from one A5 S3Frame.
The contribution is frame.data[skip:] with inner-frame DLE pairs stripped
per _strip_inner_frame_dles().
per _strip_inner_frame_dles(). The chk_byte is temporarily appended before
stripping to handle the split-pair edge case where a DLE at the end of
frame.data is paired with chk_byte.
Until #58 (2026-11-06) an escaped checksum (`10 02/03/04`) left its 0x10 as
the last byte of frame.data, and this function dropped it by pairing it with
chk_byte (first seen on A5[8] of M529LIY6, 2026-04-21). The parser drops it
now, so a 0x10 here is data and is kept.
Split-pair edge case (confirmed for A5[8] of M529LIY6 (example event), 2026-04-21):
S3FrameParser appends DLE+XX pairs as two literal bytes when XX ∉ {DLE, ETX}.
When the LAST occurrence of such a pair straddles the payload/checksum boundary
(i.e., DLE is the last byte of raw_payload and XX is the checksum), the parser
splits them:
- DLE ends up as the last byte of frame.data (frame.data[-1] == 0x10)
- XX is stored as frame.chk_byte
To strip the pair correctly, we reunite the bytes before calling the strip
function. Since chk_byte is the checksum (not payload data), it is excluded
from the final output regardless of whether it was part of a pair.
Post-strip chk_byte removal (ALL cases):
_strip_inner_frame_dles strips the 0x10 and KEEPS chk_byte in all cases.
Chk_byte is always the checksum (not payload), so always strip it off.
Args:
frame: S3Frame from S3FrameParser (or a store pickle loaded by
WaveformStore.load_a5, which converts pre-#58 frames).
frame: S3Frame with frame.data and frame.chk_byte populated.
skip: Number of leading bytes in frame.data to exclude (frame header).
Returns:
@@ -308,7 +327,28 @@ def _frame_body_bytes(frame: S3Frame, skip: int) -> bytes:
"""
if skip >= len(frame.data):
return b""
return _strip_inner_frame_dles(frame.data[skip:])
relevant = frame.data[skip:]
# Detect split DLE+chk pair at the frame boundary.
has_split_pair = (
len(relevant) > 0
and relevant[-1] == 0x10
and frame.chk_byte in {0x02, 0x03, 0x04}
)
if has_split_pair:
# Reunite the split pair so the strip function sees both bytes together.
buf = relevant + bytes([frame.chk_byte])
stripped = _strip_inner_frame_dles(buf)
# _strip_inner_frame_dles strips the DLE (0x10) and KEEPS chk_byte.
# chk_byte is the received checksum — never payload — so remove it.
# This is correct for all values in {0x02, 0x03, 0x04}.
if stripped:
stripped = stripped[:-1]
return stripped
else:
return _strip_inner_frame_dles(relevant)
# ── Filename helper ───────────────────────────────────────────────────────────
@@ -427,9 +467,6 @@ def blastware_filename(event: Event, serial: str, ach: bool = False) -> str:
0 = always literal digit zero
T = 'W' or 'H' — ONLY appended for call-home (ACH) downloads (ach=True).
⚠ ach=True guesses the letter from the recording mode, which is wrong for
a waveform recorded in Histogram+Continuous; for a file in hand use
`with_type_letter(name, bw_bytes)`, which reads the file's own type byte.
Manual / direct downloads produce a 3-char extension (AB0) with no type char.
Call-home downloads produce a 4-char extension (AB0W or AB0H).
@@ -494,32 +531,6 @@ def blastware_filename(event: Event, serial: str, ach: bool = False) -> str:
return prefix + stem + ext
_TYPE_LETTER = {"Waveform": "W", "Histogram": "H"}
def with_type_letter(name: str, bw_bytes: bytes) -> str:
"""`name` with the W/H type letter, for a Blastware file SFM built itself.
Blastware's own direct downloads leave the letter off (`K441LTON.900`) and
only its call-in copies carry it (`K441LTON.900H`), which makes events hard
to sort; SFM's files carry it (2026-10-30). The letter is read from the
file's own record-type byte -- STRT[18], as `decode_blastware_bytes` reads it
(#41) -- not from the recording mode, which in Histogram+Continuous records
both kinds. A file whose type does not read keeps the plain name: a name is
never a reason to fail a download. A name already carrying a letter, or
not of the `<stem>.<AB>0` form, is returned unchanged.
"""
if blastware_filename_time(name) is None or len(name.rsplit(".", 1)[-1]) != 3:
return name
try:
from .event_file_io import decode_blastware_bytes # lazy: event_file_io imports this module
letter = _TYPE_LETTER.get(decode_blastware_bytes(bw_bytes).record_type)
except Exception as exc: # noqa: BLE001
log.warning("with_type_letter: %s: the record type did not read (%s) -- plain name kept", name, exc)
letter = None
return name + letter if letter else name
# ── A5 frame classifier ───────────────────────────────────────────────────────────
# ASCII markers that identify a compliance-config / metadata frame.
@@ -567,31 +578,6 @@ def classify_frame(frame: S3Frame) -> str:
# ── Waveform file writer ───────────────────────────────────────────────────────────
_A5_HEADER = 12 # every A5 reply's header after the probe, in stripped bytes
_A5_TERM_HEADER = 11 # the TERM reply's header
def _raw_skip(data, stripped_len: int) -> int:
"""Raw bytes of `data` covering its first `stripped_len` bytes, an inner DLE
pair (10 02 / 10 03 / 10 04) counting as one -- the rule `probe_skip` and
`_strip_inner_frame_dles` already use.
Every A5 header is 12 bytes in that sense (the TERM's 11), but its raw length
varies with the address it echoes: 13 for the metadata pages at 0x1002 and
0x1004, and for a sample chunk that lands there; 12 otherwise. A fixed
"frames 1 and 2 are metadata pages, skip 13" cut two bytes from every
non-first event, which has no metadata pages (BE9441, 2026-10-25).
"""
raw_i = stripped = 0
while stripped < stripped_len and raw_i < len(data):
if data[raw_i] == 0x10 and raw_i + 1 < len(data) and data[raw_i + 1] in (0x02, 0x03, 0x04):
raw_i += 2
else:
raw_i += 1
stripped += 1
return raw_i
def extract_body_bytes(a5_frames):
"""Reconstruct the Blastware-file body bytes from a list of A5 frames.
@@ -654,11 +640,16 @@ def extract_body_bytes(a5_frames):
all_bytes = bytearray()
for fi, frame in enumerate(body_frames):
skip = probe_skip if fi == 0 else _raw_skip(frame.data, _A5_HEADER)
if fi == 0:
skip = probe_skip
elif fi in (1, 2):
skip = 13 # metadata pages
else:
skip = 12 # sample chunks
all_bytes.extend(_frame_body_bytes(frame, skip))
if term_frame is not None:
all_bytes.extend(_frame_body_bytes(term_frame, _raw_skip(term_frame.data, _A5_TERM_HEADER)))
all_bytes.extend(_frame_body_bytes(term_frame, 11))
# Find the first valid `0e 08` footer marker.
footer_pos = -1
@@ -691,18 +682,8 @@ def write_blastware_file(
a5_frames: list[S3Frame],
path: Union[str, Path],
) -> None:
"""Write `blastware_file_bytes(event, a5_frames)` to `path`."""
Path(path).write_bytes(blastware_file_bytes(event, a5_frames))
def blastware_file_bytes(
event: Event,
a5_frames: list[S3Frame],
) -> bytes:
"""
The Blastware waveform file for a downloaded event, as bytes -- what
write_blastware_file writes, and what a live SFM download stores through the
file-import path (sfm.event_ingest).
Write a Blastware waveform file from a downloaded event.
Args:
event: Event object (populated by get_events() or download_waveform()).
@@ -711,18 +692,23 @@ def blastware_file_bytes(
(page_key=0x0000). Pass include_terminator=True to
read_bulk_waveform_stream() when collecting frames.
Must have at least 2 frames (probe + terminator).
path: Destination file path. Parent directory must exist.
Extension should be set via blastware_filename().
File layout:
[22B header] [21B STRT] [body bytes] [26B footer]
Raises:
ValueError: if a5_frames is empty or has no terminator (page_key=0).
OSError: if the file cannot be written.
Confirmed correct waveform body reconstruction against M529LIY6 (example event) (2026-04-21).
"""
if not a5_frames:
raise ValueError("a5_frames must not be empty")
path = Path(path)
# ── Extract STRT record from probe frame ────────────────────────────────
# The STRT record (21 bytes) lives verbatim inside A5[0].data[7:].
# It is stored as-is in the waveform file — do NOT reconstruct it from Event
@@ -826,9 +812,9 @@ def blastware_file_bytes(
# Frame contribution loop (v0.14.0 BW-exact walk).
# Skip values:
# probe (fi=0): probe_skip
# every later frame: 12 stripped bytes (_raw_skip): 13 raw for an
# address with an inner DLE pair (the metadata
# pages 0x1002 / 0x1004, or a chunk there), else 12
# meta@0x1002 (fi=1): 13 (6-byte inner header)
# meta@0x1004 (fi=2): 13 (6-byte inner header)
# sample chunks (fi=3+): 12 (5-byte inner header)
last_fi = len(body_frames) - 1
log.debug(
@@ -839,7 +825,12 @@ def blastware_file_bytes(
all_bytes = bytearray()
for fi, frame in enumerate(body_frames):
skip = probe_skip if fi == 0 else _raw_skip(frame.data, _A5_HEADER)
if fi == 0:
skip = probe_skip
elif fi in (1, 2):
skip = 13 # metadata pages
else:
skip = 12 # sample chunks
contribution = _frame_body_bytes(frame, skip)
log.debug("write_blastware_file: fi=%d skip=%d raw_data=%d contribution=%d",
@@ -847,15 +838,14 @@ def blastware_file_bytes(
all_bytes.extend(contribution)
# Terminator contributes its content, which ends with the 26-byte footer.
# 11 stripped bytes (not 12): the terminator's inner frame header is one
# shorter than a chunk's. Confirmed 2026-04-21.
# skip=11 (not 12) because the terminator's inner frame header is 4 bytes,
# one shorter than chunk frames' 5-byte inner header. Confirmed 2026-04-21.
if term_frame is not None:
term_skip = _raw_skip(term_frame.data, _A5_TERM_HEADER)
term_contribution = _frame_body_bytes(term_frame, term_skip)
term_contribution = _frame_body_bytes(term_frame, 11)
log.debug(
"write_blastware_file: term_frame data_len=%d skip=%d "
"write_blastware_file: term_frame data_len=%d skip=11 "
"contribution_len=%d first8=%s",
len(term_frame.data), term_skip,
len(term_frame.data),
len(term_contribution),
term_contribution[:8].hex() if len(term_contribution) >= 8 else term_contribution.hex(),
)
@@ -917,7 +907,12 @@ def blastware_file_bytes(
+ b"\x00\x00"
)
return header + strt + body + footer
# ── Write file ───────────────────────────────────────────────────────────
with open(path, "wb") as f:
f.write(header)
f.write(strt)
f.write(body)
f.write(footer)
def read_blastware_file(path: Union[str, Path]) -> Event:
+429 -214
View File
@@ -34,7 +34,7 @@ import re
import struct
from typing import Optional
from .framing import S3Frame, unescape_reply
from .framing import S3Frame
from .models import (
CallHomeConfig,
ComplianceConfig,
@@ -60,18 +60,23 @@ from .transport import SerialTransport, BaseTransport
log = logging.getLogger(__name__)
# SUB 0x1C state-flag values measured while a unit was monitoring: 0x10 (BE11529,
# 2026-04-08, 98 frames) and 0x0B (BE9441 recording a histogram, 2026-10-26).
# Idle is 0x00 on both.
S3_MONITORING_FLAGS = frozenset({0x10, 0x0B})
# ── Module-level constants ────────────────────────────────────────────────────
# ⚠ RETRACTED 2026-10-27 (#46): a trigger block "hardcoded from 3-11-26 -- no
# read exists, Blastware writes this fixed blob". Blastware reads it first (SUB
# 0x2E), and its byte 5 differs by unit and session (01 / 03 / 04 on record), so
# the copy changed that setting on any unit that differed. A settings write sends
# the unit's own block back (sfm.device_access.s3 change_settings, phase 5).
# Trigger config payload hardcoded from 3-11-26 BW TX capture (BW frame 108).
# No SUB 0x22 read exists in the capture — Blastware writes this fixed blob.
# 29 bytes: [00][1A][D5][00][00][10][03][08][0A] + 18×FF + [00][00]
_TRIGGER_DATA_HARDCODED: bytes = bytes.fromhex(
"001ad500001003080a"
"ffffffffffffffffffffffffffffffffffffff"
"0000"
)
# Compliance ASCII slot format (confirmed from 3-11-26 capture + label search):
# Each label occupies a 64-byte slot.
# Value starts at slot_start + 22, max 42 bytes, null-padded.
_COMPLIANCE_SLOT_SIZE = 64
_COMPLIANCE_VALUE_OFFSET = 22
_COMPLIANCE_VALUE_MAX = _COMPLIANCE_SLOT_SIZE - _COMPLIANCE_VALUE_OFFSET # 42
# ── MiniMateClient ────────────────────────────────────────────────────────────
@@ -445,7 +450,7 @@ class MiniMateClient:
proto.confirm_erase_all()
log.info("delete_all_events: erase confirmed — device memory cleared")
def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1, headers_only: bool = False, only_key: Optional[bytes] = None, only_key_timestamp: Optional[str] = None) -> list[Event]:
def get_events(self, full_waveform: bool = False, debug: bool = False, stop_after_index: Optional[int] = None, skip_waveform_for_keys: Optional[set] = None, skip_waveform_for_events: Optional[dict] = None, extra_chunks_after_metadata: int = 1) -> list[Event]:
"""
Download all stored events from the device using the confirmed
1E → 0A → 0C → 5A → 1F event-iterator protocol.
@@ -474,26 +479,8 @@ class MiniMateClient:
Raises:
ProtocolError: on unrecoverable communication failure.
headers_only: never start a 5A -- every event takes the bypass below.
only_key: download only the event with this key (in full, per
full_waveform); walk the others without their 5A, and stop once
that event is read.
only_key_timestamp: with only_key, the ISO timestamp (as
`_event_timestamp_iso` formats it, e.g. "2026-10-01T08:00:00") the
event was listed with. If the 0C at only_key says another time, or
gave none, that event is returned without its 5A -- 1F(arm), POLL
and 5A are not sent -- and the caller reports which.
Strict mode (headers_only, or only_key): a list or a one-event download
must be all or nothing, so a lost 0A or 1F reply re-raises its
ProtocolError instead of skipping an event or ending the walk early,
and a 1F that returns a key already walked raises ProtocolError.
Without those options (legacy) the walk is exactly as it was.
"""
proto = self._require_proto()
strict = headers_only or only_key is not None
# Passed only when on, so the legacy walk's 5A call is unchanged.
strict_5a = {"strict": True} if strict else {}
log.info("get_events: requesting first event (SUB 1E)")
try:
@@ -510,7 +497,6 @@ class MiniMateClient:
events: list[Event] = []
idx = 0
seen: set = set() # strict mode: keys walked, to catch a chain that does not advance
# Legacy bare-key skip set is deprecated: the device's key counter
# resets to 0x01110000 after every memory erase, so a key in this set
@@ -528,10 +514,6 @@ class MiniMateClient:
while data8[4:8] != b"\x00\x00\x00\x00":
cur_key = key4 # key for this event's 0A/1E-arm/0C/5A calls
if strict and cur_key in seen:
raise ProtocolError(
f"event chain did not advance: key {cur_key.hex()} came back twice")
seen.add(cur_key)
log.info("get_events: record %d key=%s", idx, cur_key.hex())
ev = Event(index=idx)
@@ -549,8 +531,6 @@ class MiniMateClient:
)
proceed = False
except ProtocolError as exc:
if strict:
raise
log.warning(
"get_events: 0A failed for key=%s: %s — skipping",
cur_key.hex(), exc,
@@ -597,19 +577,6 @@ class MiniMateClient:
"get_events: key=%s (key, ts=%s) match — skipping 5A bulk download",
cur_key.hex(), actual_ts,
)
elif headers_only or (only_key is not None and cur_key != only_key):
# The same bypass as a (key, ts) match: 0A + 1E(arm) + 0C were
# read; 1F(arm) + POLL + 5A are not sent, and 1F(browse) below is
# safe because no 5A was ever started.
skip_5a = True
elif (only_key is not None and only_key_timestamp is not None
and actual_ts != only_key_timestamp):
# The event at this key is not the one asked for -- erased or
# wrapped since it was listed, or its 0C reply was lost. Do
# not download it; the caller reports which.
log.info("get_events: key=%s is from %r, not %r -- no 5A",
cur_key.hex(), actual_ts, only_key_timestamp)
skip_5a = True
arm_key4: Optional[bytes] = None
a5_ok = False
@@ -650,7 +617,7 @@ class MiniMateClient:
)
a5_frames = proto.read_bulk_waveform_stream(
cur_key, stop_after_metadata=False, max_chunks=128,
include_terminator=True, **strict_5a,
include_terminator=True,
)
if a5_frames:
a5_ok = True
@@ -669,7 +636,7 @@ class MiniMateClient:
cur_key, stop_after_metadata=True,
include_terminator=True,
extra_chunks_after_metadata=extra_chunks_after_metadata,
max_chunks=128, **strict_5a,
max_chunks=128,
)
if a5_frames:
a5_ok = True
@@ -681,8 +648,6 @@ class MiniMateClient:
ev.project_info.operator if ev.project_info else None,
)
except ProtocolError as exc:
if strict:
raise # a one-event download is whole or it is an error
log.warning(
"get_events: 5A failed for key=%s: %s — metadata unavailable",
cur_key.hex(), exc,
@@ -715,8 +680,6 @@ class MiniMateClient:
key4.hex(), data8[4:8].hex(),
)
except ProtocolError as exc:
if strict:
raise
log.warning("get_events: 1F(browse) failed: %s — stopping", exc)
key4 = b"\x00\x00\x00\x00"
data8 = b"\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -750,10 +713,6 @@ class MiniMateClient:
events.append(ev)
idx += 1
if only_key is not None and cur_key == only_key:
log.info("get_events: read key=%s -- stopping", cur_key.hex())
break
# Early exit: if the caller only wants events up to a specific
# index, stop iterating once we've collected it.
if stop_after_index is not None and idx > stop_after_index:
@@ -776,44 +735,12 @@ class MiniMateClient:
key4.hex(), data8[4:8].hex(),
)
except ProtocolError as exc:
if strict:
raise
log.warning("get_events: 1F failed: %s — stopping iteration", exc)
break
log.info("get_events: downloaded %d event(s)", len(events))
return events
def list_event_headers(self) -> list[Event]:
"""Every stored event's 0C record -- timestamp, type, peaks -- without its 5A.
`get_events()` downloads every event in full even for metadata
(`stop_after_metadata` is a no-op), so listing that way costs one
complete download per event. This walks 0A + 1E(arm) + 0C + 1F(browse)
per event -- the bypass `skip_waveform_for_events` already takes -- and
never starts a 5A. The events carry no `_a5_frames`.
"""
return self.get_events(headers_only=True)
def download_event_by_key(self, key4: bytes, *, expected_timestamp: Optional[str] = None) -> Optional[Event]:
"""Download ONE event in full; walk past the events before it without
their 5A. None if no full record has that key.
`get_events(stop_after_index=N)` downloads events 0..N in full and keeps
one; this downloads only the one asked for.
`expected_timestamp` (ISO, as `_event_timestamp_iso` writes it): the
time the event was listed with. If the 0C read at that key says
otherwise -- or could not be read -- the event comes back without its
5A (`_a5_frames` None) and nothing is downloaded; the caller compares
the timestamp and says which.
"""
for ev in self.get_events(full_waveform=True, only_key=key4,
only_key_timestamp=expected_timestamp):
if ev._waveform_key == key4:
return ev
return None
def download_waveform(self, event: Event) -> None:
"""
Download the full raw ADC waveform for a previously-retrieved event
@@ -915,8 +842,6 @@ class MiniMateClient:
compliance_data: bytes,
trigger_data: bytes,
waveform_data: bytes,
*,
escaped: bool = False,
) -> None:
"""
Push a complete config update to the device using the confirmed write
@@ -944,10 +869,6 @@ class MiniMateClient:
trigger_data: Raw bytes for SUB 82 write (44-byte trigger config).
waveform_data: Raw bytes for SUB 69 write.
`escaped`: False (the default) -- the blocks are logical, as every block
read returns them since phase 5; True for blocks that still hold the
parser's kept escape bytes.
Raises:
RuntimeError: if the client is not connected.
ProtocolError: if any write step fails (timeout, bad ack SUB).
@@ -955,40 +876,25 @@ class MiniMateClient:
"""
proto = self._require_proto()
# Every block is checked before the first frame goes out (review of #46,
# 2026-10-27): a block refused after 68 + 73 had been sent left a partial
# write behind. write_image is the same check each write makes.
from .protocol import (SUB_COMPLIANCE_WRITE, SUB_EVENT_INDEX_WRITE,
SUB_TRIGGER_CONFIG_WRITE, SUB_WAVEFORM_DATA_WRITE, ImageRefused,
write_image)
for sub, data in ((SUB_EVENT_INDEX_WRITE, event_index_data),
(SUB_COMPLIANCE_WRITE, compliance_data),
(SUB_TRIGGER_CONFIG_WRITE, trigger_data),
(SUB_WAVEFORM_DATA_WRITE, waveform_data)):
try:
write_image(sub, data, escaped=escaped)
except ValueError as exc: # refused before any frame: the caller audits "nothing sent"
raise ImageRefused(str(exc)) from exc
# 68 → 73
log.info("push_config_raw: write event index (SUB 68)")
proto.write_event_index(event_index_data, escaped=escaped)
proto.write_event_index(event_index_data)
log.info("push_config_raw: confirm B (SUB 73)")
proto.write_confirm(SUB_WRITE_CONFIRM_B)
# 71×3 → 72 (handled internally by write_compliance_config_raw)
log.info("push_config_raw: write compliance config (SUB 71 ×3 + confirm 72)")
proto.write_compliance_config_raw(compliance_data, escaped=escaped)
proto.write_compliance_config_raw(compliance_data)
# 82 → 83
log.info("push_config_raw: write trigger config (SUB 82)")
proto.write_trigger_config(trigger_data, escaped=escaped)
proto.write_trigger_config(trigger_data)
log.info("push_config_raw: trigger confirm (SUB 83)")
proto.write_confirm(SUB_TRIGGER_CONFIRM)
# 69 → 74 → 72
log.info("push_config_raw: write waveform data (SUB 69)")
proto.write_waveform_data(waveform_data, escaped=escaped)
proto.write_waveform_data(waveform_data)
log.info("push_config_raw: confirm C (SUB 74)")
proto.write_confirm(SUB_WRITE_CONFIRM_C)
log.info("push_config_raw: confirm A (SUB 72)")
@@ -996,6 +902,119 @@ class MiniMateClient:
log.info("push_config_raw: complete")
def apply_config(
self,
*,
# Recording parameters
recording_mode: Optional[int] = None,
sample_rate: Optional[int] = None,
record_time: Optional[float] = None,
histogram_interval_sec: Optional[int] = None,
# Threshold parameters (geo channels, in/s)
trigger_level_geo: Optional[float] = None,
alarm_level_geo: Optional[float] = None,
geo_range: Optional[int] = None, # 0x00=Normal 10in/s, 0x01=Sensitive 1.25in/s
# Project / operator strings
project: Optional[str] = None,
client_name: Optional[str] = None,
operator: Optional[str] = None,
seis_loc: Optional[str] = None,
notes: Optional[str] = None,
) -> None:
"""
Read the current device config, apply any supplied changes to the
compliance block, and write the full config back to the device.
Only non-None arguments are modified; all other bytes are round-tripped
verbatim from the device.
Configurable fields
-------------------
Recording parameters:
recording_mode : int — 0x00=Single Shot, 0x01=Continuous, 0x03=Histogram, 0x04=Histogram+Continuous
sample_rate : int — samples/sec; valid values: 1024, 2048, 4096
record_time : float — record duration in seconds (e.g. 2.0, 3.0)
Trigger/alarm thresholds and range (geo channels):
trigger_level_geo : float — trigger threshold in/s (e.g. 0.5)
alarm_level_geo : float — alarm threshold in/s (e.g. 1.0)
geo_range : int — 0x00=Normal 10.000 in/s, 0x01=Sensitive 1.250 in/s
(written to Tran/Vert/Long channel blocks)
Project / operator strings (max 41 ASCII characters each):
project : str
client_name : str
operator : str
seis_loc : str — sensor location
notes : str — extended notes
Write sequence (confirmed from 3-11-26 BW TX capture):
68→73 | 71×3→72 | 82→83 | 69→74→72
Write payloads:
event_index_data : 88 bytes — read live via SUB 08
compliance_data : ~2128 bytes — read live via SUB 1A (~2126 bytes, varies ±1-2) + \\x00\\x00 footer
trigger_data : 29 bytes — hardcoded from 3-11-26 capture
waveform_data : 204 bytes — read live via SUB 09
Raises:
RuntimeError: if not connected.
ProtocolError: if any read or write step fails.
ValueError: if compliance buffer is shorter than the 2082-byte write minimum.
"""
proto = self._require_proto()
# 1. Read current payloads from the device
log.info("apply_config: reading event index (SUB 08)")
event_index_data = proto.read_event_index()
log.info("apply_config: reading compliance config (SUB 1A)")
compliance_raw = proto.read_compliance_config() # ~2126 bytes (varies ±1-2 by DLE jitter)
log.info("apply_config: reading waveform data (SUB 09)")
waveform_data = proto.read_waveform_data_raw() # 204 bytes
trigger_data = _TRIGGER_DATA_HARDCODED # 29 bytes
# 2. Patch the compliance buffer and build the 2128-byte write payload
compliance_data = _encode_compliance_config(
compliance_raw,
recording_mode=recording_mode,
sample_rate=sample_rate,
record_time=record_time,
histogram_interval_sec=histogram_interval_sec,
trigger_level_geo=trigger_level_geo,
alarm_level_geo=alarm_level_geo,
geo_range=geo_range,
project=project,
client_name=client_name,
operator=operator,
seis_loc=seis_loc,
notes=notes,
)
log.info("apply_config: compliance payload ready (%d bytes)", len(compliance_data))
# 3. Push the full write sequence to the device
self.push_config_raw(event_index_data, compliance_data, trigger_data, waveform_data)
log.info("apply_config: complete")
def set_project_info(
self,
project: Optional[str] = None,
client_name: Optional[str] = None,
operator: Optional[str] = None,
seis_loc: Optional[str] = None,
notes: Optional[str] = None,
) -> None:
"""Backwards-compat shim — delegates to apply_config()."""
self.apply_config(
project=project,
client_name=client_name,
operator=operator,
seis_loc=seis_loc,
notes=notes,
)
# ── Call home config ──────────────────────────────────────────────────────
def get_call_home_config(self) -> CallHomeConfig:
@@ -1016,33 +1035,6 @@ class MiniMateClient:
raw = proto.read_call_home_config()
return _decode_call_home_config(raw)
def read_call_home_raw(self) -> bytes:
"""The `0x2C` reply payload as read (125 B, kept escapes in), for a
read-modify-write (`call_home_image`)."""
return self._require_proto().read_call_home_config()
def read_compliance_content(self) -> bytes:
"""The 1A settings read as the logical 2,090-byte block, unjudged (a
monitoring unit's device-info answer comes back as it is; see
`minimateplus.protocol.is_compliance_content`)."""
return self._require_proto().read_compliance_content()
def read_settings_blocks(self) -> dict:
"""The four blocks a settings write sends back, each as its read returns it:
event index (08), settings (1A, logical), trigger (2E), waveform data (09)."""
proto = self._require_proto()
return {"event_index": proto.read_event_index(),
"compliance": proto.read_compliance_content(),
"trigger": proto.read_trigger_config(),
"waveform": proto.read_waveform_data_raw()}
def write_call_home_image(self, image: bytes) -> None:
"""Send a `0x7E` image (`call_home_image`) and its `0x7F` confirm, each ack
checked -- framed once, never unescaped again. Raises ImageRefused before
any byte goes out for an image that is not a whole block. No retry: what
happened is the caller's to read back."""
self._require_proto().write_call_home_image(image)
def set_call_home_config(
self,
*,
@@ -1128,17 +1120,6 @@ class MiniMateClient:
log.debug("poll: startup handshake")
proto.startup()
def read_serial(self) -> str:
"""The unit's own serial (SUB 0x15), on an open, polled session. The
cheap identity read the legacy write routes check before writing."""
return _decode_serial_number(self._require_proto().read(SUB_SERIAL_NUMBER)).serial
def wake(self, attempt_s: float = 5.0, deadline_s: float = 60.0) -> None:
"""SESSION_RESET + POLL, re-sent until the unit answers (see
MiniMateProtocol.wake) -- for a unit that may be busy, e.g. sensor-checking
right after a start."""
self._require_proto().wake(attempt_s=attempt_s, deadline_s=deadline_s)
# ── Monitoring ────────────────────────────────────────────────────────────
def get_monitor_status(self) -> MonitorStatus:
@@ -1250,15 +1231,12 @@ def _decode_serial_number(data: bytes) -> DeviceInfo:
# Actual serial payload starts at data[11].
actual = data[11:] if len(data) > 11 else data
# The serial is a C string: cut at the first NUL. A short serial leaves a
# stray byte after its terminator (BE9441 sends b"BE9441\x00?"), so
# stripping trailing NULs alone is not enough.
if len(actual) < 9:
# Short payload — gracefully degrade
serial = actual.split(b"\x00", 1)[0].decode("ascii", errors="replace")
serial = actual.rstrip(b"\x00").decode("ascii", errors="replace")
return DeviceInfo(serial=serial, firmware_minor=0)
serial = actual[:8].split(b"\x00", 1)[0].decode("ascii", errors="replace")
serial = actual[:8].rstrip(b"\x00").decode("ascii", errors="replace")
trail_0 = actual[8] if len(actual) > 8 else None
fw_minor = actual[9] if len(actual) > 9 else 0
@@ -2012,6 +1990,217 @@ def _extract_project_strings(data: bytes) -> Optional[ProjectInfo]:
)
def _encode_compliance_config(
raw: bytes,
*,
recording_mode: Optional[int] = None,
sample_rate: Optional[int] = None,
record_time: Optional[float] = None,
trigger_level_geo: Optional[float] = None,
alarm_level_geo: Optional[float] = None,
geo_range: Optional[int] = None, # 0x00=Normal 10in/s, 0x01=Sensitive 1.25in/s
histogram_interval_sec: Optional[int] = None,
project: Optional[str] = None,
client_name: Optional[str] = None,
operator: Optional[str] = None,
seis_loc: Optional[str] = None,
notes: Optional[str] = None,
) -> bytes:
"""
Patch a live 2126-byte compliance buffer (read from the device) with any
supplied field values and return the 2128-byte write payload.
Only non-None arguments are modified; everything else is round-tripped verbatim.
Numeric field locations (all anchor-relative or label-relative — immune to
DLE-jitter shifts):
Anchor: b'\\xbe\\x80\\x00\\x00\\x00\\x00' (confirmed stable, both BE11529 and BE18189)
recording_mode → uint8 at anchor_pos - 8 (BOTH read and write)
Values: 0x00=Single Shot, 0x01=Continuous, 0x03=Histogram, 0x04=Histogram+Continuous
NOTE: The byte at anchor_pos - 7 is always 0x10 (a DLE marker regenerated by
device firmware in every E5 response). It must NOT be overwritten during
write — doing so causes anchor drift (+1 per write cycle).
CORRECTION 2026-04-21: previous doc stated anchor-7 for write; empirically
confirmed wrong — writing to anchor-7 shifts the anchor by 1 on every cycle.
sample_rate → uint16 BE at anchor_pos - 6
histogram_interval_sec → uint16 BE at anchor_pos - 4 (seconds; mode-gated to Histogram/Histogram+Continuous)
Valid values: 2, 5, 15, 60, 300, 900 (= 2s, 5s, 15s, 1m, 5m, 15m)
record_time → float32 BE at anchor_pos + 6
Channel block (anchored on b"Tran" with unit-string guard):
geo_range → uint8 at tran_pos + 33 (confirmed 2026-04-20)
0x00 = Normal 10.000 in/s, 0x01 = Sensitive 1.250 in/s
Written to Tran, Vert, Long channel blocks (all three).
adc_scale_factor → float32 BE at tran_pos + 28 (= 6.206053; do NOT write)
trigger_level_geo → float32 BE at tran_pos + 34
"in.\\x00" → unit string at tran_pos + 38 (layout guard)
alarm_level_geo → float32 BE at tran_pos + 42
"/s\\x00\\x00" → unit string at tran_pos + 46 (layout guard)
NOTE: tran_pos+28 (float32 = 6.206053) is the ADC-to-velocity scale factor
(= 1/sensitivity, (in/s)/V — Interface Handbook §4.5: 1.61133 V × 6.206053 = 10.000 in/s).
This is a hardware/firmware constant common to all MiniMate Plus S3 units.
It must NOT be written — do not add it back as a parameter.
String field locations (64-byte slots, label+22 format):
b"Project:" → value at label_pos + 22, max 41 chars + null
b"Client:" → value at label_pos + 22, max 41 chars + null
b"User Name:" → value at label_pos + 22, max 41 chars + null
b"Seis Loc:" → value at label_pos + 22, max 41 chars + null
b"Extended Notes"→ value at label_pos + 22, max 41 chars + null
Returns:
2128-byte write payload: patched 2126-byte buffer + 2-byte footer \\x00\\x00.
(Checksum formula for the footer is unknown; \\x00\\x00 confirmed accepted
by the device in POC test 2026-04-07.)
Raises:
ValueError: if raw is shorter than the minimum needed for the 3-chunk write.
"""
# Total size is nominally ~2126 bytes but varies by ±1-2 bytes depending on
# DLE jitter in the E5 read response (0x10 bytes in the config data cause
# 1-byte expansions per occurrence during DLE stuffing/unstuffing). The
# anchor-based field access and the chunk splitter (fixed chunk1=1027,
# chunk2=1055, chunk3=remainder) both handle variable length correctly.
# Only enforce a minimum — must have at least chunk1+chunk2 bytes of content.
_MIN_COMPLIANCE_LEN = 1027 + 1055 # = 2082
if len(raw) < _MIN_COMPLIANCE_LEN:
raise ValueError(
f"_encode_compliance_config: compliance buffer too short "
f"({len(raw)} bytes, need at least {_MIN_COMPLIANCE_LEN})"
)
if len(raw) not in range(2124, 2132):
log.warning(
"_encode_compliance_config: unusual compliance buffer length %d "
"(expected ~2126); proceeding with anchor-based access",
len(raw),
)
buf = bytearray(raw)
# ── Numeric: recording_mode + sample_rate + record_time (anchor-relative) ──
_ANC = b'\xbe\x80\x00\x00\x00\x00'
_anc = buf.find(_ANC, 0, 150)
# Log anchor position every time so we can detect unexpected shifts due to
# DLE jitter or firmware differences. Expected position is ~15.
if _anc < 0:
log.warning(
"_encode_compliance_config: anchor NOT FOUND in cfg[0:150] "
"(buf len=%d) — all anchor-relative writes will be skipped",
len(buf),
)
else:
log.info(
"_encode_compliance_config: anchor at cfg[%d] buf_len=%d "
"(recording_mode@%d DLE_marker@%d sample_rate@%d:%d "
"histogram_interval@%d:%d record_time@%d:%d)",
_anc, len(buf),
_anc - 8,
_anc - 7,
_anc - 6, _anc - 4,
_anc - 4, _anc - 2,
_anc + 6, _anc + 10,
)
if recording_mode is not None:
if _anc < 8:
log.warning("_encode_compliance_config: anchor not found — cannot write recording_mode")
else:
# Write to anchor-8, same physical position as the E5 read format.
# The byte at anchor-7 is a DLE marker (0x10) that the device firmware
# regenerates in every E5 response — it must NOT be overwritten.
# Writing to anchor-7 causes the device to add an extra byte on the
# next read-back, drifting the anchor by +1 on every write cycle.
# (CLAUDE.md "anchor-7 write" was incorrect — confirmed 2026-04-21)
buf[_anc - 8] = recording_mode & 0xFF
log.debug("_encode_compliance_config: recording_mode=0x%02X -> offset %d",
recording_mode, _anc - 8)
if sample_rate is not None:
if _anc < 6:
log.warning("_encode_compliance_config: anchor not found — cannot write sample_rate")
else:
struct.pack_into(">H", buf, _anc - 6, sample_rate)
log.debug("_encode_compliance_config: sample_rate=%d -> offset %d", sample_rate, _anc - 6)
if histogram_interval_sec is not None:
if _anc < 4:
log.warning("_encode_compliance_config: anchor not found — cannot write histogram_interval")
else:
struct.pack_into(">H", buf, _anc - 4, histogram_interval_sec)
log.debug("_encode_compliance_config: histogram_interval=%ds -> offset %d",
histogram_interval_sec, _anc - 4)
if record_time is not None:
if _anc < 0 or _anc + 10 > len(buf):
log.warning("_encode_compliance_config: anchor not found — cannot write record_time")
else:
struct.pack_into(">f", buf, _anc + 6, record_time)
log.debug("_encode_compliance_config: record_time=%.3f -> offset %d", record_time, _anc + 6)
# ── Numeric: channel block (Tran label + unit-string guard) ───────────────
# NOTE: tran_pos+24 (write format) or tran_pos+28 (E5 read format) is the
# ADC-to-velocity scale factor (6.206053, hardware constant — never written).
# geo_range is written to ALL THREE geo channel blocks (Tran, Vert, Long),
# confirmed from 4-20-26 captures showing the byte at label+29 in each block.
_needs_channel = any(v is not None for v in (trigger_level_geo, alarm_level_geo, geo_range))
if _needs_channel:
_tran = buf.find(b"Tran", 44)
_valid = (
_tran >= 0
and buf[_tran + 4 : _tran + 5] != b"2"
and _tran + 50 <= len(buf)
and buf[_tran + 38 : _tran + 42] == b"in.\x00"
and buf[_tran + 46 : _tran + 50] == b"/s\x00\x00"
)
if not _valid:
log.warning(
"_encode_compliance_config: 'Tran' channel block not found or unit "
"guard failed — trigger/alarm/geo_range will not be written"
)
else:
if trigger_level_geo is not None:
struct.pack_into(">f", buf, _tran + 34, trigger_level_geo)
log.debug("_encode_compliance_config: trigger_level_geo=%.4f -> offset %d", trigger_level_geo, _tran + 34)
if alarm_level_geo is not None:
struct.pack_into(">f", buf, _tran + 42, alarm_level_geo)
log.debug("_encode_compliance_config: alarm_level_geo=%.4f -> offset %d", alarm_level_geo, _tran + 42)
if geo_range is not None:
# Write geo_range to all three geo channel blocks (Tran, Vert, Long).
# Field at label+33 in the E5-format compliance bytes (same in read and write
# since the 2126-byte payload is round-tripped verbatim).
# 0x00 = Normal 10.000 in/s, 0x01 = Sensitive 1.250 in/s.
for _ch_label in (b"Tran", b"Vert", b"Long"):
_ch = buf.find(_ch_label, 44)
if _ch >= 0 and buf[_ch + 4 : _ch + 5] != b"2" and _ch + 34 <= len(buf):
buf[_ch + 33] = geo_range & 0xFF
log.debug(
"_encode_compliance_config: geo_range=0x%02X -> %s+33 offset %d",
geo_range, _ch_label.decode(), _ch + 33,
)
# ── ASCII strings (64-byte slot, value at label_pos+22) ───────────────────
def _set_string(label: bytes, value: Optional[str]) -> None:
if value is None:
return
idx = buf.find(label)
if idx < 0:
log.warning("_encode_compliance_config: label %r not found", label)
return
val_bytes = value.encode("ascii", errors="replace")[:_COMPLIANCE_VALUE_MAX - 1]
padded = val_bytes + b"\x00" * (_COMPLIANCE_VALUE_MAX - len(val_bytes))
buf[idx + _COMPLIANCE_VALUE_OFFSET : idx + _COMPLIANCE_SLOT_SIZE] = padded
log.debug("_encode_compliance_config: %r -> %r", label, value)
_set_string(b"Project:", project)
_set_string(b"Client:", client_name)
_set_string(b"User Name:", operator)
_set_string(b"Seis Loc:", seis_loc)
_set_string(b"Extended Notes", notes)
# 2-byte footer — checksum formula unknown; \x00\x00 confirmed accepted by device
return bytes(buf) + b"\x00\x00"
def _decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None:
@@ -2070,53 +2259,92 @@ def _decode_compliance_config_into(data: bytes, info: DeviceInfo) -> None:
# ── recording_mode / sample_rate / histogram_interval / record_time ─────────
# 6-byte stable anchor: b'\xbe\x80\x00\x00\x00\x00' — confirmed across BE11529
# and BE18189. These four fields are read from the reply with its escapes
# REMOVED (unescape_reply): the unit escapes 02/03/04/10 in every reply and
# S3FrameParser keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped
# mode, sample rate or interval moves every field after it by one. BE9441 at
# Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval (2026-10-29).
# and BE18189. The 4 bytes immediately before the anchor are NOT constant:
# bytes -4:-2 are the histogram_interval (uint16 BE, seconds), and bytes -2:0
# are zero padding. The old "10-byte anchor" (\x01\x2c\x00\x00 prefix) was
# only constant when the histogram interval happened to be 5 min (0x012C = 300).
#
# Layout after unescaping, measured on every recorded reply (four settings,
# two of them Blastware's own writes -- tests/test_s3_compliance_anchor_fields.py):
# _anchor - 7 : recording_mode (uint8)
# _anchor - 6 : sample_rate (uint16 BE)
# _anchor - 4 : histogram_interval_sec (uint16 BE, seconds)
# _anchor - 2 : 0x00 0x00 (padding)
# _anchor : \xbe\x80\x00\x00\x00\x00
# _anchor + 6 : record_time (float32 BE)
# ⚠ The old raw layout's "anchor - 7 = constant 0x10" was the escape in front
# of `04` at 1024 sps (0x0400); it read right only at that rate.
# Everything below this block (channel block, strings) still reads the RAW
# bytes: its label-relative offsets were measured on them and are wrong
# unescaped. A reply with no anchor (BE9441 answered 1A with its device-info
# block while monitoring, 2026-10-29) leaves all four fields None.
# E5 read format layout relative to 6-byte anchor:
# _anchor - 8 : recording_mode (uint8)
# _anchor - 7 : 0x10 (extra byte E5 read only; absent in SUB 71 write)
# _anchor - 6 : sample_rate_hi (uint16 BE, MSB)
# _anchor - 5 : sample_rate_lo (uint16 BE, LSB)
# _anchor - 4 : histogram_interval_hi (uint16 BE, seconds, MSB)
# _anchor - 3 : histogram_interval_lo (uint16 BE, seconds, LSB)
# _anchor - 2 : 0x00 (padding)
# _anchor - 1 : 0x00 (padding)
# _anchor : \xbe\x80\x00\x00\x00\x00 (6-byte anchor)
# _anchor + 6 : record_time (float32 BE)
_ANCHOR = b'\xbe\x80\x00\x00\x00\x00'
logical = unescape_reply(data)
_anchor = logical.find(_ANCHOR, 0, 150)
_anchor = data.find(_ANCHOR, 0, 150)
# Log anchor position on every decode so we can compare read vs write and
# catch unexpected shifts from DLE jitter or firmware differences.
# Expected position is ~15 for the E5 read payload (anchor - 8 = recording_mode).
if _anchor < 0:
log.warning(
"_decode_compliance_config_into: anchor NOT FOUND in data[0:150] (len=%d)",
len(data),
)
else:
log.info(
"_decode_compliance_config_into: anchor at data[%d] data_len=%d "
"(expected ~15; recording_mode@%d sample_rate@%d:%d "
"histogram_interval@%d:%d record_time@%d:%d)",
_anchor, len(data),
_anchor - 8,
_anchor - 6, _anchor - 4,
_anchor - 4, _anchor - 2,
_anchor + 6, _anchor + 10,
)
if _anchor >= 8 and _anchor + 10 <= len(data):
try:
config.recording_mode = data[_anchor - 8]
log.debug(
"compliance_config: recording_mode = 0x%02X (anchor@%d)", config.recording_mode, _anchor
)
except Exception as exc:
log.warning("compliance_config: recording_mode extraction failed: %s", exc)
try:
config.sample_rate = struct.unpack_from(">H", data, _anchor - 6)[0]
log.debug(
"compliance_config: sample_rate = %d Sa/s (anchor@%d)", config.sample_rate, _anchor
)
except Exception as exc:
log.warning("compliance_config: sample_rate extraction failed: %s", exc)
try:
config.histogram_interval_sec = struct.unpack_from(">H", data, _anchor - 4)[0]
log.debug(
"compliance_config: histogram_interval = %d s (anchor@%d)",
config.histogram_interval_sec, _anchor
)
except Exception as exc:
log.warning("compliance_config: histogram_interval extraction failed: %s", exc)
try:
config.record_time = struct.unpack_from(">f", data, _anchor + 6)[0]
log.debug(
"compliance_config: record_time = %.3f s (anchor@%d)", config.record_time, _anchor
)
except Exception as exc:
log.warning("compliance_config: record_time extraction failed: %s", exc)
elif _anchor >= 6 and _anchor + 10 <= len(data):
# Fallback: anchor found but not enough bytes before it for recording_mode
log.warning("compliance_config: anchor too close to start (anchor@%d) — skipping recording_mode", _anchor)
try:
config.sample_rate = struct.unpack_from(">H", data, _anchor - 6)[0]
except Exception:
pass
try:
config.record_time = struct.unpack_from(">f", data, _anchor + 6)[0]
except Exception:
pass
else:
log.warning(
"compliance_config: anchor %s not found in cfg[0:150] (len=%d) "
"— sample_rate, record_time and recording_mode will be None",
_ANCHOR.hex(), len(data),
)
elif _anchor >= 7 and _anchor + 10 <= len(logical):
log.info("_decode_compliance_config_into: anchor at unescaped[%d] data_len=%d",
_anchor, len(data))
config.recording_mode = logical[_anchor - 7]
config.sample_rate = struct.unpack_from(">H", logical, _anchor - 6)[0]
config.histogram_interval_sec = struct.unpack_from(">H", logical, _anchor - 4)[0]
config.record_time = struct.unpack_from(">f", logical, _anchor + 6)[0]
log.debug(
"compliance_config: recording_mode=0x%02X sample_rate=%d histogram_interval=%d s "
"record_time=%.3f s (anchor@%d unescaped)",
config.recording_mode, config.sample_rate, config.histogram_interval_sec,
config.record_time, _anchor,
)
else:
log.warning("compliance_config: anchor at unescaped[%d] is too close to an end "
"(len=%d) — mode, rate, interval and record time left None",
_anchor, len(logical))
# ── Project strings ───────────────────────────────────────────────────────
try:
@@ -2354,9 +2582,8 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus:
header, so field offsets below are relative to data[11]).
NOTE: frame.data has the checksum byte already stripped by S3FrameParser
(_finalise returns raw_payload[5:], the checksum and, since #58, the 10 of
an escaped checksum removed). There is NO trailing checksum byte in section;
before #58 one status reply in 63 kept that 10 and read 419.84 V.
(_finalise returns raw_payload[5:] where raw_payload = body[:-1]).
There is NO trailing checksum byte in section.
Monitoring flag (confirmed 4-8-26/2ndtry, byte diff of all 144 data frames):
section[1] == 0x00 → idle
@@ -2374,10 +2601,6 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus:
mem_total 0x000EFFF2 = 983026 bytes ≈ 960 KB
mem_free 0x000E9E52 = 958034 bytes ≈ 935 KB
"""
# Unescape first (2026-10-26): BE9441's free memory 0x000D0E04 arrived as
# `0d 0e 10 04`, and with the parser's kept 10 every field counted from the
# end read one byte off -- 419.84 V and 251,655,168 bytes for 6.76 V and 983,028.
data = unescape_reply(data)
# The data section starts at offset 11 (after the S3 section header).
section = data[11:] if len(data) > 11 else data
@@ -2390,14 +2613,7 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus:
# Confirmed from byte diff of all 144 0xE3 data frames in 4-8-26/2ndtry capture:
# section[1] = 0x00 in all IDLE frames, 0x10 in all MONITORING frames.
# (section[6] also changes but has non-binary values 0xea/0x07 — device-specific.)
#
# 2026-10-26: 0x0B on BE9441 recording a HISTOGRAM (confirmed at the unit);
# 0x00 on the same unit idle. Only measured values count as monitoring --
# sfm.device_access.s3.S3_RUN_STATES refuses any other for a change.
is_monitoring = len(section) > 1 and section[1] in S3_MONITORING_FLAGS
# The same byte, raw -- but only from a real section: for data of 11 bytes
# or fewer, `section` above falls back to the header itself.
state_flag = data[12] if len(data) > 12 else None
is_monitoring = len(section) > 1 and section[1] == 0x10
battery_v = None
memory_total = None
@@ -2423,7 +2639,6 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus:
battery_v=battery_v,
memory_total=memory_total,
memory_free=memory_free,
state_flag=state_flag,
)
+36 -240
View File
@@ -13,102 +13,31 @@ Pure: no I/O, and no import from `sfm/`.
"""
from __future__ import annotations
import datetime
import math
import re
from dataclasses import dataclass, field
from dataclasses import dataclass
from typing import Callable, Optional, Sequence
from .bw_xml_report import XmlReport
from .event_file_io import (interval_times, _GEO_FS_BY_RANGE, _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT,
decode_blastware_bytes, mic_count_divisor, over_full_scale)
from .histogram_codec import half_period_to_hz
from .event_file_io import _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, decode_blastware_bytes
from .models import Event
from .waveform_codec import mic_count_to_db
# SFM's conversion at the Normal range (10 in/s full scale = 32000 counts),
# which SFM assumes when it cannot read the event's range from the file.
# SFM's conversion: it cannot yet read the geophone range from the file, and
# assumes Normal (10 in/s full scale = 32000 counts).
GEO_IPS_PER_COUNT: float = _GEO_NORMAL_FS_INS / _GEO_INT16_FS
_CHANNELS = ("Tran", "Vert", "Long", "MicL")
_EVENT_TYPE = {"Waveform": "Full Waveform", "Histogram": "Full Histogram"}
# How Blastware prints the setup fields SFM reads (measured 2026-11-03).
_MONTHS = ("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December")
_TRIGGERED_BY = {0x0001: "Tran", 0x0002: "Vert", 0x0004: "Long", 0x0008: "MicL", 0x0200: "Manual"}
_STOP_MODES = {0: "Fixed"}
_MIC_TYPES = {2: "Linear Weighting"}
_GEO_TRIGGERS, _MIC_TRIGGER = 0x07, 0x08
# Blastware turns the mic trigger level from psi to dB with 6895 Pa per psi, not
# 6894.757: 4,272 / 4,272 DL2 levels against 4,271 (the odd one 0.01 psi,
# printed 130.8 dB(L), is 130.7498 at the exact constant).
_TRIGGER_PA_PER_PSI = 6895.0
def _setup_values(ev: Event) -> dict[str, object]:
out: dict[str, object] = {}
di = ev.device_info
if di is not None:
out["SerialNumber"] = di.serial
fw = di.firmware_version or ""
if di.dsp_version and fw.startswith("S33") and di.model:
# "V 10.72-8.17 MiniMate Plus" from "10.72", "S338.17" and the model --
# the only version in DL2, so the rule is proven for it alone.
out["Version"] = f"V {di.dsp_version}-{fw[3:]} {di.model}"
if di.calibration_date and di.calibrated_by:
c = di.calibration_date
out["Calibration"] = f"{_MONTHS[c.month - 1]} {c.day}, {c.year} by {di.calibrated_by}"
out["BatteryLevel"] = ev.battery_volts
out["Trigger"] = _TRIGGERED_BY.get(ev.triggered_by)
out["RecordStopMode"] = _STOP_MODES.get(ev.record_stop_mode)
out["Microphone"] = _MIC_TYPES.get(ev.mic_type)
# dB or psi is Blastware's preference, not the unit's (carve-out
# units-is-a-display-preference); SFM reports dB, the default.
out["Units"] = "in/s and dB(L)" if ev.mic_type is not None else "in/s"
# Blastware prints a trigger level only for a channel that is a trigger
# source, and none for a Manual trigger.
src, manual = ev.trigger_sources or 0, ev.triggered_by == 0x0200
if src & _GEO_TRIGGERS and not manual:
out["GeoTriggerLevel"] = ev.trigger_level_geo
if src & _MIC_TRIGGER and not manual and ev.trigger_level_mic_psi:
psi = ev.trigger_level_mic_psi
out["MicTriggerLevel psi(L)"] = psi
out["MicTriggerLevel dB(L)"] = 20 * math.log10(psi * _TRIGGER_PA_PER_PSI / 2e-5)
return out
@dataclass
class SfmSide:
event: Event
values: dict[str, object] # reference tag -> SFM's value; absent or None = blank
notes: list[str] # non-empty user-note slots, in order
job_number: Optional[str] # only when the file says Blastware shows it
job_number: Optional[str] # None until the decoder reads it
channels: list[str] # channels with decoded data, in Tran/Vert/Long/MicL order
counts: dict[str, list[int]] # waveform samples or histogram interval peaks
geo_ips_per_count: float = GEO_IPS_PER_COUNT # at the event's range, as SFM read it
mic_divisor: int = 1 # mic counts per 0.25 Pa, at the mic's range
# interval column -> SFM's value per interval (a number, or Blastware's word)
interval_values: dict[str, list[object]] = field(default_factory=dict)
interval_times: Optional[list[str]] = None # each interval's printed time
def interval_frequency(halfp: int, sample_rate: int) -> object:
"""An interval's frequency as Blastware prints it: "N/A" for a half-period
of 0, ">100" (">200" at 2048 sps) at 5 samples or fewer, "<1.0" below 1 Hz,
else (sample rate / 2) / half-period in Hz. Measured on ~3.1 M DL2 cells,
2026-11-03 (#50: the rate, not a fixed 512)."""
if halfp == 0:
return "N/A"
hz = half_period_to_hz(halfp, sample_rate)
if hz is None:
return f">{round(100 * sample_rate / 1024)}"
return "<1.0" if hz < 1.0 else hz
def _interval_size(seconds: int) -> str:
n, unit = (seconds // 60, "minute") if seconds % 60 == 0 else (seconds, "second")
return f"{n} {unit}{'' if n == 1 else 's'}"
def sfm_side(raw: bytes) -> SfmSide:
@@ -126,7 +55,6 @@ def sfm_side(raw: bytes) -> SfmSide:
# SFM's interval count is its decoded entry count; the reference
# carries this field for histograms only.
"NumberofIntervals": len(counts["Tran"]) or None,
"GeoRange": _GEO_FS_BY_RANGE.get(ev.geo_range),
}
if ts is not None:
date = f"{ts.year:04d}-{ts.month:02d}-{ts.day:02d}"
@@ -138,90 +66,18 @@ def sfm_side(raw: bytes) -> SfmSide:
if pv is not None:
values.update(TranPPV=pv.tran, VertPPV=pv.vert, LongPPV=pv.long,
PeakVectorSum=pv.peak_vector_sum)
# A waveform's peak detail (None on a histogram, so not reported).
for tag, value in (("TranTimeofPeak", pv.tran_time_of_peak),
("VertTimeofPeak", pv.vert_time_of_peak),
("LongTimeofPeak", pv.long_time_of_peak),
("MicLTimeofPeak", pv.micl_time_of_peak),
("PeakVectorSumTimeSum", pv.pvs_time),
("TranPeakAcceleration", pv.tran_peak_accel_g),
("VertPeakAcceleration", pv.vert_peak_accel_g),
("LongPeakAcceleration", pv.long_peak_accel_g),
("TranPeakDisplacement", pv.tran_peak_disp_in),
("VertPeakDisplacement", pv.vert_peak_disp_in),
("LongPeakDisplacement", pv.long_peak_disp_in)):
if value is not None:
values[tag] = value
# The unit's ZC frequency, every record type. Above range it is judged
# by its flag (_compare_scalar); below 1 Hz Blastware prints a word.
for tag, hz in (("TranZCFreq", pv.tran_zc_freq), ("VertZCFreq", pv.vert_zc_freq),
("LongZCFreq", pv.long_zc_freq), ("MicLZCFreq", pv.mic_zc_freq)):
if hz is not None:
values[tag] = "<1.0" if hz < 1.0 else hz
# Blastware's "Out of Range" line: on every DL2 event whose mic is over
# range, and on no other (18 / 18, 2026-11-09).
if pv is not None and pv.mic_over_range:
values["OORANGE"] = "Out of Range"
# The event's Monitor Log line, from the footer (2026-11-08).
if ev.monitor_log is not None:
ml = ev.monitor_log
values["MonitorLog"] = (f'{ml.start:%Y-%m-%d %H:%M:%S} - {ml.stop:%Y-%m-%d %H:%M:%S} '
f'"{ml.description}"')
# The unit's sensor check (2026-11-06), every record type.
for ch, r in (ev.sensor_check_results or {}).items():
values[f"{ch}TestResults"] = r.result
for tag, value in (("TestFreq", r.freq_hz), ("TestRatio", r.ratio),
("TestAmplitude", r.amplitude_mv)):
if value is not None:
values[f"{ch}{tag}"] = value
if counts["MicL"]:
values["MicLPSPL dB(L)"] = mic_count_to_db(max(abs(c) for c in counts["MicL"])
/ mic_count_divisor(ev.mic_range))
values["MicLPSPL dB(L)"] = mic_count_to_db(max(abs(c) for c in counts["MicL"]))
values["MicLPSPL psi(L)"] = pv.micl if pv is not None else None
values.update(_setup_values(ev))
if ev.stop_time is not None:
values.update(HistogramStopDate=ev.stop_time.strftime("%Y-%m-%d"),
HistogramStopTime=ev.stop_time.strftime("%H:%M:%S"))
if ev.histogram_interval_sec:
values["IntervalSize"] = _interval_size(ev.histogram_interval_sec)
interval_values: dict[str, list[object]] = {}
if ev.interval_half_periods and ev.sample_rate:
for ch, hps in ev.interval_half_periods.items():
interval_values[f"{ch} Freq Hz"] = [interval_frequency(h, ev.sample_rate) for h in hps]
if ev.interval_pvs:
# OORANGE when any geophone passes full scale in that interval: 16 / 16
# DL2 cells, and none of 2,862 without one (2026-11-09).
geo = [counts[c] for c in _GEO if counts.get(c)]
interval_values["Geo PVS in/s"] = [
"OORANGE" if any(i < len(g) and over_full_scale(g[i], "Tran") for g in geo) else v
for i, v in enumerate(ev.interval_pvs)]
times = None
n = len(counts["Tran"])
if ev.record_type == "Histogram" and ts is not None and ev.histogram_interval_sec and n:
start = datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second)
ends = interval_times(start, ev.histogram_interval_sec, ev.stop_time, n)
times = [t.strftime("%Y-%m-%d %H:%M:%S") for t in ends]
# A peak's date and time are those of the interval holding it (first).
for tag, series in (("TranPeak", counts["Tran"]), ("VertPeak", counts["Vert"]),
("LongPeak", counts["Long"]), ("MicL", counts["MicL"]),
("PeakVectorSum", ev.interval_pvs)):
if series and len(series) == n:
j = max(range(n), key=lambda q: abs(series[q]))
values[f"{tag}Date"] = ends[j].strftime("%Y-%m-%d")
values[f"{tag}Time"] = ends[j].strftime("%H:%M:%S")
return SfmSide(
event=ev,
values=values,
notes=[v for v in (pi.project, pi.client, pi.operator, pi.sensor_location) if v]
if pi is not None else [],
job_number=str(pi.job_number) if pi is not None and pi.job_number_enabled else None,
job_number=None,
channels=[ch for ch in _CHANNELS if counts[ch]],
counts=counts,
geo_ips_per_count=_GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) / _GEO_INT16_FS,
mic_divisor=mic_count_divisor(ev.mic_range),
interval_values=interval_values,
interval_times=times,
)
@@ -272,51 +128,22 @@ def _same_text(a: object, b: str) -> bool:
return " ".join(str(a).split()) == " ".join(b.split())
def _mic_table_units(ref: XmlReport) -> str:
"""The unit a report's mic sample table is printed in. Its cells say so --
a mic dB value is never under 60, psi never over 1 -- where the event's
Units line need not: S353JTHU.DT0W prints dB under psi (2026-11-09)."""
if ref.sample_rows and "MicL" in ref.channels:
i, seen = ref.channels.index("MicL"), False
for row in ref.sample_rows:
p = _printed_number(row[i]) if len(row) == len(ref.channels) else None
if p is not None:
if abs(p[0]) > 1.0:
return "dB(L)"
seen = True
if seen:
return "psi(L)"
return ref.event_units or ""
def _mic_converter(ref: XmlReport, sfm: SfmSide) -> Optional[Callable[[int], float]]:
units = _mic_table_units(ref)
d = sfm.mic_divisor
def _mic_converter(ref: XmlReport) -> Optional[Callable[[int], float]]:
units = ref.event_units or ""
if "dB(L)" in units:
return lambda c: mic_count_to_db(c / d)
return mic_count_to_db
if "psi(L)" in units:
return lambda c: c * _MIC_PSI_PER_COUNT / d
return lambda c: c * _MIC_PSI_PER_COUNT
return None
_OVER_RANGE = {"TranPPV": "tran_over_range", "VertPPV": "vert_over_range",
"LongPPV": "long_over_range", "PeakVectorSum": "pvs_over_range",
"MicLPSPL": "mic_over_range"}
def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> FieldResult:
if not printed.strip() or printed.strip() == "N/A":
return FieldResult(tag, "no_reference", printed, None)
if tag in ("MicLPSPL", "MicTriggerLevel"):
# A printed value that states its unit is compared in that unit:
# K441LA17.IN0W's Units say psi(L), its MicTriggerLevel "125.0 dB(L)".
# Else the field's own <Units>, then the event's line: 7 DL2 reports
# print the mic peak in dB under a psi line, 3 the reverse (2026-11-09).
own = ref.units.get(tag) or ""
units = (printed if ("dB(L)" in printed or "psi(L)" in printed)
else own if ("dB(L)" in own or "psi(L)" in own) else (ref.event_units or ""))
key = (f"{tag} dB(L)" if "dB(L)" in units else
f"{tag} psi(L)" if "psi(L)" in units else None)
if tag == "MicLPSPL":
units = ref.event_units or ""
key = ("MicLPSPL dB(L)" if "dB(L)" in units else
"MicLPSPL psi(L)" if "psi(L)" in units else None)
value = sfm.values.get(key) if key else None
else:
value = sfm.values.get(tag)
@@ -324,17 +151,10 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie
return FieldResult(tag, "sfm_blank", printed, None)
if printed.startswith(">"):
# ZC frequency above range: SFM agrees only by setting its flag.
ch = tag[:-len("ZCFreq")].lower()
flag = getattr(sfm.event.peak_values, ("mic" if ch == "micl" else ch) + "_zc_above_range", False)
flag = getattr(sfm.event.peak_values, tag[:-len("ZCFreq")].lower() + "_zc_above_range", False)
return FieldResult(tag, "match" if flag else "mismatch", printed, str(value))
# Over range: SFM agrees with Blastware's OORANGE only by setting its flag,
# and a flag against a printed number is a disagreement.
over = _OVER_RANGE.get(tag)
flagged = bool(over and getattr(sfm.event.peak_values, over, False))
if printed == "OORANGE" or flagged:
ok = printed == "OORANGE" and flagged
return FieldResult(tag, "match" if ok else "mismatch", printed,
"OORANGE" if flagged else _render(value, printed))
if printed == "OORANGE":
return FieldResult(tag, "mismatch", printed, str(value))
if isinstance(value, (int, float)) and not isinstance(value, bool) and _printed_number(printed):
ok = matches_printed(float(value), printed)
else:
@@ -342,11 +162,9 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie
return FieldResult(tag, "match" if ok else "mismatch", printed, _render(value, printed))
def _cell_diff(value: object, printed: str) -> Optional[float]:
def _cell_diff(value: float, printed: str) -> Optional[float]:
"""|value - printed| when the cell disagrees, else None; inf for a cell that
is not a number. A word on SFM's side (">100", "N/A") must be printed."""
if isinstance(value, str):
return None if _same_text(value, printed) else float("inf")
is not a number."""
p = _printed_number(printed)
if p is None:
return float("inf")
@@ -366,26 +184,23 @@ def _series_result(field: str, n_bw: int, n_sfm: int, diffs: list[tuple[int, flo
)
def _sample_converters(sfm: SfmSide, ref: XmlReport) -> dict[str, Callable[[int], float]]:
k = sfm.geo_ips_per_count
convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * k) for ch in _GEO}
mic = _mic_converter(ref, sfm)
def _sample_converters(ref: XmlReport) -> dict[str, Callable[[int], float]]:
convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * GEO_IPS_PER_COUNT) for ch in _GEO}
mic = _mic_converter(ref)
if mic is not None:
convert["MicL"] = mic
return convert
def _interval_converter(title: str, sfm: SfmSide) -> Optional[Callable[[int], float]]:
def _interval_converter(title: str) -> Optional[Callable[[int], float]]:
"""SFM keeps each interval's peaks; it drops their frequencies and geo PVS."""
ch, _, rest = title.partition(" ")
# A peak past full scale is Blastware's OORANGE, in an interval as in the event.
if rest.startswith("Peak") and ch in _GEO:
return lambda c: "OORANGE" if over_full_scale(c, ch) else c * sfm.geo_ips_per_count
d = sfm.mic_divisor
return lambda c: c * GEO_IPS_PER_COUNT
if ch == "MicL" and rest == "Peak dB(L)":
return lambda c: "OORANGE" if over_full_scale(c, ch) else mic_count_to_db(c / d)
return mic_count_to_db
if ch == "MicL" and rest == "Peak psi(L)":
return lambda c: "OORANGE" if over_full_scale(c, ch) else c * _MIC_PSI_PER_COUNT / d
return lambda c: c * _MIC_PSI_PER_COUNT
return None
@@ -400,7 +215,7 @@ def series_pairs(sfm: SfmSide, ref: XmlReport,
a row whose cell count differs is a disagreement for every channel."""
if field.startswith("samples."):
ch = field[len("samples."):]
convert = _sample_converters(sfm, ref).get(ch)
convert = _sample_converters(ref).get(ch)
counts = sfm.counts.get(ch, [])
if convert is None or not counts:
return None
@@ -417,19 +232,14 @@ def series_pairs(sfm: SfmSide, ref: XmlReport,
if field.startswith("intervals."):
title = field[len("intervals."):]
columns = ref.interval_columns or []
if title not in columns:
convert = _interval_converter(title)
counts = sfm.counts.get(title.partition(" ")[0], [])
if convert is None or not counts or title not in columns:
return None
i = columns.index(title)
cells = [row[i] if i < len(row) else "" for _, row in (ref.intervals or [])]
values = sfm.interval_values.get(title)
if values is None:
convert = _interval_converter(title, sfm)
counts = sfm.counts.get(title.partition(" ")[0], [])
if convert is None or not counts:
return None
values = [convert(c) for c in counts]
pairs = [(j, cell, v) for j, (cell, v) in enumerate(zip(cells, values))]
return pairs, abs(len(cells) - len(values))
pairs = [(j, cell, convert(c)) for j, (cell, c) in enumerate(zip(cells, counts))]
return pairs, abs(len(cells) - len(counts))
return None
@@ -439,9 +249,7 @@ def _compare_series(field: str, n_bw: int, sfm: SfmSide, ref: XmlReport) -> Fiel
return FieldResult(field, "sfm_blank", f"{n_bw} rows", None)
pairs, row_len = got
diffs = [(j, d) for j, cell, v in pairs if (d := _cell_diff(v, cell)) is not None]
title = field.split(".", 1)[1]
n_sfm = (len(sfm.interval_values[title]) if title in sfm.interval_values
else len(sfm.counts.get(title.partition(" ")[0], [])))
n_sfm = len(sfm.counts.get(field.split(".", 1)[1].partition(" ")[0], []))
return _series_result(field, n_bw, n_sfm, diffs, row_len)
@@ -452,21 +260,12 @@ def _compare_samples(sfm: SfmSide, ref: XmlReport) -> list[FieldResult]:
def _compare_intervals(sfm: SfmSide, ref: XmlReport) -> list[FieldResult]:
"""One result per column, plus the interval times."""
"""One result per column, plus the interval times, which SFM does not keep."""
n = len(ref.intervals or [])
return ([_compare_interval_times(sfm, ref, n)]
return ([FieldResult("intervals.Time", "sfm_blank", f"{n} rows", None)]
+ [_compare_series(f"intervals.{t}", n, sfm, ref) for t in ref.interval_columns or []])
def _compare_interval_times(sfm: SfmSide, ref: XmlReport, n: int) -> FieldResult:
if sfm.interval_times is None:
return FieldResult("intervals.Time", "sfm_blank", f"{n} rows", None)
diffs = [(j, float("inf")) for j, ((t, _), s) in enumerate(zip(ref.intervals or [], sfm.interval_times))
if not _same_text(s, t)]
return _series_result("intervals.Time", n, len(sfm.interval_times), diffs,
abs(n - len(sfm.interval_times)))
def compare(sfm: SfmSide, ref: XmlReport, carveouts: Sequence["Carveout"] = ()) -> list[FieldResult]:
"""Every field Blastware's report carries, set against what SFM produced.
A mismatch a carve-out covers and applies to becomes `accepted`."""
@@ -485,9 +284,6 @@ def compare(sfm: SfmSide, ref: XmlReport, carveouts: Sequence["Carveout"] = ())
if sfm.job_number is None else
FieldResult("JobNumber", "match" if _same_text(sfm.job_number, ref.job_number)
else "mismatch", ref.job_number, sfm.job_number))
elif sfm.job_number is not None:
# SFM says the job number is shown; Blastware printed none.
out.append(FieldResult("JobNumber", "mismatch", None, sfm.job_number))
out.append(FieldResult("Channels", "match" if ref.channels == sfm.channels else "mismatch",
" ".join(ref.channels), " ".join(sfm.channels)))
if ref.sample_rows is not None:
+6 -123
View File
@@ -17,10 +17,7 @@ from dataclasses import dataclass
from typing import Callable
from .bw_xml_report import XmlReport
from .decode_check import (FieldResult, SfmSide, _mic_table_units, _printed_number, series_pairs,
matches_printed)
from .event_file_io import _MIC_PSI_PER_COUNT
from .waveform_codec import mic_count_to_db
from .decode_check import FieldResult, SfmSide, _printed_number, series_pairs, matches_printed
@dataclass(frozen=True)
@@ -48,14 +45,6 @@ def _clamped(printed: str, r: float) -> bool:
return p is not None and abs(p[0]) >= r - _TOL
def _differs(v: object, cell: str) -> bool:
"""A cell SFM disagrees with. SFM's own word (its OORANGE, since
2026-11-09) agrees only when Blastware printed the same word."""
if isinstance(v, str):
return " ".join(v.split()) != " ".join(cell.split())
return not matches_printed(v, cell)
def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
try:
r = float(ref.scalars["GeoRange"])
@@ -79,23 +68,9 @@ def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
got = series_pairs(sfm, ref, res.field)
if got is None or got[1]:
return False
if res.field == "intervals.Geo PVS in/s":
# Per interval, as PeakVectorSum: an OORANGE vector sum, SFM's sum within
# three channels at the ceiling, and a channel Blastware itself clamped in
# that interval. 17 / 17 DL2 cells, SFM 10.01 .. 17.33 (2026-11-03).
cols = ref.interval_columns or []
peaks = [cols.index(c) for c in ("Tran Peak in/s", "Vert Peak in/s", "Long Peak in/s")
if c in cols]
rows = ref.intervals or []
differing = [(j, cell, v) for j, cell, v in got[0] if _differs(v, cell)]
return bool(differing) and all(
cell.strip() == "OORANGE" and not isinstance(v, str)
and r - _TOL <= v <= 3 ** 0.5 * r * 1.01
and any(_clamped(rows[j][1][p], r) for p in peaks if p < len(rows[j][1]))
for j, cell, v in differing)
differing = [(cell, v) for _, cell, v in got[0] if _differs(v, cell)]
differing = [(cell, v) for _, cell, v in got[0] if not matches_printed(v, cell)]
return bool(differing) and all(
not isinstance(v, str) and _clamped(cell, r) and _at_ceiling(v, r)
_clamped(cell, r) and _at_ceiling(v, r)
and (cell.strip() == "OORANGE" or (v >= 0) == (_printed_number(cell)[0] >= 0))
for cell, v in differing)
@@ -104,103 +79,11 @@ SATURATION = Carveout(
id="saturation",
fields=("TranPPV", "VertPPV", "LongPPV", "PeakVectorSum",
"samples.Tran", "samples.Vert", "samples.Long",
"intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s",
"intervals.Geo PVS in/s"),
"intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s"),
evidence=("Blastware clamps a clipped channel to the range maximum and prints OORANGE; "
"the file holds counts past full scale (32016 counts = 10.005 in/s observed). "
"scratch/verify_against_ascii.py, 2026-08-28. An interval's vector sum prints "
"OORANGE when it exceeds the range in an interval with a clamped channel: 17 / 17 "
"DL2 cells, 2026-11-03."),
"scratch/verify_against_ascii.py, 2026-08-28."),
applies=_saturation,
)
def _interval_count_is_duration(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
"""Blastware's count exceeds the intervals in its own table, and SFM decoded
exactly the table's."""
p = _printed_number(res.bw or "")
n = sfm.values.get("NumberofIntervals")
rows = len(ref.intervals or [])
return p is not None and n is not None and rows == n and p[0] > n
INTERVAL_COUNT_IS_DURATION = Carveout(
id="interval-count-is-duration",
fields=("NumberofIntervals",),
evidence=("Blastware's Number of Intervals is (stop - start) / interval from the file's "
"footer times -- exact on T193KSWP.FF0H (2,880), M462KSWR.1R0H (1,650) and "
"T193KY0A.740H (6,390). Its own interval table lists the intervals the file "
"holds: one block (30 at 2 s) fewer when the unit never wrote the last minute. "
"2026-11-02."),
applies=_interval_count_is_duration,
)
_MIC_UNITS = ("in/s and dB(L)", "in/s and psi(L)")
def _units_is_a_display_preference(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
"""Both sides say the event has a mic; they differ only in dB against psi."""
return (" ".join((res.bw or "").split()) in _MIC_UNITS
and sfm.values.get("Units") in _MIC_UNITS)
UNITS_IS_A_DISPLAY_PREFERENCE = Carveout(
id="units-is-a-display-preference",
fields=("Units",),
evidence=("dB(L) or psi(L) is Blastware's display preference on the PC when it wrote the "
"report, not the unit's: in report-write order (the _XML.XML mtimes) DL2's 70,034 "
"reports switch fleet-wide in 61 clean runs, every unit at once, and no byte or "
"bit of the event file separates the two (k-240 .. k+520, nor the 1.2 KB before "
"the footer). Instantel documents both settings: the unit's own Microphone "
"Units (MiniMate Plus manual 716U0101 Rev 15 §3.9.7: psi(L), dB(L) or Pa(L), "
"keypad Right Arrow + Setups) and Blastware's report preference (Blastware "
"manual 714U0301 Rev 22 §4, Preferences > Units and Channel: Show Mic in dB / "
"in Linear Units). 2026-11-03."),
applies=_units_is_a_display_preference,
)
def _other_mic_unit(sfm: SfmSide, units: str):
"""SFM's mic value in the unit the report did NOT say, as Blastware renders it."""
d = sfm.mic_divisor
if "dB(L)" in units:
return lambda c: c * _MIC_PSI_PER_COUNT / d
if "psi(L)" in units:
return lambda c: mic_count_to_db(c / d)
return None
def _mic_units_mixed(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
"""Every mic cell SFM disagrees with is SFM's own value in the other unit."""
counts = sfm.counts.get("MicL") or []
if res.field == "MicLPSPL":
own = ref.units.get("MicLPSPL") or ""
alt = _other_mic_unit(sfm, own if ("dB(L)" in own or "psi(L)" in own) else (ref.event_units or ""))
peak = max((abs(c) for c in counts), default=None)
return alt is not None and peak is not None and not _differs(alt(peak), res.bw or "")
got = series_pairs(sfm, ref, res.field)
# An interval column names its own unit; a sample table says it in its cells.
units = res.field if res.field.startswith("intervals.") else _mic_table_units(ref)
alt = _other_mic_unit(sfm, units)
if got is None or got[1] or alt is None:
return False
differing = [(j, cell) for j, cell, v in got[0] if _differs(v, cell)]
return bool(differing) and all(j < len(counts) and not _differs(alt(counts[j]), cell)
for j, cell in differing)
MIC_UNITS_MIXED = Carveout(
id="mic-units-mixed",
fields=("MicLPSPL", "samples.MicL", "intervals.MicL Peak psi(L)", "intervals.MicL Peak dB(L)"),
evidence=("Blastware's dB(L) / psi(L) labels do not hold for the mic on every report: 7 DL2 "
"reports print the mic peak in dB under a psi line, 3 the reverse, and some mix the "
"two inside one column -- K441L9IN.OT0W prints psi '0.000' / '-0.000' for counts of 1 "
"to 3 in a dB table, S353JTHU.DT0W psi rows then dB rows. On 19 DL2 events (14 "
"sample tables, 5 peaks) every mic cell SFM disagrees with is SFM's own value in the "
"other unit; a cell matching neither is still a mismatch. A histogram row can print "
"one unit in both its mic columns: I145HKWT.DY0H row 672 reads 95.92 under psi(L) "
"and dB(L) (count 5, dB), S353K894.OE0H rows 106 and 608 0.000 under both (count 2, "
"psi). 2026-11-09."),
applies=_mic_units_mixed,
)
CARVEOUTS: tuple[Carveout, ...] = (SATURATION, INTERVAL_COUNT_IS_DURATION,
UNITS_IS_A_DISPLAY_PREFERENCE, MIC_UNITS_MIXED)
CARVEOUTS: tuple[Carveout, ...] = (SATURATION,)
+71 -581
View File
@@ -19,21 +19,18 @@ import datetime
import hashlib
import json
import logging
import math
import os
import re
import struct
from pathlib import Path
from typing import Optional, Union
from .models import (DeviceInfo, Event, MonitorLogLine, PeakValues, ProjectInfo, SensorCheckResult,
Timestamp)
from .models import Event, PeakValues, ProjectInfo, Timestamp
from . import blastware_file as _bw # avoid circular reference at module load
from .bw_ascii_report import BwAsciiReport
from . import waveform_codec as _wc
from .waveform_codec import decode_waveform_v2, decoded_to_adc_counts
from .histogram_codec import (channels_from_records, decode_histogram_body, decode_histogram_body_full,
half_period_to_hz)
from .histogram_codec import decode_histogram_body, interval_pvs
# Reference pressure for dB(L) → psi conversion (20 µPa expressed in psi).
# Same constant as sfm/sfm_webapp.html so server-side and browser-side
@@ -54,7 +51,7 @@ SIDECAR_KIND = "sfm.event"
# bumped without a `pip install` re-run — leading to confusing stale
# version stamps in sidecars. Bump this constant and CHANGELOG.md
# together at release time.
TOOL_VERSION = "0.34.0" # file-only decode groups A-D, histogram times (#51); gates the backfill regen
TOOL_VERSION = "0.33.0" # setup + notes, record type, histogram PVS and mic from the file; gates the backfill regen
try:
# Best-effort: prefer the installed metadata when it's NEWER than the
@@ -707,11 +704,9 @@ _INT16_FS = 32768.0
# sfm.event_hdf5._GEO_INT16_FS or sidecar peaks disagree with the plotted
# waveform by 2.3%. Confirmed 2026-08-25 against the BW ASCII corpus.
_GEO_INT16_FS = 32000.0
# Full scale per geo_range: 0 Normal, 1 Sensitive.
_GEO_FS_BY_RANGE = {0: _GEO_NORMAL_FS_INS, 1: _GEO_SENSITIVE_FS_INS}
# A histogram's geo values are decoder units of 16 counts: 0.005 in/s at the
# Normal range, scaled by the range's full scale like the samples above.
_HIST_GEO_COUNTS_PER_UNIT = 16
# A histogram's geo values are in decoder units of 16 counts = 0.005 in/s at
# the Normal range (the same assumption as the samples above).
_HIST_GEO_UNIT_INS = 16 * _GEO_NORMAL_FS_INS / _GEO_INT16_FS
# Microphone scale factor, psi per MicL count: one count is 0.25 Pa
# (waveform_codec.MIC_PA_PER_COUNT, measured against Blastware's psi(L) on
@@ -719,15 +714,6 @@ _HIST_GEO_COUNTS_PER_UNIT = 16
# 0.0125 / 32768, that read every mic peak ~95x low (2026-10-31).
_PA_PER_PSI = 6894.757
_MIC_PSI_PER_COUNT = _wc.MIC_PA_PER_COUNT / _PA_PER_PSI
# The mic's own range byte (its channel block, label + 29, as the geophones'):
# at 1 each count is an eighth. Set on 7 DL2 events, all of them Blastware's
# values divided by 8, and on none of the other 70,026 (2026-11-09).
_MIC_COUNTS_PER_UNIT_BY_RANGE = {0: 1, 1: 8}
def mic_count_divisor(mic_range: Optional[int]) -> int:
"""How many of a mic's counts make one 0.25 Pa unit at its range."""
return _MIC_COUNTS_PER_UNIT_BY_RANGE.get(mic_range, 1)
def _decode_strt(strt: bytes) -> dict:
@@ -763,34 +749,31 @@ def _decode_samples_4ch_int16_le(stream: bytes) -> dict[str, list[int]]:
}
def _peaks_from_samples(samples: dict[str, list[int]],
geo_fs_ins: float = _GEO_NORMAL_FS_INS,
mic_divisor: int = 1) -> PeakValues:
def _peaks_from_samples(samples: dict[str, list[int]]) -> PeakValues:
"""
Compute peaks from raw int16 samples at the given geophone full scale
(Normal, 10 in/s, unless the file's range says otherwise). Used by the
BW-importer when the 0C waveform record (the device's authoritative peaks)
is unavailable.
Compute approximate peaks from raw int16 samples assuming Normal-range
geophone sensitivity. Used by the BW-importer when the 0C waveform
record (the device's authoritative peaks) is unavailable.
"""
def _peak_ins(ch: list[int]) -> float:
if not ch:
return 0.0
m = max(abs(int(v)) for v in ch)
return m / _GEO_INT16_FS * geo_fs_ins
return m / _GEO_INT16_FS * _GEO_NORMAL_FS_INS
tran = _peak_ins(samples.get("Tran", []))
vert = _peak_ins(samples.get("Vert", []))
long_ = _peak_ins(samples.get("Long", []))
# Mic in psi: one count = 0.25 Pa, an eighth of that on a range-1 mic
# Mic in psi: one count = 0.25 Pa
mic_ch = samples.get("MicL", []) or []
mic = max((abs(int(v)) for v in mic_ch), default=0) * _MIC_PSI_PER_COUNT / mic_divisor
mic = max((abs(int(v)) for v in mic_ch), default=0) * _MIC_PSI_PER_COUNT
# Peak vector sum: max over time of sqrt(T^2 + V^2 + L^2)
pvs = 0.0
n = min(len(samples.get("Tran", [])), len(samples.get("Vert", [])), len(samples.get("Long", [])))
if n:
scale = geo_fs_ins / _GEO_INT16_FS
scale = _GEO_NORMAL_FS_INS / _GEO_INT16_FS
T = samples["Tran"]; V = samples["Vert"]; L = samples["Long"]
for i in range(n):
t = T[i] * scale
@@ -806,92 +789,6 @@ def _peaks_from_samples(samples: dict[str, list[int]],
)
# Blastware's g for peak acceleration, fitted: every printed acceleration in
# DL2 bounds it, and together they leave [386.2236, 386.2240] in/s^2 -- 19,475 /
# 19,479 values fit (the other 4: one odd file, O117I1NK.R70W, and one sample
# mismatch). That is 9.81 m/s^2 (386.2205) plus an offset not explained, as
# with the mic's fitted dB offset; 9.81 gives 19,423, the standard 9.80665 gives
# 17,806 (2026-11-04).
_ACCEL_IPS2_PER_G = 386.2238
def _waveform_peak_detail(pv: PeakValues, samples: dict[str, list[int]], geo_fs_ins: float,
sample_rate: int, pretrig: int) -> None:
"""A waveform's time of peak per channel, the vector sum's time and each
geophone's peak acceleration, on `pv`. Measured on 400 DL2 waveforms
(2026-11-04):
* time of peak = (first peak sample - pre-trigger samples) / sample rate,
1,197 / 1,197; the vector-sum time is the same on sqrt(T^2 + V^2 + L^2),
398 / 399
* peak acceleration = the largest |v[i+1] - v[i]| x sample rate / g,
with Blastware's fitted g -- the manuals: "subtracts two velocity
readings and divides the result by the elapsed time between them"."""
scale = geo_fs_ins / _GEO_INT16_FS
geo = {}
for ch in ("Tran", "Vert", "Long", "MicL"):
c = samples.get(ch) or []
if not c:
continue
i = max(range(len(c)), key=lambda k: abs(c[k]))
setattr(pv, f"{ch.lower()}_time_of_peak", (i - pretrig) / sample_rate)
if ch != "MicL":
geo[ch] = c
step = max((abs(c[k + 1] - c[k]) for k in range(len(c) - 1)), default=0)
setattr(pv, f"{ch.lower()}_peak_accel_g", step * scale * sample_rate / _ACCEL_IPS2_PER_G)
if len(geo) == 3:
n = min(len(c) for c in geo.values())
t, v, l = geo["Tran"], geo["Vert"], geo["Long"]
j = max(range(n), key=lambda k: t[k] * t[k] + v[k] * v[k] + l[k] * l[k])
pv.pvs_time = (j - pretrig) / sample_rate
def _zc_from_half_period(halfp: int, sample_rate: int) -> tuple[Optional[float], bool]:
"""(ZC frequency, above range) as Blastware reports it: None for a
half-period of 0 ("N/A"); Blastware's threshold, flagged, at 5 samples or
fewer (">100", ">200" at 2048 sps); else (rate / 2) / half-period, which
Blastware prints as "<1.0" below 1 Hz."""
if halfp == 0:
return None, False
hz = half_period_to_hz(halfp, sample_rate)
if hz is None:
return 100.0 * sample_rate / 1024, True
return hz, False
def _apply_unit_summary(pv: PeakValues, summary: dict, geo_fs_ins: float, sample_rate: int,
pretrig: Optional[int]) -> None:
"""The unit's own values from its event summary, on `pv`. Blastware prints
them as they are (DL2, 2026-11-05):
* ZC frequency, every record type: 15,844 / 15,844 waveform and
104,000 / 104,000 histogram values, and every word
* a waveform's peak displacement = half its integral: 19,479 / 19,479
* a waveform's times of peak and vector-sum time, from the unit's peak
samples (`pretrig` given): they replace the samples' own, which differ
only where the stored samples wrap (O117I1NK.R70W)
* over range, every record type: a channel whose peak passes full scale,
and the vector sum when any geophone does -- Blastware's OORANGE on all
43 such events, and on none of the 38 whose vector sum alone passes
the range (2026-11-09)."""
# The summary's geophone values are decoder units, as a histogram's are.
unit_ins = _HIST_GEO_COUNTS_PER_UNIT * geo_fs_ins / _GEO_INT16_FS
for ch, attr in (("Tran", "tran"), ("Vert", "vert"), ("Long", "long"), ("MicL", "mic")):
c = summary.get(ch)
if c is None:
continue
hz, above = _zc_from_half_period(c["half_period"], sample_rate)
setattr(pv, f"{attr}_zc_freq", hz)
setattr(pv, f"{attr}_zc_above_range", above)
setattr(pv, f"{attr}_over_range", max(abs(c["min"]), abs(c["max"])) > _SUMMARY_FULL_SCALE)
if pretrig is None:
continue
setattr(pv, f"{ch.lower()}_time_of_peak", (c["peak_sample"] - pretrig) / sample_rate)
if ch != "MicL":
setattr(pv, f"{attr}_peak_disp_in", c["disp_integral"] * unit_ins / sample_rate / 2)
pv.pvs_over_range = pv.tran_over_range or pv.vert_over_range or pv.long_over_range
if pretrig is not None and all(ch in summary for ch in ("Tran", "Vert", "Long")):
pv.pvs_time = (summary["pvs_sample"] - pretrig) / sample_rate
# STRT[18], the record-type byte (#41): 0x46 on every one of DL2's 6,577
# waveform files and 0x0A on every one of its 63,535 histograms (measured
# 2026-10-29). Manual / Event / Combo never occur there, so their bytes are
@@ -961,7 +858,6 @@ _RECTIME_OFFSET_BEFORE_MARKER = 30
# 2026-10-29). Offsets are from the first byte of the name.
_SETUP_NAME_RE = re.compile(rb"\x1c\x08([\x20-\x7e]{1,40})\x00")
_SAMPLE_RATE_BEFORE_NAME = 42 # uint16 BE, samples per second
_INTERVAL_BEFORE_NAME = 40 # uint16 BE, histogram interval in seconds (2 / 5 / 15 / 60 / 300)
_PRETRIG_BEFORE_NAME = 36 # float32 BE, seconds, negative (-0.25, -0.0625 ...)
_RECTIME_BEFORE_NAME = 30 # float32 BE, seconds (the marker's offset above)
_SAMPLE_RATES = (1024, 2048, 4096)
@@ -995,23 +891,17 @@ def _ts8(b: bytes) -> Optional[datetime.datetime]:
def _embedded_event_record(
raw: bytes, end: int, start: Optional[datetime.datetime],
stop: Optional[datetime.datetime], record_time: Optional[float],
) -> tuple[Optional[datetime.datetime], str, Optional[int], Optional[int]]:
"""The trigger time, the trigger source and the offset of the record's
`fe 80` from the instrument's embedded event record, or (None, why, None,
None).
) -> tuple[Optional[datetime.datetime], str]:
"""The trigger time from the instrument's embedded event record, or (None, why).
Every `fe 80` before `end` (the footer) is a candidate. One counts only if
its lead bytes match, both its times are well formed, the footer's session
start <= trigger <= its stop, its stop is the footer's stop or a second
before it, and its length agrees with the record time. Exactly one may
pass: none, or more than one, is reported rather than guessed between.
The two bytes between the lead and `fe 80` are the trigger source, a uint16
BE bitmask: 0x01 Tran, 0x02 Vert, 0x04 Long, 0x08 MicL, 0x200 Manual --
Blastware's Trigger on 6,493 / 6,493 DL2 waveforms (2026-11-03).
"""
if start is None or stop is None:
return None, "the footer has no start and stop to check one against", None, None
return None, "the footer has no start and stop to check one against"
found, rejected = [], 0
i = raw.find(_EVENT_RECORD_MARKER, 6)
while 0 <= i and i + 18 <= end:
@@ -1027,203 +917,15 @@ def _embedded_event_record(
<= _EVENT_RECORD_SLACK_S[1])
)
if valid:
found.append((trig, int.from_bytes(raw[i - 2:i], "big"), i))
found.append(trig)
else:
rejected += 1
i = raw.find(_EVENT_RECORD_MARKER, i + 1)
if len(found) == 1:
return found[0][0], "", found[0][1], found[0][2]
return found[0], ""
if found:
return None, f"{len(found)} candidates validate", None, None
return None, (f"{rejected} candidate(s), none valid" if rejected else "no candidate"), None, None
# A histogram's event record: the same lead, the source 0x0400, marker fe f5,
# then its start and stop -- Blastware's Histogram Start / Stop on 63,490 /
# 63,490 DL2 histograms. On all 63,500 its start is 0 or 1 s after the footer's
# start and its stop 0 or 1 s before the footer's stop (2026-11-03).
_HISTOGRAM_RECORD_MARKER = b"\xfe\xf5"
_HISTOGRAM_RECORD_SOURCE = b"\x04\x00"
def interval_times(start: datetime.datetime, interval_sec: int,
stop: Optional[datetime.datetime], n: int) -> list[datetime.datetime]:
"""Each histogram interval's time as Blastware prints it: the interval's
end, start + (i + 1) x interval, capped at the stop. 2,308,524 / 2,308,524
DL2 rows; and an event's peak date and time are its interval's (2026-11-03)."""
out = []
for i in range(n):
t = start + datetime.timedelta(seconds=interval_sec * (i + 1))
out.append(min(t, stop) if stop is not None else t)
return out
def _histogram_event_record(
raw: bytes, end: int, start: Optional[datetime.datetime],
stop: Optional[datetime.datetime],
) -> tuple[Optional[datetime.datetime], Optional[datetime.datetime], str, Optional[int]]:
"""(start, stop, "", offset of its `fe f5`) from a histogram's own event
record, or (None, None, why, None). Exactly one record may validate against
the footer's start and stop."""
if start is None or stop is None:
return None, None, "the footer has no start and stop to check one against", None
found, rejected = [], 0
i = raw.find(_HISTOGRAM_RECORD_MARKER, 6)
while 0 <= i and i + 18 <= end:
a, b = _ts8(raw[i + 2:i + 10]), _ts8(raw[i + 10:i + 18])
if (raw[i - 6:i - 2] == _EVENT_RECORD_LEAD and raw[i - 2:i] == _HISTOGRAM_RECORD_SOURCE
and a is not None and b is not None and a <= b
and 0 <= (a - start).total_seconds() <= 1
and 0 <= (stop - b).total_seconds() <= 1):
found.append((a, b, i))
elif raw[i - 6:i - 2] == _EVENT_RECORD_LEAD:
rejected += 1
i = raw.find(_HISTOGRAM_RECORD_MARKER, i + 1)
if len(found) == 1:
return found[0][0], found[0][1], "", found[0][2]
if found:
return None, None, f"{len(found)} candidates validate", None
return None, None, (f"{rejected} candidate(s), none valid" if rejected else "no candidate"), None
# The event record is the first of a chain of [length uint16 BE][id][payload]
# records, the next starting `length` + 2 bytes after a record's lead (measured
# on all 70,041 DL2 files, 2026-11-06): the event record 0x05, the unit's
# summary 0x32-0x35, its sensor checks 0x3c-0x3f, then the footer 0x0e -- the
# file's last 26 bytes. A unit without a mic has no 0x35 or 0x3f (8 files).
# The walk ends exactly at the file's end on every one, so a chain that does
# not is not read at all.
_RECORD_LEAD_TO_MARKER = 6 # the lead `00 28 05 00` and the source sit before the marker
def _record_chain(raw: bytes, marker_at: int) -> Optional[dict[int, bytes]]:
"""Each record's payload by id (the first of each), for the chain that
starts with the validated event record whose marker is at `marker_at`; None
unless the chain ends exactly at the end of the file."""
off = marker_at - _RECORD_LEAD_TO_MARKER
out: dict[int, bytes] = {}
while off < len(raw):
ln = int.from_bytes(raw[off:off + 2], "big")
if off + 3 > len(raw) or ln < 1 or off + 2 + ln > len(raw):
return None
out.setdefault(raw[off + 2], raw[off + 3:off + 2 + ln])
off += 2 + ln
return out
# The unit's own event summary (measured on DL2, 2026-11-05). The event
# record's payload holds the vector-sum peak's sample at [25:29] (its marker
# + 22). Then one record per channel, 22 bytes (ids 0x32 Tran .. 0x35 MicL):
# [0] 0 [1:3] min [3:5] max (int16 BE; geophones in units of 16 counts)
# [5:9] peak sample [9:11] half-period, samples [11:15] displacement
# integral, units x samples [15:21] probably the unit's own largest sample step
# x 65,536 (inferred), which Blastware does not print: its acceleration is its own
# computation from the samples (_waveform_peak_detail)
# min, max and peak sample equal the samples' own on 25,962 / 25,966 DL2
# channels (the 4 others: O117I1NK.R70W, whose samples wrap at the trigger).
_EVENT_RECORD_ID = 0x05
_SUMMARY_PVS_SAMPLE = slice(25, 29)
_SUMMARY_CHANNELS = {0x32: "Tran", 0x33: "Vert", 0x34: "Long", 0x35: "MicL"}
_SUMMARY_CHANNEL_LEN = 21 # the payload; the record is 22 with its id
# Full scale in the summary's units: 2,000 x 16 = 32,000 counts on either
# geophone range, and 2,000 counts on the mic. A peak past it is Blastware's
# OORANGE: numeric up to 1,991 / 1,933, OORANGE from 2,001 (DL2, 2026-11-09).
_SUMMARY_FULL_SCALE = 2000
def over_full_scale(count: int, channel: str) -> bool:
"""Whether a decoded peak passes full scale: Blastware's OORANGE. A geophone
count is in ADC counts (16 to the unit), the mic's in its own. The same rule
holds inside a histogram's intervals: numeric up to 1,846 / 1,414, OORANGE
from 2,001 (DL2, 2026-11-09)."""
per_unit = 1 if channel == "MicL" else _HIST_GEO_COUNTS_PER_UNIT
return abs(count) > _SUMMARY_FULL_SCALE * per_unit
def _unit_summary(chain: dict[int, bytes]) -> Optional[dict]:
"""The unit's per-channel event summary from a record chain:
{"pvs_sample": int, "Tran": {...}, ...}, each channel {"min", "max",
"peak_sample", "half_period", "disp_integral"}. None when the chain has no
channel record."""
out: dict = {"pvs_sample": int.from_bytes(chain.get(_EVENT_RECORD_ID, b"")[_SUMMARY_PVS_SAMPLE], "big")}
for rid, ch in _SUMMARY_CHANNELS.items():
p = chain.get(rid)
if p is None or len(p) != _SUMMARY_CHANNEL_LEN:
continue
out[ch] = {
"min": struct.unpack(">h", p[1:3])[0],
"max": struct.unpack(">h", p[3:5])[0],
"peak_sample": int.from_bytes(p[5:9], "big"),
"half_period": int.from_bytes(p[9:11], "big"),
"disp_integral": int.from_bytes(p[11:15], "big"),
}
return out if len(out) > 1 else None
# The sensor check's results, in the header of each sensor-check record (ids
# 0x3c Tran .. 0x3f MicL, whose traces minimateplus.sensor_check decodes).
# Payload: [2] channel type (1 geophone, 2 mic, 0 the check disabled) [4] status,
# 0 = passed [5:7] frequency x 10 [7:9] ratio x 10 [9:11] amplitude, mV.
# Blastware prints them as they are (DL2, 2026-11-06): 209,943 / 209,943
# geophone frequencies and ratios, 69,975 / 69,975 mic frequencies and
# amplitudes; "Passed" on status 0 and "Check" on every other (1 .. 15: its bits
# are not decoded), "Disabled", with nothing else, on type 0.
_SENSOR_CHECK_CHANNELS = {0x3c: "Tran", 0x3d: "Vert", 0x3e: "Long", 0x3f: "MicL"}
_SENSOR_CHECK_HEADER_LEN = 11
def _sensor_check_results(chain: dict[int, bytes]) -> Optional[dict[str, SensorCheckResult]]:
out: dict[str, SensorCheckResult] = {}
for rid, ch in _SENSOR_CHECK_CHANNELS.items():
p = chain.get(rid)
if p is None or len(p) < _SENSOR_CHECK_HEADER_LEN:
continue
kind, status = p[2], p[4]
if kind == 0:
out[ch] = SensorCheckResult("Disabled", status)
continue
r = SensorCheckResult("Passed" if status == 0 else "Check", status,
freq_hz=int.from_bytes(p[5:7], "big") / 10)
if ch == "MicL":
r.amplitude_mv = int.from_bytes(p[9:11], "big")
else:
r.ratio = int.from_bytes(p[7:9], "big") / 10
out[ch] = r
return out or None
# The Monitor Log line Blastware prints for an event is the footer's start and
# stop, then words for the footer's flag word [18:20]: 69,983 / 69,983 DL2
# lines, character for character (2026-11-08). Every DL2 line has "Event
# Recorded"; a session that ended adds how. One line sets Modem and Timer and
# prints Modem, so the higher bit wins -- the order of the others is inferred.
_MONITOR_LOG_RECORDED = 0x0001
_MONITOR_LOG_ENDS = { # highest bit first
0x0800: "Memory Full Exit",
0x0200: "Battery Low Exit",
0x0020: "Modem Exit",
0x0010: "Timer Stop",
0x0008: "Selfcheck Passed",
0x0004: "Remote Exit",
0x0002: "Keyboard Exit",
}
_FOOTER_ID = 0x0E
_FOOTER_LEN = 26
def monitor_log_description(flags: int) -> str:
"""Blastware's Monitor Log words for a footer flag word."""
words = "Event Recorded " if flags & _MONITOR_LOG_RECORDED else ""
end = next((w for bit, w in _MONITOR_LOG_ENDS.items() if flags & bit), None)
return words + (" " + end if end else "")
def _monitor_log(footer: bytes) -> Optional[MonitorLogLine]:
start, stop = _bw._decode_ts_be(footer[2:10]), _bw._decode_ts_be(footer[10:18])
if start is None or stop is None:
return None
flags = int.from_bytes(footer[18:20], "big")
return MonitorLogLine(start, stop, flags, monitor_log_description(flags))
return None, f"{len(found)} candidates validate"
return None, (f"{rejected} candidate(s), none valid" if rejected else "no candidate")
def _parse_record_time_seconds(raw: bytes) -> Optional[float]:
@@ -1290,133 +992,8 @@ def _setup_notes(raw: bytes) -> ProjectInfo:
text = [p.decode("ascii", errors="replace").strip() or None for p in parts]
text += [None] * (2 + 2 * _NOTE_SLOTS - len(text))
project, client, operator, location = text[2:2 + 2 * _NOTE_SLOTS:2]
enabled, number = _setup_job_number(raw, k)
return ProjectInfo(setup_name=text[0], project=project, client=client,
operator=operator, sensor_location=location,
job_number_enabled=enabled, job_number=number)
# The job number, in Series IV's 0x1A layout ([39] report flags, [40:42] the
# number): flags at k - 9, bit 0x02 = shown; the number, uint16 BE, at k - 8,
# kept while switched off. The flag matches Blastware's JobNumber on 2,997 /
# 2,997 DL2 events that print one and 66,986 / 66,986 that don't, and every
# printed value matches (all are 1; measured 2026-11-02).
_REPORT_FLAGS_BEFORE_NAME = 9
_JOB_NUMBER_BEFORE_NAME = 8
_JOB_NUMBER_ON = 0x02
def _setup_job_number(raw: bytes, k: int) -> tuple[Optional[bool], Optional[int]]:
"""(shown, number) from the setup block whose name starts at k."""
if k < _REPORT_FLAGS_BEFORE_NAME:
return None, None
flags = raw[k - _REPORT_FLAGS_BEFORE_NAME]
j = k - _JOB_NUMBER_BEFORE_NAME
return bool(flags & _JOB_NUMBER_ON), int.from_bytes(raw[j:j + 2], "big")
# The geophone range sits in the setup's channel blocks, which follow the
# notes: the byte 29 after each geophone label (`00 00 01 Tran ...`). 0x00 is
# Normal, 0x01 Sensitive -- Blastware's GeoRange on 70,042 / 70,042 DL2 events,
# all three channels agreeing on every one (measured 2026-11-01). SFM's live
# 1A read has the same byte at label+33.
_RANGE_AFTER_LABEL = 29
_CHANNEL_BLOCK_SPAN = 2000 # how far past the setup name the blocks may sit
def _setup_geo_range(raw: bytes) -> tuple[Optional[int], Optional[str]]:
"""(geo_range, problem): 0 Normal or 1 Sensitive when all three geophone
channels say the same, else None and why."""
k = _setup_name_at(raw)
if k is None:
return None, "no recording-setup block to read the geophone range from"
found = {}
for label in (b"Tran", b"Vert", b"Long"):
i = raw.find(b"\x00\x00\x01" + label, k, k + _CHANNEL_BLOCK_SPAN)
p = i + 3 + _RANGE_AFTER_LABEL
found[label.decode()] = raw[p] if i >= 0 and p < len(raw) else None
values = set(found.values())
if len(values) == 1 and values <= {0, 1}:
return values.pop(), None
return None, f"geophone range not read: channel range bytes {found}"
# The identity block before the setup: what the live read gets from SUB FE
# (DeviceInfo). Offsets back from k, the setup name; matched against every DL2
# report 2026-11-03 -- serial, version and calibration 69,983 / 69,983, the
# battery 69,729 plus 254 that Blastware rounds half up (6.25 -> "6.3 Volts").
_SERIAL_BEFORE_NAME = 202 # ASCII, NUL-terminated
_BATTERY_BEFORE_NAME = 190 # uint16 BE, hundredths of a volt
_FIRMWARE_MINOR_BEFORE_NAME = 193 # 0x11 = 17 for S338.17, as SUB EA
_FIRMWARE_BEFORE_NAME = 147 # "S338.17"
_DSP_BEFORE_NAME = 138 # "10.72"
_CALIBRATION_BEFORE_NAME = 132 # dd mm yyyy (BE)
_CALIBRATED_BY_BEFORE_NAME = 128 # "Instantel"
_MANUFACTURER_BEFORE_NAME = 94 # "Instantel"
_MODEL_BEFORE_NAME = 72 # "MiniMate Plus" / "BlastMate III"
def _cstr(raw: bytes, i: int, limit: int = 40) -> Optional[str]:
if i < 0:
return None
j = raw.find(b"\x00", i, i + limit)
s = raw[i:j if j >= 0 else i + limit].decode("ascii", errors="replace").strip()
return s or None
def _setup_identity(raw: bytes, k: int) -> tuple[Optional[DeviceInfo], Optional[float]]:
"""(the unit's identity, the battery in volts) from the block before the
setup name at k."""
if k < _SERIAL_BEFORE_NAME:
return None, None
serial = _cstr(raw, k - _SERIAL_BEFORE_NAME, 16)
if not serial:
return None, None
c = k - _CALIBRATION_BEFORE_NAME
try:
cal = datetime.date(int.from_bytes(raw[c + 2:c + 4], "big"), raw[c + 1], raw[c])
except ValueError:
cal = None
info = DeviceInfo(
serial=serial,
firmware_minor=raw[k - _FIRMWARE_MINOR_BEFORE_NAME],
firmware_version=_cstr(raw, k - _FIRMWARE_BEFORE_NAME, 9),
dsp_version=_cstr(raw, k - _DSP_BEFORE_NAME, 6),
manufacturer=_cstr(raw, k - _MANUFACTURER_BEFORE_NAME),
model=_cstr(raw, k - _MODEL_BEFORE_NAME),
calibration_date=cal,
calibrated_by=_cstr(raw, k - _CALIBRATED_BY_BEFORE_NAME, 32),
)
b = k - _BATTERY_BEFORE_NAME
return info, int.from_bytes(raw[b:b + 2], "big") / 100
# Trigger settings, in Series IV's 0x1A layout again: the trigger-source bitmask
# at k - 19 ([29]: 0x07 geophones, 0x08 mic), the stop mode at k - 31 ([17],
# 0 = Fixed), and each channel block's trigger level, a float32 at label + 30 --
# in/s for a geophone, psi for the mic. The mic block's type code at label + 4
# is Series IV's (2 = linear). Against every DL2 waveform (2026-11-03): the geo
# level 6,447 / 6,447, the mic level 4,403 / 4,403, and Blastware prints a level
# exactly when its channel is a trigger source and the event was not Manual.
_TRIGGER_SOURCES_BEFORE_NAME = 19
_STOP_MODE_BEFORE_NAME = 31
_TRIGGER_LEVEL_AFTER_LABEL = 30
_MIC_TYPE_AFTER_LABEL = 4
def _setup_trigger(raw: bytes, k: int) -> dict:
out = {"trigger_sources": raw[k - _TRIGGER_SOURCES_BEFORE_NAME],
"record_stop_mode": raw[k - _STOP_MODE_BEFORE_NAME]}
t = raw.find(b"\x00\x00\x01Tran", k, k + _CHANNEL_BLOCK_SPAN)
if t >= 0:
p = t + 3 + _TRIGGER_LEVEL_AFTER_LABEL
out["trigger_level_geo"] = struct.unpack_from(">f", raw, p)[0]
m = raw.find(b"MicL", k, k + _CHANNEL_BLOCK_SPAN)
if m >= 0:
out["trigger_level_mic_psi"] = struct.unpack_from(">f", raw, m + _TRIGGER_LEVEL_AFTER_LABEL)[0]
out["mic_type"] = int.from_bytes(raw[m + _MIC_TYPE_AFTER_LABEL:m + _MIC_TYPE_AFTER_LABEL + 4], "big")
out["mic_range"] = raw[m + _RANGE_AFTER_LABEL]
return out
operator=operator, sensor_location=location)
def read_blastware_file(path: Union[str, Path], *, name: Optional[str] = None) -> Event:
@@ -1470,34 +1047,22 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
# Footer: locate the 0e 08 marker, validating the year is in a sane range.
body_start = _bw._WAVEFORM_HEADER_SIZE + 21
# The footer is the file's last 26 bytes whenever they are one -- 0e 08 and
# two valid times: 70,041 / 70,041 DL2 files (measured 2026-11-03). Taking
# the first "0e 08 + plausible year" instead found, on 14 of them, an
# earlier record ~1.1 KB before the end holding the stop time and zeros: a
# histogram then started at its own stop (a day late on BE9558's daily
# histograms) and a waveform lost its stop, so its trigger time too.
#
# Otherwise the search below stands. The signature can occur inside the
# sample stream, so it prefers the first candidate whose body yields a
# waveform record chain terminating on the 0x06 marker, then the first
# candidate (2026-08-25: BE17353/S353L4O5.OX0W, false positive at 3800,
# real footer at 8576).
end = len(raw) - 26
if (end >= body_start and raw[end:end + 2] == b"\x0e\x08"
and _bw._decode_ts_be(raw[end + 2:end + 10]) is not None
and _bw._decode_ts_be(raw[end + 10:end + 18]) is not None):
footer_candidates = [end]
else:
footer_candidates = []
pos = body_start
while True:
pos = raw.find(b"\x0e\x08", pos)
if pos < 0 or pos + 26 > len(raw):
break
yr = (raw[pos + 4] << 8) | raw[pos + 5]
if 2015 <= yr <= 2050:
footer_candidates.append(pos)
pos += 1
# The 0e 08 + plausible-year footer signature can occur inside the sample
# stream. Collect every candidate and prefer the first whose body yields a
# waveform record chain terminating on the 0x06 marker; fall back to the
# first candidate otherwise. Blast radius measured 2026-08-25: changes the
# chosen footer on exactly 1 of 1,388 series-3 waveform files
# (BE17353/S353L4O5.OX0W, false positive at 3800, real footer at 8576).
footer_candidates = []
pos = body_start
while True:
pos = raw.find(b"\x0e\x08", pos)
if pos < 0 or pos + 26 > len(raw):
break
yr = (raw[pos + 4] << 8) | raw[pos + 5]
if 2015 <= yr <= 2050:
footer_candidates.append(pos)
pos += 1
footer_pos = -1
for cand in footer_candidates:
@@ -1522,14 +1087,12 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
body = raw[body_start : footer_pos]
footer = raw[footer_pos : footer_pos + 26]
# Footer layout (the record chain's last record, id 0e: D.6.13):
# Footer layout:
# [0:2] 0e 08 marker
# [2:10] ts1 (start) BE 8B
# [10:18] ts2 (stop) BE 8B
# [18:20] the monitor log's flag word (_monitor_log)
# [20:22] the trigger source, as in the event record [22:24] 00 00
# [24:26] CRC-16/AUG-CCITT, BE, over the record's length prefix `00 1a`
# and [0:22]: 70,041 / 70,041 DL2 files (2026-11-11)
# [18:24] 00 01 00 02 00 00
# [24:26] crc
ts1 = _bw._decode_ts_be(footer[2:10])
ts2 = _bw._decode_ts_be(footer[10:18])
@@ -1556,40 +1119,18 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
# mode, synthetic test input), fall back to empty channels — the
# rest of the event (timestamp, waveform_key, project strings) is
# still recoverable and useful.
#
# The record type comes from the bytes: STRT[18] (#41), 0x46 / 0x0A on
# 70,041 / 70,041 DL2 files. It picks the codec. Trying the waveform codec
# first handed it BE9440 / BE9557 / BE17354's 2018 5 s histograms, which it
# accepted and returned ~5x too many "samples" for. Only an unknown type
# falls back to the old trial order. The filename's last letter is only a
# cross-check -- SFM's own downloads have no name, and a manual download's
# (".QZ0") carries no type at all.
type_byte = strt_raw[18]
record_type = _RECORD_TYPE_BY_STRT.get(type_byte)
problems = []
if record_type is None:
problems.append(f"unknown record type byte 0x{type_byte:02x} at STRT[18]")
hist_records = None
if record_type == "Histogram":
hist_records = decode_histogram_body_full(body)
decoded = channels_from_records(hist_records)
is_waveform_body = False
elif record_type == "Waveform":
decoded = decode_waveform_v2(body)
is_waveform_body = True
else:
decoded = decode_waveform_v2(body)
is_waveform_body = decoded is not None
if decoded is None:
hist_records = decode_histogram_body_full(body)
decoded = channels_from_records(hist_records)
decoded = decode_waveform_v2(body)
# Discriminator for the timestamp logic below: a waveform (trigger) event
# vs a histogram window. Keyed on the codec, not the filename — the
# save_imported_bw path passes a tmp ".bw" name whose extension lies.
is_waveform_body = decoded is not None
if decoded is None:
decoded = decode_histogram_body(body)
if decoded is None:
log.warning(
"%s: body codec failed to decode (body starts %s) — "
"raw_samples will be empty", label, body[:8].hex(" "),
)
if record_type is not None:
problems.append(f"the {record_type.lower()} codec could not decode the body")
samples = {"Tran": [], "Vert": [], "Long": [], "MicL": []}
else:
samples = decoded_to_adc_counts(decoded)
@@ -1598,8 +1139,13 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
ev = Event(index=-1)
if strt_fields.get("waveform_key"):
ev._waveform_key = bytes.fromhex(strt_fields["waveform_key"])
ev.record_type = record_type
ev.decode_problems.extend(problems)
# The record type comes from the bytes: STRT[18] (#41). The filename's
# last letter is only a cross-check -- SFM's own downloads have no name,
# and a manual download's (".QZ0") carries no type at all.
type_byte = strt_raw[18]
ev.record_type = _RECORD_TYPE_BY_STRT.get(type_byte)
if ev.record_type is None:
ev.decode_problems.append(f"unknown record type byte 0x{type_byte:02x} at STRT[18]")
named_type = derive_record_type_from_filename(name, default=None) if name else None
if named_type is not None and ev.record_type is not None and named_type != ev.record_type:
log.warning("%s: record type %s from the file disagrees with the filename's %s; "
@@ -1610,14 +1156,6 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
# every waveform used to read "70 s". A histogram has no record time or
# pre-trigger -- Blastware reports neither.
ev.sample_rate = _setup_sample_rate(raw)
ev.geo_range, range_problem = _setup_geo_range(raw)
if range_problem:
ev.decode_problems.append(range_problem + "; peaks assume the Normal range")
k = _setup_name_at(raw)
if k is not None:
ev.device_info, ev.battery_volts = _setup_identity(raw, k)
for attr, value in _setup_trigger(raw, k).items():
setattr(ev, attr, value)
if is_waveform_body:
ev.rectime_seconds = _setup_record_time(raw)
ev.total_samples = len(samples["Tran"]) or None
@@ -1648,21 +1186,17 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
# embedded in the 5A stream (_embedded_event_record), so a waveform takes
# it from there. Without a validated one the estimate stands, reported as a
# decode problem -- never a filename's time, which is only a cross-check.
# A histogram's footer start runs a second early on 97%. Its own event
# record (marker fe f5) holds Blastware's exact start and stop, so it takes
# them from there (#51); events are keyed unit + time + type, so a waveform
# and its histogram may share a second.
# ⚠ RETRACTED 2026-11-03: "histograms stay on ts1" -- that held only while
# events were unique on (serial, timestamp).
_record_at = None # the validated event record, which the unit's summary follows
# Histograms stay on ts1 although it runs a second early on 97% (their
# record, marker fe f5, holds the exact start): in Blastware's timing a
# waveform and its histogram share a second 209 times in prod's store, and
# events is unique on (serial, timestamp) -- #51.
if is_waveform_body and ts2 is not None:
_stop = datetime.datetime(ts2.year, ts2.month, ts2.day,
ts2.hour, ts2.minute, ts2.second)
_rt = _parse_record_time_seconds(raw)
_start = (datetime.datetime(ts1.year, ts1.month, ts1.day, ts1.hour, ts1.minute, ts1.second)
if ts1 is not None else None)
_trig, _why, ev.triggered_by, _record_at = _embedded_event_record(
raw, footer_pos, _start, _stop, _rt)
_trig, _why = _embedded_event_record(raw, footer_pos, _start, _stop, _rt)
if _trig is not None:
ev.timestamp_source = "event_record"
else:
@@ -1684,25 +1218,13 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
hour=_trig.hour, minute=_trig.minute, second=_trig.second,
)
elif ts1 is not None:
_start, _hstop, _why, _record_at = (_histogram_event_record(raw, footer_pos, ts1, ts2)
if record_type == "Histogram" else (None, None, "", None))
if _start is not None:
ev.timestamp_source = "event_record"
ev.stop_time = _hstop
else:
_start = ts1
ev.timestamp_source = "footer"
if record_type == "Histogram":
_problem = (f"no validated histogram event record ({_why}); the start is the "
"footer's, a second early on 97% of measured files")
ev.decode_problems.append(_problem)
log.warning("%s: %s", label, _problem)
ev.timestamp = Timestamp(
raw=footer[2:10],
flag=0x10,
year=_start.year, unknown_byte=0, month=_start.month, day=_start.day,
hour=_start.hour, minute=_start.minute, second=_start.second,
year=ts1.year, unknown_byte=0, month=ts1.month, day=ts1.day,
hour=ts1.hour, minute=ts1.minute, second=ts1.second,
)
ev.timestamp_source = "footer"
ev.project_info = _setup_notes(raw)
ev.raw_samples = samples
@@ -1722,46 +1244,14 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event:
# None, and ``apply_report_to_event`` overlays from a paired ASCII
# report when one is supplied.
has_samples = any(samples.get(ch) for ch in ("Tran", "Vert", "Long", "MicL"))
# The geophone full scale is the file's range; Normal when it wasn't read.
geo_fs = _GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS)
ev.peak_values = (_peaks_from_samples(samples, geo_fs, mic_count_divisor(ev.mic_range))
if has_samples else None)
if (is_waveform_body and ev.peak_values is not None and ev.sample_rate
and ev.pretrig_samples is not None):
_waveform_peak_detail(ev.peak_values, samples, geo_fs, ev.sample_rate, ev.pretrig_samples)
_chain = _record_chain(raw, _record_at) if _record_at is not None else None
_summary = _unit_summary(_chain) if _chain is not None else None
ev.sensor_check_results = _sensor_check_results(_chain) if _chain is not None else None
# A whole chain ends at the file's last byte with the footer, so the last
# 26 bytes are proven to be it.
if _chain is not None and _FOOTER_ID in _chain:
ev.monitor_log = _monitor_log(raw[-_FOOTER_LEN:])
if _summary is not None and ev.peak_values is not None and ev.sample_rate:
_apply_unit_summary(ev.peak_values, _summary, geo_fs, ev.sample_rate,
ev.pretrig_samples if is_waveform_body else None)
if ev.stop_time is None: # a histogram's record stop, else the footer's
ev.stop_time = ts2
if hist_records:
# A histogram stores each interval's vector sum (squared), and each
# channel's half-period: Blastware's per-interval Geo PVS (771,354 /
# 771,354 DL2 cells) and frequency, (sample rate / 2) / half-period.
unit_ins = _HIST_GEO_COUNTS_PER_UNIT * geo_fs / _GEO_INT16_FS
ev.interval_pvs = [math.sqrt(r["pvs_sq"]) * unit_ins for r in hist_records]
ev.interval_half_periods = {
ch: [r[key] for r in hist_records if r[key] is not None]
for ch, key in (("Tran", "t_halfp"), ("Vert", "v_halfp"),
("Long", "l_halfp"), ("MicL", "m_halfp"))}
if not ev.interval_half_periods["MicL"]:
del ev.interval_half_periods["MicL"]
k = _setup_name_at(raw)
if k is not None and k >= _INTERVAL_BEFORE_NAME:
ev.histogram_interval_sec = int.from_bytes(
raw[k - _INTERVAL_BEFORE_NAME:k - _INTERVAL_BEFORE_NAME + 2], "big") or None
if not is_waveform_body and ev.peak_values is not None and ev.interval_pvs:
# The event's vector sum is the largest interval's. Combining the
# channel peaks instead read high on 86% of DL2's histograms -- they
# can come from different moments.
ev.peak_values.peak_vector_sum = max(ev.interval_pvs)
ev.peak_values = _peaks_from_samples(samples) if has_samples else None
if not is_waveform_body and ev.peak_values is not None:
# A histogram stores each interval's vector sum (squared); the event's
# is the largest. Combining the channel peaks instead read high on 86%
# of DL2's histograms -- they can come from different moments.
pvs = interval_pvs(body)
if pvs:
ev.peak_values.peak_vector_sum = max(pvs) * _HIST_GEO_UNIT_INS
ev._a5_frames = None # not recoverable from BW file
return ev
+101 -130
View File
@@ -28,10 +28,6 @@ De-stuffed payload layout:
DLE stuffing rule: any 0x10 byte in the payload is doubled on the wire (0x10 → 0x10 0x10).
This applies to the checksum byte too.
⚠ AMENDED 2026-10-26 (measured): a request escapes FOUR values, not one -- every 02, 03,
04 and 10 in payload and checksum gets a DLE in front. Blastware's 748 recorded requests
re-encode byte-identically under that rule (tests/test_5a_blastware_walk.py); a bare 02 or
03 left a request unanswered. See `s3_stuff()`.
Confirmed from live captures (s3_parser.py validation + raw_bw.bin / raw_s3.bin).
"""
@@ -87,24 +83,6 @@ def dle_unstuff(data: bytes) -> bytes:
# ── Checksum ─────────────────────────────────────────────────────────────────
# Every byte value a request DLE-escapes (2026-10-26, measured): Blastware's 748
# requests from a whole download session re-encode byte-identically with this set,
# payload and checksum alike. A bare 0x02 checksum or a 0x03 inside the params left
# BE9441 silent (and the 0x02 made it reset ~11 s later). It is a Micromate's set
# too (micromate.framing._ESCAPED).
_ESCAPED = frozenset({STX, ETX, 0x04, DLE})
def s3_stuff(data: bytes) -> bytes:
"""Escape every byte a request escapes: `XX` → `10 XX` for 02, 03, 04 and 10."""
out = bytearray()
for b in data:
if b in _ESCAPED:
out.append(DLE)
out.append(b)
return bytes(out)
def checksum(payload: bytes) -> int:
"""SUM8: sum of all de-stuffed payload bytes, mod 256."""
return sum(payload) & 0xFF
@@ -112,34 +90,13 @@ def checksum(payload: bytes) -> int:
# ── BW→S3 frame builder ───────────────────────────────────────────────────────
# SUB byte for 5A (protocol.py has the full constant set; defined here to
# avoid a circular import).
# SUB byte for 5A — used by build_5a_frame below (protocol.py has the full
# constant set; defined here to avoid a circular import).
SUB_5A = 0x5A
def build_5a_request(address: int, length: int) -> bytes:
"""A SUB 5A read of `length` bytes at the unit's 32-bit `address`.
Measured 2026-10-26 from Blastware downloading all 8 of BE9441's events (four
crossing a 64 KB page): a 5A request is an ORDINARY 16-byte request --
`[10 00 5A 00][length BE][address BE 4][zeros 6]`, SUM8 checksum, every
02/03/04/10 escaped -- and this rebuilds all 540 of Blastware's 5A requests
byte for byte. The older model below (`build_5a_frame`: a raw "offset_hi
0x10", an "11-byte params", "metadata pages at 0x1002 / 0x1004") was the
same bytes misread: `10 02 00` is the length 0x0200 escaped, and the
"metadata pages" are the first event's chunks at 0x0200 and 0x0400.
"""
if not 0 <= address <= 0xFFFFFFFF:
raise ValueError(f"address must fit in 32 bits, got {address:#x}")
return build_bw_frame(SUB_5A, length, address.to_bytes(4, "big") + bytes(6))
def build_5a_frame(offset_word: int, raw_params: bytes) -> bytes:
"""
⛔ SUPERSEDED 2026-10-26 by `build_5a_request` -- no production caller. Kept
because tests/test_5a_protocol.py pins its bytes against the 5-1-26 captures;
for in-page requests it emits the same bytes. Its model (below) is retracted.
Build a BW→S3 frame for SUB 5A (BULK_WAVEFORM_STREAM) that exactly
matches Blastware's wire output.
@@ -226,14 +183,7 @@ def build_5a_frame(offset_word: int, raw_params: bytes) -> bytes:
chk = (chk + s[i]) & 0xFF
i += 1
# A checksum that is itself a framing byte is DLE-escaped. Sent bare, a
# 0x02 before ETX reads as a new STX: BE9441 never answered chunk 0x7D06
# (`... 02 03`) and rebooted ~11 s later, twice; escaped (`10 02 03`) it
# answered in 28 ms, as did checksums 0x04 and 0x10 (bench, 2026-10-26).
# The set is a Micromate's escape set (251/251 THOR requests); the MiniMate's
# de-stuffing keeps `10 02/03/04` literal and turns `10 10` into 0x10.
tail = bytes([DLE, chk]) if chk in (STX, ETX, 0x04, DLE) else bytes([chk])
return bytes([ACK, STX]) + bytes(s) + tail + bytes([ETX])
return bytes([ACK, STX]) + bytes(s) + bytes([chk, ETX])
def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> bytes:
@@ -253,7 +203,7 @@ def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> byte
byte lives at params[6] (= payload[12]). Use waveform_key_params() and
token_params() helpers to build these safely.
Wire output: [ACK] [STX] s3_stuff(payload + checksum) [ETX]
Wire output: [ACK] [STX] dle_stuff(payload + checksum) [ETX]
Args:
sub: SUB command byte (e.g. 0x01 = FULL_CONFIG_READ)
@@ -276,7 +226,7 @@ def build_bw_frame(sub: int, offset: int = 0, params: bytes = bytes(10)) -> byte
offset_lo = offset & 0xFF
payload = bytes([BW_CMD, 0x00, sub, 0x00, offset_hi, offset_lo]) + params
chk = checksum(payload)
wire = bytes([ACK, STX]) + s3_stuff(payload + bytes([chk])) + bytes([ETX])
wire = bytes([ACK, STX]) + dle_stuff(payload + bytes([chk])) + bytes([ETX])
return wire
@@ -284,34 +234,103 @@ def build_bw_write_frame(
sub: int,
data: bytes,
*,
offset: Optional[int] = None,
offset: int = 0,
params: bytes = bytes(10),
) -> bytes:
"""A write request: the standard 16-byte request followed by `data`, escaped
and checksummed like every other request (s3_stuff, SUM8).
"""
Build a BW→S3 write-command frame.
`offset` is the payload's [4:6] field -- the data's LENGTH; it defaults to
len(data), which is what Blastware sends on every write on record.
Write frames extend the standard 16-byte read header with a variable-length
data payload. They use a different checksum formula from read frames.
Measured 2026-10-26/27 (issue #46): all of Blastware's requests from February
to October 2026 -- 3,869 frames in the uploaded captures plus BE9441's 26
write frames tonight -- rebuild byte for byte this way, the 77 write frames
that carry data included (event index 68, compliance 71, trigger 82, waveform
data 69).
**CRITICAL: Write frames use minimal DLE stuffing.**
⚠ RETRACTED: "only BW_CMD is doubled, everything else raw" and the "DLE-aware
checksum" `(sum of payload[2:] skipping 0x10) + 0x10`. That model rebuilt the
March frames only because it was fitted to data that still held its escape
bytes; the "data length 91, offset 90" it explained was 90 bytes plus one
escape. It got 7 of every 13 frames in a config write wrong.
Unlike read frames (build_bw_frame), write frames do NOT apply full DLE
stuffing to the payload. Only the BW_CMD byte (0x10) at position [0] is
doubled to 0x10 0x10 on the wire. All other bytes — flags, sub, offset,
params, data, and checksum — are written RAW with no stuffing, even if they
contain 0x10 bytes (e.g. offset_hi=0x10 for compliance chunks, or 0x10
bytes in the write data payload).
Confirmed from 3-11-26 BW TX capture (frames 102–112): all 11 write frames
match the rule "double BW_CMD only; everything else raw." ✅ 2026-04-07.
Wire layout:
[41] ACK
[02] STX
[10 10] BW_CMD doubled (the ONLY DLE stuffing applied)
[00] flags
[sub] write command byte (0x68–0x83)
[00] always zero
[hi][lo] offset as uint16 BE (raw; NOT stuffed even if hi=0x10)
[params] 10 bytes (raw)
[data] variable-length write payload (raw; NOT stuffed)
[chk] checksum byte (raw; NOT stuffed even if 0x10)
[03] ETX
De-stuffed payload (for checksum computation):
[0] BW_CMD 0x10
[1] flags 0x00
[2] SUB write command byte
[3] 0x00 always zero
[4] offset_hi
[5] offset_lo
[6:16] params 10 bytes
[16:] data write payload
[-1] chk
**Checksum formula (confirmed 2026-03-12 from 3-11-26 BW TX capture):**
chk = (sum(b for b in payload[2:] if b != 0x10) + 0x10) % 256
where payload = destuffed content BEFORE appending chk.
This skips all 0x10 bytes in payload[2:] (sub onwards), including any
0x10 bytes in the offset, params, data, and the checksum byte itself.
The offset field [4:6] meaning per write SUB:
- SUBs 68, 69, 82 (single-chunk writes): offset = data[1] + 2, where
data[1] is an embedded length field in the write payload.
Confirmed from capture: 68→0x5A (data[1]=0x58+2), 82→0x1C
(data[1]=0x1A+2), 69→0xCA (data[1]=0xC8+2).
- SUB 71 (multi-chunk compliance): 0x1004 for full chunks, 0x002C
for the final partial chunk.
- Confirm frames (72, 73, 74, 83): offset=0, no data.
Args:
sub: Write command SUB byte.
data: Write payload (variable length; empty for confirm frames).
offset: 16-bit value placed at [4:6]. See per-SUB notes above.
params: 10 bytes placed at [6:16]. All-zero for most writes; compliance
chunk writes use chunk-specific values.
Returns:
Complete frame bytes ready to write to the transport.
"""
if len(params) != 10:
raise ValueError(f"params must be exactly 10 bytes, got {len(params)}")
length = len(data) if offset is None else offset
if not 0 <= length <= 0xFFFF:
raise ValueError(f"length must fit in 16 bits, got {length:#x}")
payload = bytes([BW_CMD, 0x00, sub, 0x00, (length >> 8) & 0xFF, length & 0xFF]) + params + data
return bytes([ACK, STX]) + s3_stuff(payload + bytes([checksum(payload)])) + bytes([ETX])
if offset > 0xFFFF:
raise ValueError(f"offset must fit in uint16, got {offset:#06x}")
offset_hi = (offset >> 8) & 0xFF
offset_lo = offset & 0xFF
# Destuffed payload (used only for checksum; not sent directly)
payload_no_chk = bytes([BW_CMD, 0x00, sub, 0x00, offset_hi, offset_lo]) + params + data
# Large-frame checksum: sum payload[2:] skipping all 0x10 bytes, add 0x10.
# Applied to the destuffed representation — confirms correctly against
# all 11 write frames in the 3-11-26/170151 BW TX capture. ✅
chk = (sum(b for b in payload_no_chk[2:] if b != 0x10) + 0x10) & 0xFF
# Wire construction: only BW_CMD is doubled; everything else is raw.
# Do NOT use dle_stuff() here — that would incorrectly double 0x10 bytes
# in the offset, params, and data sections.
wire = (
bytes([ACK, STX]) # Frame prefix (not part of payload)
+ bytes([BW_CMD, BW_CMD]) # BW_CMD doubled (only DLE stuffing applied)
+ payload_no_chk[1:] # flags, sub, offset, params, data — RAW
+ bytes([chk]) # checksum — RAW
+ bytes([ETX]) # Frame terminator
)
return wire
def waveform_key_params(key4: bytes) -> bytes:
@@ -370,9 +389,6 @@ def token_params(token: int = 0) -> bytes:
def bulk_waveform_params(key4: bytes, counter: int, *, is_probe: bool = False) -> bytes:
"""
⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no
production caller; kept for tests/test_5a_protocol.py. See build_5a_request.
Build the 10-byte params block for SUB 5A (BULK_WAVEFORM_STREAM) requests.
Confirmed 2026-04-02 from 1-2-26 BW TX capture analysis:
@@ -418,9 +434,6 @@ def bulk_waveform_params(key4: bytes, counter: int, *, is_probe: bool = False) -
def bulk_waveform_term_params(key4: bytes, counter: int) -> bytes:
"""
⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no
production caller; kept for tests/test_5a_protocol.py. See build_5a_request.
⛔ DEPRECATED — DO NOT USE IN NEW CODE.
This is the v1 termination params helper, paired with the broken
@@ -457,9 +470,6 @@ def bulk_waveform_term_v2(
last_chunk_counter: int,
) -> tuple[int, bytes]:
"""
⛔ SUPERSEDED 2026-10-26 by `build_5a_request` / `parse_strt_end_key` -- no
production caller; kept for tests/test_5a_protocol.py. See build_5a_request.
Compute the SUB 5A TERM frame's offset_word and 10-byte params block.
Confirmed across 3 events (4-27-26 + 5-1-26 captures):
@@ -531,44 +541,8 @@ def bulk_waveform_term_v2(
STRT_MARKER = b"STRT"
def unescape_reply(data: bytes) -> bytes:
"""A reply's data with each kept escape removed: `10 02/03/04` → `02/03/04`.
The unit escapes 02, 03, 04 and 10 in its replies exactly as requests do,
the checksum included (748/748 replies, 2026-10-26; 7,747 / 7,747 across every
recording, March to October 2026, #58). S3FrameParser collapses `10 10` but
keeps the `10` of `10 02/03/04` (inner-frame markers to it) everywhere but the
checksum, so its `.data` carries an extra byte before each 02/03/04 value --
harmless for fields read before the escape, one byte off for any read after it,
or counted from the end."""
out, i = bytearray(), 0
while i < len(data):
if data[i] == DLE and i + 1 < len(data) and data[i + 1] in (STX, ETX, 0x04):
i += 1
continue
out.append(data[i])
i += 1
return bytes(out)
def parse_strt_end_key(a5_data: bytes) -> Optional[int]:
"""The event's FULL 32-bit end key from the STRT record in an A5 reply's
data, or None. The page byte is part of it: an event that ends in the next
64 KB page reads e.g. 0x011216C4 here, where `parse_strt_end_offset` gave
0x16C4. Read after `unescape_reply`."""
out = unescape_reply(a5_data)
pos = out.find(STRT_MARKER)
if pos < 0 or pos + 10 > len(out):
return None
return int.from_bytes(out[pos + 6:pos + 10], "big")
def parse_strt_end_offset(a5_data: bytes) -> Optional[int]:
"""
⛔ SUPERSEDED 2026-10-26 by `parse_strt_end_key`: this keeps only the low 16
bits (the 64 KB page bug) and misreads an end whose low bytes hold an escaped
02/03/04. No production caller; kept for tests/test_5a_protocol.py.
Extract the event-end offset from the STRT record in an A5 response payload.
The first A5 response (the probe response, or the first chunk for events
@@ -634,8 +608,11 @@ class S3Frame:
page_lo: int # PAGE_LO from header
data: bytes # payload data section (payload[5:], checksum already stripped)
checksum_valid: bool
chk_byte: int = 0 # actual checksum byte received from wire (body[-1]); an
# escaped one (`10 02/03/04`) leaves no 10 in `data` (#58)
chk_byte: int = 0 # actual checksum byte received from wire (body[-1])
# needed for waveform file reconstruction: when the last data byte
# is 0x10 and chk_byte ∈ {0x02, 0x03, 0x04}, the DLE+chk pair
# must be included in the DLE-strip operation to correctly
# reconstruct the Blastware binary body.
@property
def page_key(self) -> int:
@@ -758,15 +735,9 @@ class S3FrameParser:
if len(body) < 6:
return None
# A checksum of 02, 03 or 04 arrives escaped, `10 X`, and _step keeps both
# bytes; that 10 is the escape, never data (#58: 272 of 7,747 recorded
# replies, every one an escape pair). Any other checksum is one byte.
n_chk = 2 if body[-2] == DLE and body[-1] in (STX, ETX, 0x04) else 1
raw_payload = body[:-n_chk] # everything except the checksum
raw_payload = body[:-1] # everything except the trailing checksum byte
chk_received = body[-1]
# SUM8 of the payload unescaped: the kept `10` of a `10 02/03/04` is not
# summed (7,747 of 7,747 recorded replies check this way).
chk_computed = checksum(unescape_reply(raw_payload))
chk_computed = checksum(raw_payload)
if len(raw_payload) < 5:
return None
+16 -41
View File
@@ -156,11 +156,10 @@ _BLOCK_MARKER = 10
# 16-count-unit output (1 unit = 0.005 in/s = 16 ADC counts).
_GEO_LSB_INS = 0.005
# Frequency formula: freq_Hz = (sample_rate / 2) / half_period_samples.
# ⚠ RETRACTED 2026-11-03 (#50): "a fixed numerator of 512". 512 is sample_rate
# / 2 at 1024 sps only; at 2048 sps it halved every frequency. Measured on DL2:
# 527,915 / 527,915 cells at 1024 sps and 1,725 / 1,725 at 2048.
_FREQ_NUMERATOR = 512 # sample_rate / 2 at the default 1024 sps
# Frequency formula: freq_Hz = _FREQ_NUMERATOR / half_period_samples.
# Empirically determined to be 512 (= sample_rate / 2, where sample rate
# is 1024 sps for the standard MiniMate Plus configuration).
_FREQ_NUMERATOR = 512
def _is_data_block(block: bytes) -> bool:
@@ -301,11 +300,7 @@ def decode_histogram_body(body: bytes) -> Optional[dict]:
to get 1-count ADC values, then ``count / 32767 * 10.0`` for in/s)
- Mic channel: use ``waveform_codec.mic_count_to_db(count)``
"""
return channels_from_records(_walk_auto(body))
def channels_from_records(records: Optional[List[dict]]) -> Optional[dict]:
"""``decode_histogram_body``'s per-channel peaks, from records already walked."""
records = _walk_auto(body)
if not records:
return None
return {
@@ -343,19 +338,17 @@ def interval_pvs(body: bytes) -> Optional[List[float]]:
return [math.sqrt(r["pvs_sq"]) for r in records] if records else None
def half_period_to_hz(halfp: int, sample_rate: int = 1024) -> Optional[float]:
"""Convert a half-period in samples to frequency in Hz:
``(sample_rate / 2) / halfp``.
def half_period_to_hz(halfp: int) -> Optional[float]:
"""Convert a half-period in samples to frequency in Hz.
Returns ``None`` for half-period ≤ 5 — the device emits values in
that range when the measured zero-crossing rate exceeds 100 Hz at
1024 sps (the BW display reports `>100`, `>200` at 2048 sps). Callers
can treat ``None`` as that sentinel. A half-period of 0 is Blastware's
"N/A"; it also returns None.
that range when the measured zero-crossing rate exceeds 100 Hz
(the BW display reports `>100 Hz` for such cases). Callers can
treat ``None`` as the `>100 Hz` sentinel.
"""
if halfp <= 5:
return None
return (sample_rate / 2) / halfp
return _FREQ_NUMERATOR / halfp
def geo_count_to_ins(count: int) -> float:
@@ -446,34 +439,16 @@ def _stride(rec: int, n: int) -> int:
def _records_plausible(body: bytes, off: int, rec: int, m: int) -> bool:
"""Every record's last 4 bytes are its vector sum squared, consistent with
its channel peaks: at least the largest peak, at most sqrt(3) times it (one
unit of rounding either way). That is what tells a 16-byte layout from a
20-byte one when both strides happen to fit (492 = 12 + 16x30 = 12 + 20x24);
misread, those bytes are other fields. Holds on 34,502,955 / 34,502,955 DL2
sub-minute intervals (2026-11-02).
⚠ RETRACTED 2026-11-02: "every record's zero word is 0000". It is the high
word of the PVS², non-zero on any interval above 1.28 in/s, so a short
histogram with one loud interval was not recognised at all (T193KR5M.X90H,
K440HA3C.JM0H decoded to nothing)."""
"""Every record's zero word is 0000 -- what tells a 16-byte layout from a
20-byte one when both strides happen to fit (492 = 12 + 16x30 = 12 + 20x24)."""
z = rec - 4
for k in range(m):
q = off + _MULTI_HEADER_LEN + rec * k
if q + rec > len(body):
return False
peak = max((body[q + i] << 8) | body[q + i + 1] for i in (0, 4, 8))
if not _pvs_consistent(peak, int.from_bytes(body[q + z:q + z + 4], "big")):
if q + rec > len(body) or body[q + z] or body[q + z + 1]:
return False
return True
def _pvs_consistent(peak: int, pvs_sq: int) -> bool:
"""A record's vector sum squared against its largest geo peak, one unit of
rounding either way: peak <= PVS <= sqrt(3) * peak."""
return max(peak - 1, 0) ** 2 <= pvs_sq <= 3 * (peak + 1) ** 2
def detect_multi_interval_layout(body: bytes) -> Optional[Tuple[int, int]]:
"""``(record_len, per_block)`` of a multi-interval body, or None.
@@ -568,8 +543,8 @@ def walk_multi_interval_blocks(body: bytes,
recs = [_decode_record(body, off + _MULTI_HEADER_LEN + rec * k, rec, off)
for k in range(max(m, 0))]
for k, r in enumerate(recs):
peak = max(r["t_peak"], r["v_peak"], r["l_peak"])
if not _pvs_consistent(peak, r["pvs_sq"]) or peak > _GEO_MAX_COUNTS:
if (r["meta_var"][:2] != b"\x00\x00"
or max(r["t_peak"], r["v_peak"], r["l_peak"]) > _GEO_MAX_COUNTS):
del recs[k:]
break
out.extend(recs)
-82
View File
@@ -300,10 +300,6 @@ class DeviceInfo:
# ── From SUB 08 (EVENT_INDEX_RESPONSE) ────────────────────────────────────
event_count: Optional[int] = None # stored event count from F7 response 🔶
# ── From a Blastware event file's identity block (2026-11-03) ─────────────
calibration_date: Optional[datetime.date] = None # e.g. 2019-02-20 ✅
calibrated_by: Optional[str] = None # e.g. "Instantel" ✅
def __str__(self) -> str:
fw = self.firmware_version or f"?.{self.firmware_minor}"
mdl = self.model or "MiniMate Plus"
@@ -356,9 +352,6 @@ class PeakValues:
long: Optional[float] = None # Longitudinal PPV (in/s) ✅
micl: Optional[float] = None # Air overpressure (psi) 🔶 (units uncertain)
peak_vector_sum: Optional[float] = None # Scalar geo PVS (in/s) ✅
# ZC frequency (Hz), from the unit's own summary in the file (2026-11-05) or
# a report. Above range, the value is Blastware's threshold (100 Hz at
# 1024 sps) and the flag is set; None is Blastware's "N/A".
tran_zc_freq: Optional[float] = None
vert_zc_freq: Optional[float] = None
long_zc_freq: Optional[float] = None
@@ -367,50 +360,6 @@ class PeakValues:
vert_zc_above_range: bool = False
long_zc_above_range: bool = False
mic_zc_above_range: bool = False
# A waveform's peak detail (2026-11-04); None for a histogram. Times of peak
# are the unit's own peak samples, acceleration comes from the samples.
tran_time_of_peak: Optional[float] = None # s from the trigger; negative = pre-trigger
vert_time_of_peak: Optional[float] = None
long_time_of_peak: Optional[float] = None
micl_time_of_peak: Optional[float] = None
pvs_time: Optional[float] = None # s from the trigger, of the vector-sum peak
tran_peak_accel_g: Optional[float] = None
vert_peak_accel_g: Optional[float] = None
long_peak_accel_g: Optional[float] = None
# Peak displacement (in), from the unit's own summary (2026-11-05).
tran_peak_disp_in: Optional[float] = None
vert_peak_disp_in: Optional[float] = None
long_peak_disp_in: Optional[float] = None
# Over range: the unit's own peak passed full scale (2026-11-09). Blastware
# prints OORANGE for that peak, and for the vector sum when any geophone is
# over; the value beside it is then a lower bound.
tran_over_range: bool = False
vert_over_range: bool = False
long_over_range: bool = False
mic_over_range: bool = False
pvs_over_range: bool = False
@dataclass
class SensorCheckResult:
"""One channel's sensor check, as the unit stores it in the event file
(2026-11-06). `result` is Blastware's word for it."""
result: str # "Passed", "Check" or "Disabled"
status: int # the unit's code: 0 passed; its bits are not decoded
freq_hz: Optional[float] = None # geophone resonance / mic test frequency; None when Disabled
ratio: Optional[float] = None # geophones only
amplitude_mv: Optional[int] = None # the mic only
@dataclass
class MonitorLogLine:
"""The Monitor Log line Blastware prints for an event, from the file's
footer (2026-11-08): the monitoring session's start, the stop, and what
happened. Not the live 0x0A browse entries (MonitorLogEntry)."""
start: datetime.datetime
stop: datetime.datetime
flags: int # the footer's flag word
description: str # Blastware's words, e.g. "Event Recorded Modem Exit"
# ── Project / operator metadata ───────────────────────────────────────────────
@@ -430,8 +379,6 @@ class ProjectInfo:
operator: Optional[str] = None # operator / user name
sensor_location: Optional[str] = None # sensor location string
notes: Optional[str] = None # extended notes
job_number_enabled: Optional[bool] = None # Blastware prints the job number
job_number: Optional[int] = None # kept while switched off
# ── Compliance Config ──────────────────────────────────────────────────────────
@@ -596,24 +543,6 @@ class Event:
total_samples: Optional[int] = None # from STRT record: expected total sample-sets
pretrig_samples: Optional[int] = None # from STRT record: pre-trigger sample count
rectime_seconds: Optional[int] = None # from STRT record: record duration (seconds)
# Geophone range from the recording setup, as ComplianceConfig.geo_range:
# 0 Normal (10 in/s full scale), 1 Sensitive (1.25 in/s). None: not read.
geo_range: Optional[int] = None
# From a Blastware event file (2026-11-03); None when not read.
device_info: Optional["DeviceInfo"] = None # the unit, as SUB FE reports it
battery_volts: Optional[float] = None # at the event
triggered_by: Optional[int] = None # 0x01 Tran 0x02 Vert 0x04 Long 0x08 MicL 0x200 Manual
trigger_sources: Optional[int] = None # setup bitmask: 0x07 geophones, 0x08 mic
trigger_level_geo: Optional[float] = None # in/s, as ComplianceConfig.trigger_level_geo
trigger_level_mic_psi: Optional[float] = None
record_stop_mode: Optional[int] = None # 0 = Fixed
mic_type: Optional[int] = None # 2 = Linear Weighting (as Series IV)
mic_range: Optional[int] = None # 0; 1 = each mic count is an eighth (2026-11-09)
stop_time: Optional[datetime.datetime] = None # the footer's stop
# A histogram's per-interval detail (2026-11-03); None for a waveform.
histogram_interval_sec: Optional[int] = None # as ComplianceConfig.histogram_interval_sec
interval_half_periods: Optional[dict] = None # channel -> half-period per interval, samples
interval_pvs: Optional[list] = None # each interval's vector sum, in/s
# Sensor self-check traces keyed by channel label — the short diagnostic
# waveforms the unit records when it pulses each sensor before monitoring
@@ -623,12 +552,6 @@ class Event:
# Raw ADC counts; the source series' scale differs but the trace is a
# shape diagnostic (rendered fit-to-box). None when absent.
sensor_check: Optional[dict] = None # {"Tran": [...], ..., "MicL": [...]}
# And its results per channel, from the same records (2026-11-06): None
# when the file's record chain is not whole.
sensor_check_results: Optional[dict] = None # channel -> SensorCheckResult
# The event's Monitor Log line (2026-11-08): None unless the file's record
# chain is whole, which proves the footer.
monitor_log: Optional[MonitorLogLine] = None
# Where `timestamp` came from, when decoded from a Blastware binary
# (event_file_io): "event_record" -- the instrument's own event record in
@@ -746,8 +669,3 @@ class MonitorStatus:
battery_v: Optional[float] = None # Battery voltage in volts ✅
memory_total: Optional[int] = None # Total flash memory in bytes ✅
memory_free: Optional[int] = None # Free flash memory in bytes ✅
# The raw flag byte `is_monitoring` is derived from: section[1] = data[12].
# Measured: 0x00 idle, 0x10 monitoring. None when the section is too short
# to hold it. Kept raw so a caller can refuse a value never measured,
# where `is_monitoring` reads anything but 0x10 as idle.
state_flag: Optional[int] = None
+434 -470
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -98,25 +98,25 @@ def _decode_delta_stream(buf: bytes) -> List[int]:
def _find_chain(body: bytes):
"""Locate the length-prefixed sensor-check records.
"""Locate the four length-prefixed sensor-check records.
Returns a list of ``(offset, id, length)`` or ``None``. The chain is
validated by walking the ids 0x3c → 0x3d → 0x3e (→ 0x3f) via their own
length prefixes, so a stray 0x3c byte in the waveform data cannot match.
A unit without a mic has no 0x3f (BE16352, all 8 of its DL2 events,
2026-11-06), so the three geophone records are enough.
validated by walking the ids 0x3c → 0x3d → 0x3e → 0x3f via their own length
prefixes, so a stray 0x3c byte in the waveform data cannot match.
"""
for p in range(len(body) - 6):
if body[p + 2] == 0x3C and body[p + 3] == 0 and body[p + 4] == 0:
q = p
recs = []
ok = True
for expect in _CHAIN_IDS:
if q + 3 > len(body) or body[q + 2] != expect:
ok = False
break
length = int.from_bytes(body[q:q + 2], "big")
recs.append((q, expect, length))
q = q + 2 + length
if len(recs) >= 3:
if ok and len(recs) == 4:
return recs
return None
@@ -124,8 +124,8 @@ def _find_chain(body: bytes):
def decode_sensor_check(raw: bytes) -> Dict[str, List[int]]:
"""Decode the four sensor self-check traces from a series-3 event binary.
Returns ``{"Tran": [...], "Vert": [...], "Long": [...], "MicL": [...]}`` (no
"MicL" on a unit without a mic) in raw decode units (same 16-count LSB as the main waveform), or ``{}`` if the
Returns ``{"Tran": [...], "Vert": [...], "Long": [...], "MicL": [...]}`` in
raw decode units (same 16-count LSB as the main waveform), or ``{}`` if the
binary carries no sensor-check block (a histogram event, a non-series-3
file, or a unit/firmware that doesn't store it).
"""
+3 -8
View File
@@ -640,21 +640,16 @@ MIC_PA_PER_COUNT = 0.25
# 124.2, and the 81.94 first fitted to a handful of values misses counts 119
# and 132. Its display chain presumably carries rounded constants; the
# window, not the physics, is what is measured.
# ⚠ CORRECTED 2026-11-09: that window was too high. Every count Blastware
# printed in DL2 -- 1,704 in waveform sample tables, 520 in histogram
# intervals, 494 histogram peaks -- leaves [81.9382058, 81.9382266]: count
# 129 (124.2) bounds it from below, 463 (135.2, which 81.9384 prints 135.3)
# and 677 (138.5) from above. One offset serves all three.
_MIC_DB_REF = 81.938216
_MIC_DB_REF = 81.9384
def mic_count_to_db(count: int) -> float:
"""Convert a MicL ADC count to dB(L) for BW-display-compatible output.
dB = sign(count) × (81.938216 + 20 × log10(|count|)) for |count| ≥ 1
dB = sign(count) × (81.9384 + 20 × log10(|count|)) for |count| ≥ 1
dB = 0.0 for count == 0
81.938216 ≈ 20 log10(0.25 Pa / 20 µPa); see _MIC_DB_REF.
81.9384 ≈ 20 log10(0.25 Pa / 20 µPa); see _MIC_DB_REF.
count=±1 → ±81.94 dB; count=813 → 140.14 dB (the V70 fixture).
"""
if count == 0:
+68
View File
@@ -0,0 +1,68 @@
"""
poc_set_project.py — POC test for set_project_info() against a live MiniMate Plus.
Usage:
python poc_set_project.py [--host IP] [--port PORT]
Default target: BE11529 at 63.43.212.232:9034
"""
import argparse
import logging
import sys
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)-7s %(name)s %(message)s",
datefmt="%H:%M:%S",
)
log = logging.getLogger("poc_set_project")
from minimateplus import MiniMateClient
from minimateplus.transport import TcpTransport
DEFAULT_HOST = "63.43.212.232"
DEFAULT_PORT = 9034
def main() -> None:
ap = argparse.ArgumentParser(description="POC: write project info to MiniMate Plus")
ap.add_argument("--host", default=DEFAULT_HOST, help="Modem IP address")
ap.add_argument("--port", type=int, default=DEFAULT_PORT, help="TCP port")
ap.add_argument("--project", default="POC Write Test")
ap.add_argument("--client-name", default="Terra-Mechanics Inc.")
ap.add_argument("--operator", default="B. Harrison")
ap.add_argument("--seis-loc", default="Lab Bench - POC")
ap.add_argument("--notes", default="set_project_info POC 2026-04-07")
args = ap.parse_args()
log.info("Connecting to %s:%d", args.host, args.port)
transport = TcpTransport(args.host, port=args.port)
with MiniMateClient(transport=transport, timeout=60.0) as client:
log.info("Performing POLL handshake + identity read …")
info = client.connect()
log.info("Connected: serial=%s firmware=%s", info.serial, info.firmware_version)
log.info("Calling set_project_info() …")
client.set_project_info(
project=args.project,
client_name=args.client_name,
operator=args.operator,
seis_loc=args.seis_loc,
notes=args.notes,
)
log.info("set_project_info() returned — write sequence complete")
log.info("Done. Reconnect Blastware to verify the fields were written.")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
sys.exit(0)
except Exception as exc:
log.exception("Fatal: %s", exc)
sys.exit(1)
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "seismo-relay"
version = "0.34.0"
version = "0.33.0"
description = "Python client and REST server for MiniMate Plus seismographs"
requires-python = ">=3.10"
dependencies = [
-98
View File
@@ -1,98 +0,0 @@
#!/usr/bin/env python3
"""Cut Micromate write-session fixtures out of THOR's captures.
bridges/captures/ is gitignored, so the reproduction tests read these instead.
Each fixture is every request (as wire bytes) and every response (as its data
section) of one captured THOR session, paired in order, with the sha256 of the
capture files it came from. Re-run to regenerate:
.venv/bin/python scratch/mm_write_fixtures.py
"""
from __future__ import annotations
import hashlib
import json
import sys
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(REPO))
from micromate.framing import ACK, DLE, ETX, STX, MicromateFrameParser, request_sub # noqa: E402
CAP = REPO / "bridges" / "captures" / "9-24-26 - micromate2"
OUT = REPO / "tests" / "fixtures" / "micromate-writes"
SESSIONS = {
"setup-push-new-test1": "20260924_181942_send_TEST1_to_unit",
"setup-push-overwrite-test1": "overwritetest/*20260924_185113_test1_overwrite_check",
"setup-push-read-scheduler": "20260924_191835_read_scheduler",
"setup-push-pull-schedule": "20260925_003029_pull_schedule,_turn_off_repeat_daily,_push_schedule",
"setup-push-multiday": "20260925_011907_send_multiday_schedule",
"call-home-enable-disable": "20260925_011620_ACH-change_1_setting",
"monitor-start-stop": "20260924_191214_turn_on_monitormode_then_attempt_to_write_config",
}
def _find(stem: str, kind: str) -> Path:
if "/" in stem:
sub, rest = stem.split("/", 1)
hits = sorted((CAP / sub).glob(f"raw_{kind}_{rest.lstrip('*')}.bin"))
else:
hits = sorted(CAP.glob(f"raw_{kind}_{stem}.bin"))
if len(hits) != 1:
raise SystemExit(f"expected one raw_{kind} file for {stem!r}, found {hits}")
return hits[0]
def requests(blob: bytes) -> list[bytes]:
out, i = [], 0
while i < len(blob):
if not (blob[i] == ACK and i + 1 < len(blob) and blob[i + 1] == STX):
i += 1
continue
j = i + 2
while j < len(blob):
if blob[j] == DLE and j + 1 < len(blob):
j += 2
continue
if blob[j] == ETX:
break
j += 1
out.append(blob[i:j + 1])
i = j + 1
return out
def main() -> None:
OUT.mkdir(parents=True, exist_ok=True)
for slug, stem in SESSIONS.items():
bw, s3 = _find(stem, "bw"), _find(stem, "s3")
reqs = requests(bw.read_bytes())
parser = MicromateFrameParser()
rsps = parser.feed(s3.read_bytes())
if len(reqs) != len(rsps):
raise SystemExit(f"{slug}: {len(reqs)} requests vs {len(rsps)} responses")
exchanges = []
lines = {rp.firmware_line for rp in rsps}
if len(lines) != 1 or lines & {"unknown"}:
raise SystemExit(f"{slug}: responses report firmware lines {sorted(lines)}")
for rq, rp in zip(reqs, rsps):
sub = request_sub(rq)
if rp.sub != 0xFF - sub or not rp.checksum_valid:
raise SystemExit(f"{slug}: response 0x{rp.sub:02X} does not answer 0x{sub:02X}")
exchanges.append({"sub": sub, "request": rq.hex(), "response_sub": rp.sub,
"response_data": rp.data.hex()})
doc = {
"source": str(bw.relative_to(REPO)),
"source_sha256": {"bw": hashlib.sha256(bw.read_bytes()).hexdigest(),
"s3": hashlib.sha256(s3.read_bytes()).hexdigest()},
"unit": "UM12947", "firmware_version": "11.0CB",
"firmware_line": lines.pop(),
"exchanges": exchanges,
}
(OUT / f"{slug}.json").write_text(json.dumps(doc, indent=1) + "\n")
print(f"{slug}: {len(exchanges)} exchanges")
if __name__ == "__main__":
main()
+275 -275
View File
@@ -1,275 +1,275 @@
event_id,serial,timestamp,filename,channel,offset_ips,peak_ips,mean_over_peak,trigger_level_ips,already_flagged_ft
1e7a7808-034c-423b-80e9-d6788da80993,BE18438,2025-11-15T08:57:40,T438LBX4.W40W,Vert,0.2722,0.2930,0.929,0.2,0
346e383f-c5a1-41d1-b972-3d652e599d39,BE18438,2025-11-15T09:13:15,T438LBX5.M30W,Vert,0.2747,0.2930,0.938,0.2,0
45ef3023-22c5-44a8-a606-a0900bc17861,BE18438,2025-11-15T09:16:13,T438LBX5.R10W,Vert,0.2929,0.3027,0.967,0.2,0
1cbcd2aa-ec55-4e2f-af42-7178f26cc6a1,BE18438,2025-11-15T09:19:29,T438LBX5.WH0W,Vert,0.2816,0.2979,0.945,0.2,0
caf43634-4528-4fd5-9674-5f4f563661c0,BE18438,2025-11-15T09:22:32,T438LBX6.1K0W,Vert,0.2883,0.2930,0.984,0.2,0
456ae646-c834-4e5c-82f1-7df18b3440a1,BE18438,2025-11-15T09:25:31,T438LBX6.6J0W,Vert,0.3189,0.3223,0.989,0.2,0
afb91ba2-351b-42a0-b33f-acebd5f1829d,BE18438,2025-11-15T09:28:29,T438LBX6.BH0W,Vert,0.3057,0.3076,0.994,0.2,0
39847146-3537-4300-943d-01c0c771e9cd,BE18438,2025-11-15T09:31:26,T438LBX6.GE0W,Vert,0.3225,0.3271,0.986,0.2,0
e47335c1-fc3f-4c90-88c6-8edd0f296ce4,BE18438,2025-11-15T09:34:24,T438LBX6.LC0W,Vert,0.3275,0.3320,0.986,0.2,0
25b6eda6-ba98-422f-8834-94b6cbe34971,BE18438,2025-11-15T09:37:22,T438LBX6.QA0W,Vert,0.3398,0.3418,0.994,0.2,0
7af99377-e47f-4914-8e91-ac7f7f50b8c6,BE18438,2025-11-15T09:40:20,T438LBX6.V80W,Vert,0.3515,0.3564,0.986,0.2,0
c4330605-c257-49ef-aede-20deb641e7d7,BE18438,2025-11-15T10:09:48,T438LBX8.8C0W,Vert,0.3605,0.3955,0.912,0.2,0
b665caf9-64ee-4352-a391-60c1ddeebc1e,BE18438,2026-02-25T10:58:04,T438LH66.GS0W,Vert,0.1803,0.1953,0.923,0.2,0
3b0c32c3-fd16-4b83-9917-942a56dea168,BE18438,2026-02-25T18:12:04,T438LH6Q.K40W,Vert,0.1869,0.1953,0.957,0.2,0
ca66e601-d10f-4424-9c26-08a688e7b08c,BE18438,2026-02-25T18:17:16,T438LH6Q.SS0W,Vert,0.1870,0.1953,0.958,0.2,0
31aa30ba-eb0a-49a9-98ca-c77d2cc31275,BE18438,2026-02-25T18:21:11,T438LH6Q.ZB0W,Vert,0.1868,0.1953,0.956,0.2,0
fdb55a93-fc91-4fdf-a7f4-fdd1a6b48f59,BE18438,2026-02-25T18:26:27,T438LH6R.830W,Vert,0.1893,0.1953,0.969,0.2,0
cbd718d7-2378-4d74-8656-842f229d19a8,BE18438,2026-02-25T18:33:25,T438LH6R.JP0W,Vert,0.1887,0.1953,0.966,0.2,0
bfaf58ec-6163-47eb-9d2a-70da880bd948,BE18438,2026-02-25T18:37:48,T438LH6R.R00W,Vert,0.1872,0.1953,0.959,0.2,0
ddaa530b-886e-4415-b93a-f4ebf4c4a882,BE18438,2026-02-25T18:59:54,T438LH6S.RU0W,Vert,0.1874,0.1953,0.959,0.2,0
57f15284-ab69-48fc-9660-8c347c80c681,BE18438,2026-02-25T19:15:58,T438LH6T.IM0W,Vert,0.1873,0.1953,0.959,0.2,0
03715718-7aa8-4e1d-9b0b-c2ab75fc1975,BE18438,2026-02-25T19:19:58,T438LH6T.PA0W,Vert,0.1891,0.1953,0.968,0.2,0
9f921cd5-1bf9-4713-aef6-41e7f780eff1,BE18438,2026-02-25T19:24:02,T438LH6T.W20W,Vert,0.1871,0.1953,0.958,0.2,0
44994949-58d4-44fa-bd78-ed75b8acc667,BE18438,2026-02-25T19:44:57,T438LH6U.UX0W,Vert,0.1877,0.1953,0.961,0.2,0
c4be01c3-1001-4e17-aecd-d6d26dbb09f3,BE18438,2026-02-25T19:49:19,T438LH6V.270W,Vert,0.1884,0.1953,0.964,0.2,0
3db004e6-ee34-43c5-ae8e-f22894ead5d0,BE18438,2026-02-25T20:08:22,T438LH6V.XY0W,Vert,0.1878,0.1953,0.962,0.2,0
d276ae48-0434-41e5-af43-e0fb366acf11,BE18438,2026-02-25T20:11:33,T438LH6W.390W,Vert,0.1880,0.1953,0.963,0.2,0
c027dc12-88fd-4a45-872b-a6a945f2008e,BE18438,2026-02-25T20:14:35,T438LH6W.8B0W,Vert,0.1874,0.1953,0.959,0.2,0
9665bc3a-3d08-4852-b008-37ef8bfd0023,BE18438,2026-02-25T20:18:51,T438LH6W.FF0W,Vert,0.1884,0.1953,0.965,0.2,0
5fb5a05e-d7e2-4268-9b85-cfe8d82aa6c9,BE18438,2026-02-25T20:29:50,T438LH6W.XQ0W,Vert,0.1890,0.1953,0.968,0.2,0
57ec0b10-9324-4459-a07e-0c8532b8928f,BE18438,2026-02-25T20:35:39,T438LH6X.7F0W,Vert,0.1889,0.1953,0.967,0.2,0
ac86f73f-1174-4fae-a206-ecdcb73e1ffc,BE18438,2026-02-25T20:39:12,T438LH6X.DC0W,Vert,0.1887,0.1953,0.966,0.2,0
dcf25ddd-9cf0-41c1-b109-f3ef2e490ce5,BE18438,2026-02-25T20:43:41,T438LH6X.KT0W,Vert,0.1871,0.1953,0.958,0.2,0
aa79bbdd-2392-4ef6-8a5c-873a9f72746d,BE18438,2026-02-25T20:46:51,T438LH6X.Q30W,Vert,0.1877,0.1953,0.961,0.2,0
ad46d1ce-b417-4c8c-b029-bb3b008ba809,BE18438,2026-02-25T20:53:33,T438LH6Y.190W,Vert,0.1882,0.1953,0.964,0.2,0
3d3a8f34-86a7-4d70-a7e8-fa768a723325,BE18438,2026-02-26T07:03:39,T438LH7Q.A30W,Vert,0.1809,0.1953,0.926,0.2,0
7817525f-dc3d-4f5e-b2cb-5af9ca12ede8,BE18438,2026-02-26T07:09:42,T438LH7Q.K60W,Vert,0.1814,0.1953,0.929,0.2,0
a2091302-0b34-46c1-ab83-174be2b59bcf,BE18438,2026-02-26T13:12:35,T438LH87.CZ0W,Vert,0.1896,0.1953,0.971,0.2,0
e1c0c9de-a900-479f-9572-9675b13296a9,BE18438,2026-02-26T13:24:46,T438LH87.XA0W,Vert,0.2237,0.2588,0.864,0.2,0
76a6dc6b-88e1-434b-a137-f5e9b63f248e,BE18438,2026-02-26T13:27:43,T438LH88.270W,Vert,0.3185,0.3223,0.988,0.2,0
281b508b-7982-4668-86af-9b0b28be608a,BE18438,2026-02-26T13:30:36,T438LH88.700W,Vert,0.3263,0.3320,0.983,0.2,0
68bbaf77-bb23-40fd-94f9-f928728d90dc,BE18438,2026-02-26T13:33:28,T438LH88.BS0W,Vert,0.3207,0.3271,0.980,0.2,0
5c975640-6ff1-441a-aa11-41642f6a6b31,BE18438,2026-02-26T13:36:21,T438LH88.GL0W,Vert,0.3261,0.3320,0.982,0.2,0
dea248ac-1124-4bba-b054-953f86c852b2,BE18438,2026-02-26T13:40:34,T438LH88.NM0W,Vert,0.3271,0.3320,0.985,0.2,0
4e463201-f008-41ad-9c52-11fcc3d93095,BE18438,2026-02-26T13:43:29,T438LH88.SH0W,Vert,0.3357,0.3418,0.982,0.2,0
507262c5-d58f-4a05-a6a3-a6cbb5b4de20,BE18438,2026-02-26T13:46:24,T438LH88.XC0W,Vert,0.3372,0.3418,0.987,0.2,0
4c2d8ee8-842f-4e44-9e03-ff34d26e4fdb,BE18438,2026-02-26T13:49:17,T438LH89.250W,Vert,0.3253,0.3320,0.980,0.2,0
b184b112-603f-44f4-ae97-087493fbd8ce,BE18438,2026-02-26T13:52:10,T438LH89.6Y0W,Vert,0.3321,0.3369,0.986,0.2,0
2ff1a552-5a2e-4396-9083-b9c8d334eed7,BE18438,2026-02-26T13:55:04,T438LH89.BS0W,Vert,0.3378,0.3418,0.988,0.2,0
928e21a7-1990-4792-803e-58014d8140ce,BE18438,2026-02-26T13:57:57,T438LH89.GL0W,Vert,0.3341,0.3369,0.992,0.2,0
f521b5db-6100-41e6-954e-0abdbf9660c1,BE18438,2026-02-26T14:00:51,T438LH89.LF0W,Vert,0.3421,0.3467,0.987,0.2,0
efba962f-e511-41ef-9fc5-313f202a9d96,BE18438,2026-02-26T14:03:46,T438LH89.QA0W,Vert,0.3506,0.3564,0.984,0.2,0
0b51e273-8d10-4494-bda6-8c75eaeec66f,BE18438,2026-02-26T14:06:41,T438LH89.V50W,Vert,0.3448,0.3516,0.981,0.2,0
6d46e4ee-1647-4169-b6b2-33da32240eb9,BE18438,2026-02-26T14:09:35,T438LH89.ZZ0W,Vert,0.3463,0.3516,0.985,0.2,0
1ca294cd-4dc2-41fb-9374-e277d4550761,BE18438,2026-02-26T14:12:28,T438LH8A.4S0W,Vert,0.3442,0.3467,0.993,0.2,0
7b683dcf-1aed-4d9b-be1e-b10f92374398,BE18438,2026-02-26T14:15:23,T438LH8A.9N0W,Vert,0.3486,0.3516,0.992,0.2,0
2b5cb8e7-c947-4914-bcb5-504f74603547,BE18438,2026-02-26T14:18:21,T438LH8A.EL0W,Vert,0.3519,0.3613,0.974,0.2,0
5ea3a6bf-10de-4911-aedc-66daecf86b76,BE18438,2026-02-26T14:21:16,T438LH8A.JG0W,Vert,0.3460,0.3564,0.971,0.2,0
d93be7f5-39ec-45fd-9949-fa531f2f9d34,BE18438,2026-02-26T14:24:13,T438LH8A.OD0W,Vert,0.3457,0.3516,0.983,0.2,0
cfa113f2-8cee-4a1d-b1e7-0e936fa771e2,BE18438,2026-02-26T14:28:21,T438LH8A.V90W,Vert,0.3485,0.3564,0.978,0.2,0
46d322ac-38cb-4c99-a4c2-9e9d7ad06171,BE18438,2026-02-26T14:31:17,T438LH8B.050W,Vert,0.3367,0.3467,0.971,0.2,0
42500a83-bd67-4deb-8bb2-963ee2b8a7ce,BE18438,2026-02-26T14:34:11,T438LH8B.4Z0W,Vert,0.3365,0.3516,0.957,0.2,0
3ccf6bda-2e88-473c-951d-9ea86d0d9363,BE18438,2026-02-26T14:37:05,T438LH8B.9T0W,Vert,0.3472,0.3564,0.974,0.2,0
9050487d-d238-4631-b8e1-5a693a026542,BE18438,2026-02-26T14:39:58,T438LH8B.EM0W,Vert,0.3420,0.3564,0.959,0.2,0
e62989e4-a326-4bae-8d47-a8becee96462,BE18438,2026-02-26T14:42:52,T438LH8B.JG0W,Vert,0.3430,0.3564,0.962,0.2,0
f0e30fab-dc57-4189-8439-48df17007a2c,BE18438,2026-02-26T14:45:46,T438LH8B.OA0W,Vert,0.3389,0.3516,0.964,0.2,0
03e1ca09-78df-4c6f-9915-0b6e4f2141d2,BE18438,2026-02-26T14:48:43,T438LH8B.T70W,Vert,0.3449,0.3564,0.968,0.2,0
945d39f7-1b98-4a1f-80a8-6a18fd9df25f,BE18438,2026-02-26T14:51:37,T438LH8B.Y10W,Vert,0.3522,0.3613,0.975,0.2,0
d27eb2e3-e313-4125-98f4-f9d6d3737d28,BE18438,2026-02-26T14:54:32,T438LH8C.2W0W,Vert,0.3502,0.3613,0.969,0.2,0
916901cb-ebea-441e-a2a1-40f4e49f32f4,BE18438,2026-02-26T14:57:25,T438LH8C.7P0W,Vert,0.3524,0.3662,0.962,0.2,0
5d8d7e29-fdbb-4fa3-bd25-506c9352a354,BE18438,2026-02-26T15:01:35,T438LH8C.EN0W,Vert,0.3530,0.3613,0.977,0.2,0
c6c7a3af-b03b-43dc-97de-024f8e09b62f,BE18438,2026-02-26T15:04:27,T438LH8C.JF0W,Vert,0.3514,0.3613,0.973,0.2,0
b6856898-3d10-4967-9577-7f17902f77ea,BE18438,2026-02-26T15:11:34,T438LH8C.VA0W,Vert,0.3566,0.3613,0.987,0.2,0
7a4802f6-621e-4230-8d8c-d7f0c9a65bf2,BE18438,2026-02-26T15:14:24,T438LH8D.000W,Vert,0.3594,0.3711,0.968,0.2,0
79f38b7e-ec56-417e-943a-8c944252c2b8,BE18438,2026-02-26T15:18:32,T438LH8D.6W0W,Vert,0.3550,0.3613,0.983,0.2,0
1b4190c4-0d54-48ba-8ff5-8ddb0eb91e50,BE18438,2026-02-26T15:22:22,T438LH8D.DA0W,Vert,0.3571,0.3613,0.988,0.2,0
de57b5ae-a3a1-4ede-9d2b-3e87bfb3fd19,BE9558,2026-04-14T11:16:32,K558LJN3.BK0W,Tran,0.3448,0.3662,0.942,0.2,0
43afeaf5-02ec-41f6-9e23-0c9772821ed4,BE9558,2026-04-14T11:27:15,K558LJN3.TF0W,Tran,0.3094,0.3223,0.960,0.2,0
8123c0ef-84c9-4f6c-8d82-9dc32e2e470d,BE9558,2026-04-14T14:45:30,K558LJNC.ZU0W,Tran,0.2721,0.3564,0.763,0.2,0
8c787af3-596e-411b-9e10-29485fa5114f,BE9558,2026-04-29T16:18:47,K558LKF9.BB0W,Tran,0.2943,0.3027,0.972,0.2,0
431928ff-b4c4-4caa-b933-acc917f3717c,BE9558,2026-05-04T15:02:30,K558LKOF.460W,Tran,0.4364,0.5225,0.835,0.2,0
6c3c07f8-c36a-4493-acce-7441c9d22cec,BE9558,2026-05-15T08:50:06,K558LL8B.7I0W,Long,0.2892,0.2930,0.987,0.2,0
13c268df-b652-422e-a642-6453f6a314aa,BE9558,2026-05-15T10:18:34,K558LL8F.AY0W,Long,0.2907,0.2979,0.976,0.2,0
9b0d0871-8810-467d-806a-5bbfa4e667fe,BE9558,2026-05-15T15:52:00,K558LL8U.QO0W,Long,0.2659,0.2979,0.893,0.2,0
092640f9-a944-48b7-b872-364d75c2c5e7,BE9558,2026-05-15T16:13:12,K558LL8V.Q00W,Long,0.2428,0.2979,0.815,0.2,0
0573741a-96ab-4b36-af7a-b5bc11a79009,BE9558,2026-05-16T03:23:26,K558LL9Q.R20W,Long,0.2861,0.2930,0.976,0.2,0
321f03ea-6696-47de-ad46-2be43d4d6cae,BE9558,2026-05-16T03:30:49,K558LL9R.3D0W,Long,0.2886,0.2930,0.985,0.2,0
cc423a6a-3e3c-466a-b39c-6146ca7f34c8,BE9558,2026-05-16T03:33:55,K558LL9R.8J0W,Long,0.2880,0.2881,1.000,0.2,0
efa52a14-cc68-4bea-aab4-4ee3a3cbff3a,BE9558,2026-05-16T03:36:55,K558LL9R.DJ0W,Long,0.2890,0.2930,0.986,0.2,0
92895bfe-122f-4cdc-bd3d-40609633d278,BE9558,2026-05-16T03:43:41,K558LL9R.OT0W,Long,0.2880,0.2881,1.000,0.2,0
2a4c81db-2307-44e5-9b27-d5154d98e38d,BE9558,2026-05-16T03:46:36,K558LL9R.TO0W,Long,0.2921,0.2979,0.981,0.2,0
656b0fdc-e275-4c9c-8936-9eee267ea04e,BE9558,2026-05-16T03:49:28,K558LL9R.YG0W,Long,0.2966,0.2979,0.996,0.2,0
3b9989ae-e0f2-4652-9724-c145603543d2,BE9558,2026-05-16T03:52:29,K558LL9S.3H0W,Long,0.2880,0.2930,0.983,0.2,0
837d0d84-d609-4f4a-b542-b7e2b064ea22,BE9558,2026-05-16T03:56:32,K558LL9S.A80W,Long,0.2880,0.2930,0.983,0.2,0
affcb008-ab99-4bc5-8f35-83dbe620499d,BE9558,2026-05-16T04:02:50,K558LL9S.KQ0W,Long,0.2896,0.2930,0.989,0.2,0
e1f1c6d2-545c-451f-9018-714d52e20a05,BE9558,2026-05-16T04:05:47,K558LL9S.PN0W,Long,0.3024,0.3076,0.983,0.2,0
93ef80f1-7e83-4703-a0f9-89bbfeeae6c3,BE9558,2026-05-16T04:08:41,K558LL9S.UH0W,Long,0.2976,0.2979,0.999,0.2,0
5c118ca9-fc37-4080-876d-b3f57ce0b121,BE9558,2026-05-16T04:11:42,K558LL9S.ZI0W,Long,0.2881,0.2930,0.983,0.2,0
d98b2eaa-7763-4c78-88fb-c21195cb9978,BE9558,2026-05-16T04:14:38,K558LL9T.4E0W,Long,0.2898,0.2930,0.989,0.2,0
6a146a01-0d02-4413-b231-ecb4a6fde776,BE9558,2026-05-16T04:17:35,K558LL9T.9B0W,Long,0.2880,0.2930,0.983,0.2,0
f6587a55-27e3-454f-997e-57e7516a296c,BE9558,2026-05-16T04:20:32,K558LL9T.E80W,Long,0.3046,0.3076,0.990,0.2,0
1fb48250-2214-41e6-92cb-362aff1ba62b,BE9558,2026-05-16T04:26:05,K558LL9T.NH0W,Long,0.2876,0.2930,0.982,0.2,0
2f4f3d06-1189-4e28-a1ac-5454ea586a0c,BE9558,2026-05-16T04:59:47,K558LL9V.7N0W,Long,0.2961,0.3027,0.978,0.2,0
62b7bdab-b744-41e4-8d0e-c9141b9d4821,BE9558,2026-05-16T05:02:46,K558LL9V.CM0W,Long,0.2903,0.2930,0.991,0.2,0
cadcb6dc-74c0-48b5-974c-87bb7a57816c,BE9558,2026-05-16T05:05:43,K558LL9V.HJ0W,Long,0.3090,0.3125,0.989,0.2,0
a0235177-be5a-4f11-b741-c65744698e5b,BE9558,2026-05-16T05:08:35,K558LL9V.MB0W,Long,0.3167,0.3223,0.983,0.2,0
1968c2f6-f52c-4544-a0ed-f79b91ce0da0,BE9558,2026-05-16T05:11:28,K558LL9V.R40W,Long,0.3446,0.3516,0.980,0.2,0
caa06b94-8813-4949-b47b-61ffb16e61c4,BE9558,2026-05-16T05:14:22,K558LL9V.VY0W,Long,0.3318,0.3320,0.999,0.2,0
fdaa8101-f033-47e6-9c65-abd76dea1870,BE9558,2026-05-16T05:17:16,K558LL9W.0S0W,Long,0.3407,0.3418,0.997,0.2,0
29bd16bd-81b9-4ccd-a981-f1a80858536c,BE9558,2026-05-16T05:23:05,K558LL9W.AH0W,Long,0.3450,0.3516,0.981,0.2,0
1f8bc862-d5fd-4cce-abc0-e2bd8c2f11fa,BE9558,2026-05-16T05:26:00,K558LL9W.FC0W,Long,0.3417,0.3467,0.986,0.2,0
20220068-d498-4fca-9a2a-a7fd2ee52ab1,BE9558,2026-05-16T05:28:53,K558LL9W.K50W,Long,0.3516,0.3564,0.986,0.2,0
9816a261-3118-417a-8334-ace36687ad8f,BE9558,2026-05-16T05:31:47,K558LL9W.OZ0W,Long,0.3416,0.3467,0.985,0.2,0
5d2c76d7-543d-4557-9caf-996a69ab00bd,BE9558,2026-05-16T05:34:42,K558LL9W.TU0W,Long,0.3537,0.3564,0.992,0.2,0
c7b5ae00-52e7-4920-aa27-49d3b3daff92,BE9558,2026-05-16T05:37:36,K558LL9W.YO0W,Long,0.3517,0.3564,0.987,0.2,0
07db8fd8-ccef-4a5a-9d97-9f318f73a478,BE9558,2026-05-16T05:40:31,K558LL9X.3J0W,Long,0.3574,0.3613,0.989,0.2,0
790fcff9-e266-4a12-87f0-a072990d2533,BE9558,2026-05-16T05:43:26,K558LL9X.8E0W,Long,0.3650,0.3662,0.997,0.2,0
f4245f61-1dde-43dc-a121-98e102f6a193,BE9558,2026-05-16T05:50:28,K558LL9X.K40W,Long,0.3856,0.3906,0.987,0.2,0
5a3bce7b-358e-4260-876f-3f853163d7cf,BE9558,2026-05-16T05:53:22,K558LL9X.OY0W,Long,0.3847,0.3857,0.997,0.2,0
37c2b4b1-7a1b-43e7-b513-2c16f582109c,BE9558,2026-05-16T05:56:15,K558LL9X.TR0W,Long,0.3906,0.3955,0.988,0.2,0
57fde109-1d8a-45a1-b398-5bd28c3e47f1,BE9558,2026-05-16T05:59:10,K558LL9X.YM0W,Long,0.4000,0.4004,0.999,0.2,0
1e41ab40-93be-405c-a464-f7a57524d3b3,BE9558,2026-05-16T06:02:02,K558LL9Y.3E0W,Long,0.3825,0.3857,0.992,0.2,0
e9d61eb5-fae8-4902-8fab-4828ffa8e6da,BE9558,2026-05-16T06:04:57,K558LL9Y.890W,Long,0.3802,0.3809,0.998,0.2,0
c0e964e0-7788-4e41-bc41-6e479c3dc81b,BE9558,2026-05-16T06:07:51,K558LL9Y.D30W,Long,0.3954,0.4004,0.987,0.2,0
0b2df8e5-1689-4fe6-abad-30970ba10aa6,BE9558,2026-05-16T06:16:06,K558LL9Y.QU0W,Long,0.4051,0.4053,1.000,0.2,0
2bc6ce73-464b-469c-9e8f-3bf6f6cfae1d,BE9558,2026-05-16T06:21:51,K558LL9Z.0F0W,Long,0.3910,0.3955,0.989,0.2,0
b8603ee1-616a-451e-a2cd-61f8f2634cd0,BE9558,2026-05-16T06:24:44,K558LL9Z.580W,Long,0.3969,0.4004,0.991,0.2,0
1aecf582-66a2-4ebb-80f9-04b3aeba331a,BE9558,2026-05-16T06:27:39,K558LL9Z.A30W,Long,0.3915,0.3955,0.990,0.2,0
885aedfd-7a1a-4120-8176-7c344dd3d8fe,BE9558,2026-05-16T06:30:30,K558LL9Z.EU0W,Long,0.4025,0.4053,0.993,0.2,0
ec15930f-47f5-4752-afc2-427ee156ac95,BE9558,2026-05-16T06:33:25,K558LL9Z.JP0W,Long,0.4060,0.4102,0.990,0.2,0
5ca23f47-2a38-4a54-99dd-041287aa9510,BE9558,2026-05-16T06:36:17,K558LL9Z.OH0W,Long,0.4054,0.4102,0.988,0.2,0
03f371cf-81bc-4681-80f0-ef6fa437da85,BE9558,2026-05-16T06:39:09,K558LL9Z.T90W,Long,0.4052,0.4102,0.988,0.2,0
ed386f54-140d-45e8-ad51-6585a58b4375,BE9558,2026-05-16T06:44:54,K558LLA0.2U0W,Long,0.3993,0.4004,0.997,0.2,0
579f1c3f-4c1e-42a3-aa89-69aa93514033,BE9558,2026-05-16T06:47:47,K558LLA0.7N0W,Long,0.4001,0.4053,0.987,0.2,0
57024de6-07ea-41f4-b916-c6adc3f51636,BE9558,2026-05-16T06:50:40,K558LLA0.CG0W,Long,0.4103,0.4150,0.989,0.2,0
36bf5adf-afb5-4a5e-a106-1afbd1f56c7b,BE9558,2026-05-16T06:54:49,K558LLA0.JD0W,Long,0.4069,0.4150,0.980,0.2,0
3e2f831b-5228-46ff-9acb-75d8c86f8bc1,BE9558,2026-05-16T06:57:43,K558LLA0.O70W,Long,0.4108,0.4150,0.990,0.2,0
1775fa20-568b-4294-b9ca-561201a66c5b,BE9558,2026-05-16T07:00:38,K558LLA0.T20W,Long,0.3967,0.4004,0.991,0.2,0
fd391469-03f9-4d8d-bccd-3af50c91e5b7,BE9558,2026-05-16T07:03:33,K558LLA0.XX0W,Long,0.3927,0.3955,0.993,0.2,0
02b52ef6-b707-4dcb-b58f-43da02698832,BE9558,2026-05-16T07:06:27,K558LLA1.2R0W,Long,0.3824,0.3857,0.991,0.2,0
8d45333f-e101-4249-9e27-913c583a0a8d,BE9558,2026-05-16T07:09:21,K558LLA1.7L0W,Long,0.4085,0.4150,0.984,0.2,0
361d11ce-f42a-4d04-8270-ee3771fe4f09,BE9558,2026-05-16T07:12:14,K558LLA1.CE0W,Long,0.4017,0.4053,0.991,0.2,0
59218125-ed5d-4457-aa8b-35ba03441363,BE9558,2026-05-16T07:15:07,K558LLA1.H70W,Long,0.3934,0.3955,0.995,0.2,0
a603e55a-2ad6-4fc9-8c8c-0dc7be95c3e7,BE9558,2026-05-16T07:23:43,K558LLA1.VJ0W,Long,0.3806,0.3857,0.987,0.2,0
c8d07902-93ea-4b03-9e69-9ad6ed5bffb1,BE9558,2026-05-16T07:26:36,K558LLA2.0C0W,Long,0.3807,0.3857,0.987,0.2,0
4c46c0c7-42f0-4648-827e-1995f733b18f,BE9558,2026-05-16T07:30:44,K558LLA2.780W,Long,0.3667,0.3711,0.988,0.2,0
04759a00-ba3e-4959-a4cb-be8fc1f3004e,BE9558,2026-05-16T07:36:28,K558LLA2.GS0W,Long,0.3514,0.3516,1.000,0.2,0
0b6b0856-bd87-4a07-a5b4-f13d99e04a12,BE9558,2026-05-16T07:39:20,K558LLA2.LK0W,Long,0.3512,0.3516,0.999,0.2,0
3d81a8bd-464d-4050-8a76-25e8373d1ddb,BE9558,2026-05-16T07:42:12,K558LLA2.QC0W,Long,0.3350,0.3369,0.994,0.2,0
b8b9c0c4-c388-4acb-955a-be4ac356afce,BE9558,2026-05-16T07:45:04,K558LLA2.V40W,Long,0.3563,0.3564,1.000,0.2,0
cb3d142a-fb84-4a21-a298-f61bb869b036,BE9558,2026-05-16T07:49:13,K558LLA3.210W,Long,0.3663,0.3711,0.987,0.2,0
7401b19b-bc9d-43f0-b395-f4323aca5c72,BE9558,2026-05-16T07:52:06,K558LLA3.6U0W,Long,0.3612,0.3662,0.986,0.2,0
2236df76-a9e6-401f-9176-ad565242f2cf,BE9558,2026-05-16T07:57:52,K558LLA3.GG0W,Long,0.3366,0.3369,0.999,0.2,0
a645846c-cae4-4aa5-a2e6-85166bd4dd62,BE9558,2026-05-16T08:00:44,K558LLA3.L80W,Long,0.3265,0.3271,0.998,0.2,0
7212bd33-99a9-4659-9f0b-c98cc8d1e8bc,BE9558,2026-05-16T08:04:51,K558LLA3.S30W,Long,0.3418,0.3467,0.986,0.2,0
2cc4bf33-c63a-4c65-b0e2-5e61a9146a5d,BE9558,2026-05-16T08:07:43,K558LLA3.WV0W,Long,0.3405,0.3418,0.996,0.2,0
4fedb486-5f1f-4623-a01f-083e829f0565,BE9558,2026-05-16T08:10:35,K558LLA4.1N0W,Long,0.3515,0.3564,0.986,0.2,0
58aff0ba-0f9b-45e1-9bbe-a990d16192ae,BE9558,2026-05-16T08:13:27,K558LLA4.6F0W,Long,0.3513,0.3516,0.999,0.2,0
e56d87e5-e1d4-4947-b6a5-3bbd2773c54a,BE9558,2026-05-16T08:20:03,K558LLA4.HF0W,Long,0.3564,0.3613,0.986,0.2,0
0e96e61e-6a21-4e07-8e09-72d09dbfa1e6,BE9558,2026-05-16T08:25:21,K558LLA4.Q90W,Long,0.3565,0.3613,0.987,0.2,0
19611f28-2da8-4362-a58e-dbed2e061379,BE9558,2026-05-16T08:34:19,K558LLA5.570W,Long,0.3647,0.3662,0.996,0.2,0
bd580c1d-44d4-41fd-9f83-f462cda4099a,BE9558,2026-05-16T08:37:15,K558LLA5.A30W,Long,0.3536,0.3564,0.992,0.2,0
2782df3b-3cb4-471a-a6f5-bbc4903a8ab9,BE9558,2026-05-16T08:44:00,K558LLA5.LC0W,Long,0.3612,0.3662,0.986,0.2,0
d15a08f3-1c7c-4f80-8d9b-f5008c58c3d9,BE9558,2026-05-16T08:49:18,K558LLA5.U60W,Long,0.3610,0.3613,0.999,0.2,0
03a10a6a-193a-476c-9543-f63818f69417,BE9558,2026-05-16T08:54:36,K558LLA6.300W,Long,0.3515,0.3516,1.000,0.2,0
1c271856-8100-4c0d-bc8c-9357b47d7626,BE9558,2026-05-16T08:59:54,K558LLA6.BU0W,Long,0.3617,0.3662,0.988,0.2,0
a85f125e-bfa2-42be-b877-2604b8d068c8,BE9558,2026-05-16T09:05:17,K558LLA6.KT0W,Long,0.3510,0.3516,0.998,0.2,0
dde9aa71-d2e3-41ac-8388-f2bbddb6dae6,BE9558,2026-05-16T09:08:11,K558LLA6.PN0W,Long,0.3447,0.3467,0.994,0.2,0
2f3f2be2-0ee3-422e-b3ad-83fb87512a2b,BE9558,2026-05-16T09:14:39,K558LLA7.0F0W,Long,0.3580,0.3613,0.991,0.2,0
357a3034-8a9c-485e-8cb6-f526dd2baf6f,BE9558,2026-05-16T09:29:11,K558LLA7.ON0W,Long,0.3708,0.3760,0.986,0.2,0
f8ad0274-8e6f-4714-82ff-d229e60f1442,BE9558,2026-05-16T09:32:06,K558LLA7.TI0W,Long,0.3567,0.3613,0.987,0.2,0
42bb007a-2726-401a-b085-c25151b0dc24,BE9558,2026-05-16T09:35:02,K558LLA7.YE0W,Long,0.3575,0.3613,0.989,0.2,0
c99bfc4a-db02-4bea-bea4-943c67485dba,BE9558,2026-05-16T09:37:58,K558LLA8.3A0W,Long,0.3527,0.3564,0.989,0.2,0
8fc17de0-73f7-48bd-8d93-5451dce47e8e,BE9558,2026-05-16T09:40:52,K558LLA8.840W,Long,0.3613,0.3662,0.987,0.2,0
bbee5276-03dd-4ca4-a7b9-aec02baac7e8,BE9558,2026-05-16T09:48:13,K558LLA8.KD0W,Long,0.3590,0.3613,0.993,0.2,0
8dcdee10-db01-4224-9506-4181c3105d6f,BE9558,2026-05-16T09:53:31,K558LLA8.T70W,Long,0.3588,0.3613,0.993,0.2,0
48c8be72-64d9-4da3-95b5-bbec2c5e1dbd,BE9558,2026-05-16T09:58:49,K558LLA9.210W,Long,0.3582,0.3662,0.978,0.2,0
0da20919-7ce9-4feb-8ae9-12d9bb40c2b5,BE9558,2026-05-16T10:04:07,K558LLA9.AV0W,Long,0.3506,0.3516,0.997,0.2,0
c2f7e9bc-8b93-42c3-96d3-e3af217dde35,BE9558,2026-05-16T10:09:25,K558LLA9.JP0W,Long,0.3506,0.3516,0.997,0.2,0
522a0e42-d443-4447-bc71-af1832c6604e,BE9558,2026-05-16T10:14:43,K558LLA9.SJ0W,Long,0.3624,0.3662,0.990,0.2,0
67f7e732-3c0b-439f-87c5-3c478a381418,BE9558,2026-05-16T10:20:01,K558LLAA.1D0W,Long,0.3494,0.3516,0.994,0.2,0
251767e8-56f7-4091-a001-364d8e75c15c,BE9558,2026-05-16T10:25:19,K558LLAA.A70W,Long,0.3463,0.3516,0.985,0.2,0
9457239d-a4ca-4476-b385-5e01fc8f6420,BE9558,2026-05-16T10:30:37,K558LLAA.J10W,Long,0.3436,0.3467,0.991,0.2,0
43718d7c-9353-49e1-89b6-0841aeb1b276,BE9558,2026-05-16T10:35:55,K558LLAA.RV0W,Long,0.3452,0.3516,0.982,0.2,0
f54ba557-ddfe-41d3-8f4c-8bbec9a3783c,BE9558,2026-05-16T10:41:13,K558LLAB.0P0W,Long,0.3419,0.3467,0.986,0.2,0
dc26c758-ad99-49c1-b518-931368cdf8cf,BE9558,2026-05-16T10:46:31,K558LLAB.9J0W,Long,0.3463,0.3516,0.985,0.2,0
10917eb2-d151-461c-a8cb-e9660da5a5b0,BE9558,2026-05-16T10:51:49,K558LLAB.ID0W,Long,0.3520,0.3564,0.987,0.2,0
4938a5e6-d53b-40ee-be2b-06ec0e60398c,BE9558,2026-05-16T10:57:07,K558LLAB.R70W,Long,0.3541,0.3564,0.993,0.2,0
0711b51d-55bd-48be-b51e-2aad67107a60,BE9558,2026-05-16T11:13:01,K558LLAC.HP0W,Long,0.3661,0.3711,0.986,0.2,0
065564b6-aa49-40e7-9ea6-c75defdc60fe,BE9558,2026-05-16T11:18:19,K558LLAC.QJ0W,Long,0.3622,0.3662,0.989,0.2,0
ffb6b230-1d70-4e0e-ba30-e945339a122a,BE9558,2026-05-16T11:23:37,K558LLAC.ZD0W,Long,0.3711,0.3760,0.987,0.2,0
52b4da82-c1e0-4a8a-8365-51b090787005,BE9558,2026-05-16T11:28:55,K558LLAD.870W,Long,0.3644,0.3662,0.995,0.2,0
cdbff3d8-fbfe-4bea-8bd6-c898800e81ba,BE9558,2026-05-16T11:39:31,K558LLAD.PV0W,Long,0.3609,0.3662,0.986,0.2,0
3fb0bc30-1463-4cfc-9e7f-386c0eb2a34a,BE9558,2026-05-16T11:44:49,K558LLAD.YP0W,Long,0.3553,0.3564,0.997,0.2,0
ba1f5ec8-aef7-4a9e-ac1f-276cf016e285,BE9558,2026-05-16T11:50:07,K558LLAE.7J0W,Long,0.3479,0.3516,0.990,0.2,0
b1dd4df7-34a9-4512-a903-f8242b236fd2,BE9558,2026-05-16T11:55:25,K558LLAE.GD0W,Long,0.3427,0.3467,0.988,0.2,0
1f23aa28-c026-4bc7-b3d1-7c78fd76a673,BE9558,2026-05-16T12:00:43,K558LLAE.P70W,Long,0.3454,0.3467,0.996,0.2,0
0d91f54d-b20d-4a50-b7dd-d071c39a0690,BE9558,2026-05-16T12:06:01,K558LLAE.Y10W,Long,0.3431,0.3467,0.990,0.2,0
12ccdecd-5fd9-4465-9813-3d6006ec32f3,BE9558,2026-05-16T12:11:19,K558LLAF.6V0W,Long,0.3433,0.3467,0.990,0.2,0
a7024f1a-f071-48ab-820f-99bdf87366b5,BE9558,2026-05-16T12:16:37,K558LLAF.FP0W,Long,0.3361,0.3369,0.998,0.2,0
de0fa439-30b8-4607-a3c3-7e17191e4624,BE9558,2026-05-16T12:21:55,K558LLAF.OJ0W,Long,0.3274,0.3320,0.986,0.2,0
f9374ec3-05e5-477f-8e1a-0c862fed2a50,BE9558,2026-05-16T12:27:13,K558LLAF.XD0W,Long,0.3449,0.3467,0.995,0.2,0
424cb275-3743-4174-95f0-0ca1205b374c,BE9558,2026-05-16T12:32:31,K558LLAG.670W,Long,0.3370,0.3418,0.986,0.2,0
9accde13-cefa-41b8-bd0a-cef2ffed59b0,BE9558,2026-05-16T12:37:49,K558LLAG.F10W,Long,0.3465,0.3467,0.999,0.2,0
4665be38-1956-4b14-b931-068ba9af5c5e,BE9558,2026-05-16T12:48:25,K558LLAG.WP0W,Long,0.3453,0.3516,0.982,0.2,0
1aedf624-1a99-43e1-a8f2-f9d358b97f61,BE9558,2026-05-16T12:53:43,K558LLAH.5J0W,Long,0.3366,0.3418,0.985,0.2,0
c15e1799-91d7-425e-ad17-2ba3d170d81e,BE9558,2026-05-16T13:04:19,K558LLAH.N70W,Long,0.3348,0.3369,0.994,0.2,0
72d4c4ea-19ca-4cc6-9b04-7a2b70122c67,BE9558,2026-05-16T13:09:37,K558LLAH.W10W,Long,0.3272,0.3320,0.986,0.2,0
b4ebf2c9-1f6d-4594-9810-40479e87c0a5,BE9558,2026-05-16T13:14:55,K558LLAI.4V0W,Long,0.3297,0.3320,0.993,0.2,0
bb297e9e-548f-4dae-8b1a-0f161af2e766,BE9558,2026-05-16T13:20:13,K558LLAI.DP0W,Long,0.3272,0.3320,0.986,0.2,0
87562c24-63db-48bd-9962-72a20a40f2ff,BE9558,2026-05-16T13:36:07,K558LLAJ.470W,Long,0.3174,0.3223,0.985,0.2,0
01e9cc58-3bea-4f38-8499-a2c20e5f8550,BE9558,2026-05-16T13:46:52,K558LLAJ.M40W,Long,0.2880,0.2930,0.983,0.2,0
5ae7503d-ae17-4063-9208-6a420699e1ab,BE9558,2026-05-16T14:00:35,K558LLAK.8Z0W,Long,0.2879,0.2930,0.983,0.2,0
e009ea3c-1534-4154-8623-e180ed4db9fb,BE9558,2026-05-16T14:06:19,K558LLAK.IJ0W,Long,0.2882,0.2930,0.984,0.2,0
cd4e21f5-512b-4b2b-8054-bec01aa06400,BE9558,2026-05-16T14:12:03,K558LLAK.S30W,Long,0.2857,0.2930,0.975,0.2,0
ae5b780f-2038-4ccf-8bfc-b15b87be139e,BE9558,2026-05-16T14:17:22,K558LLAL.0Y0W,Long,0.2899,0.2930,0.989,0.2,0
d8c3fb81-8c66-4ebc-b33a-0559bc03334b,BE9558,2026-05-16T14:22:40,K558LLAL.9S0W,Long,0.3009,0.3027,0.994,0.2,0
990a4c7a-3c51-4d4a-8ab7-416ccb97d29c,BE9558,2026-05-16T14:27:58,K558LLAL.IM0W,Long,0.3057,0.3076,0.994,0.2,0
68d7a2c3-d899-4e75-96fb-3bf16ae6ea6f,BE9558,2026-05-16T14:33:16,K558LLAL.RG0W,Long,0.3110,0.3125,0.995,0.2,0
73505b8c-f912-4116-b903-a8a4c75524d3,BE9558,2026-05-16T14:38:34,K558LLAM.0A0W,Long,0.3172,0.3223,0.984,0.2,0
8d3c9602-7efa-488a-801b-3228bd85ab14,BE9558,2026-05-16T14:43:51,K558LLAM.930W,Long,0.3136,0.3174,0.988,0.2,0
243e16ee-860a-4960-bc15-b797ad7e9735,BE9558,2026-05-16T14:49:08,K558LLAM.HW0W,Long,0.3135,0.3174,0.988,0.2,0
e90c8d90-6d41-4788-9ee6-a29e4bfcc16b,BE9558,2026-05-16T15:19:35,K558LLAN.WN0W,Long,0.3132,0.3174,0.987,0.2,0
4182b0e7-7811-46b8-87d1-a4dd0c152f3b,BE9558,2026-05-16T15:28:45,K558LLAO.BX0W,Long,0.3023,0.3076,0.983,0.2,0
28a790da-0e48-4fe4-b8ba-2c82cc6bfa79,BE9558,2026-05-16T15:34:02,K558LLAO.KQ0W,Long,0.3176,0.3223,0.985,0.2,0
093d2fa3-7a4b-4f0f-abda-71155ebe2dfb,BE9558,2026-05-16T15:39:19,K558LLAO.TJ0W,Long,0.3223,0.3271,0.985,0.2,0
68dc9560-4082-49b6-af04-9244773ffbc1,BE9558,2026-05-16T15:44:36,K558LLAP.2C0W,Long,0.3227,0.3271,0.986,0.2,0
ad6b268a-165d-4b1d-b0b3-f58db7c9b0e4,BE9558,2026-05-16T15:49:53,K558LLAP.B50W,Long,0.3177,0.3223,0.986,0.2,0
046c5cb4-56b3-48c0-83c2-bf1f30837940,BE9558,2026-05-16T15:55:10,K558LLAP.JY0W,Long,0.3174,0.3223,0.985,0.2,0
1b76edf4-3b1c-4bcb-a73c-27334981c350,BE9558,2026-05-16T16:00:27,K558LLAP.SR0W,Long,0.3127,0.3174,0.985,0.2,0
a0264171-a682-4396-ad8a-cda3b2964533,BE9558,2026-05-16T16:06:55,K558LLAQ.3J0W,Long,0.2885,0.2930,0.985,0.2,0
707da1f6-ee81-4e57-abd5-98295c14651b,BE9558,2026-05-16T16:12:30,K558LLAQ.CU0W,Long,0.2880,0.2930,0.983,0.2,0
b8115b64-8739-42c8-b541-713ab6b68bcd,BE9558,2026-05-16T16:17:53,K558LLAQ.LT0W,Long,0.2881,0.2930,0.983,0.2,0
fb179c36-fef1-4df6-b0a0-2bd7792ea910,BE9558,2026-05-16T16:23:11,K558LLAQ.UN0W,Long,0.2933,0.2979,0.985,0.2,0
0cec8793-c3c1-486b-a33a-4dbf9cb069b0,BE9558,2026-05-16T16:33:46,K558LLAR.CA0W,Long,0.3017,0.3027,0.997,0.2,0
c531b052-ee04-4c66-888b-21e97445a615,BE9558,2026-05-16T16:49:37,K558LLAS.2P0W,Long,0.2922,0.2979,0.981,0.2,0
0dc402f9-cab6-4c4a-8317-b8fc3c4b1ced,BE9558,2026-05-16T16:55:08,K558LLAS.BW0W,Long,0.2898,0.2930,0.989,0.2,0
fd73733e-b42d-4a51-81d0-4acad6edfbd4,BE9558,2026-05-16T17:16:17,K558LLAT.B50W,Long,0.3115,0.3125,0.997,0.2,0
6a254daa-ae27-4ac1-b334-58f776a6b276,BE9558,2026-05-16T17:26:51,K558LLAT.SR0W,Long,0.3174,0.3223,0.985,0.2,0
0cc8e82f-5270-4508-beae-0d3af56095ca,BE9558,2026-05-16T17:37:27,K558LLAU.AF0W,Long,0.2899,0.2930,0.989,0.2,0
00557a73-8dc3-4cd2-b880-c7820dc8b171,BE9558,2026-05-16T17:43:17,K558LLAU.K50W,Long,0.2881,0.2930,0.983,0.2,0
8e5518d9-ff0a-4c09-9cf9-a681c84c0b6e,BE9558,2026-05-16T17:53:53,K558LLAV.1T0W,Long,0.2898,0.2930,0.989,0.2,0
91dbd7e9-7344-400b-82b1-379f2ac4b49a,BE9558,2026-05-16T17:59:11,K558LLAV.AN0W,Long,0.2925,0.2930,0.998,0.2,0
fa256408-d480-4376-95b5-d1a549c483ea,BE9558,2026-05-16T18:04:29,K558LLAV.JH0W,Long,0.2977,0.3027,0.983,0.2,0
4ab6e66a-8364-49b6-82f1-86e86199e676,BE9558,2026-05-16T18:09:46,K558LLAV.SA0W,Long,0.2944,0.2979,0.988,0.2,0
0a65fb7c-96e1-4ba0-85de-4620d88658c1,BE9558,2026-05-16T18:15:03,K558LLAW.130W,Long,0.2965,0.2979,0.995,0.2,0
92b1ef3e-1696-4123-8662-163947737c83,BE9558,2026-05-16T18:20:20,K558LLAW.9W0W,Long,0.2976,0.3027,0.983,0.2,0
9e3cb24c-4426-4220-9a73-389d0a96c94f,BE9558,2026-05-16T18:25:37,K558LLAW.IP0W,Long,0.2983,0.3027,0.985,0.2,0
a3473215-4c46-45ab-9aa7-1720486ec4a8,BE9558,2026-05-16T18:30:54,K558LLAW.RI0W,Long,0.2956,0.2979,0.993,0.2,0
449665b1-47c8-4bd2-984c-8f45b627e6d8,BE9558,2026-05-16T18:36:11,K558LLAX.0B0W,Long,0.2989,0.3027,0.987,0.2,0
600cfabc-cffd-42e1-800c-70e75f312316,BE9558,2026-05-16T20:00:12,K558LLB0.WC0W,Long,0.3077,0.3125,0.985,0.2,0
12bf5944-0194-4f5b-b486-a7acd7141c7f,BE9558,2026-05-16T20:04:28,K558LLB1.3G0W,Long,0.2888,0.2930,0.986,0.2,0
f1fc913a-91bc-4240-a595-7dfe3091f9a2,BE9558,2026-05-16T20:07:29,K558LLB1.8H0W,Long,0.2977,0.3027,0.983,0.2,0
e74f7ec3-20bb-4177-beb2-e802e5f801fd,BE9558,2026-05-16T20:10:26,K558LLB1.DE0W,Long,0.2978,0.3027,0.984,0.2,0
27491c3a-b631-4643-818a-714523911178,BE9558,2026-05-16T20:16:21,K558LLB1.N90W,Long,0.2921,0.2930,0.997,0.2,0
9d9196ce-11e2-4f28-b01c-3dcc60e60d42,BE9558,2026-05-16T20:22:28,K558LLB1.XG0W,Long,0.2881,0.2930,0.983,0.2,0
a592d7c8-b643-4b25-9186-3d611ae22709,BE9558,2026-05-16T20:25:37,K558LLB2.2P0W,Long,0.2893,0.2930,0.987,0.2,0
f709a3d5-27cd-4bb1-b91c-669e8ea11d77,BE9558,2026-05-16T20:28:57,K558LLB2.890W,Long,0.2880,0.2930,0.983,0.2,0
cc9cad87-b87f-4b67-854a-ffb21e876a92,BE9558,2026-05-16T20:32:45,K558LLB2.EL0W,Long,0.2873,0.2930,0.980,0.2,0
10732d26-6b49-4b14-a474-6c75e259d278,BE9558,2026-05-16T20:49:32,K558LLB3.6K0W,Long,0.2881,0.2930,0.983,0.2,0
aa63957a-fdb2-4f17-af52-a63bb015119d,BE9558,2026-05-16T21:21:45,K558LLB4.O90W,Long,0.2880,0.2930,0.983,0.2,0
8350440f-019d-45a4-b9f9-23058628e6f0,BE9558,2026-05-16T21:32:43,K558LLB5.6J0W,Long,0.2925,0.2930,0.999,0.2,0
edfc10b2-dbe1-4527-a061-b0d670b5e5d2,BE9558,2026-05-16T21:35:37,K558LLB5.BD0W,Long,0.2891,0.2930,0.987,0.2,0
f98001a3-88b2-4830-8112-b7c5164e99c3,BE9558,2026-05-16T21:38:40,K558LLB5.GG0W,Long,0.2877,0.2930,0.982,0.2,0
f1e53e7b-b124-4fc5-82c2-504fb0c8b80d,BE9558,2026-05-16T21:41:46,K558LLB5.LM0W,Long,0.2881,0.2930,0.983,0.2,0
7890637f-142e-4775-b48c-fd4f3b8ada77,BE9558,2026-05-16T21:45:14,K558LLB5.RE0W,Long,0.2880,0.2930,0.983,0.2,0
7c97c10f-b413-467c-9b56-c18e423cdcfa,BE9558,2026-05-16T21:48:26,K558LLB5.WQ0W,Long,0.2886,0.2930,0.985,0.2,0
8178cf22-8428-4f85-8199-0a43f7334a8f,BE9558,2026-05-16T21:51:47,K558LLB6.2B0W,Long,0.2881,0.2930,0.983,0.2,0
eceb2997-deb4-403a-802f-50e93d23d423,BE9558,2026-05-16T21:57:18,K558LLB6.BI0W,Long,0.2881,0.2930,0.984,0.2,0
9c26690c-1983-4b21-b8af-7c7967c014c3,BE9558,2026-05-16T22:12:21,K558LLB7.0L0W,Long,0.2876,0.2930,0.982,0.2,0
78f67fc3-08b7-4317-96ba-ee5544e0b95b,BE9558,2026-05-16T22:19:34,K558LLB7.CM0W,Long,0.2880,0.2930,0.983,0.2,0
7f9dad14-4f1b-492d-aa26-845a908ea894,BE9558,2026-05-16T22:27:40,K558LLB7.Q40W,Long,0.2881,0.2930,0.983,0.2,0
f75c52b4-21b9-4065-baeb-5cfbd27d130a,BE9558,2026-05-16T22:33:50,K558LLB8.0E0W,Long,0.2881,0.2930,0.984,0.2,0
10f7496d-fa76-40a7-8bef-dc14e8a41869,BE9558,2026-05-16T22:40:48,K558LLB8.C00W,Long,0.2878,0.2930,0.982,0.2,0
event_id,serial,timestamp,filename,channel,offset_ips,peak_ips,mean_over_peak,trigger_level_ips,already_flagged_ft
1e7a7808-034c-423b-80e9-d6788da80993,BE18438,2025-11-15T08:57:40,T438LBX4.W40W,Vert,0.2722,0.2930,0.929,0.2,0
346e383f-c5a1-41d1-b972-3d652e599d39,BE18438,2025-11-15T09:13:15,T438LBX5.M30W,Vert,0.2747,0.2930,0.938,0.2,0
45ef3023-22c5-44a8-a606-a0900bc17861,BE18438,2025-11-15T09:16:13,T438LBX5.R10W,Vert,0.2929,0.3027,0.967,0.2,0
1cbcd2aa-ec55-4e2f-af42-7178f26cc6a1,BE18438,2025-11-15T09:19:29,T438LBX5.WH0W,Vert,0.2816,0.2979,0.945,0.2,0
caf43634-4528-4fd5-9674-5f4f563661c0,BE18438,2025-11-15T09:22:32,T438LBX6.1K0W,Vert,0.2883,0.2930,0.984,0.2,0
456ae646-c834-4e5c-82f1-7df18b3440a1,BE18438,2025-11-15T09:25:31,T438LBX6.6J0W,Vert,0.3189,0.3223,0.989,0.2,0
afb91ba2-351b-42a0-b33f-acebd5f1829d,BE18438,2025-11-15T09:28:29,T438LBX6.BH0W,Vert,0.3057,0.3076,0.994,0.2,0
39847146-3537-4300-943d-01c0c771e9cd,BE18438,2025-11-15T09:31:26,T438LBX6.GE0W,Vert,0.3225,0.3271,0.986,0.2,0
e47335c1-fc3f-4c90-88c6-8edd0f296ce4,BE18438,2025-11-15T09:34:24,T438LBX6.LC0W,Vert,0.3275,0.3320,0.986,0.2,0
25b6eda6-ba98-422f-8834-94b6cbe34971,BE18438,2025-11-15T09:37:22,T438LBX6.QA0W,Vert,0.3398,0.3418,0.994,0.2,0
7af99377-e47f-4914-8e91-ac7f7f50b8c6,BE18438,2025-11-15T09:40:20,T438LBX6.V80W,Vert,0.3515,0.3564,0.986,0.2,0
c4330605-c257-49ef-aede-20deb641e7d7,BE18438,2025-11-15T10:09:48,T438LBX8.8C0W,Vert,0.3605,0.3955,0.912,0.2,0
b665caf9-64ee-4352-a391-60c1ddeebc1e,BE18438,2026-02-25T10:58:04,T438LH66.GS0W,Vert,0.1803,0.1953,0.923,0.2,0
3b0c32c3-fd16-4b83-9917-942a56dea168,BE18438,2026-02-25T18:12:04,T438LH6Q.K40W,Vert,0.1869,0.1953,0.957,0.2,0
ca66e601-d10f-4424-9c26-08a688e7b08c,BE18438,2026-02-25T18:17:16,T438LH6Q.SS0W,Vert,0.1870,0.1953,0.958,0.2,0
31aa30ba-eb0a-49a9-98ca-c77d2cc31275,BE18438,2026-02-25T18:21:11,T438LH6Q.ZB0W,Vert,0.1868,0.1953,0.956,0.2,0
fdb55a93-fc91-4fdf-a7f4-fdd1a6b48f59,BE18438,2026-02-25T18:26:27,T438LH6R.830W,Vert,0.1893,0.1953,0.969,0.2,0
cbd718d7-2378-4d74-8656-842f229d19a8,BE18438,2026-02-25T18:33:25,T438LH6R.JP0W,Vert,0.1887,0.1953,0.966,0.2,0
bfaf58ec-6163-47eb-9d2a-70da880bd948,BE18438,2026-02-25T18:37:48,T438LH6R.R00W,Vert,0.1872,0.1953,0.959,0.2,0
ddaa530b-886e-4415-b93a-f4ebf4c4a882,BE18438,2026-02-25T18:59:54,T438LH6S.RU0W,Vert,0.1874,0.1953,0.959,0.2,0
57f15284-ab69-48fc-9660-8c347c80c681,BE18438,2026-02-25T19:15:58,T438LH6T.IM0W,Vert,0.1873,0.1953,0.959,0.2,0
03715718-7aa8-4e1d-9b0b-c2ab75fc1975,BE18438,2026-02-25T19:19:58,T438LH6T.PA0W,Vert,0.1891,0.1953,0.968,0.2,0
9f921cd5-1bf9-4713-aef6-41e7f780eff1,BE18438,2026-02-25T19:24:02,T438LH6T.W20W,Vert,0.1871,0.1953,0.958,0.2,0
44994949-58d4-44fa-bd78-ed75b8acc667,BE18438,2026-02-25T19:44:57,T438LH6U.UX0W,Vert,0.1877,0.1953,0.961,0.2,0
c4be01c3-1001-4e17-aecd-d6d26dbb09f3,BE18438,2026-02-25T19:49:19,T438LH6V.270W,Vert,0.1884,0.1953,0.964,0.2,0
3db004e6-ee34-43c5-ae8e-f22894ead5d0,BE18438,2026-02-25T20:08:22,T438LH6V.XY0W,Vert,0.1878,0.1953,0.962,0.2,0
d276ae48-0434-41e5-af43-e0fb366acf11,BE18438,2026-02-25T20:11:33,T438LH6W.390W,Vert,0.1880,0.1953,0.963,0.2,0
c027dc12-88fd-4a45-872b-a6a945f2008e,BE18438,2026-02-25T20:14:35,T438LH6W.8B0W,Vert,0.1874,0.1953,0.959,0.2,0
9665bc3a-3d08-4852-b008-37ef8bfd0023,BE18438,2026-02-25T20:18:51,T438LH6W.FF0W,Vert,0.1884,0.1953,0.965,0.2,0
5fb5a05e-d7e2-4268-9b85-cfe8d82aa6c9,BE18438,2026-02-25T20:29:50,T438LH6W.XQ0W,Vert,0.1890,0.1953,0.968,0.2,0
57ec0b10-9324-4459-a07e-0c8532b8928f,BE18438,2026-02-25T20:35:39,T438LH6X.7F0W,Vert,0.1889,0.1953,0.967,0.2,0
ac86f73f-1174-4fae-a206-ecdcb73e1ffc,BE18438,2026-02-25T20:39:12,T438LH6X.DC0W,Vert,0.1887,0.1953,0.966,0.2,0
dcf25ddd-9cf0-41c1-b109-f3ef2e490ce5,BE18438,2026-02-25T20:43:41,T438LH6X.KT0W,Vert,0.1871,0.1953,0.958,0.2,0
aa79bbdd-2392-4ef6-8a5c-873a9f72746d,BE18438,2026-02-25T20:46:51,T438LH6X.Q30W,Vert,0.1877,0.1953,0.961,0.2,0
ad46d1ce-b417-4c8c-b029-bb3b008ba809,BE18438,2026-02-25T20:53:33,T438LH6Y.190W,Vert,0.1882,0.1953,0.964,0.2,0
3d3a8f34-86a7-4d70-a7e8-fa768a723325,BE18438,2026-02-26T07:03:39,T438LH7Q.A30W,Vert,0.1809,0.1953,0.926,0.2,0
7817525f-dc3d-4f5e-b2cb-5af9ca12ede8,BE18438,2026-02-26T07:09:42,T438LH7Q.K60W,Vert,0.1814,0.1953,0.929,0.2,0
a2091302-0b34-46c1-ab83-174be2b59bcf,BE18438,2026-02-26T13:12:35,T438LH87.CZ0W,Vert,0.1896,0.1953,0.971,0.2,0
e1c0c9de-a900-479f-9572-9675b13296a9,BE18438,2026-02-26T13:24:46,T438LH87.XA0W,Vert,0.2237,0.2588,0.864,0.2,0
76a6dc6b-88e1-434b-a137-f5e9b63f248e,BE18438,2026-02-26T13:27:43,T438LH88.270W,Vert,0.3185,0.3223,0.988,0.2,0
281b508b-7982-4668-86af-9b0b28be608a,BE18438,2026-02-26T13:30:36,T438LH88.700W,Vert,0.3263,0.3320,0.983,0.2,0
68bbaf77-bb23-40fd-94f9-f928728d90dc,BE18438,2026-02-26T13:33:28,T438LH88.BS0W,Vert,0.3207,0.3271,0.980,0.2,0
5c975640-6ff1-441a-aa11-41642f6a6b31,BE18438,2026-02-26T13:36:21,T438LH88.GL0W,Vert,0.3261,0.3320,0.982,0.2,0
dea248ac-1124-4bba-b054-953f86c852b2,BE18438,2026-02-26T13:40:34,T438LH88.NM0W,Vert,0.3271,0.3320,0.985,0.2,0
4e463201-f008-41ad-9c52-11fcc3d93095,BE18438,2026-02-26T13:43:29,T438LH88.SH0W,Vert,0.3357,0.3418,0.982,0.2,0
507262c5-d58f-4a05-a6a3-a6cbb5b4de20,BE18438,2026-02-26T13:46:24,T438LH88.XC0W,Vert,0.3372,0.3418,0.987,0.2,0
4c2d8ee8-842f-4e44-9e03-ff34d26e4fdb,BE18438,2026-02-26T13:49:17,T438LH89.250W,Vert,0.3253,0.3320,0.980,0.2,0
b184b112-603f-44f4-ae97-087493fbd8ce,BE18438,2026-02-26T13:52:10,T438LH89.6Y0W,Vert,0.3321,0.3369,0.986,0.2,0
2ff1a552-5a2e-4396-9083-b9c8d334eed7,BE18438,2026-02-26T13:55:04,T438LH89.BS0W,Vert,0.3378,0.3418,0.988,0.2,0
928e21a7-1990-4792-803e-58014d8140ce,BE18438,2026-02-26T13:57:57,T438LH89.GL0W,Vert,0.3341,0.3369,0.992,0.2,0
f521b5db-6100-41e6-954e-0abdbf9660c1,BE18438,2026-02-26T14:00:51,T438LH89.LF0W,Vert,0.3421,0.3467,0.987,0.2,0
efba962f-e511-41ef-9fc5-313f202a9d96,BE18438,2026-02-26T14:03:46,T438LH89.QA0W,Vert,0.3506,0.3564,0.984,0.2,0
0b51e273-8d10-4494-bda6-8c75eaeec66f,BE18438,2026-02-26T14:06:41,T438LH89.V50W,Vert,0.3448,0.3516,0.981,0.2,0
6d46e4ee-1647-4169-b6b2-33da32240eb9,BE18438,2026-02-26T14:09:35,T438LH89.ZZ0W,Vert,0.3463,0.3516,0.985,0.2,0
1ca294cd-4dc2-41fb-9374-e277d4550761,BE18438,2026-02-26T14:12:28,T438LH8A.4S0W,Vert,0.3442,0.3467,0.993,0.2,0
7b683dcf-1aed-4d9b-be1e-b10f92374398,BE18438,2026-02-26T14:15:23,T438LH8A.9N0W,Vert,0.3486,0.3516,0.992,0.2,0
2b5cb8e7-c947-4914-bcb5-504f74603547,BE18438,2026-02-26T14:18:21,T438LH8A.EL0W,Vert,0.3519,0.3613,0.974,0.2,0
5ea3a6bf-10de-4911-aedc-66daecf86b76,BE18438,2026-02-26T14:21:16,T438LH8A.JG0W,Vert,0.3460,0.3564,0.971,0.2,0
d93be7f5-39ec-45fd-9949-fa531f2f9d34,BE18438,2026-02-26T14:24:13,T438LH8A.OD0W,Vert,0.3457,0.3516,0.983,0.2,0
cfa113f2-8cee-4a1d-b1e7-0e936fa771e2,BE18438,2026-02-26T14:28:21,T438LH8A.V90W,Vert,0.3485,0.3564,0.978,0.2,0
46d322ac-38cb-4c99-a4c2-9e9d7ad06171,BE18438,2026-02-26T14:31:17,T438LH8B.050W,Vert,0.3367,0.3467,0.971,0.2,0
42500a83-bd67-4deb-8bb2-963ee2b8a7ce,BE18438,2026-02-26T14:34:11,T438LH8B.4Z0W,Vert,0.3365,0.3516,0.957,0.2,0
3ccf6bda-2e88-473c-951d-9ea86d0d9363,BE18438,2026-02-26T14:37:05,T438LH8B.9T0W,Vert,0.3472,0.3564,0.974,0.2,0
9050487d-d238-4631-b8e1-5a693a026542,BE18438,2026-02-26T14:39:58,T438LH8B.EM0W,Vert,0.3420,0.3564,0.959,0.2,0
e62989e4-a326-4bae-8d47-a8becee96462,BE18438,2026-02-26T14:42:52,T438LH8B.JG0W,Vert,0.3430,0.3564,0.962,0.2,0
f0e30fab-dc57-4189-8439-48df17007a2c,BE18438,2026-02-26T14:45:46,T438LH8B.OA0W,Vert,0.3389,0.3516,0.964,0.2,0
03e1ca09-78df-4c6f-9915-0b6e4f2141d2,BE18438,2026-02-26T14:48:43,T438LH8B.T70W,Vert,0.3449,0.3564,0.968,0.2,0
945d39f7-1b98-4a1f-80a8-6a18fd9df25f,BE18438,2026-02-26T14:51:37,T438LH8B.Y10W,Vert,0.3522,0.3613,0.975,0.2,0
d27eb2e3-e313-4125-98f4-f9d6d3737d28,BE18438,2026-02-26T14:54:32,T438LH8C.2W0W,Vert,0.3502,0.3613,0.969,0.2,0
916901cb-ebea-441e-a2a1-40f4e49f32f4,BE18438,2026-02-26T14:57:25,T438LH8C.7P0W,Vert,0.3524,0.3662,0.962,0.2,0
5d8d7e29-fdbb-4fa3-bd25-506c9352a354,BE18438,2026-02-26T15:01:35,T438LH8C.EN0W,Vert,0.3530,0.3613,0.977,0.2,0
c6c7a3af-b03b-43dc-97de-024f8e09b62f,BE18438,2026-02-26T15:04:27,T438LH8C.JF0W,Vert,0.3514,0.3613,0.973,0.2,0
b6856898-3d10-4967-9577-7f17902f77ea,BE18438,2026-02-26T15:11:34,T438LH8C.VA0W,Vert,0.3566,0.3613,0.987,0.2,0
7a4802f6-621e-4230-8d8c-d7f0c9a65bf2,BE18438,2026-02-26T15:14:24,T438LH8D.000W,Vert,0.3594,0.3711,0.968,0.2,0
79f38b7e-ec56-417e-943a-8c944252c2b8,BE18438,2026-02-26T15:18:32,T438LH8D.6W0W,Vert,0.3550,0.3613,0.983,0.2,0
1b4190c4-0d54-48ba-8ff5-8ddb0eb91e50,BE18438,2026-02-26T15:22:22,T438LH8D.DA0W,Vert,0.3571,0.3613,0.988,0.2,0
de57b5ae-a3a1-4ede-9d2b-3e87bfb3fd19,BE9558,2026-04-14T11:16:32,K558LJN3.BK0W,Tran,0.3448,0.3662,0.942,0.2,0
43afeaf5-02ec-41f6-9e23-0c9772821ed4,BE9558,2026-04-14T11:27:15,K558LJN3.TF0W,Tran,0.3094,0.3223,0.960,0.2,0
8123c0ef-84c9-4f6c-8d82-9dc32e2e470d,BE9558,2026-04-14T14:45:30,K558LJNC.ZU0W,Tran,0.2721,0.3564,0.763,0.2,0
8c787af3-596e-411b-9e10-29485fa5114f,BE9558,2026-04-29T16:18:47,K558LKF9.BB0W,Tran,0.2943,0.3027,0.972,0.2,0
431928ff-b4c4-4caa-b933-acc917f3717c,BE9558,2026-05-04T15:02:30,K558LKOF.460W,Tran,0.4364,0.5225,0.835,0.2,0
6c3c07f8-c36a-4493-acce-7441c9d22cec,BE9558,2026-05-15T08:50:06,K558LL8B.7I0W,Long,0.2892,0.2930,0.987,0.2,0
13c268df-b652-422e-a642-6453f6a314aa,BE9558,2026-05-15T10:18:34,K558LL8F.AY0W,Long,0.2907,0.2979,0.976,0.2,0
9b0d0871-8810-467d-806a-5bbfa4e667fe,BE9558,2026-05-15T15:52:00,K558LL8U.QO0W,Long,0.2659,0.2979,0.893,0.2,0
092640f9-a944-48b7-b872-364d75c2c5e7,BE9558,2026-05-15T16:13:12,K558LL8V.Q00W,Long,0.2428,0.2979,0.815,0.2,0
0573741a-96ab-4b36-af7a-b5bc11a79009,BE9558,2026-05-16T03:23:26,K558LL9Q.R20W,Long,0.2861,0.2930,0.976,0.2,0
321f03ea-6696-47de-ad46-2be43d4d6cae,BE9558,2026-05-16T03:30:49,K558LL9R.3D0W,Long,0.2886,0.2930,0.985,0.2,0
cc423a6a-3e3c-466a-b39c-6146ca7f34c8,BE9558,2026-05-16T03:33:55,K558LL9R.8J0W,Long,0.2880,0.2881,1.000,0.2,0
efa52a14-cc68-4bea-aab4-4ee3a3cbff3a,BE9558,2026-05-16T03:36:55,K558LL9R.DJ0W,Long,0.2890,0.2930,0.986,0.2,0
92895bfe-122f-4cdc-bd3d-40609633d278,BE9558,2026-05-16T03:43:41,K558LL9R.OT0W,Long,0.2880,0.2881,1.000,0.2,0
2a4c81db-2307-44e5-9b27-d5154d98e38d,BE9558,2026-05-16T03:46:36,K558LL9R.TO0W,Long,0.2921,0.2979,0.981,0.2,0
656b0fdc-e275-4c9c-8936-9eee267ea04e,BE9558,2026-05-16T03:49:28,K558LL9R.YG0W,Long,0.2966,0.2979,0.996,0.2,0
3b9989ae-e0f2-4652-9724-c145603543d2,BE9558,2026-05-16T03:52:29,K558LL9S.3H0W,Long,0.2880,0.2930,0.983,0.2,0
837d0d84-d609-4f4a-b542-b7e2b064ea22,BE9558,2026-05-16T03:56:32,K558LL9S.A80W,Long,0.2880,0.2930,0.983,0.2,0
affcb008-ab99-4bc5-8f35-83dbe620499d,BE9558,2026-05-16T04:02:50,K558LL9S.KQ0W,Long,0.2896,0.2930,0.989,0.2,0
e1f1c6d2-545c-451f-9018-714d52e20a05,BE9558,2026-05-16T04:05:47,K558LL9S.PN0W,Long,0.3024,0.3076,0.983,0.2,0
93ef80f1-7e83-4703-a0f9-89bbfeeae6c3,BE9558,2026-05-16T04:08:41,K558LL9S.UH0W,Long,0.2976,0.2979,0.999,0.2,0
5c118ca9-fc37-4080-876d-b3f57ce0b121,BE9558,2026-05-16T04:11:42,K558LL9S.ZI0W,Long,0.2881,0.2930,0.983,0.2,0
d98b2eaa-7763-4c78-88fb-c21195cb9978,BE9558,2026-05-16T04:14:38,K558LL9T.4E0W,Long,0.2898,0.2930,0.989,0.2,0
6a146a01-0d02-4413-b231-ecb4a6fde776,BE9558,2026-05-16T04:17:35,K558LL9T.9B0W,Long,0.2880,0.2930,0.983,0.2,0
f6587a55-27e3-454f-997e-57e7516a296c,BE9558,2026-05-16T04:20:32,K558LL9T.E80W,Long,0.3046,0.3076,0.990,0.2,0
1fb48250-2214-41e6-92cb-362aff1ba62b,BE9558,2026-05-16T04:26:05,K558LL9T.NH0W,Long,0.2876,0.2930,0.982,0.2,0
2f4f3d06-1189-4e28-a1ac-5454ea586a0c,BE9558,2026-05-16T04:59:47,K558LL9V.7N0W,Long,0.2961,0.3027,0.978,0.2,0
62b7bdab-b744-41e4-8d0e-c9141b9d4821,BE9558,2026-05-16T05:02:46,K558LL9V.CM0W,Long,0.2903,0.2930,0.991,0.2,0
cadcb6dc-74c0-48b5-974c-87bb7a57816c,BE9558,2026-05-16T05:05:43,K558LL9V.HJ0W,Long,0.3090,0.3125,0.989,0.2,0
a0235177-be5a-4f11-b741-c65744698e5b,BE9558,2026-05-16T05:08:35,K558LL9V.MB0W,Long,0.3167,0.3223,0.983,0.2,0
1968c2f6-f52c-4544-a0ed-f79b91ce0da0,BE9558,2026-05-16T05:11:28,K558LL9V.R40W,Long,0.3446,0.3516,0.980,0.2,0
caa06b94-8813-4949-b47b-61ffb16e61c4,BE9558,2026-05-16T05:14:22,K558LL9V.VY0W,Long,0.3318,0.3320,0.999,0.2,0
fdaa8101-f033-47e6-9c65-abd76dea1870,BE9558,2026-05-16T05:17:16,K558LL9W.0S0W,Long,0.3407,0.3418,0.997,0.2,0
29bd16bd-81b9-4ccd-a981-f1a80858536c,BE9558,2026-05-16T05:23:05,K558LL9W.AH0W,Long,0.3450,0.3516,0.981,0.2,0
1f8bc862-d5fd-4cce-abc0-e2bd8c2f11fa,BE9558,2026-05-16T05:26:00,K558LL9W.FC0W,Long,0.3417,0.3467,0.986,0.2,0
20220068-d498-4fca-9a2a-a7fd2ee52ab1,BE9558,2026-05-16T05:28:53,K558LL9W.K50W,Long,0.3516,0.3564,0.986,0.2,0
9816a261-3118-417a-8334-ace36687ad8f,BE9558,2026-05-16T05:31:47,K558LL9W.OZ0W,Long,0.3416,0.3467,0.985,0.2,0
5d2c76d7-543d-4557-9caf-996a69ab00bd,BE9558,2026-05-16T05:34:42,K558LL9W.TU0W,Long,0.3537,0.3564,0.992,0.2,0
c7b5ae00-52e7-4920-aa27-49d3b3daff92,BE9558,2026-05-16T05:37:36,K558LL9W.YO0W,Long,0.3517,0.3564,0.987,0.2,0
07db8fd8-ccef-4a5a-9d97-9f318f73a478,BE9558,2026-05-16T05:40:31,K558LL9X.3J0W,Long,0.3574,0.3613,0.989,0.2,0
790fcff9-e266-4a12-87f0-a072990d2533,BE9558,2026-05-16T05:43:26,K558LL9X.8E0W,Long,0.3650,0.3662,0.997,0.2,0
f4245f61-1dde-43dc-a121-98e102f6a193,BE9558,2026-05-16T05:50:28,K558LL9X.K40W,Long,0.3856,0.3906,0.987,0.2,0
5a3bce7b-358e-4260-876f-3f853163d7cf,BE9558,2026-05-16T05:53:22,K558LL9X.OY0W,Long,0.3847,0.3857,0.997,0.2,0
37c2b4b1-7a1b-43e7-b513-2c16f582109c,BE9558,2026-05-16T05:56:15,K558LL9X.TR0W,Long,0.3906,0.3955,0.988,0.2,0
57fde109-1d8a-45a1-b398-5bd28c3e47f1,BE9558,2026-05-16T05:59:10,K558LL9X.YM0W,Long,0.4000,0.4004,0.999,0.2,0
1e41ab40-93be-405c-a464-f7a57524d3b3,BE9558,2026-05-16T06:02:02,K558LL9Y.3E0W,Long,0.3825,0.3857,0.992,0.2,0
e9d61eb5-fae8-4902-8fab-4828ffa8e6da,BE9558,2026-05-16T06:04:57,K558LL9Y.890W,Long,0.3802,0.3809,0.998,0.2,0
c0e964e0-7788-4e41-bc41-6e479c3dc81b,BE9558,2026-05-16T06:07:51,K558LL9Y.D30W,Long,0.3954,0.4004,0.987,0.2,0
0b2df8e5-1689-4fe6-abad-30970ba10aa6,BE9558,2026-05-16T06:16:06,K558LL9Y.QU0W,Long,0.4051,0.4053,1.000,0.2,0
2bc6ce73-464b-469c-9e8f-3bf6f6cfae1d,BE9558,2026-05-16T06:21:51,K558LL9Z.0F0W,Long,0.3910,0.3955,0.989,0.2,0
b8603ee1-616a-451e-a2cd-61f8f2634cd0,BE9558,2026-05-16T06:24:44,K558LL9Z.580W,Long,0.3969,0.4004,0.991,0.2,0
1aecf582-66a2-4ebb-80f9-04b3aeba331a,BE9558,2026-05-16T06:27:39,K558LL9Z.A30W,Long,0.3915,0.3955,0.990,0.2,0
885aedfd-7a1a-4120-8176-7c344dd3d8fe,BE9558,2026-05-16T06:30:30,K558LL9Z.EU0W,Long,0.4025,0.4053,0.993,0.2,0
ec15930f-47f5-4752-afc2-427ee156ac95,BE9558,2026-05-16T06:33:25,K558LL9Z.JP0W,Long,0.4060,0.4102,0.990,0.2,0
5ca23f47-2a38-4a54-99dd-041287aa9510,BE9558,2026-05-16T06:36:17,K558LL9Z.OH0W,Long,0.4054,0.4102,0.988,0.2,0
03f371cf-81bc-4681-80f0-ef6fa437da85,BE9558,2026-05-16T06:39:09,K558LL9Z.T90W,Long,0.4052,0.4102,0.988,0.2,0
ed386f54-140d-45e8-ad51-6585a58b4375,BE9558,2026-05-16T06:44:54,K558LLA0.2U0W,Long,0.3993,0.4004,0.997,0.2,0
579f1c3f-4c1e-42a3-aa89-69aa93514033,BE9558,2026-05-16T06:47:47,K558LLA0.7N0W,Long,0.4001,0.4053,0.987,0.2,0
57024de6-07ea-41f4-b916-c6adc3f51636,BE9558,2026-05-16T06:50:40,K558LLA0.CG0W,Long,0.4103,0.4150,0.989,0.2,0
36bf5adf-afb5-4a5e-a106-1afbd1f56c7b,BE9558,2026-05-16T06:54:49,K558LLA0.JD0W,Long,0.4069,0.4150,0.980,0.2,0
3e2f831b-5228-46ff-9acb-75d8c86f8bc1,BE9558,2026-05-16T06:57:43,K558LLA0.O70W,Long,0.4108,0.4150,0.990,0.2,0
1775fa20-568b-4294-b9ca-561201a66c5b,BE9558,2026-05-16T07:00:38,K558LLA0.T20W,Long,0.3967,0.4004,0.991,0.2,0
fd391469-03f9-4d8d-bccd-3af50c91e5b7,BE9558,2026-05-16T07:03:33,K558LLA0.XX0W,Long,0.3927,0.3955,0.993,0.2,0
02b52ef6-b707-4dcb-b58f-43da02698832,BE9558,2026-05-16T07:06:27,K558LLA1.2R0W,Long,0.3824,0.3857,0.991,0.2,0
8d45333f-e101-4249-9e27-913c583a0a8d,BE9558,2026-05-16T07:09:21,K558LLA1.7L0W,Long,0.4085,0.4150,0.984,0.2,0
361d11ce-f42a-4d04-8270-ee3771fe4f09,BE9558,2026-05-16T07:12:14,K558LLA1.CE0W,Long,0.4017,0.4053,0.991,0.2,0
59218125-ed5d-4457-aa8b-35ba03441363,BE9558,2026-05-16T07:15:07,K558LLA1.H70W,Long,0.3934,0.3955,0.995,0.2,0
a603e55a-2ad6-4fc9-8c8c-0dc7be95c3e7,BE9558,2026-05-16T07:23:43,K558LLA1.VJ0W,Long,0.3806,0.3857,0.987,0.2,0
c8d07902-93ea-4b03-9e69-9ad6ed5bffb1,BE9558,2026-05-16T07:26:36,K558LLA2.0C0W,Long,0.3807,0.3857,0.987,0.2,0
4c46c0c7-42f0-4648-827e-1995f733b18f,BE9558,2026-05-16T07:30:44,K558LLA2.780W,Long,0.3667,0.3711,0.988,0.2,0
04759a00-ba3e-4959-a4cb-be8fc1f3004e,BE9558,2026-05-16T07:36:28,K558LLA2.GS0W,Long,0.3514,0.3516,1.000,0.2,0
0b6b0856-bd87-4a07-a5b4-f13d99e04a12,BE9558,2026-05-16T07:39:20,K558LLA2.LK0W,Long,0.3512,0.3516,0.999,0.2,0
3d81a8bd-464d-4050-8a76-25e8373d1ddb,BE9558,2026-05-16T07:42:12,K558LLA2.QC0W,Long,0.3350,0.3369,0.994,0.2,0
b8b9c0c4-c388-4acb-955a-be4ac356afce,BE9558,2026-05-16T07:45:04,K558LLA2.V40W,Long,0.3563,0.3564,1.000,0.2,0
cb3d142a-fb84-4a21-a298-f61bb869b036,BE9558,2026-05-16T07:49:13,K558LLA3.210W,Long,0.3663,0.3711,0.987,0.2,0
7401b19b-bc9d-43f0-b395-f4323aca5c72,BE9558,2026-05-16T07:52:06,K558LLA3.6U0W,Long,0.3612,0.3662,0.986,0.2,0
2236df76-a9e6-401f-9176-ad565242f2cf,BE9558,2026-05-16T07:57:52,K558LLA3.GG0W,Long,0.3366,0.3369,0.999,0.2,0
a645846c-cae4-4aa5-a2e6-85166bd4dd62,BE9558,2026-05-16T08:00:44,K558LLA3.L80W,Long,0.3265,0.3271,0.998,0.2,0
7212bd33-99a9-4659-9f0b-c98cc8d1e8bc,BE9558,2026-05-16T08:04:51,K558LLA3.S30W,Long,0.3418,0.3467,0.986,0.2,0
2cc4bf33-c63a-4c65-b0e2-5e61a9146a5d,BE9558,2026-05-16T08:07:43,K558LLA3.WV0W,Long,0.3405,0.3418,0.996,0.2,0
4fedb486-5f1f-4623-a01f-083e829f0565,BE9558,2026-05-16T08:10:35,K558LLA4.1N0W,Long,0.3515,0.3564,0.986,0.2,0
58aff0ba-0f9b-45e1-9bbe-a990d16192ae,BE9558,2026-05-16T08:13:27,K558LLA4.6F0W,Long,0.3513,0.3516,0.999,0.2,0
e56d87e5-e1d4-4947-b6a5-3bbd2773c54a,BE9558,2026-05-16T08:20:03,K558LLA4.HF0W,Long,0.3564,0.3613,0.986,0.2,0
0e96e61e-6a21-4e07-8e09-72d09dbfa1e6,BE9558,2026-05-16T08:25:21,K558LLA4.Q90W,Long,0.3565,0.3613,0.987,0.2,0
19611f28-2da8-4362-a58e-dbed2e061379,BE9558,2026-05-16T08:34:19,K558LLA5.570W,Long,0.3647,0.3662,0.996,0.2,0
bd580c1d-44d4-41fd-9f83-f462cda4099a,BE9558,2026-05-16T08:37:15,K558LLA5.A30W,Long,0.3536,0.3564,0.992,0.2,0
2782df3b-3cb4-471a-a6f5-bbc4903a8ab9,BE9558,2026-05-16T08:44:00,K558LLA5.LC0W,Long,0.3612,0.3662,0.986,0.2,0
d15a08f3-1c7c-4f80-8d9b-f5008c58c3d9,BE9558,2026-05-16T08:49:18,K558LLA5.U60W,Long,0.3610,0.3613,0.999,0.2,0
03a10a6a-193a-476c-9543-f63818f69417,BE9558,2026-05-16T08:54:36,K558LLA6.300W,Long,0.3515,0.3516,1.000,0.2,0
1c271856-8100-4c0d-bc8c-9357b47d7626,BE9558,2026-05-16T08:59:54,K558LLA6.BU0W,Long,0.3617,0.3662,0.988,0.2,0
a85f125e-bfa2-42be-b877-2604b8d068c8,BE9558,2026-05-16T09:05:17,K558LLA6.KT0W,Long,0.3510,0.3516,0.998,0.2,0
dde9aa71-d2e3-41ac-8388-f2bbddb6dae6,BE9558,2026-05-16T09:08:11,K558LLA6.PN0W,Long,0.3447,0.3467,0.994,0.2,0
2f3f2be2-0ee3-422e-b3ad-83fb87512a2b,BE9558,2026-05-16T09:14:39,K558LLA7.0F0W,Long,0.3580,0.3613,0.991,0.2,0
357a3034-8a9c-485e-8cb6-f526dd2baf6f,BE9558,2026-05-16T09:29:11,K558LLA7.ON0W,Long,0.3708,0.3760,0.986,0.2,0
f8ad0274-8e6f-4714-82ff-d229e60f1442,BE9558,2026-05-16T09:32:06,K558LLA7.TI0W,Long,0.3567,0.3613,0.987,0.2,0
42bb007a-2726-401a-b085-c25151b0dc24,BE9558,2026-05-16T09:35:02,K558LLA7.YE0W,Long,0.3575,0.3613,0.989,0.2,0
c99bfc4a-db02-4bea-bea4-943c67485dba,BE9558,2026-05-16T09:37:58,K558LLA8.3A0W,Long,0.3527,0.3564,0.989,0.2,0
8fc17de0-73f7-48bd-8d93-5451dce47e8e,BE9558,2026-05-16T09:40:52,K558LLA8.840W,Long,0.3613,0.3662,0.987,0.2,0
bbee5276-03dd-4ca4-a7b9-aec02baac7e8,BE9558,2026-05-16T09:48:13,K558LLA8.KD0W,Long,0.3590,0.3613,0.993,0.2,0
8dcdee10-db01-4224-9506-4181c3105d6f,BE9558,2026-05-16T09:53:31,K558LLA8.T70W,Long,0.3588,0.3613,0.993,0.2,0
48c8be72-64d9-4da3-95b5-bbec2c5e1dbd,BE9558,2026-05-16T09:58:49,K558LLA9.210W,Long,0.3582,0.3662,0.978,0.2,0
0da20919-7ce9-4feb-8ae9-12d9bb40c2b5,BE9558,2026-05-16T10:04:07,K558LLA9.AV0W,Long,0.3506,0.3516,0.997,0.2,0
c2f7e9bc-8b93-42c3-96d3-e3af217dde35,BE9558,2026-05-16T10:09:25,K558LLA9.JP0W,Long,0.3506,0.3516,0.997,0.2,0
522a0e42-d443-4447-bc71-af1832c6604e,BE9558,2026-05-16T10:14:43,K558LLA9.SJ0W,Long,0.3624,0.3662,0.990,0.2,0
67f7e732-3c0b-439f-87c5-3c478a381418,BE9558,2026-05-16T10:20:01,K558LLAA.1D0W,Long,0.3494,0.3516,0.994,0.2,0
251767e8-56f7-4091-a001-364d8e75c15c,BE9558,2026-05-16T10:25:19,K558LLAA.A70W,Long,0.3463,0.3516,0.985,0.2,0
9457239d-a4ca-4476-b385-5e01fc8f6420,BE9558,2026-05-16T10:30:37,K558LLAA.J10W,Long,0.3436,0.3467,0.991,0.2,0
43718d7c-9353-49e1-89b6-0841aeb1b276,BE9558,2026-05-16T10:35:55,K558LLAA.RV0W,Long,0.3452,0.3516,0.982,0.2,0
f54ba557-ddfe-41d3-8f4c-8bbec9a3783c,BE9558,2026-05-16T10:41:13,K558LLAB.0P0W,Long,0.3419,0.3467,0.986,0.2,0
dc26c758-ad99-49c1-b518-931368cdf8cf,BE9558,2026-05-16T10:46:31,K558LLAB.9J0W,Long,0.3463,0.3516,0.985,0.2,0
10917eb2-d151-461c-a8cb-e9660da5a5b0,BE9558,2026-05-16T10:51:49,K558LLAB.ID0W,Long,0.3520,0.3564,0.987,0.2,0
4938a5e6-d53b-40ee-be2b-06ec0e60398c,BE9558,2026-05-16T10:57:07,K558LLAB.R70W,Long,0.3541,0.3564,0.993,0.2,0
0711b51d-55bd-48be-b51e-2aad67107a60,BE9558,2026-05-16T11:13:01,K558LLAC.HP0W,Long,0.3661,0.3711,0.986,0.2,0
065564b6-aa49-40e7-9ea6-c75defdc60fe,BE9558,2026-05-16T11:18:19,K558LLAC.QJ0W,Long,0.3622,0.3662,0.989,0.2,0
ffb6b230-1d70-4e0e-ba30-e945339a122a,BE9558,2026-05-16T11:23:37,K558LLAC.ZD0W,Long,0.3711,0.3760,0.987,0.2,0
52b4da82-c1e0-4a8a-8365-51b090787005,BE9558,2026-05-16T11:28:55,K558LLAD.870W,Long,0.3644,0.3662,0.995,0.2,0
cdbff3d8-fbfe-4bea-8bd6-c898800e81ba,BE9558,2026-05-16T11:39:31,K558LLAD.PV0W,Long,0.3609,0.3662,0.986,0.2,0
3fb0bc30-1463-4cfc-9e7f-386c0eb2a34a,BE9558,2026-05-16T11:44:49,K558LLAD.YP0W,Long,0.3553,0.3564,0.997,0.2,0
ba1f5ec8-aef7-4a9e-ac1f-276cf016e285,BE9558,2026-05-16T11:50:07,K558LLAE.7J0W,Long,0.3479,0.3516,0.990,0.2,0
b1dd4df7-34a9-4512-a903-f8242b236fd2,BE9558,2026-05-16T11:55:25,K558LLAE.GD0W,Long,0.3427,0.3467,0.988,0.2,0
1f23aa28-c026-4bc7-b3d1-7c78fd76a673,BE9558,2026-05-16T12:00:43,K558LLAE.P70W,Long,0.3454,0.3467,0.996,0.2,0
0d91f54d-b20d-4a50-b7dd-d071c39a0690,BE9558,2026-05-16T12:06:01,K558LLAE.Y10W,Long,0.3431,0.3467,0.990,0.2,0
12ccdecd-5fd9-4465-9813-3d6006ec32f3,BE9558,2026-05-16T12:11:19,K558LLAF.6V0W,Long,0.3433,0.3467,0.990,0.2,0
a7024f1a-f071-48ab-820f-99bdf87366b5,BE9558,2026-05-16T12:16:37,K558LLAF.FP0W,Long,0.3361,0.3369,0.998,0.2,0
de0fa439-30b8-4607-a3c3-7e17191e4624,BE9558,2026-05-16T12:21:55,K558LLAF.OJ0W,Long,0.3274,0.3320,0.986,0.2,0
f9374ec3-05e5-477f-8e1a-0c862fed2a50,BE9558,2026-05-16T12:27:13,K558LLAF.XD0W,Long,0.3449,0.3467,0.995,0.2,0
424cb275-3743-4174-95f0-0ca1205b374c,BE9558,2026-05-16T12:32:31,K558LLAG.670W,Long,0.3370,0.3418,0.986,0.2,0
9accde13-cefa-41b8-bd0a-cef2ffed59b0,BE9558,2026-05-16T12:37:49,K558LLAG.F10W,Long,0.3465,0.3467,0.999,0.2,0
4665be38-1956-4b14-b931-068ba9af5c5e,BE9558,2026-05-16T12:48:25,K558LLAG.WP0W,Long,0.3453,0.3516,0.982,0.2,0
1aedf624-1a99-43e1-a8f2-f9d358b97f61,BE9558,2026-05-16T12:53:43,K558LLAH.5J0W,Long,0.3366,0.3418,0.985,0.2,0
c15e1799-91d7-425e-ad17-2ba3d170d81e,BE9558,2026-05-16T13:04:19,K558LLAH.N70W,Long,0.3348,0.3369,0.994,0.2,0
72d4c4ea-19ca-4cc6-9b04-7a2b70122c67,BE9558,2026-05-16T13:09:37,K558LLAH.W10W,Long,0.3272,0.3320,0.986,0.2,0
b4ebf2c9-1f6d-4594-9810-40479e87c0a5,BE9558,2026-05-16T13:14:55,K558LLAI.4V0W,Long,0.3297,0.3320,0.993,0.2,0
bb297e9e-548f-4dae-8b1a-0f161af2e766,BE9558,2026-05-16T13:20:13,K558LLAI.DP0W,Long,0.3272,0.3320,0.986,0.2,0
87562c24-63db-48bd-9962-72a20a40f2ff,BE9558,2026-05-16T13:36:07,K558LLAJ.470W,Long,0.3174,0.3223,0.985,0.2,0
01e9cc58-3bea-4f38-8499-a2c20e5f8550,BE9558,2026-05-16T13:46:52,K558LLAJ.M40W,Long,0.2880,0.2930,0.983,0.2,0
5ae7503d-ae17-4063-9208-6a420699e1ab,BE9558,2026-05-16T14:00:35,K558LLAK.8Z0W,Long,0.2879,0.2930,0.983,0.2,0
e009ea3c-1534-4154-8623-e180ed4db9fb,BE9558,2026-05-16T14:06:19,K558LLAK.IJ0W,Long,0.2882,0.2930,0.984,0.2,0
cd4e21f5-512b-4b2b-8054-bec01aa06400,BE9558,2026-05-16T14:12:03,K558LLAK.S30W,Long,0.2857,0.2930,0.975,0.2,0
ae5b780f-2038-4ccf-8bfc-b15b87be139e,BE9558,2026-05-16T14:17:22,K558LLAL.0Y0W,Long,0.2899,0.2930,0.989,0.2,0
d8c3fb81-8c66-4ebc-b33a-0559bc03334b,BE9558,2026-05-16T14:22:40,K558LLAL.9S0W,Long,0.3009,0.3027,0.994,0.2,0
990a4c7a-3c51-4d4a-8ab7-416ccb97d29c,BE9558,2026-05-16T14:27:58,K558LLAL.IM0W,Long,0.3057,0.3076,0.994,0.2,0
68d7a2c3-d899-4e75-96fb-3bf16ae6ea6f,BE9558,2026-05-16T14:33:16,K558LLAL.RG0W,Long,0.3110,0.3125,0.995,0.2,0
73505b8c-f912-4116-b903-a8a4c75524d3,BE9558,2026-05-16T14:38:34,K558LLAM.0A0W,Long,0.3172,0.3223,0.984,0.2,0
8d3c9602-7efa-488a-801b-3228bd85ab14,BE9558,2026-05-16T14:43:51,K558LLAM.930W,Long,0.3136,0.3174,0.988,0.2,0
243e16ee-860a-4960-bc15-b797ad7e9735,BE9558,2026-05-16T14:49:08,K558LLAM.HW0W,Long,0.3135,0.3174,0.988,0.2,0
e90c8d90-6d41-4788-9ee6-a29e4bfcc16b,BE9558,2026-05-16T15:19:35,K558LLAN.WN0W,Long,0.3132,0.3174,0.987,0.2,0
4182b0e7-7811-46b8-87d1-a4dd0c152f3b,BE9558,2026-05-16T15:28:45,K558LLAO.BX0W,Long,0.3023,0.3076,0.983,0.2,0
28a790da-0e48-4fe4-b8ba-2c82cc6bfa79,BE9558,2026-05-16T15:34:02,K558LLAO.KQ0W,Long,0.3176,0.3223,0.985,0.2,0
093d2fa3-7a4b-4f0f-abda-71155ebe2dfb,BE9558,2026-05-16T15:39:19,K558LLAO.TJ0W,Long,0.3223,0.3271,0.985,0.2,0
68dc9560-4082-49b6-af04-9244773ffbc1,BE9558,2026-05-16T15:44:36,K558LLAP.2C0W,Long,0.3227,0.3271,0.986,0.2,0
ad6b268a-165d-4b1d-b0b3-f58db7c9b0e4,BE9558,2026-05-16T15:49:53,K558LLAP.B50W,Long,0.3177,0.3223,0.986,0.2,0
046c5cb4-56b3-48c0-83c2-bf1f30837940,BE9558,2026-05-16T15:55:10,K558LLAP.JY0W,Long,0.3174,0.3223,0.985,0.2,0
1b76edf4-3b1c-4bcb-a73c-27334981c350,BE9558,2026-05-16T16:00:27,K558LLAP.SR0W,Long,0.3127,0.3174,0.985,0.2,0
a0264171-a682-4396-ad8a-cda3b2964533,BE9558,2026-05-16T16:06:55,K558LLAQ.3J0W,Long,0.2885,0.2930,0.985,0.2,0
707da1f6-ee81-4e57-abd5-98295c14651b,BE9558,2026-05-16T16:12:30,K558LLAQ.CU0W,Long,0.2880,0.2930,0.983,0.2,0
b8115b64-8739-42c8-b541-713ab6b68bcd,BE9558,2026-05-16T16:17:53,K558LLAQ.LT0W,Long,0.2881,0.2930,0.983,0.2,0
fb179c36-fef1-4df6-b0a0-2bd7792ea910,BE9558,2026-05-16T16:23:11,K558LLAQ.UN0W,Long,0.2933,0.2979,0.985,0.2,0
0cec8793-c3c1-486b-a33a-4dbf9cb069b0,BE9558,2026-05-16T16:33:46,K558LLAR.CA0W,Long,0.3017,0.3027,0.997,0.2,0
c531b052-ee04-4c66-888b-21e97445a615,BE9558,2026-05-16T16:49:37,K558LLAS.2P0W,Long,0.2922,0.2979,0.981,0.2,0
0dc402f9-cab6-4c4a-8317-b8fc3c4b1ced,BE9558,2026-05-16T16:55:08,K558LLAS.BW0W,Long,0.2898,0.2930,0.989,0.2,0
fd73733e-b42d-4a51-81d0-4acad6edfbd4,BE9558,2026-05-16T17:16:17,K558LLAT.B50W,Long,0.3115,0.3125,0.997,0.2,0
6a254daa-ae27-4ac1-b334-58f776a6b276,BE9558,2026-05-16T17:26:51,K558LLAT.SR0W,Long,0.3174,0.3223,0.985,0.2,0
0cc8e82f-5270-4508-beae-0d3af56095ca,BE9558,2026-05-16T17:37:27,K558LLAU.AF0W,Long,0.2899,0.2930,0.989,0.2,0
00557a73-8dc3-4cd2-b880-c7820dc8b171,BE9558,2026-05-16T17:43:17,K558LLAU.K50W,Long,0.2881,0.2930,0.983,0.2,0
8e5518d9-ff0a-4c09-9cf9-a681c84c0b6e,BE9558,2026-05-16T17:53:53,K558LLAV.1T0W,Long,0.2898,0.2930,0.989,0.2,0
91dbd7e9-7344-400b-82b1-379f2ac4b49a,BE9558,2026-05-16T17:59:11,K558LLAV.AN0W,Long,0.2925,0.2930,0.998,0.2,0
fa256408-d480-4376-95b5-d1a549c483ea,BE9558,2026-05-16T18:04:29,K558LLAV.JH0W,Long,0.2977,0.3027,0.983,0.2,0
4ab6e66a-8364-49b6-82f1-86e86199e676,BE9558,2026-05-16T18:09:46,K558LLAV.SA0W,Long,0.2944,0.2979,0.988,0.2,0
0a65fb7c-96e1-4ba0-85de-4620d88658c1,BE9558,2026-05-16T18:15:03,K558LLAW.130W,Long,0.2965,0.2979,0.995,0.2,0
92b1ef3e-1696-4123-8662-163947737c83,BE9558,2026-05-16T18:20:20,K558LLAW.9W0W,Long,0.2976,0.3027,0.983,0.2,0
9e3cb24c-4426-4220-9a73-389d0a96c94f,BE9558,2026-05-16T18:25:37,K558LLAW.IP0W,Long,0.2983,0.3027,0.985,0.2,0
a3473215-4c46-45ab-9aa7-1720486ec4a8,BE9558,2026-05-16T18:30:54,K558LLAW.RI0W,Long,0.2956,0.2979,0.993,0.2,0
449665b1-47c8-4bd2-984c-8f45b627e6d8,BE9558,2026-05-16T18:36:11,K558LLAX.0B0W,Long,0.2989,0.3027,0.987,0.2,0
600cfabc-cffd-42e1-800c-70e75f312316,BE9558,2026-05-16T20:00:12,K558LLB0.WC0W,Long,0.3077,0.3125,0.985,0.2,0
12bf5944-0194-4f5b-b486-a7acd7141c7f,BE9558,2026-05-16T20:04:28,K558LLB1.3G0W,Long,0.2888,0.2930,0.986,0.2,0
f1fc913a-91bc-4240-a595-7dfe3091f9a2,BE9558,2026-05-16T20:07:29,K558LLB1.8H0W,Long,0.2977,0.3027,0.983,0.2,0
e74f7ec3-20bb-4177-beb2-e802e5f801fd,BE9558,2026-05-16T20:10:26,K558LLB1.DE0W,Long,0.2978,0.3027,0.984,0.2,0
27491c3a-b631-4643-818a-714523911178,BE9558,2026-05-16T20:16:21,K558LLB1.N90W,Long,0.2921,0.2930,0.997,0.2,0
9d9196ce-11e2-4f28-b01c-3dcc60e60d42,BE9558,2026-05-16T20:22:28,K558LLB1.XG0W,Long,0.2881,0.2930,0.983,0.2,0
a592d7c8-b643-4b25-9186-3d611ae22709,BE9558,2026-05-16T20:25:37,K558LLB2.2P0W,Long,0.2893,0.2930,0.987,0.2,0
f709a3d5-27cd-4bb1-b91c-669e8ea11d77,BE9558,2026-05-16T20:28:57,K558LLB2.890W,Long,0.2880,0.2930,0.983,0.2,0
cc9cad87-b87f-4b67-854a-ffb21e876a92,BE9558,2026-05-16T20:32:45,K558LLB2.EL0W,Long,0.2873,0.2930,0.980,0.2,0
10732d26-6b49-4b14-a474-6c75e259d278,BE9558,2026-05-16T20:49:32,K558LLB3.6K0W,Long,0.2881,0.2930,0.983,0.2,0
aa63957a-fdb2-4f17-af52-a63bb015119d,BE9558,2026-05-16T21:21:45,K558LLB4.O90W,Long,0.2880,0.2930,0.983,0.2,0
8350440f-019d-45a4-b9f9-23058628e6f0,BE9558,2026-05-16T21:32:43,K558LLB5.6J0W,Long,0.2925,0.2930,0.999,0.2,0
edfc10b2-dbe1-4527-a061-b0d670b5e5d2,BE9558,2026-05-16T21:35:37,K558LLB5.BD0W,Long,0.2891,0.2930,0.987,0.2,0
f98001a3-88b2-4830-8112-b7c5164e99c3,BE9558,2026-05-16T21:38:40,K558LLB5.GG0W,Long,0.2877,0.2930,0.982,0.2,0
f1e53e7b-b124-4fc5-82c2-504fb0c8b80d,BE9558,2026-05-16T21:41:46,K558LLB5.LM0W,Long,0.2881,0.2930,0.983,0.2,0
7890637f-142e-4775-b48c-fd4f3b8ada77,BE9558,2026-05-16T21:45:14,K558LLB5.RE0W,Long,0.2880,0.2930,0.983,0.2,0
7c97c10f-b413-467c-9b56-c18e423cdcfa,BE9558,2026-05-16T21:48:26,K558LLB5.WQ0W,Long,0.2886,0.2930,0.985,0.2,0
8178cf22-8428-4f85-8199-0a43f7334a8f,BE9558,2026-05-16T21:51:47,K558LLB6.2B0W,Long,0.2881,0.2930,0.983,0.2,0
eceb2997-deb4-403a-802f-50e93d23d423,BE9558,2026-05-16T21:57:18,K558LLB6.BI0W,Long,0.2881,0.2930,0.984,0.2,0
9c26690c-1983-4b21-b8af-7c7967c014c3,BE9558,2026-05-16T22:12:21,K558LLB7.0L0W,Long,0.2876,0.2930,0.982,0.2,0
78f67fc3-08b7-4317-96ba-ee5544e0b95b,BE9558,2026-05-16T22:19:34,K558LLB7.CM0W,Long,0.2880,0.2930,0.983,0.2,0
7f9dad14-4f1b-492d-aa26-845a908ea894,BE9558,2026-05-16T22:27:40,K558LLB7.Q40W,Long,0.2881,0.2930,0.983,0.2,0
f75c52b4-21b9-4065-baeb-5cfbd27d130a,BE9558,2026-05-16T22:33:50,K558LLB8.0E0W,Long,0.2881,0.2930,0.984,0.2,0
10f7496d-fa76-40a7-8bef-dc14e8a41869,BE9558,2026-05-16T22:40:48,K558LLB8.C00W,Long,0.2878,0.2930,0.982,0.2,0
1 event_id serial timestamp filename channel offset_ips peak_ips mean_over_peak trigger_level_ips already_flagged_ft
2 1e7a7808-034c-423b-80e9-d6788da80993 BE18438 2025-11-15T08:57:40 T438LBX4.W40W Vert 0.2722 0.2930 0.929 0.2 0
3 346e383f-c5a1-41d1-b972-3d652e599d39 BE18438 2025-11-15T09:13:15 T438LBX5.M30W Vert 0.2747 0.2930 0.938 0.2 0
4 45ef3023-22c5-44a8-a606-a0900bc17861 BE18438 2025-11-15T09:16:13 T438LBX5.R10W Vert 0.2929 0.3027 0.967 0.2 0
5 1cbcd2aa-ec55-4e2f-af42-7178f26cc6a1 BE18438 2025-11-15T09:19:29 T438LBX5.WH0W Vert 0.2816 0.2979 0.945 0.2 0
6 caf43634-4528-4fd5-9674-5f4f563661c0 BE18438 2025-11-15T09:22:32 T438LBX6.1K0W Vert 0.2883 0.2930 0.984 0.2 0
7 456ae646-c834-4e5c-82f1-7df18b3440a1 BE18438 2025-11-15T09:25:31 T438LBX6.6J0W Vert 0.3189 0.3223 0.989 0.2 0
8 afb91ba2-351b-42a0-b33f-acebd5f1829d BE18438 2025-11-15T09:28:29 T438LBX6.BH0W Vert 0.3057 0.3076 0.994 0.2 0
9 39847146-3537-4300-943d-01c0c771e9cd BE18438 2025-11-15T09:31:26 T438LBX6.GE0W Vert 0.3225 0.3271 0.986 0.2 0
10 e47335c1-fc3f-4c90-88c6-8edd0f296ce4 BE18438 2025-11-15T09:34:24 T438LBX6.LC0W Vert 0.3275 0.3320 0.986 0.2 0
11 25b6eda6-ba98-422f-8834-94b6cbe34971 BE18438 2025-11-15T09:37:22 T438LBX6.QA0W Vert 0.3398 0.3418 0.994 0.2 0
12 7af99377-e47f-4914-8e91-ac7f7f50b8c6 BE18438 2025-11-15T09:40:20 T438LBX6.V80W Vert 0.3515 0.3564 0.986 0.2 0
13 c4330605-c257-49ef-aede-20deb641e7d7 BE18438 2025-11-15T10:09:48 T438LBX8.8C0W Vert 0.3605 0.3955 0.912 0.2 0
14 b665caf9-64ee-4352-a391-60c1ddeebc1e BE18438 2026-02-25T10:58:04 T438LH66.GS0W Vert 0.1803 0.1953 0.923 0.2 0
15 3b0c32c3-fd16-4b83-9917-942a56dea168 BE18438 2026-02-25T18:12:04 T438LH6Q.K40W Vert 0.1869 0.1953 0.957 0.2 0
16 ca66e601-d10f-4424-9c26-08a688e7b08c BE18438 2026-02-25T18:17:16 T438LH6Q.SS0W Vert 0.1870 0.1953 0.958 0.2 0
17 31aa30ba-eb0a-49a9-98ca-c77d2cc31275 BE18438 2026-02-25T18:21:11 T438LH6Q.ZB0W Vert 0.1868 0.1953 0.956 0.2 0
18 fdb55a93-fc91-4fdf-a7f4-fdd1a6b48f59 BE18438 2026-02-25T18:26:27 T438LH6R.830W Vert 0.1893 0.1953 0.969 0.2 0
19 cbd718d7-2378-4d74-8656-842f229d19a8 BE18438 2026-02-25T18:33:25 T438LH6R.JP0W Vert 0.1887 0.1953 0.966 0.2 0
20 bfaf58ec-6163-47eb-9d2a-70da880bd948 BE18438 2026-02-25T18:37:48 T438LH6R.R00W Vert 0.1872 0.1953 0.959 0.2 0
21 ddaa530b-886e-4415-b93a-f4ebf4c4a882 BE18438 2026-02-25T18:59:54 T438LH6S.RU0W Vert 0.1874 0.1953 0.959 0.2 0
22 57f15284-ab69-48fc-9660-8c347c80c681 BE18438 2026-02-25T19:15:58 T438LH6T.IM0W Vert 0.1873 0.1953 0.959 0.2 0
23 03715718-7aa8-4e1d-9b0b-c2ab75fc1975 BE18438 2026-02-25T19:19:58 T438LH6T.PA0W Vert 0.1891 0.1953 0.968 0.2 0
24 9f921cd5-1bf9-4713-aef6-41e7f780eff1 BE18438 2026-02-25T19:24:02 T438LH6T.W20W Vert 0.1871 0.1953 0.958 0.2 0
25 44994949-58d4-44fa-bd78-ed75b8acc667 BE18438 2026-02-25T19:44:57 T438LH6U.UX0W Vert 0.1877 0.1953 0.961 0.2 0
26 c4be01c3-1001-4e17-aecd-d6d26dbb09f3 BE18438 2026-02-25T19:49:19 T438LH6V.270W Vert 0.1884 0.1953 0.964 0.2 0
27 3db004e6-ee34-43c5-ae8e-f22894ead5d0 BE18438 2026-02-25T20:08:22 T438LH6V.XY0W Vert 0.1878 0.1953 0.962 0.2 0
28 d276ae48-0434-41e5-af43-e0fb366acf11 BE18438 2026-02-25T20:11:33 T438LH6W.390W Vert 0.1880 0.1953 0.963 0.2 0
29 c027dc12-88fd-4a45-872b-a6a945f2008e BE18438 2026-02-25T20:14:35 T438LH6W.8B0W Vert 0.1874 0.1953 0.959 0.2 0
30 9665bc3a-3d08-4852-b008-37ef8bfd0023 BE18438 2026-02-25T20:18:51 T438LH6W.FF0W Vert 0.1884 0.1953 0.965 0.2 0
31 5fb5a05e-d7e2-4268-9b85-cfe8d82aa6c9 BE18438 2026-02-25T20:29:50 T438LH6W.XQ0W Vert 0.1890 0.1953 0.968 0.2 0
32 57ec0b10-9324-4459-a07e-0c8532b8928f BE18438 2026-02-25T20:35:39 T438LH6X.7F0W Vert 0.1889 0.1953 0.967 0.2 0
33 ac86f73f-1174-4fae-a206-ecdcb73e1ffc BE18438 2026-02-25T20:39:12 T438LH6X.DC0W Vert 0.1887 0.1953 0.966 0.2 0
34 dcf25ddd-9cf0-41c1-b109-f3ef2e490ce5 BE18438 2026-02-25T20:43:41 T438LH6X.KT0W Vert 0.1871 0.1953 0.958 0.2 0
35 aa79bbdd-2392-4ef6-8a5c-873a9f72746d BE18438 2026-02-25T20:46:51 T438LH6X.Q30W Vert 0.1877 0.1953 0.961 0.2 0
36 ad46d1ce-b417-4c8c-b029-bb3b008ba809 BE18438 2026-02-25T20:53:33 T438LH6Y.190W Vert 0.1882 0.1953 0.964 0.2 0
37 3d3a8f34-86a7-4d70-a7e8-fa768a723325 BE18438 2026-02-26T07:03:39 T438LH7Q.A30W Vert 0.1809 0.1953 0.926 0.2 0
38 7817525f-dc3d-4f5e-b2cb-5af9ca12ede8 BE18438 2026-02-26T07:09:42 T438LH7Q.K60W Vert 0.1814 0.1953 0.929 0.2 0
39 a2091302-0b34-46c1-ab83-174be2b59bcf BE18438 2026-02-26T13:12:35 T438LH87.CZ0W Vert 0.1896 0.1953 0.971 0.2 0
40 e1c0c9de-a900-479f-9572-9675b13296a9 BE18438 2026-02-26T13:24:46 T438LH87.XA0W Vert 0.2237 0.2588 0.864 0.2 0
41 76a6dc6b-88e1-434b-a137-f5e9b63f248e BE18438 2026-02-26T13:27:43 T438LH88.270W Vert 0.3185 0.3223 0.988 0.2 0
42 281b508b-7982-4668-86af-9b0b28be608a BE18438 2026-02-26T13:30:36 T438LH88.700W Vert 0.3263 0.3320 0.983 0.2 0
43 68bbaf77-bb23-40fd-94f9-f928728d90dc BE18438 2026-02-26T13:33:28 T438LH88.BS0W Vert 0.3207 0.3271 0.980 0.2 0
44 5c975640-6ff1-441a-aa11-41642f6a6b31 BE18438 2026-02-26T13:36:21 T438LH88.GL0W Vert 0.3261 0.3320 0.982 0.2 0
45 dea248ac-1124-4bba-b054-953f86c852b2 BE18438 2026-02-26T13:40:34 T438LH88.NM0W Vert 0.3271 0.3320 0.985 0.2 0
46 4e463201-f008-41ad-9c52-11fcc3d93095 BE18438 2026-02-26T13:43:29 T438LH88.SH0W Vert 0.3357 0.3418 0.982 0.2 0
47 507262c5-d58f-4a05-a6a3-a6cbb5b4de20 BE18438 2026-02-26T13:46:24 T438LH88.XC0W Vert 0.3372 0.3418 0.987 0.2 0
48 4c2d8ee8-842f-4e44-9e03-ff34d26e4fdb BE18438 2026-02-26T13:49:17 T438LH89.250W Vert 0.3253 0.3320 0.980 0.2 0
49 b184b112-603f-44f4-ae97-087493fbd8ce BE18438 2026-02-26T13:52:10 T438LH89.6Y0W Vert 0.3321 0.3369 0.986 0.2 0
50 2ff1a552-5a2e-4396-9083-b9c8d334eed7 BE18438 2026-02-26T13:55:04 T438LH89.BS0W Vert 0.3378 0.3418 0.988 0.2 0
51 928e21a7-1990-4792-803e-58014d8140ce BE18438 2026-02-26T13:57:57 T438LH89.GL0W Vert 0.3341 0.3369 0.992 0.2 0
52 f521b5db-6100-41e6-954e-0abdbf9660c1 BE18438 2026-02-26T14:00:51 T438LH89.LF0W Vert 0.3421 0.3467 0.987 0.2 0
53 efba962f-e511-41ef-9fc5-313f202a9d96 BE18438 2026-02-26T14:03:46 T438LH89.QA0W Vert 0.3506 0.3564 0.984 0.2 0
54 0b51e273-8d10-4494-bda6-8c75eaeec66f BE18438 2026-02-26T14:06:41 T438LH89.V50W Vert 0.3448 0.3516 0.981 0.2 0
55 6d46e4ee-1647-4169-b6b2-33da32240eb9 BE18438 2026-02-26T14:09:35 T438LH89.ZZ0W Vert 0.3463 0.3516 0.985 0.2 0
56 1ca294cd-4dc2-41fb-9374-e277d4550761 BE18438 2026-02-26T14:12:28 T438LH8A.4S0W Vert 0.3442 0.3467 0.993 0.2 0
57 7b683dcf-1aed-4d9b-be1e-b10f92374398 BE18438 2026-02-26T14:15:23 T438LH8A.9N0W Vert 0.3486 0.3516 0.992 0.2 0
58 2b5cb8e7-c947-4914-bcb5-504f74603547 BE18438 2026-02-26T14:18:21 T438LH8A.EL0W Vert 0.3519 0.3613 0.974 0.2 0
59 5ea3a6bf-10de-4911-aedc-66daecf86b76 BE18438 2026-02-26T14:21:16 T438LH8A.JG0W Vert 0.3460 0.3564 0.971 0.2 0
60 d93be7f5-39ec-45fd-9949-fa531f2f9d34 BE18438 2026-02-26T14:24:13 T438LH8A.OD0W Vert 0.3457 0.3516 0.983 0.2 0
61 cfa113f2-8cee-4a1d-b1e7-0e936fa771e2 BE18438 2026-02-26T14:28:21 T438LH8A.V90W Vert 0.3485 0.3564 0.978 0.2 0
62 46d322ac-38cb-4c99-a4c2-9e9d7ad06171 BE18438 2026-02-26T14:31:17 T438LH8B.050W Vert 0.3367 0.3467 0.971 0.2 0
63 42500a83-bd67-4deb-8bb2-963ee2b8a7ce BE18438 2026-02-26T14:34:11 T438LH8B.4Z0W Vert 0.3365 0.3516 0.957 0.2 0
64 3ccf6bda-2e88-473c-951d-9ea86d0d9363 BE18438 2026-02-26T14:37:05 T438LH8B.9T0W Vert 0.3472 0.3564 0.974 0.2 0
65 9050487d-d238-4631-b8e1-5a693a026542 BE18438 2026-02-26T14:39:58 T438LH8B.EM0W Vert 0.3420 0.3564 0.959 0.2 0
66 e62989e4-a326-4bae-8d47-a8becee96462 BE18438 2026-02-26T14:42:52 T438LH8B.JG0W Vert 0.3430 0.3564 0.962 0.2 0
67 f0e30fab-dc57-4189-8439-48df17007a2c BE18438 2026-02-26T14:45:46 T438LH8B.OA0W Vert 0.3389 0.3516 0.964 0.2 0
68 03e1ca09-78df-4c6f-9915-0b6e4f2141d2 BE18438 2026-02-26T14:48:43 T438LH8B.T70W Vert 0.3449 0.3564 0.968 0.2 0
69 945d39f7-1b98-4a1f-80a8-6a18fd9df25f BE18438 2026-02-26T14:51:37 T438LH8B.Y10W Vert 0.3522 0.3613 0.975 0.2 0
70 d27eb2e3-e313-4125-98f4-f9d6d3737d28 BE18438 2026-02-26T14:54:32 T438LH8C.2W0W Vert 0.3502 0.3613 0.969 0.2 0
71 916901cb-ebea-441e-a2a1-40f4e49f32f4 BE18438 2026-02-26T14:57:25 T438LH8C.7P0W Vert 0.3524 0.3662 0.962 0.2 0
72 5d8d7e29-fdbb-4fa3-bd25-506c9352a354 BE18438 2026-02-26T15:01:35 T438LH8C.EN0W Vert 0.3530 0.3613 0.977 0.2 0
73 c6c7a3af-b03b-43dc-97de-024f8e09b62f BE18438 2026-02-26T15:04:27 T438LH8C.JF0W Vert 0.3514 0.3613 0.973 0.2 0
74 b6856898-3d10-4967-9577-7f17902f77ea BE18438 2026-02-26T15:11:34 T438LH8C.VA0W Vert 0.3566 0.3613 0.987 0.2 0
75 7a4802f6-621e-4230-8d8c-d7f0c9a65bf2 BE18438 2026-02-26T15:14:24 T438LH8D.000W Vert 0.3594 0.3711 0.968 0.2 0
76 79f38b7e-ec56-417e-943a-8c944252c2b8 BE18438 2026-02-26T15:18:32 T438LH8D.6W0W Vert 0.3550 0.3613 0.983 0.2 0
77 1b4190c4-0d54-48ba-8ff5-8ddb0eb91e50 BE18438 2026-02-26T15:22:22 T438LH8D.DA0W Vert 0.3571 0.3613 0.988 0.2 0
78 de57b5ae-a3a1-4ede-9d2b-3e87bfb3fd19 BE9558 2026-04-14T11:16:32 K558LJN3.BK0W Tran 0.3448 0.3662 0.942 0.2 0
79 43afeaf5-02ec-41f6-9e23-0c9772821ed4 BE9558 2026-04-14T11:27:15 K558LJN3.TF0W Tran 0.3094 0.3223 0.960 0.2 0
80 8123c0ef-84c9-4f6c-8d82-9dc32e2e470d BE9558 2026-04-14T14:45:30 K558LJNC.ZU0W Tran 0.2721 0.3564 0.763 0.2 0
81 8c787af3-596e-411b-9e10-29485fa5114f BE9558 2026-04-29T16:18:47 K558LKF9.BB0W Tran 0.2943 0.3027 0.972 0.2 0
82 431928ff-b4c4-4caa-b933-acc917f3717c BE9558 2026-05-04T15:02:30 K558LKOF.460W Tran 0.4364 0.5225 0.835 0.2 0
83 6c3c07f8-c36a-4493-acce-7441c9d22cec BE9558 2026-05-15T08:50:06 K558LL8B.7I0W Long 0.2892 0.2930 0.987 0.2 0
84 13c268df-b652-422e-a642-6453f6a314aa BE9558 2026-05-15T10:18:34 K558LL8F.AY0W Long 0.2907 0.2979 0.976 0.2 0
85 9b0d0871-8810-467d-806a-5bbfa4e667fe BE9558 2026-05-15T15:52:00 K558LL8U.QO0W Long 0.2659 0.2979 0.893 0.2 0
86 092640f9-a944-48b7-b872-364d75c2c5e7 BE9558 2026-05-15T16:13:12 K558LL8V.Q00W Long 0.2428 0.2979 0.815 0.2 0
87 0573741a-96ab-4b36-af7a-b5bc11a79009 BE9558 2026-05-16T03:23:26 K558LL9Q.R20W Long 0.2861 0.2930 0.976 0.2 0
88 321f03ea-6696-47de-ad46-2be43d4d6cae BE9558 2026-05-16T03:30:49 K558LL9R.3D0W Long 0.2886 0.2930 0.985 0.2 0
89 cc423a6a-3e3c-466a-b39c-6146ca7f34c8 BE9558 2026-05-16T03:33:55 K558LL9R.8J0W Long 0.2880 0.2881 1.000 0.2 0
90 efa52a14-cc68-4bea-aab4-4ee3a3cbff3a BE9558 2026-05-16T03:36:55 K558LL9R.DJ0W Long 0.2890 0.2930 0.986 0.2 0
91 92895bfe-122f-4cdc-bd3d-40609633d278 BE9558 2026-05-16T03:43:41 K558LL9R.OT0W Long 0.2880 0.2881 1.000 0.2 0
92 2a4c81db-2307-44e5-9b27-d5154d98e38d BE9558 2026-05-16T03:46:36 K558LL9R.TO0W Long 0.2921 0.2979 0.981 0.2 0
93 656b0fdc-e275-4c9c-8936-9eee267ea04e BE9558 2026-05-16T03:49:28 K558LL9R.YG0W Long 0.2966 0.2979 0.996 0.2 0
94 3b9989ae-e0f2-4652-9724-c145603543d2 BE9558 2026-05-16T03:52:29 K558LL9S.3H0W Long 0.2880 0.2930 0.983 0.2 0
95 837d0d84-d609-4f4a-b542-b7e2b064ea22 BE9558 2026-05-16T03:56:32 K558LL9S.A80W Long 0.2880 0.2930 0.983 0.2 0
96 affcb008-ab99-4bc5-8f35-83dbe620499d BE9558 2026-05-16T04:02:50 K558LL9S.KQ0W Long 0.2896 0.2930 0.989 0.2 0
97 e1f1c6d2-545c-451f-9018-714d52e20a05 BE9558 2026-05-16T04:05:47 K558LL9S.PN0W Long 0.3024 0.3076 0.983 0.2 0
98 93ef80f1-7e83-4703-a0f9-89bbfeeae6c3 BE9558 2026-05-16T04:08:41 K558LL9S.UH0W Long 0.2976 0.2979 0.999 0.2 0
99 5c118ca9-fc37-4080-876d-b3f57ce0b121 BE9558 2026-05-16T04:11:42 K558LL9S.ZI0W Long 0.2881 0.2930 0.983 0.2 0
100 d98b2eaa-7763-4c78-88fb-c21195cb9978 BE9558 2026-05-16T04:14:38 K558LL9T.4E0W Long 0.2898 0.2930 0.989 0.2 0
101 6a146a01-0d02-4413-b231-ecb4a6fde776 BE9558 2026-05-16T04:17:35 K558LL9T.9B0W Long 0.2880 0.2930 0.983 0.2 0
102 f6587a55-27e3-454f-997e-57e7516a296c BE9558 2026-05-16T04:20:32 K558LL9T.E80W Long 0.3046 0.3076 0.990 0.2 0
103 1fb48250-2214-41e6-92cb-362aff1ba62b BE9558 2026-05-16T04:26:05 K558LL9T.NH0W Long 0.2876 0.2930 0.982 0.2 0
104 2f4f3d06-1189-4e28-a1ac-5454ea586a0c BE9558 2026-05-16T04:59:47 K558LL9V.7N0W Long 0.2961 0.3027 0.978 0.2 0
105 62b7bdab-b744-41e4-8d0e-c9141b9d4821 BE9558 2026-05-16T05:02:46 K558LL9V.CM0W Long 0.2903 0.2930 0.991 0.2 0
106 cadcb6dc-74c0-48b5-974c-87bb7a57816c BE9558 2026-05-16T05:05:43 K558LL9V.HJ0W Long 0.3090 0.3125 0.989 0.2 0
107 a0235177-be5a-4f11-b741-c65744698e5b BE9558 2026-05-16T05:08:35 K558LL9V.MB0W Long 0.3167 0.3223 0.983 0.2 0
108 1968c2f6-f52c-4544-a0ed-f79b91ce0da0 BE9558 2026-05-16T05:11:28 K558LL9V.R40W Long 0.3446 0.3516 0.980 0.2 0
109 caa06b94-8813-4949-b47b-61ffb16e61c4 BE9558 2026-05-16T05:14:22 K558LL9V.VY0W Long 0.3318 0.3320 0.999 0.2 0
110 fdaa8101-f033-47e6-9c65-abd76dea1870 BE9558 2026-05-16T05:17:16 K558LL9W.0S0W Long 0.3407 0.3418 0.997 0.2 0
111 29bd16bd-81b9-4ccd-a981-f1a80858536c BE9558 2026-05-16T05:23:05 K558LL9W.AH0W Long 0.3450 0.3516 0.981 0.2 0
112 1f8bc862-d5fd-4cce-abc0-e2bd8c2f11fa BE9558 2026-05-16T05:26:00 K558LL9W.FC0W Long 0.3417 0.3467 0.986 0.2 0
113 20220068-d498-4fca-9a2a-a7fd2ee52ab1 BE9558 2026-05-16T05:28:53 K558LL9W.K50W Long 0.3516 0.3564 0.986 0.2 0
114 9816a261-3118-417a-8334-ace36687ad8f BE9558 2026-05-16T05:31:47 K558LL9W.OZ0W Long 0.3416 0.3467 0.985 0.2 0
115 5d2c76d7-543d-4557-9caf-996a69ab00bd BE9558 2026-05-16T05:34:42 K558LL9W.TU0W Long 0.3537 0.3564 0.992 0.2 0
116 c7b5ae00-52e7-4920-aa27-49d3b3daff92 BE9558 2026-05-16T05:37:36 K558LL9W.YO0W Long 0.3517 0.3564 0.987 0.2 0
117 07db8fd8-ccef-4a5a-9d97-9f318f73a478 BE9558 2026-05-16T05:40:31 K558LL9X.3J0W Long 0.3574 0.3613 0.989 0.2 0
118 790fcff9-e266-4a12-87f0-a072990d2533 BE9558 2026-05-16T05:43:26 K558LL9X.8E0W Long 0.3650 0.3662 0.997 0.2 0
119 f4245f61-1dde-43dc-a121-98e102f6a193 BE9558 2026-05-16T05:50:28 K558LL9X.K40W Long 0.3856 0.3906 0.987 0.2 0
120 5a3bce7b-358e-4260-876f-3f853163d7cf BE9558 2026-05-16T05:53:22 K558LL9X.OY0W Long 0.3847 0.3857 0.997 0.2 0
121 37c2b4b1-7a1b-43e7-b513-2c16f582109c BE9558 2026-05-16T05:56:15 K558LL9X.TR0W Long 0.3906 0.3955 0.988 0.2 0
122 57fde109-1d8a-45a1-b398-5bd28c3e47f1 BE9558 2026-05-16T05:59:10 K558LL9X.YM0W Long 0.4000 0.4004 0.999 0.2 0
123 1e41ab40-93be-405c-a464-f7a57524d3b3 BE9558 2026-05-16T06:02:02 K558LL9Y.3E0W Long 0.3825 0.3857 0.992 0.2 0
124 e9d61eb5-fae8-4902-8fab-4828ffa8e6da BE9558 2026-05-16T06:04:57 K558LL9Y.890W Long 0.3802 0.3809 0.998 0.2 0
125 c0e964e0-7788-4e41-bc41-6e479c3dc81b BE9558 2026-05-16T06:07:51 K558LL9Y.D30W Long 0.3954 0.4004 0.987 0.2 0
126 0b2df8e5-1689-4fe6-abad-30970ba10aa6 BE9558 2026-05-16T06:16:06 K558LL9Y.QU0W Long 0.4051 0.4053 1.000 0.2 0
127 2bc6ce73-464b-469c-9e8f-3bf6f6cfae1d BE9558 2026-05-16T06:21:51 K558LL9Z.0F0W Long 0.3910 0.3955 0.989 0.2 0
128 b8603ee1-616a-451e-a2cd-61f8f2634cd0 BE9558 2026-05-16T06:24:44 K558LL9Z.580W Long 0.3969 0.4004 0.991 0.2 0
129 1aecf582-66a2-4ebb-80f9-04b3aeba331a BE9558 2026-05-16T06:27:39 K558LL9Z.A30W Long 0.3915 0.3955 0.990 0.2 0
130 885aedfd-7a1a-4120-8176-7c344dd3d8fe BE9558 2026-05-16T06:30:30 K558LL9Z.EU0W Long 0.4025 0.4053 0.993 0.2 0
131 ec15930f-47f5-4752-afc2-427ee156ac95 BE9558 2026-05-16T06:33:25 K558LL9Z.JP0W Long 0.4060 0.4102 0.990 0.2 0
132 5ca23f47-2a38-4a54-99dd-041287aa9510 BE9558 2026-05-16T06:36:17 K558LL9Z.OH0W Long 0.4054 0.4102 0.988 0.2 0
133 03f371cf-81bc-4681-80f0-ef6fa437da85 BE9558 2026-05-16T06:39:09 K558LL9Z.T90W Long 0.4052 0.4102 0.988 0.2 0
134 ed386f54-140d-45e8-ad51-6585a58b4375 BE9558 2026-05-16T06:44:54 K558LLA0.2U0W Long 0.3993 0.4004 0.997 0.2 0
135 579f1c3f-4c1e-42a3-aa89-69aa93514033 BE9558 2026-05-16T06:47:47 K558LLA0.7N0W Long 0.4001 0.4053 0.987 0.2 0
136 57024de6-07ea-41f4-b916-c6adc3f51636 BE9558 2026-05-16T06:50:40 K558LLA0.CG0W Long 0.4103 0.4150 0.989 0.2 0
137 36bf5adf-afb5-4a5e-a106-1afbd1f56c7b BE9558 2026-05-16T06:54:49 K558LLA0.JD0W Long 0.4069 0.4150 0.980 0.2 0
138 3e2f831b-5228-46ff-9acb-75d8c86f8bc1 BE9558 2026-05-16T06:57:43 K558LLA0.O70W Long 0.4108 0.4150 0.990 0.2 0
139 1775fa20-568b-4294-b9ca-561201a66c5b BE9558 2026-05-16T07:00:38 K558LLA0.T20W Long 0.3967 0.4004 0.991 0.2 0
140 fd391469-03f9-4d8d-bccd-3af50c91e5b7 BE9558 2026-05-16T07:03:33 K558LLA0.XX0W Long 0.3927 0.3955 0.993 0.2 0
141 02b52ef6-b707-4dcb-b58f-43da02698832 BE9558 2026-05-16T07:06:27 K558LLA1.2R0W Long 0.3824 0.3857 0.991 0.2 0
142 8d45333f-e101-4249-9e27-913c583a0a8d BE9558 2026-05-16T07:09:21 K558LLA1.7L0W Long 0.4085 0.4150 0.984 0.2 0
143 361d11ce-f42a-4d04-8270-ee3771fe4f09 BE9558 2026-05-16T07:12:14 K558LLA1.CE0W Long 0.4017 0.4053 0.991 0.2 0
144 59218125-ed5d-4457-aa8b-35ba03441363 BE9558 2026-05-16T07:15:07 K558LLA1.H70W Long 0.3934 0.3955 0.995 0.2 0
145 a603e55a-2ad6-4fc9-8c8c-0dc7be95c3e7 BE9558 2026-05-16T07:23:43 K558LLA1.VJ0W Long 0.3806 0.3857 0.987 0.2 0
146 c8d07902-93ea-4b03-9e69-9ad6ed5bffb1 BE9558 2026-05-16T07:26:36 K558LLA2.0C0W Long 0.3807 0.3857 0.987 0.2 0
147 4c46c0c7-42f0-4648-827e-1995f733b18f BE9558 2026-05-16T07:30:44 K558LLA2.780W Long 0.3667 0.3711 0.988 0.2 0
148 04759a00-ba3e-4959-a4cb-be8fc1f3004e BE9558 2026-05-16T07:36:28 K558LLA2.GS0W Long 0.3514 0.3516 1.000 0.2 0
149 0b6b0856-bd87-4a07-a5b4-f13d99e04a12 BE9558 2026-05-16T07:39:20 K558LLA2.LK0W Long 0.3512 0.3516 0.999 0.2 0
150 3d81a8bd-464d-4050-8a76-25e8373d1ddb BE9558 2026-05-16T07:42:12 K558LLA2.QC0W Long 0.3350 0.3369 0.994 0.2 0
151 b8b9c0c4-c388-4acb-955a-be4ac356afce BE9558 2026-05-16T07:45:04 K558LLA2.V40W Long 0.3563 0.3564 1.000 0.2 0
152 cb3d142a-fb84-4a21-a298-f61bb869b036 BE9558 2026-05-16T07:49:13 K558LLA3.210W Long 0.3663 0.3711 0.987 0.2 0
153 7401b19b-bc9d-43f0-b395-f4323aca5c72 BE9558 2026-05-16T07:52:06 K558LLA3.6U0W Long 0.3612 0.3662 0.986 0.2 0
154 2236df76-a9e6-401f-9176-ad565242f2cf BE9558 2026-05-16T07:57:52 K558LLA3.GG0W Long 0.3366 0.3369 0.999 0.2 0
155 a645846c-cae4-4aa5-a2e6-85166bd4dd62 BE9558 2026-05-16T08:00:44 K558LLA3.L80W Long 0.3265 0.3271 0.998 0.2 0
156 7212bd33-99a9-4659-9f0b-c98cc8d1e8bc BE9558 2026-05-16T08:04:51 K558LLA3.S30W Long 0.3418 0.3467 0.986 0.2 0
157 2cc4bf33-c63a-4c65-b0e2-5e61a9146a5d BE9558 2026-05-16T08:07:43 K558LLA3.WV0W Long 0.3405 0.3418 0.996 0.2 0
158 4fedb486-5f1f-4623-a01f-083e829f0565 BE9558 2026-05-16T08:10:35 K558LLA4.1N0W Long 0.3515 0.3564 0.986 0.2 0
159 58aff0ba-0f9b-45e1-9bbe-a990d16192ae BE9558 2026-05-16T08:13:27 K558LLA4.6F0W Long 0.3513 0.3516 0.999 0.2 0
160 e56d87e5-e1d4-4947-b6a5-3bbd2773c54a BE9558 2026-05-16T08:20:03 K558LLA4.HF0W Long 0.3564 0.3613 0.986 0.2 0
161 0e96e61e-6a21-4e07-8e09-72d09dbfa1e6 BE9558 2026-05-16T08:25:21 K558LLA4.Q90W Long 0.3565 0.3613 0.987 0.2 0
162 19611f28-2da8-4362-a58e-dbed2e061379 BE9558 2026-05-16T08:34:19 K558LLA5.570W Long 0.3647 0.3662 0.996 0.2 0
163 bd580c1d-44d4-41fd-9f83-f462cda4099a BE9558 2026-05-16T08:37:15 K558LLA5.A30W Long 0.3536 0.3564 0.992 0.2 0
164 2782df3b-3cb4-471a-a6f5-bbc4903a8ab9 BE9558 2026-05-16T08:44:00 K558LLA5.LC0W Long 0.3612 0.3662 0.986 0.2 0
165 d15a08f3-1c7c-4f80-8d9b-f5008c58c3d9 BE9558 2026-05-16T08:49:18 K558LLA5.U60W Long 0.3610 0.3613 0.999 0.2 0
166 03a10a6a-193a-476c-9543-f63818f69417 BE9558 2026-05-16T08:54:36 K558LLA6.300W Long 0.3515 0.3516 1.000 0.2 0
167 1c271856-8100-4c0d-bc8c-9357b47d7626 BE9558 2026-05-16T08:59:54 K558LLA6.BU0W Long 0.3617 0.3662 0.988 0.2 0
168 a85f125e-bfa2-42be-b877-2604b8d068c8 BE9558 2026-05-16T09:05:17 K558LLA6.KT0W Long 0.3510 0.3516 0.998 0.2 0
169 dde9aa71-d2e3-41ac-8388-f2bbddb6dae6 BE9558 2026-05-16T09:08:11 K558LLA6.PN0W Long 0.3447 0.3467 0.994 0.2 0
170 2f3f2be2-0ee3-422e-b3ad-83fb87512a2b BE9558 2026-05-16T09:14:39 K558LLA7.0F0W Long 0.3580 0.3613 0.991 0.2 0
171 357a3034-8a9c-485e-8cb6-f526dd2baf6f BE9558 2026-05-16T09:29:11 K558LLA7.ON0W Long 0.3708 0.3760 0.986 0.2 0
172 f8ad0274-8e6f-4714-82ff-d229e60f1442 BE9558 2026-05-16T09:32:06 K558LLA7.TI0W Long 0.3567 0.3613 0.987 0.2 0
173 42bb007a-2726-401a-b085-c25151b0dc24 BE9558 2026-05-16T09:35:02 K558LLA7.YE0W Long 0.3575 0.3613 0.989 0.2 0
174 c99bfc4a-db02-4bea-bea4-943c67485dba BE9558 2026-05-16T09:37:58 K558LLA8.3A0W Long 0.3527 0.3564 0.989 0.2 0
175 8fc17de0-73f7-48bd-8d93-5451dce47e8e BE9558 2026-05-16T09:40:52 K558LLA8.840W Long 0.3613 0.3662 0.987 0.2 0
176 bbee5276-03dd-4ca4-a7b9-aec02baac7e8 BE9558 2026-05-16T09:48:13 K558LLA8.KD0W Long 0.3590 0.3613 0.993 0.2 0
177 8dcdee10-db01-4224-9506-4181c3105d6f BE9558 2026-05-16T09:53:31 K558LLA8.T70W Long 0.3588 0.3613 0.993 0.2 0
178 48c8be72-64d9-4da3-95b5-bbec2c5e1dbd BE9558 2026-05-16T09:58:49 K558LLA9.210W Long 0.3582 0.3662 0.978 0.2 0
179 0da20919-7ce9-4feb-8ae9-12d9bb40c2b5 BE9558 2026-05-16T10:04:07 K558LLA9.AV0W Long 0.3506 0.3516 0.997 0.2 0
180 c2f7e9bc-8b93-42c3-96d3-e3af217dde35 BE9558 2026-05-16T10:09:25 K558LLA9.JP0W Long 0.3506 0.3516 0.997 0.2 0
181 522a0e42-d443-4447-bc71-af1832c6604e BE9558 2026-05-16T10:14:43 K558LLA9.SJ0W Long 0.3624 0.3662 0.990 0.2 0
182 67f7e732-3c0b-439f-87c5-3c478a381418 BE9558 2026-05-16T10:20:01 K558LLAA.1D0W Long 0.3494 0.3516 0.994 0.2 0
183 251767e8-56f7-4091-a001-364d8e75c15c BE9558 2026-05-16T10:25:19 K558LLAA.A70W Long 0.3463 0.3516 0.985 0.2 0
184 9457239d-a4ca-4476-b385-5e01fc8f6420 BE9558 2026-05-16T10:30:37 K558LLAA.J10W Long 0.3436 0.3467 0.991 0.2 0
185 43718d7c-9353-49e1-89b6-0841aeb1b276 BE9558 2026-05-16T10:35:55 K558LLAA.RV0W Long 0.3452 0.3516 0.982 0.2 0
186 f54ba557-ddfe-41d3-8f4c-8bbec9a3783c BE9558 2026-05-16T10:41:13 K558LLAB.0P0W Long 0.3419 0.3467 0.986 0.2 0
187 dc26c758-ad99-49c1-b518-931368cdf8cf BE9558 2026-05-16T10:46:31 K558LLAB.9J0W Long 0.3463 0.3516 0.985 0.2 0
188 10917eb2-d151-461c-a8cb-e9660da5a5b0 BE9558 2026-05-16T10:51:49 K558LLAB.ID0W Long 0.3520 0.3564 0.987 0.2 0
189 4938a5e6-d53b-40ee-be2b-06ec0e60398c BE9558 2026-05-16T10:57:07 K558LLAB.R70W Long 0.3541 0.3564 0.993 0.2 0
190 0711b51d-55bd-48be-b51e-2aad67107a60 BE9558 2026-05-16T11:13:01 K558LLAC.HP0W Long 0.3661 0.3711 0.986 0.2 0
191 065564b6-aa49-40e7-9ea6-c75defdc60fe BE9558 2026-05-16T11:18:19 K558LLAC.QJ0W Long 0.3622 0.3662 0.989 0.2 0
192 ffb6b230-1d70-4e0e-ba30-e945339a122a BE9558 2026-05-16T11:23:37 K558LLAC.ZD0W Long 0.3711 0.3760 0.987 0.2 0
193 52b4da82-c1e0-4a8a-8365-51b090787005 BE9558 2026-05-16T11:28:55 K558LLAD.870W Long 0.3644 0.3662 0.995 0.2 0
194 cdbff3d8-fbfe-4bea-8bd6-c898800e81ba BE9558 2026-05-16T11:39:31 K558LLAD.PV0W Long 0.3609 0.3662 0.986 0.2 0
195 3fb0bc30-1463-4cfc-9e7f-386c0eb2a34a BE9558 2026-05-16T11:44:49 K558LLAD.YP0W Long 0.3553 0.3564 0.997 0.2 0
196 ba1f5ec8-aef7-4a9e-ac1f-276cf016e285 BE9558 2026-05-16T11:50:07 K558LLAE.7J0W Long 0.3479 0.3516 0.990 0.2 0
197 b1dd4df7-34a9-4512-a903-f8242b236fd2 BE9558 2026-05-16T11:55:25 K558LLAE.GD0W Long 0.3427 0.3467 0.988 0.2 0
198 1f23aa28-c026-4bc7-b3d1-7c78fd76a673 BE9558 2026-05-16T12:00:43 K558LLAE.P70W Long 0.3454 0.3467 0.996 0.2 0
199 0d91f54d-b20d-4a50-b7dd-d071c39a0690 BE9558 2026-05-16T12:06:01 K558LLAE.Y10W Long 0.3431 0.3467 0.990 0.2 0
200 12ccdecd-5fd9-4465-9813-3d6006ec32f3 BE9558 2026-05-16T12:11:19 K558LLAF.6V0W Long 0.3433 0.3467 0.990 0.2 0
201 a7024f1a-f071-48ab-820f-99bdf87366b5 BE9558 2026-05-16T12:16:37 K558LLAF.FP0W Long 0.3361 0.3369 0.998 0.2 0
202 de0fa439-30b8-4607-a3c3-7e17191e4624 BE9558 2026-05-16T12:21:55 K558LLAF.OJ0W Long 0.3274 0.3320 0.986 0.2 0
203 f9374ec3-05e5-477f-8e1a-0c862fed2a50 BE9558 2026-05-16T12:27:13 K558LLAF.XD0W Long 0.3449 0.3467 0.995 0.2 0
204 424cb275-3743-4174-95f0-0ca1205b374c BE9558 2026-05-16T12:32:31 K558LLAG.670W Long 0.3370 0.3418 0.986 0.2 0
205 9accde13-cefa-41b8-bd0a-cef2ffed59b0 BE9558 2026-05-16T12:37:49 K558LLAG.F10W Long 0.3465 0.3467 0.999 0.2 0
206 4665be38-1956-4b14-b931-068ba9af5c5e BE9558 2026-05-16T12:48:25 K558LLAG.WP0W Long 0.3453 0.3516 0.982 0.2 0
207 1aedf624-1a99-43e1-a8f2-f9d358b97f61 BE9558 2026-05-16T12:53:43 K558LLAH.5J0W Long 0.3366 0.3418 0.985 0.2 0
208 c15e1799-91d7-425e-ad17-2ba3d170d81e BE9558 2026-05-16T13:04:19 K558LLAH.N70W Long 0.3348 0.3369 0.994 0.2 0
209 72d4c4ea-19ca-4cc6-9b04-7a2b70122c67 BE9558 2026-05-16T13:09:37 K558LLAH.W10W Long 0.3272 0.3320 0.986 0.2 0
210 b4ebf2c9-1f6d-4594-9810-40479e87c0a5 BE9558 2026-05-16T13:14:55 K558LLAI.4V0W Long 0.3297 0.3320 0.993 0.2 0
211 bb297e9e-548f-4dae-8b1a-0f161af2e766 BE9558 2026-05-16T13:20:13 K558LLAI.DP0W Long 0.3272 0.3320 0.986 0.2 0
212 87562c24-63db-48bd-9962-72a20a40f2ff BE9558 2026-05-16T13:36:07 K558LLAJ.470W Long 0.3174 0.3223 0.985 0.2 0
213 01e9cc58-3bea-4f38-8499-a2c20e5f8550 BE9558 2026-05-16T13:46:52 K558LLAJ.M40W Long 0.2880 0.2930 0.983 0.2 0
214 5ae7503d-ae17-4063-9208-6a420699e1ab BE9558 2026-05-16T14:00:35 K558LLAK.8Z0W Long 0.2879 0.2930 0.983 0.2 0
215 e009ea3c-1534-4154-8623-e180ed4db9fb BE9558 2026-05-16T14:06:19 K558LLAK.IJ0W Long 0.2882 0.2930 0.984 0.2 0
216 cd4e21f5-512b-4b2b-8054-bec01aa06400 BE9558 2026-05-16T14:12:03 K558LLAK.S30W Long 0.2857 0.2930 0.975 0.2 0
217 ae5b780f-2038-4ccf-8bfc-b15b87be139e BE9558 2026-05-16T14:17:22 K558LLAL.0Y0W Long 0.2899 0.2930 0.989 0.2 0
218 d8c3fb81-8c66-4ebc-b33a-0559bc03334b BE9558 2026-05-16T14:22:40 K558LLAL.9S0W Long 0.3009 0.3027 0.994 0.2 0
219 990a4c7a-3c51-4d4a-8ab7-416ccb97d29c BE9558 2026-05-16T14:27:58 K558LLAL.IM0W Long 0.3057 0.3076 0.994 0.2 0
220 68d7a2c3-d899-4e75-96fb-3bf16ae6ea6f BE9558 2026-05-16T14:33:16 K558LLAL.RG0W Long 0.3110 0.3125 0.995 0.2 0
221 73505b8c-f912-4116-b903-a8a4c75524d3 BE9558 2026-05-16T14:38:34 K558LLAM.0A0W Long 0.3172 0.3223 0.984 0.2 0
222 8d3c9602-7efa-488a-801b-3228bd85ab14 BE9558 2026-05-16T14:43:51 K558LLAM.930W Long 0.3136 0.3174 0.988 0.2 0
223 243e16ee-860a-4960-bc15-b797ad7e9735 BE9558 2026-05-16T14:49:08 K558LLAM.HW0W Long 0.3135 0.3174 0.988 0.2 0
224 e90c8d90-6d41-4788-9ee6-a29e4bfcc16b BE9558 2026-05-16T15:19:35 K558LLAN.WN0W Long 0.3132 0.3174 0.987 0.2 0
225 4182b0e7-7811-46b8-87d1-a4dd0c152f3b BE9558 2026-05-16T15:28:45 K558LLAO.BX0W Long 0.3023 0.3076 0.983 0.2 0
226 28a790da-0e48-4fe4-b8ba-2c82cc6bfa79 BE9558 2026-05-16T15:34:02 K558LLAO.KQ0W Long 0.3176 0.3223 0.985 0.2 0
227 093d2fa3-7a4b-4f0f-abda-71155ebe2dfb BE9558 2026-05-16T15:39:19 K558LLAO.TJ0W Long 0.3223 0.3271 0.985 0.2 0
228 68dc9560-4082-49b6-af04-9244773ffbc1 BE9558 2026-05-16T15:44:36 K558LLAP.2C0W Long 0.3227 0.3271 0.986 0.2 0
229 ad6b268a-165d-4b1d-b0b3-f58db7c9b0e4 BE9558 2026-05-16T15:49:53 K558LLAP.B50W Long 0.3177 0.3223 0.986 0.2 0
230 046c5cb4-56b3-48c0-83c2-bf1f30837940 BE9558 2026-05-16T15:55:10 K558LLAP.JY0W Long 0.3174 0.3223 0.985 0.2 0
231 1b76edf4-3b1c-4bcb-a73c-27334981c350 BE9558 2026-05-16T16:00:27 K558LLAP.SR0W Long 0.3127 0.3174 0.985 0.2 0
232 a0264171-a682-4396-ad8a-cda3b2964533 BE9558 2026-05-16T16:06:55 K558LLAQ.3J0W Long 0.2885 0.2930 0.985 0.2 0
233 707da1f6-ee81-4e57-abd5-98295c14651b BE9558 2026-05-16T16:12:30 K558LLAQ.CU0W Long 0.2880 0.2930 0.983 0.2 0
234 b8115b64-8739-42c8-b541-713ab6b68bcd BE9558 2026-05-16T16:17:53 K558LLAQ.LT0W Long 0.2881 0.2930 0.983 0.2 0
235 fb179c36-fef1-4df6-b0a0-2bd7792ea910 BE9558 2026-05-16T16:23:11 K558LLAQ.UN0W Long 0.2933 0.2979 0.985 0.2 0
236 0cec8793-c3c1-486b-a33a-4dbf9cb069b0 BE9558 2026-05-16T16:33:46 K558LLAR.CA0W Long 0.3017 0.3027 0.997 0.2 0
237 c531b052-ee04-4c66-888b-21e97445a615 BE9558 2026-05-16T16:49:37 K558LLAS.2P0W Long 0.2922 0.2979 0.981 0.2 0
238 0dc402f9-cab6-4c4a-8317-b8fc3c4b1ced BE9558 2026-05-16T16:55:08 K558LLAS.BW0W Long 0.2898 0.2930 0.989 0.2 0
239 fd73733e-b42d-4a51-81d0-4acad6edfbd4 BE9558 2026-05-16T17:16:17 K558LLAT.B50W Long 0.3115 0.3125 0.997 0.2 0
240 6a254daa-ae27-4ac1-b334-58f776a6b276 BE9558 2026-05-16T17:26:51 K558LLAT.SR0W Long 0.3174 0.3223 0.985 0.2 0
241 0cc8e82f-5270-4508-beae-0d3af56095ca BE9558 2026-05-16T17:37:27 K558LLAU.AF0W Long 0.2899 0.2930 0.989 0.2 0
242 00557a73-8dc3-4cd2-b880-c7820dc8b171 BE9558 2026-05-16T17:43:17 K558LLAU.K50W Long 0.2881 0.2930 0.983 0.2 0
243 8e5518d9-ff0a-4c09-9cf9-a681c84c0b6e BE9558 2026-05-16T17:53:53 K558LLAV.1T0W Long 0.2898 0.2930 0.989 0.2 0
244 91dbd7e9-7344-400b-82b1-379f2ac4b49a BE9558 2026-05-16T17:59:11 K558LLAV.AN0W Long 0.2925 0.2930 0.998 0.2 0
245 fa256408-d480-4376-95b5-d1a549c483ea BE9558 2026-05-16T18:04:29 K558LLAV.JH0W Long 0.2977 0.3027 0.983 0.2 0
246 4ab6e66a-8364-49b6-82f1-86e86199e676 BE9558 2026-05-16T18:09:46 K558LLAV.SA0W Long 0.2944 0.2979 0.988 0.2 0
247 0a65fb7c-96e1-4ba0-85de-4620d88658c1 BE9558 2026-05-16T18:15:03 K558LLAW.130W Long 0.2965 0.2979 0.995 0.2 0
248 92b1ef3e-1696-4123-8662-163947737c83 BE9558 2026-05-16T18:20:20 K558LLAW.9W0W Long 0.2976 0.3027 0.983 0.2 0
249 9e3cb24c-4426-4220-9a73-389d0a96c94f BE9558 2026-05-16T18:25:37 K558LLAW.IP0W Long 0.2983 0.3027 0.985 0.2 0
250 a3473215-4c46-45ab-9aa7-1720486ec4a8 BE9558 2026-05-16T18:30:54 K558LLAW.RI0W Long 0.2956 0.2979 0.993 0.2 0
251 449665b1-47c8-4bd2-984c-8f45b627e6d8 BE9558 2026-05-16T18:36:11 K558LLAX.0B0W Long 0.2989 0.3027 0.987 0.2 0
252 600cfabc-cffd-42e1-800c-70e75f312316 BE9558 2026-05-16T20:00:12 K558LLB0.WC0W Long 0.3077 0.3125 0.985 0.2 0
253 12bf5944-0194-4f5b-b486-a7acd7141c7f BE9558 2026-05-16T20:04:28 K558LLB1.3G0W Long 0.2888 0.2930 0.986 0.2 0
254 f1fc913a-91bc-4240-a595-7dfe3091f9a2 BE9558 2026-05-16T20:07:29 K558LLB1.8H0W Long 0.2977 0.3027 0.983 0.2 0
255 e74f7ec3-20bb-4177-beb2-e802e5f801fd BE9558 2026-05-16T20:10:26 K558LLB1.DE0W Long 0.2978 0.3027 0.984 0.2 0
256 27491c3a-b631-4643-818a-714523911178 BE9558 2026-05-16T20:16:21 K558LLB1.N90W Long 0.2921 0.2930 0.997 0.2 0
257 9d9196ce-11e2-4f28-b01c-3dcc60e60d42 BE9558 2026-05-16T20:22:28 K558LLB1.XG0W Long 0.2881 0.2930 0.983 0.2 0
258 a592d7c8-b643-4b25-9186-3d611ae22709 BE9558 2026-05-16T20:25:37 K558LLB2.2P0W Long 0.2893 0.2930 0.987 0.2 0
259 f709a3d5-27cd-4bb1-b91c-669e8ea11d77 BE9558 2026-05-16T20:28:57 K558LLB2.890W Long 0.2880 0.2930 0.983 0.2 0
260 cc9cad87-b87f-4b67-854a-ffb21e876a92 BE9558 2026-05-16T20:32:45 K558LLB2.EL0W Long 0.2873 0.2930 0.980 0.2 0
261 10732d26-6b49-4b14-a474-6c75e259d278 BE9558 2026-05-16T20:49:32 K558LLB3.6K0W Long 0.2881 0.2930 0.983 0.2 0
262 aa63957a-fdb2-4f17-af52-a63bb015119d BE9558 2026-05-16T21:21:45 K558LLB4.O90W Long 0.2880 0.2930 0.983 0.2 0
263 8350440f-019d-45a4-b9f9-23058628e6f0 BE9558 2026-05-16T21:32:43 K558LLB5.6J0W Long 0.2925 0.2930 0.999 0.2 0
264 edfc10b2-dbe1-4527-a061-b0d670b5e5d2 BE9558 2026-05-16T21:35:37 K558LLB5.BD0W Long 0.2891 0.2930 0.987 0.2 0
265 f98001a3-88b2-4830-8112-b7c5164e99c3 BE9558 2026-05-16T21:38:40 K558LLB5.GG0W Long 0.2877 0.2930 0.982 0.2 0
266 f1e53e7b-b124-4fc5-82c2-504fb0c8b80d BE9558 2026-05-16T21:41:46 K558LLB5.LM0W Long 0.2881 0.2930 0.983 0.2 0
267 7890637f-142e-4775-b48c-fd4f3b8ada77 BE9558 2026-05-16T21:45:14 K558LLB5.RE0W Long 0.2880 0.2930 0.983 0.2 0
268 7c97c10f-b413-467c-9b56-c18e423cdcfa BE9558 2026-05-16T21:48:26 K558LLB5.WQ0W Long 0.2886 0.2930 0.985 0.2 0
269 8178cf22-8428-4f85-8199-0a43f7334a8f BE9558 2026-05-16T21:51:47 K558LLB6.2B0W Long 0.2881 0.2930 0.983 0.2 0
270 eceb2997-deb4-403a-802f-50e93d23d423 BE9558 2026-05-16T21:57:18 K558LLB6.BI0W Long 0.2881 0.2930 0.984 0.2 0
271 9c26690c-1983-4b21-b8af-7c7967c014c3 BE9558 2026-05-16T22:12:21 K558LLB7.0L0W Long 0.2876 0.2930 0.982 0.2 0
272 78f67fc3-08b7-4317-96ba-ee5544e0b95b BE9558 2026-05-16T22:19:34 K558LLB7.CM0W Long 0.2880 0.2930 0.983 0.2 0
273 7f9dad14-4f1b-492d-aa26-845a908ea894 BE9558 2026-05-16T22:27:40 K558LLB7.Q40W Long 0.2881 0.2930 0.983 0.2 0
274 f75c52b4-21b9-4065-baeb-5cfbd27d130a BE9558 2026-05-16T22:33:50 K558LLB8.0E0W Long 0.2881 0.2930 0.984 0.2 0
275 10f7496d-fa76-40a7-8bef-dc14e8a41869 BE9558 2026-05-16T22:40:48 K558LLB8.C00W Long 0.2878 0.2930 0.982 0.2 0
-90
View File
@@ -1,90 +0,0 @@
"""Ring-path bench test, Runs A/B: ask SFM for a Micromate's status on a fixed
interval and log every answer with its time. Read-only on the unit.
python scratch/ring_path_poller.py --sfm http://127.0.0.1:8299 \
--serial UM20147 --host <modem ip> --tcp-port 9034 --interval 10 \
--log <run dir>/poller.jsonl
Run A: --count 1 (one call-up; SFM then holds the line until its 5-minute idle
hang-up or a RADIO RING). Run B: the default, every --interval seconds until
Ctrl-C. Each poll asks for the raw SUB 0x49 code (run_state=true), so a
call-home in progress shows as its own code rather than as "not monitoring".
What the log is for (spec, "Open questions this design leaves for the bench"):
a 503 "call home in progress" is SFM seeing the ring and hanging up; a 503/504
on connect while THOR's watchdog holds the line is contention; THOR's own ACH
log says when the call reached THOR.
"""
from __future__ import annotations
import argparse
import datetime
import json
import time
import urllib.error
import urllib.parse
import urllib.request
def poll_once(sfm: str, serial: str, host: str, tcp_port: int, timeout: float) -> dict:
q = urllib.parse.urlencode({"serial": serial, "host": host, "tcp_port": tcp_port, "run_state": "true"})
t0 = time.monotonic()
started = datetime.datetime.now().isoformat(timespec="milliseconds")
try:
with urllib.request.urlopen(f"{sfm}/device/monitor/status?{q}", timeout=timeout) as r:
code, body = r.status, json.loads(r.read() or b"{}")
except urllib.error.HTTPError as e:
code = e.code
try:
body = json.loads(e.read() or b"{}")
except ValueError:
body = {}
except (urllib.error.URLError, TimeoutError, OSError) as e:
code, body = None, {"error": f"{type(e).__name__}: {e}"}
secs = round(time.monotonic() - t0, 2)
d = body.get("detail") if isinstance(body, dict) else None
rs = d.get("run_state") if isinstance(d, dict) else None # an error's detail is a string
return {"at": started, "secs": secs, "http": code,
"monitoring": body.get("monitoring") if isinstance(body, dict) else None,
"run_state": rs, "device_time": body.get("device_time") if isinstance(body, dict) else None,
"detail": None if code == 200 else (body.get("detail") or body.get("error"))}
def line(rec: dict) -> str:
rs = rec["run_state"]
state = f"0x{rs['code']:02X} {rs['name']}" if rs else "-"
tail = f" {rec['detail']}" if rec["detail"] else ""
return f"{rec['at']} http={rec['http']} {rec['secs']:>6} s 0x49={state} monitoring={rec['monitoring']}{tail}"
def main() -> None:
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
ap.add_argument("--sfm", default="http://127.0.0.1:8299")
ap.add_argument("--serial", required=True)
ap.add_argument("--host", required=True)
ap.add_argument("--tcp-port", type=int, default=9034)
ap.add_argument("--interval", type=float, default=10.0, help="seconds between polls (start to start)")
ap.add_argument("--count", type=int, default=0, help="stop after N polls (0 = until Ctrl-C)")
ap.add_argument("--timeout", type=float, default=180.0)
ap.add_argument("--log", required=True, help="JSON lines, appended")
a = ap.parse_args()
if a.sfm.rstrip("/").endswith(":8200"):
raise SystemExit("refusing :8200 -- use the bench SFM")
n = 0
with open(a.log, "a") as f:
while True:
t0 = time.monotonic()
rec = poll_once(a.sfm.rstrip("/"), a.serial, a.host, a.tcp_port, a.timeout)
f.write(json.dumps(rec) + "\n"); f.flush()
print(line(rec), flush=True)
n += 1
if a.count and n >= a.count:
return
time.sleep(max(0.0, a.interval - (time.monotonic() - t0)))
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass
+2 -1
View File
@@ -428,7 +428,8 @@ def main(argv=None) -> int:
try:
event_hdf5.write_event_hdf5(
hdf5_path, ev,
serial=serial, # range: the event's own, from its setup
serial=serial,
geo_range="normal",
source_kind=source_kind,
)
hdf5_filename = hdf5_path.name
+4 -5
View File
@@ -73,7 +73,7 @@ def main(argv: list[str] | None = None) -> int:
conn.row_factory = sqlite3.Row
rows = list(conn.execute(
"SELECT id, serial, timestamp, record_type, blastware_filename "
"SELECT id, serial, timestamp, blastware_filename "
" FROM events "
" WHERE serial = 'UNKNOWN' "
" ORDER BY timestamp",
@@ -98,11 +98,10 @@ def main(argv: list[str] | None = None) -> int:
unresolved += 1
continue
# Check for an existing row at the target key (serial, timestamp,
# record_type -- #51).
# Check for an existing row at the target (serial, timestamp).
existing = conn.execute(
"SELECT id FROM events WHERE serial = ? AND timestamp = ? AND record_type IS ?",
(new_serial, ts, row["record_type"]),
"SELECT id FROM events WHERE serial = ? AND timestamp = ?",
(new_serial, ts),
).fetchone()
action: str
if existing is None:
+2882 -2882
View File
File diff suppressed because it is too large. Load diff
-16
View File
@@ -1,16 +0,0 @@
"""The SDM side of the device audit: DeviceAccess calls this sink, which writes
SeismoDb.device_commands. Kept here so sfm.device_access never imports the DB."""
from __future__ import annotations
from typing import Any, Callable
class DbAudit:
def __init__(self, get_db: Callable[[], Any]) -> None:
self._get_db = get_db
def begin(self, **fields: Any) -> str:
return self._get_db().begin_device_command(**fields)
def finish(self, command_id: str, **fields: Any) -> None:
self._get_db().finish_device_command(command_id, **fields)
+19 -223
View File
@@ -34,9 +34,7 @@ Usage
from __future__ import annotations
import datetime
import json
import logging
import re
import sqlite3
import uuid
from pathlib import Path
@@ -108,7 +106,7 @@ CREATE TABLE IF NOT EXISTS events (
shape_offset_pre REAL, -- pre-trigger baseline median (in/s)
shape_offset_spread REAL, -- max(pre,mid,end) - min(...) in in/s; small = constant/DC
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
UNIQUE(serial, timestamp, record_type) -- unit + time + type (#51); see Migration 3
UNIQUE(serial, timestamp)
);
CREATE INDEX IF NOT EXISTS idx_events_serial ON events(serial);
CREATE INDEX IF NOT EXISTS idx_events_timestamp ON events(timestamp);
@@ -129,27 +127,6 @@ CREATE TABLE IF NOT EXISTS monitor_log (
CREATE INDEX IF NOT EXISTS idx_monitor_log_serial ON monitor_log(serial);
CREATE INDEX IF NOT EXISTS idx_monitor_log_start ON monitor_log(start_time);
CREATE INDEX IF NOT EXISTS idx_monitor_log_session ON monitor_log(session_id);
CREATE TABLE IF NOT EXISTS device_commands (
id TEXT PRIMARY KEY,
ts TEXT NOT NULL, -- when the attempt began (UTC ISO)
-- ts/finished_ts: tz-aware UTC ISO (+00:00), unlike the naive UTC of older tables
finished_ts TEXT,
serial TEXT NOT NULL,
series INTEGER NOT NULL,
address TEXT NOT NULL,
action TEXT NOT NULL, -- e.g. "start monitoring"
tier TEXT NOT NULL, -- "change" | "destructive"
request TEXT, -- JSON: parameters + the planned frames (hex)
ack TEXT, -- JSON: ack summary
verified TEXT, -- "ok" | "mismatch" | "not_checked"
outcome TEXT NOT NULL, -- "pending" | "sent" | "skipped" | "failed"
error TEXT,
caller TEXT, -- "webapp" | "terra-view" | "script" | ...
sent INTEGER, -- did a frame go out: 1 acknowledged, 0 nothing sent, NULL unknown
states TEXT -- JSON: {"before": ..., "seen": [...], "after": ...}
);
CREATE INDEX IF NOT EXISTS idx_device_commands_serial ON device_commands(serial, ts);
"""
@@ -195,7 +172,7 @@ class SeismoDb:
row = conn.execute(
"SELECT sql FROM sqlite_master WHERE type='table' AND name='events'"
).fetchone()
if row and "UNIQUE(serial, timestamp" not in row[0]: # neither key form yet
if row and "UNIQUE(serial, timestamp)" not in row[0]:
log.info("_migrate: rebuilding events table — UNIQUE(serial, timestamp)")
conn.executescript("""
ALTER TABLE events RENAME TO events_old;
@@ -306,17 +283,6 @@ class SeismoDb:
log.info("_migrate: device_family backfill complete (remaining NULL=%d)",
remaining)
# Migration 1d: device_commands gained `sent` and `states` after the
# table first shipped on feat/series4-sfm-parity. NULLable, so rows
# written before read NULL (= unknown).
existing_cols = {
r[1] for r in conn.execute("PRAGMA table_info(device_commands)").fetchall()
}
for col, ddl in (("sent", "INTEGER"), ("states", "TEXT")):
if col not in existing_cols:
log.info("_migrate: device_commands ADD COLUMN %s %s", col, ddl)
conn.execute(f"ALTER TABLE device_commands ADD COLUMN {col} {ddl}")
# Migration 2: change monitor_log UNIQUE from (serial, waveform_key) to
# (serial, start_time) — same reasoning as events.
row = conn.execute(
@@ -349,33 +315,6 @@ class SeismoDb:
""")
log.info("_migrate: monitor_log table rebuilt OK")
# Migration 3 (#51, 2026-11-03): events UNIQUE (serial, timestamp) ->
# (serial, timestamp, record_type). A unit records a waveform and a
# histogram in the same second legitimately -- 209 times in prod's
# 2026-09-30 store once histograms carry Blastware's start -- and the old
# key could hold only one. The table is rebuilt from its own current
# definition with only the key swapped, so every column added by the
# migrations above, every row and every id is kept (Terra-View reads
# rows by id); its indexes are recreated. One transaction.
row = conn.execute(
"SELECT sql FROM sqlite_master WHERE type='table' AND name='events'"
).fetchone()
if row and "UNIQUE(serial, timestamp)" in row[0]:
log.info("_migrate: rebuilding events table — UNIQUE(serial, timestamp, record_type)")
indexes = [r[0] for r in conn.execute(
"SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name='events' "
"AND sql IS NOT NULL")]
table = re.sub(r'^CREATE TABLE\s+("?)events\1', "CREATE TABLE events_rekeyed",
row[0].replace("UNIQUE(serial, timestamp)",
"UNIQUE(serial, timestamp, record_type)", 1))
conn.executescript("BEGIN;\n" + table + ";\n"
"INSERT INTO events_rekeyed SELECT * FROM events;\n"
"DROP TABLE events;\n"
"ALTER TABLE events_rekeyed RENAME TO events;\n"
+ "".join(sql + ";\n" for sql in indexes)
+ "COMMIT;")
log.info("_migrate: events table re-keyed OK (%d indexes recreated)", len(indexes))
@staticmethod
def _iso(dt: Optional[datetime.datetime]) -> Optional[str]:
return dt.isoformat() if dt is not None else None
@@ -434,95 +373,6 @@ class SeismoDb:
).fetchall()
return [dict(r) for r in rows]
# ── Device command audit ──────────────────────────────────────────────────
def begin_device_command(
self,
*,
serial: str,
series: int,
address: str,
action: str,
tier: str,
request: dict,
caller: str,
) -> str:
"""Write a ``pending`` audit row BEFORE anything is sent. Returns its id."""
cid = self._new_id()
ts = datetime.datetime.now(datetime.timezone.utc).isoformat()
with self._connect() as conn:
conn.execute(
"""
INSERT INTO device_commands
(id, ts, serial, series, address, action, tier,
request, outcome, caller)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'pending', ?)
""",
(cid, ts, serial, series, address, action, tier,
json.dumps(request), caller),
)
return cid
def finish_device_command(
self,
command_id: str,
*,
outcome: str,
verified: Optional[str],
ack: Optional[dict],
error: Optional[str],
sent: Optional[int] = None,
states: Optional[dict] = None,
) -> None:
"""Record the result of a command begun with begin_device_command().
`sent`: 1 a frame went out and was acknowledged, 0 nothing was sent,
None unknown (the ack was lost). `states`: what was read from the unit,
``{"before": ..., "seen": [...], "after": ...}``.
"""
ts = datetime.datetime.now(datetime.timezone.utc).isoformat()
with self._connect() as conn:
cur = conn.execute(
"UPDATE device_commands SET finished_ts=?, outcome=?, verified=?, "
"ack=?, error=?, sent=?, states=? WHERE id=? AND outcome='pending'",
(ts, outcome, verified,
json.dumps(ack) if ack is not None else None,
error, sent,
json.dumps(states) if states is not None else None,
command_id),
)
if cur.rowcount == 0:
known = conn.execute(
"SELECT 1 FROM device_commands WHERE id=?",
(command_id,)).fetchone()
raise ValueError(
f"device command {command_id} "
+ ("is already finished" if known else "is unknown"))
def query_device_commands(
self,
serial: Optional[str] = None,
limit: int = 100,
) -> list[dict]:
"""Return audit rows, newest first, with request/ack/states parsed from JSON."""
with self._connect() as conn:
if serial:
rows = conn.execute(
"SELECT * FROM device_commands WHERE serial=? "
"ORDER BY ts DESC LIMIT ?", (serial, limit)).fetchall()
else:
rows = conn.execute(
"SELECT * FROM device_commands ORDER BY ts DESC LIMIT ?",
(limit,)).fetchall()
out = []
for r in rows:
d = dict(r)
for k in ("request", "ack", "states"):
if d[k] is not None:
d[k] = json.loads(d[k])
out.append(d)
return out
# ── Events ────────────────────────────────────────────────────────────────
def insert_events(
@@ -535,8 +385,7 @@ class SeismoDb:
device_family: Optional[str] = None,
) -> tuple[int, int]:
"""
Insert triggered events. Silently skips duplicates (serial + timestamp +
record_type: a waveform and a histogram may share a second, #51).
Insert triggered events. Silently skips duplicates (serial+timestamp).
Returns (inserted, skipped).
``waveform_records`` (optional): dict keyed by event waveform_key (hex)
@@ -544,7 +393,7 @@ class SeismoDb:
{"filename": str, "filesize": int, "a5_pickle_filename": str}
For events whose key is in this dict, the matching columns are
populated. If a row with the same (serial, timestamp, record_type) already exists
populated. If a row with the same (serial, timestamp) already exists
(dedup hit), the matching waveform record is upserted onto the
existing row so a re-download via the live endpoint refreshes the
file metadata.
@@ -587,27 +436,18 @@ class SeismoDb:
# No validated event record: the time may be a second off,
# so it is never allowed to move, merge into or duplicate
# a row (_estimate_guard). The file is already stored.
why = self._estimate_guard(conn, serial, rec.get("filename"), ts,
ev.record_type)
why = self._estimate_guard(conn, serial, rec.get("filename"), ts)
if why:
log.warning("insert_events: %s %s: %s", serial,
rec.get("filename") or key, why)
skipped += 1
continue
elif rec.get("filename") and ts and \
self._restamp_by_file(conn, serial, rec["filename"], ts,
ev.record_type) is False:
self._restamp_by_file(conn, serial, rec["filename"], ts) is False:
skipped += 1
continue
try:
if ev.record_type is None and conn.execute(
"SELECT 1 FROM events WHERE serial = ? AND timestamp = ? "
"AND record_type IS NULL", (serial, ts)).fetchone():
# A UNIQUE key treats NULLs as distinct, so an untyped
# event would never collide: it still refreshes the
# untyped row at its second, as under the old key.
raise sqlite3.IntegrityError("untyped event already stored")
conn.execute(
"""
INSERT INTO events
@@ -667,7 +507,7 @@ class SeismoDb:
inserted += 1
except sqlite3.IntegrityError:
skipped += 1
# UPSERT path: a row for this (serial, timestamp, record_type) already
# UPSERT path: a row for this (serial, timestamp) already
# exists. Refresh every device-authoritative field from
# the new data so that a re-import with better data (e.g.
# a watcher re-forward where the previous attempt missed
@@ -720,7 +560,7 @@ class SeismoDb:
shape_offset_axis = COALESCE(?, shape_offset_axis),
shape_offset_pre = COALESCE(?, shape_offset_pre),
shape_offset_spread = COALESCE(?, shape_offset_spread)
WHERE serial = ? AND timestamp = ? AND record_type IS ?
WHERE serial = ? AND timestamp = ?
""",
(
pv.tran if pv else None,
@@ -757,7 +597,6 @@ class SeismoDb:
rec.get("shape_offset_spread") if rec else None,
serial,
ts,
ev.record_type,
),
)
@@ -767,11 +606,11 @@ class SeismoDb:
@staticmethod
def _estimate_guard(conn: sqlite3.Connection, serial: str, filename: Optional[str],
ts: Optional[str], record_type: Optional[str] = None) -> Optional[str]:
ts: Optional[str]) -> Optional[str]:
"""Why an event whose time is only an estimate must not be written, or None.
An estimate (the decoder found no validated event record) may be a
second off, and (serial, timestamp, record_type) is the table's key. So it never
second off, and (serial, timestamp) is the table's key. So it never
moves a row, never lands on another event's row, and never adds a second
row for an event already stored -- each refusal is logged by the caller,
and the event's file and sidecar are already in the store. Its own
@@ -786,8 +625,8 @@ class SeismoDb:
return (f"already stored under {', '.join(str(t) for t in own)}; its estimated "
f"time {ts} does not move or duplicate it")
holder = conn.execute(
"SELECT blastware_filename FROM events WHERE serial = ? AND timestamp = ? "
"AND record_type IS ?", (serial, ts, record_type)).fetchone()
"SELECT blastware_filename FROM events WHERE serial = ? AND timestamp = ?",
(serial, ts)).fetchone()
if holder is not None and (named is None or holder[0] != named):
return (f"its estimated time {ts} is held by {holder[0] or 'another event'}; "
"not merged into it")
@@ -795,9 +634,8 @@ class SeismoDb:
@staticmethod
def _restamp_by_file(conn: sqlite3.Connection, serial: str, filename: str,
ts: str, record_type: Optional[str] = None) -> Optional[bool]:
"""Move this file's row to `ts` (and `record_type`) when it sits under
another time or type.
ts: str) -> Optional[bool]:
"""Move this file's row to `ts` when it sits under another time.
The events table is unique on (serial, timestamp), so an event re-stored
with a corrected time -- every Series-3 waveform after the event-time fix,
@@ -808,10 +646,6 @@ class SeismoDb:
stored as "imported.bw" -- so only a Blastware name is matched. Of
several rows for one file, a reviewed one with a time moves first.
The type moves the same way: before v0.33.0 a row's type came from the
filename, and with the type in the key (#51) a re-import under the file's
own type would otherwise add a second row.
Returns True when the row was moved; None when there was nothing to move
(no row for this file elsewhere, or this file's own row already holds
`ts`), so the caller goes on as before; False when a different stored
@@ -822,20 +656,18 @@ class SeismoDb:
return None
mine = conn.execute(
"SELECT id, timestamp FROM events WHERE serial = ? AND blastware_filename = ? "
"AND (timestamp IS NULL OR timestamp != ? OR record_type IS NOT ?) "
"AND (timestamp IS NULL OR timestamp != ?) "
"ORDER BY COALESCE(false_trigger, 0) DESC, timestamp IS NULL, rowid LIMIT 1",
(serial, filename, ts, record_type),
(serial, filename, ts),
).fetchone()
if mine is None:
return None
holder = conn.execute(
"SELECT id, blastware_filename FROM events WHERE serial = ? AND timestamp = ? "
"AND record_type IS ?",
(serial, ts, record_type),
"SELECT id, blastware_filename FROM events WHERE serial = ? AND timestamp = ?",
(serial, ts),
).fetchone()
if holder is None:
conn.execute("UPDATE events SET timestamp = ?, record_type = ? WHERE id = ?",
(ts, record_type, mine[0]))
conn.execute("UPDATE events SET timestamp = ? WHERE id = ?", (ts, mine[0]))
log.info("insert_events: %s %s moved from %s to %s (corrected event time)",
serial, filename, mine[1], ts)
return True
@@ -854,42 +686,6 @@ class SeismoDb:
).fetchone()
return dict(row) if row else None
def find_event_by_blastware_name(self, serial: str, filename: str,
record_type: Optional[str] = None) -> Optional[dict]:
"""The row stored under `filename`'s Blastware name, or None.
A Blastware name encodes the serial and the event's second
(`blastware_filename_time`), so the same name is the same event -- the
rule `_restamp_by_file` uses. Blastware's direct download is
`<stem>.<AB>0`, its call-in copy and SFM's own files `<stem>.<AB>0W` / `H`.
A name without the letter matches all three forms; one with it matches
itself and the letterless form -- not the other letter, since in
Histogram+Continuous a waveform can trigger in the second a histogram
starts. Any other name ("imported.bw") matches nothing.
`record_type`: only a row of that type -- or an untyped one, which may be
this event -- matches (#51: a same-second waveform / histogram twin shares
the letterless name). Compared ignoring case.
"""
if blastware_filename_time(filename) is None:
return None
name = filename.upper()
if len(name.rsplit(".", 1)[-1]) == 4:
forms = (name[:-1], name)
else:
forms = (name, name + "W", name + "H")
with self._connect() as conn:
typed, args = "", (serial, *forms)
if record_type is not None:
typed = " AND (record_type IS NULL OR UPPER(record_type) = UPPER(?))"
args = (*args, record_type)
row = conn.execute(
f"SELECT * FROM events WHERE serial = ? AND UPPER(blastware_filename) IN "
f"({', '.join('?' * len(forms))}){typed} ORDER BY rowid LIMIT 1",
args,
).fetchone()
return dict(row) if row else None
def query_events(
self,
serial: Optional[str] = None,
-13
View File
@@ -1,13 +0,0 @@
"""One door for every device request -- see the 2026-10-20 parity spec."""
from .errors import (
AuditIncomplete, AuditUnavailable, BadRequest, CallHomeInProgress, ChangeUnconfirmed,
ConnectFailed, DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported, StaleEvent,
UnitBusy, UnitStateUnknown, WrongUnit, translate,
)
from .models import (
ChangeResult, DownloadedEvent, EventDownload, EventList, EventRef, UnitAddress, UnitInfo,
UnitSettings, UnitStatus,
)
from .series import normalise_serial, series_for_serial
from .locks import UnitLocks
from .access import DeviceAccess
-296
View File
@@ -1,296 +0,0 @@
"""DeviceAccess -- the one door every device request passes through.
The control surface does not care which series it is talking to; this does.
"""
from __future__ import annotations
import logging
import threading
import time
from typing import Any, Callable, Dict, Optional
from .errors import BadRequest, ConnectFailed, DeviceError, NoAnswer, NotSupported, WrongUnit
from .events import parse_event_id
from .locks import UnitLocks
from .models import (CallHomeState, ChangeResult, DownloadedEvent, EventList, UnitAddress, UnitInfo,
UnitSettings, UnitStatus)
from .s3 import Series3Adapter, default_s3_client_factory
from .s4 import (
Series4Session, default_s4_client_factory, s4_call_home_state, s4_change_call_home, s4_change_monitoring,
s4_change_settings,
s4_download_event, s4_identify, s4_list_events, s4_settings, s4_status,
)
from .series import normalise_serial, series_for_serial
log = logging.getLogger("sfm.device_access")
# A config write is read back at once, not after a sensor check: up to three
# reads, a second apart -- not the start/stop window.
_CALL_HOME_VERIFY_TIMEOUT_S = 3.0
_CALL_HOME_VERIFY_INTERVAL_S = 1.0
# A settings read-back is one block read (seconds over cellular): two tries, a second apart.
_SETTINGS_VERIFY_TIMEOUT_S = 2.0
_SETTINGS_VERIFY_INTERVAL_S = 1.0
class DeviceAccess:
def __init__(
self, *,
s3_client_factory: Callable[[UnitAddress], Any] = default_s3_client_factory,
s4_client_factory: Callable[[UnitAddress], Any] = default_s4_client_factory,
clock: Callable[[], float] = time.monotonic,
lock_timeout: float = 20.0,
keepalive_s: float = 60.0,
idle_hangup_s: float = 300.0,
reaper_interval_s: float = 5.0,
start_reaper: bool = True,
audit: Any = None,
sleep: Callable[[float], None] = time.sleep,
verify_timeout_s: float = 60.0,
verify_interval_s: float = 2.0,
) -> None:
if verify_interval_s <= 0 or verify_timeout_s < verify_interval_s:
raise ValueError("verify_interval_s must be > 0 and verify_timeout_s >= verify_interval_s")
self._audit = audit
self._sleep = sleep
self._verify_timeout_s = verify_timeout_s
self._verify_interval_s = verify_interval_s
self._locks = UnitLocks(lock_timeout)
self._s3 = Series3Adapter(s3_client_factory)
self._s4_factory = s4_client_factory
self._clock = clock
self._keepalive_s = keepalive_s
self._idle_hangup_s = idle_hangup_s
self._reaper_interval_s = reaper_interval_s
self._start_reaper = start_reaper
self._reaper: Optional[threading.Thread] = None
self._sessions: Dict[str, Series4Session] = {}
self._sessions_guard = threading.Lock()
# ── public operations ─────────────────────────────────────────────────────
def identify(self, address: UnitAddress, serial: str) -> UnitInfo:
return self._dispatch(address, serial, self._s3.identify, s4_identify)
def status(self, address: UnitAddress, serial: str, *, run_state: bool = False) -> UnitStatus:
"""`run_state` adds Series 4's raw SUB 0x49 code to `detail` (one more
round trip); Series 3 has no 0x49 and ignores it."""
return self._dispatch(address, serial, self._s3.status,
lambda client, s: s4_status(client, s, run_state=run_state))
def settings(self, address: UnitAddress, serial: str) -> UnitSettings:
return self._dispatch(address, serial, self._s3.settings, s4_settings)
def list_events(self, address: UnitAddress, serial: str) -> EventList:
return self._dispatch(address, serial, self._s3.list_events, s4_list_events)
def download_event(self, address: UnitAddress, serial: str, event_id: str) -> DownloadedEvent:
"""Read-only on the unit. Holds the unit for the whole download, so
other requests for it wait, then get 423."""
key, stamp = parse_event_id(event_id, serial) # BadRequest before any I/O
return self._dispatch(
address, serial,
lambda a, s: self._s3.download_event(a, s, key, stamp),
lambda c, s: s4_download_event(c, s, key, stamp))
def start_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False,
even_if_already: bool = False, caller: str = "api") -> ChangeResult:
return self._change_monitoring(address, serial, start=True, dry_run=dry_run,
even_if_already=even_if_already, caller=caller)
def stop_monitoring(self, address: UnitAddress, serial: str, *, dry_run: bool = False,
even_if_already: bool = False, caller: str = "api") -> ChangeResult:
return self._change_monitoring(address, serial, start=False, dry_run=dry_run,
even_if_already=even_if_already, caller=caller)
def _change_monitoring(self, address, serial, *, start, dry_run, even_if_already, caller):
serial = normalise_serial(serial)
series_for_serial(serial) # BadRequest (422) before the audit check
if not dry_run and self._audit is None:
raise NotSupported("no audit log is configured -- SFM refuses to change a unit "
"without one (nothing sent)")
kw = dict(start=start, dry_run=dry_run, even_if_already=even_if_already,
audit=self._audit, caller=caller, sleep=self._sleep,
verify_timeout_s=self._verify_timeout_s,
verify_interval_s=self._verify_interval_s)
return self._dispatch(
address, serial,
lambda a, s: self._s3.change_monitoring(a, s, **kw),
lambda c, s: s4_change_monitoring(c, s, address=address, **kw),
change=True)
def call_home_state(self, address: UnitAddress, serial: str) -> CallHomeState:
return self._dispatch(address, serial,
lambda a, s: self._s3.call_home_state(a, s),
lambda c, s: s4_call_home_state(c, s))
def set_call_home(self, address: UnitAddress, serial: str, *, enabled: bool,
dry_run: bool = False, even_if_already: bool = False,
caller: str = "api") -> ChangeResult:
"""Turn the unit's automatic call-home on or off (spec row 9): audited,
identity-checked, never retried, read back."""
serial = normalise_serial(serial)
series_for_serial(serial) # BadRequest (422) before the audit check
if not dry_run and self._audit is None:
raise NotSupported("no audit log is configured -- SFM refuses to change a unit "
"without one (nothing sent)")
kw = dict(enabled=enabled, dry_run=dry_run, even_if_already=even_if_already,
audit=self._audit, caller=caller, sleep=self._sleep,
verify_timeout_s=_CALL_HOME_VERIFY_TIMEOUT_S,
verify_interval_s=_CALL_HOME_VERIFY_INTERVAL_S)
return self._dispatch(
address, serial,
lambda a, s: self._s3.change_call_home(a, s, **kw),
lambda c, s: s4_change_call_home(c, s, address=address, **kw),
change=True)
def change_settings(self, address: UnitAddress, serial: str, *, changes: dict,
revision: Optional[str], dry_run: bool = False,
caller: str = "api") -> ChangeResult:
"""Change the unit's settings (spec row 10, phase 5). A dry run is the
preview: old -> new per field and a `revision`. A live change needs that
revision; it is audited, identity-checked, sent once, never retried, and
read back. Refused before any I/O: no changes, a live call without a
revision, no audit log."""
serial = normalise_serial(serial)
series_for_serial(serial) # BadRequest (422) before anything else
if not isinstance(changes, dict) or not changes:
raise BadRequest("no settings to change -- nothing sent")
if not dry_run and not revision:
raise BadRequest("preview first: a live change needs the revision from its preview "
"-- nothing sent")
if not dry_run and self._audit is None:
raise NotSupported("no audit log is configured -- SFM refuses to change a unit "
"without one (nothing sent)")
kw = dict(changes=changes, revision=revision, dry_run=dry_run, audit=self._audit,
caller=caller, sleep=self._sleep,
verify_timeout_s=_SETTINGS_VERIFY_TIMEOUT_S,
verify_interval_s=_SETTINGS_VERIFY_INTERVAL_S)
return self._dispatch(
address, serial,
lambda a, s: self._s3.change_settings(a, s, **kw),
lambda c, s: s4_change_settings(c, s, address=address, **kw),
change=True)
def held_serial(self, address: UnitAddress) -> Optional[str]:
"""Serial of the OPEN held Series-4 line at this address, else None. No I/O."""
with self._sessions_guard:
session = self._sessions.get(address.key)
if session is not None and session.is_open:
return session.serial
return None
def hang_up(self, address: UnitAddress) -> bool:
with self._locks.hold(address.key):
with self._sessions_guard:
session = self._sessions.pop(address.key, None)
if session is None:
return False
was_open = session.is_open
session.hang_up()
return was_open
# ── dispatch ──────────────────────────────────────────────────────────────
def _dispatch(self, address: UnitAddress, serial: str,
s3_op: Callable[[UnitAddress, str], Any],
s4_op: Callable[[Any, str], Any], *, change: bool = False) -> Any:
serial = normalise_serial(serial)
series = series_for_serial(serial) # raises BadRequest before any I/O
with self._locks.hold(address.key):
if series == 3:
with self._sessions_guard:
held = self._sessions.get(address.key)
if held is not None and held.is_open:
raise WrongUnit(
f"a Series-4 line to {held.serial} is held at {address.key}; "
"a Series-3 unit cannot be there -- POST /device/hangup first "
"if the modem has moved")
return s3_op(address, serial)
session = self._session_for(address, serial)
was_held = session.is_open
try:
return session.run(lambda client: s4_op(client, serial))
except DeviceError as exc:
self._forget_if_closed(address, session)
# A held line the peer dropped still reads open (the transport only
# learns at EOF), so the first request on it times out or fails.
# Call up fresh and retry ONCE. Safe only because every operation
# here is a read (identify, status, settings, list, download -- all
# idempotent). A change (`change=True`) is never retried, by
# construction: a write whose ack was lost must never be sent twice.
if was_held and not change and isinstance(exc, (NoAnswer, ConnectFailed)):
self._drop(address.key, session)
session.hang_up()
session = self._session_for(address, serial)
try:
return session.run(lambda client: s4_op(client, serial))
except DeviceError:
self._forget_if_closed(address, session)
raise
raise
def _forget_if_closed(self, address: UnitAddress, session: Series4Session) -> None:
if not session.is_open:
self._drop(address.key, session)
def _session_for(self, address: UnitAddress, serial: str) -> Series4Session:
with self._sessions_guard:
session = self._sessions.get(address.key)
if session is not None and session.serial != serial:
if session.is_open:
raise WrongUnit(
f"a Series-4 line to {session.serial} is held at {address.key}; "
f"{serial} cannot be reached there -- POST /device/hangup first "
"if the modem has moved")
session = None
if session is None:
session = Series4Session(address, serial, self._s4_factory, clock=self._clock)
self._sessions[address.key] = session
self._ensure_reaper()
return session
# ── the reaper ────────────────────────────────────────────────────────────
def tick(self, now: Optional[float] = None) -> None:
"""Per held line: hang up if idle, else keep alive, else listen for a ring."""
now = self._clock() if now is None else now
with self._sessions_guard:
items = list(self._sessions.items())
for key, session in items:
with self._locks.try_hold(key) as held:
if not held:
continue # mid-request: not idle
if not session.is_open:
self._drop(key, session)
continue
try:
if now - session.last_used >= self._idle_hangup_s:
session.hang_up()
self._drop(key, session)
elif now - session.last_traffic >= self._keepalive_s:
session.keepalive()
else:
session.listen()
except DeviceError as exc:
log.warning("held line %s closed: %s", key, exc)
self._drop(key, session)
def _drop(self, key: str, session: Series4Session) -> None:
with self._sessions_guard:
if self._sessions.get(key) is session:
del self._sessions[key]
def _ensure_reaper(self) -> None:
if not self._start_reaper or self._reaper is not None:
return
self._reaper = threading.Thread(target=self._reaper_loop, name="sfm-held-lines", daemon=True)
self._reaper.start()
def _reaper_loop(self) -> None:
while True:
time.sleep(self._reaper_interval_s)
try:
self.tick()
except Exception: # noqa: BLE001
log.exception("held-line reaper tick failed")
-284
View File
@@ -1,284 +0,0 @@
"""The series-independent core of a change request: start/stop monitoring,
call-home on/off. A `ChangeKind` says what the change is called and which state
read back means it took.
Identity -> state -> (dry run | skip | audit -> pre-send drain -> send once ->
read back -> audit). Each series supplies only its own pieces as callables:
how to read the serial, how to read the run-state name, how to send (returning
the ack record), how to recognise a refusal or a ring, and optionally what to
drain from the line just before sending. Nothing in here retries: `send` is
called at most once, and every path after `audit.begin` calls `audit.finish`
exactly once, through `finish` below.
Once the send has started, a failure is never reported as if nothing went out:
it is a `ChangeUnconfirmed` naming the audit row, carrying the status its cause
would have had. The row's `sent` column says whether a frame went out (1),
did not (0), or may have (NULL), and `states` keeps every state read.
The state names `calling_home` and `unknown*` are Series-4 states, except
`unknown(...)`, which Series 3 also produces for a flag byte never measured.
Series 3 never produces `calling_home` or a ring, so those branches are simply
never taken there.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, NoReturn, Optional
from .errors import (
AuditIncomplete, AuditUnavailable, CallHomeInProgress, ChangeUnconfirmed, NotSupported,
UnitStateUnknown, WrongUnit, translate,
)
from .models import ChangeResult, UnitAddress
from .series import normalise_serial
CALL_HOME_MESSAGE = ("the unit started calling home; SFM hung up so the call can "
"reach THOR -- try again in a few minutes")
_HUNG_UP = "SFM hung up so the call can reach THOR"
# The row's `sent` column.
SENT_ACKNOWLEDGED, NOTHING_SENT, SENT_UNKNOWN = 1, 0, None
def _never(exc: BaseException) -> bool:
return False
@dataclass(frozen=True)
class ChangeKind:
"""What a change is called (the audit row's action, the messages' subject),
the state `read_state` returns once it took, and the past tense for messages."""
action: str
want: str
became: str
def monitoring_change(start: bool) -> ChangeKind:
return (ChangeKind("start monitoring", "monitoring", "started") if start
else ChangeKind("stop monitoring", "idle", "stopped"))
def call_home_change(enabled: bool) -> ChangeKind:
return (ChangeKind("enable call-home", "enabled", "enabled") if enabled
else ChangeKind("disable call-home", "disabled", "disabled"))
def settings_change() -> ChangeKind:
"""A settings change (phase 5): its "state" is a read-back verdict --
"as asked" (the unit holds what was written), "unchanged", or "differs"."""
return ChangeKind("change settings", "as asked", "applied")
def _take_snapshot(snapshot: Optional[Callable[[], Dict[str, Any]]]) -> Optional[Dict[str, Any]]:
"""The caller's record of what the unit holds after the change -- for the
result and the audit row only. It never decides the outcome."""
if snapshot is None:
return None
try:
return dict(snapshot())
except Exception as exc: # noqa: BLE001 -- a record, never a verdict
return {"error": str(exc)}
def run_change(*, kind: ChangeKind, serial: str, series: int, dry_run: bool, even_if_already: bool,
audit: Any, address: UnitAddress, caller: str,
sleep: Callable[[float], None], verify_timeout_s: float, verify_interval_s: float,
read_serial: Callable[[], str],
read_state: Callable[[], str],
describe_plan: Callable[[], Dict[str, Any]],
send: Callable[[], Dict[str, Any]],
is_refusal: Callable[[BaseException], bool] = _never,
is_ring: Callable[[BaseException], bool] = _never,
pre_send: Optional[Callable[[], None]] = None,
snapshot: Optional[Callable[[], Dict[str, Any]]] = None) -> ChangeResult:
action, want, became = kind.action, kind.want, kind.became
reported = normalise_serial(read_serial())
if reported != serial:
raise WrongUnit(f"asked for {serial} but {reported} answered at {address.key} -- "
"nothing sent")
before = read_state()
if before == "calling_home":
raise CallHomeInProgress(CALL_HOME_MESSAGE)
if before.startswith("unknown") and not dry_run:
raise UnitStateUnknown(f"the unit reports run state {before}, which has never "
"been measured -- nothing sent")
planned = dict(describe_plan(), sends_nothing=dry_run)
base = dict(serial=serial, series=series, action=action, plan=planned, state_before=before)
if dry_run:
return ChangeResult(dry_run=True, sent=False, outcome="dry_run",
verified="not_checked", state_after=None, audit_id=None, **base)
if audit is None:
raise NotSupported("no audit log is configured -- SFM refuses to change a unit "
"without one (nothing sent)")
request = {"plan": planned, "even_if_already": even_if_already}
try:
cid = audit.begin(serial=serial, series=series, address=address.key, action=action,
tier="change", request=request, caller=caller)
except Exception as exc: # noqa: BLE001
raise AuditUnavailable(
f"the audit log could not be written -- nothing sent: {exc}") from exc
def states(seen: List[str], after: Optional[str]) -> Dict[str, Any]:
return {"before": before, "seen": list(seen), "after": after}
def finish(unit: str, *, release_line: bool = False, **fields: Any) -> None:
"""The only way a row is finished. `unit` says what happened to the
unit, so a finish that fails still says it. `release_line` says whether
this path hangs up anyway, so a failed finish does not hold the line."""
try:
audit.finish(cid, **fields)
except Exception as exc: # noqa: BLE001
raise AuditIncomplete(
f"{unit} -- but audit record {cid} could not be finished: {exc}",
release_line=release_line) from exc
def unconfirmed(unit: str, cause: BaseException, *, went_out: str, status: int,
**fields: Any) -> NoReturn:
"""Finish the row, then say the change went out (or may have) and name it.
`went_out` is "acknowledged" or "unknown"; the row's `sent` follows it."""
finish(unit, release_line=True,
sent=SENT_ACKNOWLEDGED if went_out == "acknowledged" else SENT_UNKNOWN,
**fields)
raise ChangeUnconfirmed(f"{unit} -- audit record {cid}", audit_id=cid, sent=went_out,
http_status=status) from cause
def status_of(exc: BaseException) -> int:
return translate(exc, connecting=False).http_status
if before == want and not even_if_already:
finish(f"nothing was sent ({serial} is already {want})",
outcome="skipped", verified="not_checked", ack=None, error=f"already {want}",
sent=NOTHING_SENT, states=states([before], None))
return ChangeResult(dry_run=False, sent=False, outcome="skipped",
verified="not_checked", state_after=before,
audit_id=cid, detail={"reason": f"the unit is already {want}"}, **base)
if pre_send is not None:
try:
pre_send() # sends nothing: drains what is already waiting
except Exception as exc: # noqa: BLE001
if is_ring(exc):
finish("nothing was sent (a call-home began before sending)", release_line=True,
outcome="failed", verified="not_checked", ack=None,
error="a call-home began before sending -- nothing sent",
sent=NOTHING_SENT, states=states([before], None))
raise CallHomeInProgress(CALL_HOME_MESSAGE) from exc
finish(f"nothing was sent (the line failed before sending: {exc})", release_line=True,
outcome="failed", verified="not_checked", ack=None,
error=f"the line failed before sending -- nothing sent: {exc}",
sent=NOTHING_SENT, states=states([before], None))
raise # the link is suspect
try:
ack = send() # the only send; nothing below can reach it again
except Exception as exc: # noqa: BLE001 -- recorded, never retried
if is_refusal(exc): # refused by the gate: nothing went out
finish(f"nothing was sent (refused before sending: {exc})", release_line=True,
outcome="failed", verified="not_checked", ack=None,
error=f"refused before sending: {exc}",
sent=NOTHING_SENT, states=states([before], None))
raise
if is_ring(exc):
unconfirmed(f"{action} was sent, but a call-home began in place of the "
f"acknowledgement -- whether it {became} is unknown; {_HUNG_UP}",
exc, went_out="unknown", status=CallHomeInProgress.http_status,
outcome="failed", verified="not_checked", ack=None,
error=f"a call-home began in place of the ack: {exc}",
states=states([before], None))
try:
after: Optional[str] = read_state()
except Exception as follow: # noqa: BLE001
if is_ring(follow):
unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and "
f"the unit then began calling home -- whether it {became} is "
f"unknown; {_HUNG_UP}",
follow, went_out="unknown", status=CallHomeInProgress.http_status,
outcome="failed", verified="not_checked", ack=None,
error=f"no clean ack: {exc}; a call-home began: {follow}",
states=states([before], None))
unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and "
f"reading the state afterwards failed ({follow}) -- whether it "
f"{became} is unknown",
exc, went_out="unknown", status=status_of(exc),
outcome="failed", verified="not_checked", ack=None,
error=f"no clean ack: {exc}; the follow-up read failed: {follow}",
states=states([before], None))
if after == "calling_home":
unconfirmed(f"{action} was sent but the acknowledgement was lost ({exc}), and "
f"the unit then began calling home -- whether it {became} is "
f"unknown; {_HUNG_UP}",
exc, went_out="unknown", status=CallHomeInProgress.http_status,
outcome="failed", verified="not_checked", ack=None,
error=f"no clean ack: {exc}; the unit is now calling home",
states=states([before], after))
lost_detail: Dict[str, Any] = {"error": f"no clean ack: {exc}"}
lost_states = states([before], after)
snap = _take_snapshot(snapshot) # what the unit holds is what tells whether it landed
if snap is not None:
lost_detail["snapshot"] = lost_states["snapshot"] = snap
finish(f"{action} was sent but the acknowledgement was lost ({exc}); the unit "
f"now reads {after}",
outcome="failed", verified="not_checked", ack=None,
error=f"no clean ack: {exc}", sent=SENT_UNKNOWN, states=lost_states)
return ChangeResult(dry_run=False, sent=True, outcome="failed",
verified="not_checked", state_after=after, audit_id=cid,
detail=lost_detail, **base)
seen = [before]
def last_poll() -> Optional[str]:
return seen[-1] if len(seen) > 1 else None
polls = int(verify_timeout_s // verify_interval_s)
try:
for _ in range(polls):
sleep(verify_interval_s)
seen.append(read_state())
if seen[-1] == want or seen[-1] == "calling_home":
break
except Exception as exc: # noqa: BLE001 -- the row must not stay pending
if is_ring(exc):
unconfirmed(f"{action} was sent and acknowledged, but the unit then began "
f"calling home before its state could be read back -- whether it "
f"{became} is unknown; {_HUNG_UP}",
exc, went_out="acknowledged", status=CallHomeInProgress.http_status,
outcome="sent", verified="not_checked", ack=ack,
error=f"sent and acknowledged; a call-home began while reading the "
f"state back: {exc}",
states=states(seen, last_poll()))
unconfirmed(f"{action} was sent and acknowledged, but reading the state back "
f"failed: {exc}",
exc, went_out="acknowledged", status=status_of(exc),
outcome="sent", verified="not_checked", ack=ack,
error=f"sent and acknowledged; reading the state back failed: {exc}",
states=states(seen, last_poll()))
if seen[-1] == "calling_home":
cause = CallHomeInProgress(CALL_HOME_MESSAGE)
unconfirmed(f"{action} was sent and acknowledged, but the unit then began calling "
f"home -- whether it {became} is unknown; {_HUNG_UP}",
cause, went_out="acknowledged", status=cause.http_status,
outcome="sent", verified="not_checked", ack=ack,
error="sent and acknowledged; the unit then began calling home",
states=states(seen, last_poll()))
ok = seen[-1] == want
outcome, verified = ("sent", "ok") if ok else ("failed", "mismatch")
error = None if ok else f"unit reads {seen[-1]}, expected {want}"
detail: Dict[str, Any] = {"states_seen": seen, "ack": ack}
if even_if_already and before == want:
note = (f"the unit was already {want} before sending; the read-back cannot show "
"that this send changed anything")
detail["note"] = note
if error is None:
error = note
row_states = states(seen, last_poll())
snap = _take_snapshot(snapshot)
if snap is not None:
detail["snapshot"] = row_states["snapshot"] = snap
finish(f"{action} was sent and verified" if ok else
f"{action} was sent and acknowledged, but the unit reads {seen[-1]}, not {want}",
outcome=outcome, verified=verified, ack=ack, error=error,
sent=SENT_ACKNOWLEDGED, states=row_states)
return ChangeResult(dry_run=False, sent=True, outcome=outcome, verified=verified,
state_after=seen[-1], audit_id=cid, detail=detail, **base)
-128
View File
@@ -1,128 +0,0 @@
"""Typed device errors, each with the HTTP status the endpoints return."""
from __future__ import annotations
import micromate.protocol as _mm_proto
import minimateplus.protocol as _mmp_proto
class DeviceError(Exception):
http_status = 500
class BadRequest(DeviceError):
http_status = 422
class NotSupported(DeviceError):
http_status = 501
class WrongUnit(DeviceError):
http_status = 409
class UnitStateUnknown(DeviceError):
"""The unit reports a run state that has never been measured."""
http_status = 409
class AuditUnavailable(DeviceError):
"""The audit row could not be written, so nothing was sent."""
http_status = 503
class AuditIncomplete(DeviceError):
"""The unit was dealt with, but its audit row could not be finished. The
message says what happened to the unit first, then names the row.
`release_line` is True when the path would have hung up had the finish
worked (a ring, a link fault, a refusal): the failed write to the audit log
must not turn that into a held line, which would block a call-home."""
http_status = 500
def __init__(self, message: str, *, release_line: bool = False) -> None:
super().__init__(message)
self.release_line = release_line
class ChangeUnconfirmed(DeviceError):
"""A change failed after its frame went out, or may have gone out.
`sent` is "acknowledged" (the ack came back; the read-back failed) or
"unknown" (the ack was lost, or a call-home took its place). The status is
the one the cause would have had, set per instance, and the message names
the audit record. It never means "nothing was sent".
"""
http_status = 500
def __init__(self, message: str, *, audit_id: str, sent: str, http_status: int) -> None:
if sent not in ("acknowledged", "unknown"):
raise ValueError(f"sent must be 'acknowledged' or 'unknown', not {sent!r}")
super().__init__(message)
self.audit_id = audit_id
self.sent = sent
self.http_status = http_status
class UnitBusy(DeviceError):
http_status = 423
class ConnectFailed(DeviceError):
http_status = 503
class CallHomeInProgress(DeviceError):
http_status = 503
class NoAnswer(DeviceError):
http_status = 504
class MalformedReply(DeviceError):
http_status = 502
class EventNotFound(DeviceError):
http_status = 404
class SettingsChanged(DeviceError):
"""The unit's settings changed since the preview the request names (a keypad
edit, another program, or a preview of another unit). Nothing was sent."""
http_status = 409
class ChangeRefused(DeviceError):
"""A change SFM will not send to this unit, and why -- its factory setup, a
schedule that would undo it, a block SFM has not seen. Nothing was sent."""
http_status = 409
class StaleEvent(DeviceError):
"""The event at that key is not the one listed -- the unit was erased, or
its memory wrapped, since the list was read."""
http_status = 409
_TIMEOUTS = (_mm_proto.TimeoutError, _mmp_proto.TimeoutError)
_PROTOCOL = (_mm_proto.ProtocolError, _mmp_proto.ProtocolError)
def translate(exc: BaseException, *, connecting: bool) -> DeviceError:
"""Map a library exception to a typed error.
Order matters: each library's TimeoutError is a ProtocolError subclass, and
the builtin TimeoutError (a failed TCP connect) is an OSError.
"""
if isinstance(exc, DeviceError):
return exc
if isinstance(exc, _TIMEOUTS):
return NoAnswer(f"the unit did not answer: {exc}")
if isinstance(exc, _PROTOCOL):
return MalformedReply(f"bad reply from the unit: {exc}")
if isinstance(exc, OSError):
what = "could not connect" if connecting else "connection lost"
return ConnectFailed(f"{what}: {exc}")
return DeviceError(f"device error: {exc}")
-51
View File
@@ -1,51 +0,0 @@
"""Event identity. An `event_id` is `<serial>:<key hex>:<YYYYmmddHHMMSS>`.
The key alone is not enough: both series reuse keys (a MiniMate restarts at
01110000 after an erase; every Micromate's counter starts at the same value).
The timestamp turns a stale id into a loud StaleEvent instead of a download of
whatever now sits at that key. "-" stands in for an unknown timestamp.
"""
from __future__ import annotations
import datetime
from typing import Optional, Tuple
from .errors import BadRequest
from .series import normalise_serial
_NO_STAMP = "-"
_STAMP_FMT = "%Y%m%d%H%M%S"
def stamp_of(dt: Optional[datetime.datetime]) -> Optional[str]:
return dt.strftime(_STAMP_FMT) if dt is not None else None
def iso_of(dt: Optional[datetime.datetime]) -> Optional[str]:
return dt.isoformat() if dt is not None else None
def make_event_id(serial: str, key: bytes, stamp: Optional[str]) -> str:
return f"{normalise_serial(serial)}:{key.hex()}:{stamp or _NO_STAMP}"
def parse_event_id(event_id: str, serial: str) -> Tuple[bytes, Optional[str]]:
"""(key, stamp) for an id that belongs to `serial`; BadRequest otherwise."""
parts = (event_id or "").strip().split(":")
if len(parts) != 3:
raise BadRequest(f"not an event_id: {event_id!r} -- take it from GET /device/events")
id_serial, key_hex, stamp = parts
if normalise_serial(id_serial) != normalise_serial(serial):
raise BadRequest(f"event_id {event_id!r} belongs to {id_serial}, not {serial}")
try:
key = bytes.fromhex(key_hex)
except ValueError:
key = b""
if len(key) != 4:
raise BadRequest(f"event_id {event_id!r}: the key must be 8 hex digits")
if stamp != _NO_STAMP:
try:
datetime.datetime.strptime(stamp, _STAMP_FMT)
except ValueError:
raise BadRequest(f"event_id {event_id!r}: bad timestamp {stamp!r}") from None
return key, (None if stamp == _NO_STAMP else stamp)
-41
View File
@@ -1,41 +0,0 @@
"""One connection per unit. A modem allows a single TCP session, so two
requests must take turns instead of opening a second connection."""
from __future__ import annotations
import threading
from contextlib import contextmanager
from typing import Dict, Iterator, Optional
from .errors import UnitBusy
class UnitLocks:
def __init__(self, timeout: float = 20.0) -> None:
self._timeout = timeout
self._guard = threading.Lock()
self._locks: Dict[str, threading.Lock] = {}
def _lock_for(self, key: str) -> threading.Lock:
with self._guard:
return self._locks.setdefault(key, threading.Lock())
@contextmanager
def hold(self, key: str, timeout: Optional[float] = None) -> Iterator[None]:
lock = self._lock_for(key)
wait = self._timeout if timeout is None else timeout
if not lock.acquire(timeout=wait):
raise UnitBusy(f"the unit at {key} is busy with another request; try again shortly")
try:
yield
finally:
lock.release()
@contextmanager
def try_hold(self, key: str) -> Iterator[bool]:
lock = self._lock_for(key)
got = lock.acquire(blocking=False)
try:
yield got
finally:
if got:
lock.release()
-166
View File
@@ -1,166 +0,0 @@
"""Series-neutral models. Every operation returns the same shape for both
series; anything only one series has goes under `detail`."""
from __future__ import annotations
import datetime
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional
from .errors import BadRequest
@dataclass(frozen=True)
class UnitAddress:
host: Optional[str]
tcp_port: Optional[int]
port: Optional[str]
baud: Optional[int]
def __post_init__(self) -> None:
if not self.host and not self.port:
raise BadRequest(
"specify 'host' (TCP, e.g. ?host=10.0.0.5&tcp_port=9034) "
"or 'port' (serial, e.g. ?port=/dev/ttyACM0)"
)
@property
def key(self) -> str:
"""One key per physical link -- what the per-unit lock is keyed on."""
if self.host:
return f"tcp:{self.host}:{self.tcp_port}"
return f"serial:{self.port}"
@dataclass
class UnitInfo:
serial: str
series: int
model: Optional[str]
firmware: Optional[str]
monitoring: Optional[bool]
active_setup: Optional[str]
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class UnitStatus:
serial: str
series: int
monitoring: bool
battery_volts: Optional[float]
memory_total_bytes: Optional[int]
memory_free_bytes: Optional[int]
device_time: Optional[str] # ISO, the unit's own local time
event_count: Optional[int] # None where it is not cheap (Series 3)
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class UnitSettings:
serial: str
series: int
setup_name: Optional[str]
record_mode: Optional[str] # the unit's own name for its mode
sample_rate: Optional[int]
record_time_s: Optional[float]
histogram_interval_s: Optional[int]
geo_trigger_ips: Optional[float]
notes: Dict[str, str] = field(default_factory=dict)
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class CallHomeState:
"""A unit's call-home switch, read by serial (phase 4). `enabled` is None when
the enable byte is not a value ever measured; `detail` keeps `byte5` and the
whole `block` (hex) as read."""
serial: str
series: int
enabled: Optional[bool]
dial_string: Optional[str]
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class EventRef:
"""One stored event, as listed. `event_id` is opaque: pass it back to
download the event. `index` is its position in the list right now; an
erase renumbers it, so it is for display, never identity."""
event_id: str
serial: str
series: int
index: int
timestamp: Optional[str] # ISO, the unit's own local time
record_type: Optional[str] # "waveform" | "histogram"
peak_vector_sum_ips: Optional[float]
peaks_ips: Dict[str, float] # geophones only: tran / vert / long
filename: Optional[str] # the name the vendor's software gives it
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class EventList:
serial: str
series: int
events: List[EventRef]
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class EventDownload:
"""What a download stored. The file and waveform are then served at
/db/events/{db_event_id}/... ."""
event_id: str
serial: str
series: int
db_event_id: Optional[str]
stored_filename: str
filesize: Optional[int] # None only for a stored row with no file recorded
sha256: Optional[str] # None when the event was already stored
inserted: bool # False: already stored; nothing was written (detail.already_stored)
verified: Optional[bool] # True: decode self-check passed; None: no check exists
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class DownloadedEvent:
"""The device side's result, before SFM stores it. Not an HTTP shape: it
carries the payload -- a Series-3 Event + its 5A frames + the compliance
config, or a Series-4 file's bytes -- to sfm.event_ingest.
`timestamp` is the event's time as the unit reported it: the store looks up
an existing row by (serial, timestamp) before writing anything. `record` is
what the unit's own event record said (Series 4's 0x0C), for the fields the
file alone does not give."""
event_id: str
serial: str
series: int
filename: str
verified: Optional[bool]
idf_bytes: Optional[bytes] = field(default=None, repr=False)
bw_bytes: Optional[bytes] = field(default=None, repr=False) # Series 3: the assembled Blastware file
event: Any = field(default=None, repr=False)
a5_frames: Optional[list] = field(default=None, repr=False)
compliance: Any = field(default=None, repr=False)
timestamp: Optional[datetime.datetime] = None
record: Dict[str, Any] = field(default_factory=dict)
detail: Dict[str, Any] = field(default_factory=dict)
@dataclass
class ChangeResult:
"""The outcome of a change request. `outcome`: "dry_run" | "skipped" | "sent" |
"failed". `verified`: "ok" | "mismatch" | "not_checked". `plan` is the exact
frames planned (dry run) or sent."""
serial: str
series: int
action: str
dry_run: bool
sent: bool
outcome: str
verified: str
state_before: Optional[str]
state_after: Optional[str]
audit_id: Optional[str]
plan: Dict[str, Any] = field(default_factory=dict)
detail: Dict[str, Any] = field(default_factory=dict)
-643
View File
@@ -1,643 +0,0 @@
"""Series-3 adapter. Connect-per-request, as SFM has always done for
MiniMates -- a held session waits for the bench test in the spec."""
from __future__ import annotations
import datetime
import logging
import struct
from typing import Any, Callable, Optional
from minimateplus import MiniMateClient
from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter
from minimateplus.event_file_io import _GEO_INT16_FS
from minimateplus.framing import build_bw_write_frame, unescape_reply
from micromate.setup_block import decode_setup
from micromate.setup_fields import (
SettingsValueError, changes_bytes, check_changes, editable_fields, encode_setup, field_rows,
field_values, settings_state,
)
from micromate.setup_fields import revision as settings_revision
from minimateplus.protocol import (
SUB_CALL_HOME_CONFIRM, SUB_CALL_HOME_WRITE, SUB_COMPLIANCE_WRITE, SUB_EVENT_INDEX_WRITE,
SUB_START_MONITORING, SUB_STOP_MONITORING, SUB_TRIGGER_CONFIG_WRITE, SUB_WAVEFORM_DATA_WRITE,
ImageRefused, call_home_enabled, call_home_image, is_call_home_block, is_compliance_content,
write_image,
)
from minimateplus.transport import TcpTransport
from .errors import (BadRequest, ChangeRefused, DeviceError, EventNotFound, MalformedReply, NoAnswer, NotSupported,
SettingsChanged, StaleEvent, UnitStateUnknown, WrongUnit, translate)
from .change import call_home_change, monitoring_change, run_change, settings_change
from .events import iso_of, make_event_id, stamp_of
from .models import (CallHomeState, ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress,
UnitInfo, UnitSettings, UnitStatus)
log = logging.getLogger("sfm.device_access")
S3_DEFAULT_BAUD = 38400
S3_MODES = {0x00: "Single Shot", 0x01: "Continuous", 0x03: "Histogram", 0x04: "Histogram + Continuous"}
S3_EVENT_TIMEOUT = 120.0 # what the legacy event-download routes use
# A MiniMate call-home write goes out only once SFM's 0x7E / 0x7F frames are
# reproduced from Blastware's own; shut, a live change is refused before any
# connection (a dry run still works). OPEN since 2026-11-02:
# tests/test_s3_call_home_bw_frames.py rebuilds Blastware's enable and disable
# writes (BE11529, 2026-04-20) byte for byte from the unit's own reads.
S3_CALL_HOME_FRAME_VERIFIED = True
# Measured 2026-11-03 (BE9441): while monitoring, a MiniMate answers the 0x2C read
# with its device-info block, as it answers 1A -- its call-home settings cannot be
# read, so they cannot be changed (SFM writes back only a block it just read).
S3_CALL_HOME_WHILE_MONITORING = ("did not return its call-home settings -- a MiniMate answers the "
"call-home read with its device-info block while monitoring; "
"stop monitoring first, then change call-home")
# The 0x1C flag byte (section[1]): the only values ever measured. 0x10 is
# BE11529 monitoring (2026-04-08); 0x0B is BE9441 recording a histogram,
# confirmed at the unit (2026-10-26). Anything else is refused for a change.
# Measured 2026-11-03 (BE9441's 10-26 recording, 5 / 5 reads): while monitoring, a
# MiniMate answers the 1A settings read with its device-info block.
S3_SETTINGS_WHILE_MONITORING = ("did not return its settings -- a MiniMate answers this way "
"while monitoring; stop monitoring first (a stop makes it call in "
"if call-home is on)")
# Blastware's settings write, in its order (push_config_raw): event index, the
# settings block in addressed chunks, trigger, waveform data, with their confirms.
_S3_SETTINGS_STEPS = ((0x68, "event index (as read)"), (0x73, "confirm B"),
(0x71, "settings block"), (0x72, "confirm A"),
(0x82, "trigger block (as read)"), (0x83, "trigger confirm"),
(0x69, "waveform data (as read)"), (0x74, "confirm C"), (0x72, "confirm A"))
_S3_TAIL_WARNING = ("the two bytes after the settings block go out as 00 00 (Blastware sends "
"its own constant; the unit took it at the bench 2026-11-04)")
# Measured at the bench 2026-11-04 (BE9441): a write sent while the setup menu was open
# was acknowledged and read back, then lost when the operator pressed Cancel or Save --
# the menu writes its own copy of the whole block back.
_S3_MENU_WARNING = ("if someone is in this unit's setup menu, this change is lost when they "
"leave it (Cancel or Save writes the menu's copy back)")
S3_RUN_STATES = {0x00: "idle", 0x10: "monitoring", 0x0B: "monitoring"}
def s3_run_state(status: Any) -> str:
"""The change path's state name from the raw 0x1C flag -- never
`is_monitoring`, which reads every byte but 0x10 as idle. A value never
measured is `unknown(0x..)`, and the change core refuses it."""
flag = getattr(status, "state_flag", None)
if flag is None:
return "unknown(short)"
return S3_RUN_STATES.get(flag, f"unknown(0x{flag:02X})")
# A start makes the unit run its sensor check before "Recording..." -- ~30 s
# (Brian, 2026-10-26), ~40 s on BE11529 (2026-04-08). A start's read-back waits
# this long before asking, then wakes the unit with retries (S3_WAKE_*).
S3_SENSOR_CHECK_S = 30.0
S3_WAKE_ATTEMPT_S = 5.0
S3_WAKE_DEADLINE_S = 60.0
def _woken_state(client: Any) -> str:
"""The run state, read after waking the unit: SESSION_RESET + POLL first,
re-sent until it answers.
A monitoring MiniMate ignores a bare request until it is woken (measured
2026-04-08). On 2026-10-26 BE9441 acked a start, then left a bare 0x1C, and
later a single SESSION_RESET + POLL, unanswered for 120 s: both went out 2 s
after the start, inside the sensor check, and were never re-sent."""
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
return s3_run_state(client.get_monitor_status())
def default_s3_client_factory(address: UnitAddress, timeout: Optional[float] = None) -> MiniMateClient:
if address.host:
return MiniMateClient(transport=TcpTransport(address.host, port=address.tcp_port),
timeout=10.0 if timeout is None else timeout)
if timeout is None:
return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD)
return MiniMateClient(address.port, address.baud or S3_DEFAULT_BAUD, timeout=timeout)
def _close(client: Any) -> None:
try:
client.close()
except Exception: # noqa: BLE001
log.debug("close failed", exc_info=True)
def _s3_dt(ev: Any) -> Optional[datetime.datetime]:
ts = getattr(ev, "timestamp", None)
if ts is None or ts.hour is None:
return None
try:
return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second)
except (TypeError, ValueError):
return None
def _s3_filename(ev: Any, serial: str) -> Optional[str]:
try:
return blastware_filename(ev, serial)
except Exception: # noqa: BLE001
return None
S3_RECORD_TYPE_NOTE = "Series 3's event record does not say waveform or histogram; not decoded yet"
def _s3_ref(ev: Any, serial: str) -> EventRef:
"""record_type is always None: minimateplus's 0C decode reports "Waveform"
for every record layout, histograms included, so it cannot be trusted
here. Null rather than wrong until a histogram's 0C is captured."""
dt = _s3_dt(ev)
pv = ev.peak_values
peaks = {}
if pv is not None:
peaks = {k: v for k, v in (("tran", pv.tran), ("vert", pv.vert), ("long", pv.long))
if v is not None}
return EventRef(
event_id=make_event_id(serial, ev._waveform_key, stamp_of(dt)),
serial=serial, series=3, index=ev.index, timestamp=iso_of(dt),
record_type=None,
peak_vector_sum_ips=pv.peak_vector_sum if pv is not None else None,
peaks_ips=peaks, filename=_s3_filename(ev, serial),
detail={"mic_psi": pv.micl if pv is not None else None,
"record_type_note": S3_RECORD_TYPE_NOTE},
)
_GEO_FULL_SCALE_IPS = 10.0 # normal range; one decoder step = 0.005 in/s
_PEAK_TOLERANCE_IPS = 0.0051 # one 0.005 in/s step, plus the 0C's float32 slop
def verify_s3_download(ev: Any, compliance: Any, body: Optional[bytes] = None) -> tuple:
"""Check a downloaded event against itself and the unit's own 0C record: (verified, why).
A short or misassembled event must not reach the store -- BE9441's bench
(2026-10-25) stored two as successes before this existed. `body` is the
event's 5A body (taken from `ev._a5_frames` when not given). In order:
* No waveform decode: it must decode as a histogram (stored unverified --
its peaks are not compared yet), or it is refused. 0 of ~430 fixture
histograms decode as a waveform; a corrupted waveform decodes as neither.
* A waveform's record chain must end on its END record (0x06), as the
file reader requires; a cut-short stream does not.
* All three geophone channels must be the same length.
* Each channel's peak must be the unit's own to one 0.005 in/s step (a
clipped blast -- both at full scale -- counts as a match). Only for a
unit confirmed in normal range: a sensitive-range unit's scale is still
open (the 8x discrepancy), and an unread range is not assumed.
Raises MalformedReply ("not saved") on any failure.
"""
from minimateplus.blastware_file import extract_body_bytes
from minimateplus.histogram_codec import decode_histogram_body
from minimateplus.waveform_codec import STREAM_END_ID, walk_records
if body is None:
frames = getattr(ev, "_a5_frames", None)
body = extract_body_bytes(frames)[1] if frames else b""
samples = getattr(ev, "raw_samples", None) or {}
chans = ("Tran", "Vert", "Long")
if not all(samples.get(c) for c in chans):
if body and decode_histogram_body(body):
return None, "a histogram: stored unverified (its peaks are not compared yet)"
raise MalformedReply(
"the downloaded event decodes as neither a waveform nor a histogram -- the "
"download is incomplete or misassembled; not saved")
try:
recs = walk_records(body)
except Exception: # noqa: BLE001 -- treated as no chain
recs = []
tail = recs[-1]["end"] if recs else None
if tail is None or tail + 5 > len(body) or body[tail + 4] != STREAM_END_ID:
raise MalformedReply(
"the downloaded waveform's record chain has no end record -- the download is "
"cut short; not saved")
lengths = {c: len(samples[c]) for c in chans}
if len(set(lengths.values())) != 1:
raise MalformedReply(
f"the downloaded waveform's channels have different lengths {lengths} -- the "
"download is incomplete or misassembled; not saved")
if getattr(compliance, "geo_range", None) != 0:
return None, ("whole, but peaks not checked: the unit is not confirmed in normal "
"range (a sensitive-range scale is not settled)")
pv = ev.peak_values
unit = {"Tran": pv.tran, "Vert": pv.vert, "Long": pv.long} if pv else {}
clip = _GEO_FULL_SCALE_IPS - _PEAK_TOLERANCE_IPS
for c in chans:
if unit.get(c) is None:
return None, f"whole, but the unit's record gives no {c} peak to check against"
decoded = max(abs(x) for x in samples[c]) * _GEO_FULL_SCALE_IPS / _GEO_INT16_FS
if decoded >= clip and unit[c] >= clip:
continue # both at full scale: a clipped blast
if abs(decoded - unit[c]) > _PEAK_TOLERANCE_IPS:
raise MalformedReply(
f"the downloaded {c} peak is {decoded:.4f} in/s but the unit's own record says "
f"{unit[c]:.4f} -- the download is incomplete or misassembled; not saved")
return True, f"{lengths['Tran']} samples per channel, peaks match the unit's own"
class Series3Adapter:
def __init__(self, client_factory: Callable[..., Any] = default_s3_client_factory) -> None:
self._factory = client_factory
def change_monitoring(self, address: UnitAddress, serial: str, *, start: bool, dry_run: bool,
even_if_already: bool, audit: Any, caller: str,
sleep: Callable[[float], None], verify_timeout_s: float,
verify_interval_s: float) -> ChangeResult:
"""Series-3 pieces for the shared core in change.py. One attempt, never
retried: `retry=False` stops _run's cold-boot second attempt, and the
core calls the write once."""
sub = SUB_START_MONITORING if start else SUB_STOP_MONITORING
ack_sub = 0xFF - sub
def op(client: Any) -> ChangeResult:
def read_serial() -> str:
info = client.connect() # a fresh connection: connect() is the fresh 0x15 read
return info.serial or ""
def describe_plan() -> dict:
what = "start monitoring" if start else "stop monitoring"
return {"action": what, "sends_nothing": True, "warnings": [],
"steps": [{"sub": f"0x{sub:02X}", "what": what, "offset": "0x0000",
"data_len": 0, "expect_ack": f"0x{ack_sub:02X}",
"frame": build_bw_write_frame(sub, b"").hex()}]}
settle: list = []
def send() -> dict:
# The client validates the ack SUB; it returns nothing else, so none is claimed.
(client.start_monitoring if start else client.stop_monitoring)()
if start:
settle.append(S3_SENSOR_CHECK_S) # the first read waits out the check
return {"subs": [f"0x{ack_sub:02X}"]}
reconnected: list = []
def read_state() -> str:
if settle:
sleep(settle.pop())
try:
return _woken_state(client)
except OSError as exc:
# The modem can drop the line while the unit sensor-checks
# after a start: BE9441's first wake hit "[Errno 32] Broken
# pipe" (2026-10-29), and a fresh connection read it as
# monitoring. Reconnect once, TCP only (opening a MiniMate's
# serial port reboots it), check it is still the same unit,
# and read. A read -- nothing is re-sent.
if reconnected or not address.host:
raise
reconnected.append(True)
log.warning("Series 3 at %s: the line dropped during the read-back (%s) -- "
"reconnecting to read the state; nothing is re-sent",
address.key, exc)
client.close()
client.open()
# Wake first: the identity read is a bare 0x15, which a unit that
# has just started ignores until SESSION_RESET + POLL (the order
# the status read and the legacy write routes use: poll, then read).
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
self._check(client.read_serial(), serial, address)
return s3_run_state(client.get_monitor_status())
return run_change(
kind=monitoring_change(start), serial=serial, series=3, dry_run=dry_run,
even_if_already=even_if_already, audit=audit, address=address, caller=caller,
sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=read_serial,
read_state=read_state,
describe_plan=describe_plan, send=send)
return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False)
def _run(self, address: UnitAddress, fn: Callable[[Any], Any], timeout: Optional[float] = None,
retry: bool = True) -> Any:
def attempt() -> Any:
client = self._factory(address) if timeout is None else self._factory(address, timeout=timeout)
try:
client.open()
except Exception as exc:
_close(client)
raise translate(exc, connecting=True) from exc
try:
return fn(client)
except DeviceError:
raise
except Exception as exc:
raise translate(exc, connecting=False) from exc
finally:
_close(client)
try:
return attempt()
except NoAnswer:
# A MiniMate that has just had its serial lines asserted can take
# 5-10 s to boot, and shows it as silence; one retry covers it. TCP
# only -- on a serial cable a silence is a real fault. Narrower than
# server._run_with_retry (any protocol error): retrying a
# MalformedReply would also retry "no settings block", which a
# reconnect cannot fix.
if not retry or not address.host:
raise
log.info("Series 3 at %s: no clean answer, retrying once (unit may be cold)", address.key)
return attempt()
@staticmethod
def _check(serial_reported: str, serial: str, address: UnitAddress) -> None:
if (serial_reported or "").strip().upper() != serial:
raise WrongUnit(f"asked for {serial} but {serial_reported} answered at {address.key}")
def identify(self, address: UnitAddress, serial: str) -> UnitInfo:
def op(client: Any) -> UnitInfo:
info = client.connect()
self._check(info.serial, serial, address)
cc = info.compliance_config
return UnitInfo(
serial=info.serial, series=3, model=info.model, firmware=info.firmware_version,
monitoring=None, active_setup=cc.setup_name if cc else None,
detail={"manufacturer": info.manufacturer, "dsp_version": info.dsp_version},
)
return self._run(address, op)
def status(self, address: UnitAddress, serial: str) -> UnitStatus:
def op(client: Any) -> UnitStatus:
client.poll()
ms = client.get_monitor_status()
# The change path's reading, not a guess: an unmeasured flag is None.
monitoring = {"monitoring": True, "idle": False}.get(s3_run_state(ms))
return UnitStatus(
serial=serial, series=3, monitoring=monitoring,
battery_volts=round(ms.battery_v, 2) if ms.battery_v is not None else None,
memory_total_bytes=ms.memory_total, memory_free_bytes=ms.memory_free,
device_time=None, event_count=None,
# Series 3 status reads no serial, so the serial shown is the one requested, not one the unit reported.
detail={"serial_verified": False},
)
return self._run(address, op)
def call_home_state(self, address: UnitAddress, serial: str) -> CallHomeState:
"""The unit's call-home switch and dial string (0x2C), after a wake. Like
status, it reads no serial: the one shown is the one requested."""
def op(client: Any) -> CallHomeState:
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
raw = client.read_call_home_raw()
image = unescape_reply(raw)
detail = {"byte5": f"0x{image[5]:02X}" if len(image) > 5 else None,
"block": bytes(raw).hex(), "serial_verified": False}
if not is_call_home_block(raw):
detail["reason"] = f"the unit {S3_CALL_HOME_WHILE_MONITORING}"
return CallHomeState(serial=serial, series=3, enabled=None, dial_string=None, detail=detail)
dial = bytes(image[6:46]).split(b"\x00", 1)[0].decode("ascii", errors="replace") or None
return CallHomeState(serial=serial, series=3, enabled=call_home_enabled(raw),
dial_string=dial, detail=detail)
return self._run(address, op)
def change_call_home(self, address: UnitAddress, serial: str, *, enabled: bool, dry_run: bool,
even_if_already: bool, audit: Any, caller: str,
sleep: Callable[[float], None], verify_timeout_s: float,
verify_interval_s: float) -> ChangeResult:
"""Series-3 pieces for the shared core: read 0x2C, set byte 5 of the
unescaped image, send it (0x7E) and confirm (0x7F), re-read. One attempt,
never retried; refused live until the frame is verified against Blastware."""
if not dry_run and not S3_CALL_HOME_FRAME_VERIFIED:
raise NotSupported("a MiniMate call-home write waits until its frame has been "
"reproduced from a Blastware capture -- nothing sent")
what = "call-home " + ("enable" if enabled else "disable")
def op(client: Any) -> ChangeResult:
reads: list = []
images: list = []
def read_serial() -> str:
return client.connect().serial or "" # a fresh connection: the 0x15 read
def read_state() -> str:
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
raw = client.read_call_home_raw()
if not is_call_home_block(raw):
raise UnitStateUnknown(f"{serial} {S3_CALL_HOME_WHILE_MONITORING} -- nothing sent")
reads.append(raw)
on = call_home_enabled(raw)
if on is None:
image = unescape_reply(raw)
return f"unknown(0x{image[5]:02X})" if len(image) > 5 else "unknown(short)"
return "enabled" if on else "disabled"
def describe_plan() -> dict:
try:
image = call_home_image(reads[-1], enabled)
except ValueError as exc:
images[:] = []
return {"action": what, "steps": [], "warnings": [f"{exc}; nothing would be sent"]}
images[:] = [image]
warnings = []
if image == write_image(SUB_CALL_HOME_WRITE, reads[-1]):
warnings.append(f"the unit is already call-home {'enabled' if enabled else 'disabled'}"
" -- this write changes nothing")
return {"action": what, "warnings": warnings, "steps": [
{"sub": f"0x{SUB_CALL_HOME_WRITE:02X}", "what": "call-home config write",
"data_len": len(image), "frame": build_bw_write_frame(SUB_CALL_HOME_WRITE, image).hex()},
{"sub": f"0x{SUB_CALL_HOME_CONFIRM:02X}", "what": "call-home config confirm",
"data_len": 0, "frame": build_bw_write_frame(SUB_CALL_HOME_CONFIRM, b"").hex()}]}
def send() -> dict:
client.write_call_home_image(images[0])
return {"subs": [f"0x{0xFF - SUB_CALL_HOME_WRITE:02X}", f"0x{0xFF - SUB_CALL_HOME_CONFIRM:02X}"]}
def snapshot() -> dict:
before = write_image(SUB_CALL_HOME_WRITE, reads[0])
after = write_image(SUB_CALL_HOME_WRITE, reads[-1])
return {"before": before.hex(), "after": after.hex(),
"changed_offsets": [i for i in range(min(len(before), len(after)))
if before[i] != after[i]]}
return run_change(
kind=call_home_change(enabled), serial=serial, series=3, dry_run=dry_run,
even_if_already=even_if_already, audit=audit, address=address, caller=caller,
sleep=sleep, verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=read_serial, read_state=read_state,
describe_plan=describe_plan, send=send, snapshot=snapshot,
# raised before the frame goes out: audited as nothing sent
is_refusal=lambda e: isinstance(e, ImageRefused))
return self._run(address, op, retry=False)
def change_settings(self, address: UnitAddress, serial: str, *, changes: dict,
revision: Optional[str], dry_run: bool, audit: Any, caller: str,
sleep: Callable[[float], None], verify_timeout_s: float,
verify_interval_s: float) -> ChangeResult:
"""Series-3 pieces for the shared core (phase 5): read the four settings
blocks, patch the settings block's fields (micromate.setup_fields), send
Blastware's sequence through push_config_raw with the other three blocks
as read, re-read the settings. One attempt, never retried.
Refused before anything is sent: a monitoring unit (it answers 1A with its
device-info block); a value the unit does not allow (BadRequest); a live
call whose `revision` is not this read's (SettingsChanged)."""
def op(client: Any) -> ChangeResult:
st: dict = {}
reads: list = []
def read_serial() -> str:
return client.connect().serial or "" # a fresh connection: the 0x15 read
def read_state() -> str:
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
if st:
now = client.read_compliance_content()
if not is_compliance_content(now):
raise MalformedReply("the read-back did not return the settings block")
reads.append(now)
return settings_state(st["setup"], st["image"], now, series=3)
blocks = client.read_settings_blocks()
setup = blocks["compliance"]
if not is_compliance_content(setup):
raise UnitStateUnknown(f"{serial} {S3_SETTINGS_WHILE_MONITORING} -- nothing sent")
try:
normal = check_changes(setup, 3, changes)
except SettingsValueError as exc:
raise BadRequest(f"{exc} -- nothing sent") from exc
# What the preview showed: the settings block and the changes. The other
# three blocks are re-read here and sent back as read (the trigger block's
# byte 5 "differs by unit and session", #46).
rev = settings_revision([setup, changes_bytes(normal)])
if not dry_run and revision != rev:
raise SettingsChanged(f"{serial}'s settings, or the changes asked for, are not "
"the ones previewed -- preview again; nothing sent")
image = encode_setup(setup, 3, normal)
blocked = []
for sub, block in ((SUB_EVENT_INDEX_WRITE, blocks["event_index"]),
(SUB_COMPLIANCE_WRITE, image),
(SUB_TRIGGER_CONFIG_WRITE, blocks["trigger"]),
(SUB_WAVEFORM_DATA_WRITE, blocks["waveform"])):
try:
write_image(sub, block, escaped=False) # push_config_raw's own check
except ValueError as exc:
blocked.append(f"this unit's {exc} -- SFM has not seen a block like it")
st.update(blocks=blocks, setup=setup, image=image, changes=normal, revision=rev,
blocked=blocked)
reads.append(setup)
return settings_state(setup, image, setup, series=3)
def describe_plan() -> dict:
b = st["blocks"]
lens = {0x68: len(b["event_index"]), 0x71: len(st["image"]) + 2,
0x82: len(b["trigger"]), 0x69: len(b["waveform"])}
if st["blocked"] and not dry_run:
raise ChangeRefused("; ".join(st["blocked"]) + " -- nothing sent")
steps = [] if st["blocked"] else [
{"sub": f"0x{sub:02X}", "what": what, "data_len": lens.get(sub, 0)}
for sub, what in _S3_SETTINGS_STEPS]
return {"action": "settings write", "blocked": list(st["blocked"]), "steps": steps,
"fields": field_rows(st["setup"], st["image"], 3, st["changes"]),
"revision": st["revision"], "warnings": [_S3_MENU_WARNING, _S3_TAIL_WARNING]}
def send() -> dict:
b = st["blocks"]
client.push_config_raw(b["event_index"], st["image"], b["trigger"], b["waveform"],
escaped=False) # every block read is logical
return {"subs": [f"0x{0xFF - sub:02X}" for sub, _ in _S3_SETTINGS_STEPS]}
def snapshot() -> dict:
before, after = st["setup"], reads[-1]
return {"fields": field_rows(before, st["image"], 3, st["changes"], now=after),
"before": before.hex(), "after": after.hex(),
"changed_offsets": [i for i in range(min(len(before), len(after)))
if before[i] != after[i]]}
return run_change(
kind=settings_change(), serial=serial, series=3, dry_run=dry_run,
even_if_already=False, audit=audit, address=address, caller=caller, sleep=sleep,
verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=read_serial, read_state=read_state, describe_plan=describe_plan,
send=send, snapshot=snapshot,
# raised before the first frame goes out: audited as nothing sent
is_refusal=lambda e: isinstance(e, ImageRefused))
return self._run(address, op, retry=False)
def settings(self, address: UnitAddress, serial: str) -> UnitSettings:
"""The 1A read assembled into the logical block and decoded by the shared
settings codec (phase 5)."""
def op(client: Any) -> UnitSettings:
info = client.connect()
self._check(info.serial, serial, address)
content = client.read_compliance_content()
if not is_compliance_content(content):
raise UnitStateUnknown(f"{serial} {S3_SETTINGS_WHILE_MONITORING}")
v = field_values(content, 3)
name = decode_setup(content + bytes(2), verify=False).name # Series 3 reads no CRC
labels = {d["field"]: d["label"] for d in editable_fields(content, 3)}
notes = {labels[f]: v[f] for f in ("note_1", "note_2", "note_3", "note_4")}
code = content[5]
return UnitSettings(
serial=info.serial, series=3, setup_name=name or None,
record_mode=S3_MODES.get(code, f"unknown (0x{code:02x})"),
sample_rate=v["sample_rate"], record_time_s=v["record_time_s"],
histogram_interval_s=v["histogram_interval_s"], geo_trigger_ips=v["geo_trigger_ips"],
notes=notes,
detail={"record_mode_code": code, "alarm_level_geo": v["geo_alarm_ips"],
"geo_range": v["geo_range"], "editable": editable_fields(content, 3)},
)
return self._run(address, op)
def list_events(self, address: UnitAddress, serial: str) -> EventList:
def op(client: Any) -> EventList:
info = client.connect()
self._check(info.serial, serial, address)
return EventList(serial=serial, series=3,
events=[_s3_ref(ev, serial) for ev in client.list_event_headers()])
# The default timeout: a header walk is small replies only, so a lost
# one costs 10 s (TCP) with the unit locked, not 120 s.
return self._run(address, op)
def download_event(self, address: UnitAddress, serial: str, key: bytes,
stamp: Optional[str]) -> DownloadedEvent:
# The walk compares this with the target's 0C and, on a mismatch, sends
# no 5A: a stale id costs a header walk, not a full download of the
# wrong event.
iso = datetime.datetime.strptime(stamp, "%Y%m%d%H%M%S").isoformat() if stamp is not None else None
def op(client: Any) -> DownloadedEvent:
info = client.connect()
self._check(info.serial, serial, address)
try:
ev = client.download_event_by_key(key, expected_timestamp=iso)
except struct.error as exc:
# Defensive. This once caught the 64 KB page bug (TERM's offset driven
# negative); the walk is 32-bit linear since 2026-10-26 and no longer
# produces it, so reaching here is a new fault.
raise MalformedReply(
f"event {key.hex()}: its download could not be assembled ({exc}); not saved"
) from exc
if ev is None:
raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again")
found = stamp_of(_s3_dt(ev))
if stamp is not None and found is None:
raise MalformedReply(
f"could not read event {key.hex()}'s record (0C) to confirm it is the one "
"listed -- not downloaded; try again")
if stamp is not None and found != stamp:
raise StaleEvent(
f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- "
"the unit was erased or wrapped since the list was read; list again")
if not ev._a5_frames:
raise MalformedReply(f"event {key.hex()}: no waveform data received (the 5A download failed)")
filename = _s3_filename(ev, serial)
if filename is None:
raise MalformedReply(f"event {key.hex()} has no usable timestamp, so it cannot be named or stored")
verified, why = verify_s3_download(ev, info.compliance_config)
try:
bw_bytes = blastware_file_bytes(ev, ev._a5_frames)
except ValueError as exc:
raise MalformedReply(
f"event {key.hex()}: its Blastware file could not be assembled ({exc}); not saved"
) from exc
filename = with_type_letter(filename, bw_bytes) # ...900 -> ...900H, from the file's own bytes
return DownloadedEvent(
event_id=make_event_id(serial, key, found), serial=serial, series=3,
filename=filename, verified=verified, event=ev, a5_frames=ev._a5_frames,
bw_bytes=bw_bytes,
compliance=info.compliance_config, timestamp=_s3_dt(ev),
detail={"a5_frames": len(ev._a5_frames), "check": why},
)
return self._run(address, op, timeout=S3_EVENT_TIMEOUT)
-585
View File
@@ -1,585 +0,0 @@
"""Series-4 sessions: call up once, stay on the line, hang up when idle.
⚠ **This module hosts a write path.** `s4_change_monitoring` is the Series-4
wrapper of the shared change core (`change.run_change`): it sends `0x96` /
`0x97` through `MicromateProtocol.execute()`, and it is the only caller of
`.protocol.execute(` in the codebase (a test pins that). Everything else here
is a read.
⚠ Imports only minimateplus.transport from the Series-3 package. Nothing
here may build or send a Series-3 frame -- SESSION_RESET (41 03) has never
been sent to a Micromate.
"""
from __future__ import annotations
import logging
import time
from typing import Any, Callable, Optional, TypeVar
from micromate.client import MicromateClient
from micromate.opcodes import OpcodeRefused
from micromate.protocol import THOR_CHUNK_SIZE
from micromate.protocol import ProtocolError as _MMProtocolError
from micromate.schedule import parse_schedule, schedule_conflicts
from micromate.setup_block import decode_setup
from micromate.setup_fields import (
SettingsValueError, changes_bytes, check_changes, editable_fields, encode_setup, field_rows,
settings_state,
)
from micromate.setup_fields import revision as settings_revision
from micromate.writes import (
is_call_home_content, plan_call_home_enabled, plan_setup_push, plan_start_monitoring,
plan_stop_monitoring,
)
from minimateplus.transport import BaseTransport, SerialTransport, TcpTransport
from .errors import (
AuditIncomplete, BadRequest, CallHomeInProgress, ChangeRefused, ChangeUnconfirmed, DeviceError,
EventNotFound, MalformedReply, SettingsChanged, StaleEvent, UnitStateUnknown, WrongUnit,
translate,
)
from .change import (
CALL_HOME_MESSAGE, call_home_change, monitoring_change, run_change, settings_change,
)
from .events import iso_of, make_event_id, stamp_of
from .models import (CallHomeState, ChangeResult, DownloadedEvent, EventList, EventRef, UnitAddress,
UnitInfo, UnitSettings, UnitStatus)
from .series import normalise_serial
log = logging.getLogger("sfm.device_access")
T = TypeVar("T")
RING = b"RADIO RING"
S4_DEFAULT_BAUD = 115200
class RingDetected(Exception):
"""The unit sent RADIO RING: it is calling home up this connection."""
class RingWatchTransport(BaseTransport):
"""Passes bytes through; raises RingDetected the moment RADIO RING appears
OUTSIDE a frame, including when it is split across two reads.
Inside a frame the bytes are data: the 0x2C call-home config block's dial
string is literally "RADIO RING". A frame runs from STX to an unescaped
ETX; inside it DLE escapes the next byte.
"""
_STX, _ETX, _DLE = 0x02, 0x03, 0x10
def __init__(self, inner: BaseTransport) -> None:
self._inner = inner
self._tail = b""
self._in_frame = False
self._escaped = False
def connect(self) -> None:
self._inner.connect()
def disconnect(self) -> None:
self._inner.disconnect()
@property
def is_connected(self) -> bool:
return self._inner.is_connected
def write(self, data: bytes) -> None:
# A request starts a new exchange (MicromateProtocol resets its parser
# here too), so a stray STX on an idle line cannot hide the next ring.
self._in_frame = self._escaped = False
self._inner.write(data)
def read(self, n: int) -> bytes:
data = self._inner.read(n)
for b in data:
if self._in_frame:
if self._escaped:
self._escaped = False
elif b == self._DLE:
self._escaped = True
elif b == self._ETX:
self._in_frame = False
elif b == self._STX:
self._in_frame = True
self._tail = b""
else:
self._tail = (self._tail + bytes([b]))[-len(RING):]
if self._tail == RING:
self._tail = b""
raise RingDetected("RADIO RING")
return data
def default_s4_client_factory(address: UnitAddress, recv_timeout: float = 10.0) -> MicromateClient:
if address.host:
inner: BaseTransport = TcpTransport(address.host, port=address.tcp_port)
else:
inner = SerialTransport(address.port, address.baud or S4_DEFAULT_BAUD)
return MicromateClient(RingWatchTransport(inner), recv_timeout=recv_timeout)
def _close(client: Any) -> None:
try:
client.close()
except Exception: # noqa: BLE001
log.debug("close failed", exc_info=True)
_RING_MESSAGE = CALL_HOME_MESSAGE
class Series4Session:
"""One held line to one Micromate.
`last_used` is the last *user* request: the idle hang-up measures it.
`last_traffic` is any exchange, keep-alives included: the keep-alive
schedule measures it. If keep-alives counted as use, the line would never
go idle.
Invariant -- which errors keep the line. An operation raises a
`DeviceError` only for a verdict reached over a healthy link: the event is
not there, the id is stale, the record cannot be named. `_exchange` keeps
the line for those. Anything the library raises means the link is
suspect, and `_exchange` hangs up. `DecodeMismatch` is a library error,
so it hangs up too -- conservative, since the link may be fine. Operations
added in later phases must keep to this: never wrap a link failure in a
`DeviceError` inside an op, or the line stays open on a broken link.
The exceptions: `CallHomeInProgress` and `WrongUnit` release the line,
because the line itself is the problem; so does `ChangeUnconfirmed`, which
the change core raises only after a link fault or a ring, once the frame
has gone out. `AuditIncomplete` keeps the line unless its `release_line`
says the path would have hung up anyway (a ring, a link fault, a refusal).
"""
def __init__(self, address: UnitAddress, serial: str,
client_factory: Callable[[UnitAddress], Any],
clock: Callable[[], float] = time.monotonic) -> None:
self.address = address
self.serial = normalise_serial(serial)
self._factory = client_factory
self._clock = clock
self._client: Optional[Any] = None
self.info = None
self.last_used = clock()
self.last_traffic = self.last_used
@property
def is_open(self) -> bool:
client = self._client # one read: held_serial() calls this without the unit lock
return client is not None and client.is_open()
def call_up(self):
client = self._factory(self.address)
try:
client.open()
info = client.connect()
except RingDetected as exc:
_close(client)
log.warning("RADIO RING from %s during call-up -- released the line", self.address.key)
raise CallHomeInProgress(_RING_MESSAGE) from exc
except Exception as exc:
_close(client)
raise translate(exc, connecting=True) from exc
if normalise_serial(info.serial) != self.serial:
_close(client)
raise WrongUnit(f"asked for {self.serial} but {info.serial} answered at {self.address.key}")
self._client, self.info = client, info
self.last_used = self.last_traffic = self._clock()
log.info("call-up: %s at %s, staying on the line", self.serial, self.address.key)
return info
def _exchange(self, op: Callable[[Any], T]) -> T:
try:
return op(self._client)
except RingDetected as exc:
self.hang_up()
log.warning("RADIO RING from %s -- released the line so the call reaches THOR",
self.address.key)
raise CallHomeInProgress(_RING_MESSAGE) from exc
except (CallHomeInProgress, WrongUnit, ChangeUnconfirmed) as exc:
# The line itself is the problem: a call-home rides whatever holds the
# modem's single TCP session, and a line held for X that answers as Y
# must not stay held. ChangeUnconfirmed always follows a link fault
# or a ring (the core converts those itself, so the RingDetected
# clause above never sees them). All three are DeviceErrors, so this
# clause must stay above `except DeviceError`.
self.hang_up()
log.warning("%s at %s -- released the line: %s", type(exc).__name__,
self.address.key, exc)
raise
except AuditIncomplete as exc:
# A finish that failed on a path that hangs up anyway (ring, link
# fault, refusal) must still hang up; on a healthy path, keep the line.
if exc.release_line:
self.hang_up()
log.warning("AuditIncomplete at %s -- released the line: %s",
self.address.key, exc)
raise
except DeviceError:
# The operation's own verdict (event not found, stale id): the line
# is healthy, so keep it. Library errors still hang up below.
raise
except Exception as exc:
self.hang_up()
raise translate(exc, connecting=False) from exc
def run(self, op: Callable[[Any], T]) -> T:
"""A user request. Calls up first if the line is not open."""
if not self.is_open:
self.call_up()
result = self._exchange(op)
self.last_used = self.last_traffic = self._clock()
return result
def keepalive(self) -> None:
"""A POLL so the modem's idle timer does not drop the line. Not use."""
if not self.is_open:
return
self._exchange(lambda c: c.protocol.poll())
self.last_traffic = self._clock()
def listen(self) -> None:
"""Read anything the unit sent unprompted; send nothing. Not use."""
if not self.is_open:
return
self._exchange(lambda c: c.read_unsolicited())
def hang_up(self) -> None:
if self._client is not None:
_close(self._client)
self._client = None
log.info("hang-up: %s at %s", self.serial, self.address.key)
# ── Operations (each runs inside Series4Session.run) ──────────────────────────
def s4_identify(client: Any, serial: str) -> UnitInfo:
info = client.connect()
return UnitInfo(
serial=info.serial, series=4, model=info.model,
firmware=None, # the version string lives in 0x01, undecoded
monitoring=info.monitoring, active_setup=info.active_setup,
detail={"manufacturer": info.manufacturer, "firmware_line": info.firmware_line},
)
def s4_status(client: Any, serial: str, run_state: bool = False) -> UnitStatus:
st = client.get_state()
count = client.get_event_count()
detail = {}
if run_state: # one more round trip, so only when asked (the ring-path bench test)
rs = client.read_run_state()
detail["run_state"] = {"code": rs.code, "name": rs.name}
return UnitStatus(
serial=serial, series=4, monitoring=st.monitoring, battery_volts=st.battery_volts,
memory_total_bytes=st.memory_total_bytes, memory_free_bytes=st.memory_free_bytes,
device_time=st.device_time.isoformat() if st.device_time else None,
event_count=count, detail=detail,
)
def s4_settings(client: Any, serial: str) -> UnitSettings:
content = client.get_setup_content()
s = decode_setup(content)
return UnitSettings(
serial=serial, series=4, setup_name=s.name, record_mode=s.record_mode_name,
sample_rate=s.sample_rate, record_time_s=s.record_time_s,
histogram_interval_s=s.histogram_interval_s,
geo_trigger_ips=s.geo_trigger_ips[0], # the keypad writes all three the same
notes=dict(s.notes),
detail={
"pretrigger_s": s.pretrigger_s,
"auto_record_stop": s.auto_record_stop,
"auto_stop_after_s": s.auto_stop_after_s,
"geophones_active": s.geophones_active,
"mic_active": s.mic_active,
"trigger_on_geophones": s.trigger_on_geophones,
"trigger_on_mic": s.trigger_on_mic,
"geo_trigger_ips_per_channel": list(s.geo_trigger_ips),
"mic_type": s.mic_type,
"mic_trigger_psi": s.mic_trigger_psi,
"mic_trigger_db": s.mic_trigger_db,
"job_number_enabled": s.job_number_enabled,
"job_number": s.job_number,
"scaled_distance_enabled": s.scaled_distance_enabled,
"distance_ft": s.distance_ft,
"charge_weight_lb": s.charge_weight_lb,
"scaled_distance": s.scaled_distance,
"editable": editable_fields(content, 4),
},
)
def _s4_ref(ref: Any, serial: str) -> EventRef:
peaks = ref.peaks_ips or {}
return EventRef(
event_id=make_event_id(serial, ref.key, stamp_of(ref.timestamp)),
serial=serial, series=4, index=ref.index, timestamp=iso_of(ref.timestamp),
record_type=ref.record_type, peak_vector_sum_ips=ref.peak_vector_sum_ips,
peaks_ips={k.lower(): v for k, v in peaks.items() if k in ("Tran", "Vert", "Long")},
filename=ref.filename,
detail={"size_bytes": ref.size, "mic": peaks.get("Mic"), "setup": ref.setup,
"sensor_location": ref.sensor_location},
)
def s4_list_events(client: Any, serial: str) -> EventList:
return EventList(serial=serial, series=4,
events=[_s4_ref(r, serial) for r in client.list_events(with_records=True)])
def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str]) -> DownloadedEvent:
"""Walk to the event and download it there -- the order THOR uses, the only
one captured. Downloading at a parked cursor has never been tried."""
for ref in client.iter_events(with_records=True):
if ref.key != key:
continue
found = stamp_of(ref.timestamp)
if stamp is not None and found is None:
raise MalformedReply(
f"could not read event {key.hex()}'s record (0C) timestamp to confirm it "
"is the one listed -- not downloaded; try again")
if stamp is not None and found != stamp:
raise StaleEvent(
f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- "
"the unit was erased or wrapped since the list was read; list again")
if ref.filename is None:
raise MalformedReply(
f"event {key.hex()}: its record gave no type or timestamp, so it cannot be named or stored")
# THOR's chunk size. A 16 KB chunk takes ~7 s on cellular against the
# 10 s receive deadline; 1 KB is what THOR itself sends.
blob, result = client.fetch_event(ref, chunk_size=THOR_CHUNK_SIZE)
err = client.decode_error(ref, result)
return DownloadedEvent(
event_id=make_event_id(serial, key, found), serial=serial, series=4,
filename=ref.filename, verified=True if err is not None else None,
idf_bytes=blob, timestamp=ref.timestamp,
record={"peak_vector_sum_ips": ref.peak_vector_sum_ips,
"sensor_location": ref.sensor_location, "setup": ref.setup},
detail={"size_bytes": ref.size, "pvs_error": err},
)
raise EventNotFound(f"no event {key.hex()} on {serial} -- list the events again")
def s4_change_monitoring(client: Any, serial: str, *, start: bool, dry_run: bool,
even_if_already: bool, audit: Any, address: UnitAddress,
caller: str, sleep: Callable[[float], None],
verify_timeout_s: float, verify_interval_s: float) -> ChangeResult:
"""Series-4 pieces for the shared core in change.py."""
plan = plan_start_monitoring() if start else plan_stop_monitoring()
def send() -> dict:
acks = client.protocol.execute(plan)
return {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]}
return run_change(
kind=monitoring_change(start), serial=serial, series=4, dry_run=dry_run,
even_if_already=even_if_already,
audit=audit, address=address, caller=caller, sleep=sleep,
verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=lambda: client.serial(refresh=True),
read_state=lambda: client.read_run_state().name,
describe_plan=plan.describe, send=send,
is_refusal=lambda e: isinstance(e, OpcodeRefused),
is_ring=lambda e: isinstance(e, RingDetected),
# A RADIO RING already buffered is caught here, before 0x96/0x97 goes
# out. One transport read: RingWatchTransport over Tcp/SerialTransport,
# each with a 10 ms read timeout, so it returns at once on a quiet line.
pre_send=lambda: client.read_unsolicited())
def _dial_string(block: bytes) -> Optional[str]:
raw = bytes(block[6:46]).split(b"\x00", 1)[0]
return raw.decode("ascii", errors="replace") or None
def _changed_offsets(before: bytes, after: bytes) -> list:
return [i for i in range(max(len(before), len(after)))
if (before[i] if i < len(before) else None) != (after[i] if i < len(after) else None)]
# Measured 2026-11-03 (UM20147): monitoring, a Micromate returns its real call-home
# block and ACKS a write, but does not apply it -- its own menu: "Feature disabled
# while monitoring". So SFM refuses before sending one it would ignore.
S4_CALL_HOME_WHILE_MONITORING = ("is monitoring -- a Micromate ignores call-home changes while "
"monitoring (its own menu: 'Feature disabled while monitoring'); "
"stop monitoring first, then change call-home")
_NOT_CALL_HOME = "returned a block that is not its call-home block (header {}, not 007c)"
def s4_call_home_state(client: Any, serial: str) -> CallHomeState:
"""Bit 0 of content[5] is the enable (UM12947 reads 0x05 / 0x04, UM20147 0x01)."""
block = client.get_call_home_content()
detail = {"byte5": f"0x{block[5]:02X}" if len(block) > 5 else None, "block": block.hex()}
if not is_call_home_content(block):
detail["reason"] = "the unit " + _NOT_CALL_HOME.format(block[0:2].hex())
return CallHomeState(serial=serial, series=4, enabled=None, dial_string=None, detail=detail)
return CallHomeState(serial=serial, series=4, enabled=bool(block[5] & 0x01),
dial_string=_dial_string(block), detail=detail)
def s4_change_call_home(client: Any, serial: str, *, enabled: bool, dry_run: bool,
even_if_already: bool, audit: Any, address: UnitAddress,
caller: str, sleep: Callable[[float], None],
verify_timeout_s: float, verify_interval_s: float) -> ChangeResult:
"""Series-4 pieces for the shared core: read 0x2C, flip bit 0 of [5], send the
rest back byte for byte, re-read. The plan is built from the read run_change
made just before it (spec: build the plan on the same line, right before
sending), and that same plan is the one sent."""
reads: list = []
planned: list = []
def read_state() -> str:
run = client.read_run_state().name
if run == "calling_home" or run.startswith("unknown"):
return run # the core refuses both; a write waits for a known state
if run == "monitoring" and not reads:
raise UnitStateUnknown(f"{serial} {S4_CALL_HOME_WHILE_MONITORING} -- nothing sent")
block = client.get_call_home_content()
if not is_call_home_content(block):
raise UnitStateUnknown(f"{serial} " + _NOT_CALL_HOME.format(block[0:2].hex())
+ " -- nothing sent")
reads.append(block)
return "enabled" if block[5] & 0x01 else "disabled"
def describe_plan() -> dict:
planned[:] = [plan_call_home_enabled(reads[-1], enabled)]
return planned[0].describe()
def send() -> dict:
acks = client.protocol.execute(planned[0])
return {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]}
def snapshot() -> dict:
before, after = reads[0], reads[-1]
return {"before": before.hex(), "after": after.hex(),
"changed_offsets": _changed_offsets(before, after)}
return run_change(
kind=call_home_change(enabled), serial=serial, series=4, dry_run=dry_run,
even_if_already=even_if_already, audit=audit, address=address, caller=caller, sleep=sleep,
verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=lambda: client.serial(refresh=True),
read_state=read_state, describe_plan=describe_plan, send=send,
is_refusal=lambda e: isinstance(e, OpcodeRefused),
is_ring=lambda e: isinstance(e, RingDetected),
pre_send=lambda: client.read_unsolicited(),
snapshot=snapshot)
# ── Changing settings (phase 5) ──────────────────────────────────────────────
S4_SETTINGS_WHILE_MONITORING = ("is monitoring -- stop it first (a stop makes it call in if "
"call-home is on)")
_EDIT_BUFFER_WARNING = ("this reads the unit's keypad edit buffer: if someone is in its menu, "
"their unsaved edits are sent too")
_FACTORY = "factory.mmb"
def s4_change_settings(client: Any, serial: str, *, changes: dict, revision: Optional[str],
dry_run: bool, audit: Any, address: UnitAddress, caller: str,
sleep: Callable[[float], None], verify_timeout_s: float,
verify_interval_s: float) -> ChangeResult:
"""Series-4 pieces for the shared core: read the name, preferences, trigger
and setup blocks and the schedule; patch the setup's fields
(micromate.setup_fields); send THOR's setup push under the active setup's own
name; read the setup back. The plan is built from the read run_change made
just before it, and that same plan is the one sent.
Refused before anything is sent: a monitoring unit; values the unit does not
allow (BadRequest); a live call whose `revision` is not this read's
(SettingsChanged); the factory setup, a schedule that would load another
setup, an unreadable schedule, or a block SFM has not seen (ChangeRefused,
shown as `blocked` in a preview)."""
st: dict = {}
reads: list = []
def first_read() -> str:
name = client.get_active_setup_raw()
prefs = client.get_prefs_content()
trigger = client.get_trigger_content()
setup = client.get_setup_content()
try:
normal = check_changes(setup, 4, changes)
except SettingsValueError as exc:
raise BadRequest(f"{exc} -- nothing sent") from exc
# What the preview showed: the target name, the setup block, the changes. The
# preferences and trigger blocks are re-read here and sent back as read.
rev = settings_revision([name.encode("ascii", "replace"), setup, changes_bytes(normal)])
if not dry_run and revision != rev:
raise SettingsChanged(f"{serial}'s settings, or the changes asked for, are not the ones "
"previewed -- preview again; nothing sent")
image = encode_setup(setup, 4, normal)
blocked: list = []
warnings = [_EDIT_BUFFER_WARNING]
if name.strip().casefold() == _FACTORY:
blocked.append("this unit is running its factory setup; load any other setup on "
"its keypad, then try again")
try:
entries = parse_schedule(client.read_schedule())
except (_MMProtocolError, ValueError) as exc:
blocked.append(f"could not read this unit's schedule ({exc}) -- SFM will not change "
"a unit whose schedule it cannot check")
else:
conflicts = schedule_conflicts(entries, name)
for e in conflicts:
blocked.append(f"this unit's schedule loads {e.setup} at {e.time}, which would "
"replace this change")
for e in entries:
if "start_with_setup" in e.actions and e not in conflicts:
warnings.append(f"the unit's schedule loads this setup at {e.time}; the "
"change survives it")
plan = None
try:
plan = plan_setup_push(prefs, trigger, image, name)
except ValueError as exc:
blocked.append(f"this unit's {exc} -- SFM has not seen a block like it")
st.update(name=name, prefs=prefs, trigger=trigger, setup=setup, image=image,
changes=normal, revision=rev, blocked=blocked, warnings=warnings, plan=plan)
reads.append(setup)
return settings_state(setup, image, setup, series=4)
def read_state() -> str:
run = client.read_run_state().name
if run == "calling_home" or run.startswith("unknown"):
return run # the core refuses both; a write waits for a known state
if not st:
if run == "monitoring":
raise UnitStateUnknown(f"{serial} {S4_SETTINGS_WHILE_MONITORING} -- nothing sent")
return first_read()
now = client.get_setup_content()
reads.append(now)
return settings_state(st["setup"], st["image"], now, series=4)
def describe_plan() -> dict:
ok = st["plan"] is not None and not st["blocked"]
d = st["plan"].describe() if ok else {"action": "setup push", "steps": [], "warnings": []}
d["warnings"] = list(st["warnings"]) + list(d.get("warnings", []))
d.update(fields=field_rows(st["setup"], st["image"], 4, st["changes"]),
revision=st["revision"], blocked=list(st["blocked"]))
if st["blocked"] and not dry_run:
raise ChangeRefused("; ".join(st["blocked"]) + " -- nothing sent")
return d
def send() -> dict:
acks = client.protocol.execute(st["plan"])
return {"subs": [f"0x{a.sub:02X}" for a in acks], "data": [bytes(a.data).hex() for a in acks]}
def snapshot() -> dict:
before, after = st["setup"], reads[-1]
return {"fields": field_rows(before, st["image"], 4, st["changes"], now=after),
"before": before.hex(), "after": after.hex(),
"changed_offsets": _changed_offsets(before, after),
"prefs": st["prefs"].hex(), "trigger": st["trigger"].hex()}
return run_change(
kind=settings_change(), serial=serial, series=4, dry_run=dry_run, even_if_already=False,
audit=audit, address=address, caller=caller, sleep=sleep,
verify_timeout_s=verify_timeout_s, verify_interval_s=verify_interval_s,
read_serial=lambda: client.serial(refresh=True),
read_state=read_state, describe_plan=describe_plan, send=send,
is_refusal=lambda e: isinstance(e, OpcodeRefused),
is_ring=lambda e: isinstance(e, RingDetected),
pre_send=lambda: client.read_unsolicited(),
snapshot=snapshot)
-20
View File
@@ -1,20 +0,0 @@
"""Which series a unit is, from its serial prefix (decided with Brian, 2026-10-20)."""
from __future__ import annotations
from .errors import BadRequest
SERIES_BY_PREFIX = {"UM": 4, "BE": 3, "BA": 3}
def normalise_serial(serial: str) -> str:
return (serial or "").strip().upper()
def series_for_serial(serial: str) -> int:
s = normalise_serial(serial)
for prefix, series in SERIES_BY_PREFIX.items():
if s.startswith(prefix) and len(s) > len(prefix):
return series
raise BadRequest(
f"unknown serial {serial!r}: expected UM... (Series 4) or BE.../BA... (Series 3)"
)
+1 -53
View File
@@ -32,16 +32,6 @@ Layout written to `<filename>.h5`:
client str
operator str
sensor_location str
job_number int (only when read; kept while not shown)
job_number_enabled bool (Blastware prints the job number)
battery_volts, triggered_by, trigger_sources, trigger_level_geo_ips,
trigger_level_mic_psi, firmware_version, dsp_version, model,
calibration_date (ISO), calibrated_by
(each only when read from the event file)
histogram_interval_sec int (histograms)
/intervals (histograms, when read)
half_period/<ch> uint16 samples per interval; Hz = (sample rate / 2) / it
pvs_ips float32 each interval's vector sum, in/s
peak_tran_ips float (from 0C; authoritative)
peak_vert_ips float
peak_long_ips float
@@ -190,7 +180,7 @@ def write_event_hdf5(
event: Event,
*,
serial: str,
geo_range = None,
geo_range = "normal",
source_kind: str = "sfm-live",
tool_version: Optional[str] = None,
captured_at: Optional[datetime.datetime] = None,
@@ -200,9 +190,6 @@ def write_event_hdf5(
"""
Persist a decoded Event as an HDF5 file with samples in physical units.
``geo_range`` left as None takes the event's own (``event.geo_range``,
which a Blastware file's decode reads from its setup block), else Normal.
``geo_ips_per_count`` overrides the range-derived MiniMate count scale
for sources whose counts differ — Thor IDF imports pass
``micromate.idf_file._GEO_LSB_IPS`` (issue #42).
@@ -215,8 +202,6 @@ def write_event_hdf5(
pv = event.peak_values
pi = event.project_info
if geo_range is None:
geo_range = event.geo_range if getattr(event, "geo_range", None) is not None else "normal"
geo_fs = _resolve_geo_full_scale(geo_range)
geo_range_str = _normalise_range(geo_range)
captured_at = captured_at or datetime.datetime.utcnow()
@@ -267,27 +252,6 @@ def write_event_hdf5(
attrs["client"] = (pi.client if pi else "") or ""
attrs["operator"] = (pi.operator if pi else "") or ""
attrs["sensor_location"] = (pi.sensor_location if pi else "") or ""
if pi is not None and getattr(pi, "job_number", None) is not None:
attrs["job_number"] = int(pi.job_number)
attrs["job_number_enabled"] = bool(pi.job_number_enabled)
# Read from a Blastware file's identity and setup blocks; absent when not read.
for attr, value in (
("battery_volts", getattr(event, "battery_volts", None)),
("triggered_by", getattr(event, "triggered_by", None)),
("trigger_sources", getattr(event, "trigger_sources", None)),
("trigger_level_geo_ips", getattr(event, "trigger_level_geo", None)),
("trigger_level_mic_psi", getattr(event, "trigger_level_mic_psi", None)),
("histogram_interval_sec", getattr(event, "histogram_interval_sec", None)),
):
if value is not None:
attrs[attr] = value
di = getattr(event, "device_info", None)
if di is not None:
for attr in ("firmware_version", "dsp_version", "model", "calibrated_by"):
if getattr(di, attr, None):
attrs[attr] = getattr(di, attr)
if getattr(di, "calibration_date", None) is not None:
attrs["calibration_date"] = di.calibration_date.isoformat()
attrs["peak_tran_ips"] = float(pv.tran if pv and pv.tran is not None else 0.0)
attrs["peak_vert_ips"] = float(pv.vert if pv and pv.vert is not None else 0.0)
attrs["peak_long_ips"] = float(pv.long if pv and pv.long is not None else 0.0)
@@ -309,22 +273,6 @@ def write_event_hdf5(
compression="gzip", compression_opts=4, shuffle=True,
)
# /intervals — a histogram's per-interval detail as the file holds it:
# each channel's half-period in samples (frequency = (sample rate / 2)
# / half-period; 0 is Blastware's "N/A") and each interval's vector sum.
half_periods = getattr(event, "interval_half_periods", None)
interval_pvs = getattr(event, "interval_pvs", None)
if half_periods or interval_pvs:
igrp_iv = f.create_group("intervals")
if half_periods:
hgrp = igrp_iv.create_group("half_period")
for ch, hps in half_periods.items():
hgrp.create_dataset(ch, data=np.asarray(hps, dtype="uint16"),
compression="gzip", compression_opts=4, shuffle=True)
if interval_pvs:
igrp_iv.create_dataset("pvs_ips", data=np.asarray(interval_pvs, dtype="float32"),
compression="gzip", compression_opts=4, shuffle=True)
# /samples_int16 — optional raw ADC counts (preserved for analysis
# tools that want pre-conversion data). Cheap to include.
if include_int16:
-216
View File
@@ -1,216 +0,0 @@
"""Store an event SFM downloaded from a unit -- the SDM side of
POST /device/events/download.
Both series end in the two writes every other ingest path makes: the waveform
store (file + sidecar + .h5) and SeismoDb.insert_events().
An event already stored -- by an earlier download, or by THOR's watcher or
Blastware's ACH -- is returned as it is and NOTHING is written. The watcher's
copy is the richer one (its paired report carries PVS, project strings and ZC
frequencies a bare download does not), so a download never merges into it or
replaces it.
"""
from __future__ import annotations
import datetime
from pathlib import Path
from typing import Any, Optional
from sfm.device_access.models import DownloadedEvent, EventDownload
class IngestError(Exception):
"""Downloaded from the unit, but could not be stored."""
def backfill_series3_event(ev: Any, cc: Any) -> None:
"""Compliance-config values that supersede what the 5A stream decoded.
Some STRT fields have ambiguous semantics (STRT[20] is rectime, but
STRT[8:10] / STRT[16:18] are device-specific scratch, not reliable sample or
pre-trigger counts). Shared with GET /device/event/{i}/blastware_file.
"""
if not cc:
return
if ev.sample_rate is None and cc.sample_rate:
ev.sample_rate = cc.sample_rate
if cc.record_time:
# Authoritative: the user-set value the unit followed when recording.
ev.rectime_seconds = cc.record_time
# Derive total_samples from sample_rate x rectime when we can; the
# STRT-derived value can land at a buffer offset rather than a count.
if ev.sample_rate and ev.rectime_seconds:
derived = int(round(ev.sample_rate * ev.rectime_seconds))
if (ev.total_samples is None
or ev.total_samples > derived * 2
or ev.total_samples < derived // 4):
ev.total_samples = derived
def _event_dt(ev: Any) -> Optional[datetime.datetime]:
ts = getattr(ev, "timestamp", None)
try:
return datetime.datetime(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second)
except Exception: # noqa: BLE001
return None
def _already_stored(dl: DownloadedEvent, row: dict) -> EventDownload:
return EventDownload(
event_id=dl.event_id, serial=dl.serial, series=dl.series, db_event_id=row["id"],
stored_filename=row.get("blastware_filename") or "",
filesize=row.get("blastware_filesize"),
sha256=None, # the events table does not keep one
inserted=False, verified=dl.verified,
detail={**dl.detail, "already_stored": True},
)
def _file_geo_range(bw_bytes: bytes) -> Any:
"""The geophone range a Blastware file was recorded at (0 Normal, 1 Sensitive),
or None when it does not read -- or the file does not decode at all."""
from minimateplus import event_file_io
try:
return event_file_io.decode_blastware_bytes(bw_bytes).geo_range
except Exception: # noqa: BLE001 -- the store reports it
return None
def _overlay_s3_record(ev: Any, unit_peaks: Any, unit_range: Any) -> None:
"""The unit's own 0C peaks over the file's -- only where the file cannot be trusted.
The file reads everything Blastware reports (checked on 70,042 events): the
channel peaks and the vector sum, scaled by the geophone range in its own
setup block (4844135), and the mic (5644dbd). The 0C summary is read at
fixed offsets and can shift -- BE9441's read 0 and -0.0 for vector sums
(bench #4) -- so the file's values stand.
Except when the file's range does not read (`ev.geo_range` None; never seen
in DL2): the decoder then assumes Normal, 8x off for a Sensitive unit. Then
the unit's settings decide: Normal confirmed (`unit_range` 0) keeps the
file's peaks; Sensitive or unread keeps the unit's own, as before -- a vector
sum below the largest channel peak is impossible and is not kept. The mic
is the file's either way: its scale does not depend on the geophone range.
"""
if unit_peaks is None or getattr(ev, "geo_range", None) is not None:
return
if unit_range in (0, "normal"):
return
from minimateplus.models import PeakValues
if ev.peak_values is None:
ev.peak_values = PeakValues()
pv = ev.peak_values
for name in ("tran", "vert", "long"):
value = getattr(unit_peaks, name, None)
if value is not None:
setattr(pv, name, value)
pvs = getattr(unit_peaks, "peak_vector_sum", None)
largest = max((getattr(unit_peaks, n, None) or 0.0) for n in ("tran", "vert", "long"))
if pvs is not None and pvs > 0 and pvs >= largest - 0.005:
pv.peak_vector_sum = pvs
def _overlay_s4_record(ev: Any, record: dict) -> None:
"""Fill, where the file left them empty, what the unit's 0x0C said.
Without Thor's TXT report the IDF file gives only the three PPVs. The
vector sum matters beyond display: find_twins matches on it. Not the mic:
its 0x0C decode reads a denormal (parked).
"""
from minimateplus.models import PeakValues, ProjectInfo
pvs = record.get("peak_vector_sum_ips")
if pvs is not None:
if ev.peak_values is None:
ev.peak_values = PeakValues()
if ev.peak_values.peak_vector_sum is None:
ev.peak_values.peak_vector_sum = pvs
location = record.get("sensor_location")
if location is not None:
if ev.project_info is None:
ev.project_info = ProjectInfo()
if ev.project_info.sensor_location is None:
ev.project_info.sensor_location = location
def _download_record_type(dl: DownloadedEvent) -> Optional[str]:
"""The download's own record type -- "Waveform" / "Histogram", as every stored
row has it -- from its file: a Series-3 file's STRT[18], a Series-4 name's
IDFW / IDFH. None when it does not read (then any row at its second counts)."""
if dl.series == 4:
ext = dl.filename.rsplit(".", 1)[-1].upper()
return {"IDFW": "Waveform", "IDFH": "Histogram"}.get(ext)
if not dl.bw_bytes:
return None
try:
from minimateplus.event_file_io import decode_blastware_bytes
return decode_blastware_bytes(dl.bw_bytes).record_type
except Exception: # noqa: BLE001 -- a check, not a decode
return None
def _same_type(row_type: Optional[str], mine: Optional[str]) -> bool:
"""An untyped row, or a download whose type does not read, matches
conservatively: it may be this event."""
return row_type is None or mine is None or row_type.casefold() == mine.casefold()
def persist_download(dl: DownloadedEvent, *, store: Any, db: Any) -> EventDownload:
# Never merge: a row for (serial, timestamp, record type) means the event is
# stored, and whoever stored it first keeps it. No store call, no insert, no
# sidecar. The type matters since #51: a waveform and a histogram recorded in
# the same second (Histogram + Continuous) are two events.
kind = _download_record_type(dl)
if dl.timestamp is not None:
rows = db.query_events(serial=dl.serial, from_dt=dl.timestamp, to_dt=dl.timestamp, limit=10)
rows = [r for r in rows if _same_type(r.get("record_type"), kind)]
if rows:
return _already_stored(dl, rows[0])
# The Blastware name encodes the event's second (a second guard; before #51 a
# histogram's row sat a second off the unit's time). Both twins share the
# letterless name, so it too is held to the type.
row = db.find_event_by_blastware_name(dl.serial, dl.filename, record_type=kind)
if row is not None:
return _already_stored(dl, row)
if dl.series == 4:
ev, rec = store.save_imported_idf(dl.idf_bytes, source_path=Path(dl.filename),
serial_hint=dl.serial)
if ev is not None:
_overlay_s4_record(ev, dl.record)
family = "series4"
else:
# The same path production's watcher uses for Blastware's own files: the
# event is decoded from the file -- samples, histogram, peaks, vector sum,
# mic, sample rate, record time and the geophone range it was recorded
# at -- not from the live 5A decode. The unit's 0C summary is the
# download check (verify_s3_download); it fills in only when the file's
# range does not read (_overlay_s3_record).
if not dl.bw_bytes:
raise IngestError(f"{dl.filename}: the download carried no event file; nothing was stored")
unit_range = getattr(dl.compliance, "geo_range", None) if dl.compliance else None
# The file's range is the setting when it recorded; the live 1A is the
# unit's setting now, which may have changed since -- the fallback only.
# None lets the store scale by the file's own range.
ev, rec = store.save_imported_bw(dl.bw_bytes, source_path=Path(dl.filename),
serial_hint=dl.serial, source_kind="sfm-live",
geo_range=None if _file_geo_range(dl.bw_bytes) is not None
else unit_range)
if ev is not None and dl.event is not None:
_overlay_s3_record(ev, getattr(dl.event, "peak_values", None), unit_range)
family = "series3"
if ev is None or ev._waveform_key is None:
raise IngestError(f"{dl.filename}: stored the file but could not build a database row")
inserted, _skipped = db.insert_events(
[ev], serial=dl.serial,
waveform_records={ev._waveform_key.hex(): rec}, device_family=family)
row_id = None
dt = _event_dt(ev)
if dt is not None:
rows = db.query_events(serial=dl.serial, from_dt=dt, to_dt=dt, limit=1)
row_id = rows[0]["id"] if rows else None
return EventDownload(
event_id=dl.event_id, serial=dl.serial, series=dl.series, db_event_id=row_id,
stored_filename=rec["filename"], filesize=rec["filesize"], sha256=rec.get("sha256"),
inserted=inserted > 0, verified=dl.verified, detail=dict(dl.detail),
)
+168 -479
View File
@@ -13,14 +13,6 @@ GET /device/info POLL + serial number + full config read
GET /device/events Download all stored events (headers + peak values)
POST /device/connect Explicit connect/identify (same as /device/info)
GET /device/event/{idx} Single event by index (header + waveform record)
GET /device/settings Recording settings (requires serial)
POST /device/hangup Hang up a held Series-4 line
`serial` on /device/info, /device/connect, /device/monitor/status and
/device/settings names the unit (UM... = Series 4, BE.../BA... = Series 3) and
returns the shared model. Without it, the legacy Series-3 behaviour is
unchanged. Series-4 lines are held open between requests and hung up after
5 idle minutes, on POST /device/hangup, or the moment the unit calls home.
Transport query params (supply one set):
Serial (direct RS-232 cable):
@@ -50,14 +42,13 @@ import tempfile
import threading
import time
from pathlib import Path
from typing import Any, Dict, Mapping, Optional
from typing import Optional
# FastAPI / Pydantic
try:
from fastapi import Body, FastAPI, File, HTTPException, Query, Response, UploadFile
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, JSONResponse, StreamingResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel
import uvicorn
except ImportError:
@@ -72,7 +63,7 @@ from minimateplus import MiniMateClient
from minimateplus.protocol import ProtocolError
from minimateplus.models import CallHomeConfig, ComplianceConfig, DeviceInfo, Event, PeakValues, ProjectInfo, Timestamp
from minimateplus.transport import TcpTransport, DEFAULT_TCP_PORT
from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter
from minimateplus.blastware_file import write_blastware_file, blastware_filename
from minimateplus.client import _decode_a5_metadata_into, _decode_a5_waveform, _decode_event_count
from minimateplus.framing import build_bw_write_frame, SESSION_RESET, POLL_PROBE, POLL_DATA
from minimateplus.protocol import SUB_STOP_MONITORING
@@ -83,12 +74,6 @@ from sfm.database import SeismoDb
from sfm.live_cache import LiveCache as _LiveCache
from sfm.waveform_store import WaveformStore
from sfm import db_snapshot
from sfm.event_ingest import backfill_series3_event, persist_download
import dataclasses
from sfm.device_access import DeviceAccess, DeviceError, UnitAddress
from sfm.device_access.errors import BadRequest, ChangeUnconfirmed
from sfm.device_access.series import normalise_serial, series_for_serial
from sfm.audit import DbAudit
logging.basicConfig(
level=logging.INFO,
@@ -119,20 +104,6 @@ app.add_middleware(
)
class _PageScripts(StaticFiles):
"""sfm/static/: the web page's JavaScript (no inline JS -- a stack-wide rule,
2026-11-02). `no-cache` makes the browser revalidate on every load, a cheap
304, so a page served by a new SFM never runs an old SFM's cached script."""
async def get_response(self, path, scope):
response = await super().get_response(path, scope)
response.headers["Cache-Control"] = "no-cache"
return response
app.mount("/static", _PageScripts(directory=str(Path(__file__).parent / "static")), name="static")
# ── DB ────────────────────────────────────────────────────────────────────────
# Shared SeismoDb instance. Path can be overridden by --db-path at startup,
# or defaults to bridges/captures/seismo_relay.db relative to the repo root.
@@ -369,132 +340,6 @@ def _run_with_retry(fn, *, is_tcp: bool):
return fn() # let any second failure propagate normally
# ── Device access (serial-named requests) ─────────────────────────────────────
# A request that names the unit by `serial` goes through sfm.device_access:
# same contract for Series 3 and 4. Without `serial`, handlers run their
# legacy Series-3 path unchanged (spec 2026-10-20).
# Constructing it does no I/O and starts no thread until a Series-4 session exists.
# The audit sink is mandatory for live changes: without one they are refused.
_device_access_instance: DeviceAccess = DeviceAccess(audit=DbAudit(_get_db))
def _device_access() -> DeviceAccess:
return _device_access_instance
def _unit_address(port: Optional[str], baud: Optional[int], host: Optional[str],
tcp_port: int) -> UnitAddress:
return UnitAddress(host=host, tcp_port=tcp_port if host else None,
port=None if host else port, baud=baud)
def _via_device_access(fn) -> dict:
try:
result = fn()
except DeviceError as exc:
raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc
return dataclasses.asdict(result) if dataclasses.is_dataclass(result) else result
def _change_response(fn) -> JSONResponse:
"""Run a start/stop; the ChangeResult is the body, its outcome picks the status.
DeviceError mapping is _via_device_access's -- not repeated here. A change
that went out, or may have (ChangeUnconfirmed), keeps that status and message
and adds `sent` ("acknowledged" / "unknown") and `audit_id`, so a client can
tell it from a failure that sent nothing without matching the wording
(bench finding #10, 2026-11-02).
"""
try:
body = _via_device_access(fn)
except HTTPException as exc:
cause = exc.__cause__
if not isinstance(cause, ChangeUnconfirmed):
raise
return JSONResponse(status_code=exc.status_code,
content={"detail": exc.detail, "sent": cause.sent, "audit_id": cause.audit_id})
# An allow-list: only a dry run, a skip, or a change read back as made is a 200.
ok = (body["outcome"] in ("dry_run", "skipped")
or (body["outcome"] == "sent" and body["verified"] == "ok"))
status = 200 if ok else (409 if body["verified"] == "mismatch" else 502)
return JSONResponse(status_code=status, content=body)
_SERIAL_AWARE_PATHS = frozenset({
"/device/info", "/device/connect", "/device/monitor/status", "/device/settings",
"/device/events", "/device/events/download",
"/device/monitor/start", "/device/monitor/stop",
"/device/call_home/state", "/device/call_home/enable", "/device/call_home/disable",
"/device/settings/change",
})
def _device_guard(path: str, query: Mapping[str, str]) -> Optional[tuple]:
"""Refuse a /device/* request that would reach the wrong series' code.
FastAPI drops query params a route does not declare, so `?serial=UM...` on
a Series-3 route would silently run Series-3 bytes against a Micromate
(0xA2 is CONFIRM ERASE there). Returns (status, detail) to refuse, or None.
/device/hangup is always allowed: it must always be able to release a line.
"""
if not path.startswith("/device/") or path == "/device/hangup":
return None
serial = normalise_serial(query.get("serial") or "")
if serial and path in _SERIAL_AWARE_PATHS:
return None # DeviceAccess routes by series and checks held lines itself
if serial.startswith("UM"):
return 501, f"not supported for Series 4 yet: {path}"
# Everything else runs the legacy Series-3 handler -- whatever serial it
# carried, FastAPI drops it -- so it must not reach a held Series-4 line.
if not (query.get("host") or query.get("port")):
return None
try:
tcp_port = int(query.get("tcp_port") or DEFAULT_TCP_PORT)
# baud is not part of the address key, so it is not parsed here.
addr = _unit_address(query.get("port") or None, None, query.get("host") or None, tcp_port)
except (BadRequest, ValueError):
return None
held = _device_access().held_serial(addr)
if held is not None:
return 409, (f"a Series-4 line to {held} is held at {addr.key}; "
"POST /device/hangup first")
return None
@app.middleware("http")
async def _device_guard_middleware(request, call_next):
refusal = _device_guard(request.url.path, request.query_params)
if refusal is not None:
return JSONResponse(status_code=refusal[0], content={"detail": refusal[1]})
return await call_next(request)
_SERIAL_DOC = "Unit serial -- UM... (Series 4) or BE.../BA... (Series 3). Returns the shared model."
_SERIAL_CHECK_DOC = ("Expected unit serial (BE.../BA...). The unit's own serial is read before "
"any write; a different unit, or one that is not Series 3, is refused (409).")
def _require_series3(unit_serial: Optional[str], expected: Optional[str]) -> None:
"""Refuse (409) a legacy Series-3 write or erase unless the unit at the address
answers as Series 3 -- and as `expected`, when one was named.
0xA2 is CONFIRM ERASE on a MiniMate and ends a call-home on a Micromate, and
these routes had no identity check (phase 1c, 2026-10-29). The serial comes
from connect() where a route already makes it, else one SUB 0x15 read.
"""
try:
series = series_for_serial(unit_serial or "")
except BadRequest:
series = None
if series != 3:
raise HTTPException(status_code=409, detail=(
f"the unit at this address answers as {unit_serial!r}, not a Series-3 unit -- nothing sent"))
if expected and normalise_serial(expected) != normalise_serial(unit_serial):
raise HTTPException(status_code=409, detail=(
f"the unit at this address is {unit_serial}, not {expected} -- nothing sent"))
# ── Helpers ────────────────────────────────────────────────────────────────────
def _backfill_events(events: list, info: "DeviceInfo") -> None:
@@ -559,11 +404,10 @@ def event_browser():
@app.get("/device/info")
def device_info(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5, /dev/ttyUSB0)"),
baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"),
baud: int = Query(38400, description="Serial baud rate (default 38400)"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay (e.g. 203.0.113.5)"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
force: bool = Query(False, description="Bypass cache and re-read from device"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
) -> dict:
"""
Connect to the device, perform the POLL startup handshake, and return
@@ -577,10 +421,6 @@ def device_info(
and re-read directly from the device (e.g. after a config push).
The cache is also automatically invalidated after POST /device/config.
"""
if serial:
return _via_device_access(
lambda: _device_access().identify(_unit_address(port, baud, host, tcp_port), serial))
baud = 38400 if baud is None else baud
log.info("GET /device/info port=%s host=%s tcp_port=%d force=%s", port, host, tcp_port, force)
cache = get_cache()
@@ -619,39 +459,27 @@ def device_info(
@app.post("/device/connect")
def device_connect(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
) -> dict:
"""
Connect to the device and return identity. POST variant for terra-view
compatibility with the SLMM proxy pattern.
"""
# force=True PRESERVES today's behaviour: the old call omitted `force`, so it
# received FastAPI's Query(False) object, which is truthy -- /device/connect
# has always bypassed the cache. Passing False here would quietly change that.
return device_info(port=port, baud=baud, host=host, tcp_port=tcp_port,
force=True, serial=serial)
return device_info(port=port, baud=baud, host=host, tcp_port=tcp_port)
@app.get("/device/events")
def device_events(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
debug: bool = Query(False, description="Include raw record hex for field-layout inspection"),
force: bool = Query(False, description="Bypass cache and re-download all events from device"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
) -> dict:
"""
**With `serial`** (UM... or BE.../BA...): the unit's events in the shared
shape for either series, read from headers only -- no event is downloaded
to list it -- and not cached. Each carries an `event_id` for
POST /device/events/download. Without `serial`, the legacy Series-3
behaviour below.
Connect to the device, read the event index, and download all stored
events (event headers + full waveform records with peak values).
@@ -674,10 +502,6 @@ def device_events(
If new events exist on the device, only the new ones are downloaded and merged.
Pass *force=true* to bypass the cache entirely and re-download everything.
"""
if serial:
return _via_device_access(
lambda: _device_access().list_events(_unit_address(port, baud, host, tcp_port), serial))
baud = 38400 if baud is None else baud
log.info("GET /device/events port=%s host=%s debug=%s force=%s", port, host, debug, force)
cache = get_cache()
@@ -1053,10 +877,8 @@ def device_event_blastware_file(
# Determine serial number from device info
serial = getattr(info, "serial", None) or "UNKNOWN"
# Build filename using the same algorithm Blastware uses, plus the W/H type
# letter its direct downloads leave off (read from the file's own bytes).
bw_bytes = blastware_file_bytes(ev, a5_frames)
filename = with_type_letter(blastware_filename(ev, serial), bw_bytes)
# Build filename using the same algorithm Blastware uses
filename = blastware_filename(ev, serial)
# Write to OS temp dir (cross-platform: /tmp on Linux/macOS,
# %TEMP% on Windows) so FastAPI can stream it back via FileResponse.
@@ -1070,7 +892,7 @@ def device_event_blastware_file(
out_path.unlink()
except FileNotFoundError:
pass
out_path.write_bytes(bw_bytes)
write_blastware_file(ev, a5_frames, out_path)
log.info(
"blastware_file: wrote %s (%d A5 frames, serial=%s)",
out_path, len(a5_frames), serial,
@@ -1081,7 +903,28 @@ def device_event_blastware_file(
if serial != "UNKNOWN" and ev._waveform_key is not None:
try:
cc = info.compliance_config
backfill_series3_event(ev, cc)
# Backfill authoritative compliance-config values onto the
# Event before persisting. These supersede whatever
# _decode_a5_waveform read from the STRT bytes (some of which
# have ambiguous semantics — e.g. STRT[20] is rectime but
# STRT[8:10] / STRT[16:18] are device-specific scratch fields
# that aren't reliable sample/pretrig counts).
if cc:
if ev.sample_rate is None and cc.sample_rate:
ev.sample_rate = cc.sample_rate
if cc.record_time:
# record_time from compliance is authoritative — the
# user-set value the device followed when recording.
ev.rectime_seconds = cc.record_time
# Derive total_samples from sample_rate × rectime when
# we can; the STRT-derived value can land at a buffer-
# offset rather than a sample count.
if ev.sample_rate and ev.rectime_seconds:
derived = int(round(ev.sample_rate * ev.rectime_seconds))
if (ev.total_samples is None
or ev.total_samples > derived * 2
or ev.total_samples < derived // 4):
ev.total_samples = derived
geo_range = getattr(cc, "geo_range", None) if cc else None
rec = _get_store().save(
ev, serial=serial, a5_frames=a5_frames,
@@ -1113,61 +956,142 @@ def device_event_blastware_file(
# ── Write endpoints ───────────────────────────────────────────────────────────
_CONFIG_RETIRED = ("retired: change a unit's settings by serial with POST /device/settings/change "
"(audited, previewed, read back)")
class DeviceConfigBody(BaseModel):
"""
Request body for POST /device/config.
All fields are optional — only supplied (non-null) fields are written to
the device. All other config bytes are round-tripped verbatim.
Recording parameters
--------------------
recording_mode : Recording mode enum. Values: 0=Single Shot, 1=Continuous, 3=Histogram, 4=Histogram+Continuous.
sample_rate : Samples per second. Valid values: 1024, 2048, 4096.
record_time : Record duration in seconds (e.g. 1.0, 2.0, 3.0).
Trigger / alarm thresholds and range (geo channels)
----------------------------------------------------
trigger_level_geo : Trigger threshold in in/s (e.g. 0.5).
alarm_level_geo : Alarm threshold in in/s (e.g. 1.0).
geo_range : Geophone range/sensitivity. 0=Normal 10.000 in/s, 1=Sensitive 1.250 in/s.
Project / operator strings (max 41 ASCII characters each)
----------------------------
project : Project description.
client_name : Client / company name.
operator : Operator / technician name.
seis_loc : Sensor location description.
notes : Extended notes.
"""
# Recording parameters
recording_mode: Optional[int] = None
sample_rate: Optional[int] = None
record_time: Optional[float] = None
histogram_interval_sec: Optional[int] = None # seconds: 2, 5, 15, 60, 300, 900 (mode-gated)
# Threshold parameters / geo range
trigger_level_geo: Optional[float] = None
alarm_level_geo: Optional[float] = None
geo_range: Optional[int] = None # 0=Normal 10.000 in/s, 1=Sensitive 1.250 in/s
# Project / operator strings
project: Optional[str] = None
client_name: Optional[str] = None
operator: Optional[str] = None
seis_loc: Optional[str] = None
notes: Optional[str] = None
@app.post("/device/config")
def device_config() -> JSONResponse:
"""Retired (phase 5, 2026-11-03). It wrote a MiniMate's settings through an
encoder #46 found wrong, unaudited, with no read-back, retrying the whole
write on a TCP error. Use POST /device/settings/change."""
return JSONResponse(status_code=410, content={"detail": _CONFIG_RETIRED})
@app.post("/device/config/project")
def device_config_project() -> JSONResponse:
"""Retired with POST /device/config -- use POST /device/settings/change."""
return JSONResponse(status_code=410, content={"detail": _CONFIG_RETIRED})
class SettingsChangeBody(BaseModel):
"""POST /device/settings/change. `changes` maps field -> new value, using
the field names in GET /device/settings' `detail.editable`. `revision` is the
one a dry run (the preview) returned; a live change without it is refused."""
changes: Dict[str, Any]
revision: Optional[str] = None
@app.post("/device/settings/change")
def device_settings_change(
body: SettingsChangeBody,
serial: str = Query(..., description=_SERIAL_DOC),
host: Optional[str] = Query(None, description="TCP host — modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
def device_config(
body: DeviceConfigBody,
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
dry_run: bool = Query(False, description="Preview: old -> new and a revision; send nothing"),
caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"),
):
"""Change a unit's settings by serial, both series (spec row 10, phase 5).
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
) -> dict:
"""
Read the current device config, apply any supplied changes to the compliance
block, and write the full config back.
Preview first (`dry_run=true`): it reads the unit and returns, per field, the
value it holds and the value it would get, any warnings, anything that blocks
the change, and a `revision`. Then send the same body live with that
revision: identity read first, refused if the unit is monitoring or its
settings changed since the preview (409), sent once, never retried, read back.
Statuses as /device/monitor/start; a change that went out but was not
confirmed carries `sent` and `audit_id`."""
resp = _change_response(lambda: _device_access().change_settings(
_unit_address(port, baud, host, tcp_port), serial, changes=body.changes,
revision=body.revision, dry_run=dry_run, caller=caller or "api"))
if not dry_run:
try: # a by-host read must not serve stale settings
get_cache().mark_config_dirty(_live_cache.make_conn_key(host, tcp_port, port, baud))
except Exception as exc: # noqa: BLE001 -- the change's answer stands
log.warning("could not mark the cached config dirty: %s", exc)
return resp
Only non-null fields in the JSON body are modified. All other config bytes
are round-tripped verbatim from the device.
Supply either *port* (serial) or *host* (TCP/modem).
Example body (all fields optional — include only what you want to change):
{
"recording_mode": 1,
"sample_rate": 1024,
"record_time": 3.0,
"trigger_level_geo": 0.5,
"alarm_level_geo": 1.0,
"project": "Bridge Inspection 2026",
"client_name": "City of Portland",
"operator": "Brian Harrison",
"seis_loc": "South Abutment",
"notes": "Pre-blast baseline"
}
Returns:
{"status": "ok", "updated_fields": {...}} on success.
Raises:
502 on protocol errors (timeout, bad ack, etc.).
422 if neither port nor host is provided.
"""
changed = body.model_dump(exclude_none=True)
conn_key = _live_cache.make_conn_key(host, tcp_port, port, baud)
log.info("POST /device/config port=%s host=%s fields=%s", port, host, list(changed.keys()))
try:
def _do():
with _build_client(port, baud, host, tcp_port) as client:
client.connect()
client.apply_config(
recording_mode=body.recording_mode,
sample_rate=body.sample_rate,
record_time=body.record_time,
histogram_interval_sec=body.histogram_interval_sec,
trigger_level_geo=body.trigger_level_geo,
alarm_level_geo=body.alarm_level_geo,
geo_range=body.geo_range,
project=body.project,
client_name=body.client_name,
operator=body.operator,
seis_loc=body.seis_loc,
notes=body.notes,
)
_run_with_retry(_do, is_tcp=_is_tcp(host))
except HTTPException:
raise
except ProtocolError as exc:
raise HTTPException(status_code=502, detail=f"Protocol error: {exc}") from exc
except OSError as exc:
raise HTTPException(status_code=502, detail=f"Connection error: {exc}") from exc
except ValueError as exc:
raise HTTPException(status_code=422, detail=str(exc)) from exc
except Exception as exc:
raise HTTPException(status_code=500, detail=f"Device error: {exc}") from exc
# Config was written to the device — the cached compliance config is now stale.
conn_key = SFMCache.make_conn_key(host, tcp_port, port, baud)
get_cache().mark_config_dirty(conn_key)
return {
"status": "ok",
"updated_fields": changed,
}
# Keep the old endpoint alive under its old URL for anything already calling it
@app.post("/device/config/project")
def device_config_project(
body: DeviceConfigBody,
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
) -> dict:
"""Deprecated alias for POST /device/config — use that instead."""
return device_config(body=body, port=port, baud=baud, host=host, tcp_port=tcp_port)
# ── Monitoring endpoints ───────────────────────────────────────────────────────
@@ -1175,13 +1099,10 @@ def device_settings_change(
@app.get("/device/monitor/status")
def device_monitor_status(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud (default 38400; 115200 for a Micromate)"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
force: bool = Query(False, description="Bypass cache and re-read from device"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
run_state: bool = Query(False, description="With a UM serial: also read SUB 0x49 "
"(one more round trip) and return its raw code in detail.run_state"),
) -> dict:
"""
Read monitoring status from the device.
@@ -1197,11 +1118,6 @@ def device_monitor_status(
**Caching**: status is cached for 30 seconds to reduce cellular polling overhead.
Pass *force=true* to bypass the cache for an immediate fresh read.
"""
if serial:
return _via_device_access(
lambda: _device_access().status(_unit_address(port, baud, host, tcp_port), serial,
run_state=run_state))
baud = 38400 if baud is None else baud
cache = get_cache()
conn_key = SFMCache.make_conn_key(host, tcp_port, port, baud)
@@ -1244,64 +1160,6 @@ def device_monitor_status(
return result
@app.get("/device/settings")
def device_settings(
serial: str = Query(..., description=_SERIAL_DOC),
port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"),
baud: Optional[int] = Query(None, description="Serial baud (default by series)"),
host: Optional[str] = Query(None, description="TCP host -- modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
) -> dict:
"""The unit's recording settings, in the shared shape for either series."""
return _via_device_access(
lambda: _device_access().settings(_unit_address(port, baud, host, tcp_port), serial))
@app.post("/device/events/download")
def device_events_download(
serial: str = Query(..., description=_SERIAL_DOC),
event_id: str = Query(..., description="From GET /device/events?serial=..."),
port: Optional[str] = Query(None, description="Serial port (e.g. /dev/ttyACM0)"),
baud: Optional[int] = Query(None, description="Serial baud (default by series)"),
host: Optional[str] = Query(None, description="TCP host -- modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
) -> dict:
"""Download one event, check it, and store it in SFM's database.
Read-only on the unit. The stored file and waveform are then at
/db/events/{db_event_id}/... . An event already stored -- by an earlier
download, or by THOR's watcher -- comes back as its existing row and
nothing is written (`inserted: false`, `detail.already_stored: true`).
The unit is busy for the whole download: other requests for it wait,
then get 423.
"""
try:
dl = _device_access().download_event(_unit_address(port, baud, host, tcp_port), serial, event_id)
except DeviceError as exc:
raise HTTPException(status_code=exc.http_status, detail=str(exc)) from exc
try:
out = persist_download(dl, store=_get_store(), db=_get_db())
except Exception as exc:
log.error("events/download: %s downloaded but not stored: %s", dl.event_id, exc, exc_info=True)
raise HTTPException(
status_code=500,
detail=f"downloaded {dl.filename} from the unit but could not store it: {exc}") from exc
return dataclasses.asdict(out)
@app.post("/device/hangup")
def device_hangup(
port: Optional[str] = Query(None, description="Serial port"),
baud: Optional[int] = Query(None, description="Serial baud"),
host: Optional[str] = Query(None, description="TCP host -- modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
) -> dict:
"""Hang up a held line now instead of waiting for the idle timeout.
`hung_up` is false if nothing was being held."""
return _via_device_access(
lambda: {"hung_up": _device_access().hang_up(_unit_address(port, baud, host, tcp_port))})
@app.get("/device/events/storage_range")
def device_events_storage_range(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
@@ -1404,7 +1262,6 @@ def device_events_erase(
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: Optional[str] = Query(None, description=_SERIAL_CHECK_DOC),
) -> dict:
"""
Erase ALL stored events from the device memory.
@@ -1424,8 +1281,7 @@ def device_events_erase(
try:
def _do():
with _build_client(port, baud, host, tcp_port) as client:
info = client.connect()
_require_series3(info.serial, serial)
client.connect()
client.delete_all_events()
_run_with_retry(_do, is_tcp=_is_tcp(host))
except HTTPException:
@@ -1474,7 +1330,6 @@ def device_stop_monitoring_blind(
Returns the number of bytes sent. A 503 means the TCP connect failed
(device busy in another session — caller should retry).
"""
# Not identity-checked (phase 1c): it sends only 0x97/0x96, which mean the same on both series (measured 2026-10-25/27), and it must reach a unit too wedged to answer.
log.info(
"POST /device/stop_monitoring_blind host=%s tcp_port=%s connect_timeout=%.1fs repeat=%d",
host, tcp_port, connect_timeout, repeat,
@@ -1547,7 +1402,6 @@ def device_stop_monitoring_slow_drip(
Compared to spam mode: ~40× fewer bytes/sec on the wire, but each
byte has a much higher chance of actually being parsed.
"""
# Not identity-checked (phase 1c): it sends only 0x97/0x96, which mean the same on both series (measured 2026-10-25/27), and it must reach a unit too wedged to answer.
log.info(
"POST /device/stop_monitoring_slow_drip host=%s tcp_port=%s duration=%.1fs interval=%.2fs connect_timeout=%.1fs",
host, tcp_port, duration_s, interval_s, connect_timeout,
@@ -1677,7 +1531,6 @@ def device_stop_monitoring_spam(
when it finishes. No streaming; if you want live progress, watch
SFM logs.
"""
# Not identity-checked (phase 1c): it sends only 0x97/0x96, which mean the same on both series (measured 2026-10-25/27), and it must reach a unit too wedged to answer.
log.info(
"POST /device/stop_monitoring_spam host=%s tcp_port=%s duration=%.1fs connect_timeout=%.3fs repeat=%d",
host, tcp_port, duration_s, connect_timeout, repeat,
@@ -1749,7 +1602,6 @@ def device_rescue(
recv_timeout: float = Query(5.0, description="Per-frame S3 recv timeout in seconds (default 5)"),
disable_ach: bool = Query(True, description="Disable Auto Call Home on the device before erasing"),
erase: bool = Query(True, description="Erase all stored events after disabling ACH"),
serial: Optional[str] = Query(None, description=_SERIAL_CHECK_DOC),
) -> dict:
"""
Rescue an uncooperative unit by squeezing all maintenance work into a
@@ -1800,11 +1652,6 @@ def device_rescue(
client.poll()
steps.append({"step": "poll", "ok": True, "elapsed_s": round(time.monotonic() - t0, 2)})
if disable_ach or erase:
# One SUB 0x15 read: this route writes call-home and erases.
_require_series3(client.read_serial(), serial)
steps.append({"step": "identify", "ok": True, "elapsed_s": round(time.monotonic() - t0, 2)})
if disable_ach:
client.set_call_home_config(auto_call_home_enabled=False)
steps.append({"step": "disable_ach", "ok": True, "elapsed_s": round(time.monotonic() - t0, 2)})
@@ -1813,8 +1660,6 @@ def device_rescue(
client.delete_all_events()
steps.append({"step": "erase", "ok": True, "elapsed_s": round(time.monotonic() - t0, 2)})
except HTTPException:
raise
except ProtocolError as exc:
steps.append({"step": "error", "ok": False, "detail": f"protocol: {exc}"})
raise HTTPException(status_code=502, detail={"message": f"Protocol error: {exc}", "steps": steps}) from exc
@@ -1841,56 +1686,16 @@ def device_rescue(
@app.post("/device/monitor/start")
def device_monitor_start(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
dry_run: bool = Query(False, description="Return the planned frames; send nothing"),
even_if_already: bool = Query(False, description="Send even if the unit is already in the target state"),
caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"),
):
) -> dict:
"""
Command the device to start monitoring (recording triggered events).
Sends SUB 0x96 and waits for ack SUB 0x69.
With `serial`: the unit's identity is read first (a different unit is a 409,
nothing sent), then its state; `dry_run` returns the planned frames and sends
nothing; a live change is audited (`GET /db/device_commands`), verified by
reading the state back, and never retried. `even_if_already` sends even
when the unit is already in the target state.
Statuses with `serial`:
200 the ChangeResult: a dry run, a skip (already in the state), or a send
read back as made
409 ChangeResult: sent and acknowledged, but the unit never reached the
state (`verified: mismatch`, every state seen kept); or, as an
error, a different unit answered or its state was never measured
(nothing sent either way)
502 ChangeResult: the ack was lost but the unit could be read afterwards
422 a malformed serial or address; 423 the unit is busy;
501 no audit log is configured (nothing sent)
503 the unit is calling home, or a call-home was already waiting before
sending (nothing sent); or the audit log could not be written
(nothing sent)
500 the audit row could not be finished -- the detail says first what
happened to the unit (sent and verified, nothing sent, ...)
504 / 502 / 503 a link failure before anything was sent
A failure AFTER the frame went out (or may have) -- the read-back failed,
the ack was lost and the unit could not be read, or a call-home began --
takes the status its cause would have had (503 for a call-home, 504 for
silence, 502 for a bad reply, 503 for a lost connection), and its detail
says the frame was sent and names the audit record.
Without `serial`: the legacy behaviour above, unchanged.
"""
if serial:
return _change_response(lambda: _device_access().start_monitoring(
_unit_address(port, baud, host, tcp_port), serial, dry_run=dry_run,
even_if_already=even_if_already, caller=caller or "api"))
baud = 38400 if baud is None else baud
conn_key = _live_cache.make_conn_key(host, tcp_port, port, baud)
# Legacy branch, not identity-checked: 0x96/0x97 mean the same on both series (measured).
with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client:
try:
client.poll()
@@ -1907,56 +1712,16 @@ def device_monitor_start(
@app.post("/device/monitor/stop")
def device_monitor_stop(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: Optional[str] = Query(None, description=_SERIAL_DOC),
dry_run: bool = Query(False, description="Return the planned frames; send nothing"),
even_if_already: bool = Query(False, description="Send even if the unit is already in the target state"),
caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"),
):
) -> dict:
"""
Command the device to stop monitoring.
Sends SUB 0x97 and waits for ack SUB 0x68.
With `serial`: the unit's identity is read first (a different unit is a 409,
nothing sent), then its state; `dry_run` returns the planned frames and sends
nothing; a live change is audited (`GET /db/device_commands`), verified by
reading the state back, and never retried. `even_if_already` sends even
when the unit is already in the target state.
Statuses with `serial`:
200 the ChangeResult: a dry run, a skip (already in the state), or a send
read back as made
409 ChangeResult: sent and acknowledged, but the unit never reached the
state (`verified: mismatch`, every state seen kept); or, as an
error, a different unit answered or its state was never measured
(nothing sent either way)
502 ChangeResult: the ack was lost but the unit could be read afterwards
422 a malformed serial or address; 423 the unit is busy;
501 no audit log is configured (nothing sent)
503 the unit is calling home, or a call-home was already waiting before
sending (nothing sent); or the audit log could not be written
(nothing sent)
500 the audit row could not be finished -- the detail says first what
happened to the unit (sent and verified, nothing sent, ...)
504 / 502 / 503 a link failure before anything was sent
A failure AFTER the frame went out (or may have) -- the read-back failed,
the ack was lost and the unit could not be read, or a call-home began --
takes the status its cause would have had (503 for a call-home, 504 for
silence, 502 for a bad reply, 503 for a lost connection), and its detail
says the frame was sent and names the audit record.
Without `serial`: the legacy behaviour above, unchanged.
"""
if serial:
return _change_response(lambda: _device_access().stop_monitoring(
_unit_address(port, baud, host, tcp_port), serial, dry_run=dry_run,
even_if_already=even_if_already, caller=caller or "api"))
baud = 38400 if baud is None else baud
conn_key = _live_cache.make_conn_key(host, tcp_port, port, baud)
# Legacy branch, not identity-checked: 0x96/0x97 mean the same on both series (measured).
with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client:
try:
client.poll()
@@ -1973,64 +1738,6 @@ def device_monitor_stop(
# ── Call home config endpoints ───────────────────────────────────────────────
@app.get("/device/call_home/state")
def device_call_home_state(
serial: str = Query(..., description=_SERIAL_DOC),
host: Optional[str] = Query(None, description="TCP host — modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
) -> dict:
"""The unit's call-home switch and dial string, by serial, both series (phase 4).
`enabled` is null when the enable byte is not a value ever measured;
`detail` keeps `byte5` and the whole block as read."""
return _via_device_access(lambda: _device_access().call_home_state(
_unit_address(port, baud, host, tcp_port), serial))
def _set_call_home(enabled: bool, port, baud, host, tcp_port, serial, dry_run, even_if_already, caller):
return _change_response(lambda: _device_access().set_call_home(
_unit_address(port, baud, host, tcp_port), serial, enabled=enabled, dry_run=dry_run,
even_if_already=even_if_already, caller=caller or "api"))
@app.post("/device/call_home/enable")
def device_call_home_enable(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: str = Query(..., description=_SERIAL_DOC),
dry_run: bool = Query(False, description="Return the planned frames; send nothing"),
even_if_already: bool = Query(False, description="Send even if call-home is already on"),
caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"),
):
"""Turn the unit's automatic call-home ON (spec row 9), by serial, both series.
The same audited change as /device/monitor/start: identity read first (a
different unit is a 409, nothing sent), the 0x2C block read, one write that
changes only the enable byte (0x7E + 0x7F), never retried, then read back.
Statuses as /device/monitor/start; a change that went out but was not
confirmed carries `sent` and `audit_id`."""
return _set_call_home(True, port, baud, host, tcp_port, serial, dry_run, even_if_already, caller)
@app.post("/device/call_home/disable")
def device_call_home_disable(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
baud: Optional[int] = Query(None, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: str = Query(..., description=_SERIAL_DOC),
dry_run: bool = Query(False, description="Return the planned frames; send nothing"),
even_if_already: bool = Query(False, description="Send even if call-home is already off"),
caller: Optional[str] = Query(None, description="Who is asking (recorded in the audit row)"),
):
"""Turn the unit's automatic call-home OFF -- as /device/call_home/enable."""
return _set_call_home(False, port, baud, host, tcp_port, serial, dry_run, even_if_already, caller)
@app.get("/device/call_home")
def device_call_home_get(
port: Optional[str] = Query(None, description="Serial port (e.g. COM5)"),
@@ -2117,7 +1824,6 @@ def device_call_home_set(
baud: int = Query(38400, description="Serial baud rate"),
host: Optional[str] = Query(None, description="TCP host — modem IP or ACH relay"),
tcp_port: int = Query(DEFAULT_TCP_PORT, description=f"TCP port (default {DEFAULT_TCP_PORT})"),
serial: Optional[str] = Query(None, description=_SERIAL_CHECK_DOC),
) -> dict:
"""
Read the current call home config, apply supplied changes, and write back.
@@ -2141,7 +1847,6 @@ def device_call_home_set(
def _do():
with _build_client(port, baud, host, tcp_port) as client:
client.poll()
_require_series3(client.read_serial(), serial) # one SUB 0x15 read
client.set_call_home_config(
auto_call_home_enabled=body.auto_call_home_enabled,
after_event_recorded=body.after_event_recorded,
@@ -3223,22 +2928,6 @@ def db_sessions(
return {"count": len(rows), "sessions": rows}
@app.get("/db/device_commands")
def db_device_commands(
serial: Optional[str] = Query(None, description="Filter by unit serial"),
limit: int = Query(100, ge=1, le=1000, description="Max rows to return"),
) -> dict:
"""
The audit trail of changes SFM attempted on units, newest first.
Each row's `sent` says whether a frame went out (1 acknowledged, 0 nothing
sent, null unknown) and `states` holds every state read (before / seen /
after). `serial` is matched case-insensitively.
"""
serial = normalise_serial(serial) if serial else None
return {"commands": _get_db().query_device_commands(serial or None, limit)}
# ── Entry point ────────────────────────────────────────────────────────────────
if __name__ == "__main__":
+2078 -67
View File
File diff suppressed because it is too large. Load diff
-271
View File
@@ -1,271 +0,0 @@
/* <device-routing> */
// Every rule that decides where a /device/ request goes, or whether a
// series-specific control is live. Pure functions -- no DOM, no fetch -- so
// tests/test_webapp_device_routing.py runs them in Node (phase 1c, 2026-10-29).
// A control follows the unit's own /device/info answer, never a typed serial
// alone: 0xA2 is CONFIRM ERASE on a MiniMate and ends a call-home on a Micromate.
const SERIES_BY_PREFIX = [['UM', 4], ['BE', 3], ['BA', 3]]; // sfm/device_access/series.py
function normSerial(serial) { return String(serial || '').trim().toUpperCase(); }
function seriesFromSerial(serial) {
const s = normSerial(serial);
for (const [prefix, series] of SERIES_BY_PREFIX) {
if (s.startsWith(prefix) && s.length > prefix.length) return series;
}
return null;
}
function unitQuery(unit) {
const parts = [];
const s = normSerial(unit.serial);
if (s) parts.push(`serial=${encodeURIComponent(s)}`);
parts.push(`host=${encodeURIComponent(unit.host || '')}`);
parts.push(`tcp_port=${encodeURIComponent(unit.tcpPort)}`);
return parts.join('&');
}
// action -> [method, path, needs a serial (no legacy equivalent)]
const DEVICE_ROUTES = {
info: ['GET', '/device/info', false],
status: ['GET', '/device/monitor/status', false],
settings: ['GET', '/device/settings', true],
events: ['GET', '/device/events', false],
download: ['POST', '/device/events/download', true],
start: ['POST', '/device/monitor/start', false],
stop: ['POST', '/device/monitor/stop', false],
hangup: ['POST', '/device/hangup', true],
storage_range: ['GET', '/device/events/storage_range', false],
index: ['GET', '/device/events/index', false],
erase: ['POST', '/device/events/erase', false],
rescue: ['POST', '/device/rescue', false],
blind_stop: ['POST', '/device/stop_monitoring_blind', false],
slow_drip: ['POST', '/device/stop_monitoring_slow_drip', false],
call_home_read: ['GET', '/device/call_home', false],
call_home_write: ['POST', '/device/call_home', false],
call_home_state: ['GET', '/device/call_home/state', true],
call_home_on: ['POST', '/device/call_home/enable', true],
call_home_off: ['POST', '/device/call_home/disable', true],
settings_change: ['POST', '/device/settings/change', true],
event_waveform: ['GET', '/device/event/{index}/waveform', false],
event_file: ['GET', '/device/event/{index}/blastware_file', false],
};
function deviceUrl(action, unit, params = {}) {
const route = DEVICE_ROUTES[action];
if (!route) throw new Error(`unknown device action: ${action}`);
const [method, template, needsSerial] = route;
if (needsSerial && !normSerial(unit.serial)) return null;
const rest = { ...params };
let path = template;
if (path.includes('{index}')) { // the legacy per-event routes
if (rest.index === undefined) throw new Error(`${action} needs params.index`);
path = path.replace('{index}', encodeURIComponent(rest.index));
delete rest.index;
}
// Hang-up releases whatever line is held at the address: no serial.
let query = action === 'hangup' ? unitQuery({ ...unit, serial: '' }) : unitQuery(unit);
for (const [k, v] of Object.entries(rest)) query += `&${k}=${encodeURIComponent(v)}`;
return { method, path: `${path}?${query}` };
}
function confirmedSeries(unit) {
const c = unit.confirmed;
if (!c) return null;
const typed = normSerial(unit.serial);
if (!typed) return c.series; // a legacy identify, no serial typed
return typed === normSerial(c.serial) ? c.series : null;
}
function controlsFor(unit) {
const series = confirmedSeries(unit);
const serialMode = Boolean(normSerial(unit.serial));
return {
startStop: serialMode && (series === 3 || series === 4),
hangup: series === 4,
diagnostics: series === 3,
// by host, the legacy read is Series 3's; by serial, both series (phase 4)
callHomeRead: series === 3 || (serialMode && series === 4),
callHomeChange: serialMode && (series === 3 || series === 4),
configWrite: serialMode && (series === 3 || series === 4),
callHomeWrite: false,
reasons: { configWrite: 'By serial only: Preview, then Send (audited).',
callHomeWrite: 'By serial: use Call-home On / Off (audited). Other call-home fields wait for the THOR round.' },
};
}
function changeSummary(body) {
const id8 = String(body.audit_id || '').slice(0, 8);
if (body.outcome === 'dry_run') {
const subs = ((body.plan || {}).steps || []).map(s => s.sub).join(', ');
return `${body.action}: dry run — would send ${subs}`;
}
if (body.action === 'change settings') { // phase 5: the state is a read-back verdict
if (body.outcome === 'skipped') return 'change settings: the unit already holds these — nothing sent';
if (body.outcome === 'sent' && body.verified === 'ok') {
return `change settings: confirmed — the unit holds what was sent (audit ${id8})`;
}
if (body.verified === 'mismatch') {
return `change settings: sent, but the unit reads ${body.state_after} — see what it holds (audit ${id8})`;
}
}
if (body.outcome === 'skipped') return `${body.action}: already ${body.state_before} — nothing sent`;
if (body.outcome === 'sent' && body.verified === 'ok') {
return `${body.action}: confirmed — ${body.state_before} → ${body.state_after} (audit ${id8})`;
}
return `${body.action}: ${body.outcome}, ${body.verified} (audit ${id8})`;
}
// What a chip and the peaks bar show for an event, from either shape: the
// shared EventRef (serial mode) or the legacy event (host/port mode).
function eventView(ev) {
const label = typeof ev.timestamp === 'string' ? ev.timestamp.replace('T', ' ')
: (ev.timestamp && ev.timestamp.display) || `Event ${ev.index}`;
let peaks = null;
if (ev.peaks_ips || ev.peak_vector_sum_ips != null) {
const p = ev.peaks_ips || {};
peaks = { tran: p.tran ?? null, vert: p.vert ?? null, long: p.long ?? null,
pvs: ev.peak_vector_sum_ips ?? null, micPsi: null };
} else if (ev.peak_values) {
const pv = ev.peak_values;
peaks = { tran: pv.tran_in_s ?? null, vert: pv.vert_in_s ?? null, long: pv.long_in_s ?? null,
pvs: pv.peak_vector_sum ?? null, micPsi: pv.micl_psi ?? null };
}
return { label, title: ev.record_type || '', peaks };
}
// What the Config tab's serial-mode Read shows for a UnitSettings reply.
function settingsRows(st) {
const dash = v => (v == null || v === '' ? '—' : v);
const hi = st.histogram_interval_s;
const rows = [
['Setup Name', dash(st.setup_name)],
['Record Mode', dash(st.record_mode)],
['Sample Rate', st.sample_rate != null ? `${st.sample_rate} sps` : '—'],
['Record Time', st.record_time_s != null ? `${st.record_time_s.toFixed(2)} s` : '—'],
['Histogram Interval', hi == null ? '—' : hi < 60 ? `${hi} s` : `${hi / 60} min`],
['Geo Trigger', st.geo_trigger_ips != null ? `${st.geo_trigger_ips.toFixed(4)} in/s` : '—'],
];
const notes = Object.entries(st.notes || {});
if (!notes.length) rows.push(['Notes', '—']);
for (const [k, v] of notes) rows.push([`Note: ${k}`, dash(v)]);
return rows;
}
// The legacy per-index routes (Load / Save / Download, prev/next, the arrow
// keys) address events by position on the MiniMate path: live only for a list
// loaded without a serial that has events.
function perIndexLive({ bySerial, count }) { return !bySerial && count > 0; }
// A unit's own string (setup name, project, an error naming a serial) placed
// into markup must stay text.
function escapeHtml(v) {
return String(v ?? '').replace(/[&<>"']/g,
c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
}
function downloadSummary(body) {
if (body.inserted === false) return `already stored — ${body.stored_filename}`;
return `stored ${body.stored_filename}, ${body.filesize} bytes, check: ${(body.detail || {}).check}`;
}
// A Micromate's version string lives in 0x01, undecoded; which firmware line it
// runs comes free with every reply (bench finding #12).
const FIRMWARE_LINES = { thor: 'Thor line (version not read)', blastware: 'Blastware line (version not read)' };
function firmwareLabel(info) {
const i = info || {};
return i.firmware_version || i.firmware || FIRMWARE_LINES[(i.detail || {}).firmware_line] || '—';
}
// A failed device request's message. A 504 is a unit that took the connection
// but never answered: while THOR polls a Micromate, SFM's connection is accepted
// and gets 0 bytes (measured 2026-10-29, bench finding #16). The hint is left
// off once a change was sent -- its own message says what happened.
const NO_REPLY_HINT = 'the connection opened, so the modem is reachable — another program (THOR or '
+ "Blastware) may be holding this unit's line, or the unit is busy (e.g. its sensor check)";
function errorDetail(body, statusText) {
const b = body || {}, d = b.detail;
return b.outcome ? changeSummary(b) : typeof d === 'string' ? d : d ? (d.message || JSON.stringify(d)) : statusText;
}
function deviceErrorText(status, body, unit, statusText) {
const text = errorDetail(body, statusText);
return status === 504 && !(body || {}).sent && unit && unit.host ? `${text} — ${NO_REPLY_HINT}` : text;
}
// A change that went out (or may have) is not "failed": its body carries `sent`
// (ChangeUnconfirmed, bench finding #10), and its message says what the unit
// did and names the audit record. `label` is the whole name: "Start monitoring",
// "Enable call-home".
function changeErrorText(label, status, body, unit, statusText) {
if ((body || {}).sent) return `${label} not confirmed: ${errorDetail(body, statusText)}`;
return `${label} failed: ${deviceErrorText(status, body, unit, statusText)}`;
}
// By serial, settings are read-only until phase 5: no empty legacy edit form or
// legacy tables, and the settings box shows from the start (#6, #12).
function serialPanes(bySerial, settingsRead) {
return { configForm: !bySerial, settingsBox: bySerial, settingsPlaceholder: bySerial && !settingsRead,
legacyDeviceTables: !bySerial, callHomeForm: !bySerial, callHomeBox: bySerial };
}
// A unit's call-home switch, read by serial (phase 4). `enabled` null is an
// enable byte never measured -- shown with the byte, never as On or Off.
function callHomeRows(state) {
const s = state || {};
const d = s.detail || {};
const sw = s.enabled === true ? 'On' : s.enabled === false ? 'Off'
: d.reason || `Unknown (byte 5 = ${d.byte5 ?? '?'})`;
return [['Call-home', sw], ['Dial string', s.dial_string || '—'], ['Series', s.series]];
}
// ── The Config tab's edit form, by serial (phase 5) ──────────────────────────
// The fields the server says this unit can change, in its order, with their
// limits (UnitSettings.detail.editable).
function settingsFormFields(st) {
return (((st || {}).detail || {}).editable || []).map(f => ({ ...f }));
}
// Only what the operator changed, typed as the server expects. Numbers compare
// as numbers (0.30 is 0.3); a number that does not parse is left out (the
// preview shows exactly what would change); read-only fields never count.
function settingsChanges(fields, edited) {
const out = {};
const e = edited || {};
for (const f of fields || []) {
if (f.readonly || !(f.field in e)) continue;
let v = e[f.field];
if (f.kind === 'number' || (f.kind === 'choice' && typeof f.value === 'number')) {
if (v === '' || v == null) continue;
v = Number(v);
if (!Number.isFinite(v) || v === Number(f.value)) continue;
} else if (f.kind === 'bool') {
v = Boolean(v);
if (v === Boolean(f.value)) continue;
} else {
v = String(v);
if (v === String(f.value == null ? '' : f.value)) continue;
}
out[f.field] = v;
}
return out;
}
const _dash = v => (v == null || v === '' ? '—' : v);
// A preview (dry run): one row per field, [label, the unit holds, it would get].
function settingsPreviewRows(body) {
return Object.values(((body || {}).plan || {}).fields || {}).map(r => [r.label, _dash(r.old), _dash(r.new)]);
}
// Why a preview would not be sent ('' when nothing blocks it).
function settingsBlockedText(body) {
return (((body || {}).plan || {}).blocked || []).join('; ');
}
// After a send: [label, the unit held, SFM sent, the unit now holds].
function settingsResultRows(body) {
const fields = ((((body || {}).detail || {}).snapshot || {}).fields) || {};
return Object.values(fields).map(r => [r.label, _dash(r.old), _dash(r.new), _dash(r.now)]);
}
/* </device-routing> */
File diff suppressed because it is too large. Load diff
+18 -42
View File
@@ -38,7 +38,7 @@ from pathlib import Path
from typing import Optional, Union
from minimateplus import event_file_io
from minimateplus.blastware_file import blastware_file_bytes, blastware_filename, with_type_letter
from minimateplus.blastware_file import blastware_filename, write_blastware_file
from minimateplus.framing import S3Frame
from minimateplus.models import Event
from sfm import event_hdf5
@@ -46,19 +46,7 @@ from sfm.shape_metrics import shape_from_h5, offset_from_h5
log = logging.getLogger("sfm.waveform_store")
# 2 (2026-11-06, #58): frames as the parser gives them since an escaped checksum
# stopped leaving its 0x10 in `data`. A version-1 frame with a checksum of 02, 03
# or 04 still ends in that 0x10; load_a5 drops it (_frame_from_v1).
A5_PICKLE_VERSION = 2
def _frame_from_v1(f: S3Frame) -> S3Frame:
"""A frame pickled before #58, as the parser reads its reply now. Its 02/03/04
checksum arrived as `10 X` (every recorded one did), and the 10 ended `data`."""
if f.chk_byte in (0x02, 0x03, 0x04) and f.data[-1:] == b"\x10":
return S3Frame(sub=f.sub, page_hi=f.page_hi, page_lo=f.page_lo, data=f.data[:-1],
checksum_valid=f.checksum_valid, chk_byte=f.chk_byte)
return f
A5_PICKLE_VERSION = 1
def _frame_to_dict(f: S3Frame) -> dict:
@@ -87,7 +75,7 @@ class WaveformStore:
"""
Persistent store for Blastware-format waveform files + their A5 source frames.
Thread safety: the event file is written single-shot; concurrent saves of the
Thread safety: write_blastware_file is single-shot; concurrent saves of the
*same* filename would race, but the filename encodes second-resolution
timestamps + serial, so collisions across threads/processes are vanishingly
unlikely in practice.
@@ -196,8 +184,7 @@ class WaveformStore:
if not serial:
raise ValueError("WaveformStore.save: serial is required")
bw_bytes = blastware_file_bytes(ev, a5_frames)
filename = with_type_letter(blastware_filename(ev, serial), bw_bytes) # ...900 -> ...900H
filename = blastware_filename(ev, serial)
bw_path, a5_path = self.paths_for(serial, filename)
sidecar_path = self.sidecar_path_for(serial, filename)
hdf5_path = self.hdf5_path_for(serial, filename)
@@ -208,7 +195,7 @@ class WaveformStore:
bw_path.unlink()
except FileNotFoundError:
pass
bw_path.write_bytes(bw_bytes)
write_blastware_file(ev, a5_frames, bw_path)
filesize = bw_path.stat().st_size
sha256 = event_file_io.file_sha256(bw_path)
@@ -309,8 +296,6 @@ class WaveformStore:
*,
serial_hint: Optional[str] = None,
bw_report_text: Optional[Union[str, bytes]] = None,
source_kind: str = "bw-import",
geo_range: Optional[Union[str, int]] = None,
) -> tuple[Event, dict]:
"""
Ingest a Blastware event file produced by an external tool
@@ -330,8 +315,7 @@ class WaveformStore:
3. Resolve serial from BW filename (`<P><serial3>...`) or use
serial_hint. Falls back to "UNKNOWN".
4. Copy the BW bytes verbatim into <root>/<serial>/<filename>.
5. Write the .sfm.json sidecar with source.kind = `source_kind`
("bw-import"; "sfm-live" for SFM's own downloads)
5. Write the .sfm.json sidecar with source.kind = "bw-import"
and a5_pickle_filename = None. Does NOT write a .a5.pkl
(no A5 source available; byte-for-byte regeneration not
possible — the on-disk BW file IS the byte-for-byte source).
@@ -357,15 +341,14 @@ class WaveformStore:
exc,
)
# If we have a report, overlay its fields (peaks, project,
# sample_rate, record_time) onto the Event BEFORE handing it to
# db.insert_events(). The file decode reads these itself now (the
# decode checker compares it with Blastware's XML reports, DL2's
# 70,042 events); the overlay stays because production keeps a
# paired Blastware report as the record until the file-only decode
# has no blanks. The sidecar's `bw_report` block keeps the report's
# own values either way. (The old reason -- an undecoded codec
# giving ±10 in/s -- has not held since the 2026-08 codec fixes.)
# If we have a report, overlay its device-authoritative fields
# (peaks, project, sample_rate, record_time) onto the Event
# BEFORE handing it to db.insert_events(). Without this overlay
# the DB row gets `peak_values` from _peaks_from_samples(), which
# runs the still-undecoded waveform codec on the BW body and
# produces ±10 in/s saturation values on every channel for every
# event. The sidecar JSON had the correct values via
# event_to_sidecar_dict(bw_report=...) but the DB columns didn't.
if bw_report is not None:
try:
event_file_io.apply_report_to_event(ev, bw_report)
@@ -430,10 +413,7 @@ class WaveformStore:
event_hdf5.write_event_hdf5(
hdf5_path, ev,
serial=serial,
# None (an import): the event's own range, read from the file's
# setup (ev.geo_range), else Normal. An explicit value -- a live
# download's (event_ingest) -- wins.
geo_range=geo_range,
geo_range="normal", # BW file doesn't carry the range; assume Normal
source_kind="bw-import",
)
hdf5_filename = hdf5_path.name
@@ -458,7 +438,7 @@ class WaveformStore:
blastware_filename=filename,
blastware_filesize=filesize,
blastware_sha256=sha256,
source_kind=source_kind, # "sfm-live" for SFM's own downloads (event_ingest)
source_kind="bw-import",
a5_pickle_filename=None,
txt_filename=txt_filename,
review=existing_review,
@@ -813,8 +793,7 @@ class WaveformStore:
def load_a5(self, serial: str, filename: str) -> Optional[list[S3Frame]]:
"""
Re-hydrate the pickled A5 frame stream for a stored event, as the parser
reads it now (a version-1 pickle's frames are converted).
Re-hydrate the pickled A5 frame stream for a stored event.
Returns None if the sidecar is missing.
"""
_, a5_path = self.paths_for(serial, filename)
@@ -825,10 +804,7 @@ class WaveformStore:
if not isinstance(payload, dict) or "frames" not in payload:
log.warning("WaveformStore.load_a5: malformed sidecar at %s", a5_path)
return None
frames = [_dict_to_frame(d) for d in payload["frames"]]
if payload.get("version", 1) < 2:
frames = [_frame_from_v1(f) for f in frames]
return frames
return [_dict_to_frame(d) for d in payload["frames"]]
# ── modern .sfm.json sidecar accessors ──────────────────────────────────────
-471
View File
@@ -1,471 +0,0 @@
"""Fakes of both device clients for sfm.device_access tests.
They return the libraries' real dataclasses, and FakeMicromateClient's setup
is decoded from a real UM20147 read. `fail` is a queue of exceptions; each
call pops one, if any, and raises it.
"""
from __future__ import annotations
import copy
import datetime
import json
from pathlib import Path
from micromate.models import MicromateDeviceInfo, MicromateEventRef, MicromateState
from micromate.setup_block import decode_setup
from minimateplus.models import ComplianceConfig, DeviceInfo, Event, MonitorStatus, PeakValues, Timestamp
SETUP_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-setup" / "um20147_baseline.bin"
THOR_IDF = Path(__file__).parent / "fixtures" / "thor-idf"
PUSH_FIXTURE = Path(__file__).parent / "fixtures" / "micromate-writes" / "setup-push-overwrite-test1.json"
def s4_push_reads() -> dict:
"""UM12947's reads (content, by SUB) just before THOR's setup push: 0x08 prefs,
0x2E trigger, 0x1A setup, 0x41 active name."""
import json
ex = json.loads(PUSH_FIXTURE.read_text())["exchanges"]
start = next(i for i, e in enumerate(ex) if e["sub"] == 0xDA)
return {e["sub"]: bytes.fromhex(e["response_data"])[11:] for e in ex[:start]}
_S3_BLOCKS = None
def s3_settings_blocks() -> dict:
"""BE9441's four settings blocks on 2026-10-26, as SFM's reads return them:
the 1A read Blastware took right after its second write (assembled, 2,090 B),
and the event index / trigger / waveform blocks that write sent back (each a
write is the read plus two bytes)."""
global _S3_BLOCKS
if _S3_BLOCKS is None:
from minimateplus.framing import S3FrameParser
from minimateplus.protocol import assemble_compliance_content
from test_minimate_write_frames import WRITES, _payload
fix = Path(__file__).parent / "fixtures" / "minimate-bench-10-26-26-histogram"
reads, cur = [], None
for f in S3FrameParser().feed((fix / "unit_replies.bin").read_bytes()):
if f.sub != 0xE5:
continue
if len(f.data) == 11:
cur = []
reads.append(cur)
else:
cur.append(bytes(f.data))
sent = {_payload(f)[2]: _payload(f)[16:] for f in WRITES[13:26]}
_S3_BLOCKS = {"event_index": sent[0x68][:-2], "compliance": assemble_compliance_content(reads[2]),
"trigger": sent[0x82][:-2], "waveform": sent[0x69][:-2]}
return dict(_S3_BLOCKS)
def s3_device_info_answer(serial: bytes = b"BE9441") -> bytes:
"""What a MONITORING MiniMate returns for a 1A read, assembled: its device-info
block (BE9441 10-26: reads 3-7 start 0e 'BE9441'), 2,090 bytes."""
return (b"\x0e" + serial).ljust(2090, b"\x00")
def schedule_record(time_slot: int, action: int, setup: str = "") -> bytes:
"""One 260-byte schedule.dat record (micromate.schedule's layout)."""
rec = bytearray(260)
rec[4], rec[5], rec[6], rec[7] = time_slot, 3, action, len(setup)
rec[8:8 + len(setup)] = setup.encode("ascii")
return bytes(rec)
THOR_WRITES = Path(__file__).parent / "fixtures" / "micromate-writes"
def s3_call_home_raw(byte5: int = 0x01) -> bytes:
"""A MiniMate's 0x2C reply payload as S3FrameParser returns it (125 B, the
num_retries 3 kept as 10 03), laid out as the 4-20-26 captures measured
(BE11529): header 00 7C DC, [5] the enable, [6:46] the dial string."""
raw = b"\x00\x7c\xdc\x00\x00" + bytes([byte5]) + b"RADIO RING".ljust(40, b"\x00")
raw += bytes(117 - len(raw)) + b"\x10\x03"
return raw + bytes(125 - len(raw))
def um12947_call_home(enabled: bool = True) -> bytes:
"""UM12947's own 126-byte call-home content, as THOR read it (0x05 on, 0x04 off)."""
ex = json.loads((THOR_WRITES / "call-home-enable-disable.json").read_text())["exchanges"]
reads = [bytes.fromhex(e["response_data"])[11:] for e in ex if e["sub"] == 0x2C]
return next(r for r in reads if r[5] == (0x05 if enabled else 0x04))
from minimateplus.protocol import TimeoutError as mmp_TimeoutError # noqa: E402
class _Base:
def __init__(self, fail=None, open_error=None):
self.fail = list(fail or [])
self.open_error = open_error
self.calls: list[str] = []
self.opened = 0
self.closed = 0
self._open = False
def _step(self, name):
self.calls.append(name)
if self.fail:
raise self.fail.pop(0)
def open(self):
self.opened += 1
if self.open_error is not None:
raise self.open_error
self._open = True
def close(self):
self.closed += 1
self._open = False
def s3_event(index, key_hex, when, *, record_type="Waveform", pvs=0.12, frames=True):
ev = Event(index=index)
ev._waveform_key = bytes.fromhex(key_hex)
ev.timestamp = Timestamp(raw=b"", flag=0x10, year=when.year, unknown_byte=0,
month=when.month, day=when.day, hour=when.hour,
minute=when.minute, second=when.second)
ev.record_type = record_type
ev.peak_values = PeakValues(tran=0.05, vert=0.08, long=0.03, micl=0.0001,
peak_vector_sum=pvs)
if frames:
ev._a5_frames = ["frame"]
return ev
def _iso(ev):
"""minimateplus.client._event_timestamp_iso's format; "" with no timestamp."""
ts = ev.timestamp
if ts is None:
return ""
return datetime.datetime(ts.year, ts.month, ts.day, ts.hour or 0, ts.minute or 0,
ts.second or 0).isoformat()
def default_s3_events():
return [
s3_event(0, "01110000", datetime.datetime(2026, 10, 1, 8, 0, 0)),
s3_event(1, "0111245a", datetime.datetime(2026, 10, 2, 9, 30, 15)),
]
class FakeMiniMateClient(_Base):
def __init__(self, serial="BE18193", *, monitoring=False, compliance="default", events=None,
monitor_states=None, write_error=None, serial_reported=None, wake_errors=None,
bare_requests_ignored=False, call_home_raw=None, settings_blocks=None,
monitoring_settings=False, **kw):
super().__init__(**kw)
self.serial = serial
self.settings_blocks = s3_settings_blocks() if settings_blocks is None else dict(settings_blocks)
self.monitoring_settings = monitoring_settings
self.pushed = None
# As a monitoring MiniMate (measured 2026-04-08): on a fresh connection a
# read before SESSION_RESET + POLL goes unanswered. Off unless a test asks.
self.bare_requests_ignored = bare_requests_ignored
self._woken = False
self.call_home_raw = s3_call_home_raw() if call_home_raw is None else call_home_raw
# read_serial()'s answer (connect() keeps answering `serial`), and errors
# raised by wake() once a write has gone out -- the read-back's wakes.
self.serial_reported = serial if serial_reported is None else serial_reported
self.wake_errors = list(wake_errors or [])
self.monitoring = monitoring
self.monitor_states = list(monitor_states) if monitor_states else [monitoring]
self.write_error = write_error
self.writes: list = []
if compliance == "default":
compliance = ComplianceConfig(
recording_mode=0x01, sample_rate=1024, histogram_interval_sec=300,
record_time=3.0, trigger_level_geo=0.5, alarm_level_geo=1.0, geo_range=0,
setup_name="BRIDGE-A", project="Bridge job", client="Acme",
operator="BH", sensor_location="Loc 1", notes=None,
)
self.compliance = compliance
self.events = default_s3_events() if events is None else events
self.download_requests: list = [] # (key4, expected_timestamp) per download
self.last_download = None
def open(self):
super().open()
self._woken = False
def _bare_read(self, name):
self._step(name)
if self.bare_requests_ignored and not self._woken:
raise mmp_TimeoutError(f"{name}: no reply (the unit was not woken)")
def connect(self) -> DeviceInfo:
self._step("connect")
self._woken = True # connect() starts with the startup handshake
return DeviceInfo(
serial=self.serial, firmware_minor=17, firmware_version="S338.17",
dsp_version="10.72", manufacturer="Instantel", model="MiniMate Plus",
compliance_config=self.compliance,
)
def poll(self) -> None:
self._step("poll")
self._woken = True
def wake(self, **kw) -> None:
self._step("wake")
if self.writes and self.wake_errors:
raise self.wake_errors.pop(0)
self._woken = True
def read_serial(self) -> str:
self._bare_read("read_serial")
return self.serial_reported
def read_call_home_raw(self) -> bytes:
self._bare_read("read_call_home_raw")
return self.call_home_raw
def write_call_home_image(self, image: bytes) -> None:
self._write("call_home")
self.call_home_raw = bytes(image) # read back as the unit would store it
def read_compliance_content(self) -> bytes:
self._bare_read("read_compliance_content")
return s3_device_info_answer() if self.monitoring_settings else self.settings_blocks["compliance"]
def read_settings_blocks(self) -> dict:
self._bare_read("read_settings_blocks")
blocks = dict(self.settings_blocks)
if self.monitoring_settings:
blocks["compliance"] = s3_device_info_answer()
return blocks
def push_config_raw(self, event_index, compliance, trigger, waveform, *, escaped=False) -> None:
self.pushed_escaped = escaped
self.pushed = (bytes(event_index), bytes(compliance), bytes(trigger), bytes(waveform))
self._write("push_config_raw")
self.settings_blocks["compliance"] = bytes(compliance)[:2090] # read back as the unit stores it
def get_monitor_status(self) -> MonitorStatus:
self._bare_read("get_monitor_status")
state = self.monitor_states.pop(0) if len(self.monitor_states) > 1 else self.monitor_states[0]
# A bool is a measured state; an int (or None: a short section) is the raw 0x1C flag byte.
flag = (0x10 if state else 0x00) if isinstance(state, bool) else state
return MonitorStatus(
is_monitoring=flag == 0x10, battery_v=6.8,
memory_total=983026, memory_free=900000, state_flag=flag,
)
def _write(self, name):
self._step(name)
self.writes.append(name)
if self.write_error is not None:
raise self.write_error
def start_monitoring(self) -> None:
self._write("start_monitoring")
def stop_monitoring(self) -> None:
self._write("stop_monitoring")
def list_event_headers(self):
self._step("list_event_headers")
out = []
for ev in self.events:
h = copy.copy(ev)
h._a5_frames = None
out.append(h)
return out
def download_event_by_key(self, key4, *, expected_timestamp=None):
"""As the real walk: an event whose 0C time is not the expected one comes
back without its 5A."""
self._step("download_event_by_key")
self.download_requests.append((key4, expected_timestamp))
self.last_download = None
for ev in self.events:
if ev._waveform_key == key4:
if expected_timestamp is not None and _iso(ev) != expected_timestamp:
ev = copy.copy(ev)
ev._a5_frames = None
elif ev._a5_frames and isinstance(ev._a5_frames[0], str):
_as_downloaded(ev) # placeholder frames only; a test's real ones are kept
self.last_download = ev
return ev
return None
_REAL = {}
def _as_downloaded(ev):
"""Give a fake event what a real one-event download carries: BE9441 event 1's
recorded A5 frames, their decoded waveform, and the unit's own 0C peaks for it
-- so the download check sees a whole, matching event."""
if not _REAL:
from minimateplus.framing import S3FrameParser
from minimateplus.waveform_codec import decode_a5_frames
raw = (Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26"
/ "BE9441_event1_0111646a_rx.bin").read_bytes()
_REAL["frames"] = [f for f in S3FrameParser().feed(raw) if f.sub == 0xA5]
_REAL["samples"] = decode_a5_frames(_REAL["frames"])
ev._a5_frames = _REAL["frames"]
ev.raw_samples = _REAL["samples"]
pv = ev.peak_values
ev.peak_values = PeakValues(tran=0.030, vert=0.095, long=0.020, micl=pv.micl if pv else None,
peak_vector_sum=pv.peak_vector_sum if pv else None)
def s4_ref(index, key_hex, when, record_type, *, pvs=0.2):
"""Fixture-backed: the filename it produces names a real file in thor-idf/."""
ref = MicromateEventRef(index=index, key=bytes.fromhex(key_hex), size=0, serial="UM20147",
record_type=record_type, timestamp=when, peak_vector_sum_ips=pvs,
peaks_ips={"Tran": 0.1, "Vert": 0.15, "Long": 0.05, "Mic": 0.0002})
ref.size = (THOR_IDF / ref.filename).stat().st_size
return ref
def default_s4_refs():
return [
s4_ref(0, "055d4a81", datetime.datetime(2025, 5, 31, 13, 59, 1), "waveform"),
s4_ref(1, "055d4a83", datetime.datetime(2025, 3, 30, 7, 1, 10), "histogram"),
]
class _FakeProtocol:
def __init__(self, owner):
self._owner = owner
def poll(self):
self._owner._step("poll")
def execute(self, plan):
self._owner._step("execute")
self._owner.executed.append(plan)
if self._owner.execute_error is not None:
raise self._owner.execute_error
for st in plan.steps:
if st.sub == 0x7E: # the unit stores the block and moves [118:120] itself
old = self._owner.call_home
self._owner.call_home = bytes(st.data[:118]) + bytes(~b & 0xFF for b in old[118:120]) \
+ bytes(st.data[120:])
if st.sub == 0x71: # the unit stores the setup and computes its own CRC
from micromate.setup_block import with_crc
old = self._owner.setup
self._owner.setup = with_crc(old[:3] + bytes(st.data[3:2090]) + old[2090:2092])
return [type("Ack", (), {"sub": s.ack_sub, "data": bytes(11)})() for s in plan.steps]
def read_call_home_config(self):
self._owner._step("read_call_home_config")
return bytes(11) + self._owner.call_home
class FakeMicromateClient(_Base):
def __init__(self, serial="UM20147", *, monitoring=False, events=5,
unsolicited=b"", event_refs=None, run_states=None,
serial_reported=None, execute_error=None, call_home=None, setup=None,
prefs=None, trigger=None, active_name=None, schedule_body=None,
schedule_error=None, **kw):
super().__init__(**kw)
self.unit_serial = serial # not `serial`: that is the client's method
self.call_home = um12947_call_home() if call_home is None else call_home
push = s4_push_reads()
self.setup = SETUP_FIXTURE.read_bytes()[11:] if setup is None else setup
self.prefs = push[0x08] if prefs is None else prefs
self.trigger = push[0x2E] if trigger is None else trigger
self.active_name = (push[0x41].split(b"\x00")[0].decode("ascii")
if active_name is None else active_name)
self.schedule_body = bytes(524) if schedule_body is None else schedule_body
self.schedule_error = schedule_error
self.run_states = list(run_states) if run_states else [0x00]
self.serial_reported = serial if serial_reported is None else serial_reported
self.execute_error = execute_error
self.executed = []
self.monitoring = monitoring
self.events = events
self.unsolicited = unsolicited
self.protocol = _FakeProtocol(self)
self.event_refs = default_s4_refs() if event_refs is None else event_refs
self.cursor = None
self.fetched: list = []
def is_open(self) -> bool:
return self._open
def connect(self) -> MicromateDeviceInfo:
self._step("connect")
return MicromateDeviceInfo(
serial=self.unit_serial, manufacturer="Instantel", model="MM/ISEE/S",
firmware_line="thor", monitoring=self.monitoring, active_setup="test2.MMB",
)
def serial(self, *, refresh=False):
self._step("serial")
return self.serial_reported if refresh else self.unit_serial
def get_call_home_content(self) -> bytes:
self._step("get_call_home_content")
return self.call_home
def read_run_state(self):
from micromate.models import MicromateRunState
self._step("read_run_state")
code = self.run_states.pop(0) if len(self.run_states) > 1 else self.run_states[0]
names = {0x00: "idle", 0x02: "monitoring", 0x03: "calling_home"}
return MicromateRunState(code, names.get(code, f"unknown(0x{code:02X})"))
def get_state(self) -> MicromateState:
self._step("get_state")
return MicromateState(
monitoring=self.monitoring,
device_time=datetime.datetime(2026, 10, 20, 18, 7, 58),
battery_volts=3.8, memory_total_bytes=15_000_000, memory_free_bytes=14_799_296,
)
def get_event_count(self) -> int:
self._step("get_event_count")
return self.events
def get_setup(self):
self._step("get_setup")
return decode_setup(self.setup)
def get_setup_content(self) -> bytes:
self._step("get_setup_content")
return self.setup
def get_prefs_content(self) -> bytes:
self._step("get_prefs_content")
return self.prefs
def get_trigger_content(self) -> bytes:
self._step("get_trigger_content")
return self.trigger
def get_active_setup_raw(self) -> str:
self._step("get_active_setup_raw")
return self.active_name
def read_schedule(self) -> bytes:
self._step("read_schedule")
if self.schedule_error is not None:
raise self.schedule_error
return self.schedule_body
def read_unsolicited(self) -> bytes:
self._step("read_unsolicited")
data, self.unsolicited = self.unsolicited, b""
return data
def list_events(self, *, with_records=True):
self._step("list_events")
return list(self.event_refs)
def iter_events(self, *, with_records=True):
self._step("iter_events")
for ref in self.event_refs:
self.cursor = ref.index
yield ref
def fetch_event(self, ref, *, verify=True, tolerance=0.01, chunk_size=None):
self._step("fetch_event")
self.fetched.append((ref.key_hex, chunk_size))
return (THOR_IDF / ref.filename).read_bytes(), object()
@staticmethod
def decode_error(ref, result):
return None if ref.record_type == "histogram" else 0.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
-548
View File
@@ -1,548 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18003</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T003LCYV.JD0H</FileName>
<HistogramStartTime>18:04:25</HistogramStartTime>
<HistogramStartDate>2025-12-05</HistogramStartDate>
<HistogramStopTime>20:30:00</HistogramStopTime>
<HistogramStopDate>2025-12-05</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>145.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>7.0 Volts</BatteryLevel>
<Calibration>March 14, 2025 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>I-80-North Fork Bridges-I80 E. Abutment</Project>
<Client>Fay Company</Client>
<UserName>Terra-Mechanics, Inc - Harrison</UserName>
<Seis.Loc>Area 2 - Loc 3 - I-80 - East Abutment</Seis.Loc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>0.035</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>0.090</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>0.045</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>11</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>43</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>37</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>20:10:25</TranPeakTime>
<TranPeakDate>2025-12-05</TranPeakDate>
<VertPeakTime>19:09:25</VertPeakTime>
<VertPeakDate>2025-12-05</VertPeakDate>
<LongPeakTime>20:09:25</LongPeakTime>
<LongPeakDate>2025-12-05</LongPeakDate>
<PeakVectorSum>
<Value>0.099</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>19:09:25</PeakVectorSumTime>
<PeakVectorSumDate>2025-12-05</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>124.7</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>18:19:25</MicLTime>
<MicLDate>2025-12-05</MicLDate>
<MicLZCFreq>
<Value>2.4</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.7 Hz.</TranTestFreq>
<TranTestRatio>3.5</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.6 Hz.</VertTestFreq>
<VertTestRatio>3.1</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.4 Hz.</LongTestFreq>
<LongTestRatio>3.9</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>20.1 Hz.</MicLTestFreq>
<MicLTestAmplitude>767 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2025-12-05 18:04:24 - 2025-12-05 20:30:00 &quot;Event Recorded Timer Stop&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2025-12-05 18:05:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.070</Cell><Cell>23</Cell><Cell>0.030</Cell><Cell>17</Cell><Cell>0.075</Cell><Cell>0.003</Cell><Cell>121.5</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:06:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.6</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>47</Cell><Cell>0.074</Cell><Cell>0.003</Cell><Cell>119.1</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:07:25</Time>
<Row>
<Cell>0.020</Cell><Cell>14</Cell><Cell>0.080</Cell><Cell>34</Cell><Cell>0.030</Cell><Cell>34</Cell><Cell>0.084</Cell><Cell>0.002</Cell><Cell>118.3</Cell><Cell>3.6</Cell></Row>
<Time>2025-12-05 18:08:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.8</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>21</Cell><Cell>0.064</Cell><Cell>0.003</Cell><Cell>121.0</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:09:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.3</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.020</Cell><Cell>18</Cell><Cell>0.059</Cell><Cell>0.004</Cell><Cell>122.8</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 18:10:25</Time>
<Row>
<Cell>0.030</Cell><Cell>43</Cell><Cell>0.080</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>43</Cell><Cell>0.088</Cell><Cell>0.003</Cell><Cell>121.0</Cell><Cell>4.2</Cell></Row>
<Time>2025-12-05 18:11:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.085</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>47</Cell><Cell>0.092</Cell><Cell>0.003</Cell><Cell>119.8</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 18:12:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.2</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>20</Cell><Cell>0.061</Cell><Cell>0.003</Cell><Cell>119.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:13:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.5</Cell><Cell>0.055</Cell><Cell>73</Cell><Cell>0.025</Cell><Cell>37</Cell><Cell>0.062</Cell><Cell>0.002</Cell><Cell>117.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:14:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>43</Cell><Cell>0.072</Cell><Cell>0.004</Cell><Cell>121.8</Cell><Cell>18</Cell></Row>
<Time>2025-12-05 18:15:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.075</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.081</Cell><Cell>0.002</Cell><Cell>118.6</Cell><Cell>3.5</Cell></Row>
<Time>2025-12-05 18:16:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>120.0</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:17:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.065</Cell><Cell>0.003</Cell><Cell>119.9</Cell><Cell>2.6</Cell></Row>
<Time>2025-12-05 18:18:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.077</Cell><Cell>0.003</Cell><Cell>119.7</Cell><Cell>12</Cell></Row>
<Time>2025-12-05 18:19:25</Time>
<Row>
<Cell>0.025</Cell><Cell>28</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>34</Cell><Cell>0.073</Cell><Cell>0.005</Cell><Cell>124.7</Cell><Cell>2.4</Cell></Row>
<Time>2025-12-05 18:20:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.066</Cell><Cell>0.003</Cell><Cell>119.4</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:21:25</Time>
<Row>
<Cell>0.025</Cell><Cell>9.8</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>121.0</Cell><Cell>5.1</Cell></Row>
<Time>2025-12-05 18:22:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.075</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.079</Cell><Cell>0.003</Cell><Cell>119.0</Cell><Cell>2.5</Cell></Row>
<Time>2025-12-05 18:23:25</Time>
<Row>
<Cell>0.025</Cell><Cell>17</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.020</Cell><Cell>51</Cell><Cell>0.063</Cell><Cell>0.004</Cell><Cell>122.1</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 18:24:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.6</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.020</Cell><Cell>39</Cell><Cell>0.064</Cell><Cell>0.003</Cell><Cell>120.6</Cell><Cell>4.4</Cell></Row>
<Time>2025-12-05 18:25:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.5</Cell><Cell>0.075</Cell><Cell>37</Cell><Cell>0.030</Cell><Cell>30</Cell><Cell>0.082</Cell><Cell>0.002</Cell><Cell>118.2</Cell><Cell>5.0</Cell></Row>
<Time>2025-12-05 18:26:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.060</Cell><Cell>26</Cell><Cell>0.025</Cell><Cell>24</Cell><Cell>0.064</Cell><Cell>0.003</Cell><Cell>121.4</Cell><Cell>3.6</Cell></Row>
<Time>2025-12-05 18:27:25</Time>
<Row>
<Cell>0.025</Cell><Cell>21</Cell><Cell>0.080</Cell><Cell>37</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.084</Cell><Cell>0.003</Cell><Cell>120.1</Cell><Cell>3.4</Cell></Row>
<Time>2025-12-05 18:28:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.045</Cell><Cell>24</Cell><Cell>0.020</Cell><Cell>20</Cell><Cell>0.048</Cell><Cell>0.002</Cell><Cell>118.1</Cell><Cell>2.6</Cell></Row>
<Time>2025-12-05 18:29:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.060</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>23</Cell><Cell>0.065</Cell><Cell>0.003</Cell><Cell>120.1</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 18:30:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.3</Cell><Cell>0.045</Cell><Cell>22</Cell><Cell>0.020</Cell><Cell>30</Cell><Cell>0.051</Cell><Cell>0.002</Cell><Cell>115.9</Cell><Cell>2.6</Cell></Row>
<Time>2025-12-05 18:31:25</Time>
<Row>
<Cell>0.030</Cell><Cell>24</Cell><Cell>0.070</Cell><Cell>39</Cell><Cell>0.030</Cell><Cell>39</Cell><Cell>0.073</Cell><Cell>0.004</Cell><Cell>122.8</Cell><Cell>2.3</Cell></Row>
<Time>2025-12-05 18:32:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.4</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>120.9</Cell><Cell>3.1</Cell></Row>
<Time>2025-12-05 18:33:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.050</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>17</Cell><Cell>0.057</Cell><Cell>0.003</Cell><Cell>121.3</Cell><Cell>13</Cell></Row>
<Time>2025-12-05 18:34:25</Time>
<Row>
<Cell>0.020</Cell><Cell>22</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>30</Cell><Cell>0.066</Cell><Cell>0.004</Cell><Cell>122.0</Cell><Cell>3.0</Cell></Row>
<Time>2025-12-05 18:35:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.035</Cell><Cell>18</Cell><Cell>0.077</Cell><Cell>0.003</Cell><Cell>120.6</Cell><Cell>4.8</Cell></Row>
<Time>2025-12-05 18:36:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.1</Cell><Cell>0.045</Cell><Cell>22</Cell><Cell>0.020</Cell><Cell>30</Cell><Cell>0.051</Cell><Cell>0.002</Cell><Cell>116.7</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:37:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>120.2</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:38:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>23</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>119.3</Cell><Cell>2.3</Cell></Row>
<Time>2025-12-05 18:39:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.7</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.020</Cell><Cell>43</Cell><Cell>0.059</Cell><Cell>0.003</Cell><Cell>121.3</Cell><Cell>2.2</Cell></Row>
<Time>2025-12-05 18:40:25</Time>
<Row>
<Cell>0.020</Cell><Cell>19</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>37</Cell><Cell>0.068</Cell><Cell>0.004</Cell><Cell>123.1</Cell><Cell>11</Cell></Row>
<Time>2025-12-05 18:41:25</Time>
<Row>
<Cell>0.025</Cell><Cell>22</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>118.1</Cell><Cell>17</Cell></Row>
<Time>2025-12-05 18:42:25</Time>
<Row>
<Cell>0.025</Cell><Cell>27</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.062</Cell><Cell>0.002</Cell><Cell>118.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:43:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.3</Cell><Cell>0.060</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.065</Cell><Cell>0.002</Cell><Cell>116.9</Cell><Cell>6.3</Cell></Row>
<Time>2025-12-05 18:44:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.072</Cell><Cell>0.004</Cell><Cell>122.5</Cell><Cell>4.1</Cell></Row>
<Time>2025-12-05 18:45:25</Time>
<Row>
<Cell>0.020</Cell><Cell>2.6</Cell><Cell>0.060</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.066</Cell><Cell>0.004</Cell><Cell>122.0</Cell><Cell>5.7</Cell></Row>
<Time>2025-12-05 18:46:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.2</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>11</Cell><Cell>0.064</Cell><Cell>0.004</Cell><Cell>121.9</Cell><Cell>1.7</Cell></Row>
<Time>2025-12-05 18:47:25</Time>
<Row>
<Cell>0.025</Cell><Cell>14</Cell><Cell>0.070</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.076</Cell><Cell>0.004</Cell><Cell>122.1</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:48:25</Time>
<Row>
<Cell>0.025</Cell><Cell>34</Cell><Cell>0.070</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>18</Cell><Cell>0.076</Cell><Cell>0.003</Cell><Cell>120.1</Cell><Cell>15</Cell></Row>
<Time>2025-12-05 18:49:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.5</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>57</Cell><Cell>0.070</Cell><Cell>0.004</Cell><Cell>121.8</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:50:25</Time>
<Row>
<Cell>0.025</Cell><Cell>18</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>24</Cell><Cell>0.069</Cell><Cell>0.002</Cell><Cell>117.6</Cell><Cell>2.5</Cell></Row>
<Time>2025-12-05 18:51:25</Time>
<Row>
<Cell>0.025</Cell><Cell>10</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.070</Cell><Cell>0.004</Cell><Cell>122.0</Cell><Cell>2.5</Cell></Row>
<Time>2025-12-05 18:52:25</Time>
<Row>
<Cell>0.020</Cell><Cell>4.2</Cell><Cell>0.050</Cell><Cell>22</Cell><Cell>0.020</Cell><Cell>14</Cell><Cell>0.056</Cell><Cell>0.003</Cell><Cell>119.1</Cell><Cell>2.7</Cell></Row>
<Time>2025-12-05 18:53:25</Time>
<Row>
<Cell>0.020</Cell><Cell>1.9</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.020</Cell><Cell>34</Cell><Cell>0.059</Cell><Cell>0.004</Cell><Cell>122.1</Cell><Cell>4.3</Cell></Row>
<Time>2025-12-05 18:54:25</Time>
<Row>
<Cell>0.020</Cell><Cell>&lt;1.0</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>47</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>117.2</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 18:55:25</Time>
<Row>
<Cell>0.020</Cell><Cell>17</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>121.1</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:56:25</Time>
<Row>
<Cell>0.020</Cell><Cell>&lt;1.0</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>57</Cell><Cell>0.065</Cell><Cell>0.003</Cell><Cell>119.8</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 18:57:25</Time>
<Row>
<Cell>0.025</Cell><Cell>15</Cell><Cell>0.070</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.074</Cell><Cell>0.003</Cell><Cell>120.9</Cell><Cell>4.7</Cell></Row>
<Time>2025-12-05 18:58:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.9</Cell><Cell>0.050</Cell><Cell>22</Cell><Cell>0.020</Cell><Cell>28</Cell><Cell>0.051</Cell><Cell>0.002</Cell><Cell>117.1</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 18:59:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.077</Cell><Cell>0.002</Cell><Cell>117.4</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 19:00:25</Time>
<Row>
<Cell>0.025</Cell><Cell>27</Cell><Cell>0.055</Cell><Cell>85</Cell><Cell>0.030</Cell><Cell>17</Cell><Cell>0.058</Cell><Cell>0.003</Cell><Cell>120.2</Cell><Cell>1.8</Cell></Row>
<Time>2025-12-05 19:01:25</Time>
<Row>
<Cell>0.020</Cell><Cell>17</Cell><Cell>0.055</Cell><Cell>43</Cell><Cell>0.020</Cell><Cell>43</Cell><Cell>0.059</Cell><Cell>0.004</Cell><Cell>123.1</Cell><Cell>3.7</Cell></Row>
<Time>2025-12-05 19:02:25</Time>
<Row>
<Cell>0.020</Cell><Cell>&lt;1.0</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>120.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:03:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.6</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>119.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:04:25</Time>
<Row>
<Cell>0.030</Cell><Cell>17</Cell><Cell>0.085</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>57</Cell><Cell>0.092</Cell><Cell>0.004</Cell><Cell>122.8</Cell><Cell>2.2</Cell></Row>
<Time>2025-12-05 19:05:25</Time>
<Row>
<Cell>0.025</Cell><Cell>24</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.062</Cell><Cell>0.002</Cell><Cell>117.8</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:06:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.050</Cell><Cell>23</Cell><Cell>0.025</Cell><Cell>26</Cell><Cell>0.058</Cell><Cell>0.002</Cell><Cell>116.4</Cell><Cell>51</Cell></Row>
<Time>2025-12-05 19:07:25</Time>
<Row>
<Cell>0.025</Cell><Cell>14</Cell><Cell>0.055</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>26</Cell><Cell>0.059</Cell><Cell>0.003</Cell><Cell>119.0</Cell><Cell>2.2</Cell></Row>
<Time>2025-12-05 19:08:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.035</Cell><Cell>30</Cell><Cell>0.078</Cell><Cell>0.002</Cell><Cell>117.2</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 19:09:25</Time>
<Row>
<Cell>0.025</Cell><Cell>15</Cell><Cell>0.090</Cell><Cell>43</Cell><Cell>0.040</Cell><Cell>47</Cell><Cell>0.099</Cell><Cell>0.003</Cell><Cell>120.2</Cell><Cell>4.7</Cell></Row>
<Time>2025-12-05 19:10:25</Time>
<Row>
<Cell>0.025</Cell><Cell>17</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>119.6</Cell><Cell>3.6</Cell></Row>
<Time>2025-12-05 19:11:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.6</Cell><Cell>0.060</Cell><Cell>57</Cell><Cell>0.030</Cell><Cell>28</Cell><Cell>0.062</Cell><Cell>0.003</Cell><Cell>119.8</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:12:25</Time>
<Row>
<Cell>0.025</Cell><Cell>32</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.035</Cell><Cell>27</Cell><Cell>0.074</Cell><Cell>0.003</Cell><Cell>120.2</Cell><Cell>4.0</Cell></Row>
<Time>2025-12-05 19:13:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>24</Cell><Cell>0.069</Cell><Cell>0.003</Cell><Cell>119.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:14:25</Time>
<Row>
<Cell>0.020</Cell><Cell>16</Cell><Cell>0.040</Cell><Cell>24</Cell><Cell>0.020</Cell><Cell>22</Cell><Cell>0.047</Cell><Cell>0.002</Cell><Cell>117.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:15:25</Time>
<Row>
<Cell>0.020</Cell><Cell>19</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>116.7</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:16:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.070</Cell><Cell>39</Cell><Cell>0.035</Cell><Cell>51</Cell><Cell>0.080</Cell><Cell>0.004</Cell><Cell>121.9</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:17:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.080</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>27</Cell><Cell>0.087</Cell><Cell>0.003</Cell><Cell>119.7</Cell><Cell>2.7</Cell></Row>
<Time>2025-12-05 19:18:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.076</Cell><Cell>0.003</Cell><Cell>119.4</Cell><Cell>6.7</Cell></Row>
<Time>2025-12-05 19:19:25</Time>
<Row>
<Cell>0.030</Cell><Cell>20</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>121.6</Cell><Cell>4.7</Cell></Row>
<Time>2025-12-05 19:20:25</Time>
<Row>
<Cell>0.020</Cell><Cell>&lt;1.0</Cell><Cell>0.065</Cell><Cell>39</Cell><Cell>0.025</Cell><Cell>26</Cell><Cell>0.069</Cell><Cell>0.003</Cell><Cell>119.9</Cell><Cell>4.1</Cell></Row>
<Time>2025-12-05 19:21:25</Time>
<Row>
<Cell>0.025</Cell><Cell>4.7</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>22</Cell><Cell>0.065</Cell><Cell>0.002</Cell><Cell>117.9</Cell><Cell>1.5</Cell></Row>
<Time>2025-12-05 19:22:25</Time>
<Row>
<Cell>0.025</Cell><Cell>23</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>37</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>118.2</Cell><Cell>2.2</Cell></Row>
<Time>2025-12-05 19:23:25</Time>
<Row>
<Cell>0.020</Cell><Cell>16</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.071</Cell><Cell>0.003</Cell><Cell>120.0</Cell><Cell>2.9</Cell></Row>
<Time>2025-12-05 19:24:25</Time>
<Row>
<Cell>0.020</Cell><Cell>4.0</Cell><Cell>0.045</Cell><Cell>34</Cell><Cell>0.020</Cell><Cell>18</Cell><Cell>0.050</Cell><Cell>0.003</Cell><Cell>118.7</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:25:25</Time>
<Row>
<Cell>0.020</Cell><Cell>2.9</Cell><Cell>0.055</Cell><Cell>23</Cell><Cell>0.025</Cell><Cell>17</Cell><Cell>0.062</Cell><Cell>0.002</Cell><Cell>118.5</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:26:25</Time>
<Row>
<Cell>0.025</Cell><Cell>47</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.075</Cell><Cell>0.004</Cell><Cell>122.7</Cell><Cell>2.7</Cell></Row>
<Time>2025-12-05 19:27:25</Time>
<Row>
<Cell>0.025</Cell><Cell>9.7</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>28</Cell><Cell>0.074</Cell><Cell>0.003</Cell><Cell>121.1</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:28:25</Time>
<Row>
<Cell>0.025</Cell><Cell>57</Cell><Cell>0.090</Cell><Cell>47</Cell><Cell>0.040</Cell><Cell>51</Cell><Cell>0.097</Cell><Cell>0.003</Cell><Cell>121.3</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 19:29:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.050</Cell><Cell>22</Cell><Cell>0.020</Cell><Cell>34</Cell><Cell>0.056</Cell><Cell>0.002</Cell><Cell>114.8</Cell><Cell>2.3</Cell></Row>
<Time>2025-12-05 19:30:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>119.1</Cell><Cell>51</Cell></Row>
<Time>2025-12-05 19:31:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.055</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.061</Cell><Cell>0.004</Cell><Cell>122.0</Cell><Cell>2.6</Cell></Row>
<Time>2025-12-05 19:32:25</Time>
<Row>
<Cell>0.015</Cell><Cell>&lt;1.0</Cell><Cell>0.015</Cell><Cell>18</Cell><Cell>0.015</Cell><Cell>12</Cell><Cell>0.026</Cell><Cell>0.001</Cell><Cell>108.0</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:33:25</Time>
<Row>
<Cell>0.020</Cell><Cell>2.9</Cell><Cell>0.050</Cell><Cell>21</Cell><Cell>0.025</Cell><Cell>22</Cell><Cell>0.058</Cell><Cell>0.002</Cell><Cell>117.2</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:34:25</Time>
<Row>
<Cell>0.020</Cell><Cell>8.3</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>24</Cell><Cell>0.066</Cell><Cell>0.003</Cell><Cell>121.5</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 19:35:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.8</Cell><Cell>0.040</Cell><Cell>23</Cell><Cell>0.020</Cell><Cell>23</Cell><Cell>0.047</Cell><Cell>0.002</Cell><Cell>114.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:36:25</Time>
<Row>
<Cell>0.020</Cell><Cell>12</Cell><Cell>0.055</Cell><Cell>43</Cell><Cell>0.020</Cell><Cell>39</Cell><Cell>0.059</Cell><Cell>0.003</Cell><Cell>121.0</Cell><Cell>2.8</Cell></Row>
<Time>2025-12-05 19:37:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.055</Cell><Cell>22</Cell><Cell>0.030</Cell><Cell>20</Cell><Cell>0.066</Cell><Cell>0.002</Cell><Cell>117.6</Cell><Cell>3.1</Cell></Row>
<Time>2025-12-05 19:38:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.3</Cell><Cell>0.050</Cell><Cell>39</Cell><Cell>0.020</Cell><Cell>32</Cell><Cell>0.056</Cell><Cell>0.004</Cell><Cell>122.2</Cell><Cell>2.5</Cell></Row>
<Time>2025-12-05 19:39:25</Time>
<Row>
<Cell>0.030</Cell><Cell>23</Cell><Cell>0.070</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>47</Cell><Cell>0.077</Cell><Cell>0.003</Cell><Cell>120.3</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:40:25</Time>
<Row>
<Cell>0.025</Cell><Cell>18</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>51</Cell><Cell>0.070</Cell><Cell>0.004</Cell><Cell>121.8</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:41:25</Time>
<Row>
<Cell>0.020</Cell><Cell>32</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>17</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>120.1</Cell><Cell>14</Cell></Row>
<Time>2025-12-05 19:42:25</Time>
<Row>
<Cell>0.025</Cell><Cell>17</Cell><Cell>0.060</Cell><Cell>26</Cell><Cell>0.025</Cell><Cell>23</Cell><Cell>0.065</Cell><Cell>0.002</Cell><Cell>116.1</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:43:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.060</Cell><Cell>23</Cell><Cell>0.030</Cell><Cell>24</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>116.9</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:44:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.075</Cell><Cell>47</Cell><Cell>0.035</Cell><Cell>51</Cell><Cell>0.081</Cell><Cell>0.003</Cell><Cell>121.5</Cell><Cell>6.0</Cell></Row>
<Time>2025-12-05 19:45:25</Time>
<Row>
<Cell>0.025</Cell><Cell>18</Cell><Cell>0.050</Cell><Cell>21</Cell><Cell>0.025</Cell><Cell>22</Cell><Cell>0.056</Cell><Cell>0.002</Cell><Cell>117.2</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:46:25</Time>
<Row>
<Cell>0.025</Cell><Cell>22</Cell><Cell>0.055</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>18</Cell><Cell>0.059</Cell><Cell>0.003</Cell><Cell>119.6</Cell><Cell>3.0</Cell></Row>
<Time>2025-12-05 19:47:25</Time>
<Row>
<Cell>0.020</Cell><Cell>&lt;1.0</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.077</Cell><Cell>0.002</Cell><Cell>118.3</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:48:25</Time>
<Row>
<Cell>0.020</Cell><Cell>8.1</Cell><Cell>0.030</Cell><Cell>39</Cell><Cell>0.020</Cell><Cell>23</Cell><Cell>0.037</Cell><Cell>0.002</Cell><Cell>116.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:49:25</Time>
<Row>
<Cell>0.025</Cell><Cell>17</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>24</Cell><Cell>0.074</Cell><Cell>0.002</Cell><Cell>118.6</Cell><Cell>3.3</Cell></Row>
<Time>2025-12-05 19:50:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.2</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>118.8</Cell><Cell>2.6</Cell></Row>
<Time>2025-12-05 19:51:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.035</Cell><Cell>21</Cell><Cell>0.020</Cell><Cell>20</Cell><Cell>0.041</Cell><Cell>0.001</Cell><Cell>112.8</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:52:25</Time>
<Row>
<Cell>0.025</Cell><Cell>14</Cell><Cell>0.075</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.081</Cell><Cell>0.004</Cell><Cell>121.7</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 19:53:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>37</Cell><Cell>0.072</Cell><Cell>0.004</Cell><Cell>121.9</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:54:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>47</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>120.6</Cell><Cell>15</Cell></Row>
<Time>2025-12-05 19:55:25</Time>
<Row>
<Cell>0.025</Cell><Cell>22</Cell><Cell>0.060</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.065</Cell><Cell>0.003</Cell><Cell>120.7</Cell><Cell>2.0</Cell></Row>
<Time>2025-12-05 19:56:25</Time>
<Row>
<Cell>0.025</Cell><Cell>21</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>37</Cell><Cell>0.066</Cell><Cell>0.003</Cell><Cell>121.1</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 19:57:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.6</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>47</Cell><Cell>0.072</Cell><Cell>0.004</Cell><Cell>121.9</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:58:25</Time>
<Row>
<Cell>0.030</Cell><Cell>18</Cell><Cell>0.075</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.079</Cell><Cell>0.003</Cell><Cell>121.5</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 19:59:25</Time>
<Row>
<Cell>0.025</Cell><Cell>12</Cell><Cell>0.075</Cell><Cell>43</Cell><Cell>0.035</Cell><Cell>30</Cell><Cell>0.081</Cell><Cell>0.003</Cell><Cell>119.4</Cell><Cell>1.8</Cell></Row>
<Time>2025-12-05 20:00:25</Time>
<Row>
<Cell>0.025</Cell><Cell>20</Cell><Cell>0.050</Cell><Cell>22</Cell><Cell>0.025</Cell><Cell>23</Cell><Cell>0.057</Cell><Cell>0.002</Cell><Cell>115.0</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:01:25</Time>
<Row>
<Cell>0.025</Cell><Cell>11</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>18</Cell><Cell>0.066</Cell><Cell>0.003</Cell><Cell>119.1</Cell><Cell>2.4</Cell></Row>
<Time>2025-12-05 20:02:25</Time>
<Row>
<Cell>0.025</Cell><Cell>22</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>39</Cell><Cell>0.073</Cell><Cell>0.003</Cell><Cell>119.0</Cell><Cell>2.4</Cell></Row>
<Time>2025-12-05 20:03:25</Time>
<Row>
<Cell>0.025</Cell><Cell>15</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>43</Cell><Cell>0.076</Cell><Cell>0.003</Cell><Cell>119.7</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 20:04:25</Time>
<Row>
<Cell>0.025</Cell><Cell>16</Cell><Cell>0.050</Cell><Cell>34</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.055</Cell><Cell>0.002</Cell><Cell>115.9</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:05:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.2</Cell><Cell>0.045</Cell><Cell>34</Cell><Cell>0.020</Cell><Cell>30</Cell><Cell>0.049</Cell><Cell>0.002</Cell><Cell>117.6</Cell><Cell>2.3</Cell></Row>
<Time>2025-12-05 20:06:25</Time>
<Row>
<Cell>0.025</Cell><Cell>27</Cell><Cell>0.055</Cell><Cell>24</Cell><Cell>0.025</Cell><Cell>16</Cell><Cell>0.061</Cell><Cell>0.002</Cell><Cell>115.4</Cell><Cell>4.9</Cell></Row>
<Time>2025-12-05 20:07:25</Time>
<Row>
<Cell>0.025</Cell><Cell>3.5</Cell><Cell>0.090</Cell><Cell>47</Cell><Cell>0.040</Cell><Cell>57</Cell><Cell>0.097</Cell><Cell>0.004</Cell><Cell>123.1</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 20:08:25</Time>
<Row>
<Cell>0.025</Cell><Cell>17</Cell><Cell>0.060</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>51</Cell><Cell>0.066</Cell><Cell>0.003</Cell><Cell>119.9</Cell><Cell>2.3</Cell></Row>
<Time>2025-12-05 20:09:25</Time>
<Row>
<Cell>0.025</Cell><Cell>32</Cell><Cell>0.090</Cell><Cell>43</Cell><Cell>0.045</Cell><Cell>37</Cell><Cell>0.098</Cell><Cell>0.002</Cell><Cell>118.6</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 20:10:25</Time>
<Row>
<Cell>0.035</Cell><Cell>11</Cell><Cell>0.070</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.077</Cell><Cell>0.003</Cell><Cell>120.3</Cell><Cell>3.7</Cell></Row>
<Time>2025-12-05 20:11:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>20</Cell><Cell>0.070</Cell><Cell>0.002</Cell><Cell>117.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:12:25</Time>
<Row>
<Cell>0.020</Cell><Cell>5.3</Cell><Cell>0.050</Cell><Cell>24</Cell><Cell>0.025</Cell><Cell>26</Cell><Cell>0.059</Cell><Cell>0.002</Cell><Cell>118.2</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:13:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.055</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.061</Cell><Cell>0.002</Cell><Cell>117.1</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:14:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.060</Cell><Cell>47</Cell><Cell>0.025</Cell><Cell>51</Cell><Cell>0.064</Cell><Cell>0.002</Cell><Cell>118.3</Cell><Cell>4.0</Cell></Row>
<Time>2025-12-05 20:15:25</Time>
<Row>
<Cell>0.020</Cell><Cell>12</Cell><Cell>0.035</Cell><Cell>24</Cell><Cell>0.020</Cell><Cell>19</Cell><Cell>0.043</Cell><Cell>0.002</Cell><Cell>115.7</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:16:25</Time>
<Row>
<Cell>0.020</Cell><Cell>10</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>51</Cell><Cell>0.072</Cell><Cell>0.002</Cell><Cell>117.8</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:17:25</Time>
<Row>
<Cell>0.025</Cell><Cell>32</Cell><Cell>0.065</Cell><Cell>43</Cell><Cell>0.025</Cell><Cell>43</Cell><Cell>0.069</Cell><Cell>0.004</Cell><Cell>123.3</Cell><Cell>2.1</Cell></Row>
<Time>2025-12-05 20:18:25</Time>
<Row>
<Cell>0.020</Cell><Cell>13</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>37</Cell><Cell>0.070</Cell><Cell>0.003</Cell><Cell>119.6</Cell><Cell>4.1</Cell></Row>
<Time>2025-12-05 20:19:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.8</Cell><Cell>0.055</Cell><Cell>23</Cell><Cell>0.025</Cell><Cell>24</Cell><Cell>0.062</Cell><Cell>0.003</Cell><Cell>120.0</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:20:25</Time>
<Row>
<Cell>0.020</Cell><Cell>7.2</Cell><Cell>0.050</Cell><Cell>39</Cell><Cell>0.025</Cell><Cell>39</Cell><Cell>0.057</Cell><Cell>0.002</Cell><Cell>117.8</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:21:25</Time>
<Row>
<Cell>0.020</Cell><Cell>3.2</Cell><Cell>0.050</Cell><Cell>23</Cell><Cell>0.025</Cell><Cell>26</Cell><Cell>0.059</Cell><Cell>0.002</Cell><Cell>116.6</Cell><Cell>2.5</Cell></Row>
<Time>2025-12-05 20:22:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.2</Cell><Cell>0.055</Cell><Cell>23</Cell><Cell>0.025</Cell><Cell>37</Cell><Cell>0.062</Cell><Cell>0.002</Cell><Cell>118.3</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:23:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.065</Cell><Cell>47</Cell><Cell>0.030</Cell><Cell>24</Cell><Cell>0.072</Cell><Cell>0.003</Cell><Cell>120.2</Cell><Cell>1.8</Cell></Row>
<Time>2025-12-05 20:24:25</Time>
<Row>
<Cell>0.025</Cell><Cell>18</Cell><Cell>0.050</Cell><Cell>32</Cell><Cell>0.025</Cell><Cell>34</Cell><Cell>0.057</Cell><Cell>0.002</Cell><Cell>116.9</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:25:25</Time>
<Row>
<Cell>0.025</Cell><Cell>13</Cell><Cell>0.080</Cell><Cell>47</Cell><Cell>0.035</Cell><Cell>51</Cell><Cell>0.087</Cell><Cell>0.002</Cell><Cell>118.5</Cell><Cell>1.9</Cell></Row>
<Time>2025-12-05 20:26:25</Time>
<Row>
<Cell>0.020</Cell><Cell>6.6</Cell><Cell>0.040</Cell><Cell>23</Cell><Cell>0.020</Cell><Cell>30</Cell><Cell>0.046</Cell><Cell>0.002</Cell><Cell>117.6</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:27:25</Time>
<Row>
<Cell>0.020</Cell><Cell>17</Cell><Cell>0.040</Cell><Cell>21</Cell><Cell>0.020</Cell><Cell>23</Cell><Cell>0.047</Cell><Cell>0.002</Cell><Cell>115.2</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:28:25</Time>
<Row>
<Cell>0.025</Cell><Cell>18</Cell><Cell>0.090</Cell><Cell>73</Cell><Cell>0.040</Cell><Cell>51</Cell><Cell>0.093</Cell><Cell>0.003</Cell><Cell>119.3</Cell><Cell>&gt;100</Cell></Row>
<Time>2025-12-05 20:29:25</Time>
<Row>
<Cell>0.025</Cell><Cell>28</Cell><Cell>0.075</Cell><Cell>43</Cell><Cell>0.030</Cell><Cell>57</Cell><Cell>0.081</Cell><Cell>0.004</Cell><Cell>122.2</Cell><Cell>2.2</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
-167
View File
@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE11010</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>M010HR6K.OA0H</FileName>
<HistogramStartTime>17:02:34</HistogramStartTime>
<HistogramStartDate>2019-01-08</HistogramStartDate>
<HistogramStopTime>17:20:00</HistogramStopTime>
<HistogramStopDate>2019-01-08</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>18.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.8 Volts</BatteryLevel>
<Calibration>December 17, 2018 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>Wampum Ave-ECMS 29301-215 Joseph St</Project>
<Client>Brayman Construction</Client>
<UserName>Terra-Mechanics Inc - D. Bartholomae</UserName>
<Seis.Loc>Loc, #1 - 215 Joseph Street</Seis.Loc>
<GeoRange>
<Value>1.250</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>0.008</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>0.009</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>0.005</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>11</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>73</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>16</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>17:11:34</TranPeakTime>
<TranPeakDate>2019-01-08</TranPeakDate>
<VertPeakTime>17:03:34</VertPeakTime>
<VertPeakDate>2019-01-08</VertPeakDate>
<LongPeakTime>17:11:34</LongPeakTime>
<LongPeakDate>2019-01-08</LongPeakDate>
<PeakVectorSum>
<Value>0.009</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>17:11:34</PeakVectorSumTime>
<PeakVectorSumDate>2019-01-08</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>134.1</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>17:03:34</MicLTime>
<MicLDate>2019-01-08</MicLDate>
<MicLZCFreq>
<Value>9.7</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.2 Hz.</TranTestFreq>
<TranTestRatio>4.3</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.6 Hz.</VertTestFreq>
<VertTestRatio>3.4</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.2 Hz.</LongTestFreq>
<LongTestRatio>3.8</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>20.1 Hz.</MicLTestFreq>
<MicLTestAmplitude>583 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2019-01-08 17:02:33 - 2019-01-08 17:20:00 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2019-01-08 17:03:34</Time>
<Row>
<Cell>0.003</Cell><Cell>47</Cell><Cell>0.009</Cell><Cell>73</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.015</Cell><Cell>134.1</Cell><Cell>9.7</Cell></Row>
<Time>2019-01-08 17:04:34</Time>
<Row>
<Cell>0.003</Cell><Cell>21</Cell><Cell>0.007</Cell><Cell>27</Cell><Cell>0.002</Cell><Cell>85</Cell><Cell>0.007</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:05:34</Time>
<Row>
<Cell>0.004</Cell><Cell>20</Cell><Cell>0.004</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>0.003</Cell><Cell>119.1</Cell><Cell>7.5</Cell></Row>
<Time>2019-01-08 17:06:34</Time>
<Row>
<Cell>0.003</Cell><Cell>34</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>51</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>81.94</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:07:34</Time>
<Row>
<Cell>0.003</Cell><Cell>51</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>39</Cell></Row>
<Time>2019-01-08 17:08:34</Time>
<Row>
<Cell>0.004</Cell><Cell>12</Cell><Cell>0.004</Cell><Cell>16</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>13</Cell></Row>
<Time>2019-01-08 17:09:34</Time>
<Row>
<Cell>0.002</Cell><Cell>51</Cell><Cell>0.002</Cell><Cell>64</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>81.94</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:10:34</Time>
<Row>
<Cell>0.003</Cell><Cell>12</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.004</Cell><Cell>0.000</Cell><Cell>81.94</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:11:34</Time>
<Row>
<Cell>0.008</Cell><Cell>11</Cell><Cell>0.005</Cell><Cell>13</Cell><Cell>0.005</Cell><Cell>16</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>19</Cell></Row>
<Time>2019-01-08 17:12:34</Time>
<Row>
<Cell>0.006</Cell><Cell>13</Cell><Cell>0.004</Cell><Cell>14</Cell><Cell>0.004</Cell><Cell>51</Cell><Cell>0.007</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>20</Cell></Row>
<Time>2019-01-08 17:13:34</Time>
<Row>
<Cell>0.003</Cell><Cell>57</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:14:34</Time>
<Row>
<Cell>0.003</Cell><Cell>47</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>13</Cell></Row>
<Time>2019-01-08 17:15:34</Time>
<Row>
<Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.004</Cell><Cell>0.000</Cell><Cell>95.92</Cell><Cell>2.5</Cell></Row>
<Time>2019-01-08 17:16:34</Time>
<Row>
<Cell>0.003</Cell><Cell>13</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>85</Cell><Cell>0.004</Cell><Cell>0.000</Cell><Cell>93.98</Cell><Cell>9.1</Cell></Row>
<Time>2019-01-08 17:17:34</Time>
<Row>
<Cell>0.003</Cell><Cell>17</Cell><Cell>0.002</Cell><Cell>85</Cell><Cell>0.002</Cell><Cell>73</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>81.94</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:18:34</Time>
<Row>
<Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.004</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
<Time>2019-01-08 17:19:34</Time>
<Row>
<Cell>0.003</Cell><Cell>73</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>20</Cell><Cell>0.004</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>6.1</Cell></Row>
<Time>2019-01-08 17:20:00</Time>
<Row>
<Cell>0.002</Cell><Cell>37</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.002</Cell><Cell>&gt;100</Cell><Cell>0.003</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>18</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
@@ -1,137 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE9440</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>K440HA3C.JM0H</FileName>
<HistogramStartTime>11:42:58</HistogramStartTime>
<HistogramStartDate>2018-02-10</HistogramStartDate>
<HistogramStopTime>11:43:34</HistogramStopTime>
<HistogramStopDate>2018-02-10</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>8.00</NumberofIntervals>
<IntervalSize>5 seconds</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.8 Volts</BatteryLevel>
<Calibration>January 11, 2018 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>Villanova Stadium Station - Seis. Loc #2</Project>
<Client>D&apos;Angleo Brothers, Inc</Client>
<UserName>Terra-Mechanics, Inc - D Harrison</UserName>
<Seis.Location>Loc # 2 - OutBound Track</Seis.Location>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>0.390</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>2.645</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>0.095</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>85</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>73</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>43</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>11:43:33</TranPeakTime>
<TranPeakDate>2018-02-10</TranPeakDate>
<VertPeakTime>11:43:33</VertPeakTime>
<VertPeakDate>2018-02-10</VertPeakDate>
<LongPeakTime>11:43:33</LongPeakTime>
<LongPeakDate>2018-02-10</LongPeakDate>
<PeakVectorSum>
<Value>2.656</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>11:43:33</PeakVectorSumTime>
<PeakVectorSumDate>2018-02-10</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>126.4</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>11:43:18</MicLTime>
<MicLDate>2018-02-10</MicLDate>
<MicLZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.2 Hz.</TranTestFreq>
<TranTestRatio>4.3</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.5 Hz.</VertTestFreq>
<VertTestRatio>3.7</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.4 Hz.</LongTestFreq>
<LongTestRatio>4.1</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>19.7 Hz.</MicLTestFreq>
<MicLTestAmplitude>634 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2018-02-10 11:42:57 - 2018-02-10 11:43:34 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2018-02-10 11:43:03</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>N/A</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>34</Cell></Row>
<Time>2018-02-10 11:43:08</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>100.0</Cell><Cell>&gt;100</Cell></Row>
<Time>2018-02-10 11:43:13</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
<Time>2018-02-10 11:43:18</Time>
<Row>
<Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.015</Cell><Cell>&gt;100</Cell><Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.016</Cell><Cell>0.006</Cell><Cell>126.4</Cell><Cell>&gt;100</Cell></Row>
<Time>2018-02-10 11:43:23</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.004</Cell><Cell>122.0</Cell><Cell>43</Cell></Row>
<Time>2018-02-10 11:43:28</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.011</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
<Time>2018-02-10 11:43:33</Time>
<Row>
<Cell>0.390</Cell><Cell>85</Cell><Cell>2.645</Cell><Cell>73</Cell><Cell>0.095</Cell><Cell>43</Cell><Cell>2.656</Cell><Cell>0.000</Cell><Cell>93.98</Cell><Cell>&gt;100</Cell></Row>
<Time>2018-02-10 11:43:34</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.007</Cell><Cell>0.000</Cell><Cell>87.96</Cell><Cell>&gt;100</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
Binary file not shown.
@@ -1,140 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18193</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T193KR5M.X90H</FileName>
<HistogramStartTime>17:22:21</HistogramStartTime>
<HistogramStartDate>2024-10-07</HistogramStartDate>
<HistogramStopTime>17:22:38</HistogramStopTime>
<HistogramStopDate>2024-10-07</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>9.00</NumberofIntervals>
<IntervalSize>2 seconds</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.3 Volts</BatteryLevel>
<Calibration>July 10, 2024 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>I-80- North Fork Bridges-543 Plank Rd</Project>
<Client>Fay Company</Client>
<UserName>Terra-Mechanics Inc - Harrison</UserName>
<Seis.Loc>Loc #1 -Main Line- Area 2 - 543 Plank Rd</Seis.Loc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>2.290</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>5.515</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>1.520</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>11</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>34</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>18</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>17:22:37</TranPeakTime>
<TranPeakDate>2024-10-07</TranPeakDate>
<VertPeakTime>17:22:37</VertPeakTime>
<VertPeakDate>2024-10-07</VertPeakDate>
<LongPeakTime>17:22:37</LongPeakTime>
<LongPeakDate>2024-10-07</LongPeakDate>
<PeakVectorSum>
<Value>5.818</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>17:22:37</PeakVectorSumTime>
<PeakVectorSumDate>2024-10-07</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>108.0</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>17:22:37</MicLTime>
<MicLDate>2024-10-07</MicLDate>
<MicLZCFreq>
<Value>57</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.6 Hz.</TranTestFreq>
<TranTestRatio>3.7</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.7 Hz.</VertTestFreq>
<VertTestRatio>3.5</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.5 Hz.</LongTestFreq>
<LongTestRatio>3.6</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>0.0 Hz.</MicLTestFreq>
<MicLTestAmplitude>0 mv</MicLTestAmplitude>
<MicLTestResults>Check</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2024-10-07 17:22:20 - 2024-10-07 17:22:38 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2024-10-07 17:22:23</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.011</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:25</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:27</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:29</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:31</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:33</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.009</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>73</Cell></Row>
<Time>2024-10-07 17:22:35</Time>
<Row>
<Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.011</Cell><Cell>0.000</Cell><Cell>104.2</Cell><Cell>64</Cell></Row>
<Time>2024-10-07 17:22:37</Time>
<Row>
<Cell>2.290</Cell><Cell>11</Cell><Cell>5.515</Cell><Cell>34</Cell><Cell>1.520</Cell><Cell>18</Cell><Cell>5.818</Cell><Cell>0.001</Cell><Cell>108.0</Cell><Cell>57</Cell></Row>
<Time>2024-10-07 17:22:38</Time>
<Row>
<Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.020</Cell><Cell>2.9</Cell><Cell>0.005</Cell><Cell>&gt;100</Cell><Cell>0.022</Cell><Cell>0.001</Cell><Cell>104.9</Cell><Cell>64</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18190</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T190LD42.T00H</FileName>
<HistogramStartTime>13:29:24</HistogramStartTime>
<HistogramStartDate>2025-12-08</HistogramStartDate>
<HistogramStopTime>13:29:37</HistogramStopTime>
<HistogramStopDate>2025-12-08</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>1.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>2048 sps</SampleRate>
<BatteryLevel>6.7 Volts</BatteryLevel>
<Calibration>June 13, 2025 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>I-80-North Fork-Area 3-462Richardsvilel</Project>
<Client>Fay Company</Client>
<UserName>Terra-Mechanics Inc.- Harrison</UserName>
<SeisLoc>Loc #8 - Area 3- 462 Richardsville Road</SeisLoc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>1.280</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>2.615</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>1.120</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>15.5</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>64</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>17.7</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>13:29:37</TranPeakTime>
<TranPeakDate>2025-12-08</TranPeakDate>
<VertPeakTime>13:29:37</VertPeakTime>
<VertPeakDate>2025-12-08</VertPeakDate>
<LongPeakTime>13:29:37</LongPeakTime>
<LongPeakDate>2025-12-08</LongPeakDate>
<PeakVectorSum>
<Value>2.644</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>13:29:37</PeakVectorSumTime>
<PeakVectorSumDate>2025-12-08</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>107.0</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>13:29:37</MicLTime>
<MicLDate>2025-12-08</MicLDate>
<MicLZCFreq>
<Value>51</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.4 Hz.</TranTestFreq>
<TranTestRatio>4.2</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.6 Hz.</VertTestFreq>
<VertTestRatio>3.4</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.3 Hz.</LongTestFreq>
<LongTestRatio>3.7</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>0.0 Hz.</MicLTestFreq>
<MicLTestAmplitude>0 mv</MicLTestAmplitude>
<MicLTestResults>Check</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2025-12-08 13:29:23 - 2025-12-08 13:29:37 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2025-12-08 13:29:37</Time>
<Row>
<Cell>1.280</Cell><Cell>15.5</Cell><Cell>2.615</Cell><Cell>64</Cell><Cell>1.120</Cell><Cell>17.7</Cell><Cell>2.644</Cell><Cell>0.001</Cell><Cell>107.0</Cell><Cell>51</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18190</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T190LD5Q.LD0H</FileName>
<HistogramStartTime>11:00:49</HistogramStartTime>
<HistogramStartDate>2025-12-09</HistogramStartDate>
<HistogramStopTime>11:00:59</HistogramStopTime>
<HistogramStopDate>2025-12-09</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>1.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.9 Volts</BatteryLevel>
<Calibration>June 13, 2025 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>I-80-North Fork-Area 3-462Richardsvilel</Project>
<Client>Fay Company</Client>
<UserName>Terra-Mechanics Inc.- Harrison</UserName>
<SeisLoc>Loc #8 - Area 3- 462 Richardsville Road</SeisLoc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>2.140</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>OORANGE</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>2.830</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>85</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>34</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>11:00:59</TranPeakTime>
<TranPeakDate>2025-12-09</TranPeakDate>
<VertPeakTime>11:00:59</VertPeakTime>
<VertPeakDate>2025-12-09</VertPeakDate>
<LongPeakTime>11:00:59</LongPeakTime>
<LongPeakDate>2025-12-09</LongPeakDate>
<PeakVectorSum>
<Value>OORANGE</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>11:00:59</PeakVectorSumTime>
<PeakVectorSumDate>2025-12-09</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>106.0</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>11:00:59</MicLTime>
<MicLDate>2025-12-09</MicLDate>
<MicLZCFreq>
<Value>85</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.4 Hz.</TranTestFreq>
<TranTestRatio>4.4</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.6 Hz.</VertTestFreq>
<VertTestRatio>3.5</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.3 Hz.</LongTestFreq>
<LongTestRatio>3.9</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>20.5 Hz.</MicLTestFreq>
<MicLTestAmplitude>691 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2025-12-09 11:00:48 - 2025-12-09 11:00:59 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2025-12-09 11:00:59</Time>
<Row>
<Cell>2.140</Cell><Cell>&gt;100</Cell><Cell>OORANGE</Cell><Cell>85</Cell><Cell>2.830</Cell><Cell>34</Cell><Cell>OORANGE</Cell><Cell>0.001</Cell><Cell>106.0</Cell><Cell>85</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
-116
View File
@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE9557</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>K557I55Y.I20H</FileName>
<HistogramStartTime>12:54:02</HistogramStartTime>
<HistogramStartDate>2019-10-07</HistogramStartDate>
<HistogramStopTime>12:54:28</HistogramStopTime>
<HistogramStopDate>2019-10-07</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>1.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.4 Volts</BatteryLevel>
<Calibration>January 18, 2019 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>Landmark - The Standard - Atherton Hotel</Project>
<Client>Landmark Constructors</Client>
<UserName>Terra-Mechanics, Inc. - D. Bartholomae</UserName>
<SeisLocation>Loc 2- Atherton Hotel - 125 S. Atherton</SeisLocation>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>0.425</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>0.010</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>0.485</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>12:54:28</TranPeakTime>
<TranPeakDate>2019-10-07</TranPeakDate>
<VertPeakTime>12:54:28</VertPeakTime>
<VertPeakDate>2019-10-07</VertPeakDate>
<LongPeakTime>12:54:28</LongPeakTime>
<LongPeakDate>2019-10-07</LongPeakDate>
<PeakVectorSum>
<Value>0.645</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>12:54:28</PeakVectorSumTime>
<PeakVectorSumDate>2019-10-07</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>91.5</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>12:54:28</MicLTime>
<MicLDate>2019-10-07</MicLDate>
<MicLZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.9 Hz.</TranTestFreq>
<TranTestRatio>3.4</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.4 Hz.</VertTestFreq>
<VertTestRatio>3.7</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.7 Hz.</LongTestFreq>
<LongTestRatio>3.9</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>20.1 Hz.</MicLTestFreq>
<MicLTestAmplitude>585 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2019-10-07 12:54:01 - 2019-10-07 12:54:28 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2019-10-07 12:54:28</Time>
<Row>
<Cell>0.425</Cell><Cell>&gt;100</Cell><Cell>0.010</Cell><Cell>&gt;100</Cell><Cell>0.485</Cell><Cell>&gt;100</Cell><Cell>0.645</Cell><Cell>0.000</Cell><Cell>91.48</Cell><Cell>&gt;100</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
-117
View File
@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18438</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T438I4V5.DJ0H</FileName>
<HistogramStartTime>16:48:55</HistogramStartTime>
<HistogramStartDate>2019-10-01</HistogramStartDate>
<HistogramStopTime>16:48:57</HistogramStopTime>
<HistogramStopDate>2019-10-01</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>1.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.8 Volts</BatteryLevel>
<Calibration>September 3, 2019 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<JobNumber>1</JobNumber>
<Project>Univ of Pitt - Scaife Hall-UPMC - Loc 2</Project>
<Client>P J Dick, Inc.</Client>
<UserName>Terra-Mechanics, Inc. - D. Harrison</UserName>
<Seis.Loc>Unit #2 - Station #2 - Loc 2</Seis.Loc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>0.550</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>1.335</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>0.270</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>N/A</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>N/A</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>N/A</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>16:48:57</TranPeakTime>
<TranPeakDate>2019-10-01</TranPeakDate>
<VertPeakTime>16:48:57</VertPeakTime>
<VertPeakDate>2019-10-01</VertPeakDate>
<LongPeakTime>16:48:57</LongPeakTime>
<LongPeakDate>2019-10-01</LongPeakDate>
<PeakVectorSum>
<Value>1.394</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>16:48:57</PeakVectorSumTime>
<PeakVectorSumDate>2019-10-01</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>114.4</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>16:48:57</MicLTime>
<MicLDate>2019-10-01</MicLDate>
<MicLZCFreq>
<Value>51</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.5 Hz.</TranTestFreq>
<TranTestRatio>4.0</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.5 Hz.</VertTestFreq>
<VertTestRatio>3.9</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.6 Hz.</LongTestFreq>
<LongTestRatio>3.7</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>0.0 Hz.</MicLTestFreq>
<MicLTestAmplitude>0 mv</MicLTestAmplitude>
<MicLTestResults>Check</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2019-10-01 16:48:54 - 2019-10-01 16:48:57 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2019-10-01 16:48:57</Time>
<Row>
<Cell>0.550</Cell><Cell>N/A</Cell><Cell>1.335</Cell><Cell>N/A</Cell><Cell>0.270</Cell><Cell>N/A</Cell><Cell>1.394</Cell><Cell>0.002</Cell><Cell>114.4</Cell><Cell>51</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -1,96 +0,0 @@
{
"source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260925_011620_ACH-change_1_setting.bin",
"source_sha256": {
"bw": "e44ce87a1e8638a9346386d5182a97ea142c8486fb17b7de2d1c67d1266be9df",
"s3": "5b15f219ff58a64e61c8b2123034dfcc766465534479a61c1447ea6d66ffd878"
},
"unit": "UM12947",
"firmware_version": "11.0CB",
"firmware_line": "blastware",
"exchanges": [
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 21,
"request": "41021010001500000a000000000000000000002f03",
"response_sub": 234,
"response_data": "0a00000000000000000000554d3132393437003100"
},
{
"sub": 73,
"request": "41021010004900ffff000000000000000000005703",
"response_sub": 182,
"response_data": "050000000000000000000000e8000b00"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 44,
"request": "41021010002c00ffff000000000000000000003a03",
"response_sub": 211,
"response_data": "7e00000000000000000000007cdc000004524144494f2052494e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000034323003c00000000"
},
{
"sub": 126,
"request": "41021010007e00007e00000000000000000000007cdc000005524144494f2052494e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000010034323003c00000000ce03",
"response_sub": 129,
"response_data": "0000000000000000000000"
},
{
"sub": 127,
"request": "41021010007f00ffff000000000000000000008d03",
"response_sub": 128,
"response_data": "0000000000000000000000"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 21,
"request": "41021010001500000a000000000000000000002f03",
"response_sub": 234,
"response_data": "0a00000000000000000000554d3132393437003100"
},
{
"sub": 73,
"request": "41021010004900ffff000000000000000000005703",
"response_sub": 182,
"response_data": "050000000000000000000000e8000b00"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 44,
"request": "41021010002c00ffff000000000000000000003a03",
"response_sub": 211,
"response_data": "7e00000000000000000000007cdc000005524144494f2052494e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000032e5e003c00000000"
},
{
"sub": 126,
"request": "41021010007e00007e00000000000000000000007cdc00001004524144494f2052494e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000010032e5e003c00000000f303",
"response_sub": 129,
"response_data": "0000000000000000000000"
},
{
"sub": 127,
"request": "41021010007f00ffff000000000000000000008d03",
"response_sub": 128,
"response_data": "0000000000000000000000"
}
]
}
-252
View File
@@ -1,252 +0,0 @@
{
"source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260924_191214_turn_on_monitormode_then_attempt_to_write_config.bin",
"source_sha256": {
"bw": "f65dd3b3260eb1fe034169a276e29f631e73fff69c65861d7281718fdbc2d999",
"s3": "dd78a64ac15d1d93492d0db7e3bafceddc1533ad0b6e7f8a5d19bffd83ecce66"
},
"unit": "UM12947",
"firmware_version": "11.0CB",
"firmware_line": "blastware",
"exchanges": [
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 21,
"request": "41021010001500000a000000000000000000002f03",
"response_sub": 234,
"response_data": "0a00000000000000000000554d3132393437003100"
},
{
"sub": 73,
"request": "41021010004900ffff000000000000000000005703",
"response_sub": 182,
"response_data": "050000000000000000000000e8000b00"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 150,
"request": "41021010009600ffff00000000000000000000a403",
"response_sub": 105,
"response_data": "0000000000000000000000"
},
{
"sub": 28,
"request": "41021010001c00ffff000000000000000000002a03",
"response_sub": 227,
"response_data": "2c00000000000000000000000e180907ea20130c19000000000001000000000000000000000000000000000000017c00e4e1c000e3f1c0"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 21,
"request": "41021010001500000a000000000000000000002f03",
"response_sub": 234,
"response_data": "0a00000000000000000000554d3132393437003100"
},
{
"sub": 73,
"request": "41021010004900ffff000000000000000000005703",
"response_sub": 182,
"response_data": "050000000000000000000002e8000b00"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 151,
"request": "41021010009700ffff00000000000000000000a503",
"response_sub": 104,
"response_data": "0000000000000000000000"
},
{
"sub": 28,
"request": "41021010001c00ffff000000000000000000002a03",
"response_sub": 227,
"response_data": "2c000000000000000000000000180907ea64130d22000000000001000000000000000000000000000000000000017c00e4e1c000e3e1c0"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 21,
"request": "41021010001500000a000000000000000000002f03",
"response_sub": 234,
"response_data": "0a00000000000000000000554d3132393437003100"
},
{
"sub": 73,
"request": "41021010004900ffff000000000000000000005703",
"response_sub": 182,
"response_data": "050000000000000000000000e8000b00"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 63,
"request": "41021010003f00ffff000000000000000000004d03",
"response_sub": 192,
"response_data": "ff00000000000000000000666163746f72792e4d4d4200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff00000000000000000000544553542e4d4d4200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000042555320544553542e4d4d42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000057616c7368204a56203234312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000057616c7368204a56203030382e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000048617762616b6572203332322e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000048617762616b65722033323220626c617374696e672e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000006d696e2e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff00000000000000000000506c6179686f757365204c6f6320312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000056616c6c657920526f636b20536f6c7574696f6e2e4d4d42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000005265636f7264696e6753657475702e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000055504d432e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000055504d43204c6f6320332e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000005265736964656e636520496e6e2e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000004d6963726f6d6174652065787420747269676765722e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000004d6963726f6d6174652072656d6f727420616c61726d2e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000054726565206f66204c696665202d204c6f632031202d203538363120536f6c7761792e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000004d656c652d505753412d436172726f6c6c202d4c6f6320342e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff000000000000000000004d6963726f6d617465206d696e2074726967676572206d6d622e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff00000000000000000000466179202d204c6179746f6e204272696467652050726f6a6563742e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000044656661756c74204d6963726f6d61746520495345452e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 64,
"request": "41021010004000ffff000000000000000000004e03",
"response_sub": 191,
"response_data": "ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 65,
"request": "41021010004100ffff000000000000000000004f03",
"response_sub": 190,
"response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
]
}
-156
View File
@@ -1,156 +0,0 @@
{
"source": "bridges/captures/9-24-26 - micromate2/raw_bw_20260925_011907_send_multiday_schedule.bin",
"source_sha256": {
"bw": "1884a47bc25ac20f44b5aef4a0f92da6625ce1c809a8794aa2bb5da483ae4bf5",
"s3": "f26370a1bc880dfb08afdf1f3199f9f2811f49bc43ca9d4c9d3dc2b3cabfdbef"
},
"unit": "UM12947",
"firmware_version": "11.0CB",
"firmware_line": "blastware",
"exchanges": [
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 65,
"request": "41021010004100ffff000000000000000000004f03",
"response_sub": 190,
"response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 65,
"request": "41021010004100ffff000000000000000000004f03",
"response_sub": 190,
"response_data": "ff0000000000000000000054455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"sub": 8,
"request": "41021010000800ffff000000000000000000001603",
"response_sub": 247,
"response_data": "5a0000000000000000000000580900000000000000000000000000000000000000000000000000000000000000000000000000000100010001000100000000000000010001000000000000000000000000000000000002000000000000000200000000b42f"
},
{
"sub": 46,
"request": "41021010002e00ffff000000000000000000003c03",
"response_sub": 209,
"response_data": "1c00000000000000000000001ad50000010000000000000000000000000000000000000000141a"
},
{
"sub": 26,
"request": "41021010001a00ffff000000000000000000002803",
"response_sub": 229,
"response_data": "2c00000000000000000000082a64000004040000020000bf8000000000404000000003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a0028001504fb020d00030000404698dd00003f000000696e2e003f8000002f732e0000004d6963000000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d69630000000200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c000242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bbdf"
},
{
"sub": 218,
"request": "4102101000da0001000000000000000000000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c603",
"response_sub": 37,
"response_data": "0000000000000000000000"
},
{
"sub": 104,
"request": "41021010006800005a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010001000000000000000100010000000000000000000000000000000000100200000000000000100200000000dc03",
"response_sub": 151,
"response_data": "0000000000000000000000"
},
{
"sub": 115,
"request": "41021010007300ffff000000000000000000008103",
"response_sub": 140,
"response_data": "0000000000000000000000"
},
{
"sub": 130,
"request": "41021010008200001c0000000000000000000000000000000100000000000000000000000000000000000000000000af03",
"response_sub": 125,
"response_data": "0000000000000000000000"
},
{
"sub": 131,
"request": "41021010008300ffff000000000000000000009103",
"response_sub": 124,
"response_data": "0000000000000000000000"
},
{
"sub": 113,
"request": "41021010007100082c00000000000000000000000000000010041004000010020000bf800000000040400000001003000f053e000700000000000000000001000054455354312e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e000000000000000000000000000054657374204c6f636174696f6e2031202d203132333420656c65637472696320626f6f67616c6f6f0000436c69656e7400000000000000000000000000000000544d49000000000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000053657276657273446f776e4c61627300000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000486f706566756c6c79207468697320776f726b732120646964206974206f76657277726974653f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005465737420436f6e6669672053656e64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c001002429200000000424800006442000042700000284129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f03",
"response_sub": 142,
"response_data": "0000000000000000000000"
},
{
"sub": 114,
"request": "41021010007200ffff000000000000000000008003",
"response_sub": 141,
"response_data": "0000000000000000000000"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 141,
"request": "41021010008d000018000000000000000000005c73797374656d5c7365747570735c74657374322e6d6d626e03",
"response_sub": 114,
"response_data": "0000000000000000000000"
},
{
"sub": 142,
"request": "41021010008e0008900000000000000000000000011004000010020000bf800000000040400000001003000f053e000f00000000000000000001000074657374322e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6f636174696f6e0000000000000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000436c69656e7400000000000000000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000436f6d70616e7900000000000000000000000000000074657374320000000000000000000000000000000000000000000000000000000000000000000000000047656e6572616c204e6f746573000000000000000000746573743200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015472616e00000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000015665727400000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000014c6f6e6700000001004a000a002800151004fb10020d0010030000404698dd00003f000000696e2e003f8000002f732e0000004d696300000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c290000004c4d6963000000100200c80032000a000a05dc01f4000500003cb8583600003c289d8f707369003ca8b5e4284c29000000534d69630000000900014e4c000a005a0055012c000c00100242920000000042480000644200004270000028412900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010000000100000000000000010001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000008d03",
"response_sub": 113,
"response_data": "0000000000000000000000"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 141,
"request": "41021010008d00001d000000000000000000005c73797374656d5c7363686564756c655c7363686564756c652e6461747403",
"response_sub": 114,
"response_data": "0000000000000000000000"
},
{
"sub": 142,
"request": "41021010008e0010040000000000000000000000100400000010100010020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100110020974657374322e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100210020954455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100310020974657374322e6d6d6200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008603",
"response_sub": 113,
"response_data": "0000000000000000000000"
},
{
"sub": 142,
"request": "41021010008e001003200000000000000000000000000000000000000000000000000000000000001010100410020954455354312e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100510020974657374322e6d6d620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100610020954455354312e6d6d62000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003303",
"response_sub": 113,
"response_data": "0000000000000000000000"
},
{
"sub": 91,
"request": "41021010005b000030000000000000000000009b03",
"response_sub": 164,
"response_data": "300000000000000000000000000050496e7374616e74656c000600c3f04a00e4194f0074024d4d2f495345452f532f494f00001f603e7657603e76"
},
{
"sub": 71,
"request": "41021010004700ffff000000000000000100005603",
"response_sub": 184,
"response_data": "040000000000000001000000000001"
},
{
"sub": 71,
"request": "41021010004700ffff00000000000000100300005803",
"response_sub": 184,
"response_data": "040000000000000003000000000001"
}
]
}
Loaded 100 of 238 files, more files were not shown because too many files have changed in this diff. Show more