This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF21540DK as Thread RCP

Hello,

I have a running thread network now. Yay!

I am using a BMD-341 module from a old board as a Thread Sleeping end device. Getting great results.

I've flashed the module with the mqttsn_sleepy_subscriber example from nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8.

I am running the OTBR Docker Container on a Raspberry Pi. I've hooked up a nRF21540DK with the usb interface.

For the nRF21540DK I am Currently using the ot-rcp firmware built with the https://github.com/openthread/ot-nrf528xx repo. However I am having some trouble with getting the FEM to work. I am getting -70dBm RSSI measurements with a distance of 10cm. I know this is a problem with the FEM configuration. I've also made a github issue about getting the nRF21540DK working with ot-rcp.

I tried to build RCP firmware using the CoProcessor Example in the nRF Connect SDK v1.7.1. The firmware is running but the container does not connect with the device. I am hoping someone here knows why this example does not run with the OTBR Docker Container.

nRF21540DK RTT Logs:

[00:00:00.002,868] <inf> ieee802154_nrf5: nRF5 802154 radio initialized
[00:00:00.003,662] <inf> net_otPlat_uart: Waiting for host to be ready to communicate
[00:00:00.007,629] <inf> usb_cdc_acm: Device suspended
[00:00:00.304,412] <inf> usb_cdc_acm: Device resumed
[00:00:00.304,412] <inf> usb_cdc_acm: from suspend
[00:00:00.551,055] <inf> usb_cdc_acm: Device configured
[00:00:00.002,899] <inf> ieee802154_nrf5: nRF5 802154 radio initialized
[00:00:00.003,692] <inf> net_otPlat_uart: Waiting for host to be ready to communicate
[00:00:00.007,659] <inf> usb_cdc_acm: Device suspended
[00:00:00.246,307] <inf> usb_cdc_acm: Device resumed
[00:00:00.246,307] <inf> usb_cdc_acm: from suspend
[00:00:00.490,844] <inf> usb_cdc_acm: Device configured

OTBR Docker Container logs:

+ service tayga start
 * Starting userspace NAT64 tayga        
[ OK ]
+ dns64_start
+ with NAT64
+ local value
++ printenv NAT64
+ value=1
+ [[ -z 1 ]]
+ [[ 1 == 1 ]]
+ with DNS64
+ local value
++ printenv DNS64
+ value=1
+ [[ -z 1 ]]
+ [[ 1 == 1 ]]
++ _detect_service_name
++ dpkg -L bind9
++ grep /etc/init.d/
++ cut -d/ -f4
+ service_name=bind9
+ have systemctl
+ command -v systemctl
+ command -v service
/usr/sbin/service
+ sudo service bind9 start
 * Starting domain name service... bind9        
[ OK ]
+ firewall_start
+ with DOCKER
+ local value
++ printenv DOCKER
+ value=1
+ [[ -z 1 ]]
+ [[ 1 == 1 ]]
+ service otbr-firewall start
+ have systemctl
+ command -v systemctl
+ have service
+ command -v service
+ sudo service rsyslog status
 * rsyslogd is not running
+ sudo service rsyslog start
 * Starting enhanced syslogd rsyslogd        
[ OK ]
+ sudo service dbus status
 * dbus is not running
+ sudo service dbus start
 * Removing stale PID file /var/run/dbus/pid.
 * Starting system message bus dbus        
[ OK ]
+ sudo service mdns status
Usage: /etc/init.d/mDNS {start|stop|reload|restart}
+ sudo service mdns start
Starting Apple Darwin Multicast DNS / DNS Service Discovery daemon: mdnsd.
+ sudo service avahi-daemon status
Process 212 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
Avahi mDNS/DNS-SD Daemon is not running
+ sudo service avahi-daemon start
 * Starting Avahi mDNS/DNS-SD Daemon avahi-daemon        
[ OK ]
+ sudo service otbr-agent status
 * otbr-agent is not running
+ sudo service otbr-agent start
 * Removing stale PID file /var/run/otbr-agent.pid.
 * Starting thread border agent otbr-agent        
[ OK ]
+ without WEB_GUI
+ with WEB_GUI
+ local value
++ printenv WEB_GUI
+ value=1
+ [[ -z 1 ]]
+ [[ 1 == 1 ]]
+ sudo service otbr-web status
 * otbr-web is not running
+ sudo service otbr-web start
 * Removing stale PID file /var/run/otbr-web.pid.
 * Starting thread web interface otbr-web        
[ OK ]
+ . /dev/null
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: New relevant interface lo.IPv4 for mDNS.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Network interface enumeration completed.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Registering new address record for fe80::42:acff:fe11:3 on eth0.*.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Registering new address record for 172.17.0.3 on eth0.IPv4.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Registering new address record for ::1 on lo.*.
Dec 23 16:14:46 6f42ccb377d4 avahi-daemon[212]: Registering new address record for 127.0.0.1 on lo.IPv4.
Dec 23 16:14:46 6f42ccb377d4 rsyslogd: rsyslogd's groupid changed to 101
Dec 23 16:14:46 6f42ccb377d4 rsyslogd: rsyslogd's userid changed to 101
Dec 23 16:14:46 6f42ccb377d4 rsyslogd:  [origin software="rsyslogd" swVersion="8.32.0" x-pid="141" x-info="http://www.rsyslog.com"] start
Dec 23 16:14:47 6f42ccb377d4 avahi-daemon[212]: Server startup complete. Host name is 6f42ccb377d4.local. Local service cookie is 1282487036.
Dec 23 16:14:47 6f42ccb377d4 otbr-agent[248]: [INFO]-UTILS---: Running 0.3.0-72fa16e
Dec 23 16:14:47 6f42ccb377d4 otbr-agent[248]: [INFO]-UTILS---: Thread version: 1.2.0
Dec 23 16:14:47 6f42ccb377d4 otbr-agent[248]: [INFO]-UTILS---: Thread interface: wpan0
Dec 23 16:14:47 6f42ccb377d4 otbr-agent[248]: [INFO]-UTILS---: Backbone interface: eth0
Dec 23 16:14:47 6f42ccb377d4 otbr-agent[248]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0
Dec 23 16:14:47 6f42ccb377d4 otbr-web[284]: [INFO]-WEB-----: Running 0.3.0-72fa16e
Dec 23 16:14:47 6f42ccb377d4 otbr-web[284]: [INFO]-WEB-----: Border router web started on wpan0
Dec 23 16:14:47 6f42ccb377d4 otbr-web[284]: [ERR ]-WEB-----: OpenThread daemon is not running.
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.427236] usb 1-1.2: new full-speed USB device number 43 using dwc_otg
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.571170] usb 1-1.2: New USB device found, idVendor=1915, idProduct=0000, bcdDevice= 2.06
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.571196] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.571211] usb 1-1.2: Product: Thread Co-Processor
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.571226] usb 1-1.2: Manufacturer: Nordic Semiconductor ASA
Dec 23 16:14:48 6f42ccb377d4 kernel: [279825.573885] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
Dec 23 16:14:49 6f42ccb377d4 otbr-agent[248]: 52d.22:46:33.546 [CRIT]-PLAT----: HandleRcpTimeout() at ../../third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:2218: RadioSpinelNoResponse

Offtopic but sharing this information because I did not see that much info about thread networks, my Power Profiler Kit current measurements and pings over Thread:

Poll rate Power consumption average over 1m41s
	100ms 295uA
	200ms 145uA 
	300ms 95uA
		100 packets transmitted, 98 packets received. Packet loss = 2.0%. Round-trip min/avg/max = 52/204.724/582 ms.
	400ms 73uA
		100 packets transmitted, 99 packets received. Packet loss = 1.0%. Round-trip min/avg/max = 20/214.585/542 ms.
	500ms 63uA
		100 packets transmitted, 95 packets received. Packet loss = 5.0%. Round-trip min/avg/max = 63/320.589/818 ms.
	1000ms 33uA
        100 packets transmitted, 96 packets received. Packet loss = 4.0%. Round-trip min/avg/max = 109/624.541/2101 ms.

  • Hi,

    I tried to build RCP firmware using the CoProcessor Example in the nRF Connect SDK v1.7.1. The firmware is running but the container does not connect with the device.

    Using the CoProcessor Example with nRF Connect SDK should be the best way to use the nRF21540DK, as I can not see any builds for the nRF21540DK in the openthread github repository.

    When the nRF Connect SDK CoProcessor sample does not work with the OTBR, I experienced that it is usually either:

    - The CoProcessor is configured as a NCP(by default) instead of a RCP. To build as a RCP, built with "-- -DOVERLAY_CONFIG="overlay-rcp.conf".

    - The baud rates of the OTBR is not the same as of the RCP. The OTBR Baud rate configuration is different based on if you use the direct version or the docker version. For the Docker version, you can set the baud rate by adding "?uart-baudrate=115200" after the port declaration in the docker run script. See our docs on OpenThread Border Router.
    The baud rate of the RCP is defined in the devicetree overlay files in the "boards" folder in your project folder, but I believe it should be 115200 by default.

    - The OTBR and RCP has the wrong Thread version. If your OTBR use Thread version 1.2, add CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y to your prj.conf. Thread 1.1 should be default.

    Does any/a combination of these help with your issue?

    Regards,
    Sigurd Hellesvik

  • In the nRF Connect SDK CoProcessor example I added the overlays: usb, rcp and logging.

    I added CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y to the prj.conf of the example

    And I've specified the baud rate in the Radio URL

    Output when not specifying the baud rate:

    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: New relevant interface lo.IPv4 for mDNS.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Network interface enumeration completed.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Registering new address record for fe80::42:acff:fe11:3 on eth0.*.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Registering new address record for 172.17.0.3 on eth0.IPv4.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Registering new address record for ::1 on lo.*.
    Jan  3 15:16:29 5b76b697da3d avahi-daemon[188]: Registering new address record for 127.0.0.1 on lo.IPv4.
    Jan  3 15:16:29 5b76b697da3d rsyslogd: rsyslogd's groupid changed to 101
    Jan  3 15:16:29 5b76b697da3d rsyslogd: rsyslogd's userid changed to 101
    Jan  3 15:16:29 5b76b697da3d rsyslogd:  [origin software="rsyslogd" swVersion="8.32.0" x-pid="121" x-info="http://www.rsyslog.com"] start
    Jan  3 15:16:30 5b76b697da3d avahi-daemon[188]: Server startup complete. Host name is 5b76b697da3d.local. Local service cookie is 1699871024.
    Jan  3 15:16:30 5b76b697da3d otbr-agent[216]: [INFO]-UTILS---: Running 0.3.0-8ae81c5ac
    Jan  3 15:16:30 5b76b697da3d otbr-agent[216]: [INFO]-UTILS---: Thread version: 1.2.0
    Jan  3 15:16:30 5b76b697da3d otbr-agent[216]: [INFO]-UTILS---: Thread interface: wpan0
    Jan  3 15:16:30 5b76b697da3d otbr-agent[216]: [INFO]-UTILS---: Backbone interface: eth0
    Jan  3 15:16:30 5b76b697da3d otbr-agent[216]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0
    Jan  3 15:16:30 5b76b697da3d otbr-web[244]: [INFO]-WEB-----: Running 0.3.0-8ae81c5ac
    Jan  3 15:16:30 5b76b697da3d otbr-web[244]: [INFO]-WEB-----: Border router web started on wpan0
    Jan  3 15:16:30 5b76b697da3d otbr-web[244]: [ERR ]-WEB-----: OpenThread daemon is not running.
    Jan  3 15:16:31 5b76b697da3d kernel: [ 5489.106173] usb 1-1.3: new full-speed USB device number 10 using dwc_otg
    Jan  3 15:16:31 5b76b697da3d kernel: [ 5489.248849] usb 1-1.3: New USB device found, idVendor=1915, idProduct=0000, bcdDevice= 2.06
    Jan  3 15:16:31 5b76b697da3d kernel: [ 5489.248876] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan  3 15:16:31 5b76b697da3d kernel: [ 5489.248891] usb 1-1.3: Product: Thread Co-Processor
    Jan  3 15:16:31 5b76b697da3d kernel: [ 5489.248920] usb 1-1.3: SerialNumber: 9DB0ECEDBB9858E8
    Jan  3 15:16:32 5b76b697da3d otbr-agent[216]: 49d.18:34:17.145 [CRIT]-PLAT----: HandleRcpTimeout() at ../../third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:2218: RadioSpinelNoResponse

    And the output with baud rate 115200:

    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: New relevant interface lo.IPv4 for mDNS.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Network interface enumeration completed.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Registering new address record for fe80::42:acff:fe11:3 on eth0.*.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Registering new address record for 172.17.0.3 on eth0.IPv4.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Registering new address record for ::1 on lo.*.
    Jan  3 15:18:25 c34eb76f0cb8 avahi-daemon[187]: Registering new address record for 127.0.0.1 on lo.IPv4.
    Jan  3 15:18:25 c34eb76f0cb8 rsyslogd: rsyslogd's groupid changed to 101
    Jan  3 15:18:25 c34eb76f0cb8 rsyslogd: rsyslogd's userid changed to 101
    Jan  3 15:18:25 c34eb76f0cb8 rsyslogd:  [origin software="rsyslogd" swVersion="8.32.0" x-pid="120" x-info="http://www.rsyslog.com"] start
    Jan  3 15:18:26 c34eb76f0cb8 otbr-agent[215]: [INFO]-UTILS---: Running 0.3.0-8ae81c5ac
    Jan  3 15:18:26 c34eb76f0cb8 otbr-agent[215]: [INFO]-UTILS---: Thread version: 1.2.0
    Jan  3 15:18:26 c34eb76f0cb8 otbr-agent[215]: [INFO]-UTILS---: Thread interface: wpan0
    Jan  3 15:18:26 c34eb76f0cb8 otbr-agent[215]: [INFO]-UTILS---: Backbone interface: eth0
    Jan  3 15:18:26 c34eb76f0cb8 otbr-agent[215]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=115200
    Jan  3 15:18:26 c34eb76f0cb8 avahi-daemon[187]: Server startup complete. Host name is c34eb76f0cb8.local. Local service cookie is 812342254.
    Jan  3 15:18:26 c34eb76f0cb8 otbr-web[243]: [INFO]-WEB-----: Running 0.3.0-8ae81c5ac
    Jan  3 15:18:26 c34eb76f0cb8 otbr-web[243]: [INFO]-WEB-----: Border router web started on wpan0
    Jan  3 15:18:26 c34eb76f0cb8 otbr-web[243]: [ERR ]-WEB-----: OpenThread daemon is not running.
    Jan  3 15:18:28 c34eb76f0cb8 otbr-agent[215]: 49d.18:36:13.098 [CRIT]-PLAT----: HandleRcpTimeout() at ../../third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:2218: RadioSpinelNoResponse

  • Hi

    Try to set the baud rate in boards/nrf21540dk_nrf52840.overlay to the same as well.

    When you pull the docker image, have you pulled a compatible version?


    ref https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/ug_thread_tools.html

    Regards,
    Sigurd Hellesvik

  • Indeed I did not know otbr had a different image for nordic devices.
    I was just following the tutorial specific to version 1.7.1 and got this output:

    Mar 18 12:22:14 raspberrypi otbr-agent[7790]: [NOTE]-PLAT----: RCP API Version: 4
    Mar 18 12:22:14 raspberrypi otbr-agent[7790]: [CRIT]-PLAT----: RCP is missing required capabilities: tx-security tx-timing
    Mar 18 12:22:14 raspberrypi otbr-agent[7790]: [CRIT]-PLAT----: CheckRadioCapabilities() at ../../third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:380: RadioSpinelIncompatible

    Then I downloaded the 1.8.0 sdk and flashed my nrf21540DK but something went wrong. The DK isnt connecting over USB anymore, cannot flash and does not blink. I did get something when I powered on the device with the boot/reset button held. it now presents me a disk with the name Bootloader.

  • Hi

    The "RadioSpinelIncompatible" means that the OTBR is not able to communicate with the RCP.

    fhfs said:
    Then I downloaded the 1.8.0 sdk and flashed my nrf21540DK but something went wrong. The DK isnt connecting over USB anymore, cannot flash and does not blink. I did get something when I powered on the device with the boot/reset button held. it now presents me a disk with the name Bootloader.

    Try to use the command line and use the commands:

    nrfjprog --help
    nrfjprog --recover

    Then try to program the DK again.

    Regards,
    Sigurd Hellesvik

Related