From fde68609a70b1f88e09ffef70d8869003b8dc985 Mon Sep 17 00:00:00 2001 From: James Aguilar Date: Wed, 17 Dec 2025 21:21:15 -0700 Subject: [PATCH] EV3: Fix flashing on Windows. Windows requires a reportid byte at the front of each sent message for an HID device, even if the device doesn't use reportids. Adding this synthetic 0x00 to the front of the message enables successful EV3 flashing on Windows. --- pybricksdev/connections/ev3.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pybricksdev/connections/ev3.py b/pybricksdev/connections/ev3.py index 9c4e2ac..a8e899f 100644 --- a/pybricksdev/connections/ev3.py +++ b/pybricksdev/connections/ev3.py @@ -84,10 +84,17 @@ def _send_command(self, command: Command, payload: bytes | None = None) -> int: length += len(payload) + # report_id is not used by the EV3 but is required by HIDAPI on Windows. + # It does no harm on Linux, so we include it unconditionally. Note that + # the report ID is automatically stripped from incoming messages by + # HIDAPI on all platforms. + report_id = 0 + message_number = next(self._msg_count) message = struct.pack( - "