bump timeout to 30s to deal with modem slowness.

This commit is contained in:
Brian Harrison
2026-03-31 12:12:36 -04:00
parent de02f9cccf
commit 8074bf0fee
2 changed files with 5 additions and 4 deletions

View File

@@ -154,7 +154,7 @@ class MiniMateProtocol:
self._send(POLL_PROBE) self._send(POLL_PROBE)
probe_rsp = self._recv_one( probe_rsp = self._recv_one(
expected_sub=_expected_rsp_sub(SUB_POLL), expected_sub=_expected_rsp_sub(SUB_POLL),
timeout=POLL_RECV_TIMEOUT, timeout=self._recv_timeout,
) )
log.debug( log.debug(
"startup: POLL probe response page_key=0x%04X", probe_rsp.page_key "startup: POLL probe response page_key=0x%04X", probe_rsp.page_key
@@ -164,7 +164,7 @@ class MiniMateProtocol:
self._send(POLL_DATA) self._send(POLL_DATA)
data_rsp = self._recv_one( data_rsp = self._recv_one(
expected_sub=_expected_rsp_sub(SUB_POLL), expected_sub=_expected_rsp_sub(SUB_POLL),
timeout=POLL_RECV_TIMEOUT, timeout=self._recv_timeout,
) )
log.debug("startup: POLL data received, %d bytes", len(data_rsp.data)) log.debug("startup: POLL data received, %d bytes", len(data_rsp.data))
return data_rsp return data_rsp

View File

@@ -152,10 +152,11 @@ def _build_client(
Raises HTTPException(422) if neither is provided. Raises HTTPException(422) if neither is provided.
""" """
if host: if host:
# TCP / modem / ACH path # TCP / modem / ACH path — use a longer timeout to survive cold boots
# (unit takes 5-15s to wake from RS-232 line assertion over cellular)
transport = TcpTransport(host, port=tcp_port) transport = TcpTransport(host, port=tcp_port)
log.debug("TCP transport: %s:%d", host, tcp_port) log.debug("TCP transport: %s:%d", host, tcp_port)
return MiniMateClient(transport=transport) return MiniMateClient(transport=transport, timeout=30.0)
elif port: elif port:
# Direct serial path # Direct serial path
log.debug("Serial transport: %s baud=%d", port, baud) log.debug("Serial transport: %s baud=%d", port, baud)