gpsd-dev
[Top][All Lists]
Advanced

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

Re: [RFC] get gpsd to work with gnss-share


From: Clayton Craft
Subject: Re: [RFC] get gpsd to work with gnss-share
Date: Mon, 9 Jan 2023 12:47:38 -0800

On Mon, 09 Jan 2023 12:27:52 -0800 "Gary E. Miller" <gem@rellim.com> wrote:
> Where do I find the gnss-share source and doc?
> 
> Is this it?  https://gitlab.com/postmarketOS/gnss-share

Yes.

> > It's currently RO, gnss-share ignores any writes to it. This might
> > change in the future, but currently gnss-share controls the
> > underlying device if, e.g., a-gps needs to be uploaded or whatever.
> > gnss-share can be controlled at runtime by using signals.
> 
> How many different GNSS protocols?

Doesn't matter, gnss-share isn't doing anything with the data it gets from the
module, from gpsd's standpoint (and other things like geoclue), it's just a
proxy for it.

> > What gnss-share does is open some underlying gnss device (e.g.
> > connected over serial) and just passes through any data from it
> > directly to the socket.
> 
> So it does not configure the data to be sent?  Just rely on the defaults?

Nope. I mean, it *could*, but currently it doesn't configure what data the
module is going to shout out at whatever interval it wants.

> > The real value in gnss-share is that it can
> > perform any arbitrary setup for specific devices, or interrupt them
> > to do things like load a-gps, etc. It also supports any number of
> > clients connected to the socket at once all receiving the same
> > unaltered data from the module.
> 
> I find A-GPS near useless with the most modern devices.  Until recently
> the vendors refused to even document the process.

I find it crucial for some modern devices, like the STM module in the Librem 5.
Agree to disagree?


> > I know that for the Librem 5, gpsd is capable of "using" the data
> > from it's gps module as-is.
> 
> Googling around, I see opinions differ on that.

/shrug

It worked for me at the time. Maybe it doesn't anymore?


> > A couple of years ago I was using gpsd on
> > the L5, and it was fine, but decided to make gnss-share to allow for
> > loading/storing a-gps -related data,
> 
> I wish you had sent gpsd patches instead.

Everyone else seem to be moving to geoclue for aggregating location data from
multiple sources for apps to use. That was my primary target.

> > and doing other things to
> > improve lock times,
> 
> Modern GNSS are pretty fast at that.

... Except the Librem 5's GNSS module.

> 
> > as well as supporting concurrent clients from
> > things like geoclue and others.
> 
> Dunno about geoclue.
> 
> > So in theory if gpsd could connect to the gnss-share socket, it
> > should be able to use the data from it, at least for the L5's gnss
> > module.
> 
> Any doc on how to do that?

It's a unix socket, open it and read.

> Umm.  Char by char?  Packet by packet?  Multiple packets per message?
> How does the client know data is available?  Any buffering?  Any
> checksumming?

Line by line. No buffering. No checksumming, beyond what the module does in
NMEA.

> > > No such thing as "usual NMEA", just look at the GPSD regressions for
> > > a small sample of the huge variations possible.
> > > 
> > > Where is it documented.  
> > 
> > Here's a sample of the set of sentences that are 1) written to the
> > serial connection by the GNSS device every 1 second, and 2) echo'd
> > without modification to the unix socket by gnss-share:
> 
> Echoed char by char?  Sentence by sentence?  Buffered?
> 
> > $PSTMCPU,60.50,-1,49*4C
> 
> Proprietary sentence.  Got any doc on that?  ST Micro?

Yeah ST Micro. Ignore it.

> > $GPRMC,xxxxx,V,xxxx.xxxx,N,xxxxx.xxxx,W,0.0,0.0,090123,,,N*6A
> 
> Pre NMEA 4.1.  Suboptimal.

File a bug with STM :D


> > $GPGGA,xxxxxx,xxxx.xxxxx,N,xxxx.xxxxxx,W,0,00,99.0,025.15,M,0.0,M,,*7B
> 
> I can't run tests on corrupted data like that.

But at least you have some idea what the sentences are, and you can fill in the
blanks with your own location (and recompute the checksums).

> 
> > $GPVTG,0.0,T,,M,0.0,N,0.0,K,N*02
> 
> > $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
> > $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
> 
> Duplicate sentences?  A buffer failure?
> 
> > $GPGSV,3,1,12,29,81,004,,02,79,315,,05,59,088,,18,39,255,*7D
> > $GPGSV,3,2,12,25,36,189,,20,34,052,,26,25,311,,12,15,166,*7D
> > $GPGSV,3,3,12,11,13,062,,31,09,268,,15,06,142,,23,06,201,*7A
> > $GLGSV,3,1,10,84,52,307,,83,43,054,,74,42,268,,74,42,268,*64
> > $GLGSV,3,2,10,68,38,094,,67,24,036,,73,23,216,,75,21,329,*66
> > $GLGSV,3,3,10,69,16,146,,82,06,078,,,,,,,,,*6C
> > $GPGLL,xxxx.xxxxx,N,xxxx.xxxx,W,xxxxxx,V,N*54
> 
> Odd to get lat/lon/alt on an invalid fix...
>  

I'm literally just echo'ing what the module writes to the serial connection. Any
problems you see with the output are, not my problem? This works great with
geoclue.

-Clayton

Attachment: signature.asc
Description: PGP signature


reply via email to

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