Files
jsahnandClaude Opus 5.5 7fa372e801 Fix empty Bluetooth lists in web mixer; advertise it over Bonjour
busctl cannot convert some BlueZ advertisement data (Apple
ManufacturerData, a{qv}) to JSON, so GetManagedObjects failed as soon as
an iPad was paired and the web showed no devices at all. Read only the
needed Device1/Adapter1 properties per object instead. Also publish the
web mixer as an _http._tcp Avahi service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:54:38 +09:00

43 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Install/update web tools on a board that already has Shairport Sync with D-Bus.
set -euo pipefail
PACKAGE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
[[ $EUID == 0 ]] || { echo 'sudo로 실행해 주세요.' >&2; exit 1; }
/usr/local/bin/shairport-sync -V | grep -qi dbus || { echo '먼저 AirPlay D-Bus 지원 빌드를 설치해 주세요.' >&2; exit 1; }
install -d -m 755 /usr/local/lib/radxa-mixer/web
install -m 755 "$PACKAGE_DIR/scripts/radxa-audio.py" /usr/local/bin/radxa-audio
install -m 755 "$PACKAGE_DIR/scripts/web_server.py" /usr/local/lib/radxa-mixer/web_server.py
install -m 644 "$PACKAGE_DIR/scripts/input_controls.py" /usr/local/lib/radxa-mixer/input_controls.py
install -m 644 "$PACKAGE_DIR/scripts/web/"* /usr/local/lib/radxa-mixer/web/
cat > /etc/systemd/system/radxa-mixer-web.service <<'UNIT'
[Unit]
Description=Radxa wireless audio mixer web interface
After=network.target bluetooth.service shairport-sync.service bluealsa.service
[Service]
ExecStart=/usr/bin/python3 /usr/local/lib/radxa-mixer/web_server.py --port 80
Restart=on-failure
RestartSec=3
UMask=0022
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
UNIT
# Advertise the web mixer over Bonjour/mDNS (_http._tcp) next to HOSTNAME.local.
install -d -m 755 /etc/avahi/services
cat > /etc/avahi/services/radxa-mixer.service <<'AVAHI'
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Radxa Mixer (%h)</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/</txt-record>
</service>
</service-group>
AVAHI
systemctl daemon-reload
systemctl enable --now radxa-mixer-web
systemctl restart radxa-mixer-web
echo "웹 믹서: http://$(hostname).local 또는 http://보드IP"