| 概述本文檔旨在演示開關(guān)通過matter協(xié)議來做到對燈亮滅的控制。視頻不涉及前期環(huán)境的搭建。  環(huán)境搭建及使用命令參考:https://github.com/project-chip/connectedhomeip/tree/master/ex amples/all-clusters-app/esp32 學(xué)習(xí)資料:https://zhuanlan.zhihu.com/p/459731857 
   演示步驟: 1、配置好環(huán)境并安裝好對應(yīng)軟件后,需要在指定的路徑下激活軟件包source ./scripts/activate.sh 激活軟件包   2、連接一個設(shè)備,對他進(jìn)行配網(wǎng),這里先連接了“開關(guān)”./out/debug/chip-tool pairing ble-wifi 12344321 WT 0987654321 20202021 3840 開關(guān)配網(wǎng) 
   3、連接另一個設(shè)備進(jìn)行配網(wǎng),這里連接了“LED燈“./out/debug/chip-tool pairing ble-wifi 12344322 WT 0987654321 20202021 3840 燈配網(wǎng) 
 4、設(shè)置燈的ACL,以讓開關(guān)可以控制它./out/debug/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege":5, "authMode": 2, "subjects": [ 112233, 12344321 ], "targets": null}]' 12344322 0 設(shè)置燈acl 
   5、讓開關(guān)綁定燈./out/debug/chip-tool binding write binding '[{"fabricIndex": 1, "node":12344322, "endpoint":1, "cluster":6}]' 12344321 1 開關(guān)綁定燈 
   6、開關(guān)控制燈的亮滅matter esp driver send_bind 0x0001 0x0006 0x0000 控制燈滅 
   matter esp driver send_bind 0x0001 0x0006 0x0001 控制燈亮 
   注意 每當(dāng)更改配網(wǎng)信息時,可以先將設(shè)備重置(恢復(fù)出廠設(shè)置)matter device factoryreset 重置設(shè)備 
     
 |