文档问题说明
文档中有一个错误示例:
错误示范(带下划线的指令无法解析)
volume-set {"role":"MCU","msgType":"status","status":70}
正确示范(下划线改为中划线)
volume_set {"role":"MCU","msgType":"status","status":70}
复现过程
1. 设置mcp工具
{"role":"MCU","msgType":"MCP","MCP":{"tools":[{"name":"Brightness","description":"调节屏幕亮度,范围0-100","inputSchema":{"properties":{"level":{"description":"亮度等级,0-100","type":"number","minimum":0,"maximum":100}}}}]}}
2. 查询温度时出现错误
[04:04:00] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":true,"emoji":"😊","emotion":"happy","text":"% Brightness..."}}
💬 AI语音: % Brightness...
[04:04:00] 原始数据: {"role":"AI board","msgType":"MCP","MCP":{"params":{"name":"Brightness","arguments":{}}}}
🎯 收到MCP指令:
设备: Brightness
参数: {}
🔍 查询指令
🌡️ 温度查询: 28°C
📤 发送响应: mcp-responsive {"role":"MCU","msgType":"status","status":28}
[04:04:01] 原始数据: {"role":"AI board","msgType":"status","status":"OK"}
📢 状态: OK
[04:04:01] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":true,"emoji":"😎","emotion":"cool","text":"当前屏幕亮度是20,稳稳的~"}}
💬 AI语音: 当前屏幕亮度是20,稳稳的~
问题一:根据测试 mcu的数据 没有上报
后台日志示例:
User
2025-11-02 04:07:23
光是否打开?
AI
2025-11-02 04:07:24
😊光是否打开?我查一下哦
Light({"enabled":null})
以上内容由 AI (qwen) 生成
Tool
2025-11-02 04:07:27
{"result":true}
154ms
User
2025-11-02 04:03:27
现的屏幕亮度是多少?
AI
2025-11-02 04:03:27
😊我还不知道呢,要不你让我查一下?
Brightness({})
以上内容由 AI (qwen) 生成
Tool
2025-11-02 04:03:31
{"type":"text","text":""}
249ms
问题二:MCU MCP上报数据格式解析错误
错误示范:
{"role":"MCU","msgType":"status","status":"26"}
正确示范:
{"role":"MCU","msgType":"status","status":26}
相关日志
[03:27:20] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":true,"emoji":"😊","emotion":"happy","text":"现在让我查一下温度..."}}
💬 AI语音: 现在让我查一下温度...
[03:27:22] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":false}}
[03:27:22] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":true,"emoji":"😊","emotion":"happy","text":"% Temperature..."}}
💬 AI语音: % Temperature...
[03:27:22] 原始数据: {"role":"AI board","msgType":"MCP","MCP":{"params":{"name":"Temperature","arguments":{"temp":null}}}}
🎯 收到MCP指令:
设备: Temperature
参数: {'temp': None}
🔍 查询指令
🌡️ 温度查询: 26°C
📤 发送响应: mcp-responsive {"role":"MCU","msgType":"status","status":"26"}
[03:27:22] 原始数据: {"role":"AI board","msgType":"status","status":"OK"}
📢 状态: OK
[03:27:22] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":true,"emoji":"😌","emotion":"relaxed","text":"刚刚试了下温度计,它好像在装睡呢~"}}
💬 AI语音: 刚刚试了下温度计,它好像在装睡呢~
[03:27:26] 原始数据: {"role":"AI board","msgType":"MCP Text","MCP Text":{"state":false}}