- Sun Sep 18, 2016 6:52 am
#55322
Hi guys, i am essentially having the same issue and am currently trying to work out the arduino code to turn the radio off, have the PIR trigger the radio to turn on, do processing and then turn off again. How did you go about turning of the radio but still keeping the cpu active? If the code is around i would love to see it for the below instructions.
1. turn the radio off
2. turn interrupt on for the PIR gpio
3. when the PIR interrupts:
a. turn PIR interrupt off
b. start a timer alarm to ignore any more PIR activity for n minutes
c. turn radio on - connect to AP
d. when the radio connects publish the mqtt message
e. when the mqtt message is sent
1) turn the radio off
2) turn the PIR interrupt back on
all with alarms to repeat the process over and over
Thanks