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

Mesh configuration - Sending composition data fails?

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?

  • Hi Søren,

    When you are handling handle_composition_data_get() on the server, what was the source address and destination address inside access_message_rx_t * p_message ? When you reply and then end up in the packet_tx I don't think it would be a problem if non_virtual_address_handle_get() returns DSM_HANDLE_INVALID . The reason is that, that address is not the dsm address list. So it's normal to get DSM_HANDLE_INVALID. But I don't think it would be a problem when sending packet. The mesh stack will just simply send the packet using the src address in the rx message data. Have you checked all the way until nrf_mesh_packet_send() inside packet_tx() ?

  • Hi Hung Bui.

    Thank you for the answer. The problem has somehow been resolved, and i am not sure how... maybe magic? I haven't made any significant changes to the code but. I flashed another program to the chip before trying again and it seems to have fixed the error.

    But thank you for the help anyway.

Related