How to reset a node and re-provision it after provision once programmically?

Hi!

We are developing home automation light control mesh products.

We use nrf52832 DK (PCA10040), with nRF Connect SDK Toolchain v2.7.0 and nRF Connect SDK v2.6.1

We had successful build a mesh network, provision nodes.

But our customer need a function: let end user can reset the device (provisionee) after provisioned and then being provison by another provisioner again.

That is to say, they want to remove provision data in provisionee, and join another network or re-join this network.

We had check public Q&A, there is a post talking about:

//dsm_devkey_delete();
//config_client_code_reset();
//dsm_clear()
But we can not find these API. It seems they are deprecated.
Would you please show us example codes to solve this problem?
  • Hi,

    In nRF Connect SDK, you can use bt_mesh_reset() to reset the local node. Please note that after resetting the node, you must initiate unprovisioned advertising with bt_mesh_prov_enable() in order for the node to be available for provisioning again.

    Please note also that when resetting the local node this way, the provisioner will not get notified. From the view of the rest of the network, resetting the node looks the same as the node simply being brought out of range. Typically, node removal should therefore be done by the provisioner.

    For an nRF Connect SDK based provisioner, you can reset other nodes through use of bt_mesh_cfg_cli_node_reset(). (Technically this call can also be used to reset the node itself, by using the node's unicast address, but bt_mesh_reset() is the preferred way to reset the local node itself.)

    When a node has been reset, the provisioner should keep track of the (now unused) unicast addresses, which can be reused after two IV Updates. (Unicast address reuse is not allowed before that, due to the potential existence of replay protection list entries in other noes.)

    If a node has been reset, there is often also a good idea to perform the Key Refresh procedure, for any keys held by the now reset node, in order to maintain the security of the network. (E.g. to protect against trash can attack.)

    Regards,
    Terje

Related