Have you ever wondered why it sometimes takes your GPS module 10-20 minutes to get a GPS fix? This post will explain why.
Each satellite sends a message every 30 seconds. This message consists of two main components;
Ephemeris data, used to calculate the position of each satellite in orbit
Almanac , which is information about the time and status of the entire satellite constellation.
Only a small portion of the Almanac is included in a GPS message. It takes 25 messages (12.5 minutes) to get the full Almanac. The full Almanac is needed before a GPS fix can be obtained. This is Time To First Fix (TTFF).
TTFF is a measure of the time required for a GPS receiver to acquire satellite signals and navigation data, and calculate a position solution (called a fix).
The above happens during a cold start, this is when the GPS module has been off for some time and has no data in its memory. A full Almanac download is required to get TTFF. If the GPS module has clear line of sight to all satellites, the shortest time for TTFF is 12.5 minutes.
In a warmstart scenario, the GPS module has valid Almanac data, is close to its last position (100km or so) and knows the time within about 20 seconds. This approximate information helps the receiver estimate the range to satellites. The TTFF for a warm start can be as short as 30 seconds, but is usually just a couple of minutes.
A receiver that has a current almanac, ephemeris data, time and position can have a hot start. A hot start can take from 0.5 to 20 seconds for TTFF.
Smarts phones use Assisted GPS (aGPS), this allows them to download the Ephemeris data and Almanac over the cell network which greatly reduces the TTFF.
The BerryGPS-IMU was used to capture the GPS coordinates as well as "attitude". No external antenna was needed as the BerryGPS-IMU includes an internal antenna.
The "attitude" would include values such as pitch, roll, direction. Some of this data you can see annotate in the image below.
Other programs can use some of this data to plot the image on a map and even show the direction of the camera at the time the image was taken. A good example of this is seen in GeoSetter
The cap has the BerryGPS-IMU sitting on top of the visor, with the Raspberry Pi sitting under the viso. Some holes where made in the visor to allow connectivity between the BerryGPS-IMU and Raspberry Pi. We also created a basic camera mount out of 3mm laser cut acrylic. M2.5 Nylon screws were used to hold everything in place.
Navit can be installed without a GPS connected to your Raspberry Pi, but you will not be able to use the real-time turn by turn navigation. You will however be able to browse maps. If you are not going to use a GPS, you can skip to the next step.
As we are using the BerryGPS-IMU, we will be following the guide in the link below. As most GPS modules use serial to communication, this guide can be followed for other GPS modules.
The images below shows how we have connected the BerryGPS-IMU to the Raspberry Pi 3 whilst it is in the SmartPi Touch case.
If you plan on testing this out in your car, you need to be mindfully of where you place your BerryGPS. In my setup and I have placed it in the air vent as shown below, and BerryGPS gets a good strong signal.
If you are using an external antenna, then there is no need to worry about where your BerryGPS is placed.
Both GPS modules use the M10478-A2 from Antenova, which is a high quality GPS module which is able to track 22 satellites and has an internal antenna. This means no external antenna is needed if the module has clear access to sky. Both feature a SuperCap to store ephemeris data for up to four hours. This and many more features are included.
Both have been specifically designed for the Raspberry Pi Zero, however they will work with any version of Raspberry Pi.
The BerryGPS-IMU also includes all the components found on the BerryIMU. And is compatible with the existing code in our repository. The BerryGPS-IMU present a lot of sensors in a very, very small package.