From f5352b210c123017f6f7c35dbe4f6831e0cec431 Mon Sep 17 00:00:00 2001 From: david rice Date: Tue, 21 Apr 2026 16:05:58 +0100 Subject: [PATCH] Changes --- device_server.py | 15 ++++++++++----- display_test_nexio.py | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/device_server.py b/device_server.py index 09cbc25..fb5dc1d 100644 --- a/device_server.py +++ b/device_server.py @@ -209,11 +209,16 @@ def control_video(): if action == "start": if _video_proc is not None and _video_proc.poll() is None: return jsonify({"status": "already_running", "pid": _video_proc.pid}), 200 - _video_proc = subprocess.Popen( - ["python3", KIOSK_SCRIPT], - stdout=open("/tmp/kiosk.log", "w"), - stderr=subprocess.STDOUT, - ) + try: + log = open("/tmp/kiosk.log", "w") + _video_proc = subprocess.Popen( + ["python3", KIOSK_SCRIPT], + stdout=log, + stderr=subprocess.STDOUT, + env=os.environ.copy(), + ) + except Exception as e: + return jsonify({"error": f"failed to launch kiosk: {e}"}), 500 return jsonify({"status": "started", "pid": _video_proc.pid}), 200 elif action == "stop": diff --git a/display_test_nexio.py b/display_test_nexio.py index 54b5ae0..3fab83d 100644 --- a/display_test_nexio.py +++ b/display_test_nexio.py @@ -10,8 +10,8 @@ class KioskManager: def __init__(self, pipeline): self.pipeline = pipeline self.videos = [ - "file:///root/python/vid.mp4", - "file:///root/python/vid2.mp4" + "file:///root/vid.mp4", + "file:///root/vid2.mp4" ] self.current_video_index = 0