mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
Able to run from root folder
making it easier to run
This commit is contained in:
136
README.md
136
README.md
@@ -1,85 +1,36 @@
|
|||||||
# LED Matrix Clock
|
# LEDSportsMatrix
|
||||||
|
|
||||||
A simple, modular clock application for Raspberry Pi using Adafruit LED Matrix displays.
|
A modular LED matrix display system for sports information using Raspberry Pi and RGB LED matrices.
|
||||||
|
|
||||||
## Hardware Requirements
|
## Hardware Requirements
|
||||||
|
- Raspberry Pi 3 or newer
|
||||||
- Raspberry Pi 3
|
- Adafruit RGB Matrix Bonnet/HAT
|
||||||
- 2x Adafruit 64x32 LED Matrices
|
- LED Matrix panels (64x32)
|
||||||
- Adafruit Pi LED Matrix Bonnet
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Install required system packages:
|
1. Clone this repository:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get update
|
git clone https://github.com/yourusername/LEDSportsMatrix.git
|
||||||
sudo apt-get install -y python3-pip python3-dev python3-setuptools
|
cd LEDSportsMatrix
|
||||||
sudo apt-get install -y build-essential git
|
|
||||||
sudo apt-get install -y python3-pil python3-pil.imagetk
|
|
||||||
sudo apt-get install -y cython3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install the rpi-rgb-led-matrix library and Python bindings:
|
2. Install dependencies:
|
||||||
```bash
|
```bash
|
||||||
# Make sure you're in the main project directory
|
pip3 install -r requirements.txt
|
||||||
cd ~/LEDSportsMatrix/rpi-rgb-led-matrix-master
|
|
||||||
|
|
||||||
# Build the C++ library first
|
|
||||||
make
|
|
||||||
|
|
||||||
# Build and install Python bindings
|
|
||||||
cd bindings/python
|
|
||||||
sudo python3 setup.py install
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
# Install the library files
|
|
||||||
sudo cp -r lib/* /usr/local/lib/
|
|
||||||
sudo cp -r include/* /usr/local/include/
|
|
||||||
sudo ldconfig
|
|
||||||
cd ..
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install additional Python packages:
|
|
||||||
```bash
|
|
||||||
sudo python3 -m pip install pytz
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Install the DejaVu Sans font:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install -y fonts-dejavu
|
|
||||||
```
|
|
||||||
|
|
||||||
## Performance Optimization
|
|
||||||
|
|
||||||
To reduce flickering and improve display quality:
|
|
||||||
|
|
||||||
1. Edit `/boot/firmware/cmdline.txt`:
|
|
||||||
```bash
|
|
||||||
sudo nano /boot/firmware/cmdline.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Add `isolcpus=3` at the end of the line
|
|
||||||
|
|
||||||
3. Save and reboot:
|
|
||||||
```bash
|
|
||||||
sudo reboot
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Edit the `config/config.json` file to customize:
|
1. Copy the example configuration:
|
||||||
- Timezone
|
```bash
|
||||||
- Display settings (brightness, dimensions)
|
cp config/config.example.json config/config.json
|
||||||
- Clock format and update interval
|
```
|
||||||
|
|
||||||
For sensitive settings like API keys:
|
2. Edit `config/config.json` with your preferences
|
||||||
1. Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
|
|
||||||
2. Edit `config/config_secrets.json` with your API keys
|
|
||||||
|
|
||||||
## Important: Sound Module Configuration
|
## Important: Sound Module Configuration
|
||||||
|
|
||||||
The LED matrix library is known to conflict with the Raspberry Pi's built-in sound module. To prevent issues:
|
|
||||||
|
|
||||||
1. Remove unnecessary services that might interfere with the LED matrix:
|
1. Remove unnecessary services that might interfere with the LED matrix:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio
|
sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio
|
||||||
@@ -99,6 +50,52 @@ sudo update-initramfs -u
|
|||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running the Display
|
||||||
|
|
||||||
|
From the project root directory:
|
||||||
|
```bash
|
||||||
|
sudo python3 display_controller.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The display will alternate between showing:
|
||||||
|
- Current time
|
||||||
|
- Weather information (requires API key configuration)
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
The project structure is organized as follows:
|
||||||
|
```
|
||||||
|
LEDSportsMatrix/
|
||||||
|
├── config/ # Configuration files
|
||||||
|
│ ├── config.json # Main configuration
|
||||||
|
│ └── config_secrets.json# API keys and sensitive data
|
||||||
|
├── src/ # Source code
|
||||||
|
│ ├── display_manager.py # LED matrix display handling
|
||||||
|
│ ├── clock.py # Clock display module
|
||||||
|
│ └── weather.py # Weather display module
|
||||||
|
└── display_controller.py # Main entry point
|
||||||
|
```
|
||||||
|
|
||||||
|
## Performance Optimization
|
||||||
|
|
||||||
|
To reduce flickering and improve display quality:
|
||||||
|
|
||||||
|
1. Edit `/boot/firmware/cmdline.txt`:
|
||||||
|
```bash
|
||||||
|
sudo nano /boot/firmware/cmdline.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Add `isolcpus=3` at the end of the line
|
||||||
|
|
||||||
|
3. Save and reboot:
|
||||||
|
```bash
|
||||||
|
sudo reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
For sensitive settings like API keys:
|
||||||
|
1. Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
|
||||||
|
2. Edit `config/config_secrets.json` with your API keys
|
||||||
|
|
||||||
Note: If you still experience issues, you can additionally disable the audio hardware by editing `/boot/firmware/config.txt`:
|
Note: If you still experience issues, you can additionally disable the audio hardware by editing `/boot/firmware/config.txt`:
|
||||||
```bash
|
```bash
|
||||||
sudo nano /boot/firmware/config.txt
|
sudo nano /boot/firmware/config.txt
|
||||||
@@ -112,17 +109,6 @@ Alternatively, you can:
|
|||||||
- Use external USB sound adapters if you need audio
|
- Use external USB sound adapters if you need audio
|
||||||
- Run the program with `--led-no-hardware-pulse` flag (may cause more flicker)
|
- Run the program with `--led-no-hardware-pulse` flag (may cause more flicker)
|
||||||
|
|
||||||
## Running the Clock
|
|
||||||
|
|
||||||
The program must be run with root privileges to access the LED matrix hardware:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd src
|
|
||||||
sudo python3 display_controller.py
|
|
||||||
```
|
|
||||||
|
|
||||||
To stop the clock, press Ctrl+C.
|
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
- `src/`
|
- `src/`
|
||||||
|
|||||||
6
display_controller.py
Normal file
6
display_controller.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from src.display_controller import main
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user