v0.12.6 #10

Merged
serversdown merged 43 commits from seismo-lab-new into main 2026-05-04 13:22:56 -04:00
Owner

v0.12.6 — 2026-05-01

Fixed

  • blastware_file.py — waveform frame classification — A5 frame classification for
    waveform-only vs header-only frames now uses frame.record_type instead of frame index.
    Only waveform frames (0x46) are written to the file body; metadata frames are skipped.
    Fixes spurious data corruption from incorrectly classified frames.

  • s3_analyzer.py — A5/5A frame naming — Bulk waveform stream frames (SUB 5A response)
    are now correctly labeled "A5" in analyzer output instead of being conflated with other
    multi-frame responses (SUB A4, E5, etc.).

  • S3FrameParser — frame terminator detection — Corrected the bare ETX terminator
    detection. Frame termination is now correctly identified by a standalone ETX=0x03 byte,
    not by the DLE+ETX sequence (which is part of the payload when it appears within a frame).


v0.12.5 — 2026-04-21

Added

  • seismo_lab.py — Download tab — New fourth tab for live wire-byte capture during event
    downloads. Captures both BW→device and device→S3 frames in real time, allowing inspection
    of the 5A bulk stream chunk sequence and frame-by-frame analysis without needing a bridge
    or MITM proxy. Files are saved with user-specified labels for easy tracking.

Changed

  • s3_bridge.py — raw captures always-on by default--raw-bw and --raw-s3 now
    default to "auto" instead of None. Every bridge session automatically generates
    timestamped raw_bw_<ts>.bin and raw_s3_<ts>.bin files alongside the .bin/.log
    session files. Pass --raw-bw "" (explicit empty string) to disable if needed.

  • gui_bridge.py — raw capture checkboxes pre-checked — Both "BW→S3 raw" and
    "S3→BW raw" checkboxes start checked. Path fields are empty by default (bridge auto-names
    the files). Unchecking a box passes --raw-bw "" to explicitly disable capture.

  • Bridge tab — TCP mode added — Serial/TCP radio toggle allows connection via cellular
    modem (RV50/RV55) instead of direct RS-232. Supports multi-capture design (simultaneous
    Bridge + Analyzer + Download sessions).

  • ach_server.py — TX capture added (raw_tx_<ts>.bin) — Every ACH inbound session
    now saves both directions: raw_rx_<ts>.bin (device → us, S3 side, as before) and
    raw_tx_<ts>.bin (us → device, BW side). Both files are usable in the Analyzer.
    TX bytes are buffered in memory until startup handshake succeeds (same as RX), preventing
    scanner probes from creating empty files.

## v0.12.6 — 2026-05-01 ### Fixed - **`blastware_file.py` — waveform frame classification** — A5 frame classification for waveform-only vs header-only frames now uses `frame.record_type` instead of frame index. Only waveform frames (0x46) are written to the file body; metadata frames are skipped. Fixes spurious data corruption from incorrectly classified frames. - **`s3_analyzer.py` — A5/5A frame naming** — Bulk waveform stream frames (SUB 5A response) are now correctly labeled "A5" in analyzer output instead of being conflated with other multi-frame responses (SUB A4, E5, etc.). - **`S3FrameParser` — frame terminator detection** — Corrected the bare ETX terminator detection. Frame termination is now correctly identified by a standalone `ETX=0x03` byte, not by the `DLE+ETX` sequence (which is part of the payload when it appears within a frame). --- ## v0.12.5 — 2026-04-21 ### Added - **`seismo_lab.py` — Download tab** — New fourth tab for live wire-byte capture during event downloads. Captures both BW→device and device→S3 frames in real time, allowing inspection of the 5A bulk stream chunk sequence and frame-by-frame analysis without needing a bridge or MITM proxy. Files are saved with user-specified labels for easy tracking. ### Changed - **`s3_bridge.py` — raw captures always-on by default** — `--raw-bw` and `--raw-s3` now default to `"auto"` instead of `None`. Every bridge session automatically generates timestamped `raw_bw_<ts>.bin` and `raw_s3_<ts>.bin` files alongside the `.bin`/`.log` session files. Pass `--raw-bw ""` (explicit empty string) to disable if needed. - **`gui_bridge.py` — raw capture checkboxes pre-checked** — Both "BW→S3 raw" and "S3→BW raw" checkboxes start checked. Path fields are empty by default (bridge auto-names the files). Unchecking a box passes `--raw-bw ""` to explicitly disable capture. - **`Bridge tab` — TCP mode added** — Serial/TCP radio toggle allows connection via cellular modem (RV50/RV55) instead of direct RS-232. Supports multi-capture design (simultaneous Bridge + Analyzer + Download sessions). - **`ach_server.py` — TX capture added (`raw_tx_<ts>.bin`)** — Every ACH inbound session now saves both directions: `raw_rx_<ts>.bin` (device → us, S3 side, as before) and `raw_tx_<ts>.bin` (us → device, BW side). Both files are usable in the Analyzer. TX bytes are buffered in memory until startup handshake succeeds (same as RX), preventing scanner probes from creating empty files.
serversdown added 43 commits 2026-05-04 13:19:14 -04:00
- Update `s3_bridge.py` to default raw capture file paths to "auto" for timestamped naming.
- Modify `gui_bridge.py` to pre-check raw capture options and streamline path handling.
- Extend `ach_server.py` to save both incoming and outgoing raw bytes for analysis.
- Revise `CHANGELOG.md` and `instantel_protocol_reference.md` to reflect changes in recording mode handling and compliance data encoding.
fix: rename .n00 to just blastware file (.n00 was false positive)
For 2-second events at 1024 sps the "Project:" metadata frame appears
beyond chunk 32 (the old default cap), causing the safety limit to be
hit and ~34 KB of waveform data to be downloaded instead of stopping
at the metadata frame.  Raising max_chunks to 128 ensures
stop_after_metadata=True can locate the metadata frame for record
times up to ~4 seconds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add classify_frame() which categorises each A5 frame by content:
  terminator    — page_key == 0x0000
  probe_or_strt — contains b"STRT"
  metadata      — contains compliance-config ASCII markers
                  (Project:, Client:, Standard Recording Setup, …)
  waveform      — binary-heavy (< 20% printable ASCII), i.e. raw ADC data
  unknown       — fallback

Update write_blastware_file() body loop: frame 0 (probe) is still
always processed; frames 1+ are only included when classify_frame
returns "waveform".  Metadata frames (compliance config block with
Project:/Client:/etc.) and any stray STRT-bearing frames are skipped
with a warning/debug log.  Terminator frame handling is unchanged.

Adds temporary print() diagnostics so each frame's classification is
visible in the server log to aid debugging.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Frame 0 is always the probe; frames 1+ are always data (waveform ADC
chunks, compliance config, compliance continuation).  Gating on
classify_frame() at fi>0 produces false positives: ADC binary data
can coincidentally contain b"STRT\xff\xfe", causing frames 1 and 5
to be silently dropped from the body (confirmed from live capture on
event key=01110000).  Remove all type-based filtering; include every
frame unconditionally with the standard index-based skip amounts.
parse_s3 had the S3 terminator logic inverted vs the real S3FrameParser
in framing.py. It was terminating on DLE+ETX and treating bare ETX as
payload, which caused every bare 0x03 to be swallowed — bundling multiple
real S3 frames into one giant body until a DLE+ETX sequence happened to
appear. Result: 583-byte POLL_RESPONSE 'frames' containing many real
frames concatenated, all showing BAD CHK.

Fix: mirror S3FrameParser exactly —
  - Bare ETX (0x03) = real frame terminator
  - DLE+ETX (0x10 0x03) = inner-frame literal data (A4/E5 sub-frames),
    appended to body and parsing continues

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Add 0x5A (BULK_WAVEFORM_STREAM) and 0xA5 (BULK_WAVEFORM_RESPONSE) to
SUB_TABLE so they display with real names instead of UNKNOWN_5A/A5.

Revert S3 checksum validation to checksum_valid=None (the original
intentional behavior). Large S3 frames (A5 bulk waveform, E5 compliance
config) embed inner DLE+ETX sub-frame delimiters; the trailing 0x03 of
the last inner delimiter can land where the parser expects the SUM8
checksum byte, causing false BAD CHK on every valid A5 frame.
protocol.py _validate_frame documents and ignores exactly this issue.

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Reviewed-on: #7
New 'TCP Capture' tab in seismo_lab.py: listens on a configurable local
port for an incoming Blastware connection, transparently forwards all
traffic to the real seismograph device, and saves both directions to
raw_bw_<ts>.bin / raw_s3_<ts>.bin in the same format the Analyzer already
understands.  Session start wires up Analyzer live mode automatically via
the same on_bridge_started callback as the COM-port bridge.

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Removes the separate 'TCP Capture' tab and folds TCP MITM capture directly
into the existing Bridge tab.  A Serial/TCP radio selector at the top swaps
the connection fields (COM ports vs. listen port + device host:port) while
keeping the same Start Bridge / Stop Bridge / Add Mark buttons, capture
checkboxes, log dir, and live log — identical UX for both modes.

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Brings back the protocol-exp BridgePanel design:
- Single bridge session stays up; New Capture / Stop Capture create
  labelled raw-file segments on demand (no files created at bridge start)
- Capture history listbox shows all segments; double-click reloads in Analyzer
- On capture complete: Analyzer auto-populates and runs analysis

TCP mode integrated into same tab (Serial/TCP radio toggle):
- Each incoming Blastware connection is automatically a capture segment
- Session appears in history list; Analyzer wires up live on connect
- Stop Capture disconnects current TCP session

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Previously every Blastware connection auto-created files.
Now TCP mode works the same as serial mode:
- Start Bridge: proxy listens and forwards silently, no files written
- New Capture: opens raw_bw/raw_s3 files; pipe threads write to them
- Stop Capture: flushes and closes files, fires Analyzer callback
- No connection = no file; multiple captures per bridge session work correctly

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Matches serial bridge naming: raw_bw_{ts}_{label}.bin / raw_s3_{ts}_{label}.bin

https://claude.ai/code/session_014NczSHUz9uTzCAf4cVASTJ
Adds a new CapturingTransport wrapper in minimateplus.transport that mirrors
every TX/RX byte to two raw .bin files using the same on-wire format as
bridges/ach_mitm.py, so the resulting captures are byte-for-byte compatible
with the existing Blastware MITM captures and load directly in the Analyzer.

A new "Download" tab in seismo_lab.py lets the user connect to a device over
TCP or serial and run connect / list-keys / download-events while the wrapper
saves raw_bw_<ts>.bin (our TX) and raw_s3_<ts>.bin (device TX) into a
seismo_dl_<ts>[_<label>]/ session directory. On completion, the panel hands
both files to the Analyzer and switches tabs, mirroring the UX of the
existing Bridge capture flow.
serversdown merged commit 4ab604eff1 into main 2026-05-04 13:22:56 -04:00
Sign in to join this conversation.