Skip to content

fix(install): resolve install issues and speed up web UI startup#225

Merged
ChuckBuilds merged 4 commits intomainfrom
fix/led-panel-permissions-224
Jan 30, 2026
Merged

fix(install): resolve install issues and speed up web UI startup#225
ChuckBuilds merged 4 commits intomainfrom
fix/led-panel-permissions-224

Conversation

@ChuckBuilds
Copy link
Copy Markdown
Owner

@ChuckBuilds ChuckBuilds commented Jan 30, 2026

Summary

Changes

Issue #224 - LED Panels Not Working After Fresh Install

  • Exclude rpi-rgb-led-matrix-master from permission normalization in Step 11.1
  • The blanket chmod 644 was stripping executable bits from compiled library files

Issue #208 - Duplicate Package Wheel Errors

  • Remove redundant python3-pillow from apt install (Debian maps it to python3-pil)
  • Only upgrade pip, not setuptools/wheel (they conflict with apt versions)
  • Remove separate apt numpy install (pip handles it from requirements.txt)

Web UI Slow Startup

  • Install web interface dependencies during first-time setup, not on every startup
  • Add marker file (.web_deps_installed) to skip redundant pip installs
  • Web UI was running pip install on every startup, causing 30-60+ second delays

User Experience

  • Add user-friendly message about expected wait time after installation

Test plan

  • Run fresh installation on a test Pi
  • Verify no "Cannot uninstall wheel" or "Cannot uninstall setuptools" errors
  • Verify LED display works without manual chmod commands
  • Reboot and verify web UI starts quickly (< 10 seconds)
  • Check service status: sudo systemctl status ledmatrix ledmatrix-web

Fixes #224
Fixes #208

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Prevented repeated reinstallation of dependencies on startup by detecting prior installs.
  • Chores

    • Streamlined web interface dependency installation to run once during setup and when needed.
    • Expanded permission and ownership handling for additional install scenarios.
    • Updated post-install notes, step numbering, and reboot guidance for clearer user instructions.

✏️ Tip: You can customize this high-level summary in your review settings.

Chuck and others added 2 commits January 30, 2026 10:44
The permission normalization step in first_time_install.sh was running
chmod 644 on all files, which stripped executable bits from compiled
library files (librgbmatrix.so.1) after make build-python created them.

This caused LED panels to not work after fresh installation until users
manually ran chmod on the rpi-rgb-led-matrix-master directory.

Fixes #224

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Issues addressed:
- Remove redundant python3-pillow from apt (Debian maps it to python3-pil)
- Only upgrade pip, not setuptools/wheel (they conflict with apt versions)
- Remove separate apt numpy install (pip handles it from requirements.txt)
- Install web interface deps during first-time setup, not on every startup
- Add marker file (.web_deps_installed) to skip redundant pip installs
- Add user-friendly message about wait time after installation

The web UI was taking 30-60+ seconds to start because it ran pip install
on every startup. Now it only installs dependencies on first run.

Fixes #208

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 30, 2026

Warning

Rate limit exceeded

@ChuckBuilds has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Replaced apt-based numpy and related steps with pip-based installation from requirements; added a .web_deps_installed marker and guard so web dependencies install only once at startup; expanded permission/ownership handling and updated end-user messaging and step ordering.

Changes

Cohort / File(s) Summary
Installation Script
first_time_install.sh
Removed apt-based numpy install and related checks; moved numpy and web UI deps to pip via requirements.txt; added creation of .web_deps_installed marker; adjusted pip upgrade behavior and expanded directory normalization/permission handling; updated final messaging and step numbers.
Startup / Dependency Guard
scripts/utils/start_web_conditionally.py
Added DEPS_MARKER constant and dependencies_installed() function; wrapped dependency installation with marker check so installation runs only when marker absent and creates marker on success; preserved failure exit behavior.

Sequence Diagram

sequenceDiagram
    participant Startup as Startup Process
    participant Checker as Marker Check
    participant FS as File System
    participant Installer as Pip Installer
    participant WebUI as Web Interface

    Startup->>Checker: dependencies_installed()?
    Checker->>FS: stat/.web_deps_installed

    alt marker exists
        FS-->>Checker: exists
        Checker-->>Startup: skip install
        Startup->>WebUI: launch web UI
    else marker missing
        FS-->>Checker: not found
        Checker-->>Startup: run installer
        Startup->>Installer: pip install -r requirements.txt (web deps)
        Installer-->>Startup: install result (success/fail)
        alt success
            Startup->>FS: create .web_deps_installed
            FS-->>Startup: marker created
            Startup->>WebUI: launch web UI
        else failure
            Startup-->>Startup: exit with error
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped in scripts at break of dawn,

A tiny marker now keeps installs gone,
Pip seeds the garden, permissions trimmed,
The web awakes—soft, tidy, and prim,
A rabbit cheers: no repeats at morn!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: resolving installation issues and speeding up web UI startup, which aligns with the primary changes across both modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/led-panel-permissions-224

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@first_time_install.sh`:
- Around line 804-816: The web dependencies are being installed twice because
Step 6 writes a marker file ".web_deps_installed" but Step 7 still runs
install_dependencies_apt.py; modify the script to check for the marker before
running the Step 7 block and skip install_dependencies_apt.py if
"$PROJECT_ROOT_DIR/.web_deps_installed" exists (or alternatively remove the Step
6 installation and instead rely solely on install_dependencies_apt.py), ensuring
the check references the marker file name and the install_dependencies_apt.py
invocation to prevent duplicate installs.
🧹 Nitpick comments (1)
first_time_install.sh (1)

1549-1553: Good user communication about first-boot expectations.

The patience message helps users understand that the first boot may take longer. The 5-minute estimate is reasonable for worst-case scenarios on slower SD cards or with many dependencies.

Minor suggestion: Consider clarifying that subsequent boots will be much faster (<10 seconds) thanks to the marker file optimization.

📝 Suggested enhancement for clarity
 echo "1. PLEASE BE PATIENT after reboot!"
 echo "   - The web interface may take up to 5 minutes to start on first boot"
 echo "   - Services need time to initialize after installation"
 echo "   - Wait at least 2-3 minutes before checking service status"
+echo "   - Subsequent boots will start much faster (<10 seconds)"
 echo ""

Step 7 was installing web dependencies again even though they were
already installed in Step 5. Now Step 7 checks for the .web_deps_installed
marker file and skips the installation if it already exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@first_time_install.sh`:
- Around line 804-816: The script currently creates the marker
.web_deps_installed regardless of pip install success; change the control flow
so the marker is only created when the install succeeds by checking the pip
command exit status (use the same conditional that prints "✓ Web interface
dependencies installed") and move the touch
"$PROJECT_ROOT_DIR/.web_deps_installed" into the success branch (or wrap it in
an if after the pip command). Reference variables/strings: PROJECT_ROOT_DIR,
web_interface/requirements.txt, the pip install command, the warning echo "⚠
Warning: Some web interface dependencies failed to install", and the marker name
.web_deps_installed to locate and update the logic.
🧹 Nitpick comments (2)
first_time_install.sh (2)

909-933: Good: Marker check prevents duplicate installation; same marker creation concern applies.

The marker file check at line 910 correctly prevents redundant web dependency installation, addressing the previous review concern. However, similar to Step 5, the marker at line 931 is created regardless of whether the installation actually succeeds. This could mask failures in subsequent runs.

Consider making the marker creation conditional on successful installation in both fallback paths.

♻️ Proposed improvement for conditional marker creation
     # Try to install dependencies using the smart installer if available
     if [ -f "$PROJECT_ROOT_DIR/scripts/install_dependencies_apt.py" ]; then
         echo "Using smart dependency installer..."
-        python3 "$PROJECT_ROOT_DIR/scripts/install_dependencies_apt.py"
+        if python3 "$PROJECT_ROOT_DIR/scripts/install_dependencies_apt.py"; then
+            touch "$PROJECT_ROOT_DIR/.web_deps_installed"
+            echo "✓ Web interface dependencies installed"
+        else
+            echo "⚠ Warning: Smart dependency installer failed"
+        fi
     else
         echo "Using pip to install dependencies..."
         if [ -f "$PROJECT_ROOT_DIR/requirements_web_v2.txt" ]; then
-            python3 -m pip install --break-system-packages -r requirements_web_v2.txt
+            if python3 -m pip install --break-system-packages -r requirements_web_v2.txt; then
+                touch "$PROJECT_ROOT_DIR/.web_deps_installed"
+                echo "✓ Web interface dependencies installed"
+            else
+                echo "⚠ Warning: pip install failed"
+            fi
         else
             echo "⚠ requirements_web_v2.txt not found; skipping web dependency install"
         fi
     fi
-
-    # Create marker file to indicate dependencies are installed
-    touch "$PROJECT_ROOT_DIR/.web_deps_installed"
-    echo "✓ Web interface dependencies installed"
 fi

1556-1560: LGTM! Consider clarifying the timing expectation.

The patience note addresses the PR objective for user-facing messaging. The "up to 5 minutes" estimate is conservative, which is reasonable for first boot on varying hardware. Given that the PR objective states subsequent boots should be under 5 seconds, you might consider clarifying this distinction to set better user expectations:

📝 Optional: Clarify first boot vs subsequent boot timing
 echo "1. PLEASE BE PATIENT after reboot!"
-echo "   - The web interface may take up to 5 minutes to start on first boot"
+echo "   - The web interface may take 1-2 minutes to start on first boot"
+echo "   - Subsequent boots should be much faster (under 10 seconds)"
 echo "   - Services need time to initialize after installation"
 echo "   - Wait at least 2-3 minutes before checking service status"

The .web_deps_installed marker file should only be created when pip
install actually succeeds. Previously it was created regardless of
the pip exit status, which could cause subsequent runs to skip
installing missing dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChuckBuilds ChuckBuilds merged commit ea61331 into main Jan 30, 2026
1 check passed
@ChuckBuilds ChuckBuilds deleted the fix/led-panel-permissions-224 branch January 30, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Build Panel not working Duplicate package wheel in the install script/instructions

1 participant