Most home alarm systems nowadays are using non-Matter connection. I am going to build a home alarm system which uses the Matter connection. Besides a home alarm system, it is also a home monitoring system where sensors data will be displayed on a web dashboard and possibly controls some actuators.
.
The system can be set in alarm or home mode. In alarm mode, the alarm (buzzer) will go off and LED will be turned on if there is movement being detected by the motion sensor. The nRF7002 DK is the processing unit which will read sensors data, control actuators and sending data to cloud over Matter connection.
.
Configure Border Router and controller on one deviceI am using a Raspberry Pi to run the Thread Border Router and the CHIP Tool. To simply the setup, a Docker container with OpenThread Bourder Router image is used.
.
Steps taken:
- Configure the Thread Border Router
- Configure the CHIP Tool
.
.
Follow the instructions to setup and configure the environment. Follow those necessary subpages which require quite a huge effort to complete the setup and configuration. Refer to the helpful links below for further details.
.
Configuring a radio co-processor.
Generate the RCP firmware package:
.
Install the RCP firmware package onto the nRF52840 Dongle:
.
Running OTBR using Docker.
Start the OpenThread Border Router container:
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:84c6aff --radio-url spinel+hdlc+uart:///dev/radio?uart-baudrate=1000000
.
Form the Thread network by opening the http://<ip>:8080/
address in a web browser and select the Form from the menu:
.
.
Configure the CHIP ToolBuild the tool manually from the source files as I am using SDK v2.5.0.
Run the following command in the connectedhomeip directory:
./scripts/examples/gn_build_example.sh examples/chip-tool BUILD_PATH
Run the following command form the BUILD_PATH directory:
./chip-tool
Get the nRF Connect SDK code v2.5.0For command line environment, use the following step to get the nRF Connect SDK code v2.5.0.
.
nrfutil toolchain-manager launch --terminal
.
west init -m https://github.com/nrfconnect/sdk-nrf --mr v2.5.0
west update
.
Using CHIP Tool for Matter device testing
Follow the steps illustrated in the above link to start testing those sample applications.
.
Testing the Matter Lighting Application Sample.
Step 1: Preparing the Matter device
Refer to instructions from Matter nRF Connect Lighting Example Application
Building instructions:
$ cd examples/lighting-app/nrfconnect
$ west build -b nrf7002dk_nrf5340_cpuapp
Step 2: Enable Bluetooth LE advertising on Matter device, if required
Step 3: Setup the IP network
Step 4: Determine network paring credentials
sudo docker exec -it otbr sh -c "sudo ot-ctl dataset active -x"
0e08000000000001000035060004001fffe00708fd65974194bdbb040c0402a0f7f8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f0410445f2b5ca6f2a93a55ce570a70efeecb000300000f0208111111112222222201021234
Step 5: Determine Matter device's discriminator and setup PIN code
Step 6: Commission Matter device into an existing IP network
Step 7: Control application Data Model clusters
Step 8: Read basic information from the Matter device
.
Build problems encountered.
I keep getting errors while testing the Matter Lighting Application Sample working. First try to build with an ARM based Raspberry Pi platform and getting some errors during the build. Later I switched to a Windows based PC and getting some other errors.
.
Summary.
Setting up a working Matter environment from ground up is not a trivial task. You need to get the right platform and the matching version of software (repos) to build and run the application samples. Up to now, I manage to complete half of the work that intended. I will continue to work on the rest using other platforms and devices.
.
Helpful links.
Matter over Thread: Configuring Border Router and controller on one device
Configure the Thread Border Router
How to install Ubuntu Server on Raspberry Pi
Cloning Zephyr and installing Zephyr SDK
Installing the nRF Connect SDK
Installing nRF Command Line Tools
Installing nRF Util for nRF5 SDK
Building and running OpenThread Co-Processor sample application
Programming and Debugging nRF52840 Dongle
.
.
.
Comments