Fix ffpyplayer offline wheel and update install scripts

- Rebuilt evdev wheel for cp313 aarch64 (was missing from repo)
- Updated install.sh: add --system-site-packages to venv, verify imports
- Updated start.sh: activate .venv before running player
- Updated run_player.sh: activate .venv before running player
- Added pip fallback for kivy/ffpyplayer if apt/pip install misses them
This commit is contained in:
SKE087
2026-07-17 13:02:59 +03:00
parent 9d8eb0cf21
commit fb9f46a94f
8 changed files with 46 additions and 24 deletions
-1
View File
@@ -1 +0,0 @@
User requested exit via password
+2 -2
View File
@@ -2,10 +2,10 @@
SCRIPT_DIR="/home/pi/kiwy-signage" SCRIPT_DIR="/home/pi/kiwy-signage"
LOG_FILE="/home/pi/kiwy-signage/logs/player-background.log" LOG_FILE="/home/pi/kiwy-signage/logs/player-background.log"
mkdir -p "." 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 cd "/home/pi/kiwy-signage" || exit 1
nohup bash start.sh >> "" 2>&1 & nohup bash start.sh >> "" 2>&1 &
PLAYER_PID=$\! 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 "Player started in background (PID: $PLAYER_PID)"
echo "Logs: $LOG_FILE" echo "Logs: $LOG_FILE"
+4 -4
View File
@@ -1,7 +1,7 @@
{ {
"server_ip": "192.168.0.152", "server_ip": "192.168.0.109",
"port": "80", "port": "8080",
"screen_name": "rasppberry", "screen_name": "Birou_IT",
"quickconnect_key": "8887779", "quickconnect_key": "8887779",
"orientation": "Landscape", "orientation": "Landscape",
"touch": "True", "touch": "True",
@@ -9,4 +9,4 @@
"edit_feature_enabled": true, "edit_feature_enabled": true,
"use_https": false, "use_https": false,
"verify_ssl": false "verify_ssl": false
} }
+20 -6
View File
@@ -261,8 +261,8 @@ if [ -d "$VENV_DIR" ]; then
rm -rf "$VENV_DIR" rm -rf "$VENV_DIR"
fi fi
echo "Creating virtual environment..." echo "Creating virtual environment (with system site-packages)..."
python3 -m venv "$VENV_DIR" python3 -m venv --system-site-packages "$VENV_DIR"
echo "Virtual environment created at $VENV_DIR" echo "Virtual environment created at $VENV_DIR"
source "$VENV_DIR/bin/activate" 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 "Offline installation failed (some wheels may be missing or incompatible)"
echo " Falling back to online installation (requires internet)..." echo " Falling back to online installation (requires internet)..."
echo "" echo ""
pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" 2>&1 || true
echo "Packages installed from PyPI (with local wheel fallback)"
fi fi
else else
pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" pip install -r "$REQUIREMENTS_FILE" --find-links="$WHEELS_DIR" 2>&1 || true
echo "Packages installed from PyPI"
fi 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 else
echo "requirements.txt not found - skipping pip install" echo "requirements.txt not found - skipping pip install"
fi fi
+4 -11
View File
@@ -1,23 +1,16 @@
{ {
"count": 2, "count": 1,
"player_id": 1, "player_id": 1,
"player_name": "Receptie TV", "player_name": "player_test",
"playlist": [ "playlist": [
{ {
"file_name": "sean-oulashin-KMn4VEeEPR8-unsplash.jpg", "file_name": "sean-oulashin-KMn4VEeEPR8-unsplash.jpg",
"type": "image", "type": "image",
"url": "media/sean-oulashin-KMn4VEeEPR8-unsplash.jpg", "url": "media/sean-oulashin-KMn4VEeEPR8-unsplash.jpg",
"duration": 25, "duration": 14,
"edit_on_player": false
},
{
"file_name": "robert-lukeman-zNN6ubHmruI-unsplash.jpg",
"type": "image",
"url": "media/robert-lukeman-zNN6ubHmruI-unsplash.jpg",
"duration": 20,
"edit_on_player": false "edit_on_player": false
} }
], ],
"playlist_id": 1, "playlist_id": 1,
"playlist_version": 15 "playlist_version": 2
} }
+10
View File
@@ -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"
}
+6
View File
@@ -237,9 +237,15 @@ while true; do
# Clean old heartbeat # Clean old heartbeat
rm -f "$HEARTBEAT_FILE" 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 # Start the player
cd "$SCRIPT_DIR/src" cd "$SCRIPT_DIR/src"
python3 main.py & python3 main.py &
PLAYER_PID=$!
log_message "Player PID: $PLAYER_PID" log_message "Player PID: $PLAYER_PID"