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

  • 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);

  • Hello,

    I see. I also struggle with the return values of these calls. I did some other changes to the project, such as disabling autostart by setting .autostart_disable = true in thread_instance_init():

    static void thread_instance_init(void)
    {
        thread_configuration_t thread_configuration =
        {
            .radio_mode            = THREAD_RADIO_MODE_RX_OFF_WHEN_IDLE,
            .autocommissioning     = true,
            .poll_period           = 2500,
            .default_child_timeout = 10,
            .autostart_disable     = true
        };
    
        thread_init(&thread_configuration);
        thread_state_changed_callback_set(thread_state_changed_callback);
    }

    I see that it makes a difference if I call otCommissionerStart() or not, because it gives a different callback to thread_state_changed_callback(), but it still returns the error, and so does otCommissionerAddJoiner().

    I have forwarded this to our Thread team. I'll let you know when I hear from them.

    Best regards,

    Edvin

  • Ok I await your response.

    Thank you very much for your help.

  • Hi,

    Sorry for hijacking this thread but I have similar issue and I want to know answer of original question of thread.

    I am facing similar issue. I am using ble_thread_dyn_proximity_uart_pca10056_s140 as I want to use COAP server as commissioner. as this project included optimized FTD Open thread library by default and I want it to be a commissioner so I removed it and added FTD library. and modified code as I understand commissioning process.    

    When I call otCommissionerStart() it returns OT_ERROR_ALREADY and another thing is that if I call otInstanceFactoryReset(thread_ot_instance_get()); it jumps to error handler.

    I am attaching my code for your review. What I want to do is commission a new device to a  network.,ble_thread_dyn_proximity_SR_COAP_Server.rar

    Regards,

    Hardik Harpal      

  • Hi Edvin,

    I've been waiting for 3 weeks: do you have any news?

    Thank you

Related