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

[MESH SDK] Remove one device from mesh network

Hi,

Now, I have a provisioner (based on the provisioner example of the mesh sdk) and I want to unprovision a specific device.

I have tried to use "config_client_node_reset" but this method remove all node from network and not a specific one.

I have tried to temporarily change the mesh config model publish address to the node address that I want to remove from network but Its not really stable and works not every times.

So, there is a way to remove just one node from the mesh network ?

Regards

Used sdk :

- nRF5_SDK_16.0.0_98a08e2

- nrf5_SDK_for_Mesh_v4.2.0_src

Board used :

- nrf52840 evaluation board

  • Actually what I'm doing :

    In my mesh controller :

    // Unprovision a provisioned mesh device.
    uint8_t free_device(uint16_t target)
    {
    //  config_client_node_reset();
    //  serial_free_cb(target);
    //  return SERIAL_CMD_SUCCESS;
    
      if (reset_device(target) == NRF_SUCCESS)
      {
        reset_config_handle(&m_dev_handles.m_appkey_handle);
    
        dsm_handle_t handle;
        if (dsm_devkey_handle_get(target, &handle) == NRF_SUCCESS)
        {
          dsm_devkey_delete(handle);
        }
        serial_free_cb(target);
    
        toggle_scan(true);
        return SERIAL_CMD_SUCCESS;
      }
      reset_config_handle(&m_dev_handles.m_appkey_handle);
      return SERIAL_ERROR;
    }
    

    What I add in my config_client.c file :

    uint32_t reset_device(uint16_t target)
    {
        uint32_t status = NRF_SUCCESS;
        if (client_in_wrong_state(&status))
        {
            return status;
        }
    
        dsm_handle_t hdl;
        status = dsm_address_publish_add(target, &hdl);
        if (status != NRF_SUCCESS)
        {
          return status;
        }
        
        status = access_model_publish_address_set(m_client.model_handle, hdl);
        if (status != NRF_SUCCESS)
        {
          return status;
        }
    
        return send_reliable(CONFIG_OPCODE_NODE_RESET, 0, CONFIG_OPCODE_NODE_RESET_STATUS);
    }
    
    uint32_t reset_config_handle(dsm_handle_t* hdl)
    {
        return access_model_publish_address_set(m_client.model_handle, *hdl);
    }
    

    Regards

  • Hi

    Due to the summer vacation period we are currently understaffed, so delayed replies must be expected. I am sorry about any inconvenience this might cause.

    This question has been asked before in DevZone, and I suggest checking out this case where my colleague Hung has answered this already.

    Best regards,

    Simon

Related