Skip to main content
Visitor II
November 23, 2022
Question

How to set THREAD_VERSION for ot-br-posix

  • November 23, 2022
  • 5 replies
  • 3452 views

Hello,

I wants to bitbake ot-br-posix with OT_THREAD_VERSION=1.1, Modified the ot-br-posix_git.bb file, add -DOT_THREAD_VERSION=1.1 in this file. But result is ot-br-posix using Thread Version 1.2

Does somebody know how to solve this issue

Many thanks.

B.R

Frank

    This topic has been closed for replies.

    5 replies

    ST Employee
    November 23, 2022

    Hi @Community member​ 

    by looking at the file third_party/openthread/CMakeLists.txt in the GIT repository of ot-br-posix under github https://github.com/openthread/ot-br-posix, I can see that OT_THREAD_VERSION with a different value than 1.1 triggers some variables to be set. In particular (so if OT_THREAD_VERSION is NOT 1.1) :

    • OT_DUA is set to ON
    • OT_MLR is set to ON

    I guess if OT_THREAD_VERSION is set to 1.1, these variables are set to OFF.

    But that conflicts with the recipe ot-br-posix_git.bb which explicitly sets them to ON.

    This would seem like a good idea to remove

     -DOT_MLR=ON \

    and

     -DOT_DUA=ON \

    from the recipe or enforce them to OFF.

    Best regards,

    --JM

    Visitor II
    November 25, 2022

    Hi JM

    Thanks a lot, I tried with your method. It does not work. The thread version sticks at version 1.2. But on rpi3 platform, only INFRA_IF_NAME=wlan0 WEB_GUI=1 BACKBONE_ROUTER=0 OTBR_OPTIONS="-DOT_THREAD_VERSION=1.1" ./script/setup, then it works.

    B.R.

    Frank

    ST Employee
    November 25, 2022

    Hi @Community member​ 

    Too bad :(

    Indeed the OT_THREAD_VERSION=1.1 is ignored as I can see it on my board in /var/log/messages:

    Nov 25 14:12:32 stm32mp1 user.info otbr-agent[1386]: [INFO]-UTILS---: Thread version: 1.2.0

    I need to dig into my own notes as I successfully built the ot-br-posix package some months ago but with OpenSTLinux 3.0 and a different ot-br-posix recipe:

    Mar 31 08:15:46 stm32mp1 user.info otbr-agent[1060]: [INFO]-UTILS---: Thread version: 1.1.1

    I agree the setup with RPi is working well but the Yocto recipe relies on a different mechanism that surely explains this discrepancy.

    Best regards,

    --JM

    ST Employee
    November 25, 2022

    Hi @Community member​ 

    I think we need some combinations of flags to properly build the OBTR package and I didn't find them.

    At now, I have added these flags:

    -DOT_THREAD_VERSION=1.1
    -DOTBR_BACKBONE_ROUTER=OFF
    -DOTBR_DUA_ROUTING=OFF
    -DOT_DUA=OFF
    -DOT_MLR=OFF

    But I have some compilation errors because some features need OpenThread version 1.2. Currently, I don't know which flags allow the build process to bypass these errors.

    Best regards,

    --JM

    Visitor II
    November 28, 2022

    Hi JM,

    Thanks for your information. I will try OpenSTLinux 3.0 and try to feature out the reason.

    B.R.

    Frank

    ST Employee
    November 28, 2022

    Hi @Community member​ 

    If you have access to a RPi3 machine, I would be curious about building the OTBR with OT_THREAD_VERSION=1.1: is RPi3 really with version 1.1 when running? Or is the version is forced silently to 1.2?

    I think you can stay with DV-4.1 to search the reason why OT_THREAD_VERSION=1.1 is not taken into account. I guess this is related to interaction with the build process of third_party/openthread.

    Best regards,

    --JM

    Visitor II
    November 28, 2022

    Hi JM,

    On RPI3, I just did below:

    $ git clone https://github.com/openthread/ot-br-posix

    $ cd ot-br-posix

    $ WEB_GUI=1 ./script/bootstrap

    $ INFRA_IF_NAME=wlan0 WEB_GUI=1 BACKBONE_ROUTER=0 OTBR_OPTIONS="-DOT_THREAD_VERSION=1.1" ./script/setup

    If without OTBR_OPTIONS="-DOT_THREAD_VERSION=1.1", the ot-br-posix uses thread version 1.3

    0693W00000WJbYfQAL.png 

    Best Regards

    Frank

    ST Employee
    November 28, 2022

    Hi @Community member​ 

    Thank you for the output.

    Do you have the same output when building OTBR with OT_THREAD_VERSION=1.1 please?

    Best regards,

    --JM

    Visitor II
    November 29, 2022

    Hi JM,

    When building ot-br-posix on RPI3, the build process outputs

    + local builddir=/home/pi/work/ot-br-posix/build/otbr

    + mkdir -p /home/pi/work/ot-br-posix/build/otbr

    + cd /home/pi/work/ot-br-posix/build/otbr

    + cmake -GNinja /home/pi/work/ot-br-posix -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DOTBR_DBUS=ON -DOTBR_FEATURE_FLAGS=ON -DOTBR_DNSSD_DISCOVERY_PROXY=ON -DOTBR_SRP_ADVERTISING_PROXY=ON -DOTBR_INFRA_IF_NAME=wlan0 -DOTBR_MDNS=mDNSResponder -DOTBR_VERSION= -DOT_PACKAGE_VERSION= -DOT_THREAD_VERSION=1.1 -DOTBR_WEB=ON -DOTBR_BORDER_ROUTING=ON -DOTBR_REST=ON

    And the otbt-agent runs with Thread Version 1.1.1, it works with our STM32WB55 RCP

    Best Regards

    Frank0693W00000WJhm9QAD.png

    ST Employee
    December 2, 2022

    Hi @Community member​ 

    I made some significant progress as I can see these outputs in my /var/log/messages:

    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Running 0.3.0-ad6822257f-dirty
    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Thread version: 1.1.1
    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Thread interface: wpan0
    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Backbone interface: wlan0
    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Radio URL: spinel+hdlc+uart:///dev/ttyUSB0
    Dec 2 16:09:41 stm32mp1 user.info otbr-agent[1032]: [INFO]-UTILS---: Radio URL: trel://eth0
    Dec 2 16:09:43 stm32mp1 user.crit otbr-agent[1032]: 49d.17:07:12.290 [C] Platform------: BSD TCP function() at radio_spinel_impl.hpp:2236: RadioSpinelNoResponse

    To achieve this result, I introduced a bbappend recipe:

    FILESEXTRAPATHS:prepend := "${THISDIR}/ot-br-posix:"
    SRC_URI += "\
     file://manage-ot-thread-version-1.1.patch \
     "
     
    # openthread/repo/src/cli/cli.cpp:1786:18: fatal error: variable 'i' set but not used [-Wunused-but-set-variable]
    # for (uint8_t i = 0;; i++)
    CXXFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=unused-but-set-variable"
     
    EXTRA_OECMAKE += "\
     -DOT_THREAD_VERSION=1.1 \
     -DOTBR_INFRA_IF_NAME=wlan0 \
     -DOTBR_BACKBONE_ROUTER=OFF \
     -DOTBR_DUA_ROUTING=OFF \
     -DOT_DUA=OFF \
     -DOT_MLR=OFF \
     "
     
    RDEPENDS:${PN} += "ipset"

    The patch mentionned in the recipe changes the file third_party/openthread/CMakeLists.txt to its exact copy of the file at sha1 110eb2507caa2fbc9b10935d37f78f6280de1086 in the ot-br-posix git repo. I attached it below.

    Best regards,

    --JM

    Visitor II
    December 5, 2022

    Hi JM,

    Thanks for your solution, I will try.

    Best Regards

    Frank