From 8074bf0feeb90d9d293877822193a23ad66f9b80 Mon Sep 17 00:00:00 2001 From: Brian Harrison Date: Tue, 31 Mar 2026 12:12:36 -0400 Subject: [PATCH] bump timeout to 30s to deal with modem slowness. --- minimateplus/protocol.py | 4 ++-- sfm/server.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index f70cdb5..dc1680e 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -154,7 +154,7 @@ class MiniMateProtocol: self._send(POLL_PROBE) probe_rsp = self._recv_one( expected_sub=_expected_rsp_sub(SUB_POLL), - timeout=POLL_RECV_TIMEOUT, + timeout=self._recv_timeout, ) log.debug( "startup: POLL probe response page_key=0x%04X", probe_rsp.page_key @@ -164,7 +164,7 @@ class MiniMateProtocol: self._send(POLL_DATA) data_rsp = self._recv_one( 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)) return data_rsp diff --git a/sfm/server.py b/sfm/server.py index 847705a..5921975 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -152,10 +152,11 @@ def _build_client( Raises HTTPException(422) if neither is provided. """ 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) log.debug("TCP transport: %s:%d", host, tcp_port) - return MiniMateClient(transport=transport) + return MiniMateClient(transport=transport, timeout=30.0) elif port: # Direct serial path log.debug("Serial transport: %s baud=%d", port, baud)