diff --git a/html/launcher.php b/html/launcher.php index 1f62403..65e3a0d 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -1755,12 +1755,13 @@ if ($type == "set_cpu_power_mode") { if ($type == "screen_control") { $action = $_GET['action']; if ($action == "start") { - // Run as background process - $command = 'nohup sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/screen_control/screen.py > /dev/null 2>&1 &'; + // Run as background process without sudo (requires www-data in video group) + // Redirecting to a temp log file to debug startup issues + $command = 'export DISPLAY=:0 && nohup /usr/bin/python3 /var/www/nebuleair_pro_4g/screen_control/screen.py > /tmp/screen_control.log 2>&1 &'; shell_exec($command); - echo "Started"; + echo "Started. Check /tmp/screen_control.log for details."; } elseif ($action == "stop") { - $command = 'sudo pkill -f "screen.py" 2>&1'; + $command = 'pkill -f "screen.py" 2>&1'; $output = shell_exec($command); echo "Stopped. Output: " . $output; }