This directory contains everything needed to cross-compile ZeroClaw and deploy it to a Raspberry Pi over SSH.
| File | Purpose |
|---|---|
deploy-rpi.sh |
One-shot cross-compile and deploy script |
rpi-config.toml |
Production config template deployed to ~/.zeroclaw/config.toml |
zeroclaw.service |
systemd unit file installed on the Pi |
99-act-led.rules |
udev rule for ACT LED sysfs access without sudo |
brew install zig
cargo install cargo-zigbuild
rustup target add aarch64-unknown-linux-gnucargo install cross
rustup target add aarch64-unknown-linux-gnu
# Docker must be runningThe deploy script auto-detects which tool is available, preferring cargo-zigbuild.
Force a specific tool with CROSS_TOOL=zigbuild or CROSS_TOOL=cross.
If you can't use SSH key authentication, install sshpass and set the RPI_PASS environment variable:
brew install sshpass # macOS
sudo apt install sshpass # LinuxRPI_HOST=raspberrypi.local RPI_USER=pi ./scripts/deploy-rpi.shAfter the first deploy, you must set your API key on the Pi (see First-Time Setup).
| Variable | Default | Description |
|---|---|---|
RPI_HOST |
raspberrypi.local |
Pi hostname or IP address |
RPI_USER |
pi |
SSH username |
RPI_PORT |
22 |
SSH port |
RPI_DIR |
~/zeroclaw |
Remote directory for the binary and .env |
RPI_PASS |
(unset) | SSH password β uses sshpass if set; key auth used otherwise |
CROSS_TOOL |
(auto-detect) | Force zigbuild or cross |
- Cross-compile β builds a release binary for
aarch64-unknown-linux-gnuwith--features hardware,peripheral-rpi. - Stop service β runs
sudo systemctl stop zeroclawon the Pi (continues if not yet installed). - Create remote directory β ensures
$RPI_DIRexists on the Pi. - Copy binary β SCPs the compiled binary to
$RPI_DIR/zeroclaw. - Create
.envβ writes an.envskeleton with anANTHROPIC_API_KEY=placeholder to$RPI_DIR/.envwith mode600. Skipped if the file already exists so an existing key is not overwritten. - Deploy config β copies
rpi-config.tomlto~/.zeroclaw/config.toml, preserving anyapi_keyalready present in the file. - Install systemd service β copies
zeroclaw.serviceto/etc/systemd/system/, then enables and restarts it. - Hardware permissions β adds the deploy user to the
gpiogroup, copies99-act-led.rulesto/etc/udev/rules.d/, and resets the ACT LED trigger.
After the first successful deploy, SSH into the Pi and fill in your API key:
ssh pi@raspberrypi.local
nano ~/zeroclaw/.env
# Set: ANTHROPIC_API_KEY=sk-ant-...
sudo systemctl restart zeroclawThe .env is loaded by the systemd service as an EnvironmentFile.
Once the service is running the gateway listens on port 8080.
curl http://raspberrypi.local:8080/healthcurl -s -X POST http://raspberrypi.local:8080/api/chat \
-H 'Content-Type: application/json' \
-d '{"message": "What is the CPU temperature?"}' | jq .curl -N -s -X POST http://raspberrypi.local:8080/api/chat \
-H 'Content-Type: application/json' \
-H 'Accept: text/event-stream' \
-d '{"message": "List connected hardware devices", "stream": true}'ssh pi@raspberrypi.local 'journalctl -u zeroclaw -f'ZeroClaw is deployed with the peripheral-rpi feature, which enables two LLM-callable tools:
gpio_readβ reads a GPIO pin value via sysfs (/sys/class/gpio/...).gpio_writeβ writes a GPIO pin value.
These tools let the agent directly control hardware in response to natural-language instructions.
The udev rule 99-act-led.rules grants the gpio group write access to:
/sys/class/leds/ACT/trigger
/sys/class/leds/ACT/brightness
This allows toggling the Pi's green ACT LED without sudo.
If a Total Phase Aardvark adapter is connected, the hardware feature enables I2C/SPI communication with external devices. No extra setup is needed β the device is auto-detected via USB.
| Remote path | Source | Description |
|---|---|---|
~/zeroclaw/zeroclaw |
compiled binary | Main agent binary |
~/zeroclaw/.env |
created on first deploy | API key and environment variables |
~/.zeroclaw/config.toml |
rpi-config.toml |
Agent configuration |
/etc/systemd/system/zeroclaw.service |
zeroclaw.service |
systemd service unit |
/etc/udev/rules.d/99-act-led.rules |
99-act-led.rules |
ACT LED permissions |
rpi-config.toml is the production config template. Key defaults:
- Provider:
anthropic-custom:https://api.z.ai/api/anthropic - Model:
claude-3-5-sonnet-20241022 - Autonomy:
full - Allowed shell commands:
git,cargo,npm,mkdir,touch,cp,mv,ls,cat,grep,find,echo,pwd,wc,head,tail,date
To customise, edit ~/.zeroclaw/config.toml directly on the Pi and restart the service.
ssh pi@raspberrypi.local 'sudo systemctl status zeroclaw'
ssh pi@raspberrypi.local 'journalctl -u zeroclaw -n 50 --no-pager'Make sure the deploy user is in the gpio group and that a fresh login session has been started:
ssh pi@raspberrypi.local 'groups'
# Should include: gpioIf the group was just added, log out and back in, or run newgrp gpio.
Re-run the deploy script. Confirm the target:
ssh pi@raspberrypi.local 'file ~/zeroclaw/zeroclaw'
# Expected: ELF 64-bit LSB pie executable, ARM aarch64CROSS_TOOL=zigbuild RPI_HOST=raspberrypi.local ./scripts/deploy-rpi.sh
# or
CROSS_TOOL=cross RPI_HOST=raspberrypi.local ./scripts/deploy-rpi.shcargo zigbuild --release \
--target aarch64-unknown-linux-gnu \
--features hardware,peripheral-rpi