This application note explains how to setup Open Thread Border Router on NAVQ Plus.
Thread Border Router
A Thread Border Router connects a Thread network to other IP-based networks, such as Wi-Fi or Ethernet. A Thread network requires a Border Router to connect to other networks.
Thread Radio Co-Processor
Radio Co-Processor (RCP) is the interface between the NAVQ Plus where Open Thread Border Router (OTBR) runs and the Thread radio communication. OpenThread Border Router supports a variety of adapters. SONOFF Zigbee 3.0 USB Dongle Plus-E, usually referred to as ZBDongle-E (Amazon).
Hardware Setup
Connect ZBDongle-У to NAVQ Plus using USB hub that is plugged into the USB1 port of the NAVQ Plus.
Flashing RCP Dongle
To use Thread network with ZBDongle-E, Thread Radio Co-Processor firmware is required. To flash ZBDongle-E firmware, install Silabs universal flasher on NAVQ Plus:
user@imx8mpnavq:~$ pip3 install universal-silabs-flasher
Download RCP firmware:
user@imx8mpnavq:~$ wget https://github.com/darkxst/silabs-firmware-builder/raw/main/firmware_builds/zbdonglee/ot-rcp-v2.3.1.0-zbdonglee-230400.gbl
Issue the below command to flash firmware:
user@imx8mpnavq:~$ sudo universal-silabs-flasher --device /dev/ttyACM0 \ flash --firmware ot-rcp-v2.3.1.0-zbdonglee-230400.gbl --allow-cross-flashing
Disconnect the dongle and connect it back. Run the below command to verify it is connected:
user@imx8mpnavq:~$ ls -la /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Oct 19 11:36 /dev/ttyACM0
Software Setup
For correct functioning of the Thread network with NAVQ Plus BSP release 1.1.9 or higher is required.
Enable OTBR agent otbr-agent
service to start automatically when system boots:
user@imx8mpnavq:~$ sudo systemctl enable otbr-agent Created symlink /etc/systemd/system/otbr-agent.service → /lib/systemd/system/otbr-agent.service. Created symlink /etc/systemd/system/multi-user.target.wants/otbr-agent.service → /lib/systemd/system/otbr-agent.service.
Start otbr-agent
service by running:
user@imx8mpnavq:~$ sudo systemctl restart otbr-agent
Verify OTBR agent has started:
● otbr-agent.service - OpenThread Border Router Agent Loaded: loaded (/lib/systemd/system/otbr-agent.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2023-10-23 16:08:56 UTC; 6s ago Process: 2623 ExecStartPre=/usr/sbin/service mdns start (code=exited, status=0/SUCCESS) Main PID: 2642 (otbr-agent) Tasks: 1 (limit: 3198) Memory: 1.6M CPU: 82ms CGroup: /system.slice/otbr-agent.service └─2642 /usr/sbin/otbr-agent -I wpan0 -B mlan0 spinel+hdlc+uart:///dev/ttyACM0 trel://mlan0 Oct 23 16:08:57 imx8mpnavq otbr-agent[2642]: 00:00:00.855 [I] Platform------: [netif] ADD [M] ff03:0:0:0:0:0:0:fc (already subscribed, ignored) Oct 23 16:08:57 imx8mpnavq otbr-agent[2642]: 00:00:00.856 [I] Platform------: [netif] ADD [M] ff03:0:0:0:0:0:0:1 (already subscribed, ignored) Oct 23 16:08:57 imx8mpnavq otbr-agent[2642]: 00:00:00.856 [I] Platform------: [netif] ADD [M] ff02:0:0:0:0:0:0:16 (already subscribed, ignored) Oct 23 16:09:00 imx8mpnavq otbr-agent[2642]: 00:00:03.798 [I] Platform------: [netif] Message dropped by Thread Oct 23 16:09:01 imx8mpnavq otbr-agent[2642]: 00:00:05.340 [I] Mle-----------: Send Link Request (ff02:0:0:0:0:0:0:2) Oct 23 16:09:02 imx8mpnavq otbr-agent[2642]: 00:00:05.580 [W] Platform------: Handle transmit done failed: ChannelAccessFailure Oct 23 16:09:02 imx8mpnavq otbr-agent[2642]: 00:00:05.580 [I] Mac-----------: Frame tx attempt 16/16 failed, error:ChannelAccessFailure, len:61, seqnum:228, type:Data, src:6ae36605355389d5, dst:0xffff, sec:no, ackreq:no Oct 23 16:09:02 imx8mpnavq otbr-agent[2642]: 00:00:05.580 [N] MeshForwarder-: Failed to send IPv6 UDP msg, len:82, chksum:002c, ecn:no, to:0xffff, sec:no, error:ChannelAccessFailure, prio:net Oct 23 16:09:02 imx8mpnavq otbr-agent[2642]: 00:00:05.580 [N] MeshForwarder-: src:[fe80:0:0:0:68e3:6605:3553:89d5]:19788 Oct 23 16:09:02 imx8mpnavq otbr-agent[2642]: 00:00:05.580 [N] MeshForwarder-: dst:[ff02:0:0:0:0:0:0:2]:19788 ~
Creating Dataset
Initialize a new dataset:
user@imx8mpnavq:~$ sudo ot-ctl dataset init new Done
Issue the below commands to set up network credentials (Personal Area Network ID (PAN ID), Extended Personal Area Network ID (XPAN ID), Network Name and Network key):
user@imx8mpnavq:~$ sudo ot-ctl dataset panid 0xdaf7 Done user@imx8mpnavq:~$ sudo ot-ctl dataset extpanid 1122334455667788 Done user@imx8mpnavq:~$ sudo ot-ctl dataset networkname OpenThread Done user@imx8mpnavq:~$ sudo ot-ctl dataset networkkey 00112233445566778899aabbccddeeff Done
Generate the Pre-Shared Key using pskc
(Syntax is "pskc <PASSPHRASE> <EXTPANID> <NETWORK_NAME>
"):
user@imx8mpnavq:~$ pskc 654321 1122334455667788 OpenThread 07708bf664c00858c19269cf10261e5b
Set pskc
from output of the command above:
user@imx8mpnavq:~$ sudo ot-ctl dataset pskc 07708bf664c00858c19269cf10261e5b
Commit the active dataset:
user@imx8mpnavq:~$ sudo ot-ctl dataset commit active Done
Add on-mesh prefix:
user@imx8mpnavq:~$ sudo ot-ctl prefix add fd11:22::/64 pasor Done
Issue the below commands to start Thread network:
user@imx8mpnavq:~$ sudo ot-ctl ifconfig up Done user@imx8mpnavq:~$ sudo ot-ctl thread start Done user@imx8mpnavq:~$ sudo ot-ctl netdata register Done
Wait for 10 seconds and verify network status:
user@imx8mpnavq:~$ sudo ot-ctl state leader Done
To get active dataset to use with chip-tool
issue the following command:
user@imx8mpnavq:~$ sudo ot-ctl dataset active -x 0e080000000000010000000300000b35060004001fffe00708fdebe98b055ed9440c0402a0f7f80102daf702081122334455667788030a4f70656e546872656164051000112233445566778899aabbccddeeff041007708bf664c00858c19269cf10261e5b Done
Please refer to Using Eve Energy smart plug with NAVQ Plus page as example of connecting to a Thread device using Matter protocol.