Add macOS host support

Cherry-picks the macOS-specific pieces from PR #5: Python daemon using
bleak (CoreBluetooth backend), LaunchAgent template, flash-mac.sh, and
install-mac.sh. Token is read from the macOS Keychain ("Claude
Code-credentials" service); Linux behavior is unchanged. README split
into "macOS installation" and "Linux installation" sections with
parallel Flash / Pair / Install subsections.

Co-Authored-By: Chris Davidson <36679917+lorddavidson@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Hermann Björgvin Haraldsson
2026-05-14 18:39:13 +00:00
co-authored by Chris Davidson Claude Opus 4.7
parent 9aa6954d42
commit 512039e740
6 changed files with 539 additions and 8 deletions
Executable
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# Build and flash Clawdmeter firmware on macOS.
# Usage:
# ./flash-mac.sh # auto-detect /dev/cu.usbmodem*
# ./flash-mac.sh /dev/cu.usbmodem1101 # explicit USB serial port
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PORT="$1"
if [ -z "$PORT" ]; then
PORT=$(ls /dev/cu.usbmodem* 2>/dev/null | head -1)
if [ -z "$PORT" ]; then
echo "Error: no /dev/cu.usbmodem* device found. Plug in via USB-C."
exit 1
fi
fi
if ! command -v pio >/dev/null; then
echo "Error: 'pio' not found. Install with:"
echo " brew install platformio"
exit 1
fi
echo "=== Flashing Clawdmeter ==="
echo "Port: $PORT"
echo ""
cd "$SCRIPT_DIR/firmware"
pio run -t upload --upload-port "$PORT"
echo ""
echo "=== Done ==="
echo "Monitor with: pio device monitor -p $PORT -b 115200"