ImperialSpaceSociety / picotracker-Lora

This is the code base and hardware design files for the Lora pico tracker to be flown around the world
13 stars 3 forks source link

Save the last fix of the day to EEPROM #42

Closed MedadRufus closed 3 years ago

MedadRufus commented 3 years ago

Currently, the very first fix of the day is saved to eeprom. IT saves as long as there is no position saved for the last 20 minutes. Hence at wakeup in the morning, it will save the first position.

Its useful to know the first and last position of the day and the time so that we can estimate at what solar angle it is waking up and going to sleep.

Solution is easy. As soon as position fix is succesful, save to eeprom. Then overwrite it in every subsequent position fix. If it goes to sleep, the last position fix will be saved. Just save to the location of the next save index. But increment the index after 20 minutes.