I have a set of weather sensor (rain and wind) that generate interrupts to gather rain and wind data. Every 15 minutes I send that data to my server (well or so I thought)
I put my moteino to sleep using a loop and LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF) - but by design the interrupts stop the sleep loop and I end up sleeping partially and sending data to the server depending of how many interrupts I had...
I was hoping I could figure out how many loops I missed but then the issue I'm trying to figure out if since I can't find out how much of the 8s I slept I'm pretty much not sleeping at all when it's windy.
Now for my question and with the goal of optimizing battery time:
- is there a better to organize the code flow in order to maybe alway sleep in the loop and have an external timer call my sendDataToServer at a specific interval? I looped around but could not find a way to do this since the sleep function pretty much turns off all timers
- is the only way to do this to use Extended Standby and turn on T2 so I can have a timer be called every 15min, gather the data and send it?
I have a feeling I'm overthinking this and should just go w option #2 but I'd be interested to see if anyone has a better option (without having to had a external HW clock)
thanks!
X