The board I'm using is a RF95 Lora M0 feather. Currently the unit wakes up transmits a single message and waits for a reply. If it gets a reply it goes into a high frequency transmission of data. If it doesn't hear back it sets an alarm in the RTC for 1 minute later and goes back to sleep.
Code: Select all
void isrRTC() {
//update the alarmtime and return to loop (which will put us to sleep again).
rtc.setAlarmTime(rtc.getHours(), (rtc.getMinutes()+SLEEPMINS)%60, (rtc.getSeconds()+SLEEPSECS)%60);
awake = false;
firstDatum = true;
messagesMissed = 0;
messagesMissedAlotment = MISSED_BEFORE_SLEEP_DOZE;
}
Anyway so far this all works pretty well.... What I wonder.... Is there any way to have a watch dog added to this that can detect if things have gone sideways at a long time interval and reset the system to ensure it continues running reliably or am I kind of no longer able to really use the watch dog because of the standby mode stuff.
I'm using the RTCZero library from here (https://github.com/arduino-libraries/RTCZero) to use the built in RTC and using the rtc.standbyMode(); along with rf95.sleep(); in order to get into my low power mode which draws about 4mA. Still wish to get that lower but I think it'll take a lot of power supply changes.