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

Provisioner node : Unhandled mesh event

Hi,

I'm working on sending string data over mesh by following this case, my message is printed on server side in mesh_msg_handle() function (access.c file), but I want to print it in server main.c file, from what i see in the provisioner log : Unhandled mesh event: 4, my message is not handled after handle_incoming() function. i don't understand how it works after debugging this function I'm using mesh SDK v2.0.1.

Also from what i learn in that case is that i have to do the initialization of the simple message model on both client and server side, i added that with the initialization of the on_off model but it shows error like NRF_NO_MEM on client side (No more memory available to allocate model) and NRF_FORBIDDEN on server side (multiple instances per element is not allowed), after that i tried  to replace the simple_on_off model configuration by simple_message model configuration in node_setup.c file,  but it fails and configuration of nodes won't happen.

Am I allowed to add simple message model configuration in node_setup.c file like the simple on_off model so the message can be handled?

Thank you,

Best regards

Parents Reply Children
  • Thank you for your reply, i don't understand why errors occur when i do the initialization of simple_message model with simple_on_off initialization, and this new model considered as on_off model intance that cannot be in the same element 

  • What errors are you receiving? Do you have a log that you can upload to this case?

  • I fixed the errors by increasing ACCESS_MODEL_COUNT to consider the new simple message model with the other models, the initialization of both models works (on_off and message), after that Unhandled mesh event doesn't occur, now still not able to print my message on server main.c, any idea please?

  • Does this mean that you are using the simple_on_off model in addition to the simple_message model? If so, it makes sense to increase the ACCESS_MODEL_COUNT. If you are switching out the simple_on_off model with the simple_message model, I would not increase ACCESS_MODEL_COUNT.

    You could have a callback function in main that gets called whenever a message gets sent to the server. For an example of how this is initialized & done in practice, have a look at the app_health_event_cb() in the provisioner of the light switch example in Mesh SDK v2.0.1. The app_health_event_cb function gets called in models_init_cb() inside the health_client_init() function. The handle_fault_status() function inside health_client.c handles the incoming health message, sets the event type to HEALTH_CLIENT_EVT_TYPE_FAULT_STATUS_RECEIVED & calls the event_handler() at the bottom, which happens to be the app_health_event_cb() function.

  • Yes I'am using the simple_on_off model in addition to the simple_message model and on server side I did make callback function like so : 

    and initialization in server main.c like so

    i believe there is something wrong here or related with configuration of new model, in the provisioner.c I only added this two lines in main provisioner.c to configure my new model, am i supposed to do something else ?

    /*Bind message client to App key, and configure publication key */
    ERROR_CHECK(access_model_application_bind(m_message_client.model_handle, m_dev_handles.m_appkey_handle));
    ERROR_CHECK(access_model_publish_application_set(m_message_client.model_handle, m_dev_handles.m_appkey_handle));

Related