gpsd-users
[Top][All Lists]
Advanced

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

Re: So I took a look at the gps_read section of Dire Wolf


From: Don Rolph
Subject: Re: So I took a look at the gps_read section of Dire Wolf
Date: Wed, 5 Jan 2022 17:43:52 -0500

You stated:

>> And we are receiving over 100 identical records which are not in the
>> gpsd message debug log.

>And yet you complain about a bug in gpsd...

Certainly:  since the same client code works with gpsd 3.17 but fails with all versions of the library on 3.23.2~dev, it seems that it is the change in gpsd which is triggering the problem.  If it were the gpsd client library I would expect different results with different versions of the library, but the results are constant across versions.

The MT3333 unit is an externality, but it also works smoothly with gpsd 3.17.

Like wise Direwolf 1.7 works with gpsd 3.17 but not 322-400 onward.

So the only piece which when changed causes a failure is gpsd.

Now there are multiple possible scenarios:

- gpsd 3.23.2~dev is generating a message format which can't be handled by the gps_read code:  both come from the gpsd team

- there is a bug in the gps_read code (but across all versions?)

- there is a bug in the Dire Wolf implementations of the gps_read code (but it works with gpsd 3.17)

The variable which triggers the problem appears to be the gpsd code.

One can look at the entire routine:

-  https://github.com/wb2osz/direwolf/blob/master/src/dwgpsd.c

but I don't see anywhere in the code where spurious messages can be generated except in the gps_read routine provided by the gpsd team as part of the client library.

Again, I am not a c expert, so I might be confused.

But I did, as requested, demonstrate the failure with gpsd 3.23.2~rev with a client using the lib.so.29 library from the gpsd 3.23.2~r distribution.  The results were consistent with previous testing./

Again, thanks for everyone's help and support!

On Wed, Jan 5, 2022 at 5:16 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Don!

On Wed, 5 Jan 2022 16:52:33 -0500
Don Rolph <don.rolph@gmail.com> wrote:

> If one looks at the dire3.log file one sees that the first TPV message
> after a 3D fix has been received by the rest of the code well over 100
> times.  The messages are all identical.  They do not show up in the
> log data from gpsd received by gpspipe -W.

Asked and answered.  The Dire worlf code is bad, from a bad
stackexchange example.  loop++.

> I did a quick scan of the code, and the following seems salient.  The
> reading of the gpsd data all occurs in the routine read_gpsd_thread

Yes, since there are very few lines of gpsd code in Dire Wolf, it is
probably in there, somewhere.

> A highly edited version of the source is below:

Please don't do that.  The problem is where you refuse to look.

> So it appears that the process reads a record and then prints a
> record.  To print a new it first has to read a new record.

I suggestt you re-read the gps_read() man page.

> And we are receiving over 100 identical records which are not in the
> gpsd message debug log.

And yet you complain about a bug in gpsd...

> This would seem to indicate that gps_read is generating the spurious
> messages since between the gps_read and the print there is no code to
> cause a loop or generate a record.

I suggestt you re-read the gps_read() man page.

> Now I am not a c specialist, so I may have made an error here. But if
> so, the nature of the error should be able to be identified by others.

Yup.  And if you had not over simplified the loop, you might see it
too.

> So do we know for sure that there is not a potential edge condition
> which can cause gps_read to generate multiple spurious identical
> spurious records?

Yup, we know it, documented in fact.  How about you do some RTFM with
the examples in "man libgps".  Compare that known good code, with the
ode you helpfully removed and ignored.

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


--

73,
AB1PH
Don Rolph

reply via email to

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