Hello,
I have been trying to debug a curious behavior leading to higher energy consumption (~17mA) on my Sleepy End Device (Rx is off when idle).
I am using the nRF SDK for Zigbee v4.1, and the device is running both Bluetooth and Zigbee stacks.
I reimplemented zb_nrf52_sleep and zb_wake_up: those are only changing the state of the RNG. When I receive the Zigbee signal 15 (ZB_COMMON_SIGNAL_CAN_SLEEP), I set up a timer (app_timer_start()) to wake up in sleep_tmo milliseconds, during that time, the Zigbee event handler (zboss_main_loop_iteration) is not called.
It works well after the device joined the network (polling times are less than a second) but at some point, the polling time increases to 4254ms. After that, the power consumption is around 17mA. It seemed to me like the RX wasn't turned off and I thought maybe I am missing a packet, so I tried to reactive the RX 500ms earlier than sleep_tmo:
app_timer_start(m_zb_timer, APP_TIMER_TICKS((sleep_tmo > 4000 ? sleep_tmo - 500 : sleep_tmo)), NULL);
The first observation is that I can see there are 2 signals (15) received:
...
13:50:37.063 [0000001765:0:zigbee_manager.c:78] 261 <-- sleep_tmo
13:50:38.047 [0000001766:0:zigbee_manager.c:110] ZB signal (15, status: 0)
13:50:38.052 [0000001766:0:zigbee_manager.c:78] 721
13:50:39.059 [0000001767:0:zigbee_manager.c:110] ZB signal (15, status: 0)
13:50:39.063 [0000001767:0:zigbee_manager.c:78] 4254 <-- sleep_tmo increased
13:50:43.043 [0000001770:1:zigbee_manager.c:110] ZB signal (15, status: 0) <-- first signal, doesn't seem to make the device go back to sleep
13:50:43.051 [0000001771:0:zigbee_manager.c:110] ZB signal (15, status: 0) <-- second signal
13:50:43.056 [0000001771:0:zigbee_manager.c:78] 4992 <-- back to sleep
The second observation is that this time, the power consumption did not increase and I can keep it low (<200uA on average).
It seems like 500ms earlier is the minimum value I can use, otherwise, the trick does not work.
Does someone know how should I deal with "long" polling times?
Best,
Cyril