Skip to content

Commit 1cdcd43

Browse files
authored
Update README.md
Signed-off-by: Chuck <[email protected]>
1 parent ac26b81 commit 1cdcd43

File tree

1 file changed

+139
-74
lines changed

1 file changed

+139
-74
lines changed

README.md

Lines changed: 139 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,30 @@ Modular, rotating Displays that can be individually enabled or disabled per the
1616

1717
### Time and Weather
1818
- Real-time clock display
19+
![DSC01361](https://github.com/user-attachments/assets/c4487d40-5872-45f5-a553-debf8cea17e9)
20+
1921

2022
- Current Weather, Daily Weather, and Hourly Weather Forecasts
23+
![DSC01362](https://github.com/user-attachments/assets/d31df736-522f-4f61-9451-29151d69f164)
24+
![DSC01364](https://github.com/user-attachments/assets/eb2d16ad-6b12-49d9-ba41-e39a6a106682)
25+
![DSC01365](https://github.com/user-attachments/assets/f8a23426-e6fa-4774-8c87-19bb94cfbe73)
2126

2227

2328
- Google Calendar event display
29+
![DSC01374-1](https://github.com/user-attachments/assets/5bc89917-876e-489d-b944-4d60274266e3)
30+
31+
2432

2533
### Sports Information
2634
The system supports live, recent, and upcoming game information for multiple sports leagues:
2735
- NHL (Hockey)
36+
![DSC01356](https://github.com/user-attachments/assets/64c359b6-4b99-4dee-aca0-b74debda30e0)
37+
![DSC01339](https://github.com/user-attachments/assets/2ccc52af-b4ed-4c06-a341-581506c02153)
38+
![DSC01337](https://github.com/user-attachments/assets/f4faf678-9f43-4d37-be56-89ecbd09acf6)
2839

2940
- NBA (Basketball)
3041
- MLB (Baseball)
42+
![DSC01359](https://github.com/user-attachments/assets/71e985f1-d2c9-4f0e-8ea1-13eaefeec01c)
3143

3244
- NFL (Football)
3345
- NCAA Football
@@ -40,6 +52,8 @@ The system supports live, recent, and upcoming game information for multiple spo
4052
- Near real-time stock & crypto price updates
4153
- Stock news headlines
4254
- Customizable stock & crypto watchlists
55+
![DSC01366](https://github.com/user-attachments/assets/95b67f50-0f69-4479-89d0-1d87c3daefd3)
56+
![DSC01368](https://github.com/user-attachments/assets/c4b75546-388b-4d4a-8b8c-8c5a62f139f9)
4357

4458

4559

@@ -49,15 +63,19 @@ The system supports live, recent, and upcoming game information for multiple spo
4963
- YouTube Music integration
5064
- Album art display
5165
- Now playing information with scrolling text
66+
![DSC01354](https://github.com/user-attachments/assets/7524b149-f55d-4eb7-b6c6-6e336e0d1ac1)
67+
![DSC01389](https://github.com/user-attachments/assets/3f768651-5446-4ff5-9357-129cd8b3900d)
5268

5369

5470

5571
### Custom Display Features
56-
- Custom Text display
72+
- Custom Text display
73+
![DSC01379](https://github.com/user-attachments/assets/338b7578-9d4b-4465-851c-7e6a1d999e07)
74+
5775
- Youtube Subscriber Count Display
76+
![DSC01376](https://github.com/user-attachments/assets/7ea5f42d-afce-422f-aa97-6b2a179aa7d2)
5877

59-
- Font testing and customization
60-
- Configurable display modes
78+
- Font testing Display (not in rotation)
6179

6280
## System Architecture
6381

@@ -79,24 +97,26 @@ The system can be configured through a JSON configuration file that allows users
7997

8098

8199
## Hardware Requirements
82-
- Raspberry Pi 3b or 4 (NOT RPI5!)
83-
-- Amazon Affiliate Link: Raspberry Pi 4 4GB (https://amzn.to/4dJixuX)
84-
- Adafruit RGB Matrix Bonnet/HAT
85-
-- https://www.adafruit.com/product/3211
86-
- 2x LED Matrix panels (64x32) (Designed for 128x32 but has a lot of dynamic scaling elements that could work on a variety of displays, pixel pitch is user preference)
87-
-- https://www.adafruit.com/product/2278
88-
- 5V 4A DC Power Supply for Adafruit RGB HAT
89-
-- https://www.adafruit.com/product/1466
100+
- Raspberry Pi 3b or 4 (NOT RPI5!) : Amazon Affiliate Link: Raspberry Pi 4 4GB (https://amzn.to/4dJixuX)
101+
- Adafruit RGB Matrix Bonnet/HAT : https://www.adafruit.com/product/3211
102+
- 2x LED Matrix panels (64x32) (Designed for 128x32 but has a lot of dynamic scaling elements that could work on a variety of displays, pixel pitch is user preference) : https://www.adafruit.com/product/2278
103+
- 5V 4A DC Power Supply for Adafruit RGB HAT : https://www.adafruit.com/product/1466
90104

91105
## Optional but recommended mod for Adafruit RGB Matrix Bonnet
92106
- By soldering a jumper between pins 4 and 18, you can run a specialized command for polling the matrix display. This provides better brightness, less flicker, and better color.
93-
- If you do the mod, we will use the command: --led-gpio-mapping=adafruit-hat-pwm, otherwise just use --led-gpio-mapping=adafruit-hat
107+
- If you do the mod, we will use the default config with led-gpio-mapping=adafruit-hat-pwm, otherwise just adjust your mapping in config.json to adafruit-hat
94108
- More information available: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master?tab=readme-ov-file
95109
![DSC00079](https://github.com/user-attachments/assets/4282d07d-dfa2-4546-8422-ff1f3a9c0703)
96110

111+
-----------------------------------------------------------------------------------
112+
## Mount/Stand
113+
I 3D printed stands to keep the panels upright and snug. STL Files are included in the Repo but are also available at https://www.thingiverse.com/thing:5169867 Thanks to "Randomwire" for making these for the 4mm Pixel Pitch LED Matrix.
114+
115+
These are not required and you can probably rig up something basic with stuff you have around the house. I used these screws: https://amzn.to/4mFwNJp (Amazon Affiliate Link)
97116

117+
-----------------------------------------------------------------------------------
98118

99-
Overall 2 Matrix display with Rpi connected.
119+
2 Matrix display with Rpi connected.
100120
![DSC00073](https://github.com/user-attachments/assets/a0e167ae-37c6-4db9-b9ce-a2b957ca1a67)
101121

102122
-----------------------------------------------------------------------------------
@@ -119,8 +139,10 @@ Overall 2 Matrix display with Rpi connected.
119139

120140
# System Setup & Installation
121141

122-
1. Open PowerShell and ssh into your Raspberry Pi with ledpi@ledpi
123-
142+
1. Open PowerShell and ssh into your Raspberry Pi with ledpi@ledpi (or Username@Hostname)
143+
```bash
144+
ssh ledpi@ledpi
145+
```
124146

125147
2. Update repositories, upgrade raspberry pi OS, install git
126148
```bash
@@ -141,7 +163,7 @@ sudo pip3 install --break-system-packages -r requirements.txt
141163
--break-system-packages allows us to install without a virtual environment
142164

143165

144-
5. Install rpi-rgb-led-matrix dependenices:
166+
5. Install rpi-rgb-led-matrix dependencies:
145167
```bash
146168
cd rpi-rgb-led-matrix-master
147169
```
@@ -193,7 +215,7 @@ sudo nano /boot/firmware/cmdline.txt
193215

194216
2. Add `isolcpus=3` at the end of the line
195217

196-
3. Ctrl + X to exit, Y to save
218+
3. Ctrl + X to exit, Y to save, Enter to Confirm
197219

198220
4. Edit /boot/firmware/config.txt with
199221
```bash
@@ -202,7 +224,7 @@ sudo nano /boot/firmware/config.txt
202224

203225
6. Edit the `dtparam=audio=on` section to `dtparam=audio=off`
204226

205-
7. Ctrl + X to exit, Y to save
227+
7. Ctrl + X to exit, Y to save, Enter to Confirm
206228

207229
8. Save and reboot:
208230
```bash
@@ -220,65 +242,15 @@ sudo reboot
220242
For sensitive settings like API keys:
221243
Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
222244
Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
223-
Ctrl + X to exit, Y to overwrite, Enter to save
245+
Ctrl + X to exit, Y to overwrite, Enter to Confirm
224246

225247
Everything is configured via `config/config.json` and `config/config_secrets.json`.
226248

227249

228250

229251
-----------------------------------------------------------------------------------
230252

231-
232-
233-
# Configuration
234-
235-
1.Edit `config/config.json` with your preferences via `sudo nano config/config.json`
236-
237-
238-
## API Keys
239-
240-
For sensitive settings like API keys:
241-
1. Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
242-
243-
2. Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
244-
245-
3. Ctrl + X to exit, Y to overwrite, Enter to save
246-
247-
248-
249-
250-
### YouTube Display Configuration
251-
252-
The YouTube display module shows channel statistics for a specified YouTube channel. To configure it:
253-
254-
1. In `config/config.json`, add the following section:
255-
```json
256-
{
257-
"youtube": {
258-
"enabled": true,
259-
"update_interval": 300 // Update interval in seconds (default: 300)
260-
}
261-
}
262-
```
263-
264-
2. In `config/config_secrets.json`, add your YouTube API credentials:
265-
```json
266-
{
267-
"youtube": {
268-
"api_key": "YOUR_YOUTUBE_API_KEY",
269-
"channel_id": "YOUR_CHANNEL_ID"
270-
}
271-
}
272-
```
273-
274-
To get these credentials:
275-
1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
276-
2. Create a new project or select an existing one
277-
3. Enable the YouTube Data API v3
278-
4. Create credentials (API key)
279-
5. For the channel ID, you can find it in your YouTube channel URL or use the YouTube Data API to look it up
280-
281-
### Calendar Display Configuration
253+
## Calendar Display Configuration
282254

283255
The calendar display module shows upcoming events from your Google Calendar. To configure it:
284256

@@ -313,7 +285,7 @@ The calendar display will show:
313285
- Event title (wrapped to fit the display)
314286
- Up to 3 upcoming events (configurable)
315287

316-
### Music Display Configuration
288+
## Music Display Configuration
317289

318290
The Music Display module shows information about the currently playing track from either Spotify or YouTube Music (via the [YouTube Music Desktop App](https://ytmdesktop.app/) companion server).
319291

@@ -335,7 +307,7 @@ The Music Display module shows information about the currently playing track fro
335307
* `"spotify"`: Only uses Spotify. Ignores YTM.
336308
* `"ytm"`: Only uses the YTM Companion Server. Ignores Spotify.
337309

338-
## Spotify Authentication for Music Display
310+
### Spotify Authentication for Music Display
339311

340312
If you are using the Spotify integration to display currently playing music, you will need to authenticate with Spotify. This project uses an authentication flow that requires a one-time setup. Due to how the display controller script may run with specific user permissions (even when using `sudo`), the following steps are crucial:
341313

@@ -389,6 +361,37 @@ The `authenticate_spotify.py` script, when run with `sudo`, creates `config/spot
389361

390362
The system can display currently playing music information from [YouTube Music Desktop (YTMD)](https://ytmdesktop.app/) via its Companion server API.
391363

364+
### YouTube Display Configuration & API Key
365+
366+
The YouTube display module shows channel statistics for a specified YouTube channel. To configure it:
367+
368+
1. In `config/config.json`, add the following section:
369+
```json
370+
{
371+
"youtube": {
372+
"enabled": true,
373+
"update_interval": 300 // Update interval in seconds (default: 300)
374+
}
375+
}
376+
```
377+
378+
2. In `config/config_secrets.json`, add your YouTube API credentials:
379+
```json
380+
{
381+
"youtube": {
382+
"api_key": "YOUR_YOUTUBE_API_KEY",
383+
"channel_id": "YOUR_CHANNEL_ID"
384+
}
385+
}
386+
```
387+
388+
To get these credentials:
389+
1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
390+
2. Create a new project or select an existing one
391+
3. Enable the YouTube Data API v3
392+
4. Create credentials (API key)
393+
5. For the channel ID, you can find it in your YouTube channel URL or use the YouTube Data API to look it up
394+
392395
**Setup:**
393396

394397
1. **Enable Companion Server in YTMD:**
@@ -418,6 +421,7 @@ The system can display currently playing music information from [YouTube Music D
418421
* Connection errors: Double-check the `YTM_COMPANION_URL` in `config.json` matches what YTMD's companion server is set to.
419422
* Ensure your firewall (Windows Firewall) allows YTM Desktop app to access local networks.
420423

424+
-----------------------------------------------------------------------------------
421425

422426
## Before Running the Display
423427
- To allow the script to properly access fonts, you need to set the correct permissions on your home directory:
@@ -435,6 +439,10 @@ From the project root directory:
435439
```bash
436440
sudo python3 display_controller.py
437441
```
442+
This will start the display cycle but only stays active as long as your ssh session is active.
443+
444+
445+
-----------------------------------------------------------------------------------
438446

439447

440448
## Run on Startup Automatically with Systemd Service Installation
@@ -502,10 +510,17 @@ sudo ./stop_display.sh
502510
```
503511

504512

505-
## Fonts
513+
-----------------------------------------------------------------------------------
514+
515+
## Custom Fonts
506516
You can add any font to the assets/fonts/ folder but they need to be .ttf or .btf(less support) and updated in display_manager.py
507517

508-
### Running without Sudo (Optional and not recommended but can be useful for troubleshooting or overcoming write errors)
518+
519+
520+
-----------------------------------------------------------------------------------
521+
522+
523+
### Running the display without Sudo (Not recommended but can be useful for troubleshooting or overcoming write errors)
509524

510525
To run the display script without `sudo`, the user executing the script needs access to GPIO pins. Add the user to the `gpio` group:
511526

@@ -526,6 +541,40 @@ python3 display_controller.py
526541
```
527542
-----------------------------------------------------------------------------------
528543

544+
## Display Settings
545+
If you are copying my setup, you can likely leave this alone.
546+
- hardware: Configures how the matrix is driven.
547+
- rows, cols, chain_length: Physical panel configuration.
548+
- brightness: Display brightness (0–100).
549+
- hardware_mapping: Use "adafruit-hat-pwm" for Adafruit bonnet WITH the jumper mod. Remove -pwm if you did not solder the jumper.
550+
- pwm_bits, pwm_dither_bits, pwm_lsb_nanoseconds: Affect color fidelity.
551+
- limit_refresh_rate_hz: Cap refresh rate for better stability.
552+
- runtime:
553+
- gpio_slowdown: Tweak this depending on your Pi model. Match it to the generation (e.g., Pi 3 → 3, Pi 4 -> 4).
554+
- display_durations:
555+
- Control how long each display module stays visible in seconds. For example, if you want more focus on stocks, increase that value.
556+
### Modules
557+
- Each module (weather, stocks, crypto, calendar, etc.) has enabled, update_interval, and often display_format settings.
558+
- Sports modules also support test_mode, live_update_interval, and favorite_teams.
559+
- Logos are loaded from the logo_dir path under assets/sports/...
560+
561+
```bash
562+
Example: NHL Configuration"nhl_scoreboard": {
563+
"enabled": true,
564+
"test_mode": false,
565+
"update_interval_seconds": 300,
566+
"live_update_interval": 15,
567+
"recent_game_hours": 48,
568+
"favorite_teams": ["TB", "DAL"],
569+
"logo_dir": "assets/sports/nhl_logos",
570+
"display_modes": {
571+
"nhl_live": true,
572+
"nhl_recent": true,
573+
"nhl_upcoming": true
574+
}
575+
}
576+
```
577+
529578

530579
## Project Structure
531580

@@ -632,3 +681,19 @@ The LEDMatrix system includes a robust caching mechanism to optimize API calls a
632681
- Cache directory is created with proper permissions on first run
633682
- Temporary files are used for safe updates
634683
- JSON serialization handles all data types including timestamps
684+
685+
## Final Notes
686+
- Most configuration is done via config/config.json
687+
- Refresh intervals for sports/weather/stocks are customizable
688+
- A caching system reduces API strain and helps ensure the display doesn’t hammer external services (and ruin it for everyone)
689+
- Font files should be placed in assets/fonts/
690+
- You can test each module individually for debugging
691+
692+
693+
##What's Next?
694+
- Adding MQTT/HomeAssistant integration
695+
- Gambling odds?
696+
- Building a user-friendly UI for easier configuration
697+
698+
699+
### If you’ve read this far — thanks!

0 commit comments

Comments
 (0)