diff --git a/.player_stop_requested b/.player_stop_requested deleted file mode 100644 index bb64142..0000000 --- a/.player_stop_requested +++ /dev/null @@ -1 +0,0 @@ -User requested exit via password \ No newline at end of file diff --git a/.run-background.sh b/.run-background.sh index 9abf796..a910bac 100755 --- a/.run-background.sh +++ b/.run-background.sh @@ -2,10 +2,10 @@ SCRIPT_DIR="/home/pi/kiwy-signage" LOG_FILE="/home/pi/kiwy-signage/logs/player-background.log" mkdir -p "." -echo "[2026-07-17 10:18:24] Starting player in background..." >> "" +echo "[2026-07-17 10:54:53] Starting player in background..." >> "" cd "/home/pi/kiwy-signage" || exit 1 nohup bash start.sh >> "" 2>&1 & PLAYER_PID=$\! -echo "[2026-07-17 10:18:24] Player started with PID: $PLAYER_PID" >> "" +echo "[2026-07-17 10:54:53] Player started with PID: $PLAYER_PID" >> "" echo "Player started in background (PID: $PLAYER_PID)" echo "Logs: $LOG_FILE" diff --git a/config/app_config.json b/config/app_config.json index d556c16..e09c3f5 100644 --- a/config/app_config.json +++ b/config/app_config.json @@ -1,7 +1,7 @@ { - "server_ip": "192.168.0.152", - "port": "80", - "screen_name": "rasppberry", + "server_ip": "192.168.0.109", + "port": "8080", + "screen_name": "Birou_IT", "quickconnect_key": "8887779", "orientation": "Landscape", "touch": "True", @@ -9,4 +9,4 @@ "edit_feature_enabled": true, "use_https": false, "verify_ssl": false -} +} \ No newline at end of file diff --git a/install.sh b/install.sh index 4e9aaa6..eae1ccd 100755 --- a/install.sh +++ b/install.sh @@ -261,8 +261,8 @@ if [ -d "$VENV_DIR" ]; then rm -rf "$VENV_DIR" fi -echo "Creating virtual environment..." -python3 -m venv "$VENV_DIR" +echo "Creating virtual environment (with system site-packages)..." +python3 -m venv --system-site-packages "$VENV_DIR" echo "Virtual environment created at $VENV_DIR" source "$VENV_DIR/bin/activate" @@ -294,13 +294,27 @@ if [ -f "$REQUIREMENTS_FILE" ]; then echo "Offline installation failed (some wheels may be missing or incompatible)" echo " Falling back to online installation (requires internet)..." echo "" - pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" - echo "Packages installed from PyPI (with local wheel fallback)" + pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" 2>&1 || true fi else - pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" - echo "Packages installed from PyPI" + pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" 2>&1 || true fi + + # Verify critical packages are importable + echo "" + echo "Verifying installed packages..." + pip list --format=columns 2>/dev/null | grep -iE "kivy|ffpyplayer" || true + + # If kivy is still missing after pip install, try system-wide fallback + python3 -c "import kivy" 2>/dev/null && echo " kivy OK" || { + echo "" + echo " kivy not found in venv — installing system-wide via pip (break-system-packages)..." + pip install kivy --break-system-packages 2>/dev/null || pip install --user kivy 2>/dev/null || true + } + python3 -c "import ffpyplayer" 2>/dev/null && echo " ffpyplayer OK" || { + echo " ffpyplayer not found — installing system-wide..." + pip install ffpyplayer --break-system-packages 2>/dev/null || pip install --user ffpyplayer 2>/dev/null || true + } else echo "requirements.txt not found - skipping pip install" fi diff --git a/playlists/server_playlist.json b/playlists/server_playlist.json index 79d1339..40ccc8d 100644 --- a/playlists/server_playlist.json +++ b/playlists/server_playlist.json @@ -1,23 +1,16 @@ { - "count": 2, + "count": 1, "player_id": 1, - "player_name": "Receptie TV", + "player_name": "player_test", "playlist": [ { "file_name": "sean-oulashin-KMn4VEeEPR8-unsplash.jpg", "type": "image", "url": "media/sean-oulashin-KMn4VEeEPR8-unsplash.jpg", - "duration": 25, - "edit_on_player": false - }, - { - "file_name": "robert-lukeman-zNN6ubHmruI-unsplash.jpg", - "type": "image", - "url": "media/robert-lukeman-zNN6ubHmruI-unsplash.jpg", - "duration": 20, + "duration": 14, "edit_on_player": false } ], "playlist_id": 1, - "playlist_version": 15 + "playlist_version": 2 } \ No newline at end of file diff --git a/repo/python-wheels/evdev-1.9.1-cp313-cp313-linux_aarch64.whl b/repo/python-wheels/evdev-1.9.1-cp313-cp313-linux_aarch64.whl index 3d20860..2f30dd1 100644 Binary files a/repo/python-wheels/evdev-1.9.1-cp313-cp313-linux_aarch64.whl and b/repo/python-wheels/evdev-1.9.1-cp313-cp313-linux_aarch64.whl differ diff --git a/src/player_auth.json b/src/player_auth.json new file mode 100644 index 0000000..78fed64 --- /dev/null +++ b/src/player_auth.json @@ -0,0 +1,10 @@ +{ + "hostname": "Birou_IT", + "auth_code": "CZncd_2dlTZGieBEdqAbUTjf3qNyEUPDXr8jLVx7NLs", + "player_id": 1, + "player_name": "Test_player1", + "playlist_id": 1, + "orientation": "Landscape", + "authenticated": true, + "server_url": "http://192.168.0.109:8080" +} \ No newline at end of file diff --git a/start.sh b/start.sh index 12e1a78..05e6d97 100755 --- a/start.sh +++ b/start.sh @@ -237,9 +237,15 @@ while true; do # Clean old heartbeat rm -f "$HEARTBEAT_FILE" + # Activate virtual environment if it exists + if [ -f "$SCRIPT_DIR/.venv/bin/activate" ]; then + source "$SCRIPT_DIR/.venv/bin/activate" + fi + # Start the player cd "$SCRIPT_DIR/src" python3 main.py & + PLAYER_PID=$! log_message "Player PID: $PLAYER_PID"