How it works
三步,从一块板子到 Agent 的外设
01
烧录固件
02
绑定设备
03
交给 Agent
Architecture
模型在云端,执行在边缘
Agent
你的 AI Agent
- 读 skill.md 学会调用
- 持有 oct_ 令牌,不碰密码
- 写 Lua、部署、读事件
HTTPSoct_…
Control plane
控制面(FastAPI)
- 设备、脚本、事件、位图
- 每台设备独立 token
- MIT,可自建
long-polldevice_token
Edge
ESP32-S3 板子
- Lua 运行时 + 插件
- 屏幕 / 音频 / 传感器 / 按键
- emit() 回报事件
gfx.*audio.*sensors()input.*http.*emit()gfx.imageble / padHardware
一棵代码树,三种构建环境
esp32-s3-bare
任意 ESP32-S3 模组
- 16MB flash + 八线 PSRAM
- 只有核心:云通道、Lua、HTTP、事件
- gfx / audio 调用安全空转
MIT
esp32-s3-rlcd-42
Waveshare ESP32-S3-RLCD-4.2
- ST7305 反射屏 400×300,约 140ms 一帧
- ES8311 音频、温湿度、按键
- BLE 手柄 OC-Snake
MIT
esp32-s3-epaper-397
Waveshare ESP32-S3-ePaper-3.97
- 800×480 墨水屏,局刷
- ES8311 音频
- 同一份 Lua,gfx.slow() 自动放慢
链接 GxEPD2,此环境的固件按 GPL-3.0 分发
Code
应用就是一段 Lua
hello.lua
function on_start() gfx.clear(0) gfx.text(12, 30, "hello from my agent", 1) gfx.fill_circle(gfx.W // 2, 150, 40, 1) gfx.flush() audio.beep(1000, 80) end function on_loop() local s = sensors() if input.key() then emit("pressed", { temp = s.temp_c }) end return 200 -- ms until next tick end
agent → deploy
curl -X POST $BASE/api/scripts \ -H "Authorization: Bearer oct_…" \ -H "Content-Type: application/json" \ -d '{ "name": "hello", "language": "lua", "mode": "loop", "device_id": "YOUR_DEVICE_ID", "source": "…hello.lua…" }' # then read what the board reported curl $BASE/api/events \ -H "Authorization: Bearer oct_…"