diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 4268a01..2e94f18 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-11 | Appendix 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]`: 70,041 / 70,041 DL2 files. Found by the `.MLG` session, verified here. Retracts 2026-11-08's "no common CRC-16 fits": every attempt had started at the footer itself. Same CRC family as the Series IV `0x1A` block's and the `.MLG` record's. | | 2026-11-09 | Appendix D.6.15 (NEW), D.6.6, D.6.11 | ✅ **Over range and the mic.** **D.6.15:** a peak past full scale (2,000 units = 32,000 counts; the mic in counts) is Blastware's `OORANGE`, per channel and per histogram interval, from the unit's own summary peaks. The vector sum is `OORANGE` exactly when a geophone is (43 / 43); never on its own (38 / 38 numeric), which retracts D.6.11's open "vector sum alone" case. The `` line marks the mic over (18 / 18). **D.6.6:** the mic has its own range byte (label + 29): at 1 a count is an eighth, 7 DL2 events SFM read 8× high. The dB offset is **81.938216**: [81.9383, 81.9385] was too high, and every count Blastware printed leaves [81.9382058, 81.9382266]. Blastware's mic unit labels do not hold on every report; some mix dB and psi in one column. **80 of 88 report fields now match on every DL2 event.** | | 2026-11-08 | Appendix D.6.14 (NEW), D.3.3, D.6.11 | ✅ **The monitor log is in the footer.** Every DL2 report prints one Monitor Log line: the footer's ts1 and ts2, then words for the footer's flag word `[18:20]` (`0x0001` Event Recorded, `0x0002` Keyboard Exit, `0x0004` Remote Exit, `0x0008` Selfcheck Passed, `0x0010` Timer Stop, `0x0020` Modem Exit, `0x0200` Battery Low Exit, `0x0800` Memory Full Exit; the higher session-end bit wins, from one file). Rebuilt, it equals Blastware's character for character on 69,983 / 69,983. **D.3.3:** footer `[20:22]` is the trigger source again, `[22:24]` is zero; `[24:26]` still unknown, and no common CRC-16 or sum fits. **72 of 88 report fields now match on every DL2 event.** | | 2026-11-06 | Appendix D.6.13 (NEW), D.3.3, D.6.11, D.6.12 | ✅ **The record chain to the footer, and the sensor check.** Walked from the event record, the chain (event `0x05` → unit's summary `0x32`–`0x35` → sensor checks `0x3c`–`0x3f` → footer `0x0e`) ends exactly at the file's end on all 70,041 DL2 files. The footer is its last record: `00 1a` is its length, `0e` its id. **Each sensor-check record's header holds the unit's results:** channel type `[2]`, status `[4]` (0 = passed), frequency × 10 `[5:7]`, ratio × 10 `[7:9]` and amplitude mV `[9:11]`. Blastware prints them as they are: 209,943 / 209,943 geophone frequencies and ratios, 69,975 / 69,975 mic frequencies and amplitudes. The result is Passed / Check / Disabled by status and type. The status is the unit's own verdict, its bits not decoded. D.6.12's "`0x3c` / `0x3d`, before and after" retracted in place: one record per channel. **71 of 88 report fields now match on every DL2 event.** | @@ -3490,10 +3491,18 @@ The footer terminates the N00 file. Its bytes come directly from the terminator | 18 | 2 | monitor-log flags | uint16 BE: the words of Blastware's Monitor Log line (D.6.14) ✅ 69,983 / 69,983 | | 20 | 2 | trigger source | the event record's again: `00 01`–`00 08` a channel, `02 00` Manual, `04 00` a histogram ✅ 69,983 / 69,983 | | 22 | 2 | `00 00` | 69,983 / 69,983 | -| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed. ⚠ 2026-11-08: no common CRC-16 (XMODEM, CCITT-FALSE, AUG-CCITT, KERMIT, ARC, MODBUS, BUYPASS) nor a 16-bit sum, over the file, from STRT, after STRT or over the footer, fits 40 sampled files. That it is a checksum is not shown | +| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed. ⚠ 2026-11-08: no common CRC-16 (XMODEM, CCITT-FALSE, AUG-CCITT, KERMIT, ARC, MODBUS, BUYPASS) nor a 16-bit sum, over the file, from STRT, after STRT or over the footer, fits 40 sampled files. That it is a checksum is not shown. **Retracted 2026-11-11: see the note below the table** | **CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. +> ✅ **SOLVED 2026-11-11 (measured; found by the `.MLG` session, verified here):** footer +> `[24:26]` is a **CRC-16/AUG-CCITT** (poly `0x1021`, init `0x1D0F`), stored big-endian. It covers +> the footer record from its **length prefix**: the `00 1a` before the footer, then footer +> `[0:22]`, 24 bytes in all. The zero word `[22:24]` is not covered. Matches **70,041 / 70,041** +> DL2 files. Every earlier attempt, including AUG-CCITT, started at the footer itself and missed +> the length prefix. It is the same CRC family as the Series IV `0x1A` block's and the `.MLG` +> record's (D.4). + ### D.4 MLG File Format — Monitor Log **File layout:** `[308B header] [N × 292B records]` diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 3e1f00e..d8a0853 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -1528,7 +1528,8 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # [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] not identified (no common CRC-16 or 16-bit sum fits) + # [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) ts1 = _bw._decode_ts_be(footer[2:10]) ts2 = _bw._decode_ts_be(footer[10:18])