Loading 3D model… large boards can take a moment.
Entwurf (noch nicht an der Anlage getestet). Die Registerbelegung muss zur STM32-Firmware passen
(siehe modbus_bus.py oben und Dokumentation, Abschnitt Modbus).
| Datei | Aufgabe |
|---|---|
config.yaml | Schnittstelle, Baudrate, Modbus-Adressen, Liste der Ventile (Name → Modul + Ausgang) |
modbus_bus.py | Modbus-RTU-Zugriff (pymodbus) + SimBus zum Testen ohne Hardware |
app.py | Abfrage-Schleife, Prüfungen (online / Auto / Kette OK), Web-API, Protokoll ventil.log |
templates/index.html | Bedienoberfläche im Browser |
ventilsteuerung.service | Autostart als systemd-Dienst |
sudo apt install python3-venv
mkdir -p ~/ventilsteuerung && cd ~/ventilsteuerung # Dateien hierher kopieren
python3 -m venv venv
venv/bin/pip install -r requirements.txt
sudo usermod -aG dialout pi # Zugriff auf /dev/ttyUSB0, danach neu anmelden
venv/bin/python app.py # Browser: http://<IP-des-Pi>:5000
Ohne Hardware testen (auch am PC): python app.py --sim
| Methode | Pfad | Daten | Wirkung |
|---|---|---|---|
| GET | /api/state | – | Zustand beider Module + aller Ventile |
| POST | /api/valve/<id> | {"on": true} | Ventil ein/aus (abgelehnt bei Hand, Kette offen, offline, gesperrt) |
| POST | /api/all_off | – | alle Ausgänge beider Module aus |
Die Software ist nur eine zusätzliche Schicht. Sicherheitskette, Hand/Auto-Relais K101 (Modul B, auf dem Relaisboard), U113 und der Kommunikations-Timeout der Firmware wirken unabhängig vom Pi.
No comments yet. Be the first to ask about this board.