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

Communication with a provisioner

Let's have light-switch provisioner, server and client.

My question is, how to send a message from a client or a server to the provisioner? In order to send a message, client needs to have provisioner's address (access_model_handle_t) but it doesn't. How to solve this problem?

[nRF52840, Mesh SDK 2.2.0, nRF SDK 15.2.0, S140 6.1.0]

  • Hi,

    I would take a good look at the health model if I were you. If you run the light switch example on mesh sdk v2.2.0 with one provisioner, one client & one (or more) servers, you should see that the provisioner receives logging information about the health status of all nodes. I am assuming you have a few 52 dev kits to test with. Just run a debug session for each example in Segger Embedded Studios.

    In the health_server.c file in the server example, take a look at the send_attention_status() function. The server knows the model_handle and is able to use that information to send a message back to the provisioner without knowing the unicast address of the provisioner directly:

    (void) access_model_reply(p_server->model_handle, p_message, &packet);

    The real work occurs inside packet_tx() in the access.c function. This is where the device state manager returns the local addresses & the model handle is used to find the correct address to send the message to.

    Also, note that the mesh sdk v2.2.0 requires the nRF5 SDK v15.0.0, not 15.2.0. Hence, the softdevice used is S140 v6.0.0, not 6.1.0. Hope that helps!

    Kind Regards,

    Bjørn

Related