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

How to re-provision a node to same address with nRF52840 DK board in mesh

i'm using nRF mesh sdk v2.1.1 with 2 boards and 1 provisioner board. I have un-provisioned 1 board with the help of config_client_node_reset().  I want to know the procedure to re-provision the unprovisioned node with same address.Please give me solution.

  • i'm resetting provisionee node (unprovision from network) by calling config_client_node_reset().I have successfully unprovisioned the node, I facing the issue, when i start provision to same address it provision to (address: 0x0100) same address but devkey_handle becomes 0 instead of 2.Can you please clarify why the devkey_handle becomes 0 when i re-provision the node with same address.  

    Please describe what exactly your code doing. 

    I'm simply reset a node using config_client_node_reset() from provisioner and trying to re-provision it to same address.

  • I saw in the log you post ealier, there is some log about node reset on the provisioner for example: 

    <t: 532066>, main.c, 702, Button 4 pressed
    <t: 532068>, main.c, 716, ----- Node reset -----
    <t: 532078>, main.c, 721, ----- Press reset button or power cycle the device -----
    <t: 532081>, main.c, 728, Setup start after reset 
    <t: 532083>, main.c, 731, Waiting for node to be provisioned ...
    <t: 532086>, provisioner_helper.c, 287, Scanning For Unprovisioned Devices

    Please explain this. 

    Regarding devkey_handle, please debug the call to dsm_devkey_add() inside NRF_MESH_PROV_EVT_COMPLETE event handler in prov_evt_handler(). And check if the p_devkey in that call, would be exactly the same at the p_devkey when you first provision the device. Also please check if dsm_devkey_add () return NRF_SUCCESS or it actually return NRF_ERROR_FORBIDDEN

    What I can see in the code of dsm_devkey_add is that if the address is already inside the list of device keys, then the call dev_key_handle_get() will return the handle and it will trigger  NRF_ERROR_FORBIDDEN. 

    You would need to make sure the address is removed from the device key list. 

  • when provision first time the devkey is 9D F7 CC 2D C8 E8 B4 AA 66 C7 DC 41 40 9D AD 4E 00 and p_devkey address is 0x200036E0. After re-provision with same node address the devkey becomes AA 36 22 75 76 7D 55 34 4A 75 33 13 42 A8 1A 8E 00 and p_devkey address is  0x200036E0. how to remove the address from device key list.

  • where should i need to call this dsm_devkey_delete() 

Related