Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bootstrap/bootstrap_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ else
echo "Run manually: sudo ${SCRIPT_DIR}/install_publisher.sh $REPO_DIR <url> <key>"
fi

"${SCRIPT_DIR}/install_led_service.sh" "$REPO_DIR"

echo ""
echo "=== Bootstrap complete for ${BENCH_NAME} ==="
echo "Config: /etc/hil-bench/config.yaml"
Expand Down
34 changes: 34 additions & 0 deletions bootstrap/install_led_service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Install the LED daemon service.
# Idempotent — safe to re-run.
#
# Usage: sudo ./install_led_service.sh <repo-dir>
set -euo pipefail

REPO_DIR="${1:?Usage: $0 <repo-dir>}"
VENV="/opt/hil-bench/venv"
SYSTEMD_DST="/etc/systemd/system"

echo "--- Installing LED service ---"

# Install rpi_ws281x into venv
if [[ -d "$VENV" ]]; then
echo "Installing rpi_ws281x package..."
"${VENV}/bin/pip" install --quiet "rpi_ws281x>=5.0"
else
echo "WARNING: venv not found at $VENV — run install_python_env.sh first"
fi

# Install systemd unit
UNIT_SRC="${REPO_DIR}/systemd/hil-bench-led.service"
if [[ -f "$UNIT_SRC" ]]; then
cp "$UNIT_SRC" "${SYSTEMD_DST}/hil-bench-led.service"
systemctl daemon-reload
systemctl enable hil-bench-led.service
echo "Installed and enabled: ${SYSTEMD_DST}/hil-bench-led.service"
else
echo "WARNING: Service file not found: $UNIT_SRC"
fi

echo "--- LED service install done ---"
echo "Start with: sudo systemctl start hil-bench-led"
12 changes: 11 additions & 1 deletion bootstrap/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ echo "--- Refreshing health timer ---"
echo "--- Refreshing udev rules ---"
"${SCRIPT_DIR}/install_udev_rules.sh" "$REPO_DIR"

# ── 6. Done ──────────────────────────────────────────────────────────────
# ── 6. Refresh LED service ───────────────────────────────────────────

LED_UNIT_SRC="${REPO_DIR}/systemd/hil-bench-led.service"
if [[ -f "$LED_UNIT_SRC" ]]; then
echo "--- Refreshing LED service ---"
cp "$LED_UNIT_SRC" /etc/systemd/system/hil-bench-led.service
systemctl daemon-reload
echo "LED service unit refreshed"
fi

# ── 7. Done ──────────────────────────────────────────────────────────────

echo ""
echo "=== Update complete ==="
Expand Down
6 changes: 6 additions & 0 deletions configs/bench-config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ paths:

wiki:
canonical_url: https://wiki.aharoni-lab.com/HIL/Bench/aharoni-samd51-bench-01

led:
enabled: true
led_count: 16
gpio_pin: 18
brightness: 128
8 changes: 8 additions & 0 deletions configs/config.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,11 @@ paths:

wiki:
canonical_url: null # optional wiki link

led:
enabled: false # set to true to enable WS2812B LED strip
led_count: 16 # number of LEDs on the strip
gpio_pin: 18 # GPIO pin (PWM0)
brightness: 128 # default brightness (0-255)
fps: 30 # animation frame rate
socket_path: /run/hil-bench/led.sock
Loading
Loading