Page 1 of 1
Sleeping Mode
Posted: 05 Apr 2018 17:05
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?
Re: Sleeping Mode
Posted: 08 Apr 2018 21:48
by PoltoS
Z-Uno wakes up on wake up interval or on interrupt. Your sensor should wake up by interrupt
Re: Sleeping Mode
Posted: 09 Apr 2018 22:46
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?
Re: Sleeping Mode
Posted: 11 Apr 2018 00:35
by PoltoS
Please share a simplified sample code that shows that it do not work.
Re: Sleeping Mode
Posted: 11 Apr 2018 19:04
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.