-
-
Notifications
You must be signed in to change notification settings - Fork 18
INSTALLATION_GUIDE
The easiest way to get your LEDMatrix up and running is to use the automated installer:
# SSH into your Raspberry Pi
ssh ledpi@ledpi
# (replace with your actual username@hostname)sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip cython3 build-essential python3-dev python3-pillow sconsgit clone https://github.com/ChuckBuilds/LEDMatrix.git
cd LEDMatrixchmod +x first_time_install.sh
sudo ./first_time_install.shThis single script handles everything you need for a new installation!
If you prefer to install components individually, follow these steps:
- Install dependencies:
sudo pip3 install --break-system-packages -r requirements.txt--break-system-packages allows us to install without a virtual environment
- Install rpi-rgb-led-matrix dependencies:
cd rpi-rgb-led-matrix-mastersudo make build-python PYTHON=$(which python3)cd bindings/python
sudo python3 setup.py installTest it with:
python3 -c 'from rgbmatrix import RGBMatrix, RGBMatrixOptions; print("Success!")'- Remove unnecessary services that might interfere with the LED matrix:
sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio- Blacklist the sound module:
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf
blacklist snd_bcm2835
EOFthen execute
sudo update-initramfs -u- Reboot:
sudo rebootTo reduce flickering and improve display quality:
- Edit
/boot/firmware/cmdline.txt:
sudo nano /boot/firmware/cmdline.txt-
Add
isolcpus=3at the end of the line -
Ctrl + X to exit, Y to save, Enter to Confirm
-
Edit /boot/firmware/config.txt with
sudo nano /boot/firmware/config.txt-
Edit the
dtparam=audio=onsection todtparam=audio=off -
Ctrl + X to exit, Y to save, Enter to Confirm
-
Save and reboot:
sudo reboot- Run the first_time_install.sh
chmod +x first_time_install.sh
sudo ./first_time_install.shThis handles dependency setup, service installation, permissions, and sudoers configuration.
- Web Interface (V2)
- If
"web_display_autostart": trueis set inconfig/config.json(recommended), the web interface will be started by the installed service. - Access the web UI at:
http://your-pi-ip:5001
- To launch manually instead of using the service:
python3 start_web_v2.pyAfter installation, you'll need to configure your LEDMatrix system:
Edit the main configuration file:
sudo nano config/config.jsonFor sensitive settings like API keys, use the secrets file:
-
Copy the template:
cp config/config_secrets.template.json config/config_secrets.json
-
Edit with your API keys:
sudo nano config/config_secrets.json
-
Save and exit:
Ctrl + X, thenY, thenEnter
Note: Everything is configured via config/config.json and config/config_secrets.json.
- When to use: New installations only
- What it does: Complete setup including all steps below
-
Usage:
sudo ./first_time_install.sh
- When to use: Install main LED Matrix display service
-
What it does:
- Creates systemd service for main display
- Creates systemd service for web interface
- Enables services to start on boot
-
Usage:
sudo ./install_service.sh
- When to use: Install only the web interface service (legacy)
- What it does: Installs the web interface systemd service
-
Usage:
sudo ./install_web_service.sh -
Note:
install_service.shnow handles this automatically
- When to use: When you see cache permission errors
-
What it does:
- Creates cache directories (
/var/cache/ledmatrix) - Sets proper permissions for cache access
- Creates placeholder logo directories
- Creates cache directories (
-
Usage:
sudo ./fix_cache_permissions.sh
- When to use: When web interface can't access logs or system commands
-
What it does:
- Adds user to
systemd-journalgroup (for log access) - Adds user to
admgroup (for system access) - Sets proper file ownership
- Adds user to
-
Usage:
./fix_web_permissions.sh(run as regular user)
- When to use: When web interface buttons don't work (sudo password errors)
-
What it does:
- Configures passwordless sudo access for web interface
- Allows web interface to start/stop services without password
-
Usage:
./configure_web_sudo.sh(run as regular user)
- When to use: When you want to install packages via apt first, then pip
-
What it does:
- Tries to install packages via apt (system packages)
- Falls back to pip with
--break-system-packages - Handles externally managed Python environments
-
Usage:
sudo python3 scripts/install_dependencies_apt.py
- When to use: Manual web interface startup
-
What it does:
- Installs dependencies
- Starts web interface directly
- Includes comprehensive logging
-
Usage:
python3 start_web_v2.py
- When to use: Manual web interface startup (shell script version)
-
What it does: Same as
start_web_v2.pybut as a shell script -
Usage:
./run_web_v2.sh
- When to use: Remove virtual environment if you don't want to use it
-
What it does: Removes
venv_web_v2directory -
Usage:
./cleanup_venv.sh
- When to use: Called by systemd service (don't run manually)
-
What it does:
- Checks config for
web_display_autostartsetting - Starts web interface only if enabled
- Used by the systemd service
- Checks config for
# One command does everything
sudo ./first_time_install.sh# Install web interface dependencies
sudo python3 scripts/install_dependencies_apt.py
# Fix permissions
./fix_web_permissions.sh
# Configure sudo access
./configure_web_sudo.sh
# Install services
sudo ./install_service.sh# Fix cache permissions
sudo ./fix_cache_permissions.sh
# Fix web interface permissions
./fix_web_permissions.sh
# Configure sudo access
./configure_web_sudo.sh
# Log out and back in for group changes to take effect# Start web interface manually (for testing)
python3 start_web_v2.pyAfter running permission scripts, you need to log out and back in for group changes to take effect:
# Or use this command to apply group changes immediately
newgrp systemd-journalEdit config/config.json and set:
{
"web_display_autostart": true
}Open your browser and go to:
http://your-pi-ip:5001
- Check if services are running:
sudo systemctl status ledmatrix.service - Check web interface:
sudo systemctl status ledmatrix-web.service - View logs:
journalctl -u ledmatrix.service -f
- Check if service is running:
sudo systemctl status ledmatrix-web.service - Check logs:
journalctl -u ledmatrix-web.service -f - Ensure
web_display_autostartistruein config
- Run:
./fix_web_permissions.sh - Run:
./configure_web_sudo.sh - Log out and back in
- Run:
sudo ./fix_cache_permissions.sh
- Run:
./configure_web_sudo.sh - Log out and back in
- Run:
sudo python3 scripts/install_dependencies_apt.py
For first-time installations: Use first_time_install.sh
For existing installations with issues: Use the individual permission and configuration scripts as needed.
The first_time_install.sh script is designed to handle everything automatically, so you typically only need to run individual scripts if you're troubleshooting specific issues.