Can't get GPS/PPS to work

Gary E. Miller gem at rellim.com
Wed May 18 21:43:29 UTC 2022


Yo Philipp!

On Wed, 18 May 2022 08:13:23 +0000
Philipp Ammann via users <users at ntpsec.org> wrote:

> 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.

What version gpsd?  Compiles with, or without MAGIC_HAT?

I assume you did not read this as you skipped some steps:

https://gpsd.io/gpsd-time-service-howto.html

> The GPS module a
> run-of-the-mill (Whadda branded) uBlox Neo-7M based board.

Essentially obsolete.  It needs an exterior antenna.  What is your antenna.

> `gpsmon`
> reports "Quality: 1 / Sats: 10" so everything seems to be working
> perfectly fine here.

Good, but you should use cgps, not the unmatintained gpsmon.

> `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

No real need to use the ymlinks.

> 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
> ```

You missed the step between gpsd and ntpd.  What does ntpshmmon show you?

I prefer the new style syntax to the magix 127.xxxx tstuff:

# at the TOP
refclock shm unit 1 minpoll 4 maxpoll 4 refid PPS flag4 1

# at the BOTTOM
refclock shm unit 0 time1 -0.0900  refid GPS flag4 1 noselect

And, you neglect to mention how you start gpsd and ntpd.

> 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

Unreachable.  Thus the need to see your ntpshmmon result.

You realize that by default nptd needs more than three time sources to
do anything?

> 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
> ```

Confirming the missing additional chimers.

> 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
> ```

Sure not looking like working to me.

Try running gpsdebuginfo, as root, from here:

https://gpsd.io/gpsdebuginfo

and returning the output of that here.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/users/attachments/20220518/ec95607c/attachment.bin>


More information about the users mailing list