Can't get GPS/PPS to work
Philipp Ammann
philipp.ammann at posteo.de
Wed May 18 08:13:23 UTC 2022
Hi List,
I'm trying to get ntpsec (1.2.1; running on a Raspberry Pi 4 / Gentoo)
to sync to a GPS module connected via GPIO. The GPS module a
run-of-the-mill (Whadda branded) uBlox Neo-7M based board. `gpsmon`
reports "Quality: 1 / Sats: 10" so everything seems to be working
perfectly fine here. `ppstest` also reports that everything is on order.
However, I am unable to use the GPS signal in ntpd. I have the following
devices:
* /dev/pps0
* /dev/ttyAMA0 # the GPS device
* /dev/gps0 -> /dev/ttyAMA0
* /dev/gpspps0 -> /dev/pps0
ntp.conf:
```
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntp/stats
restrict default kod limited nomodify nopeer noquery
restrict -4 127.0.0.1
restrict -6 ::1
# tried that, didn't work
#refclock pps unit 0 flag2 0 1
#refclock nmea baud 9600 path /dev/ttyAMA0 ppspath /dev/pps0
#server ptbtime1.ptb.de. iburst
#server ptbtime2.ptb.de. iburst
#server ptbtime3.ptb.de. iburst
server 127.127.20.0 minpoll 2 maxpoll 4
fudge 127.127.20.0 time1 1 refid GPS
server 127.127.22.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.22.0 refid PPS
```
I did try many variations in the config. But no matter what, I always get:
```
ntpq> peers
remote refid st t when poll reach delay offset jitter
=====================================================================
NMEA(0) .GPS. 0 l - 4 0 0.0000 0.0000 1.9531
PPS(0) .PPS. 0 l - 16 0 0.0000 0.0000 0.0002
ntpq> associations
ind assid status conf reach auth condition last_event cnt
===========================================================
1 17767 80fb yes no none reject clock_alarm 15
2 17768 8011 yes no none reject mobilize 1
```
HOWEVER it did work once (yesterday), reporting:
```
$ ntpq -p
remote refid st t when poll reach delay offset jitter
=====================================================================
*NMEA(0) .GPS. 0 l 2 4 377 0.0000 218.7745 1.5621
PPS(0) .PPS. 0 l - 16 0 0.0000 0.0000 0.0002
```
After restarting ntpd it was back to where it was before -- without
changing anything it the config. Let it run over night -- no change.
Can you guys give me any pointers as to what is going on here?
Thank you
Philipp
More information about the users
mailing list