gpsd no PPS output

232 views
Skip to first unread message

Jim Pennino

unread,
Jul 28, 2021, 1:01:07 PM7/28/21
to
Using Ubuntu 20.04.2 and gpsd 3.20.

I replaced the long running USB GPS with a serial device, reconfigured
and rebooted.

NMEA data is just fine and ppscheck works but gpsd is not processing the
PPS signal on CTS.

ppstest and ppswatch fail, xgps does not show PPS, and ntpshmmon shows
only NTP0, i.e. not NTP1 and NTP2.

I ran gpsd as a regular user with -D3 -N to look for errors but it
looked OK and was accepting PPS. ntpshmmon showed NTP2 and NTP3 and xgps
did show PPS.

Guessing it was some sort of permissions issue I had introduced over the
years, I did an apt purge gpsd, apt install gpsd and started fresh with
a reboot.

No change.

Thinking maybe apparmor was doing something, I stopped it and did a
teardown.

No change.

Now I have no clue...

Any suggestions?

chris

unread,
Jul 28, 2021, 3:03:04 PM7/28/21
to
One possibility might be that the pps is at ttl level, while a serial
post needs rs3232 +/- levels to trigger properly. You can buy ttl to
rs232 board level adapter for a few $ on Ebay, which is what i'm
using here. Single supply line, 5 or 12 v, don't remember, that you
can tap off from the host b/board...




William Unruh

unread,
Jul 28, 2021, 3:30:34 PM7/28/21
to
Although a theoretical possibility, it is highly doubtful, as most
serial cards do NOT follow the standard for rs232 ports, but will
happily use TTL levels. This has been true now for about 40 years I
believe. One problem with the adapters is that they can easily introduce
delays into the signal. They may well be inconsequential for your
purposes, and I would expect them to be on the microsecond level, but do
not know for sure.

You do need something to actually respond to the serial port interrups--
ie a serial port interrupt driver. Linux includes on


I have a "gps" script in /etc/init.d

------------------------------

#! /bin/sh
#
# gps Support for NTP i gps clock.
#
# chkconfig: 345 70 15
# description: gps is a module to read the PPS from a gps parallel port
# clock and start the shm ntp daemon to deliver the time to ntp.
#
# processname: gps

# Get config.
. /etc/sysconfig/network

# Get functions
. /etc/rc.d/init.d/functions

module="gps"
device="gps"
mode="664"
group=wheel

echo gsp $1 >>/tmp/gps

# See how we were called.
case "$1" in
start)
echo "Starting gps pps service"
modprobe pps-ldisc
ldattach 18 /dev/ttyS0
;;
stop)
echo "Stopping gps pps service"
killall ldattach
;;
status)
status ldattach
;;

restart)
$0 stop
$0 start
;;

*)
echo "gps wildcard">>/tmp/gps
gprintf "Usage: gps {start|stop|status|restart}\n "
exit 1
;;
esac

exit 0

----------------------

I do not use gpsd however.
>
>
>
>

Jim Pennino

unread,
Jul 28, 2021, 3:31:05 PM7/28/21
to
Nope, this is a RS-232 device connected to a RS-232 port and as I said,
ppscheck works fine and PPS seems to get processed if gpsd is run as an
ordinary user, but not if started by root and run as gpsd.

This is NOT a hobby device.


Jim Pennino

unread,
Jul 28, 2021, 4:31:06 PM7/28/21
to
William Unruh <un...@invalid.ca> wrote:

<snip old stuff>

> You do need something to actually respond to the serial port interrups--
> ie a serial port interrupt driver. Linux includes on
>
>
> I have a "gps" script in /etc/init.d

gpsd does all that for you and simplifies configuration, which is why
I'm using gpsd at all.

I did a modprobe check to make sure all the pps stuff was loaded; it
was.

Next is a post to the gpsd support group.

If all else fails, gpsd gets dumped and ntpd gets configured for the
NMEA interface.



chris

unread,
Jul 28, 2021, 5:18:36 PM7/28/21
to
Worth a try. It was the problem on the setup here, a s/hand 1u
time tools gps ntp server, and a micro atx motherboard running FreeBSD.
The time tools pps is ttl, as are all the other gps do boxes here, from
several vendors collected over the years. While such mismatch may
work with some interfaces, there's no guarantee, as the voltage levels
are incorrect. Even if it does work, there may be excessive jitter,
which doesn't help performance. Propagation delay using a drive chip is
only 10's of nS, havng measure it on a scope, so can be ignored.

If the only thing changed is the serial card then it's most likely
something related...

chris

unread,
Jul 28, 2021, 5:24:50 PM7/28/21
to
\
Here's the relevant fragment from ntp.conf, dcd line as pps input:

server 127.127.22.0 minpoll 2 maxpoll 2
fudge 127.127.22.0 flag2 1 flag3 1 flag4 1



William Unruh

unread,
Jul 28, 2021, 6:22:44 PM7/28/21
to
On 2021-07-28, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> William Unruh <un...@invalid.ca> wrote:
>
><snip old stuff>
>
>> You do need something to actually respond to the serial port interrups--
>> ie a serial port interrupt driver. Linux includes on
>>
>>
>> I have a "gps" script in /etc/init.d
>
> gpsd does all that for you and simplifies configuration, which is why
> I'm using gpsd at all.

Except it does not work!

>
> I did a modprobe check to make sure all the pps stuff was loaded; it
> was.

Do
cat /sys/devices/virtual/pps/pps0/assert and
cat sys/devices/virtual/pps/pps0/clear
to see if either is giving you signals once a second when the gpsd is
supposed to be servicing the interrupts.

(run each successively)
It is usually assert you want. Your gpsd might be trying to read the
clear, and it never changes.


>
> Next is a post to the gpsd support group.
>
> If all else fails, gpsd gets dumped and ntpd gets configured for the
> NMEA interface.

If all you want is the time to the nearest second then that is fine. If
you want it to better than a few tens of ms, then it is not.

>
>
>

William Unruh

unread,
Jul 28, 2021, 6:30:53 PM7/28/21
to
Nice theory. But AFAIK almost noone builds RS232 chips/booards with
follow the RS232 guidelines. I do not say noone because you may well
come up with an example, but why should they follow the standards?
Nothing else does. That standard was set about 1950, (Oops I exagerate,
it was 1960)when they were
driven by tubes.


>
> If the only thing changed is the serial card then it's most likely
> something related...

It is possible. Just as it is possible that if your car does not start,
you have to insert a crank into a little hole under the radiator and
turn it.

Jim Pennino

unread,
Jul 28, 2021, 6:46:06 PM7/28/21
to
What changed is I replaced the USB GPS with a GNSS disciplined OCXO
box which has an RS-232 interface and a specified PPS accuracy in the
nanoseconds.

It remains to be seen if it actually does nanoseconds, but the 10 MHz
+/- 0.0002 Hz output has been verified.


William Unruh

unread,
Jul 28, 2021, 6:54:14 PM7/28/21
to
Which is pretty useless for timing purposes.
Also that is one part in 10^11, and GPS is incapable of giving that.
I presume that the PPS output is once per second, and that the pulse
width is not too small (milliseconds) , or gpsd might well have trouble recogizing it as
a pulse.
>
>

chris

unread,
Jul 28, 2021, 6:58:44 PM7/28/21
to
Sorry William, but do this sort of hardware design for work and every
pc with serial ports i've seen, has some sort of level conversion to
generate the rs232 levels, or at least a negative and positive going
waveform. Might not meet the older rs232 spec and some may work
with ttl input, but that's not guaranteed. For timing applications,
it's important to avoid jitter on input transitions, so why not do
the design right, rather than bodging it ?. Might be ok for a
home hack, but not for professional work, not here anyway...

Ymmv, of course...

Jim Pennino

unread,
Jul 28, 2021, 7:01:06 PM7/28/21
to
gpsd uses the type 28 driver.

Most versions of ntpd will silently change a minpoll of 2 to 4. You can
verify with ntpq -p. If it says poll is 16, your's is one of them. The
ntp documentation for reference clocks explicitly says setting minpoll
to less than 4 is a waste of time and poll will always be 16, so setting
max poll has no effect.

YMMV


David Woolley

unread,
Jul 28, 2021, 7:01:24 PM7/28/21
to
On 28/07/2021 23:30, William Unruh wrote:
> But AFAIK almost noone builds RS232 chips/booards with
> follow the RS232 guidelines.

I think you will find they do. Line receivers are allowed a threshold
anywhere between -3V and +3V, so a threshold compatible with TTL is in
spec. I think there is also a part of the specification that requires
control lines to read OFF when the driver is powered down, which implies
the threshold is > 0.

chris

unread,
Jul 28, 2021, 7:03:44 PM7/28/21
to
I've used ex telco gps do for frequency standard work for years and they
typically have a pps offset in the 10nS range. You can even adjust the
antenna cable length to compensate. Have a look at the time nuts
mailing list for more info...




Jim Pennino

unread,
Jul 28, 2021, 7:16:07 PM7/28/21
to
William Unruh <un...@invalid.ca> wrote:
> On 2021-07-28, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>> William Unruh <un...@invalid.ca> wrote:
>>
>><snip old stuff>
>>
>>> You do need something to actually respond to the serial port interrups--
>>> ie a serial port interrupt driver. Linux includes on
>>>
>>>
>>> I have a "gps" script in /etc/init.d
>>
>> gpsd does all that for you and simplifies configuration, which is why
>> I'm using gpsd at all.
>
> Except it does not work!

Yeah, tell me about it.

It does in the general case as I have other serial systems that use gpsd
and PPS with no issue.

>> I did a modprobe check to make sure all the pps stuff was loaded; it
>> was.
>
> Do
> cat /sys/devices/virtual/pps/pps0/assert and
> cat sys/devices/virtual/pps/pps0/clear
> to see if either is giving you signals once a second when the gpsd is
> supposed to be servicing the interrupts.
>
> (run each successively)
> It is usually assert you want. Your gpsd might be trying to read the
> clear, and it never changes.

When running, gpsd takes control of /dev/pps0.

A cat of both assert and clear both give 0.000000000#0

If I run gpsd as a regular user in debug mode, I can see that it does
ouput PPS but not from the privileged shared memory segment needed for
ntp.

That says to me there is something hosed in the permissions within the
gpsd PPS processing and that it is not a signal level problem.


>> Next is a post to the gpsd support group.
>>
>> If all else fails, gpsd gets dumped and ntpd gets configured for the
>> NMEA interface.
>
> If all you want is the time to the nearest second then that is fine. If
> you want it to better than a few tens of ms, then it is not.

Well, since the 4 machines with a USB GPS all show an average error of
about 1.5 milliseconds with a standard deviation of about 0.5
milliseconds and the other PPS machine shows an average error of about
2 microseconds with a standard deviation of about 150 microseconds,
the time accuracy on the network appears to be OK.

This new device is a GNSS disciplined OCXO in a 4"X4"X2" high box which
will supposedly give me nanoseconds if I can get PPS working on that system.

The 10 MHz +/- 0.0002 Hz frequency reference output seems to be working
OK, so if I could get PPS to work with gpsd...


Jim Pennino

unread,
Jul 28, 2021, 7:31:05 PM7/28/21
to
True, but it is just fine and dandy for calibrating frequency counters
without having to send them somewhere and it allows testing of radio
dial accuracy no matter the state of the ionosphere.

> Also that is one part in 10^11, and GPS is incapable of giving that.
> I presume that the PPS output is once per second, and that the pulse
> width is not too small (milliseconds) , or gpsd might well have trouble recogizing it as
> a pulse.

This is a commercial box sold specifically as a time and frequency
standard and purchased because it's specifications are only a bit worse
than a rubidium standard and about $600 cheaper.

I have already verified that gpsd CAN recognize the PPS on CTS, but NOT
running with the permissions that it needs to feed ntp.



Jim Pennino

unread,
Jul 28, 2021, 7:46:06 PM7/28/21
to
chris <chris-...@tridac.net> wrote:

<snip old stuff>


> I've used ex telco gps do for frequency standard work for years and they
> typically have a pps offset in the 10nS range. You can even adjust the
> antenna cable length to compensate. Have a look at the time nuts
> mailing list for more info...


I bought this thing because I was interested in the state of the art of
affordable devices.

I am well past the point in my life when I would haunt surplus stores
looking for treasure. I might violate that if I find a good source of
really cheap wave guide.


chris

unread,
Jul 28, 2021, 7:57:23 PM7/28/21
to
Interesting, as some serial device chips have internal hardware locking
between some of the control functions. I used the dcd line for the
system here, which was fine, but haven't tested with the cts line...




>

chris

unread,
Jul 28, 2021, 7:59:37 PM7/28/21
to
Ignore above but how about permissions on the serial device itself ?...


chris

unread,
Jul 28, 2021, 8:02:51 PM7/28/21
to
Depends on the item, but have more or less equipped the lab here with
older high end test gear, even some parts / repair. Trade time against
money. Never get tired of just making stuff work...



Jim Pennino

unread,
Jul 28, 2021, 9:16:22 PM7/28/21
to
chris <chris-...@tridac.net> wrote:

<snip old stuff>

>
> Ignore above but how about permissions on the serial device itself ?...

The problem seems to be permissions related to shared memory segments.

Jim Pennino

unread,
Jul 28, 2021, 9:16:25 PM7/28/21
to
The inducement here is that while GPS disciplined oscillators are very
old technology which used to live in 19" 5U rack mount boxes and cost
tens of thousands of dollars, they now consist of some chip sets on a
circuit board in a 4"X4"X2" high box and costs about $180 with shipping.


Jim Pennino

unread,
Jul 28, 2021, 9:16:27 PM7/28/21
to
There are no "serial device chips", there is a commercial PCI interface
board specified to work as RS-232 ports with full hardware handshake.


William Unruh

unread,
Jul 28, 2021, 11:38:52 PM7/28/21
to
But those "PCI interface board" contains "serial device chips"
>
>

Miroslav Lichvar

unread,
Jul 29, 2021, 3:31:06 AM7/29/21
to
On 2021-07-28, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> ppstest and ppswatch fail, xgps does not show PPS, and ntpshmmon shows
> only NTP0, i.e. not NTP1 and NTP2.
>
> I ran gpsd as a regular user with -D3 -N to look for errors but it
> looked OK and was accepting PPS. ntpshmmon showed NTP2 and NTP3 and xgps
> did show PPS.

How exactly is gpsd started? With the serial device specified on its
command line, or is it added only later by gpsdctl (via udev+systemd)
when gpsd already dropped the root privileges?

--
Miroslav Lichvar

David Woolley

unread,
Jul 29, 2021, 7:47:09 AM7/29/21
to
On 29/07/2021 00:03, chris wrote:
>
> I've used ex telco gps do for frequency standard work for years and they
> typically have a pps offset in the 10nS range

Offset relative to what? Do you have an atomic clock that is traceable
to UTC?

The official GPS time transfer accuracy is <= 40ns, so whilst 10ns may
be achievable most of the time, it isn't guaranteed.

Jim Pennino

unread,
Jul 29, 2021, 10:01:07 AM7/29/21
to
Yes, they also contain capacitors, resistors, crystals, etc.

An interface board is a commercial item with a specification, i.e. the
board is specified to work in a PCI slot, provide RS-232 ports that have
standard connectors with full hardware handshaking and work with all
native OS serial drivers.

Since the board obviously works to specification, obsessing to what may
or may not be happening at the chip level seems to me to be pointless.


Jim Pennino

unread,
Jul 29, 2021, 10:01:08 AM7/29/21
to
It is started by systemd with the options in /etc/default/gpsd which
are:

# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"

DEVICES="/dev/ttyS4 /dev/pps0"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n -b -s9600 "
GPSD_SOCKET=/var/run/gpsd.socket

So a ps shows:

gpsd 1483 1 0 Jul28 ? 00:00:52 /usr/sbin/gpsd -n -b -s9600 /dev/ttyS4 /dev/pps0

Miroslav Lichvar

unread,
Jul 29, 2021, 10:54:40 AM7/29/21
to
On 2021-07-29, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> So a ps shows:
>
> gpsd 1483 1 0 Jul28 ? 00:00:52 /usr/sbin/gpsd -n -b -s9600 /dev/ttyS4 /dev/pps0

Is that /dev/pps0 necessary? IIRC that is needed only when gpsd cannot
create the PPS device on its own (similarly to ldattach). If it is
needed, is gpsd started when it already exists?

--
Miroslav Lichvar

Jim Pennino

unread,
Jul 29, 2021, 11:46:05 AM7/29/21
to
I do not know if it is "needed" and /dev/pps0 is indeed created by gpsd
as it did not exist until the first time I started gpsd with the serial
interface configuration.

OK, I killed gpsd and /dev/pps0 went away.

I commented pps0 out of the file, restarted gpsd and /dev/pps0 came
back, so I guess it really isn't needed and does nothing.

Still nothing but NTP0 from ntpshmmon.

sudo ntpshmmon
ntpshmmon: version 3.20
# Name Seen@ Clock Real L Prc
sample NTP0 1627572530.002686133 1627572530.002587625 1627572530.000031780 0 -20
sample NTP0 1627572531.002298509 1627572531.002285618 1627572531.000030611 0 -20
sample NTP0 1627572532.003058043 1627572532.002332397 1627572532.000029441 0 -20
^C

sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
^C

sudo ppscheck /dev/ttyS4
# Seconds nanoSecs Signals
1627572707.885746295 TIOCM_CTS
1627572707.985778695
1627572708.885715568 TIOCM_CTS
1627572708.985741009
1627572709.885677623 TIOCM_CTS
1627572709.985701097
^C

chris

unread,
Jul 29, 2021, 12:11:32 PM7/29/21
to
Depending on the chip id, some functions may be inhibited if the control
lines are in the wrong state. So yes, chip hardware architecture does
matter and not always something that can be abstracted away within the
device driver. Devil is in the detail, as usual...




chris

unread,
Jul 29, 2021, 12:21:10 PM7/29/21
to
Yes, they do, but they are unlikely to have the phase noise figures of
a better quality unit, nor short term stability. In fact some gpsdo
are using cheap dil vcxo's that that are not even ovenised and wander
all over the place.

Lower cost units should be good enough for ntp use, even if not good
enough for a primary frequency standard...



chris

unread,
Jul 29, 2021, 12:38:22 PM7/29/21
to
On 07/29/21 12:47, David Woolley wrote:
> On 29/07/2021 00:03, chris wrote:
>>
>> I've used ex telco gps do for frequency standard work for years and they
>> typically have a pps offset in the 10nS range
>
> Offset relative to what? Do you have an atomic clock that is traceable
> to UTC?

For telco use, they do need the accuracy for gsm cell sync reasons and
it is quite a tight spec. Have run a couple of HP types for years, the
Z3815 and Z3816 and the HP utility that drives that reports nS
offset from UTC. Perhaps the absolute time is not as important as the
cell to cell sync accuracy, but don't have data on that. As I said,
there's even a function in the utility to adjust delay in the coax
line to the antenna, so they are trying to get well within any
theoretical limits...

Jim Pennino

unread,
Jul 29, 2021, 12:46:10 PM7/29/21
to
chris <chris-...@tridac.net> wrote:

<snip old stuff>

> Depending on the chip id, some functions may be inhibited if the control
> lines are in the wrong state. So yes, chip hardware architecture does
> matter and not always something that can be abstracted away within the
> device driver. Devil is in the detail, as usual...

Yeah, so?

The card obviously works to specification, i.e. RS-232 and it does see CTS.

If it did not work to specification, I would return the card to the
vendor and buy a different one.

chris

unread,
Jul 29, 2021, 12:58:57 PM7/29/21
to
This is hard work, obviously never designed any hardware, nor written
code for it. While the card may very well meet spec, the spec can't
cover all the myriad cases of operation or use.The spec is often
generalised, to allow some slack in component selection and to take
account of advances in the art, but it's the corner cases that can
catch out the unwary...




Jim Pennino

unread,
Jul 29, 2021, 1:01:10 PM7/29/21
to
Noise figure of what, exactly?

The box has specifications.

If the box does not meet the specifications, the box will be returned to
the vendor.

The box is specified to be a GNSS disciplined OCXO with some very tight
specifications for short and long term stability.

None of this addresses the gpsd issue.


Jim Pennino

unread,
Jul 29, 2021, 1:31:05 PM7/29/21
to
Do you understand the difference between DIY and purchasing a commercial
product sold to thousands upon thousands if not millions of purchasers?

Do you understand that RS-232 is many decades old and is specified by
TIA-232-F Interface Between Data Terminal Equipment and Data
Circuit-Terminating Equipment Employing Serial Binary Data Interchange,
issued in 1997?

The box and the card are both RS-232.

The card and box combination obviously works.

None of this has ANYTHING to do with the issue of gpsd.


chris

unread,
Jul 29, 2021, 4:16:38 PM7/29/21
to
That's just the spec for the signals on the wires, nothing to do
with how that is implemented inside devices, or on your pc card,
which may be implemented in many different ways, from bit banging
to fully integrated devices with buffering and even some
intelligence. It only affects your low cost gpsd if you can't
make it work, and need to dig into why it doesn't work...




Jim Pennino

unread,
Jul 29, 2021, 6:31:07 PM7/29/21
to
1) I no more care how the manufacturer inplemented what is inside the
box or on the PC card than I care what kind of steel was used to make
the exhaust manifold on my car.

2) The box is low cost compared to the tens of thousands of dollars such
things used to cost.

3) If the box doesn't work, it goes back for a refund. I have no
interest in fixing things with a warrenty.

4) It is blazingly obvious to anyone paying the slightest bit of
attention that the problem is in software, i.e. gpsd, and not the box.

William Unruh

unread,
Jul 29, 2021, 7:08:28 PM7/29/21
to
That is of course completely irrelevant. The same could be said of an aluminum
spoon (cost mcuch more than a gold spoon), and yet it would still not be most people's first choice for
tableware.

> Thank you for your suggestions. I always notice the host name part of the prompt string, which is different from each other for the test case discussed here, when I'm on different hosts.
>
> 3) If the box doesn't work, it goes back for a refund. I have no
> interest in fixing things with a warrenty.

But then as point 4 says, you do not know if it is the box or some
misconfiguration (the wetware behind the keyboard) or a bug in gpsd.

>
> 4) It is blazingly obvious to anyone paying the slightest bit of
> attention that the problem is in software, i.e. gpsd, and not the box.

And yet, you also have been cogitating about the possibility that the
serial port (either on the box or on the computer) does not satisfy the RS232 standards, which is hardware

How about trying the direct use of ldattach, instead of using gpsd, to
see if you can get that to work. If it does, and gpsd does not then your
hypothesis that gpsd is at fault is born out. Then you can decide
whether it is better to suffer the slings and arrows of debugging gpsd,
or with one fell swoop use ldattach and have a working system.


>

Jim Pennino

unread,
Jul 29, 2021, 8:47:00 PM7/29/21
to
At one time the cost of aluminum was much higher than gold...

>
>> Thank you for your suggestions. I always notice the host name part of the prompt string, which is different from each other for the test case discussed here, when I'm on different hosts.
>>
>> 3) If the box doesn't work, it goes back for a refund. I have no
>> interest in fixing things with a warrenty.
>
> But then as point 4 says, you do not know if it is the box or some
> misconfiguration (the wetware behind the keyboard) or a bug in gpsd.

Point 4 says I DO know the problem is in gpsd.

>>
>> 4) It is blazingly obvious to anyone paying the slightest bit of
>> attention that the problem is in software, i.e. gpsd, and not the box.
>
> And yet, you also have been cogitating about the possibility that the
> serial port (either on the box or on the computer) does not satisfy the RS232 standards, which is hardware
>

No, I have not, that is someone else fixating on that. That was settled
as far as I am concerned before I made the first post.

> How about trying the direct use of ldattach, instead of using gpsd, to
> see if you can get that to work. If it does, and gpsd does not then your
> hypothesis that gpsd is at fault is born out. Then you can decide
> whether it is better to suffer the slings and arrows of debugging gpsd,
> or with one fell swoop use ldattach and have a working system.

That gpsd has some sort of issue is well established at this point.

Any further debugging of gpsd will be done with the gpsd support list.



William Unruh

unread,
Jul 29, 2021, 10:40:27 PM7/29/21
to
On 2021-07-30, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> William Unruh <un...@invalid.ca> wrote:
>>>
>>> 2) The box is low cost compared to the tens of thousands of dollars such
>>> things used to cost.
>>
>> That is of course completely irrelevant. The same could be said of an aluminum
>> spoon (cost mcuch more than a gold spoon), and yet it would still not be most people's first choice for
>> tableware.
>
> At one time the cost of aluminum was much higher than gold...

Yes. Precisely. You are the one claiming that because prices are cheaper
now, it means something about the quality of the object for the purpose.

>> But then as point 4 says, you do not know if it is the box or some
>> misconfiguration (the wetware behind the keyboard) or a bug in gpsd.
>
> Point 4 says I DO know the problem is in gpsd.

No.

Why do you feel that you know that the problem is gpsd? You have tested
the interrupt handling with other programs (lets say like ldattach)? Not
that you have given any indication of. You simply say "it is obvious"
Unfortunately I have seen far far to many instances in wich someone says
"it is obvious" and they turned out to be entirely wrong.


>
>>>
>>> 4) It is blazingly obvious to anyone paying the slightest bit of
>>> attention that the problem is in software, i.e. gpsd, and not the box.
>>
>> And yet, you also have been cogitating about the possibility that the
>> serial port (either on the box or on the computer) does not satisfy the RS232 standards, which is hardware
>>
>
> No, I have not, that is someone else fixating on that. That was settled
> as far as I am concerned before I made the first post.
>
>> How about trying the direct use of ldattach, instead of using gpsd, to
>> see if you can get that to work. If it does, and gpsd does not then your
>> hypothesis that gpsd is at fault is born out. Then you can decide
>> whether it is better to suffer the slings and arrows of debugging gpsd,
>> or with one fell swoop use ldattach and have a working system.
>
> That gpsd has some sort of issue is well established at this point.

Proof by blatant assertion is always a very poor argument.

Since ldattach is a stadard part of linux, and since the use of it is
trivial, your blind refusal to test is pretty suspicious.

>
> Any further debugging of gpsd will be done with the gpsd support list.

And here I thought that the purpose was to get your time working, not to
debug gpsd. Oh well, sorry.

>
>
>

Jim Pennino

unread,
Jul 29, 2021, 11:16:06 PM7/29/21
to
William Unruh <un...@invalid.ca> wrote:
> On 2021-07-30, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>> William Unruh <un...@invalid.ca> wrote:
>>>>
>>>> 2) The box is low cost compared to the tens of thousands of dollars such
>>>> things used to cost.
>>>
>>> That is of course completely irrelevant. The same could be said of an aluminum
>>> spoon (cost mcuch more than a gold spoon), and yet it would still not be most people's first choice for
>>> tableware.
>>
>> At one time the cost of aluminum was much higher than gold...
>
> Yes. Precisely. You are the one claiming that because prices are cheaper
> now, it means something about the quality of the object for the purpose.

I have never said anything like that.

What I did say was that I was interested in what such a device could do
compared to the older stuff that cost two orders of magnitude more money
new and still cost a magnitude more on the surplus market as well as
taking up 5U in a 19 inch rack.


>>> But then as point 4 says, you do not know if it is the box or some
>>> misconfiguration (the wetware behind the keyboard) or a bug in gpsd.
>>
>> Point 4 says I DO know the problem is in gpsd.
>
> No.
>
> Why do you feel that you know that the problem is gpsd?

If you actually read and understood what I wrote, you would know why.

> You have tested
> the interrupt handling with other programs (lets say like ldattach)? Not
> that you have given any indication of. You simply say "it is obvious"
> Unfortunately I have seen far far to many instances in wich someone says
> "it is obvious" and they turned out to be entirely wrong.

It is obvious from what gpsd and related programs do that CTS gets
through the plug and to the computer.

What is not obvious is why gpsd does not forward PPS through the shared
memory segment.

>>>> 4) It is blazingly obvious to anyone paying the slightest bit of
>>>> attention that the problem is in software, i.e. gpsd, and not the box.
>>>
>>> And yet, you also have been cogitating about the possibility that the
>>> serial port (either on the box or on the computer) does not satisfy the RS232 standards, which is hardware
>>>
>>
>> No, I have not, that is someone else fixating on that. That was settled
>> as far as I am concerned before I made the first post.
>>
>>> How about trying the direct use of ldattach, instead of using gpsd, to
>>> see if you can get that to work. If it does, and gpsd does not then your
>>> hypothesis that gpsd is at fault is born out. Then you can decide
>>> whether it is better to suffer the slings and arrows of debugging gpsd,
>>> or with one fell swoop use ldattach and have a working system.
>>
>> That gpsd has some sort of issue is well established at this point.
>
> Proof by blatant assertion is always a very poor argument.

And also proved though discourse with people knowledgeable with gpsd.

> Since ldattach is a stadard part of linux, and since the use of it is
> trivial, your blind refusal to test is pretty suspicious.

Since my major interest is in getting gpsd to work, it is irrelevant as
gpsd takes care of such things.

>> Any further debugging of gpsd will be done with the gpsd support list.
>
> And here I thought that the purpose was to get your time working, not to
> debug gpsd. Oh well, sorry.

The original post was to attempt to find out why ntpd was not working.

That evolved into discovering that ntpd doesn't work because gpsd has
either a bug or a configuration issue.


Jim Pennino

unread,
Jul 31, 2021, 10:31:06 AM7/31/21
to
Jim Pennino <ji...@gonzo.specsol.net> wrote:

It turns out there is a kernel bug in Ubuntu 5.4.0-80-generic which
breaks PPS processing.

The net result is that an application that looks at /dev/ttySx will have
no issues and will see CTS being asserted but anything that looks at
/dev/ppsx will fail.

According to Focal, a kernel update is imminent...


William Unruh

unread,
Jul 31, 2021, 12:47:12 PM7/31/21
to
Do you have a reference for this-- eg a URL?

Jim Pennino

unread,
Jul 31, 2021, 3:46:05 PM7/31/21
to
William Unruh <un...@invalid.ca> wrote:
> Do you have a reference for this-- eg a URL?

A reference for the kernel bug?

No, this was determined by downloading source for various GPS utility
programs and running them under a debugger noting where the failure
occured and seeing that it always happened in a ppsapi routine.

And yes, the kernel says all the pps related modules are loaded.

William Unruh

unread,
Jul 31, 2021, 4:49:29 PM7/31/21
to
On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> William Unruh <un...@invalid.ca> wrote:
>> Do you have a reference for this-- eg a URL?
>
> A reference for the kernel bug?
>
> No, this was determined by downloading source for various GPS utility
> programs and running them under a debugger noting where the failure
> occured and seeing that it always happened in a ppsapi routine.

So you reported the bug? What is the bug report then.
What was the "failure"?
Note that the pps driver is highly time sensative, and a debugger could
upset that, and report bug which is due to the interaction with the
debugger.

Jim Pennino

unread,
Jul 31, 2021, 5:16:07 PM7/31/21
to
William Unruh <un...@invalid.ca> wrote:
> On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>> William Unruh <un...@invalid.ca> wrote:
>>> Do you have a reference for this-- eg a URL?
>>
>> A reference for the kernel bug?
>>
>> No, this was determined by downloading source for various GPS utility
>> programs and running them under a debugger noting where the failure
>> occured and seeing that it always happened in a ppsapi routine.
>
> So you reported the bug? What is the bug report then.

As there is an immenent kernel update, I didn't bother.

If the update doesn't fix the issue, then I will consider a bug report
for that kernel.

> What was the "failure"?
> Note that the pps driver is highly time sensative, and a debugger could
> upset that, and report bug which is due to the interaction with the
> debugger.

I have been writiting and debugging software since mid 1970 and do have
some idea of how it is done, but thank you for your comments.

Quiz of the day: What does "RT" in RT-11 stand for?


William Unruh

unread,
Jul 31, 2021, 5:58:21 PM7/31/21
to
On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> William Unruh <un...@invalid.ca> wrote:
>> On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>>> William Unruh <un...@invalid.ca> wrote:
>>>> Do you have a reference for this-- eg a URL?
>>>
>>> A reference for the kernel bug?
>>>
>>> No, this was determined by downloading source for various GPS utility
>>> programs and running them under a debugger noting where the failure
>>> occured and seeing that it always happened in a ppsapi routine.
>>
>> So you reported the bug? What is the bug report then.
>
> As there is an immenent kernel update, I didn't bother.

Kernels are updated for many reasons, and there seems to be no reason
why it would fix this particular bug if noone had ever reported it.

And are you sure that the evidence for this bug is not there in many of
the kernel versions? Ie, it could be a peculiarity of your own system
rather than being generic.

You were originally completely sure that this was a bug in gpsd. Now it
is a kernel bug.

Jim Pennino

unread,
Jul 31, 2021, 6:31:07 PM7/31/21
to
William Unruh <un...@invalid.ca> wrote:
> On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>> William Unruh <un...@invalid.ca> wrote:
>>> On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>>>> William Unruh <un...@invalid.ca> wrote:
>>>>> Do you have a reference for this-- eg a URL?
>>>>
>>>> A reference for the kernel bug?
>>>>
>>>> No, this was determined by downloading source for various GPS utility
>>>> programs and running them under a debugger noting where the failure
>>>> occured and seeing that it always happened in a ppsapi routine.
>>>
>>> So you reported the bug? What is the bug report then.
>>
>> As there is an immenent kernel update, I didn't bother.
>
> Kernels are updated for many reasons, and there seems to be no reason
> why it would fix this particular bug if noone had ever reported it.

And as the update is immenent, I think it makes little to no difference
if I wait until the release. And, no I did not search through the bugs
data base. You may do so if you wish.

> And are you sure that the evidence for this bug is not there in many of
> the kernel versions? Ie, it could be a peculiarity of your own system
> rather than being generic.

Does the id of the kernel, i.e. 5.4.0-80-generic, give you a clue?

> You were originally completely sure that this was a bug in gpsd. Now it
> is a kernel bug.

No, I was originally sure the bug had something to do with gpsd, which
does not necessarily mean IN gpsd. The real WTF moment came when I
discovered ntpd does not work either for reasons that should be obvious
now.

And finally, to further beat this dead horse to ribbons, I have also
found some issues with apparmor for both gpsd and ntpd.

And before you even ask, put apparmor in complain for gpsd and ntpd to
see if you are effected.

>>
>> If the update doesn't fix the issue, then I will consider a bug report
>> for that kernel.
>>
>>> What was the "failure"?
>>> Note that the pps driver is highly time sensative, and a debugger could
>>> upset that, and report bug which is due to the interaction with the
>>> debugger.
>>
>> I have been writiting and debugging software since mid 1970 and do have
>> some idea of how it is done, 5.4.0-80-genericbut thank you for your comments.
>>
>> Quiz of the day: What does "RT" in RT-11 stand for?

Question too tough for you?

Here's another: What is the response if you type who on the terminal of
a RT-11 machine?


chris

unread,
Jul 31, 2021, 7:52:17 PM7/31/21
to
On 07/31/21 22:11, Jim Pennino wrote:
>
> Quiz of the day: What does "RT" in RT-11 stand for?
>
>

Real Time, RT11, an early operating system for dec pdp11. It
was a single tasking / forground background os that was good
for real time control and quite lightweight.

Spent quite a few years programming macro under RT11 and RSX...




Miroslav Lichvar

unread,
Aug 2, 2021, 6:23:24 AM8/2/21
to
On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
> It turns out there is a kernel bug in Ubuntu 5.4.0-80-generic which
> breaks PPS processing.
>
> The net result is that an application that looks at /dev/ttySx will have
> no issues and will see CTS being asserted but anything that looks at
> /dev/ppsx will fail.

I think that is expected if you have the PPS signal connected to CTS.
AFAIK the kernel PPS serial driver works only with DCD.

gpsd supports the kernel PPS and also (a much less precise) user-space
PPS if the kernel PPS does not work.

However, I'm not sure why it worked for you only when started directly
from command line. It might help if we could compare the gpsd debug
output or strace output in both cases.

--
Miroslav Lichvar

chris

unread,
Aug 2, 2021, 8:28:53 AM8/2/21
to
The dcd line is what I used, as that is what was specified for
ntpd under FreeBSD. It provides a local microsecond sync, as the
following shows:


root@ntp-host:~ # ntpq -pn
remote refid st t when poll reach delay offset jitter
====================================================================
o127.127.22.0 .PPS. 0 l 5 8 377 0.000 0.002 0.001
+192.9.200.168 .GPS. 1 u 23 64 377 0.168 0.004 0.059
*192.9.200.169 .GPS. 1 u 34 64 377 0.365 -0.002 0.042



Jim Pennino

unread,
Aug 2, 2021, 10:01:10 AM8/2/21
to
Miroslav Lichvar <mlic...@redhat.com> wrote:
> On 2021-07-31, Jim Pennino <ji...@gonzo.specsol.net> wrote:
>> It turns out there is a kernel bug in Ubuntu 5.4.0-80-generic which
>> breaks PPS processing.
>>
>> The net result is that an application that looks at /dev/ttySx will have
>> no issues and will see CTS being asserted but anything that looks at
>> /dev/ppsx will fail.
>
> I think that is expected if you have the PPS signal connected to CTS.
> AFAIK the kernel PPS serial driver works only with DCD.

Then that is a bug because most real devices use CTS.

gpsmon /dev/ttyS0 shows ---PPS---- in the data window.

> gpsd supports the kernel PPS and also (a much less precise) user-space
> PPS if the kernel PPS does not work.

gpsd uses the pps_api.

> However, I'm not sure why it worked for you only when started directly
> from command line. It might help if we could compare the gpsd debug
> output or strace output in both cases.

Calling any pps_api routine from anything fails.

David Taylor

unread,
Aug 2, 2021, 10:39:17 AM8/2/21
to
On 02/08/2021 14:01, Jim Pennino wrote:
>> I think that is expected if you have the PPS signal connected to CTS.
>> AFAIK the kernel PPS serial driver works only with DCD.

> Then that is a bug because most real devices use CTS.

All the real devices I've used on Windows and multiple variants of Linux use DCD.

--
Cheers,
David
Web: http://www.satsignal.eu

Jim Pennino

unread,
Aug 2, 2021, 10:46:05 AM8/2/21
to
"In NTP versions after 4.0.99k23 is NMEA driver atomized what means that
for PPS processing we don't need neither ATOM driver nor PPS command in
ntp.conf."

http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm 6.2.4.3.3

Which means, assuming your PPS device outputs NMEA sentences, all you
need to get both data and PPS is:

server 127.127.20.0 mode (for your device) minpoll 4 maxpoll 4
fudge 127.127.20.0 flag1 1

Terje Mathisen

unread,
Aug 2, 2021, 10:55:57 AM8/2/21
to
David Taylor wrote:
> On 02/08/2021 14:01, Jim Pennino wrote:
>>> I think that is expected if you have the PPS signal connected to CTS.
>>> AFAIK the kernel PPS serial driver works only with DCD.
>
>> Then that is a bug because most real devices use CTS.
>
> All the real devices I've used on Windows and multiple variants of Linux
> use DCD.
>
I have to agree with David here:

I have been a member of the NTP Hackers team for more than 25 years, and
I have yet to see a PPS device on RS232 which doesn't use DCD.

I have soldered together several (Motorola, Garmin, Sure) GPS reference
clocks, all of those used DCD.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Jim Pennino

unread,
Aug 2, 2021, 11:46:06 AM8/2/21
to
Terje Mathisen <terje.m...@tmsw.no> wrote:
> David Taylor wrote:
>> On 02/08/2021 14:01, Jim Pennino wrote:
>>>> I think that is expected if you have the PPS signal connected to CTS.
>>>> AFAIK the kernel PPS serial driver works only with DCD.
>>
>>> Then that is a bug because most real devices use CTS.
>>
>> All the real devices I've used on Windows and multiple variants of Linux
>> use DCD.
>>
> I have to agree with David here:
>
> I have been a member of the NTP Hackers team for more than 25 years, and
> I have yet to see a PPS device on RS232 which doesn't use DCD.

It is now 2021 and there have been changes.

> I have soldered together several (Motorola, Garmin, Sure) GPS reference
> clocks, all of those used DCD.
>
> Terje

I have a commercial GNSSDO, which contains an OCXO as the rubidium
option was a bit too pricey for me, and both models use CTS.

There is no soldering involved as this is, again, a commercial device
with a DB-9 on the panel with pin 8, i.e. CTS on the DTE end, labeled
1PPS.

If one runs gpsmon against this device it shows PPS being asserted on the
data display line, so whoever wrote gpsmon has seen GPS devices with PPS
on CTS.

If one runs ppstest against this device it shows PPS being asserted, so
whoever wrote ppstest has seen GPS devices with PPS on CTS.

FYI the OCXO model is about $180 and the rubidium model is about $800.

Arent't advances in technology great?

Jim Pennino

unread,
Aug 2, 2021, 11:46:07 AM8/2/21
to
David Taylor <david-...@blueyonder.co.uk.invalid> wrote:
> On 02/08/2021 14:01, Jim Pennino wrote:
>>> I think that is expected if you have the PPS signal connected to CTS.
>>> AFAIK the kernel PPS serial driver works only with DCD.
>
>> Then that is a bug because most real devices use CTS.
>
> All the real devices I've used on Windows and multiple variants of Linux use DCD.

The computer operating system has nothing to do with how some external,
commercial device is built.

chris

unread,
Aug 2, 2021, 12:19:56 PM8/2/21
to
The pps line has nothing to do with nmea sentances directly, but is
a ttl level pulse that marks the beginning of each second,
typically with microsecond accuracy. It's a sync pulse for the current
second.

The nmea sentences provide the overall time of day, month, year,
but fine resolution within the second can only be provided by the
subsecond accuracy of the pps pulse. Obvious really, in that
differing times of flight of the nmea sentences and decoding
can never provide the required accuracy alone...

chris

unread,
Aug 2, 2021, 12:26:14 PM8/2/21
to
They are, but if it's all now working, what output do you get
from the ntpq utility. or equivalent, in terms of accuracy ?.
If it's working properly and has been running for a few hours,
offset against UTC should be in the microsecond range, not
milliseconds, 3 orders of magnitude error...

David Woolley

unread,
Aug 2, 2021, 1:05:39 PM8/2/21
to
On 02/08/2021 17:26, chris wrote:
> If it's working properly and has been running for a few hours,
> offset against UTC should be in the microsecond range, not

ntpd doesn't provide that information. It only provides the offset
between the timing source and the PC's internal clock.

Terje Mathisen

unread,
Aug 2, 2021, 1:40:46 PM8/2/21
to
Jim Pennino wrote:
> Terje Mathisen <terje.m...@tmsw.no> wrote:
>> David Taylor wrote:
>>> On 02/08/2021 14:01, Jim Pennino wrote:
>>>>> I think that is expected if you have the PPS signal connected to CTS.
>>>>> AFAIK the kernel PPS serial driver works only with DCD.
>>>
>>>> Then that is a bug because most real devices use CTS.

The above is simply wrong.

>&