tuanchris před 4 měsíci
rodič
revize
982c0d9ffb

+ 2 - 3
dune-weaver-touch/dune-weaver-touch.service

@@ -12,9 +12,8 @@ WorkingDirectory=/home/pi/dune-weaver-touch
 
 
 # EGLFS platform - direct framebuffer, no X11/Wayland needed
 # EGLFS platform - direct framebuffer, no X11/Wayland needed
 Environment=QT_QPA_PLATFORM=eglfs
 Environment=QT_QPA_PLATFORM=eglfs
-Environment=QT_QPA_EGLFS_ALWAYS_SET_MODE=1
-Environment=QT_QPA_EGLFS_PHYSICAL_WIDTH=155
-Environment=QT_QPA_EGLFS_PHYSICAL_HEIGHT=86
+Environment=QT_QPA_EGLFS_WIDTH=800
+Environment=QT_QPA_EGLFS_HEIGHT=480
 Environment=QT_IM_MODULE=qtvirtualkeyboard
 Environment=QT_IM_MODULE=qtvirtualkeyboard
 
 
 # Kiosk mode flag
 # Kiosk mode flag

+ 16 - 9
dune-weaver-touch/install.sh

@@ -85,22 +85,29 @@ install_scripts() {
 # Function to setup systemd service
 # Function to setup systemd service
 setup_systemd() {
 setup_systemd() {
     echo "🚀 Setting up systemd service..."
     echo "🚀 Setting up systemd service..."
-    
+
     # Update paths in the service file
     # Update paths in the service file
     sed "s|/home/pi/dune-weaver-touch|$SCRIPT_DIR|g" "$SCRIPT_DIR/dune-weaver-touch.service" > /tmp/dune-weaver-touch.service
     sed "s|/home/pi/dune-weaver-touch|$SCRIPT_DIR|g" "$SCRIPT_DIR/dune-weaver-touch.service" > /tmp/dune-weaver-touch.service
     sed -i "s|User=pi|User=$ACTUAL_USER|g" /tmp/dune-weaver-touch.service
     sed -i "s|User=pi|User=$ACTUAL_USER|g" /tmp/dune-weaver-touch.service
     sed -i "s|Group=pi|Group=$ACTUAL_USER|g" /tmp/dune-weaver-touch.service
     sed -i "s|Group=pi|Group=$ACTUAL_USER|g" /tmp/dune-weaver-touch.service
-    
-    # Ensure the ExecStart uses the venv python
-    sed -i "s|ExecStart=.*python.*|ExecStart=$SCRIPT_DIR/venv/bin/python $SCRIPT_DIR/main.py|g" /tmp/dune-weaver-touch.service
-    
+
+    # Update all paths in the service file
+    sed -i "s|WorkingDirectory=.*|WorkingDirectory=$SCRIPT_DIR|g" /tmp/dune-weaver-touch.service
+    sed -i "s|ExecStart=.*python.*main.py|ExecStart=$SCRIPT_DIR/venv/bin/python $SCRIPT_DIR/main.py|g" /tmp/dune-weaver-touch.service
+    sed -i "s|ExecStartPre=.*|ExecStartPre=/bin/bash -c 'until curl -s http://localhost:8080/serial_status > /dev/null 2>\&1; do sleep 2; done'|g" /tmp/dune-weaver-touch.service
+
     # Copy service file
     # Copy service file
-    cp /tmp/dune-weaver-touch.service /etc/systemd/system/
-    
-    # Enable service
+    cp /tmp/dune-weaver-touch.service /etc/systemd/system/dune-weaver-touch.service
+
+    echo "   📋 Service configuration:"
+    echo "      User: $ACTUAL_USER"
+    echo "      Directory: $SCRIPT_DIR"
+    echo "      Python: $SCRIPT_DIR/venv/bin/python"
+
+    # Reload and enable service
     systemctl daemon-reload
     systemctl daemon-reload
     systemctl enable dune-weaver-touch.service
     systemctl enable dune-weaver-touch.service
-    
+
     echo "   🚀 Systemd service installed and enabled"
     echo "   🚀 Systemd service installed and enabled"
 }
 }
 
 

+ 3 - 2
dune-weaver-touch/main.py

@@ -18,8 +18,9 @@ def main():
     if kiosk_mode:
     if kiosk_mode:
         # Set Qt platform for fullscreen framebuffer mode
         # Set Qt platform for fullscreen framebuffer mode
         os.environ['QT_QPA_PLATFORM'] = 'eglfs'
         os.environ['QT_QPA_PLATFORM'] = 'eglfs'
-        os.environ['QT_QPA_EGLFS_ALWAYS_SET_MODE'] = '1'
-        print("🖥️  Running in KIOSK MODE (fullscreen)")
+        os.environ['QT_QPA_EGLFS_WIDTH'] = '800'
+        os.environ['QT_QPA_EGLFS_HEIGHT'] = '480'
+        print("🖥️  Running in KIOSK MODE (fullscreen 800x480)")
     else:
     else:
         print("🪟 Running in WINDOWED MODE (development)")
         print("🪟 Running in WINDOWED MODE (development)")
         print("   Use --kiosk flag or set KIOSK_MODE=1 for fullscreen")
         print("   Use --kiosk flag or set KIOSK_MODE=1 for fullscreen")