spectraphilic / wasp_sketches

Waspmote sketches develoded by our group
1 stars 0 forks source link

Iridium not running (with GPS?) #47

Closed jdavid closed 5 years ago

jdavid commented 5 years ago
1549472241.432 INFO Id        : 073C10FDC337DE24 Version=J Name=iridium_test
1549472241.459 INFO Battery   : Lithium-ion (90 %)
1549472241.481 INFO Hardware  : board=none SD=1 GPS=1
1549472241.503 INFO Iridium   : fw=TA16005
1549472241.528 INFO Frames    : size=255 encryption=disabled
1549472241.559 INFO Log       : level=DEBUG output=USB, SD
1549472241.583 INFO Actions   : net=1h bat=1h gps=1h acc=1h 
1549472241.608 INFO Boot done, go to sleep
1549472241.703 DEBUG Next alarm at 00:17:00:00 in 3 minutes
1549472400.250 INFO *** Loop 1 battery=Lithium-ion (91 %)
1549472400.414 INFO ACC x=3, y=-15, z=972
1549476000.250 INFO *** Loop 2 battery=Lithium-ion (91 %)
1549476000.403 INFO ACC x=-9, y=7, z=1060
1549479600.251 INFO *** Loop 3 battery=Lithium-ion (91 %)
1549479600.403 INFO ACC x=-5, y=0, z=1053
1549483200.251 INFO *** Loop 4 battery=Lithium-ion (91 %)
1549483200.403 INFO ACC x=-3, y=-1, z=1062
1549486800.251 INFO *** Loop 5 battery=Lithium-ion (91 %)
1549486800.403 INFO ACC x=-8, y=9, z=1061
1549490400.251 INFO *** Loop 6 battery=Lithium-ion (91 %)
1549490400.404 INFO ACC x=-20, y=7, z=1078
1549494000.251 INFO *** Loop 7 battery=Lithium-ion (91 %)
1549494000.404 INFO ACC x=-24, y=0, z=1061
1549497600.251 INFO *** Loop 8 battery=Lithium-ion (91 %)
1549497600.403 INFO ACC x=-18, y=12, z=1062
1549501200.252 INFO *** Loop 9 battery=Lithium-ion (91 %)
1549501200.405 INFO ACC x=-19, y=2, z=1055
1549504800.251 INFO *** Loop 10 battery=Lithium-ion (91 %)
1549504800.403 INFO ACC x=-7, y=0, z=1068
1549508400.251 INFO *** Loop 11 battery=Lithium-ion (90 %)
1549508400.403 INFO ACC x=-16, y=0, z=1071
1549512000.251 INFO *** Loop 12 battery=Lithium-ion (90 %)
1549512000.404 INFO ACC x=-12, y=2, z=1054
1549515600.251 INFO *** Loop 13 battery=Lithium-ion (90 %)
1549515600.404 INFO ACC x=-14, y=12, z=1056
1549519200.251 INFO *** Loop 14 battery=Lithium-ion (90 %)
1549519200.402 INFO ACC x=-15, y=8, z=1062
1549522800.251 INFO *** Loop 15 battery=Lithium-ion (90 %)
1549522800.405 INFO ACC x=-22, y=6, z=1062
1549526400.251 INFO *** Loop 16 battery=Lithium-ion (90 %)
1549526400.403 INFO ACC x=-15, y=0, z=1055
1549530000.251 INFO *** Loop 17 battery=Lithium-ion (90 %)
1549530000.405 INFO ACC x=-19, y=6, z=1048
1549533600.250 INFO *** Loop 18 battery=Lithium-ion (90 %)
1549533600.401 INFO ACC x=-24, y=15, z=1029
1549537200.250 INFO *** Loop 19 battery=Lithium-ion (90 %)
1549537200.402 INFO ACC x=-14, y=10, z=1031
1549539899.250 INFO *** Loop 20 battery=Lithium-ion (90 %)
1549539899.273 INFO Loop done in 272 ms (CPU time 272 ms).
1549539899.352 DEBUG Next alarm at 00:12:00:00 in 15 minutes
jdavid commented 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.

jdavid commented 5 years ago

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.

jdavid commented 5 years ago

I've added 50ms more before powering off the SD.

jdavid commented 5 years ago

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.

jdavid commented 5 years ago

With that last fix I think we can close this issue.