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

Remote provisioning from all devices on the mesh

I am using mesh SDK v4.2.0.

I read the documentation of the remote provisioning example (pb_remote) and took look at the code.

My first feeling was that the remote provisioning in this example is done through a specific device on the mesh that implements the pb_remote_server and is chosen to start the process using the device that implements the pb_remote_client, most likely the provisioner device.

Before a detailed reading of this example, I thought the provisioner just flooded the mesh with provisioning messages and all devices repeated those messages and could add a new device to the mesh. While the provisioning data is indeed passed through the mesh as I expected to, only one specific device, the one chosen by the pb_remote_client, seems to be able to convey the message on the last jump to the new unprovisioned device.

How can the provisioner know beforehand the best device to choose as the final messager? Is it possible to activate many pb_remote_servers at the same time? Do we need to alternate which device is scanning for unprovisioned devices periodically? I think there might be many ways of doing this, so I am asking for advice, or correction if I understood something wrong.

Parents
  • Hi, 

    Sorry for the late reply. 

    You are correct, a specific remote provisioning server is used for actually provisioning each unprovisioned device. There is nothing stopping you from having a lot of these in the network however, possibly on every node. In addition, choosing the "best" server for provisioning a new device is not really neccessary, any device which picks up the unprovisioned beacon should do.

  • Hi, I returned to the development of the remote provisioner and while I got it working, I cannot start multiple remote scans at the same time. From my interpretation of the code, this is not natively possible.

    Currently I am cycling through all active nodes in the mesh network, first setting/changing the publish address of the pb_remote_client with the dsm to the address of the pb_remote_server in that node and then initiating the scan with pb_remote_client_remote_scan_start.

    pb_remote_client_remote_scan_start only returns NRF_SUCCESS if the client state is PB_REMOTE_CLIENT_STATE_IDLE, returning NRF_ERROR_INVALID_STATE otherwise. After the first scan is ordered, an event of type PB_REMOTE_CLIENT_EVENT_SCAN_START is sent for processing, which will trigger pb_remote_client_event_scan_start_cb and change the client state to PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN. On ordering the second scan from the second node, client state is no longer PB_REMOTE_CLIENT_STATE_IDLE, but PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN. This will trigger the NRF_ERROR_INVALID_STATE error and prevent me from initiating remote scanning on the second node.

    I imagine this is done because the remote client does not change its publish address dynamically, depending on the address of the server that links with the unprovisioned device. Am I on the right track? Thank you.

Reply
  • Hi, I returned to the development of the remote provisioner and while I got it working, I cannot start multiple remote scans at the same time. From my interpretation of the code, this is not natively possible.

    Currently I am cycling through all active nodes in the mesh network, first setting/changing the publish address of the pb_remote_client with the dsm to the address of the pb_remote_server in that node and then initiating the scan with pb_remote_client_remote_scan_start.

    pb_remote_client_remote_scan_start only returns NRF_SUCCESS if the client state is PB_REMOTE_CLIENT_STATE_IDLE, returning NRF_ERROR_INVALID_STATE otherwise. After the first scan is ordered, an event of type PB_REMOTE_CLIENT_EVENT_SCAN_START is sent for processing, which will trigger pb_remote_client_event_scan_start_cb and change the client state to PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN. On ordering the second scan from the second node, client state is no longer PB_REMOTE_CLIENT_STATE_IDLE, but PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN. This will trigger the NRF_ERROR_INVALID_STATE error and prevent me from initiating remote scanning on the second node.

    I imagine this is done because the remote client does not change its publish address dynamically, depending on the address of the server that links with the unprovisioned device. Am I on the right track? Thank you.

Children
No Data
Related