# 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?

edit retag close delete

Sort by » oldest newest most voted

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)
{
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

more

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.

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

[hide preview]

## Recent blog posts

• ### Estudando Projetos do SDK 10 para nRF5x com Eclipse Oxygen (Portuguese)

Posted 2017-11-12 00:08:55 by Carlos Delfino
• ### Configurando o Eclipse Oxygen para Desenvolvimento com nRF5x (Portuguese)

Posted 2017-11-10 21:15:47 by Carlos Delfino
• ### How to use Git for embedded software development

Posted 2017-11-06 13:21:55 by Yaniv Nis
• ### Thingy:52 based Weather Station

Posted 2017-10-29 22:31:15 by Krzysztof Szewczyk
• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis

## Recent questions

• ### Issues running imported Keil project in Segger Studio

Posted 2017-11-19 08:21:24 by Nick

• ### Programming Sparkfun nRF52832 Breakout with Keil

Posted 2017-11-19 07:01:46 by Nick
• ### BLE_GAP_SEC_STATUS_DHKEY_FAILURE numeric comparison

Posted 2017-11-18 23:08:29 by Arepa