Hello,
I'm attempting to configure a Raspberry PI Zero as a GPS fed NTP server for my home network. During the configuration process, I've gotten stuck with the following problem (output below):
pi@raspberrypi:/usr/local/ntp/bin $ ./ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
o127.127.22.0 .kPPS. 0 l 13 16 377 0.000 -3.949 0.353
x127.127.28.0 .GPSD. 1 l 13 16 377 0.000 641.741 23.654
*128.138.140.44 .NIST. 1 u 21 64 377 13.514 -1.368 4.476
Note that my "kPPS" entry is prefaced with an "o", which I'm told is good, and my "GPSD" entry is prefaced with an "x", which I'm told is not good. The "x" before the "GPSD" entry seems to come and go; good output follows:
pi@raspberrypi:/usr/local/ntp/bin $ ./ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
o127.127.22.0 .kPPS. 0 l 6 16 377 0.000 0.002 0.005
+127.127.28.0 .GPSD. 1 l 6 16 377 0.000 494.358 56.547
*128.138.140.44 .NIST. 1 u 28 64 377 13.444 2.847 0.446
pi@raspberrypi:/usr/local/ntp/bin $
Any ideas what would cause my "GPSD" entry to switch between "x" and "+"?
I've been following How-To documents located here:
http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html
http://www.satsignal.eu/ntp/Raspberry-Pi-quickstart.html
http://www.satsignal.eu/raspberry-pi/Schmidt-RPZ-NTP-2016.pdf
http://mythopoeic.org/pi-ntp/
https://musingsfromthe8thfloor.com/2015/02/08/stratum-1-ntp-server-on-raspberry-pi/comment-page-1/#comment-28
along with a variety of forums where people are asking for and discussing configuration issues...
My GPS unit is an Adafruit Ultimate GPS, which I connected to my PI Zero using these documents:
https://learn.adafruit.com/adafruit-ultimate-gps-on-the-raspberry-pi/introduction
http://www.satsignal.eu/raspberry-pi/Schmidt-RPZ-NTP-2016.pdf
My configuration information follows:
root@raspberrypi:/usr/local/ntp/sbin# ./ntpd --version
ntpd 4.3.93@1.2483 Tue Oct 18 02:16:02 UTC 2016 (1)
root@raspberrypi:/usr/local/ntp/sbin# uname -a
Linux raspberrypi 4.4.23+ #913 Tue Oct 4 13:56:56 BST 2016 armv6l GNU/Linux
root@raspberrypi:/usr/local/ntp/sbin# ppswatch -a /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
timestamp: 1476797579, sequence: 34974, offset: 2697026
timestamp: 1476797580, sequence: 34975, offset: 2694208
timestamp: 1476797581, sequence: 34976, offset: 2699390
timestamp: 1476797582, sequence: 34977, offset: 2694572
timestamp: 1476797583, sequence: 34978, offset: 2692754
timestamp: 1476797584, sequence: 34979, offset: 2693936
timestamp: 1476797585, sequence: 34980, offset: 2694118
timestamp: 1476797586, sequence: 34981, offset: 2692301
^C
Total number of PPS signals: 8
Maximum divergence: 2699390
root@raspberrypi:/usr/local/ntp/sbin# ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1476797595.002692614, sequence: 34990 - clear 0.000000000, sequence: 0
source 0 - assert 1476797596.002691797, sequence: 34991 - clear 0.000000000, sequence: 0
source 0 - assert 1476797597.002689979, sequence: 34992 - clear 0.000000000, sequence: 0
source 0 - assert 1476797598.002691161, sequence: 34993 - clear 0.000000000, sequence: 0
^C
root@raspberrypi:/usr/local/ntp/sbin# dmesg | grep -i pps
[ 4.141313] pps_core: LinuxPPS API ver. 1 registered
[ 4.141344] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 4.160400] pps pps0: new PPS source pps.-1
[ 4.160518] pps pps0: Registered IRQ 184 as PPS source
[ 2099.460453] pps_ldisc: PPS line discipline registered
[ 2099.462264] pps pps1: new PPS source ttyAMA0
[ 2099.462367] pps pps1: source "/dev/ttyAMA0" added
root@raspberrypi:/usr/local/ntp/sbin# cat /dev/ttyAMA0
$GPGGA,133335.000,3859.3203,N,10452.4481,W,1,08,0.99,2100.4,M,-21.3,M,,*66
$GPGSA,A,3,02,03,17,19,24,28,12,06,,,,,1.30,0.99,0.84*0A
$GPGSV,3,1,09,06,72,168,17,19,66,021,26,17,50,048,15,24,42,280,20*74
$GPGSV,3,2,09,02,40,207,16,28,27,117,19,12,22,310,12,03,13,050,19*7B
$GPGSV,3,3,09,22,03,036,*46
$GPRMC,133335.000,A,3859.3203,N,10452.4481,W,1.25,194.08,181016,,,A*7B
$GPZDA,133335.000,18,10,2016,,*5F
$GPGGA,133336.000,3859.3200,N,10452.4481,W,1,08,0.99,2100.4,M,-21.3,M,,*66
$GPGSA,A,3,02,03,17,19,24,28,12,06,,,,,1.30,0.99,0.84*0A
$GPRMC,133336.000,A,3859.3200,N,10452.4481,W,1.30,190.94,181016,,,A*7E
$GPZDA,133336.000,18,10,2016,,*5C
$GPGGA,133337.000,3859.3198,N,10452.4481,W,1,08,0.99,2100.5,M,-21.3,M,,*64
$GPGSA,A,3,02,03,17,19,24,28,12,06,,,,,1.30,0.99,0.84*0A
$GPRMC,133337.000,A,3859.3198,N,10452.4481,W,1.25,187.76,181016,,,A*73
$GPZDA,133337.000,18,10,2016,,*5D
pi@raspberrypi:/usr/local/ntp/bin $ grep -v ^# /etc/ntp.conf | grep -v ^$
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server utcnist.colorado.edu prefer
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 refid kPPS
server 127.127.28.0 minpoll 4 maxpoll 4 iburst
fudge 127.127.28.0 time1 +1.105 flag1 1 refid GPSD stratum 1
root@raspberrypi:/usr/local/ntp/sbin# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
i2c-dev
pps-gpio
root@raspberrypi:/usr/local/ntp/sbin# grep -v ^# /boot/cmdline.txt
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
root@raspberrypi:/usr/local/ntp/sbin# grep -v ^# /boot/config.txt | grep -v ^$
dtparam=audio=on
enable_uart=1
dtoverlay=pps-gpio,gpiopin=24
root@raspberrypi:/usr/local/ntp/sbin# lsmod
Module Size Used by
pps_ldisc 2389 2
bnep 11853 2
bluetooth 365780 5 bnep
cfg80211 499234 0
rfkill 21397 3 cfg80211,bluetooth
evdev 11650 4
joydev 9194 0
hid_logitech_hidpp 11560 0
pegasus 17484 0
hid_logitech_dj 11567 0
snd_bcm2835 23131 1
snd_pcm 95473 1 snd_bcm2835
snd_timer 22556 1 snd_pcm
snd 68368 5 snd_bcm2835,snd_timer,snd_pcm
bcm2835_gpiomem 3823 0
bcm2835_wdt 4133 0
uio_pdrv_genirq 3718 0
uio 10230 1 uio_pdrv_genirq
pps_gpio 2993 1
pps_core 8756 4 pps_ldisc,pps_gpio
i2c_dev 6578 0
fuse 90216 3
ipv6 367607 30
root@raspberrypi:/usr/local/ntp/sbin# systemctl | grep -i gps
gpsd.service loaded active running GPS (Global Positioning System) Daemon
gpsd.socket loaded active running GPS (Global Positioning System) Daemon Sockets
root@raspberrypi:/usr/local/ntp/sbin# ping 127.127.22.0
PING 127.127.22.0 (127.127.22.0) 56(84) bytes of data.
64 bytes from 127.127.22.0: icmp_seq=1 ttl=64 time=0.369 ms
64 bytes from 127.127.22.0: icmp_seq=2 ttl=64 time=0.169 ms
^C
--- 127.127.22.0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.169/0.269/0.369/0.100 ms
root@raspberrypi:/usr/local/ntp/sbin# ping 127.127.28.0
PING 127.127.28.0 (127.127.28.0) 56(84) bytes of data.
64 bytes from 127.127.28.0: icmp_seq=1 ttl=64 time=0.338 ms
64 bytes from 127.127.28.0: icmp_seq=2 ttl=64 time=0.157 ms
^C
--- 127.127.28.0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.157/0.247/0.338/0.091 ms
root@raspberrypi:/usr/local/ntp/sbin# ufw status
Status: inactive
root@raspberrypi:/usr/local/ntp/sbin# grep ^PATH /etc/init.d/ntp
PATH=/usr/local/ntp/bin:/usr/local/ntp/sbin:/sbin:/bin:/usr/sbin:/usr/bin
root@raspberrypi:/usr/local/ntp/sbin# grep ^DAEMON /etc/init.d/ntp
DAEMON=/usr/local/ntp/sbin/ntpd
root@raspberrypi:/usr/local/ntp/sbin# ps -ef | grep -i gps
gpsd 2429 1 0 Oct17 ? 00:00:31 /usr/sbin/gpsd -N -n /dev/ttyAMA0
root 3101 3062 0 07:37 pts/1 00:00:00 grep -i gps
root@raspberrypi:/usr/local/ntp/sbin# ps -ef | grep -i ntp
ntp 2520 1 0 Oct17 ? 00:00:08 /usr/local/ntp/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111
root 3103 3062 0 07:37 pts/1 00:00:00 grep -i ntp