From a0f19d8972d0e74e83362605bd509ff95ed177ac Mon Sep 17 00:00:00 2001 From: Chuck Date: Fri, 15 May 2026 14:09:25 -0400 Subject: [PATCH] fix: deterministic submodule install + guard rp1_rio for older rgbmatrix first_time_install.sh: remove --remote from both git submodule update calls so first-time installs check out the pinned commit recorded in the repo rather than whatever upstream master happens to be at install time. The branch = master config in .gitmodules reserves --remote for an explicit maintainer upgrade (git submodule update --remote). display_manager.py: guard rp1_rio assignment with hasattr() so setting the option in config does not cause an AttributeError and silently fall through to emulator mode when running against RGBMatrixEmulator or an older rgbmatrix build that predates the Pi 5 property. Emit a warning instead so the operator knows the value was ignored. Co-Authored-By: Claude Sonnet 4.6 --- first_time_install.sh | 4 ++-- src/display_manager.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/first_time_install.sh b/first_time_install.sh index 89b3828e..02e54a58 100644 --- a/first_time_install.sh +++ b/first_time_install.sh @@ -795,7 +795,7 @@ else # Try to initialize submodule if .gitmodules exists if [ -f "$PROJECT_ROOT_DIR/.gitmodules" ] && grep -q "rpi-rgb-led-matrix" "$PROJECT_ROOT_DIR/.gitmodules"; then echo "Initializing rpi-rgb-led-matrix submodule..." - if ! git submodule update --init --remote --recursive rpi-rgb-led-matrix-master 2>&1; then + if ! git submodule update --init --recursive rpi-rgb-led-matrix-master 2>&1; then echo "⚠ Submodule init failed, cloning directly from GitHub..." git clone https://github.com/hzeller/rpi-rgb-led-matrix.git rpi-rgb-led-matrix-master fi @@ -814,7 +814,7 @@ else cd "$PROJECT_ROOT_DIR" rm -rf rpi-rgb-led-matrix-master if [ -f "$PROJECT_ROOT_DIR/.gitmodules" ] && grep -q "rpi-rgb-led-matrix" "$PROJECT_ROOT_DIR/.gitmodules"; then - git submodule update --init --remote --recursive rpi-rgb-led-matrix-master + git submodule update --init --recursive rpi-rgb-led-matrix-master else git clone https://github.com/hzeller/rpi-rgb-led-matrix.git rpi-rgb-led-matrix-master fi diff --git a/src/display_manager.py b/src/display_manager.py index 15538866..e548e86f 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -103,7 +103,14 @@ class DisplayManager: # Pi 5 only: 0=PIO/RP1 coprocessor (default, less CPU), # 1=RIO/Registered IO (faster; gpio_slowdown effect is inverted in this mode) if 'rp1_rio' in runtime_config: - options.rp1_rio = runtime_config.get('rp1_rio') + if hasattr(options, 'rp1_rio'): + 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" + ) 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}")