Understanding running/sleeping modes?
Posted: 17 Jan 2017 21:22
Hi,
I've read the Z-Uno reference and through the forum to get an understanding of the available running/sleeping modes, what features a battery powered Z-Uno may support and the sketch may look like.
I'm still somewhat unsure regarding setup() and loop().
a) With ZUNO_SLEEPING_MODE_ALWAYS_AWAKE things seem to be quite easy:
- setup() is called first just after powerup/reset
- loop() is called next and called again all the time
b) ZUNO_SLEEPING_MODE_SLEEPING seems to be the mode to use for battery powered devices with the lowest average power consumption:
- setup() is called first just after powerup/reset or when the Z-Uno wakes up
- loop() is called next and called again until the device is put into sleep mode by calling zunoSendDeviceToSleep()
- the wakeup interval (limited to 240 second increments) can be controlled by the Z-Wave controller (e.g. Z-Way, Fhem) using the WAKE_UP class
- to wakeup the device earlier the service button or an interrupt (attached to pin INT[0|1]) needs to be pressed resp. asserted
c) ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE (FLiRS) is close to ZUNO_SLEEPING_MODE_SLEEPING, but with some higher average power consumption:
- I guess it's quite the same as with the sleeping mode, but the wakeup interval is fixed to 250ms or 1s
For battery powered devices the runtime of at least loop() should be as short as possible to save battery.
Does this summarize the 3 different operation modes as intended?
Two questions I can't completely answer right now:
1) I haven't worked with a FLiRS capable device right now, but how do I control the wakeup interval?
2) For e.g. temperature or luminance measurement, the measurement interval seems to be bound to the wakeup interval or I have to provide an external interrupt (driven by some external time base).
Thanks
Ralf
I've read the Z-Uno reference and through the forum to get an understanding of the available running/sleeping modes, what features a battery powered Z-Uno may support and the sketch may look like.
I'm still somewhat unsure regarding setup() and loop().
a) With ZUNO_SLEEPING_MODE_ALWAYS_AWAKE things seem to be quite easy:
- setup() is called first just after powerup/reset
- loop() is called next and called again all the time
b) ZUNO_SLEEPING_MODE_SLEEPING seems to be the mode to use for battery powered devices with the lowest average power consumption:
- setup() is called first just after powerup/reset or when the Z-Uno wakes up
- loop() is called next and called again until the device is put into sleep mode by calling zunoSendDeviceToSleep()
- the wakeup interval (limited to 240 second increments) can be controlled by the Z-Wave controller (e.g. Z-Way, Fhem) using the WAKE_UP class
- to wakeup the device earlier the service button or an interrupt (attached to pin INT[0|1]) needs to be pressed resp. asserted
c) ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE (FLiRS) is close to ZUNO_SLEEPING_MODE_SLEEPING, but with some higher average power consumption:
- I guess it's quite the same as with the sleeping mode, but the wakeup interval is fixed to 250ms or 1s
For battery powered devices the runtime of at least loop() should be as short as possible to save battery.
Does this summarize the 3 different operation modes as intended?
Two questions I can't completely answer right now:
1) I haven't worked with a FLiRS capable device right now, but how do I control the wakeup interval?
2) For e.g. temperature or luminance measurement, the measurement interval seems to be bound to the wakeup interval or I have to provide an external interrupt (driven by some external time base).
Thanks
Ralf