Closed jdavid closed 5 years ago
Here we appreciate several bugs.
(1) The line DEBUG Next alarm [..]
only appears in the last loop. This may be because just after logging that line we power off the SD; there's already a delay(100)
in SD::OFF
to give time to handle pending operations, but maybe sometimes 100ms is not enough?
(2) All loops are correctly run every hour at :00
, all but the last one which runs at :45
, so there may be a bug in how the next action is calculated.
(3) The iridium action is not run at all. After the sensors and before iridium we call the GPS action, maybe there's an issue there. But it looks more like a bug where the condition to run Iridium (and GPS?) is not satisfied.
Sending frames has a 3min timeout since the beginning of the loop , this means that if GPS and Iridium are run in the same loop, probably Iridium won't have time to do anything.
I've pushed a commit, where before starting with Iridium, it checks whether it has at least 1m30s left, otherwise it doesn't bother trying. This means that if GPS is run before probably Iridium won't run.
So Iridium should run more often than GPS. For example run GPS once a day and Iridium every 6 or 8 hours.
I've added 50ms more before powering off the SD.
Several changes have been done in this ticket.
Most important and not stated before, we have fixed the GPS with firmware J. The fix is to power off the SD before powering on the GPS, and to power on the SD after powering off the GPS.
With that last fix I think we can close this issue.