sleep() in MySensors 2.2.0
-
Hello all,
I have read about a long discussion about sleep() in MySensors with @AWI and @Yveaux discussing that for PIR sensors sleep must be used with "LOW" interrupt according to atmega328p spec. However, I did try it and it just does not work. If I change
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
to anything like
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), LOW, SLEEP_TIME);
my PIR stops working.
I cannot use smartSleep() as I have Domoticz.What's the final verdict? How sleep function has to be used please?
-
If you set it on "high"?
-
@alexsh1 it is a bug in the atmega datasheet that only certain levels can be used. Change should also work, although it might give two wakes for each trigger.
Make sure to use mySensors 2.2.x as some issues with waking from sleep by interrupts have been fixed.
-
@gohan I have not tried it. All I can say is that LOW does not work for PIRs. At least in my setup
-
@yveaux thank you!
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51