Feature: ShineDiag — portabler Vor-Ort-Diagnose-Gateway (Pi 3B)
Flask-App + mobile Web UI für Diagnose vor Ort ohne HAOS/MQTT. Pi 3B: eth0 → ShineLAN-X (DHCP), wlan0 → Hotspot "ShineDiag". Browser auf http://10.0.1.1: Modell wählen, alle Sensoren auslesen, Rohdaten-Register-Dump, Export als JSON. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# /etc/dhcpcd.conf — eth0 feste IP für ShineDiag
|
||||
# Diese Datei ans Ende von /etc/dhcpcd.conf anhängen
|
||||
|
||||
interface eth0
|
||||
static ip_address=10.0.0.1/24
|
||||
static routers=
|
||||
static domain_name_servers=
|
||||
noipv6
|
||||
@@ -0,0 +1,9 @@
|
||||
# /etc/dnsmasq.conf — DHCP für ShineLAN-X auf eth0
|
||||
|
||||
interface=eth0
|
||||
dhcp-range=10.0.0.100,10.0.0.200,12h
|
||||
|
||||
# ShineLAN-X bekommt immer 10.0.0.100 (MAC anpassen!)
|
||||
# dhcp-host=AA:BB:CC:DD:EE:FF,shinelanx,10.0.0.100
|
||||
|
||||
bind-interfaces
|
||||
@@ -0,0 +1,16 @@
|
||||
# /etc/hostapd/hostapd.conf — WiFi-Hotspot "ShineDiag"
|
||||
|
||||
interface=wlan0
|
||||
driver=nl80211
|
||||
ssid=ShineDiag
|
||||
hw_mode=g
|
||||
channel=6
|
||||
ieee80211n=1
|
||||
wmm_enabled=1
|
||||
|
||||
auth_algs=1
|
||||
wpa=2
|
||||
wpa_passphrase=shinelanx
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_pairwise=CCMP
|
||||
rsn_pairwise=CCMP
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
# ShineDiag Pi 3B Setup — einmalig als root ausführen
|
||||
set -e
|
||||
|
||||
echo "=== ShineDiag Installation ==="
|
||||
|
||||
# Pakete
|
||||
apt-get update -q
|
||||
apt-get install -y python3-pip hostapd dnsmasq
|
||||
|
||||
# Python-Abhängigkeiten
|
||||
pip3 install flask pymodbus --break-system-packages
|
||||
|
||||
# Netzwerk: eth0 statische IP
|
||||
cat setup/dhcpcd.conf >> /etc/dhcpcd.conf
|
||||
|
||||
# DHCP-Server für eth0
|
||||
cp setup/dnsmasq.conf /etc/dnsmasq.conf
|
||||
systemctl enable dnsmasq
|
||||
|
||||
# WiFi-Hotspot
|
||||
cp setup/hostapd.conf /etc/hostapd/hostapd.conf
|
||||
echo 'DAEMON_CONF="/etc/hostapd/hostapd.conf"' >> /etc/default/hostapd
|
||||
systemctl unmask hostapd
|
||||
systemctl enable hostapd
|
||||
|
||||
# Wlan0 IP
|
||||
cat >> /etc/dhcpcd.conf << 'EOF'
|
||||
|
||||
interface wlan0
|
||||
static ip_address=10.0.1.1/24
|
||||
nohook wpa_supplicant
|
||||
EOF
|
||||
|
||||
# DHCP auch für wlan0 (MacBook-Verbindung)
|
||||
cat >> /etc/dnsmasq.conf << 'EOF'
|
||||
|
||||
interface=wlan0
|
||||
dhcp-range=10.0.1.100,10.0.1.200,1h
|
||||
EOF
|
||||
|
||||
# systemd-Service für ShineDiag
|
||||
INSTALL_DIR="$(pwd)"
|
||||
cat > /etc/systemd/system/shinediag.service << EOF
|
||||
[Unit]
|
||||
Description=ShineDiag Diagnose-Tool
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/python3 ${INSTALL_DIR}/diagnose.py
|
||||
WorkingDirectory=${INSTALL_DIR}
|
||||
Environment=PORT=80
|
||||
Environment=SHINELANX_IP=10.0.0.100
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable shinediag
|
||||
|
||||
echo ""
|
||||
echo "=== Fertig! Bitte neu starten: sudo reboot ==="
|
||||
echo ""
|
||||
echo "Nach dem Neustart:"
|
||||
echo " WiFi: 'ShineDiag' | Passwort: shinelanx"
|
||||
echo " Browser: http://10.0.1.1"
|
||||
Reference in New Issue
Block a user