Here is my issue :I want to have a low power mesh node that can just send message to other nodes. The device can enable and disable himself the mesh stack to send message and must never listen to other node once configured. I would like to have that with the example code "light switch server", so without using the LPN experimental example. That's because we don't want to implement friends,... in or network. I work with SDK for mesh 4.0.0 and I measure the current with the PPK on a DK (and also with a multimeter on a proto, same results).
I implement that this way now :
retval = proxy_stop();
//SEGGER_RTT_printf(0, "retval_stopproxy %d\n",retval);
if (retval == NRF_SUCCESS)
retval = nrf_mesh_disable();
//SEGGER_RTT_printf(0, "mesh_disable %d\n",retval);
The node disable the mesh to get in low power mode and then enable it to send data when needed (not in the code, not the issue here). My problem is that I can't get a power consumption of 4uA. I still have +- 100 uA after proxy_stop() and mesh_disable(). What is far too much for my application. See picture below :
It looks like there is still listening or advertising packets ... How can I disable this "radio" that is still consuming more than 10mA periodically ? To get an average consumption < 10uA !
Here is the shape of the packet :
I already read many posts but solutions didn't works for me ... Here are the links :
I didn't succeed to disable the HFCLK with these lines : NRF_CLOCK->TASKS_HFCLKSTOP=1; NRF_UART0->TASKS_STOPRX= 1; (related to first link).
I believe the solution is to disable something but I don't know what and how.
Thank you very much for your help !!
I just found why the radio is still on. It is because the node was not yet provisionned ...But is there a simple way to shut down the radio totaly even if the node isn't provisionned yet ?
I think the easiest way would be to not start advertising when the node is unprovisioned.
You can do this by commenting out "ERROR_CHECK(mesh_provisionee_prov_start(&prov_start_params));" inside start(), but then again you need to run this if you want to provisioning the node at all.
Not sure why you want to disable the radio while the node is unprovioned, can you elaborate?
I want to disable the radio when the node is unprovisionned so that the node is also very low power before provisionning. The product will be powered on after production and will be in its low power state until the user provision it once he receives the device. So the purpose is that the "radio" don't use much battery capacity before and after the device is provisionned. When the user receives the device, he will push a button to start the advertising and enable BLE to provision its node. So at this moment, I can run the line you mention : ERROR_CHECK(mesh_provisionee_prov_start(&prov_start_params)).
Is there an argument in flash that I can check to see if the device is already provisioned ? That would be very useful to start the BLE directly if the device is already provisioned or don't start the BLE directly if the device is not provisioned yet.
Yes, but it isn't as straight forward.
The stack determines if the device is provisioned or not by checking if the device has a valid unicast address stored or not:
So, if you want to do it manually by looking at the hex dump of the flash, you will have to find out the location of "MESH_OPT_DSM_UNICAST_ADDR_EID" entry in the DSM flash page and see the value stored there. If that value is a valid unicast address then the device us provisioned,
I will recommend you to just use m_device_provisioned flag in your firmware application instead, as shown in all mesh examples.