openthread cli does not auto start and cannot use commissionner

I'm trying to create an openthread network extension with nrf52840 dongle. For that, it needs to be Full Thtead Device so that it's capable of becoming a router and should be able to join automatically so auto start thread and joined config. I based it on the cli example

github.com/.../cli

witht the following west.yml

https://github.com/HomeSmartMesh/sdk-hsm-thingy53/blob/main/west.yml

which has nrfconnect v2.3.0 and sdk zephyr v3.2.99-ncs2

with the following additional overlay

github.com/.../overlay-joiner-rounter.conf

here the content for conevenience 

```

CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y
CONFIG_OPENTHREAD_FTD=y
CONFIG_OPENTHREAD_MTD=n
CONFIG_OPENTHREAD_MANUAL_START=n

# OpenThread joiner
CONFIG_OPENTHREAD_JOINER=y
CONFIG_OPENTHREAD_JOINER_AUTOSTART=y
CONFIG_OPENTHREAD_JOINER_PSKD="ABCDE2"
CONFIG_OPENTHREAD_SLAAC=y

CONFIG_OPENTHREAD_COMMISSIONER=y

```

Yet, by default the state is disabled and is not autostarting despite `CONFIG_OPENTHREAD_MANUAL_START=n`

plus the commissionner command does not exist, I get an error when I try to use it on the shell, despite `CONFIG_OPENTHREAD_COMMISSIONER=y` 

I built it as follows and checked in `build/zephyr/.conf` that the config flags are taken correctly. 

`west build -p always -b nrf52840dongle_nrf52840 -- "-DOVERLAY_CONFIG=overlay-usb.conf;overlay-joiner-rounter.conf" -DDTC_OVERLAY_FILE="usb.overlay"`

I also perform an `ot factoryreset` for every test and have a sniffer to check packets. Right after a factory rest, and after the dongle restarts and the serial attaches again, the `ot state` is disabled and not detached or other, so I have to manually run`ot thread start` which is a manual start and not automatic.

My end goal is to make MTD devices be able to join through a cli dongle as router, but for that I assumed the cli has to be capable of commissioning first, and failed in testing a simple cli leader that can commission from its shell.

Parents Reply Children
  • Hi wass.

    I will continue helping in this case.

    wass said:
    Flashing actually does not delete the openthread settings region

    That is correct.

    However, if you flash and erase, openthread settings will be erased.

    wass said:
    As you can see, the cli sample starts as disabled and does not attempt to join any network as per the expected `CONFIG_OPENTHREAD_JOINER_AUTOSTART=y`

    From your description, your issue is that when you call "ot factoryreset", the device does not autojoin again, rigjt?

    If I run my autojoin sample, the device automatically joins on "ot factoryreset".
    See the video below for a sample

    Regards,
    Sigurd Hellesvik

  • Thank you very much for your support, the "autojoin" sample is out of scope though, as the question was about the cli. I am capable of using join functions with a custom app. Therefore, I will not follow up this question we can close it as I will proceed by creating a different sample than the cli.
    Thank you again for the help, I don't think it is worth it to follow up why exactly the cli sample did not work with a specific flag.

Related