Hello,
I want to be able to send 1 MB of data from a server node to a client node
I have made a simple model with an array that holds 300 bytes.
and upon a timer the server node will wake up and attempt to send this message 3125 times each time with different contents in the array.
At the start i was receiving NRF_ERROR_NO_MEM
and after a little bit of digging i found a post about waiting for NRF_MESH_EVT_TX_COMPLETE
So in my MeshEventCallbackHandler i wait for NRF_MESH_EVT_TX_COMPLETE and send but every 2 / 3rd time i will receive NRF_ERROR_NO_MEM
static int counter = 0; static void TriggerSending() { if(counter < 3125) { uint8_t random_data[300]; for(int j = 0; j < 300; j++) { random_data[j] = counter; } asset_check_in_server_update_on_waking(&m_server, currentTemp, occupancy, random_data); counter++; serverUpdateSent = true; } else { fullMessageSent = true; counter = 0; } } static void meshEventCallbackHandler(const nrf_mesh_evt_t * p_evt){ if(p_evt->type == NRF_MESH_EVT_TX_COMPLETE){ if(serverUpdateSent){ __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Asset Tx complete\n"); serverUpdateSent = false; if(!fullMessageSent) { TriggerSending(); } } else if(healthUpdateSent){ __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Health Tx complete\n"); ERROR_CHECK(app_timer_start(WaitAfterPublishTimer, APP_TIMER_TICKS(200), NULL)); healthUpdateSent = false; } } } } static void PublishAfterProvisioningTimer_handler(void * p_context){ __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Publish\n"); fullMessageSent = false; TriggerSending(); }
Any Help would be appreciated.
Regards,
David Hutchinson