gpsd-users
[Top][All Lists]
Advanced

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

Re: UBLOX and NTPD


From: Joseph Beissel
Subject: Re: UBLOX and NTPD
Date: Wed, 20 Mar 2024 17:03:35 -0500

Again only replying to questions to not be too confusing with indentation issues.

> Nothing we can do about that.  A lot of these weird serial drivers are
> broken.  That means gpsd init will fail.  And it did.  Which is why your
> device  ends up in NMEA 0183 mode.

So if it ends up in NMEA 0183 mode is that a bad thing? When I run gpsd directly connecting to the ublox device, things seem good.  When I run ntpshmmon I am getting samples written to the shared memory segment and the time on the box gets set correctl (running "data" is correct to the second).  So even if gpsd init fails, it soldiers on.  So what does "broken" mean.  gpsd seems to do "enough" to get things working.   Even if the serial driver is "broken", which isn't a good thing I agree, it doesn't seem to hamper the functionality of gpsd or does it?  I attached a debuginfo file which pulls some of the output of the script gpsdebuginfo that I pulled down off the site when running gpsd in the direct scenario.

> We can't really support that usage.   Unless you setup the receiver
> in a way that gpsd can use it, your results will be marginal.  Too many
> variables out of our control.

I get that this is not a normal situation and that you can't support it.  I am not asking to have it supported. I am just curious as to why it would not work.

What setup is done to the receiver by gpsd so it can use it? I see the file driver_ubx.c.  Does that contain all of the setup that is done?  Specifically the ubx_cfg_prt() function.  If we are able to mimic what is done to configure the device and then simply forward all the messages to gpsd, why wouldn't gpsd be happy?  I guess I am having a hard time understanding why.   Not to be argumentative, just curious.  Because things seem to work when gpsd is directly connected to the device.  And once it is up and running and processing messsages, I can run gpspipe and see raw nmea messsages.

Speaking of nmea messages, when I search through the debug output (-D4 -D5 -D6) generated when running directly connected, I see GSV, GGA, GLL, GSA, RMC, VTG and GSV sentences being processed by gpsd.  I don't see any other messages that are being processed.  Are these the messsages that gpsd relies on?

> And what driver creates a /dev/TTPS1 ??  Clearly problems there.

Typo.  Should be /dev/ttyPS1.  This is the physical device (uart) on our  processor that has been wired to communicate with the GPS device.

> gpsd knows nothing of pseudo-terminals.

Does gpsd assume anything about the device you send it?  I didn't think it mattered.  So if I create "/dev/ttyGPS0" and link it to the pseudo-terminal that gets created by calling openpty, write messages to "/de/ttyGPS0" and run gpsd using "/dev/ttyGPS0" why wouldn't gpsd be able to read the messages that are written to it.  Before you indicated we should not used the "-b" option when starting gpsd.  However in our indirect scenario it makes sense to use the "-b" if we have another process configuring the device.  Do I misunderstand the usage of "-b"?

> Why bother with a link?

A link is created so the underlying pseudo terminal is hidden from the software.  The software can refer to the same name even if openpty gives different results.  Provides portability.

Also nothing I see indicates to my why the ntpshm_link_1_activate link is not getting set to "1" which you indicated is why the shared memory segment is not getting set.  Maybe you can point me to a place in the code that could help me out.

I appreciate you keeping up with the questions. It is really helpful.

On Wed, Mar 20, 2024 at 1:35 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Joseph!

On Wed, 20 Mar 2024 12:39:02 -0500
Joseph Beissel <joebeis64@gmail.com> wrote:

> Running gpsd in two configurations:
>
>    1. running gpsd directly attached to the gps device (debug output
> in attached file gps_direct.log)

Did you read this?  You have hardware problems:

gpsd:IO: <= GPS: $GNTXT,01,01,01,More than 100 frame errors, UART RX was disabled*70

Nothing we can do about that.  A lot of these weird serial drivers are
broken.  That means gpsd init will fail.  And it did.  Which is why your
device  ends up in NMEA 0183 mode.

But it does do good SHM(0):

gpsd:PROG: NTP: ntpshm_put(/dev/ttyPS1,-20)  1710934881.000000000 @  1708975027.178745117

>    2. running custom application that attaches directly to the gps
> device and forwards all messages to another device (debug output in
> attached file gps_indirect.log)

We can't really support that usage.   Unless you setup the receiver
in a way that gpsd can use it, your results will be marginal.  Too many
variables out of our control.

> In the direct configuration gpsd is connected directly to device
> "/dev/TTPS1" (Ublox).

And what driver creates a /dev/TTPS1 ??  Clearly problems there.

> For the indirect configuration, we use openpty() to create a
> pseudo-terminal.

gpsd knows nothing of pseudo-terminals.

> We only use the FD returned for the master (ignore
> slave).

Lost me.  I'll have to read up on those.

>  We then create a symbolic link to the pseudo terminal called
> "/dev/ttyGPS0".

Why bother with a link?

> Output of "ipcr -m" shows the same for both configurations running.

Which is jumping WAY past the first failure.  No point looking there.
Always look at the first failure, not later failures.  For example: you
don't care the convertible roof failed on a car after it rolled over,
after it blew a tire.  The first failure, the tire blowing, is what you
look at.

The indirect is in a mashup of NMEA 0183 mode and u-blox mode.  So this
is commparing apples to oranges.

The message decode is setting NTPTIME and TIME flags, but not sending to
SHM(0).  later versions of gpsd have loging to show why, but in your case
I could only guess that your sentence mix is confuing the end of cycle
detector.  Beyond that, nothing I can do.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@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

Attachment: debuginfo.TXT
Description: Text document


reply via email to

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