mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
6f8acdeb83
esp_matter_client: Adding APIs to support connect and then sending commands from a client See merge request app-frameworks/esp-matter!72
Switch Example
Building and Flashing the Firmware
First update the submodules:
git submodule sync --recursive
git submodule update --init --recursive
Commission the light and switch device using chip-tool.
Commissioning using chip-tool
Build the chip-tool example application using these commands:
cd examples/chip-tool
git submodule update --init
source third_party/connectedhomeip/scripts/activate.sh
gn gen out/debug
ninja -C out/debug
Pair a device over BLE
Commission switch and light using chip-tool command:
./out/debug/chip-tool pairing ble-wifi node-id SSID PSK SETUP_PINCODE DISCRIMINATOR
for switch SETUP_PINCODE = 20212020 DISCRIMINATOR = 240 (0xF0)
See the README.md file for more information about building and flashing the firmware.
Bind light to switch
Send Bind command to switch which adds entry of remote device in binding table
./out/debug/chip-tool binding bind RemoteNodeId RemoteGroupId RemoteEndpointId RemoteClusterId node-id endpoint-id
e.g.
./out/debug/chip-tool binding bind 12344322 0 1 6 12344321 1
note: i)12344321 : node Id of switch used during commissioning ii)12344322 : node Id of light used during commissioning iii) Cluster Id for OnOff cluster is 6 iv) binding cluster is currently present on endpoint 1
What to expect in this example?
Supported features:
- Matter Commissioning
- Connect to remote light device
- Switch will connect to light when Bind command is send
Useful shell commands
- Toggle power of light
> matter esp switch on
- Make Power On
> matter esp switch off
- Make Power Off
> matter esp switch toggle