Hi! We got the mesh working with our custom model. however if we try to send a package multiple times it throws NRF_ERROR_NO_MEM error. Any ideas why this might happen or if there is any workaround?
Thank you!
Hi! We got the mesh working with our custom model. however if we try to send a package multiple times it throws NRF_ERROR_NO_MEM error. Any ideas why this might happen or if there is any workaround?
Thank you!
Do you know where in the code this error occurs? Which Mesh SDK version are you using? It might be that the ACCESS_MODEL_COUNT number of models is already allocated, as this link specifies.
Hi, we have been modifying the light_switch example in sdk 2.0.1, where we send a message 20 times when we press a button. The problem is that access_model_publish returns NRF_ERROR_NO_MEM 16 times out of 20 messages sent. In order to send the message we use a for loop where we send the message, as seen in the code:
for (int i = 0; i <= 19; i++) { status = send_command_client(&m_clients[0]); if (status == NRF_ERROR_INVALID_STATE || status == NRF_ERROR_NO_MEM || status == NRF_ERROR_BUSY) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Cannot send. Device is busy: 0x%08lX \r\n",status); } else { ERROR_CHECK(status); } nrf_delay_ms(50); }
We have tried to increase the delay and remove the delay, but nothing helps. The messages are sent unreliable
Any ideas why all messages can't be sent and just some of them?
Hi, we have been modifying the light_switch example in sdk 2.0.1, where we send a message 20 times when we press a button. The problem is that access_model_publish returns NRF_ERROR_NO_MEM 16 times out of 20 messages sent. In order to send the message we use a for loop where we send the message, as seen in the code:
for (int i = 0; i <= 19; i++) { status = send_command_client(&m_clients[0]); if (status == NRF_ERROR_INVALID_STATE || status == NRF_ERROR_NO_MEM || status == NRF_ERROR_BUSY) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Cannot send. Device is busy: 0x%08lX \r\n",status); } else { ERROR_CHECK(status); } nrf_delay_ms(50); }
We have tried to increase the delay and remove the delay, but nothing helps. The messages are sent unreliable
Any ideas why all messages can't be sent and just some of them?
Are you trying to send unicast or broadcast messages? Most likely the device that sends is busy with sending the messages, which is why you receive that error.
Instead of using a delay, you can send the next message when the event NRF_MESH_EVT_TX_COMPLETE is called inside the sending function. This event says that the current transmission is complete.