Hardware subsystem
ZeroClaw’s hardware subsystem lets the agent control microcontrollers, SBCs, and peripherals directly. Enable with --features hardware.
What’s supported
The hardware subsystem identifies boards by USB VID/PID. The boards in the canonical registry:
| Board | Architecture | USB VID:PID |
|---|---|---|
nucleo-f401re | ARM Cortex-M4 | 0x0483:0x374b |
nucleo-f411re | ARM Cortex-M4 | 0x0483:0x3748 |
arduino-uno | AVR ATmega328P | 0x2341:0x0043 |
arduino-uno | Arduino Uno Q / ATmega328P | 0x2341:0x0078 |
arduino-mega | AVR ATmega2560 | 0x2341:0x0042 |
cp2102 | USB-UART bridge | 0x10c4:0xea60 |
cp2102n | USB-UART bridge | 0x10c4:0xea70 |
esp32 | ESP32 (CH340) | 0x1a86:0x7523 |
esp32 | ESP32 (CH340) | 0x1a86:0x55d4 |
Transports the subsystem speaks:
| Transport | Description |
|---|---|
serial | Newline-delimited JSON over USB CDC serial |
swd | SWD debug probe (probe-rs) |
uf2 | UF2 mass-storage firmware flashing |
native | Direct Linux GPIO/I2C/SPI (rppal, sysfs) |
aardvark | Total Phase Aardvark USB adapter (I2C/SPI/GPIO) |
See Peripherals design for the architecture and the per-board setup guides (Nucleo, Arduino Uno Q, Aardvark, Raspberry Pi, Android) for wiring each one up.
Enabling
At compile time:
sh
cargo build --release --features hardware
The hardware features are hardware (core subsystem), peripheral-rpi
(Raspberry Pi native GPIO), and probe (probe-rs SWD introspection). See the
Config reference for the per-board config fields.
Runtime tools
With the hardware feature, the agent gains these built-in tools:
gpio_readgpio_writepico_flashdevice_read_codedevice_write_codedevice_exec
When an Aardvark adapter is connected at startup, these additional tools load:
i2c_scani2c_readi2c_writespi_transfergpio_aardvarkdatasheet
All tool invocations go through the same security policy as any other tool. Hardware tools only reach the device paths explicitly listed in [[peripherals.boards]] entries:
Running on a Raspberry Pi
The most common hardware target. A minimal setup:
sh
# install
curl -fsSL https://raw.githubusercontent.com/zeroclaw-labs/zeroclaw/master/install.sh | bash
# add yourself to hardware groups (re-login after)
sudo usermod -aG gpio,spi,i2c $USER
# install as user service (ensures hardware group membership is inherited)
zeroclaw service install
The stock systemd unit sets SupplementaryGroups=gpio spi i2c.
Safety
Hardware tools can brick things. Real, expensive things.
pico_flashwrites firmware; a bad image can brick the board. The tool requires operator approval atSupervisedautonomy regardless of autonomy level; there’s no way to auto-approve it.i2c_write/spi_transferto device addresses the agent doesn’t know can damage sensors.- GPIO writes that conflict with external drivers (voltage fights) damage pins.
For production deployments with untrusted channels exposed, keep hardware tools off non-CLI channels via the global autonomy.non_cli_excluded_tools list (the schema has no per-channel tools_deny field). Tools listed there are omitted from the tool specs sent to the model on every non-CLI channel (Discord, Telegram, Bluesky, etc.). The local CLI still sees them.
Datasheets
Per-board pin maps and electrical characteristics:
- STM32 Nucleo-F401RE: https://www.st.com/en/evaluation-tools/nucleo-f401re.html
- Arduino Uno Q: https://docs.arduino.cc/hardware/uno-q
- Raspberry Pi GPIO: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio
- ESP32: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf