feat: add pipeline diagnostic script, viz/midi log recipes, reset-mcu recipe
Validate and Test / validate-patches (push) Failing after 13s

- scripts/diagnostics/test-pipeline.py: full end-to-end test
- just diag-full: run pipeline diagnostic
- just viz-log/midi-log: watch service logs live
- just viz-stats/midi-stats: check counters
- just reset-mcu: reset MCU + reopen serial via router RPC
- just test-chord: send test MIDI chord locally
- just fix-perms: restore +x bits on all scripts
This commit is contained in:
2026-06-24 15:02:39 -07:00
parent b4d19f680a
commit c0af9c6b6f
2 changed files with 233 additions and 0 deletions
+68
View File
@@ -338,6 +338,74 @@ kconfig:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\
zgrep -E 'CONFIG_USB_(GADGET|CONFIGFS|F_UAC1|F_MIDI|DWC3|F_ACC|F_SERIAL)' /proc/config.gz 2>/dev/null | awk -F= '{printf \" %-45s %s\\n\", \$1, \$2}'"
# Full pipeline diagnostic: test MIDI → viz → router → MCU → matrix
diag-full:
python3 scripts/diagnostics/test-pipeline.py
# Watch viz real-time log
viz-log:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "journalctl -u led-matrix-viz -f -n 20"
# Watch midi-bridge real-time log
midi-log:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "journalctl -u midi-bridge -f -n 20"
# Reset MCU via router RPC and reopen serial
reset-mcu:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\
python3 -c '
import socket, msgpack, time
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.settimeout(5)
s.connect(\"/var/run/arduino-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\", [\"/dev/ttyHS1\"]])
s.sendall(req); s.recv(4096)
req = p.pack([0, 3, \"\$/serial/open\", [\"/dev/ttyHS1\"]])
s.sendall(req); s.recv(4096)
s.close()
print(\"MCU reset, serial reopened. Wait 20s for Bridge.begin()...\")
'"
# Check viz stats live
viz-stats:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "cat /tmp/viz-stats.json"
# Check midi-bridge stats live
midi-stats:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "cat /tmp/midi-stats.json 2>/dev/null || echo '(no stats - bridge may be down)'"
# Show all service status
svc-status:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\
for s in arduino-router midi-bridge pd-synth-onboard led-matrix-viz prometheus-exporter; do \
echo \" \$s: \$(systemctl is-active \$s 2>/dev/null)\"; \
done"
# Send test MIDI chord to viz (local test, no MIDI controller needed)
test-chord:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\
python3 -c '
import socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for note in [60, 64, 67, 72]:
s.sendto(b\"midi 144 %d 100;\" % note, (\"127.0.0.1\", 8082))
time.sleep(0.15)
time.sleep(0.5)
for note in [60, 64, 67, 72]:
s.sendto(b\"midi 128 %d 0;\" % note, (\"127.0.0.1\", 8082))
time.sleep(0.1)
print(\"Sent C-E-G-C chord\")
'"
# Fix permissions on all scripts (run after clone/checkout)
fix-perms:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\
chmod +x {{REPO_DIR}}/scripts/*.py {{REPO_DIR}}/scripts/*.sh 2>/dev/null; \
echo 'Permissions fixed'"
# Compile and flash the MCU sketch (LED matrix bridge) via SWD
flash-sketch:
@ssh {{SSH_OPTS}} "{{BOARD_USER}}@{{BOARD_HOST}}" "\