I have asked about this before. But after working more on the project, it seems the solution i found before actually didn't solve the problem. Hence I am asking again.
After provisioning a mesh server and calling config_client_composition_data_get()
the configuration gets an timeout error.
First I thought that the message did not get sent, but I have traced the problem to when the server tries to answer.
Here is the "chain" of function calls in which the error occurs in the server:
config_server.c: handle_composition_data_get() ->
send_reply() ->
access.c: access_model_reply() ->
packet_tx() ->
device_state_menager.c: dsm_address_handle_get() ->
non_virtual_address_handle_get()
non_virtual_address_handle_get()
returns DSM_HANDLE_INVALID
because it can not find any address handle, but why can it not find this handle?
I do this on the server when the provisioning of the it has been completed: I have a suspicion there could be a problem in here but I am not completely sure.
static void mesh_evt_prov_complete_handler(nrf_mesh_evt_t* event)
{
nrf_mesh_evt_prov_complete_t prov_data = event->params.prov_complete;
dsm_handle_t netkey_handle, devkey_handle;
dsm_local_unicast_address_t local_address =
{
.address_start = prov_data.address,
.count = ACCESS_ELEMENT_COUNT
};
dsm_local_unicast_addresses_set(&local_address);
dsm_subnet_add(prov_data.netkey_index, prov_data.p_netkey, &netkey_handle);
dsm_devkey_add(prov_data.address, netkey_handle, prov_data.p_devkey, &devkey_handle);
net_state_beacon_received(prov_data.iv_index, prov_data.flags.iv_update, prov_data.flags.key_refresh);
config_server_bind(devkey_handle);
}
I followed the Light Switch example when I wrote this, so you shouldn't think anything would be wrong. What am i doing wrong since the sending of the composition data fails?
Edit 1: I am experiencing the problem again. I am still interested in hearing why the composition data get sequence would time out?