Feedback
Feedback

If you are having issues with the exercises, please create a ticket on DevZone: devzone.nordicsemi.com
Drag & Drop Files, Choose Files to Upload 最大 2 個のファイルをアップロードできます。
  • 日本語
    Eng
    日本語
  • Exercise 1 – Running and controlling a Matter device

    In this exercise, you will be running the Matter door lock sample in the nRF Connect SDK and testing it with a developer Matter controller, using the CHIP Tool.

    Note

    In this exercise, only the basic Matter lock sample usage is presented. If you want to learn more about different configurations of this sample, visit its documentation page.

    After Lesson 1, you know that a Matter controller is a device in the Matter infrastructure that is used by the end user to control Matter accessories. The on-market devices capable of serving as Matter controllers are usually smartphones or smart hubs, for practical reasons. However, these devices use officially released, certified Matter software, while developers often want to develop new functionality that cannot be tested on on-market devices. It is also much more convenient for the developers to work with tools available on their PCs.

    You will be using the CHIP Tool for this purpose. The CHIP Tool is a default implementation of the Matter controller role widely used by Matter developers to test their applications before releasing on-market products based on them. It is also recommended for development with the nRF Connect SDK platform.

    Important

    Windows/macOS users: For this and all following exercises, you will need a Raspberry Pi to run the CHIP Tool.
    See How to set up and connect to your Raspberry Pi to get started.

    It is not possible to communicate directly with Matter over Thread devices using the CHIP Tool, as the PC running this Matter controller does not support the Thread protocol. Therefore, an additional Thread Border Router device is required to translate the communication between those devices.

    The Matter controller and Thread Border Router host application can be run on a PC, however the PC does not have an in-built radio transceiver to communicate over the Thread protocol. For this reason, it requires an external radio co-processor (RCP) device connected over USB to communicate with Thread devices. In this exercise, you will be using a second Nordic DK for this purpose.

    The following image presents the described setup:

    It is possible to communicate directly with Matter over Wi-Fi devices using the CHIP Tool, as the PC running the Matter controller supports the Wi-Fi protocol.

    The following image presents the described setup:

    Exercise steps

    1. Running the Matter door lock sample

    1.1 In Visual Studio Code, in the WELCOME panel, select “Browse samples”, select your SDK version, and search for “Matter Lock”.

    Select the sample, and it will appear under the APPLICATIONS panel.

    1.2 Add a build configuration

    1.3 Select the board target corresponding to the DK you are using

      
    nRF54L15 DKnrf54l15dk/nrf54l15/cpuapp
    nRF54LM20 DKnrf54lm20dk/nrf54lm20a/cpuapp

    Click the Generate and Build button at the bottom to build the sample

    Once the building process ends, the build directory will appear in the APPLICATIONS panel.

    1.4 Connect your nRF54L Series DK to the PC using a USB-C cable. Make sure that the POWER switch is in the ON position. As a result, the device should appear in the CONNECTED DEVICES panel.

    1.5 Flash the application to the board using the Flash button in the ACTIONS panel. Make sure to use Erase and Flash to Board icon on the right side.

    Once programming is completed, observe the LEDs on the board. LED0 on the board will blink, indicating the application is running, but the device is not connected to the network. LED1 represents the state of the lock and should be turned on, meaning the lock is closed.

    Note

    If you have an nRF54LM20 DK revision <0.5.0, you will need to go to the Board Configurator application in nRF Connect for Desktop and set VDD_NRF and VDDIO to less than 2.7 V. LEDs on the DK stop functioning if the value for VDD_NRF and VDDIO is set to more than 2.7 V.

    1.6 Open the serial port of the board, using a VCOM in the CONNECTED DEVICES panel. Click on the Connect to Serial Port icon to the right of the VCOM.

    If you do not see any logs from the device, click the RESET button on the nRF54L Series DK.

    Note

    The nRF54L Series DKs enumerate with two serial ports and their numbers can be different on your PC. Select the VCOM with the greater number, for example, if VCOM0 and VCOM1 are available, use VCOM1.

    Logs similar to the following ones should be visible in the Terminal window:

    The Matter door lock device is ready for further actions, but before connecting it to the network, the rest of the devices need to be set up.

    2. Setting up the Thread Border Router

    For development purposes, you can run the OpenThread Border Router in a Docker container on any Linux-based system, without needing to build the application manually.

    To provide a way to connect to the Thread devices from your PC, the OpenThread Border Router requires a Thread radio co-processor. This can be created using a Nordic Development Kit and the Thread Coprocessor sample from nRF Connect SDK.

    2.1 In Visual Studio Code, in the WELCOME panel, select “Browse samples” and search for “OpenThread Coprocessor”.

    Note

    You will find two OpenThread Co-Processor samples. One of them is located in the nrf directory, while the other one is located in zephyr directory. The sample located in nrf is maintained by Nordic and recommended to use, while the quality of the sample from zephyr is not verified by Nordic.

    Select the OpenThread Co-processor sample from nrf, and it will appear under the APPLICATIONS panel.

    2.2 Add a build configuration

    2.3 Select the board target corresponding to the DK you are using for the

      
    nRF54L15 DKnrf54l15dk/nrf54l15/cpuapp
    nRF54LM20 DKnrf54lm20dk/nrf54lm20a/cpuapp
    nRF52840 donglenrf52840dongle/nrf52840
    nRF52840 DKnrf52840dk/nrf52840
    nRF52833 DKnrf52833dk/nrf52833

    Click the Generate and Build button at the bottom to build the sample.

    Once the building process ends, the build directory will appear in the APPLICATIONS panel.

    2.4 Connect your DK to the PC. Make sure that POWER switch is in the ON position. In the case of the dongle, plug it directly into the USB port on your computer

    The device will appear in the CONNECTED DEVICES panel.

    Switchable tabs: DK

    2.5 Flash the application to the board using the Flash button in the ACTIONS panel. Make sure to use Erase and Flash to Board icon on the right side.

    Switchable tabs: dongle

    2.5 Flash the application the dongle.

    The nRF52840 Dongle, unlike the development kits, does not have a debugger on board. Therefore, the procedure for flashing firmware is different.

    2.5.1 Put the dongle in DFU mode by simply pressing the RESET button, which is on the far side of the board from the USB connector. The button does not face up. You will have to push it from the outside in, towards the USB connector.

    The RGB light will turn red with a fade pattern, signaling that the dongle is in DFU mode.

    2.5.2 Generate the firmware package that is compatible with Nordic’s bootloader by typing the following command in your terminal.

    Navigate to the /build/coprocessor/zephyr directory of the Radio Coprocessor sample (<ncs_install_path>/nrf/samples/openthread/coprocessor) and run the following commands in the terminal, one after another:

    nrfutil install nrf5sdk-tools

    nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application zephyr.hex --application-version 1 app.zip

    2.5.3 Flash the firmware package onto the nRF52840 Dongle by issuing this command

    nrfutil device program --firmware app.zip --traits nordicDfu

    2.6 Note the VCOM number that is used by the Thread Coprocessor sample in the CONNECTED DEVICES panel, as it will be needed in the next steps. In the present example, it is /dev/ttyACM0, but it may differ on your PC.

    Note

    The nRF54L Series DKs enumerate with two serial ports and their numbers can be different on your PC. Select the VCOM with the greater number, for example, if VCOM0 and VCOM1 are available, use VCOM1.

    With that, the Thread radio co-processor device is ready, and you can proceed with running the OpenThread Border Router application.

    For the following steps, they will need to be run on a Raspberry Pi or Ubuntu 24.04 LTS, as the tools requirements are not supported on Windows or macOS.

    2.7 Open the command line terminal.

    2.8 Install the Docker daemon, by invoking the following command:

    sudo apt update && sudo apt install docker.io
    Terminal command

    2.9 Start the Docker daemon, by invoking the following command:

    sudo systemctl start docker
    Terminal command

    2.10 Download the compatible version of the OpenThread Border Router docker image by running the following command:

    sudo docker pull nrfconnect/otbr:fbde28a
    Terminal command

    2.11 Create an IPv6 network for the OpenThread Border Router container in Docker:

    sudo docker network create --ipv6 --subnet fd11:db8:1::/64 -o com.docker.network.bridge.name=otbr0 otbr
    Terminal command

    2.12 Configure IPv6 table filter

    sudo modprobe ip6table_filter
    Terminal command

    2.13 Start the OpenThread Border Router.

    You need to replace the /dev/ttyACM0 in the following command with the serial port number that is used by your Thread Coprocessor device noted in step 2.6.

    Invoke the following commands in the terminal to run the OpenThread Border Router:

    sudo docker run -it --rm --privileged --name otbr --network otbr -p 8080:80 \ --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" \ --volume /dev/ttyACM0:/dev/radio nrfconnect/otbr:fbde28a --radio-url spinel+hdlc+uart:///dev/radio?uart-baudrate=1000000
    Terminal command

    2.14 Open the http://localhost:8080/ address in a web browser to get access to the OpenThread Border Router graphical user interface.

    2.15 Navigate to the Form tab from the side panel. The network parameters are automatically filled in and do not need to be modified.

    Note

    Modifying the default Thread network parameters can be useful when you want to run few separated Thread networks. To avoid conflicts between the networks, their parameters have to be changed.

    The Thread network parameters have the following purposes:

    • Network Name is a human-readable name for the Thread network.
    • Network Extended PAN ID is an unique network identifier to distinguish networks.
    • PAN ID is a personal area network ID used at the MAC layer for frame filtering.
    • Passphrase is a human-readable passphrase for the Thread commissioning that is not used in context of Matter protocol.
    • Network Key is a key shared by all network nodes and is used to derive security keys to encrypt the Thread traffic.
    • Channel is a IEEE 802.15.4 radio channel number used by the network.
    • On-Mesh Prefix is a IPV6 prefix advertised within the network and is used for routing purposes.
    • Default Router is a checkbox that allows the Thread Border Router to advertise a default route to the mesh and allows the nodes to send off-mesh traffic through the router.

    2.16 Press the FORM button to request from the OpenThread Border Router to form a Thread network and become a Thread leader, and press Okay when prompted with the “Are you sure?” pop-up.

    For the nRF54L Series DK, if the FORM operation was unsuccessful, try to run the command in 2.13 again, with the other VCOM port for the DK.

    If you still see the error message, please try:

    • Unpluging and plugging in the USB cable.
    • Flashing the OpenThread Coprocessor firmware once again (step 2.5.2).
    • Rebooting your Raspberry PI or Ubuntu system, sometimes a Docker image is not running properly and rebooting the system may refresh the Docker state.

    2.18 Open a new terminal and make sure that packets addressed to devices in the Thread network are routed through the OpenThread Border Router container in the Docker, by invoking the following command:

    sudo ip -6 route add fd11:22::/64 dev otbr0 via fd11:db8:1::2
    Terminal command

    2.19 Check the status of the Thread node running inside the Docker:

    sudo docker exec -it otbr sh -c "sudo ot-ctl state"
    Terminal command

    The output should be the following:

    leader 
    Done
    Terminal

    The Thread Border Router device is ready for further actions.

    However, before connecting your Matter over Thread device to the network, you must set up the Matter controller.

    3. Setting up the CHIP Tool Matter controller

    3.1 Go to the Matter nRF Connect releases GitHub page to download the executable file for the CHIP Tool. Find the release artifacts compatible with the nRF Connect SDK release you are using.

    3.2 Click on the executable file for the CHIP Tool to download it.

    • For users running setup on PC with Linux, download the chip-tool_x64 file.
    • For users running setup on Raspberry Pi, download the chip-tool_arm64 file.

    3.3 Run the downloaded binary file using the following command:

    With PC:

    ./chip-tool_x64 interactive start

    With Raspberry Pi:

    ./chip-tool_arm64 interactive start

    The application should print the logs similar to the following ones:

    [1769459696.750] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs
    [1769459696.750] [32122:32122] [DL] ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs, IGNORING.
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_factory.ini
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_config.ini
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_counters.ini
    [1769459696.760] [32122:32122] [DL] Wrote settings to /tmp/chip_counters.ini
    [1769459696.760] [32122:32122] [DL] NVS set: chip-counters/reboot-count = 2 (0x2)
    [1769459696.760] [32122:32122] [DL] Got Ethernet interface: enp0s31f6
    [1769459696.760] [32122:32122] [DL] Found the primary Ethernet interface:enp0s31f6
    [1769459696.761] [32122:32122] [DL] Got WiFi interface: wlp0s20f3
    [1769459696.761] [32122:32122] [DL] Failed to reset WiFi statistic counts
    [1769459696.761] [32122:32122] [PAF] WiFiPAF: WiFiPAFLayer::Init()
    [1769459696.761] [32122:32122] [IN] UDP::Init bind&listen port=0
    [1769459696.761] [32122:32122] [IN] UDP::Init bound to port=48497
    [1769459696.761] [32122:32122] [IN] UDP::Init bind&listen port=0
    [1769459696.761] [32122:32122] [IN] UDP::Init bound to port=59045
    [1769459696.761] [32122:32122] [IN] BLEBase::Init - setting/overriding transport
    [1769459696.761] [32122:32122] [IN] WiFiPAFBase::Init - setting/overriding transport
    [1769459696.761] [32122:32122] [IN] TransportMgr initialized
    [1769459696.761] [32122:32122] [FP] Initializing FabricTable from persistent storage
    [1769459696.761] [32122:32122] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1769459696.762] [32122:32122] [DMG] Ember attribute persistence requires setting up
    [1769459696.762] [32122:32122] [ZCL] Using ZAP configuration...
    [1769459696.765] [32122:32122] [DL] Avahi client registered
    [1769459696.765] [32122:32122] [IN] CASE Server enabling CASE session setups
    [1769459696.765] [32122:32122] [IN] SecureSession[0x5ac1e6ce54c0]: Allocated Type:2 LSID:52055
    [1769459696.765] [32122:32122] [SC] Allocated SecureSession (0x5ac1e6ce54c0) - waiting for Sigma1 msg
    [1769459696.765] [32122:32122] [CTL] System State Initialized...
    [1769459696.765] [32122:32122] [CTL] Setting attestation nonce to random value
    [1769459696.765] [32122:32122] [CTL] Setting CSR nonce to random value
    [1769459696.766] [32122:32124] [DL] CHIP task running
    [1769459696.766] [32122:32124] [DL] HandlePlatformSpecificBLEEvent 32786
    Terminal

    With that, the Matter controller device is ready, and you can proceed with commissioning the Matter door lock device.

    4. Matter device commissioning and controlling

    4.1 Open a new command line terminal.

    4.2 Get your Thread network dataset using the following command:

    sudo docker exec -it otbr sh -c "ot-ctl dataset active -x"
    Terminal command

    The output should look something like the following:

    080000000000000000000300001735060004001fffe00208deadbeefcafe12340708fd123456789abc00000510112233445566778899aabbccddeeff00030a54657374576f726b3031010211220410aabbccddeeff00112233445566778899aa0c0402a0f7f8 Done
    Terminal

    Note

    The dataset presented in the example will differ from the one displayed on your device. Make sure you use your dataset in the following steps.

    Store the dataset somewhere on your computer so you can use it in the rest of the exercises on this course without running the command.

    4.3 Press Button 0 on the Matter door lock board to start Matter advertising over Bluetooth LE.4.4

    The following logs should be visible in the device serial port:

    I: 730208 [DL]CHIPoBLE advertising started 
    I: 730212 [DL]NFC Tag emulation started
    Terminal

    Note

    The name “CHIPoBLE” is a legacy term from when the Matter protocol was called Connected Home over IP (CHIP). It has not been updated in the Matter stack.

    4.4 Return to the terminal window running the CHIP Tool application from step 3.3.

    Start the commissioning process by running the following command and fill the <thread dataset> argument with your Thread dataset that was obtained in step 4.2:

    pairing ble-thread <your_selected_node_id> hex:<thread dataset> 20202021 3840
    Terminal command

    Replace <your_selected_node_id> with a random node ID to be used only in this exercise, for example, 1. This same number will be used when sending commands to the device through CHIP Tool.

    The 20202021 and 3840 numbers in the following command are the pairing pin code and the device pairing discriminator respectively. They can be configured to use different values using the dedicated Kconfig options CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE and CONFIG_CHIP_DEVICE_DISCRIMINATOR.

    This exercise uses their default values

    As a result, the Matter door lock device and the CHIP Tool application will start printing many verbose messages in the logs that present the commissioning flow. These are especially useful in case of issues with pairing and allow for troubleshooting the problem.

    The Matter door lock device’s LED0 should be blinking rapidly, which means it is in the middle of the commissioning process. Once commissioning succeeds, LED0 will turn on.

    After a successful commissioning, the following logs should be visible in the CHIP Tool terminal:

    [1769669998.755] [13455:13457] [CTL] Commissioning complete for node ID 0x0000000000000001: success 
    [1769669998.755] [13455:13457] [TOO] Device commissioning completed with success
    Terminal

    The following logs will be visible in the Matter door lock terminal:

    I: 40994 [SVR]Commissioning completed successfully
    I: 40999 [DIS]Updating services using commissioning mode 0
    I: 41004 [DIS]Advertise operational node C0A6EA990FC57325-0000000000000001
    I: 41010 [SC]SecureSession[0x2000f648, LSID:33768]: State change 'kActive' --> 'kPendingEviction'
    I: 41019 [BLE]Releasing end point's BLE connection back to application.
    I: 41025 [DL]Closing BLE GATT connection (ConnId 00)
    I: 41114 [DL]Current number of connections: 0/1
    I: 41118 [DL]BLE GAP connection terminated (reason 0x16)
    Terminal

    4.5 Unlock the Matter lock throughy Matter controller by invoking the following command in the CHIP Tool terminal window:

    Replace <your_selected_node_id> with the node ID used when pairing the device in step 4.4

    doorlock unlock-door <your_selected_node_id> 1 --timedInteractionTimeoutMs 5000
    Terminal command

    Observe that LED1 on the Matter door lock device flickers for some time and eventually turns off. This means that the lock is open, and the flickering emulates the time needed by the physical bolt lock to open.

    4.6 Lock the Matter lock through Matter controller, by invoking the following command in the CHIP Tool terminal window:

    doorlock lock-door <your_selected_node_id> 1 --timedInteractionTimeoutMs 5000
    Terminal command

    Observe that LED1 on the Matter door lock device flickers for some time and eventually turns on. This means the lock is closed, and the flickering emulates the time it takes the physical bolt lock to close.

    1. Running the Matter door lock sample

    1.1 In Visual Studio Code, in the WELCOME panel, select “Browse samples”, select your SDK version, and search for “Matter Lock”.

    Select this sample, and it will appear under the APPLICATIONS panel.

    1.2 Add a build configuration

    1.3 Select nrf54lm20dk/nrf54lm20/cpuapp to be your board target. Next, add the following arguments in the Extra CMake arguments section to support the nRF7002 EB II shield and Wi-Fi protocol:

    • -DSHIELD=nrf7002eb2
    • -DSB_CONFIG_WIFI_NRF70=y
    • -DCONFIG_CHIP_WIFI=y

    After that, click Generate and Build button to build this sample:

    Once the building process ends, the build directory will appear in the APPLICATIONS panel.

    1.4 Connect your nRF54LM20 DK board to the PC using a USB-C cable and the DEBUGGER USB port. Make sure that the POWER switch is in the ON position.

    The device should appear in the CONNECTED DEVICES panel.

    1.5 Flash the application to the board using a Flash button in the ACTIONS panel. Make sure to use the Erase and Flash to Board icon on the right side.

    Once programming is completed, observe the LEDs on the board. LED0 on the board will be blinking, which means the application is running, but the device is not connected to the network. LED1 indicates the lock’s state and should be turned on, meaning the lock is closed.

    1.6 Open the serial port of the board, using a VCOM in the CONNECTED DEVICES panel. If no logs from the device are visible, click the RESET button on the nRF54LM20 DK.

    Note

    The nRF54LM20 DK enumerates with two serial ports, and their numbers can be different on your PC. Select the VCOM with the greater number, for example, if VCOM0 and VCOM1 are available, use VCOM1.

    You should see logs similar to the following ones will be visible in the Terminal window:

    The Matter door lock device is ready for further actions, but before connecting it to the network, the rest of the devices need to be set up.

    2. Setting up CHIP Tool Matter controller

    2.1 Visit the Matter nRF Connect releases GitHub page to download executable file for CHIP Tool. Find the release artifacts compatible with the nRF Connect SDK release you are using.

    2.2 Click on the executable file for CHIP Tool to download it.

    • For users running setup on Ubuntu 24.04 LTS, download the chip-tool_x64 file.
    • For users running setup on Raspberry Pi, download the chip-tool_arm64 file.

    2.3 Run the downloaded binary file using the following command:

    With PC:

    ./chip-tool_x64 interactive start

    With Raspberry Pi:

    ./chip-tool_arm64 interactive start

    In result the application should print the logs similar to the following ones:

    [1769459696.750] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs
    [1769459696.750] [32122:32122] [DL] ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs, IGNORING.
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_factory.ini
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_config.ini
    [1769459696.751] [32122:32122] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_counters.ini
    [1769459696.760] [32122:32122] [DL] Wrote settings to /tmp/chip_counters.ini
    [1769459696.760] [32122:32122] [DL] NVS set: chip-counters/reboot-count = 2 (0x2)
    [1769459696.760] [32122:32122] [DL] Got Ethernet interface: enp0s31f6
    [1769459696.760] [32122:32122] [DL] Found the primary Ethernet interface:enp0s31f6
    [1769459696.761] [32122:32122] [DL] Got WiFi interface: wlp0s20f3
    [1769459696.761] [32122:32122] [DL] Failed to reset WiFi statistic counts
    [1769459696.761] [32122:32122] [PAF] WiFiPAF: WiFiPAFLayer::Init()
    [1769459696.761] [32122:32122] [IN] UDP::Init bind&listen port=0
    [1769459696.761] [32122:32122] [IN] UDP::Init bound to port=48497
    [1769459696.761] [32122:32122] [IN] UDP::Init bind&listen port=0
    [1769459696.761] [32122:32122] [IN] UDP::Init bound to port=59045
    [1769459696.761] [32122:32122] [IN] BLEBase::Init - setting/overriding transport
    [1769459696.761] [32122:32122] [IN] WiFiPAFBase::Init - setting/overriding transport
    [1769459696.761] [32122:32122] [IN] TransportMgr initialized
    [1769459696.761] [32122:32122] [FP] Initializing FabricTable from persistent storage
    [1769459696.761] [32122:32122] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1769459696.762] [32122:32122] [DMG] Ember attribute persistence requires setting up
    [1769459696.762] [32122:32122] [ZCL] Using ZAP configuration...
    [1769459696.765] [32122:32122] [DL] Avahi client registered
    [1769459696.765] [32122:32122] [IN] CASE Server enabling CASE session setups
    [1769459696.765] [32122:32122] [IN] SecureSession[0x5ac1e6ce54c0]: Allocated Type:2 LSID:52055
    [1769459696.765] [32122:32122] [SC] Allocated SecureSession (0x5ac1e6ce54c0) - waiting for Sigma1 msg
    [1769459696.765] [32122:32122] [CTL] System State Initialized...
    [1769459696.765] [32122:32122] [CTL] Setting attestation nonce to random value
    [1769459696.765] [32122:32122] [CTL] Setting CSR nonce to random value
    [1769459696.766] [32122:32124] [DL] CHIP task running
    [1769459696.766] [32122:32124] [DL] HandlePlatformSpecificBLEEvent 32786
    Terminal

    With that, the Matter controller device is ready, and you can proceed with commissioning the Matter door lock device.

    3. Matter device commissioning and controlling

    3.1 Open the command line terminal.

    3.2 Get the SSID and password for the Wi-Fi network that is currently used by your machine with CHIP Tool running.

    3.3 Press Button 0 on the Matter door lock board to start Matter advertising over Bluetooth LE.

    The following logs should be visible in the device serial port:

    I: 730208 [DL]CHIPoBLE advertising started
    I: 730212 [DL]NFC Tag emulation started
    Terminal

    Note

    The name “CHIPoBLE” is a legacy term from when the Matter protocol was called Connected Home over IP (CHIP). It has not been updated in the Matter stack.

    3.4 Start the commissioning process using the terminal window with the CHIPTool application running. Run the following command and fill the <wifi_ssid> and <wifi_password> arguments with your Wi-Fi network data that were obtained in the 3.2 step:

    pairing ble-wifi <your_selected_node_id> <wifi_ssid> <wifi_password> 20202021 3840
    Terminal command

    Replace <your_selected_node_id> with a random node ID to be used only in this exercise, e.g., 1. This same number will be used when sending commands to the device through CHIP Tool.

    The 20202021 and 3840 numbers in a following command are correspondingly a pairing pin code and device’s discriminator. They can be configured to use different values using dedicated Kconfig options, however this exercise uses a default values.

    As a result, the Matter door lock device and the CHIP Tool application will start printing many verbose messages in the logs that present the commissioning flow. These are especially useful in case of issues with pairing and allow for troubleshooting the problem.

    The Matter door lock device is going to blink with LED0 rapidly, which means it is in the middle of the commissioning process. Once commissioning succeeds, the LED0 state will change to solid on.

    After the successful commissioning, the following logs will be visible in the CHIP Tool terminal:

    [1769669998.755] [13455:13457] [CTL] Commissioning complete for node ID 0x0000000000000001: success
    [1769669998.755] [13455:13457] [TOO] Device commissioning completed with success
    Terminal

    And the following logs will be visible in the Matter door lock’s terminal:

    I: 40994 [SVR]Commissioning completed successfully
    I: 40999 [DIS]Updating services using commissioning mode 0
    I: 41004 [DIS]Advertise operational node C0A6EA990FC57325-0000000000000001
    I: 41010 [SC]SecureSession[0x2000f648, LSID:33768]: State change 'kActive' --> 'kPendingEviction'
    I: 41019 [BLE]Releasing end point's BLE connection back to application.
    I: 41025 [DL]Closing BLE GATT connection (ConnId 00)
    I: 41114 [DL]Current number of connections: 0/1
    I: 41118 [DL]BLE GAP connection terminated (reason 0x16)
    Terminal

    4.5 Unlock the Matter lock through the Matter controller, by invoking the following command in the CHIP Tool terminal window:

    Replace <your_selected_node_id> with the node ID used when pairing the device in step 3.4.

    doorlock unlock-door <your_selected_node_id> 1 --timedInteractionTimeoutMs 5000
    Terminal command

    Observe that LED1 on the Matter door lock device flickers for some time and eventually turns off. This means that the lock is open, and the flickering emulates the time needed by the physical bolt lock to open.

    4.6 Lock the Matter lock through Matter controller, by invoking the following command in the CHIP Tool terminal window:

    doorlock lock-door <your_selected_node_id> 1 --timedInteractionTimeoutMs 5000
    Terminal command

    Observe that LED1 on the Matter door lock device flickers for some time and eventually turns on. This means that the lock is closed and the flickering emulates the time needed by the physical bolt lock to close.

    Switch language?

    Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.

    Your current progress is saved, and you can switch back anytime.

    Register an account
    Already have an account? Log in
    (All fields are required unless specified optional)

    • 8 or more characters
    • Upper and lower case letters
    • At least one number or special character

    Forgot your password?
    Enter the email associated with your account, and we will send you a link to reset your password.