logo
2
2
WeChat Login
docs: update all documentation to reflect current codebase

RT-Claw

Making AI Assistants Cheap Again

Discord QQ Group Telegram Bilibili MIT License

中文 | English

RT-Claw is an OpenClaw-inspired intelligent assistant for embedded devices. Multi-RTOS support via OSAL. Build swarm intelligence with networked nodes. ESP32-S3 WiFi support adapted from MimiClaw.

Deploy your own AI assistant on hardware that costs just one dollar — seamlessly integrated into your daily workflow, efficiently bridging the digital and physical worlds.

RT-Claw Demo — AI drawing on LCD via Tool Use

Architecture · ESP32-C3 QEMU Guide · Contributing · Coding Style

Core Idea

rt-claw brings intelligence from the cloud to the edge through low-cost embedded nodes and swarm networking. Each node can sense the world, collaborate with others, and execute control tasks in real time.

RT-Claw exposes atomized hardware capabilities — GPIO, sensors, LCD, networking — as tools that an LLM can dynamically orchestrate. Adapt to any scenario without writing, compiling, or flashing embedded code again.

Features

FeatureDescriptionStatus
LLM Chat EngineInteractive conversation with Claude API over HTTPDone
Tool UseLLM-driven hardware control (GPIO, system info, LCD, audio, scheduler, HTTP) via function calling; 30+ built-in toolsDone
LCD Graphics320x240 RGB565 framebuffer with text, shapes, and drawing primitives; AI agent can draw on screen via tool callsDone
OLED DisplaySSD1306 I2C OLED driver for xiaozhi-xmini boardDone
AudioES8311 codec driver with preset sound effects (success, error, notify, alert); AI-controllable volume and beepDone
Chat-first ShellUART REPL with insert-mode editing, tab completion, UTF-8 support; direct input goes to AI, /commands for systemDone
OSALWrite once, run on FreeRTOS and RT-Thread with zero code changesDone
GatewayThread-safe message routing between servicesDone
NetworkingEthernet + HTTP client on ESP32-C3 QEMU; WiFi on real hardwareDone
Multi-Model APISupport mainstream LLM APIs: Claude, GPT, Gemini, DeepSeek, GLM, MiniMax, Grok, Moonshot, Baichuan, Qwen, Doubao, Llama (Ollama)Planned
Web Config PortalLightweight built-in web page for configuring API keys, selecting models, and tuning parameters at runtimePlanned
Swarm IntelligenceNode discovery, heartbeat, capability bitmap, remote tool invocation across nodesIn Progress
Conversation MemoryShort-term RAM ring buffer + long-term NVS Flash persistent storage; AI can save/delete/list memoriesDone
Skill MemoryNodes learn and recall frequently used operation patternsIn Progress
Scheduled TasksTimer-driven task execution and periodic automation; AI can create/list/remove tasksDone
IM IntegrationsFeishu (Lark) via WebSocket long connection; planned: DingTalk, QQ, TelegramIn Progress
Claw Skill ProviderServe as a skill for other Claws, giving them the ability to sense and control the physical worldPlanned

Architecture

+--------------------------------------------------------------+ | rt-claw Application | | gateway | swarm | net | ai_engine | tools | shell | sched | | feishu | heartbeat | lcd | audio | memory | skill | +--------------------------------------------------------------+ | osal/claw_os.h (OSAL API) | +-------------------+------------------------------------------+ | FreeRTOS (IDF) | RT-Thread | +-------------------+------------------------------------------+ | ESP32-C3 / S3 | QEMU vexpress-a9 | | WiFi / BLE / OLED | Ethernet / UART | | Audio (ES8311) | | +-------------------+------------------------------------------+

Supported Platforms

PlatformTargetRTOSBuildStatus
ESP32-C3QEMU (Espressif fork)ESP-IDF + FreeRTOSMeson + CMakeAI + Ethernet verified
ESP32-S3QEMU (Espressif fork)ESP-IDF + FreeRTOSMeson + CMakeAI + Ethernet verified
ESP32-C3Real hardwareESP-IDF + FreeRTOSMeson + CMakeUntested
ESP32-S3Real hardwareESP-IDF + FreeRTOSMeson + CMakeUntested
QEMU vexpress-a9QEMURT-ThreadMeson + SConsBoot + Ethernet verified

Note: upstream STM32 QEMU boards were evaluated on QEMU 10.2.x but are not listed here yet because Ethernet is still unimplemented there, so rt-claw cannot provide QEMU networking on those machines today.

Quick Start

ESP32-S3 Real Hardware (WiFi + PSRAM)

Requires an ESP32-S3 board with 16 MB flash and 8 MB PSRAM (e.g. ESP32-S3-DevKitC-1).

1. Install system dependencies + ESP-IDF

# Ubuntu / Debian sudo apt install git wget flex bison gperf python3 python3-venv \ cmake ninja-build ccache libffi-dev libssl-dev dfu-util \ libusb-1.0-0 meson # One-line ESP-IDF setup (clones ESP-IDF v5.4, installs toolchain) ./scripts/setup-esp-env.sh

2. Configure API key

source $HOME/esp/esp-idf/export.sh idf.py -C platform/esp32s3 menuconfig # Navigate: Component config → rt-claw Configuration → AI Engine # → API Key / API URL / Model

3. Configure WiFi

Option A — build-time defaults (menuconfig):

idf.py -C platform/esp32s3 menuconfig # Navigate: Component config → rt-claw Configuration → WiFi # → Default WiFi SSID # → Default WiFi password

Option B — runtime via shell (saved to NVS, survives reboot):

/wifi_set <SSID> <PASSWORD>

NVS credentials (Option B) take priority over build-time defaults. If neither is configured, the device boots offline and waits for /wifi_set.

4. Build

make esp32s3

5. Flash and monitor

# Flash (auto-detects serial port) make flash-esp32s3 # Serial monitor (Ctrl+] to exit) make monitor-esp32s3 # Or specify a port explicitly idf.py -C platform/esp32s3 -p /dev/ttyUSB0 flash monitor

6. Shell commands

CommandDescription
(direct input)Send message to AI
/ai_set key|url|model <v>Set AI API config (persisted to NVS)
/ai_statusShow current AI config
/feishu_set <id> <secret>Set Feishu credentials (reboot to apply)
/feishu_statusShow Feishu config
/wifi_set <SSID> <PASS>Save WiFi credentials to NVS
/wifi_statusShow connection state and IP
/wifi_scanScan nearby access points
/remember <key> <value>Save fact to long-term memory
/forget <key>Delete fact from long-term memory
/memoriesList all long-term memories
/taskList scheduled tasks (or /task rm <name> to remove)
/skillList or execute a skill
/nodesShow swarm node table
/log [on|off]Toggle log output
/historyShow conversation message count
/clearClear conversation memory
/helpList all commands

ESP32-C3 (ESP-IDF + QEMU)

No hardware? No problem. Open cnb.cool/gevico.online/rtclaw/rt-claw to launch a CNB Cloud-Native IDE with all toolchains pre-installed. Build and run RT-Claw on QEMU directly in your browser.

1. Install system dependencies

# Ubuntu / Debian sudo apt install git wget flex bison gperf python3 python3-venv \ cmake ninja-build ccache libffi-dev libssl-dev dfu-util \ libusb-1.0-0 libgcrypt20-dev libglib2.0-dev libpixman-1-dev \ libsdl2-dev libslirp-dev meson # Arch Linux sudo pacman -S --needed libgcrypt glib2 pixman sdl2 libslirp \ python cmake ninja gcc git wget flex bison meson

2. Install ESP-IDF + QEMU

# One-line setup (clones ESP-IDF v5.4, installs toolchain + QEMU) ./scripts/setup-esp-env.sh

3. Choose a configuration preset

PresetFileShellFeishuDescription
Quick Demosdkconfig.defaults.demoOnOffInteractive terminal with full AI agent
Feishu Botsdkconfig.defaults.feishuOffOnHeadless IM bot, saves RAM
Defaultsdkconfig.defaultsOffOffMinimal base for custom builds
source $HOME/esp/esp-idf/export.sh # Pick one: cp platform/esp32c3/boards/qemu/sdkconfig.defaults.demo \ platform/esp32c3/boards/qemu/sdkconfig.defaults # Quick Demo # cp platform/esp32c3/boards/qemu/sdkconfig.defaults.feishu \ # platform/esp32c3/boards/qemu/sdkconfig.defaults # Feishu Bot idf.py -C platform/esp32c3 -B build/esp32c3-qemu/idf -DRTCLAW_BOARD=qemu set-target esp32c3

All presets include: AI engine, Tool Use, swarm heartbeat, scheduler, LCD, skills, and boot-time AI connectivity test.

4. Configure API key

Option A — environment variables (all platforms):

export RTCLAW_AI_API_KEY='<your-api-key>' export RTCLAW_AI_API_URL='https://api.anthropic.com/v1/messages' export RTCLAW_AI_MODEL='claude-sonnet-4-6'

Option B — ESP-IDF menuconfig:

idf.py -C platform/esp32c3 -B build/esp32c3-qemu/idf -DRTCLAW_BOARD=qemu menuconfig # Navigate: Component config → rt-claw Configuration → AI Engine

Option C — Meson option:

meson configure build/esp32c3-qemu/meson -Dai_api_key='<your-api-key>'

5. (Optional) Configure Feishu bot

Option A — environment variables:

export RTCLAW_FEISHU_APP_ID='<your-app-id>' export RTCLAW_FEISHU_APP_SECRET='<your-app-secret>'

Option B — ESP-IDF menuconfig:

idf.py -C platform/esp32c3 -B build/esp32c3-qemu/idf -DRTCLAW_BOARD=qemu menuconfig # Navigate: Component config → rt-claw Configuration → Feishu (Lark) Integration

Create an app on Feishu Open Platform, enable Event Subscription → Long Connection mode, and subscribe to im.message.receive_v1. The device establishes a WebSocket long connection on boot — no public IP required.

6. Build and run

# Unified build (recommended) make build-esp32c3-qemu # Run on QEMU make run-esp32c3-qemu # Or flash to real hardware (untested) idf.py -C platform/esp32c3 -p /dev/ttyUSB0 flash monitor

QEMU vexpress-a9 (RT-Thread)

# Prerequisites: arm-none-eabi-gcc, qemu-system-arm, scons, meson, ninja # Configure via env vars (picked up at build time) export RTCLAW_AI_API_KEY='<your-key>' # Unified build make vexpress-a9-qemu # Start API proxy (RT-Thread has no TLS, proxy forwards HTTP->HTTPS) python3 scripts/api-proxy.py https://api.anthropic.com & # Run make run-vexpress-a9-qemu

Project Structure

rt-claw/ ├── meson.build # Meson build definition (cross-compiles claw + osal) ├── meson_options.txt # Meson build options (osal backend, features, AI config) ├── Makefile # Unified build entry (make build-esp32c3-qemu / make vexpress-a9-qemu) ├── include/ # Unified public headers (aligned with claw/ and osal/) │ ├── claw/ # Public headers for claw/ │ │ ├── claw_config.h # Project configuration │ │ ├── claw_init.h # Boot entry API │ │ ├── core/ # Gateway, scheduler, service interface │ │ ├── services/ # AI, net, swarm, IM service headers │ │ ├── shell/ # Shared shell command headers │ │ └── tools/ # Tool Use framework headers │ └── osal/ # Public headers for osal/ │ ├── claw_os.h # OSAL API │ └── claw_net.h # Network abstraction ├── osal/ # OS Abstraction Layer │ ├── freertos/ # FreeRTOS implementation │ └── rtthread/ # RT-Thread implementation ├── claw/ # Platform-independent core │ ├── claw_init.c # Boot entry point │ ├── core/ # Gateway, scheduler, heartbeat │ ├── services/ai/ # LLM chat engine, memory, skill │ ├── services/net/ # Network service │ ├── services/swarm/ # Swarm intelligence │ ├── services/im/ # IM integrations (Feishu) │ ├── shell/ # UART REPL shell │ └── tools/ # Tool Use framework (GPIO, system, LCD, audio, scheduler, HTTP) ├── drivers/ # Hardware drivers (Linux-kernel style) │ ├── audio/espressif/ # ES8311 audio codec │ ├── display/espressif/ # SSD1306 OLED display │ ├── net/espressif/ # Shared WiFi driver (C3/S3) │ └── serial/espressif/ # Serial console ├── platform/ │ ├── common/espressif/ # Shared Espressif board helpers (WiFi init) │ ├── esp32c3/ # ESP32-C3 unified platform (boards/qemu/devkit/xiaozhi-xmini/) │ ├── esp32s3/ # ESP32-S3 unified platform (boards/qemu/default/) │ └── vexpress-a9/ # RT-Thread BSP (Meson + SCons) ├── vendor/ │ ├── lib/cjson/ # cJSON library │ └── os/ │ ├── freertos/ # FreeRTOS-Kernel (submodule) │ └── rt-thread/ # RT-Thread (submodule) ├── docs/ │ ├── en/ # English documentation │ └── zh/ # Chinese documentation └── scripts/ ├── api-proxy.py # HTTP→HTTPS proxy for QEMU (no TLS on RT-Thread) ├── setup-esp-env.sh # Install ESP-IDF + QEMU ├── gen-esp32c3-cross.py # Auto-generate Meson cross-file from ESP-IDF └── ...

Community

Join the GTOC (Gevico Open-Source Community) channels:

Documentation

License

MIT