This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[Zigbee] Sleepy end device get out of sleep in approx 10 mins

Hi everyone,

I have this question to ask. So I am trying do make an end device that run on low power. I can see that there is an example about the sleepy end device in the Zigbee and Thread SDK 4.1. So i try it and measure the current through the prolifier kit. Because i am running a NRF52833 on a custom board(just some with some io pins to use led and button), i run the code for PCA10100 on the light switch example. Then, I also modify some part of the code like delete the finding and binding part as well as pressing a button for the device to go sleepy but instead got sleepy automatically at startup. In addition, i also use the RTT log instead of the UART backend log.ut

When i first measure the power by the prolifier board version 1, it is get to 2.4uA on average, so good so far. But then, when i measure for a little longer like in 15 mins, the current start to go up to 80uA at 10-11mins i did not even start to commission the device to the coordinator. This is really weird since I keep like 90% of the code in the example. So, I have not modified any part of the code so that i can send it to you. Also, I try to not start the zigbee module and just run  __WFE() and __SEV() in the main while(1) loop and it working just fine. So i have a wild guess that there are some thing need to be done in the zigbee configuration that i miss.

Please help and reply soon, I attach the code i make with this.

Test_lowpower.zip

Best regards,

Hoang Ngoc Tu

  • Hi Torbjørn,

    Is there any update on the problem?

    Best regards,

    Tu

  • Hi Tu,

    I am sorry for the delay.

    I do not already know of any reason for the current consumption to suddenly go up after 10 minutes. I have tried to look into it to see if I could figure out why this is happening, but I have not been able to find an explanation as of yet. Are you able to turn on more logging? If you get logging from the zigbee_default_signal_handler() in zigbee_helpers.c, then you might see if the Zigbee stack generates any signal that is handled there when the current increase happens.

    I have asked our developers if they know what might be the cause of this.

    Best regards,

    Marte

  • Hi Tu,

    This might be caused by the sleep period being longer than RTC overflow, as RTC overflow is 520 seconds, which is rather close to 10 minutes. Please try to make the following changes in external/zboss/osif/zb_nrf52_timer.c:

    // In file: external/zboss/osif/zb_nrf52_timer.c
    // make two changes
    ///////////////////////////////////////////
    // Need this defines for later sleep period
    // calculations.
    // 
    // Change this block:
    #define ZB_NRF52_TIMER_VALUE    15360  /*microseconds in one beacon interval*/
    // to this block:
    #define ZB_NRF52_TIMER_VALUE      15360  /*microseconds in one beacon interval*/
    #define MS_PER_S                  1000UL /* Miliseconds in one second. */
    #define RADIO_DRIVER_RTC_OVRFLW_S 512UL  /* Time that has passed between overflow events. On full RTC speed, it occurs every 512 s. */
    #define ZB_NRF52_MAX_SLEEP_PERIOD_MS  ((RADIO_DRIVER_RTC_OVRFLW_S - 1) * MS_PER_S) /* Zigbee max sleep period to prevent RTC timer overflow. */
    ///////////////////////////////////////////
    ///////////////////////////////////////////
    // Workaround for long zigbee sleep period.
    // Sleep period longer than RTC overflow,
    // results in very short sleep scheduled,
    // waking up the CPU frequently.
    // 
    // Change this block:
    m_timer.dt        = 1000 * sleep_tmo;
    // To this block:
    /* Workaround for long zigbee sleep period.
     * Device wakes up on RTC event and scheduling sleep period
     * longer than RTC overflow (512 seconds) can result in very short sleep scheduled
     * whick wakes up CPU frequently and increases power consumptiom.
     */
    m_timer.dt        = 1000 * ((sleep_tmo > (ZB_NRF52_MAX_SLEEP_PERIOD_MS)) ? (ZB_NRF52_MAX_SLEEP_PERIOD_MS) : (sleep_tmo));
    ///////////////////////////////////////////

    Best regards,

    Marte

  • Hi Marte,

    Thank you for the reply, so as i can see the value RADIO_DRIVER_RTC_OVRFLW_S the the amount of time in second that a device is allow to sleep.Anyway, I will try it and tell you the result.

    Thank you for your help,

    Best regards,

    Tu

  • Hi Tu,

    Have you been able to test the workaround? Did it work, or are you still experiencing this issue?

    Best regards,

    Marte

Related