mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat(core,radxa): extract cross-platform fpv-core workspace crate and add usb0 DHCP setup for Android
This commit is contained in:
1 parent
9a8ae95b3f
commit
16d05785fb
18 files changed
+2119
-1298
No files matched your search
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
# Configure un serveur DHCP léger (dnsmasq) sur l'interface usb0 (192.168.1.1)
|
||||
# de la Radxa Zero 3W pour le plug-and-play sur Android (Galaxy Tab S8 Ultra)
|
||||
# et Linux/SteamOS sans conflit avec les profils IP statiques existants.
|
||||
#
|
||||
# Usage : ./scripts/setup_radxa_dhcp_usb0.sh [root@192.168.1.1]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
RADXA_HOST="${1:-root@192.168.1.1}"
|
||||
|
||||
echo "=== Configuration du serveur DHCP usb0 sur ${RADXA_HOST} ==="
|
||||
|
||||
ssh "${RADXA_HOST}" bash -s << 'EOF'
|
||||
set -euo pipefail
|
||||
|
||||
if ! command -v dnsmasq >/dev/null 2>&1; then
|
||||
echo "[*] dnsmasq absent — tentative d'installation via apt-get..."
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq && apt-get install -y -qq dnsmasq-base || apt-get install -y -qq dnsmasq
|
||||
fi
|
||||
|
||||
mkdir -p /etc/dnsmasq.d
|
||||
|
||||
# Configuration dédiée usb0 :
|
||||
# - port=0 : désactive le serveur DNS (évite tout conflit avec systemd-resolved)
|
||||
# - dhcp-option=3 (vide) : n'annonce AUCUNE passerelle par défaut (préserve le Wi-Fi/5G sur Android et Steam Frame)
|
||||
# - dhcp-option=6 (vide) : n'annonce AUCUN DNS
|
||||
# - plage 192.168.1.10..192.168.1.20 (premier bail = 192.168.1.10, cohérent avec les scripts existants)
|
||||
cat << 'CONF' > /etc/dnsmasq.d/steamframe-usb0.conf
|
||||
port=0
|
||||
interface=usb0
|
||||
bind-dynamic
|
||||
dhcp-range=192.168.1.10,192.168.1.20,255.255.255.0,12h
|
||||
dhcp-option=3
|
||||
dhcp-option=6
|
||||
dhcp-authoritative
|
||||
dhcp-leasefile=/tmp/dnsmasq-usb0.leases
|
||||
CONF
|
||||
|
||||
cat << 'UNIT' > /etc/systemd/system/steamframe-usb0-dhcp.service
|
||||
[Unit]
|
||||
Description=SteamFrame FPV DHCP Server on usb0 (Android & SteamOS Plug-and-Play)
|
||||
After=usb0-setup.service network.target
|
||||
Wants=usb0-setup.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/dnsmasq --keep-in-foreground --no-daemon --conf-file=/etc/dnsmasq.d/steamframe-usb0.conf
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
UNIT
|
||||
|
||||
# Si le service dnsmasq global existe et risque d'occuper le port 67, on évite les conflits
|
||||
if systemctl is-enabled dnsmasq.service >/dev/null 2>&1; then
|
||||
systemctl disable --now dnsmasq.service || true
|
||||
fi
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable steamframe-usb0-dhcp.service
|
||||
systemctl restart steamframe-usb0-dhcp.service
|
||||
systemctl status --no-pager steamframe-usb0-dhcp.service || true
|
||||
EOF
|
||||
|
||||
echo "[+] DHCP usb0 actif sur ${RADXA_HOST} (plage 192.168.1.10-20, sans passerelle ni DNS) !"
|
||||
@@ -76,6 +76,42 @@ EOF
|
||||
mkdir -p "${ROOTFS}/etc/systemd/system/multi-user.target.wants"
|
||||
ln -sf /etc/systemd/system/usb0-setup.service "${ROOTFS}/etc/systemd/system/multi-user.target.wants/usb0-setup.service"
|
||||
|
||||
# 3b. Préparer la configuration DHCP légère sur usb0 (plug-and-play Android Tab S8 Ultra & SteamOS)
|
||||
echo "[3b/5] Préparation de la config DHCP usb0 (sans passerelle ni DNS)..."
|
||||
mkdir -p "${ROOTFS}/etc/dnsmasq.d"
|
||||
cat << 'EOF' > "${ROOTFS}/etc/dnsmasq.d/steamframe-usb0.conf"
|
||||
port=0
|
||||
interface=usb0
|
||||
bind-dynamic
|
||||
dhcp-range=192.168.1.10,192.168.1.20,255.255.255.0,12h
|
||||
dhcp-option=3
|
||||
dhcp-option=6
|
||||
dhcp-authoritative
|
||||
dhcp-leasefile=/tmp/dnsmasq-usb0.leases
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > "${ROOTFS}/etc/systemd/system/steamframe-usb0-dhcp.service"
|
||||
[Unit]
|
||||
Description=SteamFrame FPV DHCP Server on usb0 (Android & SteamOS Plug-and-Play)
|
||||
After=usb0-setup.service network.target
|
||||
Wants=usb0-setup.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/dnsmasq --keep-in-foreground --no-daemon --conf-file=/etc/dnsmasq.d/steamframe-usb0.conf
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
if [ -x "${ROOTFS}/usr/sbin/dnsmasq" ]; then
|
||||
ln -sf /etc/systemd/system/steamframe-usb0-dhcp.service "${ROOTFS}/etc/systemd/system/multi-user.target.wants/steamframe-usb0-dhcp.service"
|
||||
else
|
||||
echo " -> Info : dnsmasq non présent sur l'image SD, lancez ./scripts/setup_radxa_dhcp_usb0.sh après le premier boot."
|
||||
fi
|
||||
|
||||
# 4. Ajuster le port vidéo dans controller_settings.cfg vers 5600
|
||||
echo "[4/5] Configuration du port vidéo Ruby vers 5600..."
|
||||
if [ -f "${ROOTFS}/home/radxa/ruby/config/controller_settings.cfg" ]; then
|
||||
|
||||
Reference in new issue
Block a user