User Tools

Site Tools


haussteuerung:display_panel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haussteuerung:display_panel [2025/12/27 08:08] – [Tests] dominikhaussteuerung:display_panel [2025/12/27 08:11] (current) – [Service] dominik
Line 203: Line 203:
   * Sensor : VL53L0X   * Sensor : VL53L0X
  
-    * Service \\ <code display.service> +==== Service ==== 
-pi@SHome-Display-VPN-DNS:$ cat lib/systemd/system/display.service+  * Aktivieren \\ ''sudo systemctl enable display.service'' \\ ''sudo systemctl daemon-reload'' \\ ''sudo systemctl start display.service'' 
 +  * Log ansehen \\ ''journalctl -u display.service -f'' 
 +  * ''sudo nano /lib/systemd/system/display.service'' \\ <code display.service>
 [Unit] [Unit]
-Description=Display Controller +Description=Smart Display Controller (venv/User Mode) 
- +# Wir warten, bis das Netzwerk und die Grafikoberfläche da sind 
 +After=network-online.target graphical.target 
 +Wants=network-online.target 
 [Service] [Service]
 +# --- User Context ---
 +User=pi
 +Group=pi
 +
 +# --- Arbeitsverzeichnis ---
 +# Setzt das Verzeichnis, damit relative Pfade funktionieren
 +WorkingDirectory=/home/pi/DisplayHA
 +
 +# --- Environment ---
 +# Diese Variablen sind wichtig für DDC/CI oder xrandr Interaktionen
 Environment=DISPLAY=:0 Environment=DISPLAY=:0
 Environment=XAUTHORITY=/home/pi/.Xauthority Environment=XAUTHORITY=/home/pi/.Xauthority
-ExecStart=/usr/bin/python /home/pi/DisplayOn/MotionDetect.py+# Erzwingt unbuffered Output, damit Logs sofort im Journal erscheinen 
 +Environment=PYTHONUNBUFFERED=1 
 + 
 +# --- ExecStart: Der Trick für das venv --- 
 +# Statt 'source bin/activate' rufen wir direkt das Python im venv auf. 
 +# PASSE DEN PFAD ZUM VENV AN, falls dein Ordner anders heißt (z.B. .venv)! 
 +ExecStart=/home/pi/DisplayHA/bin/python /home/pi/DisplayHA/SmartDisplay.py 
 + 
 +# --- Restart Verhalten ---
 Restart=always Restart=always
-RestartSec=30s +RestartSec=10s 
-KillMode=process +
-TimeoutSec=infinity +
- +
 [Install] [Install]
 WantedBy=graphical.target WantedBy=graphical.target
- 
 </code> </code>
  
haussteuerung/display_panel.1766819288.txt.gz · Last modified: by dominik

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki