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 12:39:02 -0500

Follow Up with a few answers and the requested logs.  If a different debug level is needed then please let me know.

Running gpsd in two configurations:
  1. running gpsd directly attached to the gps device (debug output in attached file gps_direct.log)
  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)
In the direct configuration gpsd is connected directly to device "/dev/TTPS1" (Ublox).  

gpsd -n -N -D8 /dev/ttyPS1 2>&1 | tee gpsd_direct.log

For the indirect configuration, we use openpty() to create a pseudo-terminal.  We only use the FD returned for the master (ignore slave).  We then create a symbolic link to the pseudo terminal called "/dev/ttyGPS0".  In the indirect configuration we starrt up our application and then gpsd using device "/dev/ttyGPS0".

gpsd -n -N -D8 /dev/ttyGPS0 2>&1 | tee gpsd_indirect.log

Output of "ipcr -m" shows the same for both configurations running.  Looks like the segments are correctly created.  I experimented with stopping/starting ntpd and see the number of "nattch" change from 2 to 1 when stopped and 1 to 2 when started.  Output is:

# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x4e545030 0          root       600        80         2
0x4e545031 32769      root       600        80         1
0x4e545032 65538      root       666        80         1
0x4e545033 98307      root       666        80         1
0x4e545034 131076     root       666        80         1
0x4e545035 163845     root       666        80         1
0x4e545036 196614     root       666        80         1
0x4e545037 229383     root       666        80         1
0x47505344 262152     root       666        8928       1 


On Tue, Mar 19, 2024 at 4:50 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Joseph!

On Tue, 19 Mar 2024 16:31:36 -0500
Joseph Beissel <joebeis64@gmail.com> wrote:

>    - Using a UBLOX M8

Which submodel?  M8N?  M9T?

>    - Using GPSD 3.17 due to system built on Yocto Warrior (I know,
> sucks for me...)

Yup.

> I can run gpsd  on and directly connect to our gps device using the
> following command:
>
> gpsd -b -nN8 /dev/ttyPS1 2>&1 | tee /tmp/gpsd_direct.log

Running with -b is discouraged.

> The command "ipcs -m" shows the shared memory segments.  The segment
> at 0x4e545030 has two processes attached to it (nattch=2).  I assume
> one is gpsd and the other is ntdp.  I can run ntpshmmon and see
> samples being written to the shared memory segment:

Got some output of that?

> sample NTP0 aaaa.aaaa bbbb.bbbb cccc.ccc (repeats with different
> values

Pretend data is not useful.

> Running the "date" command on the box shows the correct date and time.

What does ntpmon say?

> Now I change things up a bit.  I stop gpsd and start our custom
> application that attaches to the gps device (/dev/ttyPS1) and
> forwards all UBX and NEMA messages to another device (/dev/ttyGPS0).
> I know there's better ways to do this but other software relies on
> some of the things that our cucstom aplication does and we can't
> change that for now (down the road most likely).  So having our
> application forward all messages is the best we can do for now.

Not rare.

> I then startup gpsd as follows:
>
> gpsd -b -nN8 /dev/ttyGPS0 2>&1 | tee /tmp/gpsd_indirect.log

What is /dev/ttyGPS0?  A real device?  A loopback device?  A pipe?

> The command "ipcs -m" shows the shared memory segments.  The segment
> at 0x4e545030 has two attached to it (nattch=2).  I assume gpsd and
> ntpd are the same as above.

You are saving the logs.  Reading the logs will allow you to now
make assumptions.

> When I run ntpshmmon I do not see any
> samples being written to the shared memory segment.

The answer will be in the log.

> Since I used "N8" I compared the 2 logs created.  One thing I noticed
> is that the variable ntpshm_link_activate is set differently for the
> direct connection (/dev/ttyPS1) then it is for the indirect connection
> (/dev/ttyGPS0):
>
>    - direct(/dev/ttyPS1): ntpshm_link_activate=1
>    - indirect(/dev/ttyGPS0): ntpshm_link_activate=0

Not much I can do woth log fragments.  Please sned the FULL logs.

> I am not sure if this is causing my problem.

No link, means no SHM output from gpsd.  That would be your problem.

> And I am not sure why
> it is not set to "1".  Would this keep the shared memory segment from
> being written to?

Yup.

> If so, what keeps it from getting set to "1"?  Or
> is there something else that I am missing.  I used the
> not-supported-terrible-tool gpsmon when running in the indirect
> configuration and things look good,

We never care what gpsmon says.  We care what the logs say.

> I also compared the 2 logs to see what UBX and NMEA messages are
> being sent and they appear to be the same for the direct and indirect
> casses.

I woud like to do the same, but...

> In the direct case I captured the UBX raw configuration
> messages that gpsd sends to the device and made sure that our custom
> application was doing the same.  In addition I compared the NMEA
> messages and they appear to be identical as well.

You are now totally lost.

> Also, one more question about sending messages to this group.  When I
> get a reply to  a message that I posted, how do I reply to it?

Without knowing yur email client, we can't know.  I use claws-mail.  I just
type 'R'.

Ansking questions, without the data to answer them, is not useful.


> Do I
> simply use "reply all" or is there another way?

"Reply Sender".  Assuming your email client is not brain dead and knows
that "gpsd-users" is the sender.

> If the reply comes
> from gem, will a "reply-all" be sent to gem directly?

NOTHING comes from me, only from the list.  Please do not do Reply-all.

> I thought I
> read that it is taboo since I am not a paying customer.  Want to make
> sure I am doing the right thing by the user group.

"Reply-sender" is the way.

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: gpsd_direct.log
Description: Binary data

Attachment: gpsd_indirect.log
Description: Binary data


reply via email to

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