This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NCS: How to reset a Bluetooth Mesh node?

Dear Nordic experts,
 
 
This short code snippet is supposed to reset (unprovision) a Bluetooth Mesh node and reboot it (NCS 1.7.1):
 

void on_node_reset()
{
    bt_mesh_reset();
    bt_mesh_prov_enable(CONFIG_BT_MESH_PB_GATT);
    bt_mesh_model_data_store(somestruct.model, true, DATA_STORE_KEY, NULL, 0);
 
    sys_reboot(SYS_REBOOT_COLD);
} 

 
The function is wired to an input pin. After calling it, the reboot happens, but the node stays provisioned. Question now is, what's the proper way to reset (completely wipe, or factory reset) a Bluetooth Mesh node?

Parents
  • Hi BlueMike, 

    I don't think you would need to call bt_mesh_prov_enable() or bt_mesh_model_data_store() if you plan to reset the chip. 

    But you would need to give it some time to erase the provisioning data before you trigger the system reboot. 

    The timeout for storing (store the zeroed data) for mesh is defined as BT_MESH_STORE_TIMEOUT , by default it's 2 seconds. 
    I would suggest to wait 2 seconds before you trigger the system reboot. 

  • Hi Hung Bui,
     
    Thanks for the clarifications! It's working now. You're right, calling bt_mesh_prov_enable() is not necessary if the system is rebootet. Calling bt_mesh_model_data_store() isn't strictly necessary neither, but without calling it, the model's data would persist, even after resetting/re-provisioning.
     
    Again, thanks for your help, and all the best for 2022!
    Michael.

Reply
  • Hi Hung Bui,
     
    Thanks for the clarifications! It's working now. You're right, calling bt_mesh_prov_enable() is not necessary if the system is rebootet. Calling bt_mesh_model_data_store() isn't strictly necessary neither, but without calling it, the model's data would persist, even after resetting/re-provisioning.
     
    Again, thanks for your help, and all the best for 2022!
    Michael.

Children
No Data
Related