Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install otbr-agent & other services #2296

Open
hassan-xy opened this issue May 22, 2024 · 25 comments
Open

Unable to install otbr-agent & other services #2296

hassan-xy opened this issue May 22, 2024 · 25 comments

Comments

@hassan-xy
Copy link

Hi team,
I need otbr-agent & ot-ctl to run some example programs. I followed "https://openthread.io/guides/border-router/build" but for some reason that I am unaware of otbr-agent.service & otbr-web.service are not installed.
I am using a custom hardware running arm64, ubuntu 20.04.

The wifi module is from Ampak AP6236.

It might be a HW issue but not sure, please update me guys.

Thanks

@superwhd
Copy link
Contributor

Could you share the command line output when you failed to install OTBR?

@hassan-xy
Copy link
Author

Alright I start from the start:
git clone https://github.com/openthread/ot-br-posix (connected ethernet cable, eth0)
cd ot-br-posix
./script/bootstrap

(i check the logs, I cant see any errors)
INFRA_IF_NAME=eth0 ./script/setup
image
image
image
image
image

Well I can see now that modprobe: FATAL: Module ip6table_filter not found in directory /lib/modules/4.9.56 could be the main reason for my problem, please share your comments if this is the main reason.

Thanks

@jwhui
Copy link
Member

jwhui commented May 23, 2024

The error "FATAL: Module ip6table_filter not found in directory" indicates that the kernel module responsible for IPv6 firewalling is missing. Here's how you can fix it:

  1. Check Kernel Support:
  • IPv6 firewalling might not be compiled into your kernel. You can verify this by running:

    uname -r

    Then search online for your specific kernel version and see if it includes IPv6 firewall support.

  1. Load the Module (if supported):
  • If your kernel supports IPv6 firewalling, you can try loading the module manually using:

    sudo modprobe ip6_tables
  • Verify if the module loaded successfully with:

    lsmod | grep ip6

    This should show ip6_tables loaded.

  1. Reinstall iptables package:
  • A corrupted or missing iptables package could be the culprit. Reinstall it using your distribution's package manager:

    • Debian/Ubuntu:

      sudo apt install --reinstall iptables
    • RedHat/CentOS/Fedora:

      sudo yum reinstall iptables
  • This will ensure all necessary iptables components are installed correctly.

  1. Upgrade Kernel (last resort):
  • If none of the above work, consider upgrading your kernel to a version with built-in IPv6 firewall support. Upgrading the kernel is a more complex procedure, so make sure to research and back up your system before proceeding.

Additional Tips:

  • Always run these commands with sudo for administrative privileges.
  • If you're unsure about these steps, consult your distribution's documentation for specific instructions on managing iptables and kernel modules.

@superwhd
Copy link
Contributor

In the second screenshot:

cd : /root/ot-br-posix/build/otbr No such file or directory

This is also concerning. Could you check if the file exists?

If the file exists, then it implies it may not be configured with proper permission.
If the file doesn't exist, it implies you failed to build the otbr-agent.

@hassan-xy
Copy link
Author

Thanks for all the replies,
For ip6_tables i will have to install the kernel module (4.9).
/root/ot-br-posix/build/otbr No such file or directory ; I checked the build dir exists but its empty.
The directory has all the permissions.

If the build failed, then would it be safe to assume that ip6_tables is the main reason? or could there be any other reason?

Thanks

@jwhui
Copy link
Member

jwhui commented May 24, 2024

It would be helpful if you could provide the full build log in a text file. But I would start with fixing ip6_tables.

@hassan-xy
Copy link
Author

hassan-xy commented May 24, 2024

I agree, I tried to log the build to a text file but it only logged 4 lines.
I used the " filename >> log.txt" command
any suggestions?

@jwhui
Copy link
Member

jwhui commented May 24, 2024

Try to also capture both stdout and stderr:

command 2>&1 | tee -a output.log

@hassan-xy
Copy link
Author

hassan-xy commented May 24, 2024

bootstrap command log: bootstrap.log
script command log: eth0_script.log

PS: Has anyone tried setting up on the yocto sdk. I am able to add the recipe and build the image, but skeptical if the above procedures will run.

@hassan-xy
Copy link
Author

hassan-xy commented Jun 5, 2024

Well, I am trying to add the module ip6table_filter module but cant find the exact path in my menuconfig. Would any 1 of you guys be kind enough to let me know the correct file path.
Thanks!

Edit: I checked in my .config file ip6table_filter module does not exist.

@hassan-xy
Copy link
Author

hassan-xy commented Jun 19, 2024

UPDATE:
Hi guys,
I have added the ip6_tables in the my /lib/modules.. folder. and have inserted using insmod command.
image
I run ./script/bootstrap and notice the build directory is empty. I cant see any errors though.
bootstrap.log

I run INFRA_IF_NAME=wlan0 ./script/setup and uploaded the error log file for reference.
setup_wlan0.log

I also noticed a few more things, like failed services
image
I am not sure why dnsmasq fails here. I run on wlan1 interface and enable the bind-dynamic option.

systemctl status otbr-firewall.service
image

I am not sure why the services have failed.
Do you think its due my kernel specifications?
image

Please suggest me what I need to do in order to overcome this problem.

Thanks

@superwhd
Copy link
Contributor

As a quick workaround, you may try commenting out the firewall_uninstall and firewall_install in https://github.com/openthread/ot-br-posix/blob/main/script/setup and rerun the setup.

@hassan-xy
Copy link
Author

@superwhd Thanks for the quick reply, I tried and saw otbr and src in the build direcrtory. The issue right now seems to be the C++ internal compiler error.
image
Any ideas on why the error occurs?
setup_wlan0_v2.log

Any missing dependency or packages that I might need to install?

@superwhd
Copy link
Contributor

FAILED: src/dbus/client/CMakeFiles/otbr-dbus-client.dir/thread_api_dbus.cpp.o 
/usr/bin/c++  -DOTBR_ENABLE_BACKBONE_ROUTER=1 -DOTBR_ENABLE_BORDER_AGENT=1 -DOTBR_ENABLE_BORDER_ROUTING=1 -DOTBR_ENABLE_BORDER_ROUTING_COUNTERS=1 -DOTBR_ENABLE_DBUS_SERVER=1 -DOTBR_ENABLE_DHCP6_PD=0 -DOTBR_ENABLE_DNSSD_DISCOVERY_PROXY=1 -DOTBR_ENABLE_DNS_UPSTREAM_QUERY=1 -DOTBR_ENABLE_EPSKC=1 -DOTBR_ENABLE_LINK_METRICS_TELEMETRY=0 -DOTBR_ENABLE_NAT64=1 -DOTBR_ENABLE_NOTIFY_UPSTART=1 -DOTBR_ENABLE_PUBLISH_MESHCOP_BA_ID=1 -DOTBR_ENABLE_REST_SERVER=1 -DOTBR_ENABLE_SRP_ADVERTISING_PROXY=1 -DOTBR_ENABLE_SRP_SERVER_AUTO_ENABLE_MODE=1 -DOTBR_ENABLE_VENDOR_INFRA_LINK_SELECT=0 -DOTBR_MESHCOP_SERVICE_INSTANCE_NAME="\"OpenThread BorderRouter\"" -DOTBR_PACKAGE_NAME=\"OpenThread_BorderRouter\" -DOTBR_PACKAGE_VERSION=\"0.3.0-thread-reference-20230710-287-g5bba00e43e-dirty\" -DOTBR_PRODUCT_NAME=\"BorderRouter\" -DOTBR_SYSLOG_FACILITY_ID=LOG_USER -DOTBR_VENDOR_NAME=\"OpenThread\" -I/usr/include/dbus-1.0 -I/usr/lib/aarch64-linux-gnu/dbus-1.0/include -I../../include -I../../src -Ithird_party/openthread/repo/etc/cmake -I../../third_party/openthread/repo/etc/cmake -I../../third_party/openthread/repo/include -I../../third_party/openthread/repo/src/posix/platform/include -I../../third_party/openthread/repo/src -Wall -Wextra -Werror -Wfatal-errors -Wuninitialized -Wno-missing-braces -std=c++11 -MD -MT src/dbus/client/CMakeFiles/otbr-dbus-client.dir/thread_api_dbus.cpp.o -MF src/dbus/client/CMakeFiles/otbr-dbus-client.dir/thread_api_dbus.cpp.o.d -o src/dbus/client/CMakeFiles/otbr-dbus-client.dir/thread_api_dbus.cpp.o -c ../../src/dbus/client/thread_api_dbus.cpp
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,

Looks like your compiler had an internal issue and crashed. Is it possible to upgrade your compiler?

@hassan-xy
Copy link
Author

image
This is my current version 7.5.0.
If its possible then I will give it a try.
Let me know if anything else is needed or if you have any commands that can help me update my compilers.
Thanks

@hassan-xy
Copy link
Author

image
I have updated on gcc & g++ to 9.4.0 and tried to run once again but still the same error. Do you think I am missing any dependencies?

@superwhd
Copy link
Contributor

I haven't met a similar error before but this may be worth trying: https://stackoverflow.com/questions/30887143/make-j-8-g-internal-compiler-error-killed-program-cc1plus.

Let's see if you can find anything suspicious in dmesg.

@hassan-xy
Copy link
Author

EDIT: It checked the error could be due to less resources. I have 1GB RAM currently. How much more is needed to build successfully? How much RAM do you guys have in your system?

@superwhd
Copy link
Contributor

For development purpose I'd suggest to use a larger one. For raspberry pi I know that 8GB is enough but I don't know the minimum requirement.

@hassan-xy
Copy link
Author

Well, i am trying the stackoverflow link you shared and it seems to be complete.
image
I will now proceed with the next steps and keep you guys posted for new developments.

Thanks

@hassan-xy
Copy link
Author

Well I have flashed the rcp code in the the zigbee chipset connected to port ttyS2 and then updated the otbr-agent file
OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyS2 trel://wlan0"
Then reboot the device.
sudo service mdns status is active.
sudo service otbr-agent status is activating.
sudo service otbr-web status is active.
sudo systemctl --failed shows the following failed status.
image

I see error at step 6: Verify RCP
sudo ot-ctl state
image
sudo ot-ctl reset also throws the same error.

Let me know if you guys have an idea of whats going wrong here. Maybe the rcp file is not correct?
Thanks

@hassan-xy
Copy link
Author

Guys its been 2 weeks. Please let me know if I am wrong somewhere. Also does it support linux yocto environement.

@superwhd
Copy link
Contributor

superwhd commented Jul 4, 2024

The error you got from sudo ot-ctl state indicates that otbr-agent is not running normally.

You may need to take a look at otbr-agent logs from /var/log/syslog.

@hassan-xy
Copy link
Author

hassan-xy commented Aug 7, 2024

image
Any idea whats happening here?

RCP firmware has been flashed in zigbee module connected to port ttyS2.

Also this is a new device running on linux yocto kirkstone and I have loaded the otbr-agent and ot-ctl using the two open source recipes.
Also loaded wpantund but no idea how to use it.

PS: I didnt run the bootstrap and the setup script on the gateway due to incompatible distros (ubuntu and yocto)

@superwhd
Copy link
Contributor

superwhd commented Aug 7, 2024

Seems your openthread source code is kind of old. I don't see the file radio_spinel_impl.hpp in latest main branch code.

@zhanglongxia @Irving-cl I wonder if you have any idea what the error means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants