Build OpenThread on Ubuntu (physical machine) failed, but successed with the same hardware on the Raspberry PI

Hi,

This problem has been bothering me for a long time, can you help me?

I built the Thread network with the following command steps and burned the matter light_bulb through 5340 to add the light_bulb as another node to the constructed Thread network.

Strangely enough, the Raspberry PI worked correctly and retrieved the activity set. But it did not run on my Ubuntu20.04 physical machine.

(1)

sudo docker network create --ipv6 --subnet fd11:db8:1::/64 -o com.docker.network.bridge.name=otbr0 otbr

(2)

sudo docker pull nrfconnect/otbr:a892bf7

(3)

sudo ip -6 route add fd11:22::/64 dev otbr0 via fd11:db8:1::2

(4)

sudo modprobe ip6table_filter

(5)

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:a892bf7 --radio-url spinel+hdlc+uart:///dev/radio?uart-baudrate=1000000

Raspberry Pi:

1.

2.

3.ifconfig

Ubuntu

1.

2.

From the running result of the command, it seems that otbr-agent does not start correctly in Ubuntu.

Then I found that the network adapter names of Ubuntu and Raspberry PI seem to be different.

Will this affect the construction of Thread network? Or is it something else?

I really want to solve this problem  :(



Best regards,

Chuck

Parents Reply Children
  • Hi Jørgen,

    I sure that i burned the flash on ncs path v2.3.0/nrf/samples/openthread/coprocessor,and then built it add 'Extra CMake arguments:-DOVERLAY_CONFIG="overlay-usb.conf" -DDTC_OVERLAY_FILE="usb. overlay" '.
    And when i connected 52840dongle to Ubuntu PC,the command of line "lsusb" it can saw the result:Nodic Semiconductor ASA USB2.1 Hub.

    Also the path is /dev/ttyACM0,because disconnected to my Ubuntu PC,it will disappear.


    Best regards,

    chuck

  • One important thing I want to say is that the same RCP (52840dongle), the same operation (build Thread network), failed to build on Ubuntu20.04Pc, but will succeed on Raspberry PI 4B, I don't know why.

  • Added: I have previously built the Thread network step by step on my own, and I have tried to build the Thread network with an automated.sh script file, which also failed on Ubuntu Pc, despite the same.sh file and the same RCP,.sh file link and error message as follows:

    Link:

    https://github.com/project-chip/certification-tool/tree/main/scripts/OTBR

    Ubuntu Pc:

    chuck@chuck-rui:~/matter/certification-tool$ otbr-agent -vvv
    otbr-agent[59953]: [NOTE]-AGENT---: Running 0.3.0-thread-reference-20230710-84-g87f01e4257
    otbr-agent[59953]: [NOTE]-AGENT---: Thread version: 1.3.0
    otbr-agent[59953]: [NOTE]-AGENT---: Thread interface: wpan0
    otbr-agent[59953]: [NOTE]-AGENT---: Backbone interface is not specified
    otbr-agent[59953]: [NOTE]-ILS-----: Infra link selected: 
    otbr-agent[59953]: [INFO]-NCP-----: OpenThread log level changed to 4
    otbr-agent[59953]: 49d.17:21:06.299 [C] Platform------: get802154RadioUrl() at system.cpp:100: InvalidArgument
    
    
    
    chuck@chuck-rui:~/matter/certification-tool$ docker logs otbr-chip 
    RADIO_URL: spinel+hdlc+uart:///dev/radio?uart-baudrate=115200
    TREL_URL: 
    TUN_INTERFACE_NAME: wpan0
    BACKBONE_INTERFACE: eth0
    NAT64_PREFIX: 64:ff9b::/96
    +++ dirname /app/script/server
    ++ cd /app/script/..
    ++ [[ ! -n x ]]
    Current platform is ubuntu
    ++ echo 'Current platform is ubuntu'
    ++ with BORDER_ROUTING
    ++ local value
    +++ printenv BORDER_ROUTING
    ++ value=1
    ++ [[ -z 1 ]]
    ++ [[ 1 == 1 ]]
    ++ with DHCPV6_PD
    ++ local value
    +++ printenv DHCPV6_PD
    ++ value=
    ++ [[ -z '' ]]
    ++ [[ -f examples/platforms/ubuntu/default ]]
    ++ [[ '' == 1 ]]
    ++ with BORDER_ROUTING
    ++ local value
    +++ printenv BORDER_ROUTING
    ++ value=1
    ++ [[ -z 1 ]]
    ++ [[ 1 == 1 ]]
    ++ with NETWORK_MANAGER
    ++ local value
    +++ printenv NETWORK_MANAGER
    ++ value=
    ++ [[ -z '' ]]
    ++ [[ -f examples/platforms/ubuntu/default ]]
    ++ [[ '' == 1 ]]
    ++ STAGE_DIR=/app/stage
    ++ BUILD_DIR=/app/build
    ++ [[ -d /app/stage ]]
    ++ mkdir -v -p /app/stage
    mkdir: created directory '/app/stage'
    ++ [[ -d /app/build ]]
    ++ mkdir -v -p /app/build
    mkdir: created directory '/app/build'
    ++ export PATH=/app/stage/usr/bin:/app/stage/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    ++ PATH=/app/stage/usr/bin:/app/stage/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    +++ basename /app/script/server
    ++ TASKNAME=server
    ++ BEFORE_HOOK=examples/platforms/ubuntu/before_server
    ++ AFTER_HOOK=examples/platforms/ubuntu/after_server
    ++ [[ ! -f examples/platforms/ubuntu/before_server ]]
    ++ BEFORE_HOOK=/dev/null
    ++ [[ ! -f examples/platforms/ubuntu/after_server ]]
    ++ AFTER_HOOK=/dev/null
    + . script/_nat64
    ++ NAT64_SERVICE=openthread
    ++ TAYGA_DEFAULT=/etc/default/tayga
    ++ TAYGA_CONF=/etc/tayga.conf
    ++ TAYGA_IPV4_ADDR=192.168.255.1
    ++ TAYGA_IPV6_ADDR=fdaa:bb:1::1
    ++ TAYGA_TUN_V6_ADDR=fdaa:bb:1::2
    ++ NAT64_PREFIX=64:ff9b::/96
    ++ DYNAMIC_POOL=192.168.255.0/24
    ++ NAT44_SERVICE=/etc/init.d/otbr-nat44
    ++ WLAN_IFNAMES=eth0
    + . script/_dns64
    ++ BIND_CONF_OPTIONS=/etc/bind/named.conf.options
    ++ NAT64_PREFIX=64:ff9b::/96
    ++ DNS64_NAMESERVER_ADDR=127.0.0.1
    +++ echo 64:ff9b::/96
    +++ tr '"/"' '"/"'
    ++ DNS64_CONF='dns64 64:ff9b::/96 { clients { thread; }; recursive-only yes; };'
    ++ without NAT64
    ++ with NAT64
    ++ local value
    +++ printenv NAT64
    ++ value=1
    ++ [[ -z 1 ]]
    ++ [[ 1 == 1 ]]
    ++ without DNS64
    ++ with DNS64
    ++ local value
    +++ printenv DNS64
    ++ value=0
    ++ [[ -z 0 ]]
    ++ [[ 0 == 1 ]]
    ++ '[' ubuntu = raspbian ']'
    ++ '[' ubuntu = beagleboneblack ']'
    ++ '[' ubuntu = ubuntu ']'
    ++ RESOLV_CONF_HEAD=/etc/resolvconf/resolv.conf.d/head
    + . script/_firewall
    ++ FIREWALL_SERVICE=/etc/init.d/otbr-firewall
    ++ sudo modprobe ip6table_filter
    sudo: modprobe: command not found
    ++ true
    + main
    + [[ '' == \s\h\u\t\d\o\w\n ]]
    + startup
    + . /dev/null
    + sudo sysctl --system
    * Applying /etc/sysctl.d/10-console-messages.conf ...
    kernel.printk = 4 4 1 7
    * Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
    net.ipv6.conf.all.use_tempaddr = 2
    net.ipv6.conf.default.use_tempaddr = 2
    * Applying /etc/sysctl.d/10-kernel-hardening.conf ...
    kernel.kptr_restrict = 1
    * Applying /etc/sysctl.d/10-link-restrictions.conf ...
    fs.protected_hardlinks = 1
    fs.protected_symlinks = 1
    * Applying /etc/sysctl.d/10-magic-sysrq.conf ...
    kernel.sysrq = 176
    * Applying /etc/sysctl.d/10-network-security.conf ...
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.all.rp_filter = 1
    net.ipv4.tcp_syncookies = 1
    * Applying /etc/sysctl.d/10-ptrace.conf ...
    kernel.yama.ptrace_scope = 1
    * Applying /etc/sysctl.d/10-zeropage.conf ...
    vm.mmap_min_addr = 65536
    * Applying /etc/sysctl.d/60-otbr-accept-ra.conf ...
    * Applying /etc/sysctl.d/60-otbr-ip-forward.conf ...
    net.ipv6.conf.all.forwarding = 1
    net.ipv4.ip_forward = 1
    * Applying /etc/sysctl.conf ...
    + nat64_start
    + with NAT64
    + local value
    ++ printenv NAT64
    + value=1
    + [[ -z 1 ]]
    + [[ 1 == 1 ]]
    + '[' openthread = tayga ']'
    + nat44_start
    + with DOCKER
    + local value
    ++ printenv DOCKER
    + value=1
    + [[ -z 1 ]]
    + [[ 1 == 1 ]]
    + service otbr-nat44 start
    + dns64_start
    + with NAT64
    + local value
    ++ printenv NAT64
    + value=1
    + [[ -z 1 ]]
    + [[ 1 == 1 ]]
    + with DNS64
    + local value
    ++ printenv DNS64
    + value=0
    + [[ -z 0 ]]
    + [[ 0 == 1 ]]
    + return 0
    + firewall_start
    + with DOCKER
    + local value
    ++ printenv DOCKER
    + value=1
    + [[ -z 1 ]]
    + [[ 1 == 1 ]]
    + service otbr-firewall start
    + case "$1" in
    + firewall_start
    + firewall_stop
    + ip6tables -C FORWARD -o wpan0 -j OTBR_FORWARD_INGRESS
    + ip6tables -D FORWARD -o wpan0 -j OTBR_FORWARD_INGRESS
    + ip6tables -C FORWARD -o wpan0 -j OTBR_FORWARD_INGRESS
    ip6tables: No chain/target/match by that name.
    + ip6tables -L OTBR_FORWARD_INGRESS
    Chain OTBR_FORWARD_INGRESS (0 references)
    target     prot opt source               destination         
    DROP       all      anywhere             anywhere             PKTTYPE = unicast
    DROP       all      anywhere             anywhere             match-set otbr-ingress-deny-src src
    ACCEPT     all      anywhere             anywhere             match-set otbr-ingress-allow-dst dst
    DROP       all      anywhere             anywhere             PKTTYPE = unicast
    ACCEPT     all      anywhere             anywhere            
    + ip6tables -w -F OTBR_FORWARD_INGRESS
    + ip6tables -w -X OTBR_FORWARD_INGRESS
    + ipset_destroy_if_exist otbr-ingress-deny-src
    + ipset list otbr-ingress-deny-src
    Name: otbr-ingress-deny-src
    Type: hash:net
    Revision: 6
    Header: family inet6 hashsize 1024 maxelem 65536
    Size in memory: 1240
    References: 0
    Number of entries: 0
    Members:
    + ipset destroy otbr-ingress-deny-src
    + ipset_destroy_if_exist otbr-ingress-deny-src-swap
    + ipset list otbr-ingress-deny-src-swap
    Name: otbr-ingress-deny-src-swap
    Type: hash:net
    Revision: 6
    Header: family inet6 hashsize 1024 maxelem 65536
    Size in memory: 1240
    References: 0
    Number of entries: 0
    Members:
    + ipset destroy otbr-ingress-deny-src-swap
    + ipset_destroy_if_exist otbr-ingress-allow-dst
    + ipset list otbr-ingress-allow-dst
    Name: otbr-ingress-allow-dst
    Type: hash:net
    Revision: 6
    Header: family inet6 hashsize 1024 maxelem 65536
    Size in memory: 1240
    References: 0
    Number of entries: 0
    Members:
    + ipset destroy otbr-ingress-allow-dst
    + ipset_destroy_if_exist otbr-ingress-allow-dst-swap
    + ipset list otbr-ingress-allow-dst-swap
    Name: otbr-ingress-allow-dst-swap
    Type: hash:net
    Revision: 6
    Header: family inet6 hashsize 1024 maxelem 65536
    Size in memory: 1240
    References: 0
    Number of entries: 0
    Members:
    + ipset destroy otbr-ingress-allow-dst-swap
    + ipset create -exist otbr-ingress-deny-src hash:net family inet6
    + ipset create -exist otbr-ingress-deny-src-swap hash:net family inet6
    + ipset create -exist otbr-ingress-allow-dst hash:net family inet6
    + ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6
    + ip6tables -N OTBR_FORWARD_INGRESS
    + ip6tables -I FORWARD 1 -o wpan0 -j OTBR_FORWARD_INGRESS
    + ip6tables -A OTBR_FORWARD_INGRESS -m pkttype --pkt-type unicast -i wpan0 -j DROP
    + ip6tables -A OTBR_FORWARD_INGRESS -m set --match-set otbr-ingress-deny-src src -j DROP
    + ip6tables -A OTBR_FORWARD_INGRESS -m set --match-set otbr-ingress-allow-dst dst -j ACCEPT
    + ip6tables -A OTBR_FORWARD_INGRESS -m pkttype --pkt-type unicast -j DROP
    + ip6tables -A OTBR_FORWARD_INGRESS -j ACCEPT
    + 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
       ...done.
    + sudo service dbus status
     * dbus is not running
    + sudo service dbus start
     * Starting system message bus dbus
       ...done.
    + 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
    Avahi mDNS/DNS-SD Daemon is not running
    + sudo service avahi-daemon start
     * Starting Avahi mDNS/DNS-SD Daemon avahi-daemon
    Failed to open file '/etc/avahi/avahi-daemon.conf': No such file or directory
       ...fail!
    + sudo service otbr-agent status
     * otbr-agent is not running
    + sudo service otbr-agent start
     * Starting thread border agent otbr-agent
       ...done.
    + without WEB_GUI
    + with WEB_GUI
    + local value
    ++ printenv WEB_GUI
    + value=0
    + [[ -z 0 ]]
    + [[ 0 == 1 ]]
    + . /dev/null
    Nov  6 07:14:47 chuck-rui mDNSResponder: Default: mDNSResponder (Engineering Build) (May 22 2023 09:44:34) starting
    Nov  6 07:14:47 chuck-rui mDNSResponder: Default: mDNS_AddDNSServer: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
    Nov  6 07:14:47 chuck-rui otbr-agent: [NOTE]-AGENT---: Backbone interface: eth0
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [NOTE]-AGENT---: Running 0.3.0-9185bdaaf4-dirty
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [NOTE]-AGENT---: Thread version: 1.3.0
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [NOTE]-AGENT---: Thread interface: wpan0
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/radio?uart-baudrate=115200
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [NOTE]-ILS-----: Infra link selected: eth0
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: [INFO]-NCP-----: OpenThread log level changed to 5
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: 49d.17:08:04.978 [I] Platform------: RCP reset: RESET_POWER_ON
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: 49d.17:08:04.978 [I] Platform------: Software reset RCP successfully
    Nov  6 07:14:47 chuck-rui otbr-agent[153]: 49d.17:08:04.986 [C] Platform------: platformBackboneInit() at backbone.cpp:62: Failure
    Nov  6 07:14:48 chuck-rui rsyslogd: rsyslogd's groupid changed to 101
    Nov  6 07:14:48 chuck-rui rsyslogd: rsyslogd's userid changed to 101
    Nov  6 07:14:48 chuck-rui rsyslogd:  [origin software="rsyslogd" swVersion="8.32.0" x-pid="93" x-info="http://www.rsyslog.com"] start
    

    But Success on Raspberry Pi 4B:

    By the way, I would like to ask if you have provided a mirror image, and then all aspects of the environment have been completed, I think it will save a lot of time.

    Best Regards

    Chuck

  • Hi Jørgen,

    I'd like to confirm a point: when I build a Thread network, I will be 52840 as RCP, I burn firmware is replication/v2.3.0 / samples/openthread coprocessor firmware, I burn the firmware, do you have any questions?

  • The problem has been solved, re-pull the matter source code, re-compile the environment, nrf52840dongle re-burn RCP firmware, and successfully build the Thread network.

Related