#!/bin/bash
# capture.sh <name> [seconds]  (2026-10-15) - logic-analyser capture of the washer's MACS bus.
# Analyser: 24 MHz 8-ch "Saleae Logic" clone (fx2lafw). CH0 = panel top-left pad 3 (DATA), GND = pad 4.
# 1 MHz = 104 samples per bit at 9600 baud. Output: one byte per sample, bit0 = D0 (same as dishwasher-uart/).
# Laptop ON BATTERY, nothing else on USB: the panel's 0 V is tied to mains NEUTRAL (not isolated).
set -e
name=${1:?name}; secs=${2:-60}
out="cap-$(date +%H%M%S)-$name.bin"
sigrok-cli -d fx2lafw --config samplerate=1m --time $((secs*1000)) -O binary -o "$out"
ls -l "$out"
