Synchronizing the date and time of a Raspberry Pi to a GPS receiver

In case your Raspberry Pi board is not connected to the internet, the date and time of your Raspberry Pi will not be updated and may drift over time. To enable automatic updating of a Raspberry Pi “isolated” in any place , without network, you can set up an external synchronization by GPS. This solution clearly brings great accuracy!

GPS USB NMEA

Once GPS is connected to your Raspberry Pi, the following command should allow you to verify that the data are available.

The GPRMC frame format is

1 = UTC of position fix
2 = Data status (V=navigation receiver warning)
3 = Latitude of fix
4 = N or S
5 = Longitude of fix
6 = E or W
7 = Speed over ground in knots
8 = Track made good in degrees True
9 = UT date
10 = Magnetic variation degrees (Easterly var. subtracts from true course)
11 = E or W
12 = Checksum

Download GPSDATE the program using git.

if you have not already git on your Raspberry Pi, install it with the command

Install GPSDATE

Install the program from the doanload directory and typing the following commands:

Now you can use gpsdate to update your system time. Simply with the command:

For the system to be updated daily, we’ll add a command in the CRON file

Updating the system clock every day at 1:10 am, add the following line:

This article is an example of the many resources available for the Raspberry Pi and the repeater controlboard SvxLink Card (svxcard) on the site svxcard.f5uii.net

 

Sources:

2 thoughts on “Synchronizing the date and time of a Raspberry Pi to a GPS receiver

  1. Bonjour,
    J’aimerais savoir quel est le modèle du récepteur GPS compatible avec vos lignes de commande ?
    Merci

    (Translation)
    Hello,
    I would like to know which GPS receiver model is compatible with your command lines?
    Thank you

    1. Bonjour Johann,

      La date et l’heure sont extraites des trames “minimales recommandées” : GPRMC . Cette trame est générée par des GPS communiquants au format NMEA (Lien NMEA 0183 sur wikipedia).

      Salutations,
      (translation)
      Hello Johann,

      The date and time are extracted from the “minimum recommended” frames: GPRMC. This frame is generated by GPS communicating in NMEA format ( NMEA 0183 on wikipedia ).

      Regards

Leave a Reply

Your email address will not be published. Required fields are marked *