gpsd-users
[Top][All Lists]
Advanced

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

Re: gpsd Example2.py


From: Gary E. Miller
Subject: Re: gpsd Example2.py
Date: Wed, 21 Sep 2022 17:31:16 -0700

Yo Dirk!

On Thu, 22 Sep 2022 00:22:33 +0000
Dirk Beer <rdbeer@pm.me> wrote:

> Thanks again, Gary
> 
> ------- Original Message -------
> On Wednesday, September 21st, 2022 at 11:58 AM, Gary E. Miller
> <gem@rellim.com> wrote:
> > I guess I need to make it clearer in the doc that that libgps.html
> > is just a code fragment, to show off the Python iterator, and
> > nothing more.  
> I was unsure if the Python iterator was doing something different
> than read(),

And now you know.  I'm working on improving tha doc on that now.

> I did understand it was not a complete code example. I
> thought in my testing that the iterator ran much faster and produced
> more duplicates than read(), but that was a mistake on my part 

Yup.

> I
> just tested again and as you suggest they produce the same speed &
> output.

Of course.

> > No way around this.  
> Understand now, thanks for explaining.

I need to add that to the FAQ.

> > What happened to your time? Did you just start the receiver?
> >  
> I don't know, trying to track this down now. gpscsv does show times,
> so not sure why example2.py isn't for me.

The example reads a JSON message, and checks it is has TIME_SET set, if
not, the the time is shown as "n/a".

No idea why your JSON does not have TIME_SET, can you provide 30
seconds of your JSON?  This way:

        gpspipe -e -x 30 > json.log

> > next() and _next() are just shims over read(), to allow Pythin
> > iterators.
> >
> > No other difference, no idea what doc migh give that impression.  
> My mistake/misunderstanding, nothing wrong with the docs.

Yeah, the docs are unclear.  Working on it.

> 
> > Almost every gpsd example on the web is wrong...
> >  
> > > gpsd -s 115200 -n /dev/ttyACM0  
> >
> >
> > You skipped over another one of my comments. ttyACM0 is a native USB
> > port. Native USB ports have no "speed". So the "-s 115200" has no
> > affect on anything. gpsd and Linux accept the "speed" and throw it
> > away.  
> 
> Sorry if I missed a comment, if you mean your question about why I am
> using both the device and socket, it's because I didn't know any
> better. 

No, I just clearly said: "-s 115200" is wrong.

> So now I've switched to just using the device, and the way I start
> gpsd is now in the root crontab like so (taking out the -s that
> doesn't have any effect): 
> 
>     @reboot /usr/bin/sleep 5 && /usr/local/sbin/gpsd -n /dev/ttyACM0

Many ways to do that, that one seems OK.  I prefer local.d, YMMV.

> Hopefull this is right, please let me know if I am still missing
> something.

Until your time works, we are missing something.

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: pgpRIIvPZNLEE.pgp
Description: OpenPGP digital signature


reply via email to

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