Hi guys,
I'm adding my own 'hello world' model to the example on element 0.
For this i've implemented a simple model;
Client sends 'Set Unreliable' with char[20] value.
Server receives and outputs this in the terminal (Segger embedded studio).
I've however encounterd a problem, i get a MESH_ASSERT and traced the problem to the following;
static bool check_tx_params(access_model_handle_t handle, const access_message_tx_t * p_tx_message, const access_message_rx_t * p_rx_message, uint32_t * p_status) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "check_tx_params publish Adress_handle: %x, model_id: %d", m_model_pool[handle].model_info.publish_address_handle, m_model_pool[handle].model_info.model_id); NRF_MESH_ASSERT(NULL != p_status); if (p_tx_message->length >= ACCESS_MESSAGE_LENGTH_MAX) { *p_status = NRF_ERROR_INVALID_LENGTH; } else if (!model_handle_valid_and_allocated(handle) || m_model_pool[handle].model_info.element_index >= ACCESS_ELEMENT_COUNT) { *p_status = NRF_ERROR_NOT_FOUND; } else if ((p_rx_message == NULL && (m_model_pool[handle].model_info.publish_appkey_handle == DSM_HANDLE_INVALID || m_model_pool[handle].model_info.publish_address_handle == DSM_HANDLE_INVALID)) || !is_valid_opcode(p_tx_message->opcode)) { *p_status = NRF_ERROR_INVALID_PARAM; __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, (p_rx_message == NULL ? "<TRUE && \n" : "<FALSE && \n")); __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, (m_model_pool[handle].model_info.publish_appkey_handle == DSM_HANDLE_INVALID ? "TRUE || \n" : "FALSE || \n")); __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, (m_model_pool[handle].model_info.publish_address_handle == DSM_HANDLE_INVALID ? "TRUE> || \n" : "FALSE> || \n")); __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, (!is_valid_opcode(p_tx_message->opcode) ? "TRUE\n" : "FALSE\n")); }
the output shows;
<t: 483632>, XXX.c, 109, XXX_client_set_unreliable <t: 483635>, XXX.c, 126, XXX_client_set_unreliable In loop b4 publish <t: 483638>, access.c, 1034, acces_model_publish() <t: 483640>, access.c, 371, packet_tx <t: 483642>, access.c, 351, <TRUE && <t: 483644>, access.c, 352, FALSE || <t: 483646>, access.c, 353, TRUE> || <t: 483648>, access.c, 354, FALSE <t: 483650>, access.c, 375, Invalid param <t: 483652>, nrf_mesh_sdk.c, 72, APP_ERROR: XXX\nrf5_SDK_for_Mesh_v1.0.1_src\examples\light_switch - Copy\client\src\main.c:448 code 7
Which tells me that m_model_pool[handle].model_info.publish_address_handle Is not being set.
Something in my client/server configuration is off...
Any ideas on where this is set exactly or where this could go wrong?
My first gues is it doesn't receive the publish addr from the server correctly, the infocenter saids:
NRF_ERROR_INVALID_PARAM | Model not bound to appkey, publish address not set or wrong opcode format. |
Also the infocenter has no articles (or i haven't found them) on how to setup the configuration - a small tutorial on how to set a model's configuration correctly would be usefull.