Hello,
I'm developing an application that is sending data every certain seconds in a mesh network and, in order to reduce the power consumption, I wish the node enter into sleep mode by disabling mesh by using nrf_mesh_disable(), and then wake it up again, by using nrf_mesh_enable().
I´m doing some tests before so that mesh is enabled at the beginning, until I press a button, and then, I can disable it and enter the node in sleep mode and reduce power consumption. However, when I try to wake it up again, I'm getting an "ASSERTION FAILED" error. I attach below the for loop inside my main function:
for (;;)
{
mealy_fire((mealy_t*)&temp_fsm);
NRF_LOG_FLUSH();
sd_app_evt_wait();
//If Button 1 is pressed
if(flag_int){
NRF_LOG_INFO("Button 1");
flag_int = false;
//mesh_enabled is a flag, that is initially true
if(mesh_enabled){
mesh_enabled = false;
ERROR_CHECK(nrf_mesh_disable());
}
else{
mesh_enabled = true;
ERROR_CHECK(nrf_mesh_enable());
}
}
}
Is this correct? Is there any function that is needed to be called before disabling or enabling mesh?
I wish someone could help me to disable and enable mesh in a proper way in order to reduce power consumption while no data is being sent.
I am using SDK for Mesh 2.0.1, SDK15, the nrf52832 with SD132 SoftDevice and a PCA10040 board.
Regards,
Alex