本文来源:https://mp.weixin.qq.com/s/fMiyi1GKTBtVDMsr_fddlQ
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
如果说传统物联网设备是一个只会听令行事的士兵,那 ESP-Claw 想做的,是给每块芯片配一个随身参谋。

▲ 从传统 IoT 到边缘 Agent 的范式迁移
一块十块钱的芯片,凭什么做 AI Agent?
先不急着聊工艺,笔者回忆一下:大多数 IoT 设备的"智能"是怎么来的?传感器采集数据 → 上传云端 → 云端 AI 做决策 → 下发指令 → 设备执行。这套链路跑通了很多年,但它有两个绕不开的坑——延迟和隐私。智能灯要等两秒才亮,语音助手断网就变傻子,摄像头画面全量上云让人心里发毛。
乐鑫的工程师显然也烦透了这种架构。所以他们搞了 ESP-Claw——一个直接跑在 ESP32 芯片上的 AI Agent 框架。
说人话就是:你对着聊天软件发一句话,芯片自己理解、自己决策、自己执行。全程不经过任何云服务器(除了大模型推理本身)。ESP32-S3 一颗芯片不到十块钱,配上 ESP-Claw 就成了一个能聊天的"微型决策中心"。
💡 一句话理解 ESP-Claw:用 C 语言重写的轻量 AI Agent 运行时,跑在 ESP32 上,借助 IM 聊天控制设备行为。灵感来自 OpenClaw,但针对嵌入式情形从零构建。
Chat Coding:聊天窗口里开发硬件
ESP-Claw 把这件事叫 "Chat Coding"——用聊天来创造设备行为。
以前的玩法:想让温湿度传感器在超 30 度时开风扇,你得写代码、编译、烧录、调试。ESP-Claw 是:
📱 "当温度超过 30 度的时候,帮我把风扇打开,顺便在群里通知一下人们。"
微信或 Telegram 里发句话,设备自己搞定。IM 消息触发 Agent Loop → LLM 推理生成 Lua 脚本 → 动态加载运行。不用写一行代码。
底层靠动态 Lua 脚本加载。Agent 依据聊天上下文生成 Lua 代码,设备端 Lua 虚拟机即时解释执行——不编译、不重启、不等 OTA。
事件驱动 + 本地记忆
ESP-Claw 内置事件驱动引擎。GPIO 电平变化、定时器、传感器阈值、IM 新消息……都能触发 Agent Loop。官方数据是毫秒级响应。
另一个值得说的外观:结构化记忆。大模型本身无状态,但设备运行是连续的——上次传感器读到多少?昨天使用者设的阈值是什么?每次都塞 prompt 里,token 受不了。
ESP-Claw 把记忆存在设备本地,检索时按相关性取用。官方文档反复提到——"隐私不上云"。传感器数据、聊天上下文、行为习惯,全留在你自己的芯片上。

▲ ESP-Claw 跑在 ESP32-S3 面包板上
MCP 通讯:让设备开口说"标准话"
如果你关注过 AI Agent 领域,应该对 MCP(Model Context Protocol)不陌生。它是 Anthropic 提出的一套标准化协议,让大模型和外部工具之间有一个通用的"对话语言"。
ESP-Claw 把 MCP 完整地搬到了嵌入式设备上,而且做了一个很聪明的外观:设备同时充当 MCP Server 和 MCP Client。
🖥️ 作为 Server:上位机或云端 Agent 可以借助 MCP 协议发现并调用 ESP32 上的资源——"这设备有几个 GPIO?能读温度吗?帮我打开继电器"——全部标准化交互。
📡 作为 Client:ESP32 自己也能主动调用外部 MCP 服务。例如设备发现需要查询天气数据,它可以自己去找天气 MCP Server 要结果,然后据此决策。
这种双向能力意味着 ESP-Claw 设备不是平台里的"哑终端",而是能主动发起协作的参与者。多个 ESP-Claw 设备之间也可以借助 MCP 相互调用——一台充当传感器网关,另一台做执行器,再来一台当表明器,自己组网自己协商。
能接哪些大模型?能连哪些聊天软件?
先说模型侧。ESP-Claw 兼容 OpenAI 风格 API 和 Anthropic 风格 API 两条主流路线,这意味着市面上绝大多数模型都能接:
GPTClaudeQwen / 通义千问DeepSeek自定义 Endpoint
官方建议使用工具调用能力强的模型,文档里点名了几个:GPT-5.4、Qwen3.6-Plus、Claude 4.6 Sonnet、DeepSeek V4 Pro。当然,你完全可以用阿里云百炼上的通义千问,合规、便宜、延迟低。
IM 平台维度,当下已经打通了Telegram、QQ、飞书、微信四条通道,架构上预留了扩展接口,想接钉钉或 Discord 也不会太麻烦。
浏览器一键烧录
乐鑫做了个在线烧录工具:选板子、配 Wi-Fi、填 API Key、点烧录。不装任何开发环境。
已适配 ESP32-S3、ESP32-P4、ESP32-C5 系列,面包板和 M5Stack CoreS3 兼容。没适配的板子或需要本地工具链的芯片(例如 ESP32-P4),官方有完整的本地编译文档。
项目结构:application/ 应用代码,components/ 可复用模块,docs/ 文档站,还有个 pages/simulator/ 网页模拟器。模块独立裁剪,扩展点清楚。

▲ ESP-Claw 面包板组装示意图
物料清单
想搭一套自己的 ESP-Claw?下面是官维度包板思路的物料。核心器件 ESP32-S3 开发板十几块钱,总成本很低。
必需硬件
🔧 ESP32-S3 开发板 — 选 N8R8(8MB Flash + 8MB PSRAM)。N8 = 8MB Flash,R2 = 2MB PSRAM,跑 ESP-Claw 至少要 8MB Flash + 8MB PSRAM。官方建议 ESP32-S3-DevKitC-1,引脚多,面包板友好。淘宝乐鑫官方店有,选「1-N8R8」,别碰带 U 后缀的型号。
🔧 面包板 — 400 孔以上,建议多备一块接外设。
🔧 杜邦线 / 跳线 — 公母头都备点,线多不压身。

▲ ESP32-S3-DevKitC-1 开发板(选 N8R8)
可选外设
🖥️ 表明屏 — ST7789 SPI 彩色屏,2.0 英寸、240×320、8 脚蓝板模块带排针。在线烧录固件已适配,买同款省事,接 3V3 供电。
📷 USB 摄像头 — 兼容 USB-UVC 协议。乐鑫官方店有适配型号,顺便买根 MX1.25 4Pin 单头端子线(公头)。模型不兼容视觉也没关系,拍到的画面能推给使用者。
🎤 麦克风 & 扬声器 — ESP-Claw 兼容 USB-UAC 音频。乐鑫官方 USB 摄像头模组上预留了麦克风和扬声器的 MX1.25 2Pin 口,插上就用。
💡 WS2812 灯带 / 灯环 — 开发板自带一颗 WS2812 LED,还能外接灯环。别接太长,供电扛不住。
🔩 舵机 — 普通舵机就行。5V 供电,PWM 信号接 GPIO47。

▲ WS2812 灯环
💰 成本:ESP32-S3-DevKitC-1 约 ¥15-25,面包板 + 杜邦线约 ¥10。能跑 AI Agent 的完整硬件平台不到 40 块。加表明屏、摄像头全套也就百元出头。
组装步骤
物料齐了,开装。全程不用焊,面包板 + 杜邦线搞定:
1. 装开发板
ESP32-S3-DevKitC-1 放面包板正中间,左右各留一排空孔给外设。对齐引脚按下去就行。
2. 接表明屏(可选)
ST7789 按接线图连开发板,供电接 3V3,别插 5V。官方建议款显示屏,引脚顺序固件已适配,即插即用。
3. 接 USB 摄像头(可选)
GPIO20 → USB D+,GPIO19 → USB D-,供电从 5V 引脚取。乐鑫官方摄像头模组:近 USB 口的 2Pin 座接扬声器,另一侧 2Pin 座接麦克风。
4. 接 WS2812 灯带 / 灯环(可选)
DATA IN 接 GPIO14,供电从 5V 引脚取。配合事件引擎能做「收到消息闪一下」「温度告警变红」之类的成效。
5. 接舵机(可选)
5V 供电,PWM 信号线接 GPIO47。
⚡ 接线速查:表明屏 → 3V3 | 摄像头 → GPIO20/19 + 5V | WS2812 → GPIO14 + 5V | 舵机 → GPIO47 + 5V
硬件搭好,打开 esp-claw.com 在线烧录工具,选板子、配 Wi-Fi、填 API Key、点烧录。从零到跑通,半小时。
GitHub 上的反馈怎么样?
当下项目拿到了 1,900+ Star、390 Fork,741 次提交,更新频率相当高。社区已经有人在 M5Stack CoreS3 上跑通了完整的 Chat Coding 闭环,也有人把 ESP-Claw 接进了自己的智能家居平台。
开发团队保持开放态度:你可以直接在 GitHub 提 Issue,也可以借助飞书问卷反馈想法。他们还维护了一份公开的 TODO List,社区成员可以投票影响开发优先级——这对于一个企业主导的开源项目来说,诚意是够的。
能做什么?
🔗 项目地址:github.com/espressif/esp-claw | 在线烧录:esp-claw.com | 许可证:Apache 2.0
This article is sourced from: https://mp.weixin.qq.com/s/fMiyi1GKTBtVDMsr_fddlQ If there are copyright issues, please notify us via email: 13951431913#139.com or submit a comment on the right.
If traditional IoT devices are soldiers that only follow orders, then what ESP-Claw wants to do is give every chip a personal staff assistant.
▲ Paradigm shift from traditional IoT to edge Agent
A chip that costs ten yuan — how can it be an AI Agent?
Let's not rush into the technical details. Let me recall how the "intelligence" of most IoT devices comes about: sensors collect data → upload to the cloud → cloud AI makes decisions → sends commands → the device executes. This pipeline has worked for many years, but it has two unavoidable problems — latency and privacy. Smart lights take two seconds to turn on, voice assistants become useless when offline, and uploading full camera footage to the cloud makes people uneasy.
Espressif's engineers are clearly fed up with this architecture too. So they built ESP-Claw — an AI Agent framework that runs directly on ESP32 chips.
In plain terms: you send a message in a chat app, and the chip understands, decides, and executes on its own. No cloud server is involved in the entire process (except for the LLM inference itself). An ESP32-S3 chip costs less than ten yuan, and with ESP-Claw it becomes a "micro decision center" that can chat.
💡 ESP-Claw in one sentence: a lightweight AI Agent runtime rewritten in C, running on ESP32, using IM chat to control device behavior. Inspired by OpenClaw, but built from scratch for embedded scenarios.
Chat Coding: developing hardware inside a chat window
ESP-Claw calls this "Chat Coding" — using chat to create device behavior.
The old way: to make a temperature and humidity sensor turn on a fan when it exceeds 30 degrees, you had to write code, compile, flash, and debug. ESP-Claw is like this:
📱 "When the temperature goes above 30 degrees, turn on the fan for me and notify people in the group."
Send a message in WeChat or Telegram, and the device handles it itself. IM message triggers Agent Loop → LLM reasoning generates Lua script → dynamically loaded and executed. No need to write a single line of code.
Under the hood, it relies on dynamic Lua script loading. The Agent generates Lua code based on the chat context, and the Lua virtual machine on the device interprets and executes it immediately — no compilation, no reboot, no waiting for OTA.
Event-driven + local memory
ESP-Claw has a built-in event-driven engine. GPIO level changes, timers, sensor thresholds, new IM messages... all can trigger the Agent Loop. Official data claims millisecond-level response.
Another notable feature: structured memory. LLMs themselves are stateless, but device operation is continuous — what was the last sensor reading? What threshold did the user set yesterday? Stuffing everything into the prompt every time would be too much for tokens.
ESP-Claw stores memory locally on the device and retrieves it by relevance when needed. The official docs repeatedly emphasize — "privacy never leaves the device." Sensor data, chat context, and behavior habits all stay on your own chip.
▲ ESP-Claw running on an ESP32-S3 breadboard
MCP communication: letting devices speak "standard language"
If you follow the AI Agent field, you're probably familiar with MCP (Model Context Protocol). It's a standardized protocol proposed by Anthropic that gives LLMs and external tools a common "conversation language."
ESP-Claw brings MCP fully to embedded devices, and it does something clever: the device acts as both an MCP Server and an MCP Client.
🖥️ As a Server: a host computer or cloud Agent can discover and call ESP32 resources through the MCP protocol — "How many GPIOs does this device have? Can it read temperature? Turn on the relay for me" — all through standardized interaction.
📡 As a Client: the ESP32 can also actively call external MCP services. For example, if the device needs weather data, it can go find a weather MCP Server, get the result, and make decisions accordingly.
This bidirectional capability means ESP-Claw devices are not "dumb terminals" in a platform, but participants that can proactively initiate collaboration. Multiple ESP-Claw devices can also call each other via MCP — one acts as a sensor gateway, another as an actuator, and another as a display unit, forming a network and negotiating among themselves.
Which LLMs can it connect to? Which chat apps can it connect to?
Let's start with models. ESP-Claw is compatible with both the OpenAI-style API and the Anthropic-style API, the two mainstream routes, which means most models on the market can be connected:
GPT Claude Qwen / Tongyi Qianwen DeepSeek Custom Endpoint
Officially, models with strong tool-calling capabilities are recommended. The docs name a few: GPT-5.4, Qwen3.6-Plus, Claude 4.6 Sonnet, DeepSeek V4 Pro. Of course, you can also use Tongyi Qianwen from Alibaba Cloud Bailian — compliant, cheap, and low latency.
On the IM platform side, four channels are already integrated: Telegram, QQ, Feishu, and WeChat. The architecture has reserved extension interfaces, so integrating DingTalk or Discord shouldn't be too troublesome.
One-click browser flashing
Espressif built an online flashing tool: pick a board, configure Wi-Fi, fill in the API key, click flash. No development environment needed.
It already supports the ESP32-S3, ESP32-P4, and ESP32-C5 series, and is compatible with breadboards and the M5Stack CoreS3. For unsupported boards or chips that need a local toolchain (such as the ESP32-P4), the official documentation has complete local compilation guides.
Project structure: application/ for application code, components/ for reusable modules, docs/ for the documentation site, and a pages/simulator/ web-based simulator. Modules can be trimmed independently, and extension points are clear.
▲ ESP-Claw breadboard assembly diagram
Bill of materials
Want to build your own ESP-Claw? Here's the material list based on the official recommended board setup. The core component, the ESP32-S3 development board, costs about ten-plus yuan, so the total cost is very low.
Required hardware
🔧 ESP32-S3 development board — choose the N8R8 variant (8MB Flash + 8MB PSRAM). N8 = 8MB Flash, R2 = 2MB PSRAM. Running ESP-Claw requires at least 8MB Flash + 8MB PSRAM. The official recommendation is the ESP32-S3-DevKitC-1, which has plenty of pins and is breadboard-friendly. It's available from Espressif's official Taobao store; choose "1-N8R8" and avoid models with a U suffix.
🔧 Breadboard — 400+ holes; it's recommended to have an extra one for connecting peripherals.
🔧 Dupont wires / jumper wires — get both male and female ends; extra wires never hurt.
▲ ESP32-S3-DevKitC-1 development board (choose N8R8)
Optional peripherals
🖥️ Display — ST7789 SPI color screen, 2.0 inch, 240×320, 8-pin blue board module with pin headers. The online flashing firmware already supports it; buying the same model saves hassle. Connect to 3V3 power.
📷 USB camera — compatible with the USB-UVC protocol. Espressif's official store has compatible models; also grab an MX1.25 4Pin single-ended terminal wire (male). Even if the model doesn't support vision, the captured image can be pushed to the user.
🎤 Microphone & speaker — ESP-Claw supports USB-UAC audio. Espressif's official USB camera module has reserved MX1.25 2Pin ports for microphone and speaker; just plug them in.
💡 WS2812 LED strip / ring — the development board has one built-in WS2812 LED, and you can also connect an external LED ring. Don't make it too long; the power supply can't handle it.
🔩 Servo — a regular servo works fine. 5V power, PWM signal to GPIO47.
▲ WS2812 LED ring
💰 Cost: ESP32-S3-DevKitC-1 around ¥15-25, breadboard + Dupont wires around ¥10. A complete hardware platform that can run an AI Agent costs less than 40 yuan. Add the display and camera, and the full set is still just over 100 yuan.
Assembly steps
Once the materials are ready, start assembling. No soldering needed — breadboard and Dupont wires do the job:
1. Install the development board
Place the ESP32-S3-DevKitC-1 in the center of the breadboard, leaving one row of empty holes on each side for peripherals. Align the pins and press down.
2. Connect the display (optional)
Connect the ST7789 to the development board according to the wiring diagram. Power goes to 3V3, not 5V. For the officially recommended display, the firmware already matches the pin order, so it's plug-and-play.
3. Connect the USB camera (optional)
GPIO20 → USB D+, GPIO19 → USB D-, power from the 5V pin. On Espressif's official camera module: the 2Pin connector near the USB port goes to the speaker, and the 2Pin connector on the other side goes to the microphone.
4. Connect the WS2812 LED strip / ring (optional)
DATA IN goes to GPIO14, power from the 5V pin. Combined with the event engine, you can create effects like "blink when a message arrives" or "turn red on temperature alert."
5. Connect the servo (optional)
5V power, PWM signal wire to GPIO47.
⚡ Quick wiring reference: display → 3V3 | camera → GPIO20/19 + 5V | WS2812 → GPIO14 + 5V | servo → GPIO47 + 5V
Once the hardware is set up, open the esp-claw.com online flashing tool, pick a board, configure Wi-Fi, fill in the API key, and click flash. From zero to running, half an hour.
What do the GitHub reviews look like?
The project currently has 1,900+ Stars, 390 Forks, and 741 commits, with a fairly high update frequency. Community members have already run a complete Chat Coding loop on the M5Stack CoreS3, and others have integrated ESP-Claw into their own smart home platforms.
The development team stays open: you can file an Issue directly on GitHub, or send feedback through the Feishu questionnaire. They also maintain a public TODO List where community members can vote to influence development priorities — for an enterprise-led open source project, that's a good faith effort.
What can it do?
🔗 Project link: github.com/espressif/esp-claw | Online flashing: esp-claw.com | License: Apache 2.0