kemonine
/
lollipopcloud
Archived
1
0
Fork 0

Update GPS docs for Adadfruit Ultimate GPS to be more reliable time source

This commit is contained in:
KemoNine 2019-01-15 12:15:09 -05:00
parent 761dda63c1
commit 1f42b89b9d
No known key found for this signature in database
GPG Key ID: 9D79FBF661EC6779
1 changed files with 39 additions and 3 deletions

View File

@ -12,15 +12,36 @@ Location fun. Tracking, logging, etc
- [http://www.catb.org/gpsd/gpspipe.html](http://www.catb.org/gpsd/gpspipe.html)
- [http://www.catb.org/gpsd/gpsd-time-service-howto.html#_feeding_chrony_from_gpsd](http://www.catb.org/gpsd/gpsd-time-service-howto.html#_feeding_chrony_from_gpsd)
- [http://thomasloughlin.com/gpspipe-gps-client/](http://thomasloughlin.com/gpspipe-gps-client/)
- [http://robotsforroboticists.com/chrony-gps-for-time-synchronization/](http://robotsforroboticists.com/chrony-gps-for-time-synchronization/)
- [https://forum.armbian.com/topic/4944-opi-zero-gps-ntpserver/](https://forum.armbian.com/topic/4944-opi-zero-gps-ntpserver/)
- [http://darethehair.net/gps_time_server.html](http://darethehair.net/gps_time_server.html)
- [https://forum.armbian.com/topic/7033-solved-orangepi-one-1-pps-ntp-server/
](https://forum.armbian.com/topic/7033-solved-orangepi-one-1-pps-ntp-server/
)
- [https://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html](https://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html)
## Hardware
The author chose the [Adafruit Ultimate GPS Breakout (link)](https://www.adafruit.com/product/746) for this guide. YMMV with other boards.
### Pinout
- Connect vcc to a 3v source on the main expansion header
- Connect gnd to a gnd on the main expansion header
- Connect tx to rx pin of uart2 on the main expansion header
- Connect rx to tx pin of uart2 on the main expaions header
- Connect pps to the PA6 pin on the main expansion header
## Setup
``` bash
armbian-config # enable hardware uarts
armbian-config # Enable hardware uart2 and pps-gpio
# System
# Hardware
# Enable uart2 option
# Enable pps-gpio option
# Save/reboot
apt install gpsd gpsd-clients python-gps gpsbabel # necessary software
systemctl stop gpsd # stop gpsd to help with testin
gpsd -n -N -D 2 /dev/ttyS2 # run gpsd by hand
@ -37,6 +58,19 @@ Edit ```/etc/default/gpsd```
## Chrony
Setup PPS for chrony
``` bash
cat >> /boot/armbianEnv.txt <<EOF
param_pps_pin=PA6
EOF
systemctl reboot
demsg | grep -i pps # Verify pps is enabled and shows in the kernel
```
Add GPS as a time source to chrony
``` bash
@ -45,12 +79,14 @@ cat >> /etc/chrony/chrony.conf <<EOF
# set larger delay to allow the NMEA source to overlap with
# the other sources and avoid the falseticker status
refclock SHM 0 refid GPS precision 1e-1 offset 0.9999 delay 0.2
refclock SOCK /var/run/gpsd.sock refid PPS
refclock PPS /dev/pps0 lock NMEA
EOF
systemctl restart chrony
cgps # look for ```Status: 3D FIX```
chronyc sources # Should see GPS and SOC1 with times for recent samples
chronyc sources -v # Should show PPS and GPS time sources as having a recent reading
chronyc tracking # Further details
```