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

Configureing Mesh node returns ACCESS_STATUS_INVALID_MODEL?

When configuring my Bluetooth Mesh server node to the network, it receives an error and I am not sure why.

I receive an ACCESS_STATUS_INVALID_MODEL error after having called config_client_model_app_bind() like this:

access_model_id_t model_id =
{
    .company_id = COMPANY_ID,
    .model_id = BEACON_SERVER_MODEL_ID = 0x00
};
config_client_model_app_bind(256, 0, model_id);

I have heavily based my project on the Light Switch example from the mesh SDK, and are therefore at little puzzled as to why this does not work.

Am i doing anything wrong here? And if not, could the problem be on the server instead of the client?

EDIT 1: I have tried to do some debugging on the server and found that access.c:access_handle_get() returns NRF_ERROR_NOT_FOUND.

It seems to do this because this if() statement does not return true:

if (m_model_pool[i].model_info.element_index == element_index &&
    m_model_pool[i].model_info.model_id.model_id == model_id.model_id &&
    m_model_pool[i].model_info.model_id.company_id == model_id.company_id)

I have tried to write these values to the console, don't mind the weird format.

[0]element_index: 0x0000 == 0x0000
[0]model_id: 0x0000 == 0x0000
[0]company_id: 0xFFFF == 0x0560

[1]element_index: 0x0000 == 0x0000
[1]model_id: 0x0002 == 0x0000
[1]company_id: 0xFFFF == 0x0560

[2]element_index: 0xFFFF == 0x0000
[2]model_id: 0x0000 == 0x0000
[2]company_id: 0x0000 == 0x0560

Okay, now i can see what the problem are. But where should i correct these values?

  • Hi Søren,

    Receiving ACCESS_STATUS_INVALID_MODEL from the Configuration server means that the configuration server could not find the given model on the element you addressed. Is the address of the element where your model is instantiated 256? How does your composition data look?

    From the config_server.c:handle_model_app_bind_unbind() we can see why it replies ACCESS_STATUS_INVALID_MODEL:

    uint32_t status = access_handle_get(get_element_index(p_pdu->element_address), model_id, &model_handle);
    if (status != NRF_SUCCESS)
    {
        send_generic_error_reply(handle, p_message, ACCESS_STATUS_INVALID_MODEL,
                CONFIG_OPCODE_MODEL_APP_STATUS, PACKET_LENGTH_WITH_ID(config_msg_app_status_t, sig_model));
        return;
    }
    

    EDIT:

    From your debug log, I would bet you haven't added the beacon model to the access layer with access_model_add(). The local element index in [2] is 0xFFFF and that means ACCESS_ELEMENT_INDEX_INVALID, i.e., no models has been added to it yet. From your output, it looks like you've added:

    Element 0: Configuration server (model handle 0), 
               Health Server (model handle 1)
    

    Hope this helps!

    Best,
    Thomas

  • Thank you Thomas. I have updated my question with some additional information, maybe you can help with this also?

    BTW, seeing this has given me additional inside to my other question. Now i see that when each model is addressed by its model_id which is the same for all models of the same kind, there need to bee an additional layer to distinguish between each instance of a model.

Related