I tried to get more accurate time from gps data using ublox module and centos but it seems gpsd.sock
does not work properly to get the data to chrony.
am I missing somthing ?
[root@info /]# cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
allow
refclock SOCK /var/run/chrony.ttyS0.sock delay 0.5 refid GPS
refclock PPS /dev/pps0 lock NMEA refid PPS prefer trust
and there is no output in the chrony sources "GPS"
[root@info /]# chronyc sources
210 Number of sources = 6
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#? GPS 0 4 0 - +0ns[ +0ns] +/- 0ns
#* PPS 0 4 0 311 -382ns[ -613ns] +/- 538ns
^- 162.159.200.1 3 8 173 17 +8684us[+8684us] +/- 71ms
[root@info /]# cat /lib/systemd/system/gpsd.socket
[Unit]
Description=GPS (Global Positioning System) Daemon Sockets
[Socket]
ListenStream=/var/run/gpsd.sock
ListenStream=0.0.0.0:2947
#SocketMode=0600
SocketMode=0755
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service
[Install]
Also=gpsd.socket
WantedBy=sockets.target
[root@info /]# cat /etc/systemd/system/multi-user.target.wants/gpsd.service
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service
[Service]
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStart=/usr/sbin/gpsd -N -G $OPTIONS $DEVICES
[Install]
WantedBy=multi-user.target
Also=gpsd.socket