Reducing power consumption for ble mesh sensor server node using LPN mode

Hi, 

I am using nrf mesh sdk v5.0.0 and am using sensor server model example to build our own application on top of it. SOC we are using is  nRF52832.  I have enabled the LPN mode in the example and I am also able to establish friendship with a nearby friend node. And am also receiving messages intended to the LPN node when the LPN node polls its friend node. The purpose for LPN node is to reduce battery consumption by disabling the scanner. But the device is consuming a solid 5 - 8 mA after establishing friendship. Is it possible to reduce the battery consumption in the micro amperes range. Any guidance on how to achieve it would be really great. I am also interfacing an LED, I2C sensor and a switch with the SOC. Before and after establishing friendship, I am seeing same amount of current being consumed. 

Parents
  • Hi Hariharan, 

    Could you describe how did you do the test ? How did you do provisioning ? 


    Have you tested with the LPN example with no modification ? In the example the power consumption should drop down to few uA after it provisioned and get a friendship. 

    Which current do you see exactly after you establish friendship ? Have you verified that the CPU was not being kept awake by other modules ? 

  • I am provisioning the sensor node using an ESP32(acting as a provisioner). Once the provisioning and model configuration is done, I am initiating the friendship establishment procedure. The current consumption goes as low as 150ua after establishing friendship. But it increases to 3ma after publishing data once. And it should return to low power consumption mode right? But its not. The sensor node is constantly consuming 3ma after publishing. I dont know why this is happening. Can you please guide me?

Reply
  • I am provisioning the sensor node using an ESP32(acting as a provisioner). Once the provisioning and model configuration is done, I am initiating the friendship establishment procedure. The current consumption goes as low as 150ua after establishing friendship. But it increases to 3ma after publishing data once. And it should return to low power consumption mode right? But its not. The sensor node is constantly consuming 3ma after publishing. I dont know why this is happening. Can you please guide me?

Children
  • Even if I set the upper limit for two subsequent friend poll request to 40s, it seems that the node is polling the friend continuously for every one or two seconds. Attached the screenshot of the macro used to set the polling period between two subsequent polls for your reference

  • Hi Hariharan, 

    Could you please give more detail on your observation. How did you know that the node is polling the friend node for every one or two seconds ? 
    I am curious on how you do publishing. There could be a chance that the CPU was not put to sleep after publishing. 

    Have you tried to test with our LPN example without modification ?

  • Hi Hung. 

    I am saying that the node is polling the friend node for every one or two seconds because the two events showed in the attachment are occuring and the corresponding logs are printed on the serial terminal.

    And I am curious about when this event occurs(attached in the screenshot below) in runtime?

    I am just setting the model publication state using an ESP32(provisioner) and once the model publication is set by the provisioner, a callback is called periodically for the set publish period. The CPU should be going back to sleep after publishing right? But its not. I don't know why it behaves that way. Could you please guide me if I missed anything in configuration? 

    I will try the LPN example now and get back to you shortly.

  • Hi Hariharan, 

    The LPN node is put to sleep when the mesh stack finished processing and it will return to the main loop which calls sd_app_evt_wait();
    The NRF_MESH_EVT_READY_TO_POWER_OFF event is not really related to the LPN feature of put the CPU to sleep when there is no activity. '

    It's about putting the device to POWER OFF , and you need to close down mesh stack before enter power off. So when you receive NRF_MESH_EVT_READY_TO_POWER_OFF  you can turn off the chip (System OFF , not CPU sleep) 

    I suspect that the higher power consumption may have something to do with the NRF_LOG that you are using. Is there any reason you can't use the __LOG via RTT like what we use in the LPN example ? 

  • Why do you think NRF_LOG may have something to do with higher power consumption? I am using NRF_LOG because we have developed our custom sensor board with nRf52832. We only have TX pin for logging in runtime. That's why I have used NRF_LOG.  As you will see in the video attached as URL below, current consumption goes around 150ua once friendship is established. But once sensor data is published once after model publication is set, the current consumption is in constant 3ma and above. I think the LPN node is not put to sleep after data is published once through the "app_sensor_get_cb()" callback function. Is the application is not returning back to the sd_app_evt_wait() in the main thread? Is there a chance that any interrupt is not cleared after data is published once?

    I am establishing a friendship with a friend node only after model publication is set by the provisioner. After model publication is set, the sensor node initiates the friendship procedure.

    https://www.kapwing.com/videos/63aed5592e16220088250022

Related