diff --git a/README.md b/README.md index 36a374e9..c19cd14e 100644 --- a/README.md +++ b/README.md @@ -127,10 +127,15 @@ The system supports live, recent, and upcoming game information for multiple spo | This project can be finnicky! RGB LED Matrix displays are not built the same or to a high-quality standard. We have seen many displays arrive dead or partially working in our discord. Please purchase from a reputable vendor. | ### Raspberry Pi -- Raspberry Pi Zero's don't have enough processing power for this project and the Pi 5 is unsupported due to new GPIO output. -- **Raspberry Pi 3B or 4 (NOT RPi 5!)** +- Raspberry Pi Zero's don't have enough processing power for this project. +- **Raspberry Pi 3B, 4, or 5** [Amazon Affiliate Link – Raspberry Pi 4 4GB RAM](https://amzn.to/4dJixuX) [Amazon Affiliate Link – Raspberry Pi 4 8GB RAM](https://amzn.to/4qbqY7F) + - **Pi 5 users**: the installer automatically detects Pi 5 and builds the `rpi-rgb-led-matrix` library with RP1 support. If you previously installed on a Pi 4 and migrated the SD card, or if you see `mmap` errors in the logs, force a fresh library build: + ```bash + sudo RPI_RGB_FORCE_REBUILD=1 ./first_time_install.sh + ``` + - Pi 5 config: leave `rp1_rio` at `0` (PIO mode, default) and set `gpio_slowdown` to `1` or `2`. ### RGB Matrix Bonnet / HAT @@ -582,7 +587,7 @@ These settings control runtime behavior and GPIO timing: - **Critical setting**: Must match your Raspberry Pi model for stability - **Raspberry Pi 3**: Use 3 - **Raspberry Pi 4**: Use 4 - - **Raspberry Pi 5**: Use 5 (or higher if needed) + - **Raspberry Pi 5**: Use 1–2 in PIO mode (`rp1_rio: 0`, the default); start with `1` and increase if you see flickering - **Raspberry Pi Zero/1**: Use 1-2 - Incorrect values can cause display corruption, flickering, or system instability - If you experience issues, try adjusting this value up or down by 1 diff --git a/first_time_install.sh b/first_time_install.sh index 02e54a58..f5a42950 100644 --- a/first_time_install.sh +++ b/first_time_install.sh @@ -36,9 +36,17 @@ if [ -r /proc/device-tree/model ]; then DEVICE_MODEL=$(tr -d '\0' /dev/null 2>&1; then + _HAS_RP1=1 +fi + +_SKIP_BUILD=0 if python3 -c 'from rgbmatrix import RGBMatrix, RGBMatrixOptions' >/dev/null 2>&1 && [ "${RPI_RGB_FORCE_REBUILD:-0}" != "1" ]; then - echo "rgbmatrix Python package already available; skipping build (set RPI_RGB_FORCE_REBUILD=1 to force rebuild)." + if [ "$IS_PI5" = "1" ] && [ "$_HAS_RP1" = "0" ]; then + echo "⚠ Pi 5 detected: installed rgbmatrix lacks rp1_rio support (older build)." + echo " Forcing rebuild to get Pi 5 RP1 support..." + else + _SKIP_BUILD=1 + fi +fi + +if [ "$_SKIP_BUILD" = "1" ]; then + echo "rgbmatrix already installed${IS_PI5:+ with Pi 5 RP1 support}; skipping build (set RPI_RGB_FORCE_REBUILD=1 to force rebuild)." else # Ensure rpi-rgb-led-matrix submodule is initialized if [ ! -d "$PROJECT_ROOT_DIR/rpi-rgb-led-matrix-master" ]; then @@ -852,6 +877,17 @@ except Exception as e: PY then echo "✓ rpi-rgb-led-matrix installed and verified" + # Pi 5: confirm the freshly-built library has rp1_rio support + if [ "$IS_PI5" = "1" ]; then + if python3 -c 'from rgbmatrix import RGBMatrixOptions; assert hasattr(RGBMatrixOptions(), "rp1_rio")' >/dev/null 2>&1; then + echo "✓ Pi 5 RP1 (rp1_rio) support confirmed" + else + echo "⚠ rp1_rio not found after rebuild — the submodule may be an older version." + echo " Try updating the submodule and rebuilding:" + echo " git submodule update --remote rpi-rgb-led-matrix-master" + echo " sudo RPI_RGB_FORCE_REBUILD=1 ./first_time_install.sh" + fi + fi else echo "✗ rpi-rgb-led-matrix import test failed" exit 1 diff --git a/src/display_manager.py b/src/display_manager.py index 9519a4c7..1a94bbe2 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -110,9 +110,10 @@ class DisplayManager: options.rp1_rio = runtime_config.get('rp1_rio') else: logger.warning( - "rp1_rio is set in config but the current RGBMatrixOptions " - "implementation does not support it (RGBMatrixEmulator or older " - "library version) — value will be ignored" + "rp1_rio is set in config but the installed rgbmatrix library does " + "not support it — the library was likely built without Pi 5 RP1 " + "support (mmap to 0x3f000000 instead of RP1 chip). " + "Fix: sudo RPI_RGB_FORCE_REBUILD=1 ./first_time_install.sh" ) logger.info(f"Initializing RGB Matrix with settings: rows={options.rows}, cols={options.cols}, chain_length={options.chain_length}, parallel={options.parallel}, hardware_mapping={options.hardware_mapping}")