Add systemd unit, requirements.txt and venv setup docs

This commit is contained in:
Joachim Hummel committed 2026-10-19 18:36:41 +02:00
1 parent 8526a1bc39
commit cb198120ba
4 files changed
+42 -3

No files matched your search

+23 -3
View File
@@ -6,16 +6,19 @@ MJPEG-Stream-Server für die Raspberry-Pi-Kamera. Startet `rpicam-vid` einmalig
- Raspberry Pi mit angeschlossener Kamera
- `rpicam-vid` (rpicam-apps)
- Python 3 mit `flask` und optional `python-dotenv`
- Python 3 mit venv (`sudo apt install python3-venv`)
## Installation
```bash
pip install flask python-dotenv
python3 -m venv venv
venv/bin/pip install -r requirements.txt
```
## Start
```bash
python3 app.py
venv/bin/python app.py
```
Danach erreichbar unter:
@@ -26,6 +29,23 @@ Danach erreichbar unter:
| `http://<host>:8080/stream` | MJPEG-Stream |
| `http://<host>:8080/stream.mjpg` | MJPEG-Stream (vehicle-counter kompatibel) |
## Autostart mit systemd
Die Unit nutzt den Interpreter aus dem venv (`venv/bin/python`), das Projekt muss also vorher wie oben installiert sein. In `raspi-cam.service` ggf. `User` und die Pfade anpassen. Der User muss Mitglied der Gruppe `video` sein.
```bash
sudo cp raspi-cam.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now raspi-cam
```
Status und Logs:
```bash
systemctl status raspi-cam
journalctl -u raspi-cam -f
```
## Konfiguration
Die Konfiguration erfolgt über Umgebungsvariablen oder eine `.env`-Datei im Projektverzeichnis.