OpenThread Border Router setup on RPi Zero W

1,134 views
Skip to first unread message

Nikhil Komalan

unread,
Jun 25, 2021, 3:05:35 AM6/25/21
to openthread-users
Hello Developers,

I am currently building a cost efficient Open Thread network. In my setup i have few Full thread devices and Minimal Thread Device which will be sending data to cloud via Border Router. I have currently setup a RCP design Open Thread Border Router on RPi 3B+ by following the open thread docs and its working fine.

Doc Link: Open Thread Border Router Build and Configuration

Now as i want my final product to be as cost efficient as it can be, i would like to consider using RPi Zero W for setting up my Open Thread Border Router. So i was following the same steps mentioned in OTBR doc to setup it on RPi Zero W, i came across this line in Step 3 which states " Before you continue, make sure your configured hardware platform is connected to the internet using Ethernet. The bootstrap script disables the platform's WiFi interface and the setup script requires internet connectivity to download and install several packages. "

But my RPi Zero W only have WiFi interface. So i wanted to know, is it even possible to run OTBR setup on RPi Zero W ?

I have also read in docs that "Open Thread Border Router (OTBR) provides support for the Raspberry Pi 3B or newer (RPi) platform". But have anyone tried the same setup on RPi Zero W and was successful ? Because in the end as i said, i would like my final product to be as cost effective as possible.

Jonathan Hui

unread,
Jun 25, 2021, 3:11:41 AM6/25/21
to Nikhil Komalan, openthread-users
If you are not setting NETWORK_MANAGER=1 when running ./script/setup, I think it would work with just the Wi-Fi interface.

You can try running the following setup command:

INFRA_IF_NAME=wlan0 ./script/setup

Hope that helps.

--
Jonathan Hui



--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/af83e9ff-89c8-40be-808f-0ce28b11d7e2n%40googlegroups.com.

Nikhil Komalan

unread,
Jun 25, 2021, 3:50:51 AM6/25/21
to openthread-users

But the step you mentioned is Step 3. I am facing issues in Step 2 itself, due to internet failure.

Attached a image below:
RPIZeroW_Error.png

Nikhil Komalan

unread,
Jun 25, 2021, 4:26:44 AM6/25/21
to openthread-users

And I also have one more doubt actually confused a little bit hopefully you can help, the docs Step 5 tells me to append the RCP device port info in the /etc/default/otbr-agent. But when i open that file it already has information showed below but with extra information.

Current State of my file on my working RPI:

OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyACM0 trel://wlan0"

It has trel://wlan0 which is different from the docs statement " OTBR_AGENT_OPTS="-I wpan0 spinel+hdlc+uart:///dev/ttyUSB0" " . So i want to know should i remove trel://wlan0 from the file ?

OR

I should append this line OTBR_AGENT_OPTS="-I wpan0 spinel+hdlc+uart:///dev/ttyUSB0" irrespective of the above content ?

Jonathan Hui

unread,
Jun 25, 2021, 9:08:47 PM6/25/21
to Nikhil Komalan, openthread-users
I just went through the OTBR setup process on:
  1. Raspberry Pi 4B
  2. Fresh image of 2021-05-07-raspios-buster-armhf-lite.img
  3. nRF52840 USB dongle with RCP image
  4. Ethernet disconnected
And everything worked as expected.

Steps I did:
  1. Connect Wi-Fi interface using raspi-config.
  2. sudo apt-get update
  3. sudo apt-get install git
  4. git clone https://github.com/openthread/ot-br-posix
  5. cd ot-br-posix
  6. ./script/bootstrap
  7. INFRA_IF_NAME=wlan0 ./script/setup
  8. sudo reboot
I did not modify /etc/default/otbr-agent since the RCP shows up at /dev/ttyACM0.

--
Jonathan Hui



Nikhil Komalan

unread,
Jun 25, 2021, 11:58:24 PM6/25/21
to openthread-users
Okay. Let me check once again first i will try on RPi 3B+ than i will try to RPI Zero W to find the issue.

Can there be any dependency of the bootstrap script with the hardware i.e it won't run on RPi Zero W ?

Nikhil Komalan

unread,
Jun 28, 2021, 6:39:46 AM6/28/21
to openthread-users
Hello,

When I perform the above steps, mentioned by you, I don't get any issues in installation. But when I write ot-ctl to check RCP device state it shows me as disabled. 

Jonathan Hui

unread,
Jun 28, 2021, 11:29:13 AM6/28/21
to Nikhil Komalan, openthread-users
After initial setup, the Thread interface is disabled by default. You need to form a Thread network and enable the Thread interface - see Form a Thread network step in the Thread Border Router codelab.

--
Jonathan Hui



Nikhil Komalan

unread,
Jun 29, 2021, 2:15:29 AM6/29/21
to openthread-users
Hello,
I got it running on RPi 3B+, now will be trying the same for RPi Zero W.

In the mean while can you tell me, whats the use of setting up Wi-Fi Access Point Setup for Open Thread Border Router? Is it necessary to do this setup, because i can see a Warning mentioning that Border routing and Network Manager can't be enabled at same time. So whats the use of Access Point ? Like how can a RPi connected to internet via WiFi can be used at same time for providing Access Point.

After the steps you have mentioned above, will i be able to communicate to internet from thread devices in network ? Or i have to follow this steps also https://openthread.io/guides/border-router/access-point#configure-nat ?

Jonathan Hui

unread,
Jun 29, 2021, 2:17:56 AM6/29/21
to Nikhil Komalan, openthread-users
Wi-Fi AP on RPi is just a convenient way to avoid needing a separate Wi-Fi AP. If you have a separate Wi-Fi AP, then simply connect your RPi to that and avoid anything related to configuring Wi-Fi AP on RPi.

--
Jonathan Hui



Nikhil Komalan

unread,
Jun 29, 2021, 2:39:59 AM6/29/21
to openthread-users
Okay thanks for clarification.

Now i tried the same steps mentioned by you. Everything seems fine but there is only one issue going on.

In my /etc/default/otbr-agent file already have this
" OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyACM0 trel://wlan0" " and as my RCP device is connected on the same "ttyACM0" port i didn't changed anything.

But when i run sudo otbr-agent status i get the following output:

If you see in the image below the otbr-agent is not getting the serial interface, it just mention :///dev/

OTBRRPiZeroW.png

How to solve this issue ? I have checked all other services is running and also RPi is in running state.

Kangping Dong

unread,
Jun 29, 2021, 2:49:44 AM6/29/21
to Nikhil Komalan, openthread-users
I think the otbr-agent is already running/working.
Can you grep the log with "cat /var/log/syslog | grep otbr-agent" ?

Nikhil Komalan

unread,
Jun 29, 2021, 3:07:52 AM6/29/21
to openthread-users
The command which you mentioned gives me "Binary file (standard input) matches" .
Sorry I think it can be issue with my serial terminal utility as well, i have connected to RPi Zero via UART.
OTBR_RPIZero_Running.png

Nikhil Komalan

unread,
Jun 29, 2021, 5:05:01 AM6/29/21
to openthread-users
Hello,
Thanks everyone involved. I was able to setup border router on RPi Zero W.

I am able to ping Border Router, OMR from from end devices in thread network. So should i assume my setup is running perfectly. Or is there any other way of finding if my Border Router setup is fully working.

Kangping Dong

unread,
Jun 29, 2021, 9:44:23 AM6/29/21
to Nikhil Komalan, openthread-users
the `sudo service` command already gives the state as "active (running)", so it should be running :)

Nikhil Komalan

unread,
Jun 29, 2021, 11:55:25 PM6/29/21
to openthread-users
1. Is only RCP design supported by the border router, because i saw video from Google on Youtube on Open Thread were they have also implemented NCP design Border Router.

2. Also i would like to know on my Border Router how can i receive the data, which is sent by all the nodes in the thread network. My objective is to send data to Border Router from there i can establish a MQTT connection to cloud to forward data.  Currently i am using Nordic Coap Client Server examples, but not able to watch  the packets received on border router.
I have used tcpdump with wpan0 interface but it just gives the traffic information on network, which IPs are sending etc.

Jonathan Hui

unread,
Jun 30, 2021, 1:53:53 AM6/30/21
to Nikhil Komalan, openthread-users
On Tue, Jun 29, 2021 at 8:55 PM Nikhil Komalan <nkoma...@gmail.com> wrote:
1. Is only RCP design supported by the border router, because i saw video from Google on Youtube on Open Thread were they have also implemented NCP design Border Router.

The current openthread/ot-br-posix main branch only supports RCP mode. For historical reference, you can look at wpantund/master master branch as well, which does support NCP with wpantund. Is there a particular reason why you want to use NCP mode?
 
2. Also i would like to know on my Border Router how can i receive the data, which is sent by all the nodes in the thread network. My objective is to send data to Border Router from there i can establish a MQTT connection to cloud to forward data.  Currently i am using Nordic Coap Client Server examples, but not able to watch  the packets received on border router.
I have used tcpdump with wpan0 interface but it just gives the traffic information on network, which IPs are sending etc.

Thread is an IPv6-based network. You can transport data using any IPv6-based protocol, including UDP, CoAP, and even MQTT itself. Set the IPv6 destination address to one assigned on your border router.

--
Jonathan Hui
 
 

Nikhil Komalan

unread,
Jun 30, 2021, 4:30:43 AM6/30/21
to openthread-users
Currently i have just started developing my open thread network.  So i am free to accept any Co-processor design, just was curious to know why only RCP device was referred in docs.

Which IPv6 ?
RpiZeorW.png
Or this or-ctl ipaddr
t-ctl-ip.png

Jonathan Hui

unread,
Jun 30, 2021, 11:16:36 AM6/30/21
to Nikhil Komalan, openthread-users
We currently recommend using RCP when possible.

The IPv6 addresses assigned to either wpan0 or wlan0 interfaces should work. OTBR will ensure that Thread devices can route to the infrastructure link (which you have configured as wlan0 during setup).

--
Jonathan Hui



--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.

Nikhil Komalan

unread,
Jul 1, 2021, 1:58:02 AM7/1/21
to openthread-users
Okay i found one issue in my Border Router setup. I have build and flashed my nRF52840 DK with RCP hex (usb) by following the steps given below:

$ mkdir -p ~/src
$ cd ~/src
$ cd ot-nrf528xx $ script/build nrf52840 USB_trans -DOT_THREAD_VERSION=1.2
$ cd ~/src/ot-nrf528xx/build/bin
$ arm-none-eabi-objcopy -O ihex ot-rcp ot-rcp.hex

As you see i am using a USB interface between my development board and Border router. The default configuration in /etc/default/otbr-agent is of spinel over uart.

So how to change the interface spinel interface from UART to USB ? Just replacing with UART with USB will it work ?

For example:
"OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+usb:///dev/ttyACM0 trel://wlan0"

Jonathan Hui

unread,
Jul 1, 2021, 10:41:27 AM7/1/21
to Nikhil Komalan, openthread-users
The radio URL should continue to specify UART (not USB). The nRF52840 configured for USB transport appears as a standard TTY device in Linux.

--
Jonathan Hui


Nikhil Komalan

unread,
Jul 2, 2021, 2:04:43 AM7/2/21
to openthread-users
Okay thanks for the information.

I would also like to know how can I setup OTBR with NCP design ? Are there any doc links available for the setup ? Also does that setup require Ethernet connection for running bootstrap script ?

I am inquiring about NCP design because there are some examples provided by the Nordic in nRF5 SDK for Thread which specifically requires NCP device.To be more specific the "MQTT-SN example in SDK" require NCP device attached to border router as mentioned in there docs.

Jonathan Hui

unread,
Jul 2, 2021, 2:22:39 AM7/2/21
to Nikhil Komalan, openthread-users
MQTT-SN is a UDP-based protocol. I don't see why MQTT-SN would require an NCP.

Note that Nordic recommends using nRF Connect SDK for all new products. Nordic's Thread development page states the following:

"You can still use the nRF5 SDK for Thread and ZigBee for our nRF52 Series SoCs. Be aware that only the nRF Connect SDK is in active development. For all new products we recommend the nRF Connect SDK."

That said, if you are stuck with using nRF5 SDK for Thread and Zigbee, I would recommend using the code provided in the SDK.

--
Jonathan Hui



Nikhil Komalan

unread,
Jul 2, 2021, 2:34:03 AM7/2/21
to openthread-users
Yes i have also read that nRF Connect SDK will be the only SDK actively developed from now on. But thing is currently in NCS there aren't many examples available for Open Thread. There are just CLI, and simple COAP Client and server examples which are just used for communication between thread devices in Network.

Meanwhile nRF5 SDK for thread have variety of examples including COAP updates to things.io as well as to Google Cloud. That's why i tried out nRF5 SDK for Thread v4.1 (latest and the last) version.

Nikhil Komalan

unread,
Jul 2, 2021, 3:16:39 AM7/2/21
to openthread-users
I have a doc made by colleague when he was handling this project, which have steps for NCP installation .

8. Set up the Boarder Router for Linux
Step_1 : Clone the OTBR repository:
git clone https://github.com/openthread/ot-br-posix
Step_2 : Install dependencies:
cd ot-br-posix
./script/bootstrap
NETWORK_MANAGER=0 ./script/setup

Step_3 : Add this to /etc/wpantund.conf.
Config:NCP:SocketPath "/dev/ttyACM0"

Step_4 : Build and flash NCP on device and Attach the
flashed NCP device to the Border Router platform via USB.
#file:images/nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8/ex
amples/thread/ncp/ftd/usb/hex

Step_5 : Verify that the NCP device is present.For
example, if the device should be attached to /dev/ttyACM0

Step_6 :
Restart system

Step_7 : Verify NCP
sudo wpanctl status
open web browser type localhost

Will this steps work now ?

Jonathan Hui

unread,
Jul 2, 2021, 3:23:10 AM7/2/21
to Nikhil Komalan, openthread-users
As I mentioned in a previous response, the current openthread/ot-br-posix main branch only supports RCP mode. For historical reference, you can try using the wpantund/master branch, which does support NCP with wpantund.

Also, as previously mentioned, if you are trying to run the nRF5 SDK for Thread examples, I suggest using the code provided by the SDK (rather than GitHub) since the nRF5 SDK documentation will be consistent with the SDK code and not the latest GitHub.

--
Jonathan Hui



Nikhil Komalan

unread,
Jul 2, 2021, 7:46:44 AM7/2/21
to openthread-users

Hello,
The Steps mentioned by you for current version will it work for previous version setup. I just have to go to wpantund master directory and run the script ?

Steps mentioned by you:
  1. Connect Wi-Fi interface using raspi-config.
  2. sudo apt-get update
  3. sudo apt-get install git
  4. git clone https://github.com/openthread/ot-br-posix
  5. cd ot-br-posix
  6. ./script/bootstrap
  7. INFRA_IF_NAME=wlan0 ./script/setup
  8. sudo reboot


Nikhil Komalan

unread,
Jul 2, 2021, 7:50:45 AM7/2/21
to openthread-users
When i try to git clone git clone https://github.com/openthread/ot-br-posix/tree/wpantund/master
it gives me fatal repo error.

Jonathan Hui

unread,
Jul 2, 2021, 2:40:09 PM7/2/21
to Nikhil Komalan, openthread-users
To clone a specific branch, you need to use the `-b` option.

git clone -b wpantund/master https://github.com/openthread/ot-br-posix

As I previously mentioned, if you are looking to leverage the Nordic nRF5 SDK for Thread examples, I strongly encourage you to use the Thread Border Router provided by the SDK.


--
Jonathan Hui



Nikhil Komalan

unread,
Jul 2, 2021, 11:36:32 PM7/2/21
to openthread-users
Thanks i got your point. I also know from the docs that nRF5 SDK for thread example are best suited to work with Nordic Border Router image.

But i don't see any reason why it shouldn't run with Border Router setup RCP design as stated in openthread.io as beneath all the open thread is same.

Nikhil Komalan

unread,
Jul 2, 2021, 11:47:17 PM7/2/21
to openthread-users
So as of now i will be testing Nordic Thread examples firstly with border router image they have provided (unsupported currently) just to check the output.

Than my intentions is to move to current version of Border Router with RCP design if the examples work with it than it would be great, if it doesn't i will move to wpantund/master branch. If that also don't work than only i will go to Nordic image as last option.

I have seen the demo on YouTube using same boards, were data is sent t Google cloud using MQTT and COAP. After reading the docs, the COAP example was same as given in Nordic nRF5 SDK for Thread. So would like to know which border router image you preferred for that demo.

Thanks & Regards,
Nikhil Komalan

Jonathan Hui

unread,
Jul 3, 2021, 12:25:29 AM7/3/21
to Nikhil Komalan, openthread-users
CoAP is a UDP-based protocol. It should not matter whether you are using NCP or RCP.

--
Jonathan Hui



Nikhil Komalan

unread,
Jul 3, 2021, 1:05:57 AM7/3/21
to openthread-users
Okay thanks. :)

Nikhil Komalan

unread,
Aug 13, 2021, 3:09:44 AM8/13/21
to openthread-users
Hello,

Step_1 : Clone the OTBR repository (wpantund version)

Step_2 : Install dependencies:

cd ot-br-posix

./script/bootstrap

NETWORK_MANAGER=0 ./script/setup


Step_3 : Add this to /etc/wpantund.conf.

Config:NCP:SocketPath "/dev/ttyACM0"


Step_4 : Build and flash NCP on device and Attach the flashed NCP device to the Border Router platform via USB.

#file:images/nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8/examples/thread/ncp/ftd/usb/hex


Step_5 : Verify that the NCP device is present.For example, if the device should be attached to /dev/ttyACM0


Step_6 : Restart system

Step_7 : Verify NCP

sudo wpanctl status

    open web browser type localhost.


I have done the OTBR setup with my NCP device by following the above steps I am able to ping NCP <--> Thread devices in network. But when i try to ping 64:ff9b::acd9:a46e i am unable to ping.

Is there any extra setup needed ? Or are there any docs for the same.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages