how to wake up automatically, after deep sleeping for a couple of hours or days

10 posts / 0 new
Last post
achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-2410:56
how to wake up automatically, after deep sleeping for a couple of hours or days

hi dialog,

I want to let da14580 going into deep sleep mode for a couple of hours or days, then it wakes up automatically, how to do it with minimal energy consumed?

Peter

Device:
cosianer
Offline
Last seen:4 years 5 months ago
加入:2015-05-19 09:11
@ Peter:

@ Peter:
Generally you can wake up the device by using a Kernel timer (app_timer_set). You must create a timer_handler or use an existing handler. I use the APP_ADV_BLINK_TIMER for example. The maximal timer delay is limited by the KE_TIMER_DELAY_MAX = 30000 -> 300 seconds. I think this constant can be changed to 0xFFFF = 65535 -> 655 seconds.
I have the same problem. I like to wake up the device after hours too. In the moment, I would solve this problem by wake up the device after 655 sec. and start the Kernel timer again. This should take less time an energy.

@ Dialog team: is this a good way to realize a very long sleep interval? Or, how would you solve this? How can be solved this the best way?

Thanks!

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi achao1104, cosianer

Hi achao1104, cosianer

You can put your device in deep sleep and configure a kernel timer to wake up. But the kernel timers dont have the ability to be set in such a long time intervals such as hours or days, the kernel timers maximum value is up to approximatelly 5 minites. You will have to wake up and reset the timer. Changing the KE_TIMER_DELAY_MAX to larger values is not reccommended since its not tested and we can't guarantee a proper function. I agree that is a limitation but at the time is how the ke_timer works properly.

Thanks MT_dialog

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-2410:56
thanks, could you please

thanks, could you please provide sample of using the kernel timer with 5 minutes sleep interval?

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-2410:56
timer0 isn't suitable for

timer0 isn't suitable for this case?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi achao1104,

Hi achao1104,

Just set a kernel timer and set it in the largest value it can take (KE_TIMER_DELAY_MAX), if you want to use a hardware timer you cant go into sleep mode, once the device falls into sleep all the peripherals are powered down.

Thanks MT_dialog

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-2410:56
thanks.

thanks.

ericxiong
Offline
Last seen:2 years 3 months ago
加入:2015-08-16 08:22
嗨achao1104:

嗨achao1104:

you could use an extra variable to store how many times of 5 mins timer timed out. I also did it like your use case.

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-2410:56
but the device wakes up, and

but the device wakes up, and cost energy, though we can control whether it is going to advertise or not.

brent_zheng
Offline
Last seen:1 month 1 week ago
加入:2017-08-25 07:50
Hi, Dialog

Hi, Dialog
Can we do the same in 14585 which using timer to wakeup from deep sleep. If yes, wakeup form deepsleep will cause system reset, how can I judge whether it's wakeup from timer?