[Top][All Lists]

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

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

From: Gary E. Miller
Subject: Re: [RFC] get gpsd to work with gnss-share
Date: Mon, 9 Jan 2023 12:27:52 -0800

Yo Clayton!

On Sun, 8 Jan 2023 22:44:20 -0800
Clayton Craft <> wrote:

> Hello from west of the Cascades, author of gnss-share here :)

Welcome.  You can't be far from me.  You are in Hillsboro, right?  Or

Where do I find the gnss-share source and doc?

Is this it?

> > Running gpsd under sudo is suboptimal.  Run as root.
> > 
> > Not under your control, but /var/run has been deprecated a while.  
> The socket can be created anywhere, it's configurable. Some distros
> symlink /run --> /var/run, and my excuse is that old habits die hard
> :)

I'm annoying about following standards.

> > Why no -n?
> > 
> > Any doc on that socket?  
> 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?

> 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?

> 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 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.

> 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.

> and doing other things to
> improve lock times,

Modern GNSS are pretty fast at that.

> 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?

> > > > Why did the current gpsd/android not need to do this?    
> > > 
> > > I'm not familiar with Android, but I'm pretty sure they are not
> > > using gnss-share.  
> > 
> > So you are not on Android?  I guess I am lost...  
> No, this is postmarketOS, but there are other Linux distros (so far I
> know of PureOS too) that are not Android that also use gnss-share.

Would have been helpful to have known that up front.  No context was
given in the original request.

> > > It carries usual NMEA data. It is very similar to TCP socket, but
> > > it uses filename, not IP+port number. That way, filesystem
> > > permissions can be used to limit who can see the NMEA data.  
> > 
> > If it is NMEA, can you just open it like a file?  Can gpsd also
> > write to it?  
> It's a unix socket that gnss-share echo's data that it receives from
> some underlying serial connection to the actual GNSS module.

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

> > 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?

> $GPRMC,xxxxx,V,xxxx.xxxx,N,xxxxx.xxxx,W,0.0,0.0,090123,,,N*6A

Pre NMEA 4.1.  Suboptimal.

> $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.

> $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 tried to obfuscate it for obvious reasons, but hopefully you get
> the idea)

You are still easy to find.

> Hope this helps clarify things a bit!

A start, lot's more questions.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703  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: pgpkG6isDtekQ.pgp
Description: OpenPGP digital signature

reply via email to

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