[time-nuts] Re: time-nuts Digest, Vol 201, Issue 30

Russ Ramirez russ.ramirez at gmail.com
Sat Apr 24 17:34:54 UTC 2021


James Perkins, thank-you so much for the lengthy reply. I have attached 2
more screen captures to show the chrony.conf refclock lines and the failure
of ppstest. I believe the failure of ppstest most directly indicates the
issue I am having as all the other ppstools commands run fine, I believe. I
tried to use shared memory for PPS as well as the SOCK, 1 at a time as well
as together - neither seemed to affect the ppstest result, and as such the
chronyc sources run. So I think I have to continue to diagnose why ppstest
is failing. The direction I used is documented at Ubuntu here:
https://ubuntu.com/server/docs/network-ntp

Russ

Message: 1
> Date: Fri, 23 Apr 2021 13:54:10 -0700
> From: James Perkins <james at loowit.net>
> Subject: [time-nuts] Re: PPS on Ubuntu server 20.04 LTS
> To: Discussion of precise time and frequency measurement
>         <time-nuts at lists.febo.com>
> Message-ID:
>         <CAJ2jFj7Sn6=XxxK0Cm=ukpLuAT3sDYtOq9yDY0sb=
> rLpTCCaVQ at mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> 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
>
> ------------------------------
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chrony.confrefclocks.png
Type: image/png
Size: 20611 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20210424/a04e4bec/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppstestfails.png
Type: image/png
Size: 106785 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20210424/a04e4bec/attachment-0001.png>


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