Author Topic: [Bitcloud] End device sleeping  (Read 2269 times)

0 Members and 1 Guest are viewing this topic.

Offline danergo2Topic starter

  • Newbie
  • Posts: 4
  • Country: hu
[Bitcloud] End device sleeping
« on: April 20, 2016, 04:52:56 pm »
Hi guys,

I have a fairly simply question to you this time.
I'd like to make an end device with bitcloud, because this time my device needs to be battery-powered.
So I compile everything onto that, and it works okay.

However, I have some buttons in the project which obviously needs to wake up the micro. However its INT pins were needed for something else.
So I solved this by adding an AppTimer, which polls the buttons in every 50 ms, so it's very usable at this way, however:

1.) Does the micro tries to rejoin the network each time, when the apptimer wakes it up?
1.a) If yes, how can I control it to not waking up each time, but only each minute, or so?
1.b) If no, why not?


Thank you very much.
Danergo
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: [Bitcloud] End device sleeping
« Reply #1 on: April 20, 2016, 08:08:18 pm »
1.) Does the micro tries to rejoin the network each time, when the apptimer wakes it up?
If you are using a reasonably new version of the BitCloud, then it will sleep most of the time and wake up on interrupts.

But if you do explicit sleep request, then device will go into deeper sleep mode, but in this mode it will only wake up on true external interrupts or sleep timer. In this case your software timers will not run.

1.a) If yes, how can I control it to not waking up each time, but only each minute, or so?
When your software timer callback is called, device is not really fully sleeping. It wakes up every 10 ms to run software timers.

Device does not rejoin every time. It has to wake up every CS_END_DEVICE_SLEEP_TIME ms. There is a software timer just like yours that will take care of this.
Alex
 

Offline danergo2Topic starter

  • Newbie
  • Posts: 4
  • Country: hu
Re: [Bitcloud] End device sleeping
« Reply #2 on: April 21, 2016, 09:24:28 am »
Hi,

Thank you!


Quote
If you are using a reasonably new version of the BitCloud, then it will sleep most of the time and wake up on interrupts.
I'm using a 3.2.0 right now. Is it new enough? In this case, if I don't do explicit sleep request, device will sleep when it can, and wakes up for my AppTimers (and interrupts, etc), and after CS_END_DEVICE_SLEEP_TIME ms it will try rejoining to network?

Quote
if you do explicit sleep request
So,
Code: [Select]
SYS_EnableSleepWhenIdle
is not the explicit sleep request, and

Code: [Select]
ZDO_SleepReq
is the explicit one?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: [Bitcloud] End device sleeping
« Reply #3 on: April 21, 2016, 04:16:18 pm »
I'm using a 3.2.0 right now. Is it new enough?
Yes, anything that has SYS_EnableSleepWhenIdle() is new enough.

if I don't do explicit sleep request, device will sleep when it can, and wakes up for my AppTimers (and interrupts, etc),
Correct.

and after CS_END_DEVICE_SLEEP_TIME ms it will try rejoining to network?
No rejoining is necessary, device will just poll the parent to indicate that it is still there.

is not the explicit sleep request, and
....
is the explicit one?
Correct.

With SYS_EnableSleepWhenIdle() your system will wake up every 10 ms because all software timers are running from a single 10 ms hardware timer.
Alex
 

Offline danergo2Topic starter

  • Newbie
  • Posts: 4
  • Country: hu
Re: [Bitcloud] End device sleeping
« Reply #4 on: April 21, 2016, 08:35:24 pm »
Thank you very much!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf