fix(device_access): wake a MiniMate before every state read in a start/stop, so a start's read-back is answered

BE9441, 2026-10-26 23:41:48 (through the bridge): SFM's start (0x96, Blastware's
own bytes) was acked 0x69 and the unit began monitoring -- Brian saw it -- but
the read-back sent one bare 0x1C two seconds later and got nothing for 120 s,
so the change reported 'sent and acknowledged, but reading the state back
failed' (504, audit 0c1cf813).  Nothing was retried.

A monitoring MiniMate ignores a bare request until SESSION_RESET + POLL
(measured 2026-04-08).  The read-back had relied on the connect's wake; a stop's
read-back (18:53, the unit idle by then) never needed it.  Every state read in
the change now goes through _woken_state: client.poll() (41 03, POLL, 41 03,
POLL -- the connect's own sequence), then 0x1C.

Test: after the send, every 0x1C read is preceded by a POLL.  No codec, store or
DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-26 23:51:15 -04:00
1 parent 6f2acc79e6
commit 9886422212
2 files changed
+26 -1

No files matched your search

+12 -1
View File
@@ -43,6 +43,17 @@ def s3_run_state(status: Any) -> str:
return S3_RUN_STATES.get(flag, f"unknown(0x{flag:02X})")
def _woken_state(client: Any) -> str:
"""The run state, read after waking the unit: SESSION_RESET + POLL first.
A monitoring MiniMate ignores a bare request until it is woken (measured
2026-04-08). On 2026-10-26 BE9441 acked a start, then let a bare 0x1C go
unanswered for 120 s -- the read-back had relied on the connect's wake,
which a stop's read-back (the unit idle by then) never needed."""
client.poll()
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),
@@ -208,7 +219,7 @@ class Series3Adapter:
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=lambda: s3_run_state(client.get_monitor_status()),
read_state=lambda: _woken_state(client),
describe_plan=describe_plan, send=send)
return self._run(address, op, timeout=S3_EVENT_TIMEOUT, retry=False)