0

Configureing Mesh node returns ACCESS_STATUS_INVALID_MODEL?

SørenHN gravatar image

asked 2017-11-10 15:03:13 +0100

updated 2017-11-10 17:22:29 +0100

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?

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
1
thomas.stenersen gravatar image

answered 2017-11-10 15:27:32 +0100

updated 2017-11-14 16:43:38 +0100

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

edit flag offensive delete publish link more

Comments

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.

SørenHN ( 2017-11-10 17:19:25 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-11-10 15:03:13 +0100

Seen: 43 times

Last updated: nov. 14