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

Handling of errors in access_model_publish()

Hi,

like described in this post I sometimes get an error = 4 (NO_MEMORY) when calling:

error = access_model_publish(m_clients[0].model_handle, &msg);

How should this be handled? (Ignore, retry with delay, etc)

Is there a way to find out, wether the softdevice is still sending a message and therefore is not ready for the next one?

I'm using the mesh SDK 2.0.1 

Regards

Gerry

Parents Reply Children
  • Hi Hung

    BEARER_ADV_INT_DEFAULT_MS is set to 20. I didn't change any settings in nrf_mesh_config_bearer.

    GATT_PROXY is set to 0, so proxy.h is not included in my project. There's also no changes made to nrf_mesh_config_code. I use standard values and I don't use BLE.

    I only changed the settings in nrf_mesh_config_app.h. Could there be the problem?

    Here are my settings:

    SERVER_COUNT = 20

    CLIENT_MODEL_INSTANCE_COUNT = SERVER_COUNT + 1

    #define ACCESS_DEFAULT_TTL (SERVER_COUNT > NRF_MESH_TTL_MAX ? NRF_MESH_TTL_MAX : SERVER_COUNT)

    #define ACCESS_MODEL_COUNT (1 + /* Configuration client */ \
    1 + /* Health client */ \
    1 + /* Simple OnOff client (group) */ \
    2 + /* remote client */ \
    SERVER_COUNT /* Simple OnOff client (per server) */)

    #define ACCESS_ELEMENT_COUNT (1 + CLIENT_MODEL_INSTANCE_COUNT)

    #define ACCESS_SUBSCRIPTION_LIST_COUNT (ACCESS_MODEL_COUNT)

    #define ACCESS_FLASH_PAGE_COUNT (1)

    #define ACCESS_RELIABLE_TRANSFER_COUNT (ACCESS_MODEL_COUNT)

    #define DSM_SUBNET_MAX (1)
    #define DSM_APP_MAX (1)
    #define DSM_DEVICE_MAX (SERVER_COUNT) //(SERVER_COUNT)
    #define DSM_VIRTUAL_ADDR_MAX (1)
    #define DSM_NONVIRTUAL_ADDR_MAX (ACCESS_MODEL_COUNT + 1) 
    #define DSM_FLASH_PAGE_COUNT (2) 

  • You are having 21 element (21 client model) on one device ? I would suggest to test using less number of models/element on one device. Do you really need to have one client for each server ? If you have large number of server you want to control, I would suggest to use one single client and change the publication address instead. 

    Please test and verify you see the issue with stock light switch example.

  • Thanks for your answer Hung

    I think we don't really need one client per server, so I will eliminate this first and then set CLIENT_MODEL_INSTANCE_COUNT = 1. I only have to change the address using access_model_publish_address_set() when talking to the servers right? Does this affect the callbacks when receiving messages on the client also? 

  • No it shouldn't affect when you have the reply from the server. The server replies to the unicast address of the client, so should always receive it, doesn't matter which public address you currently pointing to. 

  • I changed the code to one client now, thanks for pointing this out.

    access_model_publish() still returns 4 (NO_MEM) when sending approx. 5-10 messages / Sek (8 Bytes).

    Also the assert still happens in core_tx_complete_cb_set()

    This didn't happen in SDK 1.0.0. What could be the reason for that?

Related