Install
openclaw skills install smartpi-plugin-setupopenclaw-smartpi 插件完整安装、配置与故障排查指南。当用户需要安装 openclaw-smartpi 插件、通过微信扫码绑定 SmartPi 设备、处理 SmartPi 连接问题(特别是错误码 9002)、管理 SmartPi 设备(查看/删除)、或设置语音与 OpenClaw 交互时触发此 skill。
openclaw skills install smartpi-plugin-setupopenclaw-smartpi 插件允许用户通过 SmartPi 语音设备与 OpenClaw 交互。用户说话后音频通过 WebSocket 传到 OpenClaw,AI 回复后通过同一连接返回,SmartPi 设备播报语音回复。
openclaw plugins install openclaw-smartpi
openclaw gateway restart
重启后插件加载,可通过 openclaw plugins list 确认 openclaw-smartpi 状态为 enabled。
openclaw smartpi accounts bind
执行后:
bindingId(有效期 30 分钟)绑定ID: 后面的 bindingId,生成 QR 图片(见下方)绑定成功,自动建立 WebSocket 长连接设备信息保存在:
~/.xxclaw/openclaw-smartpi/accounts/<deviceKey>.json
终端打印的 QR 码为 ASCII 格式,无法直接扫描。需从命令输出中提取 绑定ID: 后面的 bindingId,生成 PNG 图片供微信扫码。
方法(Python qrcode 库):
import qrcode
binding_id = "6b20121312b600a96a75e636d5222079" # 替换为实际 bindingId
img = qrcode.make(binding_id)
img.save("C:/Users/15352/.qclaw/workspace/smartpi_qr.png")
print("Done")
方法(Node.js qrcode 包):
npm install -g qrcode
node -e "const QR = require('qrcode'); QR.toFile('C:/Users/15352/.qclaw/workspace/smartpi_qr.png', '绑定ID', {type: 'png'}, (err) => { if(err) console.error(err); else console.log('Done'); });"
生成后,将 smartpi_qr.png 发送给用户扫描。
openclaw smartpi accounts list
正常输出:
SmartPi 设备列表:
- JL_17T_xxxx
同时检查 Gateway 日志中是否有 WebSocket connected: <deviceKey>。
确保 Gateway 正在运行:
openclaw gateway status
对着 SmartPi 设备说话,QClaw 会处理输入并以语音回复。
可能原因:
openclaw-smartpi 插件安装后未重启 Gateway,或插件加载失败bindId 或 token 未正确保存,导致后续消息验证失败排查步骤:
# 1. 确认插件已加载
openclaw plugins list
# 确认 openclaw-smartpi 状态为 enabled
# 2. 确认设备已绑定且连接正常
openclaw smartpi accounts list
# 检查网关日志:openclaw gateway status
# 日志中应有:[gateway] WebSocket connected: <deviceKey>
# 3. 确认 AI 模型已配置(能正常回复消息)
test: 直接向 OpenClaw 发一条消息,确认 AI 能正常回复
# 4. 重启 Gateway 重刷连接
openclaw gateway restart
# 重启后再次检查设备连接状态
若以上都正常,查看 OpenClaw 日志中是否有错误信息:~/.openclaw/logs/openclaw-YYYY-MM-DD.log
openclaw smartpi accounts bindopenclaw smartpi accounts list插件内置指数退避重连(1s → 2s → 4s... 最大 60s),一般会自动恢复。若频繁断开:
查看已绑定设备:
openclaw smartpi accounts list
删除设备:
openclaw smartpi accounts remove <deviceKey>
卸载插件前,请先移除已绑定的设备账户(否则残留账户文件可能导致重新安装后行为异常)。
# 1. 查看当前绑定的设备
openclaw smartpi accounts list
# 2. 逐一删除所有设备账户
openclaw smartpi accounts remove <deviceKey>
# (如有多个设备,重复此命令逐一删除)
# 3. 确认账户目录已清空
openclaw smartpi accounts list
# 应输出空列表
# 4. 卸载插件
openclaw plugins uninstall openclaw-smartpi
# 5. 重启 Gateway
openclaw gateway restart
如需彻底清理,可手动删除残留文件:
Remove-Item -Recurse -Force "$env:USERPROFILE\.xxclaw\openclaw-smartpi"
| 文件 | 路径 |
|---|---|
| 账号数据 | ~/.xxclaw/openclaw-smartpi/accounts/<deviceKey>.json |
| 账号索引 | ~/.xxclaw/openclaw-smartpi/accounts.json |
| 日志 | ~/.xxclaw/logs/openclaw-YYYY-MM-DD.log |
sendText 未实现:SmartPi 是被动接收模式(设备说话 → OpenClaw 回复),不支持主动发送文本