This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread network commissionning (with Bluetooth)

Hello

I would like to commission my Thread network but my Thread network is isolated (I have no wifi) but I have bluetooth which works in parallel to the Thread network (app based on the "ble_thread_dyn_mtd_coap_cli_pca10056_s140" example ).

Would it be possible to use bluetooth to commission the Thread network (add a new device to the Thread network)? If yes, what do you advise me to be able to do that?

Thank you

Parents
  • Hello,

    As far as I know there are no standardized methods of providing the provision keys for openthread. Are you able to close the network, only allowing certain devices that contain the correct keys to join? 

    What I am really asking is whether this is the question, or whether the question is if we have any suggestions on how to transfer the keys over BLE.

    Best regards,

    Edvin

Reply
  • Hello,

    As far as I know there are no standardized methods of providing the provision keys for openthread. Are you able to close the network, only allowing certain devices that contain the correct keys to join? 

    What I am really asking is whether this is the question, or whether the question is if we have any suggestions on how to transfer the keys over BLE.

    Best regards,

    Edvin

Children
  • Hi Edvin,

    I just wanted to know if there was a good way to commission a new device to join an existing Thread network using Bluetooth.

    For example, I was thinking of doing one of the following:
    - connect in Bluetooth to the new device (to add to the Thread network) and send it all the credentials of the Thread network
    - or, connect in Bluetooth to a device in the Thread network and send it a command to activate the "commissioner" by providing it with the uid64 of the device to be added and its pskd. Then, I will connect in Bluetooth to the new device to activate the "joiner" to start the commissioning.

    So the question is: is this a good way to do it?

    I started by testing the second solution but I can't start the "Commissioner".
    My application is based on the example "ble_thread_dyn_mtd_coap_cli_pca10056_s140" but when I run the function "otCommissionerStart (...)" it returns "OT_ERROR_ALREADY" (Commissioner is already started).
    So I ignore this error and I run "otCommissionerAddJoiner (...)" but it returns "OT_ERROR_INVALID_STATE" (The commissioner is not active).
    Do you have any idea on how to fix this problem?

    Thank you

  • There is no standardized way to do it in Thread 1.1 (which is what we currently support). I believe Thread 1.2. is planned, but I don't have any details about the timeline here. In Thread 1.2. this will be part of the solution. 

    However, if you don't want to wait for this, then I suggest that you first try to do this without BLE, but hardcode some keys that will only allow certain devices to join, and when you have that working, then you can look into sending these keys over BLE.

    I believe you have to call otCommissionerAddJoiner() before otCommissionerStart(), or alternatively call otCommissionerStop() -> otCommissionerAddJoiner() -> otCommissionerStart().

    BR,
    Edvin

  • Thank you very much for all this advices.

    Unfortunately, for my test I always have the same error when inverting... But that's normal, in the documentation (

    https://openthread.io/reference/group/api-commissioner#otcommissioneraddjoiner), they said to start the commissioner before to add a joiner.

    Do you have another idea?

    Thank you
  • Hello,

    Do you happen to have a project that I can run on a DK and test this on? If not, I can look into it next week, but it will be quicker if it is easily reproducible.

    Best regards,

    Edvin

  • Hello Edvin,

    Yes you can test this on the example "ble_thread_dyn_mtd_coap_cli_pca10056_s140".

    For example, after initializing the thread by auto-commissioning, execute the following functions to create a new network and commission a new device:

    otError error = OT_ERROR_NONE;  
    
    //Creation of a new dataset:
    error = otDatasetCreateNewNetwork(thread_ot_instance_get(), &sDataset);
    ASSERT(error == OT_ERROR_NONE);
    
    //Active the new dataset:
    error = otDatasetSetActive(thread_ot_instance_get(), &sDataset);
    ASSERT(error == OT_ERROR_NONE);
    
    error = otIp6SetEnabled(thread_ot_instance_get(), true);
    ASSERT(error == OT_ERROR_NONE);
    error = otThreadSetEnabled(thread_ot_instance_get(), true);
    ASSERT(error == OT_ERROR_NONE);
    
    error = otCommissionerStart(thread_ot_instance_get(), NULL, NULL, thread_ot_instance_get());
    ASSERT((error == OT_ERROR_NONE) || (error == OT_ERROR_ALREADY)); 
    
    uint8_t eui64[8];  
    for(int i=0; i<8; i++)
    {
        eui64[i]=i;
    }
    error = otCommissionerAddJoiner(thread_ot_instance_get(), &eui64, "N0RD1C", 120);
    ASSERT(error == OT_ERROR_NONE);

Related