From dd83bef7d3be5c636a999f83d7b2d508cfc3bbcd Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Fri, 7 Nov 2025 23:50:49 -0500 Subject: [PATCH] feat(install): Add pre-built wheel support for 32-bit ARM (Pi Zero W) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Host pre-built dbus_fast wheel on GitHub Releases to significantly speed up installation on 32-bit ARM devices like Raspberry Pi Zero W. Changes: - Created GitHub Release (armv6l-wheels-v1) with dbus_fast 2.44.5 wheel - Python 3.13 on ARMv6l architecture - 874KB wheel file saves ~20 minutes of compilation on Pi Zero W - Release URL: https://github.com/torlando-tech/ble-reticulum/releases/tag/armv6l-wheels-v1 - Modified install.sh to auto-download pre-built wheels: - Detects Python 3.13 on 32-bit ARM (armhf/armv6l/armv7l) - Downloads dbus_fast wheel from GitHub Releases - Falls back gracefully to source build if download fails - Saves ~20 minutes installation time on Pi Zero W - Updated README.md with comprehensive documentation: - Added "Pre-built Wheels for Raspberry Pi Zero W" section - Documented automatic installation behavior - Provided manual installation instructions - Explained why pre-built wheels matter for low-power devices - Added quick reference in automated installation section Time savings on Pi Zero W: - Before: 15-30 minutes (compile dbus_fast C extensions from source) - After: < 10 seconds (download and install pre-built wheel) The installer now transparently optimizes for Pi Zero W while maintaining compatibility with all other platforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/README.md b/README.md index c223e9a..d99d2ba 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ To skip this configuration (not recommended): ./install.sh --skip-experimental ``` +**Pi Zero W Optimization**: The installer automatically detects Raspberry Pi Zero W (32-bit ARM with Python 3.13) and downloads pre-built wheels for packages with C extensions. This saves ~20 minutes of compilation time compared to building from source. See [Pre-built Wheels](#pre-built-wheels-for-raspberry-pi-zero-w) for details. + ### Option B: Manual Installation #### 1. Install System Dependencies @@ -338,6 +340,58 @@ pytest --cov=src/RNS/Interfaces --cov-report=html For detailed development and testing guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md) and [TESTING.md](TESTING.md). +## Pre-built Wheels for Raspberry Pi Zero W + +To speed up installation on 32-bit ARM devices (Raspberry Pi Zero W, Pi 1, Pi 2), we provide pre-built wheels for packages with C extensions that would otherwise require lengthy compilation from source. + +### Automatic Installation + +The `install.sh` script **automatically detects** 32-bit ARM architecture with Python 3.13 and downloads pre-built wheels from [GitHub Releases](https://github.com/torlando-tech/ble-reticulum/releases/tag/armv6l-wheels-v1). + +**Time savings:** ~20 minutes on Pi Zero W (avoids compiling C extensions) + +### Available Wheels + +| Package | Version | Python | Architecture | Size | +|---------|---------|--------|--------------|------| +| dbus_fast | 2.44.5 | 3.13 | ARMv6l | 874KB | + +### Manual Installation + +If you need to install wheels manually (e.g., in a custom Python environment): + +```bash +# Download the wheel +wget https://github.com/torlando-tech/ble-reticulum/releases/download/armv6l-wheels-v1/dbus_fast-2.44.5-cp313-cp313-linux_armv6l.whl + +# Install it +pip install dbus_fast-2.44.5-cp313-cp313-linux_armv6l.whl +``` + +### Building Your Own Wheels + +If you need to build wheels for a different Python version on 32-bit ARM: + +```bash +# Install build dependencies +sudo apt-get install python3-dev libdbus-1-dev pkg-config + +# Build the wheel +pip wheel dbus_fast==2.44.5 + +# The wheel will be saved in the current directory +# You can then share it or install it on other devices +``` + +### Why Pre-built Wheels? + +Python packages with C extensions (like `dbus_fast`) must be compiled from source when installing via pip if no compatible wheel is available on PyPI. On low-powered devices like the Pi Zero W: + +- **Without pre-built wheel:** 15-30 minutes of compilation +- **With pre-built wheel:** < 10 seconds download and install + +The automated installer makes this transparent - it "just works" faster on supported platforms. + ## Automated Deployment The repository includes a GitHub Actions workflow for automated deployment to Raspberry Pi devices after code changes. diff --git a/install.sh b/install.sh index dfb42c0..977bec1 100755 --- a/install.sh +++ b/install.sh @@ -323,6 +323,35 @@ echo # Step 3: Install Python dependencies print_header "Installing Python Dependencies" +# Download pre-built wheels for 32-bit ARM (Pi Zero W optimization) +# Saves ~15-30 minutes of compilation time for packages with C extensions +if [[ "$ARCH" == "armhf" ]] || [[ "$(uname -m)" =~ ^(armv6l|armv7l)$ ]]; then + PYTHON_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null || echo "unknown") + + if [[ "$PYTHON_VER" == "3.13" ]]; then + print_info "Python 3.13 on 32-bit ARM detected - downloading pre-built dbus_fast wheel..." + print_info "This saves ~20 minutes of compilation time on Pi Zero W" + + WHEEL_URL="https://github.com/torlando-tech/ble-reticulum/releases/download/armv6l-wheels-v1/dbus_fast-2.44.5-cp313-cp313-linux_armv6l.whl" + WHEEL_FILE="/tmp/dbus_fast-armv6l-$$.whl" + + if curl -sL "$WHEEL_URL" -o "$WHEEL_FILE" 2>/dev/null; then + if [ -f "$WHEEL_FILE" ] && [ -s "$WHEEL_FILE" ]; then + print_success "Pre-built dbus_fast wheel downloaded (874KB)" + pip_install "$WHEEL_FILE" + rm -f "$WHEEL_FILE" + print_success "dbus_fast installed from pre-built wheel" + else + print_warning "Download failed or file empty, will build from source if needed" + rm -f "$WHEEL_FILE" + fi + else + print_warning "Could not download pre-built wheel, will build from source if needed" + fi + echo + fi +fi + print_info "Installing pip packages (PyGObject, dbus-python, pycairo provided by system packages)" if [ "$INSTALL_MODE" = "venv" ]; then