This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Issue Running Open Thread Border Agent on Raspberry Pi 3 with NRF52840 as Network Co-processor (NCP)

Hi,

I am trying to implement a Thread Border Router on Raspberry Pi 3 with NRF52840DK as a Network Co-processor (NCP).

I have followed the below steps to install the Thread Border Router on Raspberry Pi 3.

Step 1: Cloned open thread border router(OTBR) repository

$ git clone github.com/.../ot-br-posix.git --depth 1

Step 2: Build and Installed OTBR on Raspberry Pi

$ cd ot-br-posix
$ ./script/bootstrap
$ INFRA_IF_NAME=wlan0 ./script/setup

Step 3: Built and Flashed nrf/samples/openthread/coprocessor example on NRF52840DK from NRF Connect SDK (NCS) v1.6.1

$ west build -b nrf52840dk_nrf52840 --build_dir build_nrf52840dk_nrf52840

$ west flash --snr 683344644 --build-dir build_nrf52840dk_nrf52840/

Step 4: Connected the NRF52840DK to Raspberry Pi 3 over USB.

Step 5: Found the emulated NRF52840DK UART port.

In this case it is /dev/ttyACM0

Step 6: Updated the /etc/default/otbr-agent settings file to.

pi@raspberrypi:/etc/default $ cat otbr-agent
# Default settings for otbr-agent. This file is sourced by systemd

# Options to pass to otbr-agent
OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyACM0 trel://wlan0"

Step 7: Rebooted the Raspberry Pi

Step 8: Checked the otbr-agent service status

pi@raspberrypi:/etc/default $ sudo service otbr-agent status
● otbr-agent.service - Border Router Agent
    Loaded: loaded (/lib/systemd/system/otbr-agent.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Fri 2021-09-10 19:52:56 BST; 180ms ago
  Process: 2035 ExecStart=/usr/sbin/otbr-agent $OTBR_AGENT_OPTS (code=exited, status=6)
Main PID: 2035 (code=exited, status=6)

The service starts and keeps on exiting with status code 6. I have even tried restarting the service but still no luck. Can someone tell me if I am missing anything?

  • Hi Marjeris,

    I tried forming a Thread Network from OTBR Web GUI and it showed me even operation successful. But If I go to the status tab it is showing me this.

    Below are otbr-agent service logs:

    Oct 2 15:02:08 raspberrypi systemd[1]: otbr-agent.service: Main process exited, code=exited, status=6/NOTCONFIGURED
    Oct 2 15:02:08 raspberrypi systemd[1]: otbr-agent.service: Failed with result 'exit-code'.
    Oct 2 15:02:14 raspberrypi systemd[1]: otbr-agent.service: Service RestartSec=5s expired, scheduling restart.
    Oct 2 15:02:14 raspberrypi systemd[1]: otbr-agent.service: Scheduled restart job, restart counter is at 312.
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Running 0.3.0-e149a60eb
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Thread version: 1.2.0
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Thread interface: wpan0
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Backbone interface: wlan0
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=1000000
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Radio URL: trel://wlan0
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-PLAT----: RCP reset: RESET_POWER_ON
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [NOTE]-PLAT----: RCP API Version: 4
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-PLAT----: Backbone interface is configured to wlan0 (3)
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Set state callback: OK
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Stop Thread Border Agent
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-ADPROXY-: Stopped
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-DPROXY--: stopped
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Initialize OpenThread Border Router Agent: OK
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-UTILS---: Border router agent started.
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Thread is down
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Stop Thread Border Agent
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-ADPROXY-: Stopped
    Oct 2 15:02:14 raspberrypi otbr-agent[3479]: [INFO]-DPROXY--: stopped
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Thread is up
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Stop Thread Border Agent
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-ADPROXY-: Stopped
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-DPROXY--: stopped
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-ADPROXY-: Started
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Publish meshcop service OpenThread_BorderRouter._meshcop._udp.local.
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-MDNS----: Add service: OpenThread_BorderRouter._meshcop._udp (ref: 0x1f01a88)
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-ADPROXY-: Publish all hosts and services
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-DPROXY--: started
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [INFO]-AGENT---: Start Thread Border Agent: OK
    Oct 2 15:02:19 raspberrypi otbr-agent[3479]: [CRIT]-PLAT----: HandleRcpTimeout() at ../../third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:2202: RadioSpinelNoResponse
    Oct 2 15:02:20 raspberrypi systemd[1]: otbr-agent.service: Main process exited, code=exited, status=6/NOTCONFIGURED
    Oct 2 15:02:20 raspberrypi systemd[1]: otbr-agent.service: Failed with result 'exit-code'.
    Oct 2 15:02:25 raspberrypi systemd[1]: otbr-agent.service: Service RestartSec=5s expired, scheduling restart.
    Oct 2 15:02:25 raspberrypi systemd[1]: otbr-agent.service: Scheduled restart job, restart counter is at 313.
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Running 0.3.0-e149a60eb
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Thread version: 1.2.0
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Thread interface: wpan0
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Backbone interface: wlan0
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=1000000
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-UTILS---: Radio URL: trel://wlan0
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [INFO]-PLAT----: RCP reset: RESET_POWER_ON
    Oct 2 15:02:25 raspberrypi otbr-agent[3489]: [NOTE]-PLAT----: RCP API Version: 4

  • Hi Mohinish,

    About NCP support, Google decided to drop support for it in OT-BR. NCS still supports NCP build, but if someone wants to use it they should implement their own host side border router.

    Could you try to run 'ot-ctl state' to check if you have contact with the RCP device? As it says that the RCP status is detached...

    Best regards,

    Marjeris

  • Hi Marjeris,

    I tried running 'sudo ot-ctl state' commands but it tends to return different results.

    pi@raspberrypi:~ $ sudo ot-ctl state
    detached
    Done
    pi@raspberrypi:~ $ sudo ot-ctl state
    leader
    Done
    pi@raspberrypi:~ $ sudo ot-ctl state
    connect session failed: Connection refused
    pi@raspberrypi:~ $ sudo ot-ctl state
    connect session failed: Connection refused
    pi@raspberrypi:~ $ sudo ot-ctl state
    detached
    Done

  • Hi Mohinish

    A Thread node can be in different states.

    The detached state means that the node is set up correctly, and thread is active, but that it is not yet part of any Thread network.
    The leader state means that the Thread device is a part of a Thread network, and it is also the leader of the Thread network.
    The leader state means that the Thread device is a part of a Thread network, but it is not the leader.

    The "connect session failed: Connection refused" response you get could indicate that the Raspberry Pi has lost connection with the nRF52840DK.
    This could be due to a defect in the USB cable. Could you try to change to another USB cable for the nRF52840DK and see if you still get the "connect session failed: Connection refused" error?

    Spinel is a client used for communicate with the NCP(nRF52840DK). The error message in your earlier logs,"RadioSpinelNoResponse", could indicate that the Raspberry Pi does not have a connection to the NCP. So try the setup as well after you change the USB cable, and see if this is still there

    Regards,
    Sigurd Hellesvik

  • I tried changing the USB cable but still giving the same issue. I am using NCS v1.7 to build NRF52840 RCP target and OT-BR commit e149a60eb to build on Raspberry Pi 3B. Please try reproducing the issue.

Related