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 Reply
  • 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.

Children
No Data
Related