From 94e7bb511b720f4ac795ad2016ffbf2b8d24856d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20C=C3=B4t=C3=A9?= Date: Mon, 18 May 2026 15:10:28 -0400 Subject: [PATCH] Match Sutter MP-285 GET_POSITION 13-byte reply (no prefix echo) The library expected a 14-byte reply for GET_POSITION: = pad + 3 int32 + terminator, where the leading pad is the echoed command prefix 'C'. Testing against live hardware (serial SIDCACD9, after a power cycle) showed the device replies with only 13 bytes: 3 int32 + b'\r' -- no prefix echo. The protocol has two reply modes (echo on / off). The mode appears to depend on firmware state and is reset by a power cycle. The prior 14-byte assumption worked for the previous device state earlier in the session; this commit accepts the no-echo mode. Changes: - SutterDevice.commands['GET_POSITION']: replyDataLength: 14 -> 13 unpackingMask: ' ' ' 13 unpack format: ' ' --- hardwarelibrary/motion/sutterdevice.py | 9 ++++----- hardwarelibrary/tests/testSutterSerialPort.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hardwarelibrary/motion/sutterdevice.py b/hardwarelibrary/motion/sutterdevice.py index 3e6500ad..c7abc73a 100644 --- a/hardwarelibrary/motion/sutterdevice.py +++ b/hardwarelibrary/motion/sutterdevice.py @@ -25,9 +25,9 @@ class SutterDevice(LinearMotionDevice): replyDataLength=1, unpackingMask='