Understanding running/sleeping modes?

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
Posts: 5
Joined: 10 Jan 2017 20:35
Location: Germany (near Hamburg)

Understanding running/sleeping modes?

Post by Ralf.E »


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).

Posts: 35
Joined: 28 Dec 2016 17:56

Re: Understanding running/sleeping modes?

Post by jucs »

Hi Ralf,

1) When your sensor is in FLiRS mode, the controller can wake it up. Thus, you don't configure an interval at which the device wakes up, but simply poll whenever you want a fresh value. Of course you might want to poll regularly to log data.

However, beware that at least my Z-Uno does not work in FLiRS mode. It sends additional zero values all the time which clutter your sensor log.

2) You will probably need an external interrupt anyway since if the sensor wakes up on its own, it currently gets into an awkward state. For example, SPI and the ADCs do not work any longer. The I2C is implemented in software and does work after self wake-up.
User avatar
Posts: 6182
Joined: 26 Jan 2011 19:36

Re: Understanding running/sleeping modes?

Post by PoltoS »

Hope the table at the bottom of http://z-uno.z-wave.me/Reference/ZUNO_S ... EPING_MODE can clarify it.
Post Reply