From 3f142ce1c05e2d7a47d5e14909b81cc52ae9c0fe Mon Sep 17 00:00:00 2001 From: Brian Harrison Date: Tue, 31 Mar 2026 00:15:07 -0400 Subject: [PATCH] fix: stop raising on S3 checksum mismatches --- minimateplus/protocol.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index 1d684ef..f70cdb5 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -280,11 +280,17 @@ class MiniMateProtocol: @staticmethod def _validate_frame(frame: S3Frame, expected_sub: Optional[int]) -> None: - """Validate checksum and SUB, raising on failure.""" + """Validate SUB; log but do not raise on bad checksum. + + S3 response checksums frequently fail SUM8 validation due to inner-frame + delimiter bytes being captured as the checksum byte. The original + s3_parser.py deliberately never validates S3 checksums for exactly this + reason. We log a warning and continue. + """ if not frame.checksum_valid: - raise ChecksumError( - f"Bad checksum in S3 frame SUB=0x{frame.sub:02X}" - ) + # S3 checksums frequently fail SUM8 due to inner-frame delimiter bytes + # landing in the checksum position. Treat as informational only. + log.debug("S3 frame SUB=0x%02X: checksum mismatch (ignoring)", frame.sub) if expected_sub is not None and frame.sub != expected_sub: raise UnexpectedResponse( f"Expected SUB=0x{expected_sub:02X}, got 0x{frame.sub:02X}"