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

BLE mesh - Removing node from network

Is there a method to remove a node from the network using the current bt mesh stack? I've looked through device_state_manager.c but it appears to me that there are only functions that would be used to add information rather than removing one.

My use case needs a way to remove a node so it can be added to another network, or just reset to a default state so that it can be used in a different context.

  • Hi Rob,

    To remove a node from the network, there is a command from the configuration client called: CONFIG_OPCODE_NODE_RESET. Calling config_client_node_reset() will send that opcode.

    Unfortunately we haven't implement that on the server side. If you have a look at handle_node_reset() in the configuration server, you can see the TODO.

    What you need to do is to implement some command to erase configuration and provisioning data in the function.

    Note that this is not the way to force the node to be out of the network. It's upto the server to accept that command or not. To be able to force a node out of the network, a "network key refresh" is needed. But this is not implemented in our stack yet.

  • Thank you. What about cleanup on the configuration client? I assume that the device key and some other information are stored in some sort way, is there a way to delete that data as well to free up memory?

  • Hi Rob,

    device_key is used in provisioning, not when doing configuration. I don't think we store device_key in flash. We simply provide the device key to the application when the provisioning is completed.

  • Ok, I guess that won't be an issue for removing a node at this point. I understand you haven't implemented the key refresh yet, but won't the device key be need to be stored to provide a secure channel for distribution of new keys once that feature is added?

  • Hi Rob,

    I need to correct myself, the configuration model actually uses device key to communicate (it has to be because netkey and appkey is not distributed prior to the configuration). And we actually store the devkey in flash by DSM.

    You can find we read the devkey out using dsm_devkey_handle_get() in provisioned_device_handles_load() in our light switch client example.

    So, if you want to delete a node, you may also want to delete devkey in the dsm on the client, using dsm_devkey_delete()

Related