中级会员
 
- 积分
- 357
- 金钱
- 357
- 注册时间
- 2022-3-14
- 在线时间
- 53 小时
|
概述
本文档旨在演示开关通过matter协议来做到对灯亮灭的控制。视频不涉及前期环境的搭建。
环境搭建及使用命令参考:https://github.com/project-chip/connectedhomeip/tree/master/ex
amples/all-clusters-app/esp32
学习资料:https://zhuanlan.zhihu.com/p/459731857
演示步骤:
1、配置好环境并安装好对应软件后,需要在指定的路径下激活软件包
- source ./scripts/activate.sh 激活软件包
复制代码 2、连接一个设备,对他进行配网,这里先连接了“开关”
- ./out/debug/chip-tool pairing ble-wifi 12344321 WT 0987654321 20202021 3840 开关配网
复制代码
3、连接另一个设备进行配网,这里连接了“LED灯“
- ./out/debug/chip-tool pairing ble-wifi 12344322 WT 0987654321 20202021 3840 灯配网
复制代码
4、设置灯的ACL,以让开关可以控制它
- ./out/debug/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [ 112233, 12344321 ], "targets": null}]' 12344322 0 设置灯acl
复制代码
5、让开关绑定灯
- ./out/debug/chip-tool binding write binding '[{"fabricIndex": 1, "node":12344322, "endpoint":1, "cluster":6}]' 12344321 1 开关绑定灯
复制代码
6、开关控制灯的亮灭
- matter esp driver send_bind 0x0001 0x0006 0x0000 控制灯灭
复制代码
- matter esp driver send_bind 0x0001 0x0006 0x0001 控制灯亮
复制代码
注意
每当更改配网信息时,可以先将设备重置(恢复出厂设置)
- matter device factoryreset 重置设备
复制代码
|
|