The satellite data, such as position, almanac and ephemeris, are lost when the device enters deep sleep or powers off. To speed up TTFF at next start up, these data can be saved to flash by calling
Gnss.saveEphemeris(). This should only be done when positioning is deactivated. i.e. after calling
Gnss.stop(). The saved data will then be automatically read and used the next time a
HOT_START is triggered. It is recommended to only do this before entering deep sleep or powering off the device to not cause unnecessary wear on the flash memory.
If no mode is specified when calling
start() the GNSS module will try to do use
HOT_START. However, if it is not possible to reuse any data it will fall back to use
COLD_START instead. This could happen if e.g. some time has passed after the data was saved since the data received from the satellite is only valid for a limited time; 2 hours for ephemeris and 90 days for the almanac.
Current time is not included in the backup data. When the module wakes up from being inactive, e.g. from the device wakes up from deep sleep, the new GPS time is calculated using the time elapsed in the Spresense RTC. At boot however, the RTC will be set to 0 so if the approximate time and date (within 60 seconds) is known to the application then it’s good to supply them before initiating a hot start. This is done using the
It might also be a good idea to set an initial position using
setPosition() if it is believed to give a better approximation than the saved data. Note that setting time and position should be done when the receiver is in idle mode, i.e. before any positioning is started.