Joining via CLI works, trying to automate it. How to wait for Join Success before ThreadStart?

Skip to first unread message

Joseph Flynn

Feb 25, 2022, 10:29:07 AM2/25/22
to openthread-users
Subject says is all.

When I use the CLI console on my joiner to

> ot thread stop
> ot {set panid and extended panid}
> ot joiner start {psk that is on the QR code, barcode also has the eui64 id}

there is a delay here and sometimes it times out if I don't hit the commisssioner quickly enough

May need to do this again if it times out
> ot joiner start {psk that is on the QR code}

How can I wait for success before
>ot thread start


Any ideas?  Trying to automate what I have been successful in doing manually.

Abtin Keshavarzian

Feb 25, 2022, 4:43:49 PM2/25/22
to openthread-users
You can check and use the OpenThread Joiner APIs or (openthread/joiner.h)

The `otJoinerStart()` has  a callback `otJoinerCallback` which is used to report back to the caller the completion of a join operation (success or failure).
There is also an API `otJoinerGetState()` to get the current state of joiner.  I would recommend using OT APIs directly for such automation.

If you want to use joiner CLI, then you can check the `joiner state` to see the current state of joiner (perhaps a polling on the state till is finishes).

Joseph Flynn

Feb 25, 2022, 5:07:51 PM2/25/22
to openthread-users
Thank you  Abtin, I will try automating that now with your suggestions!
Reply all
Reply to author
0 new messages