Hi,
First my setup:
Windows 10, Segger Emmbedded V4.50, nrf52840, custom board, Mesh SDK 4.0
The issue:
My device is meant to operate while plugged in to an AC power source but falls back to battery power so as to preserve the device time during a power outage. Before going to sleep, after a power outage, the device turns of proxy/mesh advertising using the below code:
if(m_device_provisioned){ err_code = proxy_stop(); if (err_code == NRF_SUCCESS){ proxy_disable(); scanner_disable(); err_code = nrf_mesh_disable(); APP_ERROR_CHECK(err_code); } }else{ mesh_provisionee_prov_listen_stop(); }
When waking up the code is as follows:
if(m_device_provisioned){ uint32_t retval = proxy_enable(); if (retval == NRF_SUCCESS){ retval = proxy_start(); } if (retval == NRF_SUCCESS){ retval = nrf_mesh_enable(); } }else{ //Restart provisioning advertisements provisionee_start(); }
This works fine if not connected to a proxy (my android phone). But if connected and a short, undetermined, length of time passes between going to sleep and awaking, an assert error is thrown when running proxy_start().
[0m<t: 762522>, proxy.c, 862, active_connection_count = 0 [0m<t: 762530>, app_error_weak.c, 115, Mesh error 18 at 0x0002933B (D:\NordicSemi\nRF5-SDK-for-Mesh/examples/common/src/mesh_adv.c:173)
I have looked at the area reported to cause the error "NRF_ERROR_CONN_COUNT < Maximum connection count exceeded" and I have confirmed, as shown in the logs above, that the active_connection_count = 0. As such, I am at a loss as to why I am getting this error.
Please help.