Raspberry Pi (target):
sudo apt install bluezDevelopment machine:
cd blerc
# Native build (on Pi or ARM)
cargo build --release
# Cross-compile for Raspberry Pi (from x86_64/ARM64)
# Option 1: Using Docker via Makefile (recommended)
make build # Default: Bullseye-compatible
make build-bookworm # Bookworm-compatible
# Option 2: Using cross tool
cargo install cross
cross build --target armv7-unknown-linux-gnueabihf --release
# Option 3: Manual toolchain (x86_64 only)
rustup target add armv7-unknown-linux-gnueabihf
sudo apt install gcc-arm-linux-gnueabihf
cargo build --target armv7-unknown-linux-gnueabihf --release
cd webapp
# Install dependencies
yarn install
# Development server (hot reload)
yarn dev
# Production build
yarn build
# Output: dist/
# Start BLE server
./blerc
# With debug logging
./blerc --debug
# Custom config file
./blerc --config /path/to/config.toml
Copy the built binary to your Pi:
scp blerc/target/armv7-unknown-linux-gnueabihf/release/blerc pi@raspberrypi:~/
The webapp builds to static files:
cd webapp
yarn build
Serve options:
dist/ to any web serverpython -m http.server -d distNote: WebBluetooth requires HTTPS in production. Localhost is exempt for development.
Create /etc/systemd/system/blerc.service:
[Unit]
Description=BLE Remote Control
After=bluetooth.target
[Service]
Type=simple
User=pi
ExecStart=/home/pi/blerc
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable blerc
sudo systemctl start blerc
blerc/
├── blerc/ # Rust binary
│ ├── src/
│ │ ├── main.rs
│ │ ├── config.rs # Configuration parsing
│ │ ├── apps/ # App registry & execution
│ │ ├── ble/ # BLE GATT server
│ │ └── http/ # HTTP client for HTTP apps
│ ├── Cargo.toml
│ └── Makefile # Cross-compilation targets
├── webapp/ # PWA webapp
│ ├── src/
│ │ ├── main.ts # Entry point
│ │ ├── ble.ts # WebBluetooth client
│ │ └── style.css
│ └── package.json
├── config/ # Example configuration
├── docs/ # Documentation
└── openspec/ # Specifications & proposals
See dep_versions.md for: