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

can't Send data to server from client with unicast address of server

I set the publish address of client using function:

static uint32_t set_model_publish_address(uint16_t publish_address, access_model_handle_t model_handle) {
  uint32_t status = NRF_SUCCESS;
  dsm_handle_t publish_address_handle = DSM_HANDLE_INVALID;
  access_model_publish_address_get(model_handle, &publish_address_handle);
  NRF_MESH_ASSERT(dsm_address_publish_remove(publish_address_handle) == NRF_SUCCESS);
  status = dsm_address_publish_add(publish_address, &publish_address_handle);
  if (status != NRF_SUCCESS) {
    return status;
  } else {
    return access_model_publish_address_set(model_handle, publish_address_handle);
  }
}

Unicast address of sever is 0x0003.

After setting publish address by this function, I check publish address from mobile Nrf Mesh App, and it reflects the publish address to 0x0003.

but when I publish data from client it doesn't reach to server.

Dimmer  onoff example works perfectly for client and server, but when I use this method of publication, it didn't work.

But when I use 0xC000 subscribe address (subscribed from mobile for server), it works.

Thank You

Bivay





Parents
  • Hi,

    Do you use the static provisioner form our SDK to provision both nodes? Also, is the function for setting the publish address the only modification you made to the example(assuming you are using the dimming example)?

  • Is there are a reason why you are not using the nRF Mesh to set the publish as well? Can you try to commenting out the modifications you have done and set the publish address of the client via the app? Does it work?

  • I want to change publication address from uart data, So I need to this function to be call.

    what I have to do:

    > client and server node are in same element index, so have a unit node address,

    > Client sends some data to server and server response to it by using status publish function.

    > client verifies responses and task completed.

    issues are:

    when I use group address, I can see in log that in access.c > access_incoming_handle function is called,

    but when I use unicast address, this function is not called.

    I think mesh address filtering is done here, so all mesh message passed through this function, am I right?

    I also tried this from app, too, but it didn't work.

Reply
  • I want to change publication address from uart data, So I need to this function to be call.

    what I have to do:

    > client and server node are in same element index, so have a unit node address,

    > Client sends some data to server and server response to it by using status publish function.

    > client verifies responses and task completed.

    issues are:

    when I use group address, I can see in log that in access.c > access_incoming_handle function is called,

    but when I use unicast address, this function is not called.

    I think mesh address filtering is done here, so all mesh message passed through this function, am I right?

    I also tried this from app, too, but it didn't work.

Children
  • Hello Bivay,

    I am implementing something similar, has one client and multiple servers.

    Tried to change the unicast address for publishing works perfectly with button event. But when I tried to send message after changing unicast address it's fall in to assert.

    Here is more details,

    Case 1: 

           A: Get server node address and data over serial.

           B: Only change the unicast address.

           C: Manually press the button. This will send data to desired server.

    Case2:

          Here step A and B are same.

          C: here I call button event function internally using function call. This get me to some assert s.

Related