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.

Parents
  • 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.

  • Hi Hung,

    Mesh SDK: nrf5_SDK_for_Mesh_v1.0.1_src

    Sample code: light switch server

    Now, I try to remove node from mesh network on server side by using button event trigger, For example,  long push button over 15s, the server node will clear the configuration information and reset network state, when button is pressed, it will trigger the event handler mesh_node_configuration_reset() , but it is ASSERT when handling net_state_reset().  

    void mesh_node_configuration_reset(void)
    {
        /* Clear all the state. */
        access_clear();
        dsm_clear();
        net_state_reset();
    
        /* System reset */
        const config_server_evt_t evt = {.type = CONFIG_SERVER_EVT_NODE_RESET};
        app_evt_send(&evt);
    }

    while commiting the net_state_reset(), it is successful, but I don't think that this action is correct, because the network state(IV index and sequence number) don't clear, It seem that the cause of bearer layer event flag is not set, right ? How to fix it?

    Best regards.

Reply
  • Hi Hung,

    Mesh SDK: nrf5_SDK_for_Mesh_v1.0.1_src

    Sample code: light switch server

    Now, I try to remove node from mesh network on server side by using button event trigger, For example,  long push button over 15s, the server node will clear the configuration information and reset network state, when button is pressed, it will trigger the event handler mesh_node_configuration_reset() , but it is ASSERT when handling net_state_reset().  

    void mesh_node_configuration_reset(void)
    {
        /* Clear all the state. */
        access_clear();
        dsm_clear();
        net_state_reset();
    
        /* System reset */
        const config_server_evt_t evt = {.type = CONFIG_SERVER_EVT_NODE_RESET};
        app_evt_send(&evt);
    }

    while commiting the net_state_reset(), it is successful, but I don't think that this action is correct, because the network state(IV index and sequence number) don't clear, It seem that the cause of bearer layer event flag is not set, right ? How to fix it?

    Best regards.

Children
Related