Commissioner/Joiner Automated

432 views
Skip to first unread message

Kister Genesis Jimenez

unread,
Jul 23, 2017, 11:06:03 AM7/23/17
to openthread-users
Hi!

I have this scenario. I have a gateway and multiple devices (e.g. bulbs, locks, etc). What I understand with Commissioner/Joiner is that I will set my gateway as the commissioner and set a pre-shared key. However, is there a way that I don't have to input the pre-shared key to the devices? For example, they get locked to the first gateway they connect to whenever I push a button in the device while the gateway is in inclusion mode. I want that only the devices that are paired to the gateway can connect the to gateway and only the gateway paired with the device can access the device.



Thanks

Kister

Yakun Xu

unread,
Jul 23, 2017, 11:39:55 AM7/23/17
to openthread-users
I don't think the gateway is the commissioner, but your mobile phone is. The gateway, or the border router in terms of Thread, acts like a bridge between your phone and the Thread network. To activate your phone as a commissioner, Thread requires the commissioning passphrase. And to pair new devices, a human-scaled passphrase is not input into, but got from the new device, usually by scanning QR code on the new device or manually input into your phone, i.e. the commissioner.

If you really wanna a push-button solution, I think you may activate the native commissioner which is running inside a thread device(probably the gateway), and when gateway is set in inclusion mode, it sets the steering data of Thread network to all 1 so that commissioner will accept all devices' joining request if the PSKd(pre-shared key for the device) matches. All your new devices and native commissioner should share the same PSKd. When the button is pushed on the new device, it start joining with a fixed passphrase(which lead to the fixed PSKd).

Kister Genesis Jimenez

unread,
Jul 30, 2017, 2:25:56 PM7/30/17
to openthread-users
Hi!

Thanks for your response. Sorry about the gateway being the commissioner. What I mean is that the device running the gateway (an app with touch screen) is the commissioner.

to pair new devices, a human-scaled passphrase is not input into, but got from the new device, usually by scanning QR code on the new device or manually input into your phone, i.e. the commissioner.
You mean each device already have their own passphrase? So in the commissioner side (example in a cli):

commissioner joiner add hashmac_of_device scanned_passphrase

Is that correct? Then for another device I do that again but with the hash mac and passphrase of the pther device? Now, if the devices are already in the network, what is preventing from joining another network? For example, I have a thread network using the scanned passphrases from barcode of the devices and my neighbor scanned the barcode also, will he be able to control my devices also?

Jonathan Hui

unread,
Jul 31, 2017, 12:21:03 AM7/31/17
to Kister Genesis Jimenez, openthread-users
How a device is put into "joining" mode is product-specific.  In many cases, a device must physically be put into a "factory-reset" state to enter joining mode again.

In order to commission a device that is in joining mode requires knowledge of the device-specific passphrase.  How that passphrase is provided to the user is again product-specific.  For example, it could be printed on the outside of the packaging or via some other out-of-band means.

--
Jonathan Hui

Kister Genesis Jimenez

unread,
Jul 31, 2017, 3:23:28 AM7/31/17
to Jonathan Hui, openthread-users
Hi Jonathan

Thank you for the information. I tested having multiple instances of cli-ftd running and an NCP (posix). I set the NCP to have a masterkey channel etc.
I was able to let each cli join the NCP with each having different passphrase.

Although I encountered a problem which I will try to replicate later. There are times when I try to join from cli, the wpantund crashes.

Kister Genesis Jimenez

unread,
Jul 31, 2017, 4:43:43 AM7/31/17
to openthread-users, engka...@gmail.com, jon...@nestlabs.com
Here's the error when the wpantund crashed:

ot-ncp-ftd: /home/engkan2kit/openthread/examples/../src/core/common/message.cpp:562: int ot::Message::Write(uint16_t, uint16_t, const void*): Assertion `aOffset + aLength <= GetLength()' failed.
wpantund[3076]: [-NCP-]: Socket error on read: Input/output error 5
wpantund[3076]: NCPInstance: errno 5 "Input/output error"
wpantund[3076]: Cleaning up. (gRet = 9)
wpantund[3076]: Stopped.


Here's what I did to produce the error:
1. Run two ot-cli-ftd
2. on each CLI, run ifconfig up
3. Run run wpantund with the NCP
4. Set the masterkey, networkname, extpanid, panid, channel using wpanctl for the ncp.
5. enable commissioner using wpanctl.
6. add AABBAABB as passphrase in commissioner
7. let 1 cli join using AABBAABB
8. add ABCD1234 as passphrase in commissioner
9. let 1 cli join but using the passphrase in step 6 (ie. AABBAABB)
10. This will result to a fail to join.
11. Re-add the AABBAABB passphrase in wpanctl.
12. let the cli who failed joining, joiner AABBAABB.
Then it crashes.

Jonathan Hui

unread,
Aug 2, 2017, 1:55:44 AM8/2/17
to Kister Genesis Jimenez, openthread-users
Thanks for reporting this issue!  I was able to reproduce the problem and should have a fix out soon.

--
Jonathan Hui

Jonathan Hui

unread,
Aug 2, 2017, 1:23:37 PM8/2/17
to Kister Genesis Jimenez, openthread-users
Hi Kister,

You are running into these issues because the NCP occasionally runs out of message buffers while communicating Thread Commissioning messages.

I have submitted a PR that adds necessary checks when allocating message buffers: https://github.com/openthread/openthread/pull/2054

--
Jonathan Hui
Reply all
Reply to author
Forward
0 new messages