The Plex Radio Player Client serves as a hardware client for Plex Radio. It requires a 16x2 I2C LCD display and five physical buttons to function.
Hardware Requirements:
- 16x2 I2C LCD Display (REQUIRED)
- Raspberry Pi or compatible GPIO system
- I2C interface enabled
- GPIO pins for buttons (configurable)
The application consists of:
- Radio Core (
radio_client.py
) - Handles audio playbook, API communication, and button interactions - Display Manager (
display_manager.py
) - Manages the I2C LCD display
For automatic startup on boot and crash recovery, install as a systemd service:
# Install and start the service
cd service
./install-service.sh
# Use the service manager for control
./radio-service.sh start # Start service
./radio-service.sh stop # Stop service
./radio-service.sh status # Check status
./radio-service.sh logs # View logs
-
Install dependencies:
pip install -r requirements.txt
-
Enable I2C on Raspberry Pi:
sudo raspi-config # Interface Options -> I2C -> Enable
-
Configuration: Copy
example_radio_server_config.yaml
toradio_server_config.yaml
, provide the plex-server-api URL and GPIO pin configurations -
Run the application:
python3 radio_client.py
- Radio ON: Shows channel name and current song with marquee scrolling
- Radio OFF: Shows live clock (24-hour format) and date (MM/DD/YYYY)
- Volume Control: Temporary screen showing current volume level
- Channel Change: Temporary screen showing channel name
- Error Messages: Clear error display for troubleshooting
- Power Button: Toggle radio on/off
- Volume Buttons: Adjust system volume by 5% increments
- Channel Buttons: Navigate through available channels
- Channel Persistence: Remembers last selected channel
The application requires only these essential packages:
gpiozero
- GPIO button supporti2c-lcd
- I2C LCD display driverrequests
- API communicationPyYAML
- Configuration file parsing
plex-radio-player/
├── radio_client.py # Main application
├── display_manager.py # Display manager
├── clear_screen.py # LCD clear utility
├── example_radio_server_config.yaml # Configuration file
├── last_channel.txt # Channel persistence
├── requirements.txt # Dependencies
├── service/ # Service management files
│ ├── install-service.sh # Service installation script
│ ├── radio-service.sh # Service management utility
└── README.md # This documentation
-
Display corrupted or frozen:
python3 clear_screen.py
-
I2C LCD not detected:
- Ensure I2C is enabled:
sudo raspi-config
- Check device permissions:
ls -la /dev/i2c-*
- Verify LCD is connected and powered
- Test I2C detection:
i2cdetect -y 1
- Ensure I2C is enabled:
-
Permission denied on /dev/i2c-1:
- Add user to i2c group:
sudo usermod -a -G i2c $USER
- Logout and login again
- Add user to i2c group:
-
Application fails to start:
- This is expected behavior if no I2C LCD is detected
- The application requires hardware I2C LCD to operate
- Check that
i2c-lcd
Python module is installed
-
Import Error for i2c_lcd:
pip install i2c-lcd
-
GPIO button not responding:
- Check GPIO pin configuration in
config.yaml
- Verify physical wiring matches configured pins
- Ensure GPIO permissions are correct
- Check GPIO pin configuration in
-
ffplay not found:
sudo apt update sudo apt install ffmpeg
-
API connectivity issues:
- Verify API URL is correct in
config.yaml
- Ensure Plex Radio server is running and accessible
- Check network connectivity
- Verify API URL is correct in
For hardware-related issues:
- Test I2C connectivity with
i2cdetect -y 1
- Use the screen clear utility to reset display:
python3 clear_screen.py
- Check system logs for I2C/GPIO errors
For API connectivity issues:
- Verify the Plex Radio server is running
- Test API endpoint manually:
curl http://your-server:5000/channels
- Check firewall settings
I absolutely used AI to write this because I am shameless and just wanted to listen to my tunes.