pythongpsd

gpsd returning incomplete DEVICES message


On a small prometheus setup I've got hundreds of syslog messages in this style:

Sep 23 08:09:01 raspi4-bolli gpsd-exporter[20242]: 0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:08:59.997Z","flags":1,"native":0,"bps":9600,"parity":"}]}
Sep 23 08:09:01 raspi4-bolli gpsd-exporter[20242]:  Invalid control character at: line 1 column 173 (char 172)

So I'm thinking: gpsd-exporter is written in Python, I'll try to make a minimum running example throwing the same error (using this gpsd library):

import gpsd
gpsd.connect()

which gives the following output:

{"class":"VERSION","release":"3.17","rev":"3.17","proto_major":3,"proto_minor":12}

0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:35:47.017Z","flags":1,"native":0,"bps":9600,"parity":"}]}

0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:35:47.017Z","flags":1,"native":0,"bps":9600,"parity":"}]}
 Invalid control character at: line 1 column 173 (char 172)
1 {"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}

As you can see, the DEVICES answer is somehow incomplete: "parity":"}]}. I'm not sure if this is related to the gpsd Python library or gpsd itself - I suppose the latter, though I'm unsure why.


Solution

  • Updating gpsd to 3.22 (as in the buster-backports repo) seems to have fixed this.