fix: improve monitoring functionality with session-reset signal and payload adjustments
This commit is contained in:
@@ -582,17 +582,33 @@ All confirmed from 4-8-26/2ndtry BW TX/S3 capture (clean start → 30s monitor
|
||||
Standard two-step read (probe at offset 0x00, data at offset 0x2C).
|
||||
Response SUB = 0xFF − 0x1C = **0xE3** (standard formula — no exception).
|
||||
|
||||
Payload length indicates mode:
|
||||
- **44 bytes (0x2C)** — unit is **idle**: full status block with battery + memory
|
||||
- **12 bytes** — unit is **monitoring**: abbreviated block, no battery/memory fields
|
||||
**Payload length is ~46–49 bytes in BOTH idle and monitoring states** — length alone
|
||||
is NOT a reliable mode indicator. Earlier note claiming "12 bytes when monitoring"
|
||||
was wrong (confirmed 2026-04-08 from 4-8-26/mid-monitor captures).
|
||||
|
||||
**Field offsets (idle payload, relative to the 11-byte section header start):**
|
||||
**Monitoring flag (confirmed from 4-8-26/2ndtry byte-by-byte comparison):**
|
||||
- `section[1] == 0x00` → unit is **idle**
|
||||
- `section[1] == 0x10` → unit is **monitoring** (flips exactly at start/stop transitions)
|
||||
|
||||
Battery and memory fields are present in **both** states.
|
||||
|
||||
**Field offsets (relative to `data[11:]` = section, confirmed from 2ndtry IDLE frames):**
|
||||
|
||||
| Offset | Field | Type | Notes |
|
||||
|---|---|---|---|
|
||||
| `[0x2F:0x31]` | battery voltage × 100 | uint16 BE | `0x02A8` = 680 → 6.80 V |
|
||||
| `[0x31:0x35]` | memory total (bytes) | uint32 BE | e.g. 983040 = 960 KB |
|
||||
| `[0x35:0x39]` | memory free (bytes) | uint32 BE | |
|
||||
| `[36:38]` | battery voltage × 100 | uint16 BE | `0x02A8` = 680 → 6.80 V |
|
||||
| `[38:42]` | memory total (bytes) | uint32 BE | e.g. 983026 ≈ 960 KB |
|
||||
| `[42:46]` | memory free (bytes) | uint32 BE | decreases as events are stored |
|
||||
|
||||
### SESSION_RESET signal (`41 03`) — required for monitoring units
|
||||
|
||||
Confirmed from 4-8-26 BW TX captures: Blastware sends a 2-byte `41 03` (ACK + ETX,
|
||||
no STX) immediately before the first POLL probe AND between the probe and data frames.
|
||||
This signal is **required to wake units that are actively monitoring** — without it
|
||||
the unit does not respond to POLL over TCP. Harmless for idle units.
|
||||
|
||||
`SESSION_RESET = bytes([0x41, 0x03])` is defined in `framing.py` and sent by
|
||||
`protocol.startup()` before and between POLL frames.
|
||||
|
||||
### SUB 0x96 — Start monitoring
|
||||
|
||||
|
||||
Reference in New Issue
Block a user