[Top][All Lists]

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

Re: gpsd disconnects using ublox M8T

From: Jon Ulrigg
Subject: Re: gpsd disconnects using ublox M8T
Date: Fri, 4 Nov 2022 21:46:25 +0000

Hey Gary,

Thanks so much for your response!

I spun a new image last night using gpsd 3.24, and with no other changes so far it is running reliably.

Thanks for the detailed information, if the issue pops up again, I'll come back with something more useful regarding what it is exactly going on.

On a side note, now that it is not losing connection, I'm having some issues with the Python gps library.  Not sure if this is the appropriate place for this level of detail.

Initially I was using the gps3 library(as I started with an example based there), but it hasn't seen update since 2016, so I've abandoned that in favor of the gps library, since it is referenced in the HOWTO.

I'm using Python 3.10 and gps 3.19

I downloaded the from the HOWTO, using 
wget -o
Out of the gate, running the example generates the following error:

  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 199, in unpack = "" encoding="ascii"))
  File "/usr/lib/python3.10/json/", line 359, in loads
TypeError: JSONDecoder.__init__() got an unexpected keyword argument 'encoding'

The encoding argument was deprecated since Python 3.1, and removed in Python 3.9

I don't claim to be any kind authority on Python, but I was able to fix the issue by changing the code to:

buf.encode("ascii") = "">

That allows it to run, but does not print the time.  There appears to be an issue with session.valid not getting set.

Mode: 3D(3) Time: n/a Lat 30.436707 Lon -97.646897
Mode: 3D(3) Time: n/a Lat 30.436707 Lon -97.646897
Mode: 3D(3) Time: n/a Lat 30.436707 Lon -97.646897

if I change line 21 of from:

        if gps.TIME_SET & session.valid:

        if gps.TIME_SET:

It prints the time just fine.

Mode: 3D(3) Time: 2022-11-04T21:33:20.000Z Lat 30.436743 Lon -97.646872
Mode: 3D(3) Time: 2022-11-04T21:33:21.000Z Lat 30.436743 Lon -97.646872
Mode: 3D(3) Time: 2022-11-04T21:33:22.000Z Lat 30.436743 Lon -97.646873

The third issue, and one I don't have a solution for yet, is that when I let the client run, eventually I will get errors on satellite data.  Here are a couple examples:

Traceback (most recent call last):
  File "/home/jon/webserver/./", line 12, in <module>
    while 0 ==
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 286, in read
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 261, in __oldstyle_shim
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 314, in __getitem__
    return self.__dict__[key]
KeyError: 'el'

Traceback (most recent call last):
  File "/home/jon/webserver/./", line 12, in <module>
    while 0 ==
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 286, in read
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 262, in __oldstyle_shim
    azimuth=sat['az'], ss=sat['ss'],
  File "/home/jon/webserver/webserver_env/lib/python3.10/site-packages/gps/", line 314, in __getitem__
    return self.__dict__[key]
KeyError: 'az'



From: gpsd-users on behalf of Gary E. Miller
Sent: Thursday, November 3, 2022 12:33 PM
Subject: Re: gpsd disconnects using ublox M8T

Yo Jon!

On Thu, 3 Nov 2022 17:12:57 +0000
Jon Ulrigg <> wrote:

> New to the list (and new to gpsd as well, but seem to be coming up to
> speed quickly =) )


> I found a message from 2019 about a problem I'm presently having.
> Previous thread was titled "gpsd loses the connection with the M8T
> when Raw is enabled."

Got a link to it?

> I'm running linux 5.10.80 on an Atmel processor, with gpsd 3.23.1
> configured to use /dev/ttyS1 for the u-blox

Uh, 3.23.1 is old.  Please try 3.24, or git head.

> gpspipe: 3.23.1 (revision 3.23.1)
> + gpspipe -w -n 2 -x 20

Looks OK, exxcept no output.

You skipped the important part, hos are you starting gpsd?

> I'm using a u-blox M8T with ubx protocol,

And how are you doing that?  That is the default that gpsd tries to
set on an M8T.

> and gpsd is dropping
> connection to the M8T, and looks like it is trying to cycle through
> lower baud rates when reconnecting.

Got logs that show that?

> I've set the baud at 115200
> using:

Why?  For most things, the default 9,600 is fine.

> ubxtool -s 115200
> ubxtool -S 115200

You have those in the wrong order.  You set the local port speed,  before
the receiver port speed, so the second command never gets to the receiver.

> The previous thread mentioned disabling rawx which I believe I've
> done using
> ubxtool -d RAWX

We don't care about beliefs here.  Either you know, or you don't.  A
quick look at ubxtool output will show yout:

# ubxtool -v 2 -w 10

> I've also disabled NMEA sentences with
> ubxtool -d NMEA

Which should not be required, unless you did something else.  Did you
also enable the BINARY sentences?  As the example show you to?

> The disconnects seem less frequent, but still occur, within a couple
> minutes usually.

Hard for us to know without seeing your -D 4 log output, and gpspipe -R

> If I let cgps run, eventually it will print out a
> cgps: GPS timout
> and exit.

Not very helpful diagnosticaly.  See above.

> Any suggestions or things to try greatly appreciated

Send us the -D log output, and the gpspipe -R output.

The output of gpsdebuginfo may also be helpful.

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

reply via email to

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