Commission and control a Matter Thread device via the OTBR Snap - canonical/openthread-border-router-snap GitHub Wiki
Setup the environment
-
Ubuntu Desktop 23.04
-
nRF52840 dongle (A) with RCP firmware as an RCP
-
nRF52840 dongle (B) with the Thread lighting app running on it. Flashing and running the Thread lighting app on the device is beyond the scope of this guide. Please refer to here.
Install and configure the OTBR snap
-
Connect the RCP dongle (A) to a USB port
-
Start the OTBR snap:
sudo snap start openthread-border-router
Follow the logs with: sudo snap logs -f openthread-border-router
Form a Thread network
Use the CTL tool to initialize the Thread network:
sudo openthread-border-router.ot-ctl dataset init new
sudo openthread-border-router.ot-ctl dataset commit active
sudo openthread-border-router.ot-ctl ifconfig up
sudo openthread-border-router.ot-ctl thread start
Alternatively, these steps could be performed with the GUI at https://localhost. Please refer to the instructions here to configure and form, join, or check the status of a Thread network using the GUI.
Pair the Thread lighting device
-
Make sure that the Thread lighting app is running on dongle (B) and the device is in BLE advertisement mode
-
Obtain the OTBR operational dataset (OTBR network's credentials):
sudo openthread-border-router.ot-ctl dataset active -x
The output of this command is the Thread network's Active Operational Dataset values encoded in hex. We need this later on for pairing the Thread device via Chip Tool.
- Install and configure the Chip Tool snap:
# Install the latest stable version
sudo snap install chip-tool
# Connect the avahi-observe interface to allow DNS-SD based discovery:
sudo snap connect chip-tool:avahi-observe
# Connect the bluez interface for device discovery over Bluetooth Low Energy (BLE):
sudo snap connect chip-tool:bluez
- Pair the Thread device over Bluetooth LE
sudo chip-tool pairing ble-thread 110 hex:<active-dataset> 20202021 3840
where:
110
is the assigned node ID for the app.<active-dataset>
is the Thread network's Active Operational Dataset in hex, taken using theot-ctl
command before.20202021
is the PIN code set on the app.3840
is the discriminator ID.
On the OTBR GUI, under the Topology tab, you can now see the two connected Thread nodes:
Control the device
Toggle the device on or off using the following command:
sudo chip-tool onoff toggle 110 1
where:
onoff
is the matter cluster nameon
/off
/toggle
is the command name.110
is the node id of the app assigned during the commissioning1
is the endpoint of the configured device
Upon successful execution, the green LED on the dongle (B) will turn on or off.