121 lines
3.7 KiB
Markdown
121 lines
3.7 KiB
Markdown
# Video Player Boot Setup
|
|
|
|
This document describes how the video player has been configured to start automatically on boot without IR remote control.
|
|
|
|
## Changes Made
|
|
|
|
### 1. Updated Service Files
|
|
|
|
Both service files have been updated with the following changes:
|
|
|
|
- **User**: Changed from `pi` to `tulivision`
|
|
- **Working Directory**: Updated to `/home/tulivision/rpi-tulivision`
|
|
- **ExecStart**: Updated to use virtual environment Python and added `--no-ir` flag
|
|
- **Environment Variables**: Updated paths for tulivision user
|
|
- **Removed**: GPIO group requirement (no longer needed with `--no-ir`)
|
|
- **Added**: Better process termination handling
|
|
|
|
### 2. Service Files
|
|
|
|
#### video-player.service
|
|
- **Description**: Raspberry Pi Video Player (No IR Remote Control)
|
|
- **Command**: `video_player.py --no-ir`
|
|
- **Behavior**: Starts with default channel (channel 1)
|
|
|
|
#### video-player-random.service
|
|
- **Description**: Raspberry Pi Video Player with Random Video Startup (No IR Remote Control)
|
|
- **Command**: `video_player.py --no-ir --random`
|
|
- **Behavior**: Starts with a random video
|
|
|
|
### 3. Management Script
|
|
|
|
A management script `manage_video_player.sh` has been created with the following commands:
|
|
|
|
```bash
|
|
./manage_video_player.sh start # Start the video player service
|
|
./manage_video_player.sh stop # Stop the video player service
|
|
./manage_video_player.sh restart # Restart the video player service
|
|
./manage_video_player.sh status # Show service status
|
|
./manage_video_player.sh enable # Enable video player for boot (default channel)
|
|
./manage_video_player.sh enable-random # Enable random video player for boot
|
|
./manage_video_player.sh disable # Disable video player services from boot
|
|
./manage_video_player.sh logs # Show service logs (follow mode)
|
|
```
|
|
|
|
## Installation Status
|
|
|
|
- ✅ Service files installed to `/etc/systemd/system/`
|
|
- ✅ `video-player.service` enabled for boot
|
|
- ✅ `video-player-random.service` available but disabled
|
|
- ✅ Management script available in project directory
|
|
|
|
## Current Configuration
|
|
|
|
- **Active Service**: `video-player.service` (enabled for boot)
|
|
- **Startup Mode**: Default channel (channel 1)
|
|
- **IR Remote**: Disabled (no GPIO access required)
|
|
- **User**: tulivision
|
|
- **Working Directory**: /home/tulivision/rpi-tulivision
|
|
- **Python Environment**: Virtual environment in venv/
|
|
|
|
## Testing Results
|
|
|
|
- ✅ Service starts successfully
|
|
- ✅ VLC initializes without errors
|
|
- ✅ Video playback works
|
|
- ✅ Service stops cleanly
|
|
- ✅ No GPIO access required
|
|
- ✅ Automatic restart on failure
|
|
|
|
## Boot Behavior
|
|
|
|
When the system boots:
|
|
|
|
1. The `video-player.service` will start automatically
|
|
2. It will initialize VLC without IR remote control
|
|
3. It will scan the video directory and create channels automatically
|
|
4. It will start playing the default channel (channel 1)
|
|
5. If the service fails, it will restart automatically after 10 seconds
|
|
|
|
## Switching Between Services
|
|
|
|
To switch to random video startup:
|
|
```bash
|
|
./manage_video_player.sh enable-random
|
|
```
|
|
|
|
To switch back to default channel startup:
|
|
```bash
|
|
./manage_video_player.sh enable
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Check Service Status
|
|
```bash
|
|
./manage_video_player.sh status
|
|
```
|
|
|
|
### View Service Logs
|
|
```bash
|
|
./manage_video_player.sh logs
|
|
```
|
|
|
|
### Restart Service
|
|
```bash
|
|
./manage_video_player.sh restart
|
|
```
|
|
|
|
### Disable Auto-Start
|
|
```bash
|
|
./manage_video_player.sh disable
|
|
```
|
|
|
|
## Notes
|
|
|
|
- The service runs without IR remote control, so no GPIO access is required
|
|
- Videos are automatically discovered from the configured directory
|
|
- Channels are assigned automatically based on alphabetical order
|
|
- The service will restart automatically if it crashes
|
|
- All logging is sent to systemd journal
|