openthread / ot-br-posix

OpenThread Border Router, a Thread border router for POSIX-based platforms.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
403 stars 227 forks source link

otbr-agent status and otbr-agent status error #1390

Closed seagullanddog closed 2 years ago

seagullanddog commented 2 years ago

hi,every one I refer to the link "https://openthread.google.cn/guides/border-router/build" guide to compile ot-br-posix on ubuntu22.04 and no errors are prompted. When I execute the commands "sudo service otbr-agent status" and "sudo service otbr-web status", the following errors appear respectively:

#systemctl start otbr-agent ● otbr-agent.service - OpenThread Border Router Agent Loaded: loaded (/lib/systemd/system/otbr-agent.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Wed 2022-05-25 18:32:58 CST; 3s ago Process: 31049 ExecStartPre=service mdns start (code=exited, status=0/SUCCESS) Process: 31055 ExecStart=/usr/sbin/otbr-agent $OTBR_AGENT_OPTS (code=exited, status=1/FAILURE) Main PID: 31055 (code=exited, status=1/FAILURE) CPU: 12ms # sudo service otbr-agent status ● otbr-web.service - Border Router Web Loaded: loaded (/lib/systemd/system/otbr-web.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-05-25 18:02:46 CST; 55min ago Main PID: 27953 (otbr-web) Tasks: 1 (limit: 4588) Memory: 1.3M CPU: 5ms CGroup: /system.slice/otbr-web.service └─27953 /usr/sbin/otbr-web

May 25 18:02:46 haiou-virtual-machine systemd[1]: Started Border Router Web. May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: otbr-web[27953]: [INFO]-WEB-----: Running 0.3.0 May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: otbr-web[27953]: [INFO]-WEB-----: Border router web started on wpan0 May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: otbr-web[27953]: [ERR ]-WEB-----: OpenThread daemon is not running. May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: [INFO]-WEB-----: Running 0.3.0 May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: [INFO]-WEB-----: Border router web started on wpan0 May 25 18:02:46 haiou-virtual-machine otbr-web[27953]: [ERR ]-WEB-----: OpenThread daemon is not running.

note: I'm sure my rcp is fine because I refer to the "https://openthread.google.cn/guides/border-router/docker" guide to run with ducker.Because I have successfully form the thread network.

my hardware: EFR32MG21.

My otbr-agent file is configured as follows: OTBR_AGENT_OPTS="-I wpan0 -B eth0 spinel+hdlc+uart:///dev/ttyUSB0 trel://eth0" OTBR_NO_AUTO_ATTACH=0

I don't know how to solve it, I need your help,

thanks a lot

jwhui commented 2 years ago

@seagullanddog , it seems like otbr-agent is not starting properly. Can you provide more of the log to help identify the root cause?

seagullanddog commented 2 years ago

hi @jwhui , when I execute the"./script/bootstrap"commad ,the log shows following: +++ dirname ./script/bootstrap ++ cd ./script/.. ++ [[ ! -n '' ]] ++ grep -s 'BeagleBone Black' /sys/firmware/devicetree/base/model ++ case "${OSTYPE}" in ++ have_or_die lsb_release ++ have lsb_release ++ command -v lsb_release +++ lsb_release -i +++ cut -c17- +++ tr '[:upper:]' '[:lower:]' ++ PLATFORM=ubuntu ++ echo 'Current platform is ubuntu' Current platform is ubuntu ++ with BORDER_ROUTING ++ local value +++ printenv BORDER_ROUTING ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${BORDER_ROUTING-}' ++++ echo 1 ++ value=1 ++ [[ 1 == 1 ]] ++ with DHCPV6_PD ++ local value +++ printenv DHCPV6_PD ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${DHCPV6_PD-}' ++++ echo 0 ++ value=0 ++ [[ 0 == 1 ]] ++ with BORDER_ROUTING ++ local value +++ printenv BORDER_ROUTING ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${BORDER_ROUTING-}' ++++ echo 1 ++ value=1 ++ [[ 1 == 1 ]] ++ with NETWORK_MANAGER ++ local value +++ printenv NETWORK_MANAGER ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${NETWORK_MANAGER-}' ++++ echo 0 ++ value=0 ++ [[ 0 == 1 ]] ++ STAGE_DIR=/home/haiou/ot-br-posix/stage ++ BUILD_DIR=/home/haiou/ot-br-posix/build ++ [[ -d /home/haiou/ot-br-posix/stage ]] ++ [[ -d /home/haiou/ot-br-posix/build ]] ++ export PATH=/home/haiou/ot-br-posix/stage/usr/bin:/home/haiou/ot-br-posix/stage/usr/sbin:/home/haiou/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin ++ PATH=/home/haiou/ot-br-posix/stage/usr/bin:/home/haiou/ot-br-posix/stage/usr/sbin:/home/haiou/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +++ basename ./script/bootstrap ++ TASKNAME=bootstrap ++ BEFORE_HOOK=examples/platforms/ubuntu/before_bootstrap ++ AFTER_HOOK=examples/platforms/ubuntu/after_bootstrap ++ [[ ! -f examples/platforms/ubuntu/before_bootstrap ]] ++ BEFORE_HOOK=/dev/null ++ [[ ! -f examples/platforms/ubuntu/after_bootstrap ]] ++ AFTER_HOOK=/dev/null

2022-05-26 13:27:59 (1.03 MB/s) - 已保存 ‘mDNSResponder-1310.80.1.tar.gz.2’ [2628286/2628286])

when i execute the "INFRA_IF_NAME=eth0 ./script/setup"command , the log shows following: +++ dirname ./script/setup ++ cd ./script/.. ++ [[ ! -n '' ]] ++ grep -s 'BeagleBone Black' /sys/firmware/devicetree/base/model ++ case "${OSTYPE}" in ++ have_or_die lsb_release ++ have lsb_release ++ command -v lsb_release +++ lsb_release -i +++ cut -c17- +++ tr '[:upper:]' '[:lower:]' ++ PLATFORM=ubuntu ++ echo 'Current platform is ubuntu' Current platform is ubuntu ++ with BORDER_ROUTING ++ local value +++ printenv BORDER_ROUTING ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${BORDER_ROUTING-}' ++++ echo 1 ++ value=1 ++ [[ 1 == 1 ]] ++ with DHCPV6_PD ++ local value +++ printenv DHCPV6_PD ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${DHCPV6_PD-}' ++++ echo 0 ++ value=0 ++ [[ 0 == 1 ]] ++ with BORDER_ROUTING ++ local value +++ printenv BORDER_ROUTING ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${BORDER_ROUTING-}' ++++ echo 1 ++ value=1 ++ [[ 1 == 1 ]] ++ with NETWORK_MANAGER ++ local value +++ printenv NETWORK_MANAGER ++ value= ++ [[ -z '' ]] ++ [[ -f examples/platforms/ubuntu/default ]] +++ . examples/platforms/ubuntu/default ++++ NAT64=1 ++++ DNS64=0 ++++ DHCPV6_PD=0 ++++ NETWORK_MANAGER=0 ++++ BACKBONE_ROUTER=1 ++++ BORDER_ROUTING=1 ++++ WEB_GUI=1 ++++ REST_API=1 +++ eval echo '${NETWORK_MANAGER-}' ++++ echo 0 ++ value=0 ++ [[ 0 == 1 ]] ++ STAGE_DIR=/home/haiou/ot-br-posix/stage ++ BUILD_DIR=/home/haiou/ot-br-posix/build ++ [[ -d /home/haiou/ot-br-posix/stage ]] ++ [[ -d /home/haiou/ot-br-posix/build ]] ++ export PATH=/home/haiou/ot-br-posix/stage/usr/bin:/home/haiou/ot-br-posix/stage/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin ++ PATH=/home/haiou/ot-br-posix/stage/usr/bin:/home/haiou/ot-br-posix/stage/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin +++ basename ./script/setup ++ TASKNAME=setup ++ BEFORE_HOOK=examples/platforms/ubuntu/before_setup ++ AFTER_HOOK=examples/platforms/ubuntu/after_setup ++ [[ ! -f examples/platforms/ubuntu/before_setup ]] ++ BEFORE_HOOK=/dev/null ++ [[ ! -f examples/platforms/ubuntu/after_setup ]] ++ AFTER_HOOK=/dev/null

. /lib/lsb/init-functions . /lib/init/vars.sh

case "$1" in start)

CMake Deprecation Warning at third_party/cJSON/repo/CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Warning (dev) at third_party/cJSON/repo/CMakeLists.txt:4 (project): Policy CMP0048 is not set: project() command manages VERSION variables. Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH

This warning is for project developers. Use -Wno-dev to suppress it.

-- Checking for module 'libsystemd' -- No package 'libsystemd' found -- Configuring done -- Generating done -- Build files have been written to: /home/haiou/ot-br-posix/build/otbr

up to date, audited 8 packages in 2s

2 moderate severity vulnerabilities

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details.

up to date, audited 8 packages in 2s

2 moderate severity vulnerabilities

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. [6/6] Linking CXX executable src/agent/otbr-agent

up to date, audited 8 packages in 2s

2 moderate severity vulnerabilities

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. [3/4] Install the project... -- Install configuration: "" -- Installing: /usr/sbin/otbr-agent -- Up-to-date: /usr/sbin/ot-ctl -- Up-to-date: /etc/dbus-1/system.d/otbr-agent.conf -- Up-to-date: /lib/systemd/system/otbr-agent.service -- Up-to-date: /etc/default/otbr-agent -- Up-to-date: /usr/sbin/otbr-web -- Up-to-date: /lib/systemd/system/otbr-web.service -- Up-to-date: /usr/share/otbr-web/frontend/index.html -- Up-to-date: /usr/share/otbr-web/frontend/join.dialog.html -- Up-to-date: /usr/share/otbr-web/frontend/res -- Up-to-date: /usr/share/otbr-web/frontend/res/css -- Up-to-date: /usr/share/otbr-web/frontend/res/css/styles.css -- Up-to-date: /usr/share/otbr-web/frontend/res/img -- Up-to-date: /usr/share/otbr-web/frontend/res/img/icon-info.png -- Up-to-date: /usr/share/otbr-web/frontend/res/img/openthread_logo.png -- Up-to-date: /usr/share/otbr-web/frontend/res/img/ios-desktop.png -- Up-to-date: /usr/share/otbr-web/frontend/res/img/borderrouter.png -- Up-to-date: /usr/share/otbr-web/frontend/res/img/android-desktop.png -- Up-to-date: /usr/share/otbr-web/frontend/res/img/favicon.png -- Up-to-date: /usr/share/otbr-web/frontend/res/js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/app.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/angular-animate.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/angular-aria.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/angular-material.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/angular-messages.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/angular.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/d3.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/js/material.min.js -- Up-to-date: /usr/share/otbr-web/frontend/res/css/angular-material.min.css -- Up-to-date: /usr/share/otbr-web/frontend/res/css/material.min.css

jwhui commented 2 years ago

Can you provide the log output from otbr-agent so we can see why the process might be exiting. In particular, can you provide the output of cat /var/log/syslog | grep otbr-agent

seagullanddog commented 2 years ago

I am sorry , the "otbr-agent" log shows following: May 26 13:29:03 haiou-virtual-machine systemd[1]: otbr-agent.service: Scheduled restart job, restart counter is at 1196. May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Running 0.3.0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Thread version: 1.2.0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Thread interface: wpan0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Backbone interface: eth0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/ttyUSB0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [NOTE]-AGENT---: Radio URL: trel://eth0 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: [INFO]-NCP-----: OpenThread log level changed to 4 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: 49d.18:57:40.595 [I] Platform------: RCP reset: RESET_SOFTWARE May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: 49d.18:57:40.624 [N] Platform------: RCP API Version: 4 May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: 49d.18:57:40.635 [C] Platform------: platformBackboneInit() at backbone.cpp:62: Failure May 26 13:29:04 haiou-virtual-machine systemd[1]: otbr-agent.service: Main process exited, code=exited, status=1/FAILURE May 26 13:29:04 haiou-virtual-machine systemd[1]: otbr-agent.service: Failed with result 'exit-code'. May 26 13:29:09 haiou-virtual-machine systemd[1]: otbr-agent.service: Scheduled restart job, restart counter is at 1197. May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Running 0.3.0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Thread version: 1.2.0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Thread interface: wpan0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Backbone interface: eth0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/ttyUSB0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [NOTE]-AGENT---: Radio URL: trel://eth0 May 26 13:29:09 haiou-virtual-machine otbr-agent[21303]: [INFO]-NCP-----: OpenThread log level changed to 4 May 26 13:29:10 haiou-virtual-machine otbr-agent[21303]: 49d.18:57:46.359 [I] Platform------: RCP reset: RESET_SOFTWARE May 26 13:29:10 haiou-virtual-machine otbr-agent[21303]: 49d.18:57:46.389 [N] Platform------: RCP API Version: 4 May 26 13:29:10 haiou-virtual-machine otbr-agent[21303]: 49d.18:57:46.401 [C] Platform------: platformBackboneInit() at backbone.cpp:62: Failure May 26 13:29:10 haiou-virtual-machine systemd[1]: otbr-agent.service: Main process exited, code=exited, status=1/FAILURE May 26 13:29:10 haiou-virtual-machine systemd[1]: otbr-agent.service: Failed with result 'exit-code'.

jwhui commented 2 years ago

The log shows that the backbone interface is not configured properly:

May 26 13:29:04 haiou-virtual-machine otbr-agent[21294]: 49d.18:57:40.635 [C] Platform------: platformBackboneInit() at backbone.cpp:62: Failure

This refers to the following code: https://github.com/openthread/openthread/blob/40484c94687163e60e44e3f23855b49e7dd911df/src/posix/platform/backbone.cpp#L61-L62

Is eth0 a valid network interface on your platform?

seagullanddog commented 2 years ago

thanks jwhui , I have found the problem, my platform is "enp2s1" instead of "eth0"