Raspberry Pi, chrony, and gpsd SOCKS, SHM gremlins

I’ve recently been trying out Chrony on my RPi NTP servers and have come across a strange issue.

I have 2 near identical setups, except for the main hardware, one is a Raspberry Pi 3B rev 1.2, and the other is a Raspberry Pi 3B+, rev 1.3. Other then that, the same GPS modules are used on both, the same wiring and pinout’s on the GPIO pins, and basically the same exact software settings are used on both (GPS over serial, and a PPS signal on one of the GPIO pins).

However, for some reason the RPi 3B+ gives me trouble with using SOCKs and SHM between gpsd and Chrony. With SOCKs, most of the time the GPS socket remains unreachable, PPS works fine. If I try to restart Chrony & gpsd (yes, gpsd after Chrony), sometimes it will reach the GPS socket. But a reboot later (gotta test of course), and it’s back to not reaching GPS socket. With SHM on the 3B+ board I have the reverse issue, GPS will work, PPS wont.

The regular RPi 3B board had no such problems. GPS and PPS over sockets worked right away, even after manually stopping and starting Chrony & gpsd, and even after reboots. I didn’t test SHM since sockets worked fine from the start, but I wouldn’t be surprised if it worked fine too. For now, I’m using SHM for GPS, and the direct /dev/pps0 for PPS on the RPi 3B+ model.

Anyone have any ideas as to what might be the problem?

man ldattach

Start if before GPSD and Chrony, then the kernel will create the PPS signal.

Typical: ldattach 18 /dev/ttyUSB0 (or what the device is).

In systemd start ldattach before GPSD and Chrony after GPSD.

You need to tell the kernel that the GPIO is the PPS signal but before GPSD is started. Then in GPSD you have “devices=/dev/ttyUSB0 /dev/pps0” and it should run both in SHM.

Bas.

Both the Serial port and the pin used for PPS are both setup and working correctly. I always make sure a simple cat /dev/ttyAMA0 and ppstest work correctly before even installing gpsd or ntp/chrony.

It just seems to be a random issue on the 3B+, and not on the the regular 3B. I have a 2nd 3B+ that I plan on also using as a NTP server with GPS/PPS, but currently I have it running as a SDR server till I have a better location for it, so I can’t test it with GPS/PPS for now.