[time-nuts] Re: PPS on Ubuntu server 20.04 LTS

Avamander avamander at gmail.com
Sat Apr 24 07:44:56 UTC 2021


> DEVICES="/dev/ttyS0 /dev/pps0"

Specifying pps0 here is not required because gpsd is usually compiled with
the MAGIC_HAT flag which means it will always also use /dev/pps0, no way
around it other than rebuilding. Specifying it twice makes gpsd attempt to
open it twice. Probably works, but might cause some unnecessary warnings
and such.



On Sat, Apr 24, 2021 at 1:08 AM James Perkins <james at loowit.net> wrote:

> x GPS shows that the GPS serial data is being received on /dev/ttyS0 with
> reachability of 377 - so it's consistently coming in and being interpreted
> correctly by something (presumably, gpsd service); however, the x means
> that it is deemed a falseticker (inaccurate, compared to the chosen NTP
> server, 192.168.0.20). This is probably because you need to adjust the
> offset period to match the mean delay in serial data coming in from your
> serial port to be in line with other NTP servers.
>
> ppscheck is showing two events per second, the CTS event happening about
> .9784 offset relative to the system clock, and the serial data about 100ms
> later at .078. So, an offset of 0.100 would be a possible first try. The
> fact ppscheck (part of the gpsd package's set of tools) sees this means
> that gpsd was compiled with support for CTS edge detection. However, you're
> not getting any pps input at chrony at all. What are your chrony.conf
> refclock lines?
>
> For example, on my server, I'm using an adafruit Ultimate GPS Hat on a
> Raspberry Pi 4B. gpsd will recognize it as an NMEA0183 device. It provides
> serial input to /dev/ttyS0 and PPS on gpio 4. In /boot/config.txt I added:
>
> enable_uart=1
> dtoverlay=pps-gpio,gpiopin=4
>
> And rebooted. This will cause the kernel to activate the appropriate pins
> for the GPS serial input/output, and run a software timestamp driver
> (pps-gpio) which links the PPS gpio pin edge to an event on the /dev/pps0
> device.
>
> gpsd is run this way (setup in /etc/default/gpsd):
>
> START_DAEMON="true"
> USBAUTO="true"
> DEVICES="/dev/ttyS0 /dev/pps0"
> GPSD_OPTIONS="-n"
>
> And start the service:
>
> systemctl enable gpsd.service
> systemctl restart gpsd.service
>
> The 'systemctl status gpsd.service' command reveals it is running with
> parameters: gpsd -n /dev/ttyS0 /dev/pps0 . This updates NTP shared memory 0
> when the serial data becomes available (usually quite a while after PPS),
> and NTP shared memory 2 when the PPS clock edge is found.
>
> Then in /etc/chrony/chrony.conf, the big offset on the slow-to-arrive
> imprecise serial data (GPS) and the accurate PPS:
>
> refclock SHM 0 poll 3 refid GPS precision 1e-1 offset 0.5774 delay 0.2
> refclock SHM 2 poll 3 refid PPS precision 1e-7
>
> In the above, Shared memory 0 is the serial GPS source with low precision
> and 0.5774 offset. Shared memory 2 is the PPS gpio source with high
> precision (100ns precision was my ballpark guesstimate to use here, I need
> to get a better oscilloscope for further testing).
>
> Hope this example helps,
> James Perkins
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com -- To unsubscribe send
> an email to time-nuts-leave at lists.febo.com
> To unsubscribe, go to and follow the instructions there.
>




More information about the Time-nuts_lists.febo.com mailing list