02-13-2022, 07:38 PM
I know this isn't exactly RTC but I belive it is a solid alternative for those who have a GPS module. A lot of these steps are from the original blog post on photobyte.org referenced below but condensed down exactly what I needed to do.
Prerequisite:
- USB GPS Module (mine was from Amazon)
- Open Auto Pro 5 (I used 14.0)
- gpsd (OAP came with 3.17)
- Access to pi's console. Most likely through SSH or keyboard.
Step 1.
Edit gpsd's configuration in /etc/default/gpsd. Not sure why but the line containing START_DAEMON="TRUE" needs to be commented out. I scoured the web for an explanation on why but I didn't find an answer. Maybe the OS just needs to update to the latest version of gpsd. Regardless, here are the lines your config should contain:
#START_DAEMON=”true”
USBAUTO=”true”
DEVICES=”/dev/ttyACM0″
GPSD_OPTIONS=”-n”
Note: Your "Devices" option might not be /dev/ttyACM0. You can find what it is after you plug in the GPS module and run "dmesg" in console.
Step 2.
Install Chrony. This is the better NTP service that works with gpsd (default timedatectl does not).
$ sudo apt install -y chrony
Step 3.
Configure chrony to use the right gpsd interface (SHM0 in this case). Append "refclock SHM 0 offset 0.5 delay 0.2 refid " to the bottom of /etc/chrony/chrony.conf.
$ echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf
Step 4.
Restart chrony and gpsd. Easiest way to do this is to restart the pi but you should be able to just restart the services
$ sudo systemcttl restart chrony
$ sudo systemcttl restart gpsd
OR
$ sudo reboot
Step 5.
Check for a gps lock. Depending on your location and view with thet sky, it my take some time to get a fix. You can use gpsmon or cgps
$ cgps -s
OR
$ gpsmon
Step 6.
Verify chrony is using the correct GPSD interface. You should see "NMEA" on the list.
$ chronyc sources -v
References:
- Best reference google could find regarding the gpsd issue with a simple addition to chrony's config: https://photobyte.org/raspberry-pi-stret...medatectl/
- Official gpsd instructions (more in-depth and complicated but good information): https://gpsd.gitlab.io/gpsd/gpsd-time-se..._from_gpsd
Prerequisite:
- USB GPS Module (mine was from Amazon)
- Open Auto Pro 5 (I used 14.0)
- gpsd (OAP came with 3.17)
- Access to pi's console. Most likely through SSH or keyboard.
Step 1.
Edit gpsd's configuration in /etc/default/gpsd. Not sure why but the line containing START_DAEMON="TRUE" needs to be commented out. I scoured the web for an explanation on why but I didn't find an answer. Maybe the OS just needs to update to the latest version of gpsd. Regardless, here are the lines your config should contain:
#START_DAEMON=”true”
USBAUTO=”true”
DEVICES=”/dev/ttyACM0″
GPSD_OPTIONS=”-n”
Note: Your "Devices" option might not be /dev/ttyACM0. You can find what it is after you plug in the GPS module and run "dmesg" in console.
Step 2.
Install Chrony. This is the better NTP service that works with gpsd (default timedatectl does not).
$ sudo apt install -y chrony
Step 3.
Configure chrony to use the right gpsd interface (SHM0 in this case). Append "refclock SHM 0 offset 0.5 delay 0.2 refid " to the bottom of /etc/chrony/chrony.conf.
$ echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf
Step 4.
Restart chrony and gpsd. Easiest way to do this is to restart the pi but you should be able to just restart the services
$ sudo systemcttl restart chrony
$ sudo systemcttl restart gpsd
OR
$ sudo reboot
Step 5.
Check for a gps lock. Depending on your location and view with thet sky, it my take some time to get a fix. You can use gpsmon or cgps
$ cgps -s
OR
$ gpsmon
Step 6.
Verify chrony is using the correct GPSD interface. You should see "NMEA" on the list.
$ chronyc sources -v
References:
- Best reference google could find regarding the gpsd issue with a simple addition to chrony's config: https://photobyte.org/raspberry-pi-stret...medatectl/
- Official gpsd instructions (more in-depth and complicated but good information): https://gpsd.gitlab.io/gpsd/gpsd-time-se..._from_gpsd