Fix justfile parsing: extract inline Python to reset-mcu.py script
Validate and Test / validate-patches (push) Failing after 13s

This commit is contained in:
2026-06-24 17:33:00 -07:00
parent d4856804ff
commit 493255eb00
2 changed files with 24 additions and 16 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import socket, msgpack, time, sys
ROUTER_SOCK = sys.argv[1] if len(sys.argv) > 1 else "/var/run/arduino-router.sock"
SERIAL_DEV = sys.argv[2] if len(sys.argv) > 2 else "/dev/ttyHS1"
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.settimeout(5)
s.connect(ROUTER_SOCK)
p = msgpack.Packer()
req = p.pack([0, 1, "mon/reset", []])
s.sendall(req); s.recv(4096)
req = p.pack([0, 2, "$/serial/close", [SERIAL_DEV]])
s.sendall(req); s.recv(4096)
req = p.pack([0, 3, "$/serial/open", [SERIAL_DEV]])
s.sendall(req); s.recv(4096)
s.close()
print("MCU reset, serial reopened. Wait 20s for Bridge.begin()...")