gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use PPS device other than /dev/pps0


From: Adam Nielsen
Subject: How to use PPS device other than /dev/pps0
Date: Tue, 4 Jan 2022 18:16:53 +1000

Hi all,

In the docs it says if /dev/ttyAMA0 is used for the GPS data, /dev/pps0
is opened automatically for PPS data.

On my Raspberry Pi, the kernel PPS driver picks up /dev/ttyAMA0 as a
serial port and makes its control signals available as /dev/pps0, which
means the GPIO I'm using for the real PPS data gets bumped to
/dev/pps1.  But sometimes when I boot, the GPIO one registers first as
/dev/pps0 and ttyAMA0 gets /dev/pps1 instead, so it's unpredictable.

To solve this I set up a udev rule to symlink the correct one to
/dev/pps-gps, and then I launched gpsd with the parameters
"/dev/ttyAMA0 /dev/pps-gps".

Everything looks fine and gpsmon is giving me PPS offset messages once
a second.

However when I link this up to ntpd via the SHM driver, it doesn't get
any PPS data.  Further investigation reveals that the SHM driver is
using both /dev/pps0 and /dev/pps1:

127.127.28.0 - GPS
127.127.28.1 - /dev/pps0
127.127.28.2 - /dev/pps1

The problem is that sometimes when I boot I should use /dev/pps0 and NTP
has to use the .1 address, but other times when I boot I need to use
/dev/pps1 and NTP has to be changed to the .2 address to work.  I don't
want to leave both .1 and .2 enabled as then I always have a failed
device in the list, which causes other issues with ntpd over time.

It would seem that I need to be able to tell gpsd to only use
/dev/pps-gps and to not open any other /dev/pps* devices.  This way I
should be able to always use the .1 address for ntpd regardless of which
actual device is in use, as gpsd would only ever be using one of the two
PPS devices.

How can I tell gpsd to only use the PPS device I specify and not to open
any other PPS devices?

Many thanks,
Adam.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]