In the ever-evolving landscape of smart home technology, innovation continues to shape the way we interact with and optimize our living spaces. Armed with a vision to enhance the efficiency and intelligence of my home, I embark on a journey to harness the power of "Matter over Thread", for this challenge..My arsenal includes the nRF7002 WiFi 6 Development Kit and the nRF52840 Dongle, that I was awarded for this challenge by the sponsor of this challenge, Nordic Semiconductor..
The problem at hand is clear: How can we create a home monitoring solution that not only enhances device efficiency but also leverages artificial intelligence to make real-time decisions based on outdoor environmental data? This endeavor seeks to bridge the gap between existing smart home solutions and the limitless possibilities that emerge when we combine cutting-edge hardware with advanced machine learning.
At its core, the mission is to construct an intelligent AI-driven home monitoring system. This system will utilize historical outdoor environmental data, including humidity, temperature, and precipitation levels, to inform the indoor environment's decisions. Imagine a home that knows when to adjust the thermostat or crack open a window based on the outside temperature—this is the vision.
In this pursuit, the nRF7002 WiFi 6 Development Kit plays a pivotal role. It steps in as the cornerstone of this ambitious project, replacing the Thingy:53, which proved unsuccessful for my previous attempts at experimenting with Matter. The nRF7002, in tandem with the nRF52840 Dongle, promises to unlock the potential of the "Matter over Thread" technology, enabling seamless communication and control between various smart devices.
As I delve deeper into this journey, I will explore the hardware and software components that will bring this concept to life. The path ahead involves navigating through the intricacies of the nRFConnect-SDK Matter examples, Configuring an Open Thread Network, Implementing an OpenThread Border Router, Docker containers, using Ubuntu, and getting familiar with the hardware to be used. It calls for a fusion of skills honed through years of experience in software engineering, bolstered by a background in Computer Science from Boston University.
Join me as I embark on this transformation journey into the heart of smart home innovation, where "Matter over Thread" technology promises to redefine the way we interact with our domestic environments. The possibilities are limitless, and the future of home automation is within reach.
Getting familiar with the HardwareHere I will describe how I became familiar with the hardware supplied to me and other Hardware used on this project.
nRF7002 Wi-Fi 6 Development KitGet started with the nRF7002 DK
Gettting started with the nRF52840 Dongle.
It is recomended to use a Bluetooth LE dongle on the border router, It is used to commision devices connected to the thread Border router. The Raspberry PI has BLE capabilities, my Ubuntu PC does not. I purchased an ASUS BT-500 USB Adapter.
I needed to do a little more installation on Ubuntu then when used on Windows 10, which was plug and play.
First I found the following link that explains Using Asus BT500 bluetooth dongle on Linux system
I followed these instructions and was able to get the Bt-500 driver installed on my Ubuntu PC.
Depending on the Linux kernel version used, the ASUS BT500 may now work as expected out-of-the-box - especially the BLE functionality. This is caused by a quite new Raltek 8761BU chipset inside the BT500, which is not supported by btrtl Linux kernel driver (it supports 8761B but not the 8761BU). To solve that problem, a new driver from the ASUS webpage has to be installed on linux.
1. Download driver from the ASUS webpage:
2. Change to the driver directory - build and install USB driver
- Use Ubuntu Archiver to Extract the downloaded driver. cd to /usb under the main extract directory
- Run the following script to install the drive
- $ sudo make install
3. Copy the right FW file and config file to the correct path.
- $ sudo cp rtkbt-firmware/lib/firmware/rtl8761bu_fw /lib/firmware/
- $ sudo cp rtkbt-firmware/lib/firmware/rtl8761bu_config /lib/firmware/
4. Insert Realtek Bluetooth dongle and check LMP subversion by the following command
- $ hciconfig -a
Now, the Asus BT-500 USB Dongle can be recognized by the system and bluetooth function can be used.
Other Hardware that could be used on the projectI have the following Nordic nRF dev Kits in my Lab:1x nRF9160 DK1x Thingy532x nRF5340 Audio DK
But it seems like the only ones that are supported are nRF7002 and nRF5340? according to the following?
Supported SoCsCurrently the following SoCs from Nordic Semiconductor are supported for use with the Matter protocol
- nRF5340 (Matter over Thread and Matter over WiFi through the
nrf7002_ek
shield - nRF5340 + nRF7002 (Matter over Thread and Matter over WiFi)
- nRF52840 (Matter over Thread)
IGetting Started
To develop your Matter project you can go down the two paths described in the challenge overview page.
Two Paths to TAKE
Path 1: Use an off-the-shelf smart hub. The easiest solution is to use a store-bought smart hub that you might already have at home:
- Matter over Thread compatible smart hubs: HomePod Mini, Apple TV 4k, or Google Nest Hub 2nd Gen
- Matter over Wi-Fi compatible smart hubs: Google Nest Mini or any Matter-enabled Amazon Alexa speakers
Path 2: The PRO approach. Create your own border router or use CHIP Tool on Linux/macOS. The big advantage of this path is that all matter device types and functions will be supported.
Matter over Thread:
You can also set one up yourself by following the instructions in the Testing Matter in the nRF Connect SDK documentation. Here, you can choose between running the border router and CHIP tool on one device or two separate devices. This method requires the following hardware:
- 1x PC with Ubuntu (20.04 or newer), and/or
- 1x Raspberry Pi Model 3B+ or newer with Ubuntu (20.04 or newer) instead of Raspbian OS
In addition to:
- 1x Bluetooth LE dongle (can be embedded inside the PC, like it is on Raspberry Pi)
- 1x nRF52840 DK or nRF52840 Dongle - for the Radio Co-Processor (RCP) device
For Matter over Wi-Fi
In this setup, you use the CHIP Tool on your PC and your home WiFi. Follow the instructions in the Matter over Wi-Fi documentation on how to do this on Linux or MacOS.
WHAT TO DO- The Path 1 solution Requires off-the shelf hardware that I do not own. Although I do have a few Google Nest Mini devices, that I could use to implement a Matter over WiFi thread network to experiment with Matter. It is mentioned that these are ?
- The easiest of the PATH 2 solutions seems to be Matter over WiFi.
- I have attempted the PATH 2 solution Matter overThread for a previous Hackster contest. I had a problem with implementing an Open Thread Border Router and I abandoned the effort.
I really want to experiment with Matter Over Thread for this contest, so my plan is to revise a hackster project on implementing a Thread Border Router. After I get a thread network in place I will use thread capable Nordic devices to connect to this thread network.
I have tried Matter over Thread in a previous hackster project with NO SUCCESS in getting matter over Thread implemented, In the Project A Thread Border Router with Pi 4 and nRF9160, I tried to get a Thread Network and a OTBR setup using my Raspberry PI4 and a Nordic nrf9160 as a RCP.
- To Setup Configure the Thread Border Router on a Raspberry Pi. I followed the detailed steps, on the Thread Border Router page in the nRF Connect SDK documentation.
- First I configured the RCP. I am using the nRF9160 DK with the nRF52/nRF91 switch set to nRF52. Complete the following steps, nRF device with the RCP application Build the Thread: Co-processor sample on the following Tab nRF52840 Dongle (USB transport).
- I then installed the OTBR manually on my Raspberry Pi4. To set up and configure the OpenThread Border Router, I followed the official OpenThread Border Router Codelab tutorial on the OpenThread documentation portal.
I was never able to get it running and never got to the 3rd section 3. Form a Thread network. The $ot-ctl command is also not working and I don't know why? Not sure if it’s because I was using the nRF9160 at the time I did not have a nRF52840 to use as a RCP with My Pi4? I abandoned this attempt and never was able to experiment with Thread and Matter.
For this project I will need to get an OTBR configured and working first.
I have another project that I've submitted for the contest, Open Thread Border Router on Linux Ubuntu that will describe how I was able to successfully get a Open Thread Border Router setup on my Ubuntu Linux PC.
My ProjectAs described in the challenge notes, Matter over Thread is a networking protocol that allows smart home devices to communicate with each other using Thread, a low-power mesh networking protocol. It is secure, reliable, easy to set up and use, and interoperable with a wide range of smart home devices.
For this project I will set up a Matter over Thread network myself. I will set up a Matter over Thread gateway using the following Hardware
- a PC running Ubuntu
- Asus BT500 blue tooth dongle
- An nRF52840 Dongle
- A smartphone with the CHIP app install running on the same Wifi Network as the OTBR
Two components of a thread network are:
- Open Thread Border Router (OTBR)
- Connected Home over IP (CHIP) Tool
- I originally thought to implement the OTBR using one of my Raspberry Pi 4 2GB using Ubuntu 22.04.3 LTS. Once I installed the OS, I found it to be too slow for development and decided to turn to my PC running Ubuntu
- I will implement the OTBR using a Linux Laptop PC with Ubuntu 20.04.6 LTS installed
- I will implement the CHIP tool on my smartphone using the CHIP Tool for Android
As I mentioned, I built the OTBR on my Ubuntu PC. This was a very intensive implementation, so I decided to break out how I was able to create an OTBR in another project. This and building the Firmware for the nRF52840 Dongle, is documented in my companion Project at Open Thread Border Router on Linux Ubuntu
Once the Thread Network Is set up and tested, I will use the nrRF002 DK and a second nRF dk ( to be determined) to connect and communicate using the Matter protocol over the thread network. I will implement the Light example described in the following webinar at minute 17:27 , a lightbulb sample Matter over Thread using two nRF DK’s.
A Webinar solution that demonstrates matter over thread with a Pi, nrf52840 dongle, 2x nRF devices.The full video Developing Matter 1.0 products with nRF Connect SDK
The presentation can be downloaded here, Including slides and links from the video. Unfortunately, it does not include the steps taken to configure the firmware and the CHIP Tool commands taken to commission the devices.
The example uses 2 DK's that I do not own to implement 2 Matter Firmware Applications:
- nRF5340 DK - for the Matter Light Switch
- nRF52840 DK - for the Matter Light Bulb
There are differences in usage of environments in the webinar:
- This example used Development on Ubuntu, I am using Windows 10
- The example uses the chip tool on Linux, i'm using the chip tool on my Android smart phone.
- the example uses the nRF Dk's mentioned above, I am using different DK's
The first DK is the supplied nRF7002 DK, which is a development kit for the nRF7002 SoC. It includes a number of features that make it ideal for developing Thread and Matter devices, including a Thread radio, a Matter stack, and a USB interface. For my experiment, I'm using the Light_Bulb example to run and connect to my THREAD Network.
The second nRF DK will be used as a button device. It will connect to the Thread network and communicate with the nrf7002 DK using the Matter protocol. The DK chosen for this firmware is the nRF5340 Audio DK. The reason why is is chosen, is that it has 5 buttons. The Light_Switch firmware uses 4 buttons, so I figure it is a good candidate to use.
The Light example is a simple example that demonstrates how to use the Matter protocol to control a LED on a nRf DK, controlled by buttons on another nRF DK. It will be used to test the connectivity and functionality of the Thread network and the Matter protocol.
Steps I take to get the the Example Running
I will be using windows 10 as my development environment. I found that the latest version
- Build and Flash the Light Switch and Light Bulb Example Firmware to the Selected nRF devices.
nRF7002DK - Matter Light Bulb Firmware
Document PAGE: Matter: Light bulb
Connect USB cable to the PC. I noticed 2 com ports where detected.
I loaded the Light_Bulb example in VS code as instructed in the Webinar, When I tried to Build this with my installed version of nRFConnect SDK 20.0, I received build error. At this point I needed to install the latest nRFConnect SDK version 25.0.
I did another Build with the Build Configuration used: "nrf7002dk_nrf5340_cpuapp" Success with the build. Now Flash the Firmware to the nRF7002. Success with the Flash.
OK now I used Putty as a terminal console on windows 10. There are 2 com ports reported when the nRF7002 is connected. I needed to determine which one the Light_bulb firmware was using to report serial output. I determined thru process of elimination, that COM10 was being used after a restart of the firmware.
PICTURE OF THE SCREEN HERE.
Now that I have the Light_Bulb firmware built and Flashed to the nRF7002DK, It's time to work on the Light_Switch firmware on the nRF5340 Audio DK.
nRF5340 Audio DK.- Matter Light Switch Firmware
Document Page: Matter Light Switch
Connect USB cable to the PC. I noticed 3 com ports where detected. Not sure which one is used to connect a serial line to?
I loaded the Light_Switch example and Built it for the Build Configuration: "nrf5340dk_nrf5340_cpuapp".Success with the build. Now Flash the Firmware to the nrf5340dk. Success with the Flash. Success with the flash.
OK now I used Putty as a terminal console on windows 10. There are 3 com ports reported when the nRF5340 Audio DK is connected. I needed to determine which one the Light_Switch firmware is using to report serial output. Like the Light_bulb firmware, the log should be written out to the serial connection, but I could not determine which one it was using. I tried to restart the Firmware using Putty to connect to each of the 3 ports.
Without output from the firmware as the webinar described, I was not able to assure that the Firmware was operating correctly like the light_bulb firmware. I'm not sure what to do here, So, I abandoned the use of the Light_switch firmware to use in my experiment.
I decided to just use the Light_bulb firmware that I successfully was able to run on the nRF7002DK. Using the Android CHIPTool on my phone to switch the Led on and off.
Using the nRF7002DK as a Light Bulb.I decided to use the Light bulb firmware that I was successful in running on the nRF7002DK to experiment with Matter over Thread.
I read through a doument page Matter: Light bulb to get familier with the sample. This sample of a light bulb demonstrates the utilization of the Matter application layer in creating a dimmable light bulb device. Operating as a Matter accessory device, it can be paired and remotely controlled over a Matter network, either on a low-power 802.15.4 Thread network or a Wi-Fi network. Feel free to use this sample as a reference for developing your own application. This self-contained sample is suitable for standalone testing but is essential when testing the Matter light switch sample. According to the doc page, the nRF7002DK is supported for this example firmware. Additionally, a Matter controller device configured on a PC or mobile device is required for commissioning the light bulb device. I will be using the Android CHIPTool running on my Smart, to commission the Light Bulb Firmware running on the nRF7002 DK.
Overview
This sample employs buttons to test changing the light bulb and device states, with LEDs indicating the corresponding changes. Testing options include standalone testing with a single DK or remote testing over Thread or Wi-Fi, requiring multiple devices and a Matter controller. I will conduct both standalone and remote testing. The remote control testing requires a Matter controller that you can configure either on a PC or a mobile device (for remote testing in a network). You can enable both methods after building and running the sample.
Remote testing in a network
The Matter accessory device, by default, lacks IPv6 network configuration. Pairing it with the Matter controller over Bluetooth® LE is necessary to obtain the configuration and enable the device within a Thread network. The controller must get the Onboarding information from the Matter accessory device and provision the device into the network. This will be done using the Android CHIPTool for my experiment.
Light_Bulb firmware User interface
The sample provides feedback through LEDs indicating device and light bulb states, along with buttons for initiating various actions, including turning the light bulb on/off, dimming, and factory reset. Here is a description from the Doc page for the Leds and buttons. Note: that the nRF7002 DK only has 2 buttons, and that button 1 has a dual purpose depending on how long you press and hold it.
Looks like there is a typo in the doc for Button 2 in the first button press, “it changes the lock state”. Shouldn’t it be “changes the light bulb state” to the opposite one? Just an observation.
Building and running
The sample, located under samples/matter/light_bulb in the nRF Connect SDK folder structure, can be built and run using Visual Studio Code. This was conducted in the previous section above.
TestingThe sample offers testing options for basic features and communication between devices, including commissioning, binding, and testing connection scenarios.You can either test the sample’s basic features or use the light switch sample to test the light bulb’s communication with another device in this section. I tried the Testing basic featuressection, but because I was unable to get the com port operational for the Light_Switch firmware as mentioned above, I skipped the Testing communication with another devicesection.
TESTING BASIC FEATURESFirst test was to use the Basic Features test from the section in the doc page.
My results from testing the basic features
Step1- Connected via USB cable to PC. Kit is assigned to COM10 as indicated in Windows Device manager
Step2 - Open Putty and setup the Serial port on COM10 for a baud speed of 115200
Step3, 4, 5 - Observed LED 2 is off, Pressed Button 2 and LED 2 turns on, Pressed Button 2 again and LED 2 turns off
Remote control functionality allows the Matter light bulb device to be controlled from an IPv6 network.
Commissioning the device is a crucial step in setting up a testing environment for remote control. It involves configuring the Thread Border Router, building and installing the Matter controller, and commissioning the device. The process includes
- obtaining onboarding information and
- sending Matter commands to cover various scenarios.
Various formats of onboarding information, such as QR codes, QR code payloads, and manual pairing codes, are provided for configuring the Matter controller with the necessary data payload, including the device discriminator and setup PIN code.
The Doc page that has been discussed thus far, was not clear in How To use the ChipTool to commission a Matter device. So I decided to try and find a doc page on the Nordic document site that would help me to commission the Matter Light_builb firmware running on the nRF7002DK connected to my Thread network and use the Android CHIPTool to Commision and get the onboarding information needed to test. I found such a page here: Commissioning nRF Connect Accessory with Android CHIPTool.
I ran into problems with this option and saved my notes in Appendix A -- Problems with Android CHIPTool. The Discord forum member monitoring the event responded to my inquire basicically stating the the Android CHIPTool was not supported anymore and they recommend using the CHIPTool for Linux or macOS.
I abandoned the Android CHIPTool and proceeded to try to get it running on my Raspberry PI using Ubuntu.
Commisioning using CHIPTool for LinuxThe commissioning process using the CHIPTool is composed of the following main stages:
- CHIPTool discovers a Matter accessory device over Bluetooth LE.
- CHIPTool establishes a secure channel to the device over Bluetooth LE, and sends Matter operational credentials and Thread provisioning data.
- The accessory device joins a Matter-enabled Thread network.
I decided to try the following Steps to Commision the Light bulb example mentioned above.
1- Building and Installing Linux CHIPTool
The very first component you need is a ChipTool that will work. I found a snap CHIPTool for installing on Ubuntu which is easier then building and installing. This installalation was the esay way to get a CHIPTool up adn running. I found a link for the Snap installation.
The following link allows you to install the CHIPTool on Ubuntu by using the snap tool https://snapcraft.io/install/chip-tool/ubuntu. I also followed the steps on the github page Chip Tool Snap. to install the CHIPTool
I installed the chiptool on both my Ubuntu PC along with the ODBR and on a seperate Raspberry PI using Ubumtu.
Now I was ready to Test the matter light Bulb device over my Open thread network
First I found the page Configuring Matter controller, but I found it very limited in content, but was directed to the Working with the CHIP Tool page in the Matter documentation. Since I had already installed the CHIPTool and did not need to build the tool, so I used the steps at Using the CHIP Tool for Matter device testing.
Follow along with me for what I accomplished Let's break down the steps:
Step 1: Prepare the Matter deviceBuild and program the device with the Matter device firmware using the Matter Lighting Application Example documentation.
- Previously done
Follow the Matter device example documentation to enable Bluetooth LE advertising, either automatically on boot or through a physical trigger like pushing a button.
- Press the reset button on the nRF702 DK and note the Advertising statement on the terminal log.
Ensure that the IP network (e.g., Thread network using OpenThread Border Router) is up and running.
- Start the ODBR on the the PC under Ubuntu
You must provide the CHIP Tool with network credentials that will be used in the device commissioning procedure to configure the device with a network interface, such as Thread or Wi-Fi.,Obtain Thread network credentials using commands specific to your Thread Border Router (OTBR in Docker).
Thead network credentialsFetch and store the current Active Operational Dataset from the Thread Border Router.
I have my ODBR running in docker,so i used the following command on my Ubuntu PC running the ODBR to get the Active Operatonal Dataset:
sudo docker exec -it otbr sh -c "sudo ot-ctl dataset active -x"
My results were the same as the doc pge? also a message "connect session failed: Connection refused"? on to the next step
0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8
You must get the following Wi-Fi network credentials to commission the Matter device to the Wi-Fi network in the following steps
- Wi-Fi SSID
- Wi-Fi password
I have acces to these two credendials, and this is dully noted
In review I now have the
- Active Operational Dataset for Thead network credentials
- A Wi-Fi SSID and PASSWORD for the Wi-Fi network credentials
- SSID: MySpectrumWiFi38-2G
Retrieve the discriminator and setup PIN code from the logging terminal when the reset button on the nRF7002 DK is pressed and released after 6 seconds.
The values I received were the same as the Doc page? I'm not sure why? shouldn't they be different?
I: 478 [DL] Setup Pin Code (0 for UNKNOWN/ERROR):
20202021
I: 483 [DL] Setup Discriminator (0xFFFF for UNKNOWN/ERROR):
3840
(0xF00)
The doc page offers 2 methosd of commissioning, Over Bluetooth LE or into a network over IP.
Option 1 -- Commissioning over Bluetooth LEPrior to engaging in communication with the Matter device, it is imperative for the device to become part of an established IP network. You wil need to Establish a secure session using PASE protocol. Upon successfully establishing a connection with the device through Bluetooth LE, the controller will generate the following log:
CopySecure Session to Device Established
This log signifies the completion of the Password-Authenticated Session Establishment (PASE) utilizing the SPAKE2+ protocol.
The following 2 options are for using Bluetooth LE. It was not clear to me which one to use and what the difference was. Since My Ubuntu PC does not have Bluetooth I did not execute these. Not sure what this means?
Commissioning Option 1 -- into Thread network over Bluetooth LE- Use the command pattern:
chip-tool pairing ble-thread <node_id> hex:<operational_dataset> <pin_code> <discriminator>
- Use the command pattern:
./chip-tool pairing ble-wifi <node_id> <ssid> <password> <pin_code> <discriminator>
There are 3 options for commissioning over IP with Setup PIN, with Long Discriminator and with QR code payload
Commissioning with setup PIN code- Use the command pattern:
./chip-tool pairing onnetwork <node_id> <pin_code>
- Use the command pattern:
./chip-tool pairing onnetwork-long <node_id> <pin_code> <discriminator>
- Use the command pattern:
./chip-tool qrcode <node_id> <qrcode_payload>
At this point in time I was unable to get the CHIPTool working. I stopped at this step, since i ran out of time to complete the challenge before the deadline. I have found it Tremendously diffecult to get a trhread network up and running so I could get the light bulb matter example running.
I need to circle around and figure out why the Ubuntu SNAP instalation is not working. I was able to install the SNAP instalation but did get a missing dependancy error. I followed the instuctions documented above but was unable to commision the NRF7002 DK?
Future EnhancementsI will continue to try to get a CHIPTool to run and continue to try to use the Matter Light Bulb example.
Step 7: Control application Data Model clustersInteract with Data Model clusters using commands such as toggling the LED state or changing brightness.
Upon successfully completing the preceding steps, you have effectively commissioned the Matter device into the network. Now, you can proceed to test the device by engaging with Data Model clusters.
For example, in the context of a lighting application, the On/Off and Level Control clusters are integrated. This implies that you can assess the functionality by toggling the bulb using the onoff cluster commands or adjusting its brightness with the levelcontrol cluster commands.
To toggle the LED state, utilize the following command pattern
$ chip-tool onoff toggle <node_id> <endpoint_id>
In this command:
<node_id>
represents the user-defined ID of the commissioned node.<endpoint_id>
corresponds to the ID of the endpoint with the OnOff cluster implemented.
Alternatively, if you wish to modify the brightness of the LED, adopt the subsequent command pattern:
$ chip-tool levelcontrol move-to-level <level> <transition_time> <option_mask> <option_override> <node_id> <endpoint_id>
In this command:
<level>
denotes the brightness level encoded between 0 and 254, unless a custom range is configured in the cluster.<transition_time>
refers to the transition time.<option_mask>
is the option mask.<option_override>
stands for the option override.<node_id>
is the user-defined ID of the commissioned node.<endpoint_id>
signifies the ID of the endpoint with the LevelControl cluster implemented.
What value is <endpoint_id>? Where do I find it?
Step 8: Read basic information from the Matter device- Use the CHIP Tool’s read command on the basic cluster to read vendor name, product name, or software version.
$ chip-tool basic read vendor-name <node_id> <endpoint_id>
$ chip-tool basic read product-name <node_id> <endpoint_id>
$ chip-tool basic read software-version <node_id> <endpoint_id>
What value is <endpoint_id>? Where do I find it?
You can also use the following command to list all available commands for Basic cluster:
$ chip-tool basic
Appendix A -- Problems with Android CHIPTool.I found a page here: Commissioning nRF Connect Accessory with Android CHIPTool. This guide provides a comprehensive walkthrough for commissioning a Nordic Semiconductor device, specifically utilizing a Matter-enabled Thread network. The commissioning process involves the utilization of Android CHIPTool. The guide encompasses the establishment of a Thread Border Router, the building and programming of the nRF Connect example application, and the installation of CHIPTool on an Android smartphone. In addition to Preparing Accessory Device, Commissioning Accessory Device and Sending Matter Commands, the guide demonstrates how to control the accessory device using CHIPTool. This includes checking IPv6 connectivity, updating the device's IPv6 address, and changing the lock state.
An outline follows, that describes how I used the document to test the matter light_bulb firmware on the nRF7002DK remotely using my OpenThread Network.
The commissioning process using CHIPTool on Android is composed of the following main stages:
- CHIPTool discovers a Matter accessory device over Bluetooth LE.
- CHIPTool establishes a secure channel to the device over Bluetooth LE, and sends Matter operational credentials and Thread provisioning data.
- The accessory device joins a Matter-enabled Thread network.
The Android CHIPTool, uses both Bluetooth LE and the IPv6 connectivity. Bluetooth LE is used only during the commissioning phase. Afterwards, only the IPv6 connectivity between the smartphone and the accessory device is needed to send operational messages. The IPv6 address of the device is not exchanged during the commissioning process and CHIPTool must use DNS Service Discovery (DNS-SD) to learn or refresh the address before the controller initiates the IPv6-based communication.
The following diagram shows the connectivity between network components required to allow communication between devices running the CHIPTool and Lock applications:
Since a typical smartphone does not have a Thread radio built-in, extra effort is needed to prepare the fully-fledged testing environment that includes a Thread Border Router configured on a Linux PC. (My Ubuntu PC)
An outline of the Doc page follows with my comments on the sections that pertained to me. I skipped over some of the sections because they seem irelervent to my goal of getting the firmware working.
Requirements:
- Hardware and software prerequisites for commissioning, Include: My Openthread Network mentioned above. a smartphone with Android 8.0 or later, and my nRF7002 DK.
Setting up Thread Border Router:
- Skipped this section, since I have my OpenThread Network up and running.
Building nRF Connect Example Application:
- Skipped this also, since the light bulb Firmware was already built, flashed and tested on the nRF7002DK.
Building and Installing Android CHIPTool
- I had the Android CHIPTool already installed on my smartphone for another project Research & Experimentation with the Nordic Thingy:53, that involved the Thingy:53 commissioning
I started at this section and followed the steps to test the light_bulb firmware running on the nRF7002 DK.
Preparing Accessory Device:
- Steps to prepare the accessory device, involving UART console connection, triggering a factory reset, and obtaining the commissioning QR code.
My results from Preparing accessory Device
Step1 - Use Putty to use as a serial port, as describe in the steps above (use COM10 and a Baud Speed of 11520
Step2 - Trigger the Factory reset of the device. On the nRF7002DK, it is the RESET button to the left of button 1. Press it and hold for more than 6 seconds, to trigger a factory reset. This action will run the Matter Light_bulb firmware and will log messages to the Putty terminal as described below
Step 3 - find the QR code URL in the log as described below
Step4 - Click on the URL to bring up the following URL with a generated UPC code as described below
Step5 - Start the Bluetooth LE advertising, by pressing Button2 on the nRF7002DK for more than 6 seconds.
You should get the message in the Putty log that advertising has started.
Commissioning Accessory Device:
- Commissioning steps, including enabling Bluetooth and Location services on the smartphone, connecting to Wi-Fi, and using CHIPTool to scan the QR code and complete the Thread network settings.
- Now with the device is now advertising, perform the next steps
PROBLEMS: My results from commissioning accessory device
Step1, 2, 3 - Open the CHIPTool on an Android Smartphone
Step 4 - I had a few issues with this step. They are described at each substep
a. Tap the PROVISION CHIP DEVICE WITH THREAD button and scan the commissioning QR code.
Problem 1: Invalid QR CODE. Solution1: a relink of the URL revealed a much better QR code that worked
Problem2: now when I get a valid code, the network screen comes up and notifications in the next step b start appearing until a device not found message comes up and the CHIPTool and I never getting to step c? The CHIPTool is hung after the "Device Not Found" message? Why?
WHAT AM I DOING WRONG? Why can't the tool find the device?
b.Several notifications will appear, informing you of commissioning progress with scanning, connection, and pairing.
PROBLEM: At this point I received an error the the “Device was not found
c:At the end of this process, the Thread network settings screen appears.
PROBLEM: The “Thread network screen” popped up after the QR code was scanned?
I STOPPED HERE and I need to figure out WHY the Device is not found when commissioning over Bluetooth?? I've included the next section where I will continue after I get the nRF7002DK commissioned.
I will try to get help from the Challenge Discord server.
A member monitoring the Discord server replied with the following:
"We do not officially support the Android CHIP tool anymore and recommend using the chip tool for Linux and macOS, so there is no Android CHIPTool delivered as part of the nRF Connect SDK anymore. However, there should be a script for building the Android CHIPTool in the downstream Matter repository (ncs/modules/lib/matter). There's a guide here: https://github.com/project-chip/connectedhomeip/blob/v1.1.0.0/docs/guides/android_building.md"
Here is the operation of the ChipTool . That is not working. It is included here for my notes.
These are the screenshots I get when I operating the CHIP tool. It shows the Menu Network settings screen and the code being scaned and the pairing message.
Here is a recording of the ChipTool after selecting the option PROVISION CHIP DEVICE WITH THREAD It shows the messages as pairing is being done and hangs after the message "Device not found "
The next section will be done after I figure out my commissioning Problem. SO STAY TUNED..... THANKS
Sending Matter Commands:
After successful commissioning, the guide demonstrates how to control the accessory device using CHIPTool. This includes checking IPv6 connectivity, updating the device's IPv6 address, and changing the lock state.
After commissioning, follow the next steps to send commands to the device.
Helpful documentation that I found very helpful:
- Get started with the nRF7002 DK
- Nordic Semiconductor's "Introduction to Matter"
- A Webinar solution that demonstrates matter over thread with a Pi, nrf52840 dongle, 2x nRF devices.
Developing Matter 1.0 products with nRF Connect SDK
The presentation can be downloaded here
- Getting Started with Matter using Nordic Semiconductor’s SoCs and tools in both the nRF Connect SDK and Zephyr.
- Matter documentation in the nRF Connect SDK
- How to set up CHIP Tool for Linux or macOS
- Configuring your Thread Border Router
- DevZone Blog - Matter: Testing the nRF Connect platform with Apple, Google and Samsung ecosystems
- Gettting started with the nRF52840 Dongle.
- Nordic's tech Support and online community - Nordic DevZone
- Nordic DevAcademy – nRF Connect SDK Fundamentals
- Nordic DecAcademy – Bluetooth Low Energy Fundamentals
Comments