Sleeping Mode

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
Vesuvious911
Posts: 11
Joined: 27 Jan 2018 19:48

Sleeping Mode

Post by Vesuvious911 »

I'm confused on how sleeping mode works, more specifically waking the device. If I have a MQ2 smoke sensor and a DHT11 temperature sensor, what is the best way to send that info. Right now I have the device on ZUNO_SLEEPING_MODE_SLEEPING, I send the device to sleep at the end of the loop. However when I activate smoke sensor it does not wake up the device and send that signal. Does anyone have any tips or anything that I am missing to send these signals on activation for the smoke sensor and periodically for the temperature sensor?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Sleeping Mode

Post by PoltoS »

Z-Uno wakes up on wake up interval or on interrupt. Your sensor should wake up by interrupt
Vesuvious911
Posts: 11
Joined: 27 Jan 2018 19:48

Re: Sleeping Mode

Post by Vesuvious911 »

Mine is not waking up, not on the smoke sensor, or even a door sensor which is just connecting a pin to ground. Is this a known issue at all, or am I just doing something wrong?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Sleeping Mode

Post by PoltoS »

Please share a simplified sample code that shows that it do not work.
Vesuvious911
Posts: 11
Joined: 27 Jan 2018 19:48

Re: Sleeping Mode

Post by Vesuvious911 »

Code: Select all

#define DOORPIN 2 
byte doorValue;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);
ZUNO_SETUP_CHANNELS(ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor));
void setup() { pinMode(DOORPIN, INPUT_PULLUP);}
void loop() {
byte currentDoorValue;
currentDoorValue = digitalRead(DOORPIN);
  if (currentDoorValue != doorValue)
    {
    doorValue = currentDoorValue;
    zunoSendReport(1); 
    }
  zunoSendDeviceToSleep(); 
  }  
  byte getterDoor(void) {
  return doorValue ? 0xff : 0;
  }
So when I send the device to sleep, it never wakes up again even after I cause an interrupt with the door sensor and open or close it.
Post Reply