gpsd 返回不完整的 DEVICES 消息

gpsd returning incomplete DEVICES message

在小型 prometheus 设置中,我有数百条这种风格的系统日志消息:

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)

所以我在想:gpsd-exporter 是用 Python 编写的,我将尝试制作一个最小的 运行 示例来抛出相同的错误(使用 this gpsd library):

import gpsd
gpsd.connect()

给出以下输出:

{"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}

如您所见,DEVICES 答案有些不完整:"parity":"}]}。我不确定这是否与 gpsd Python 库或 gpsd 本身有关 - 我想是后者,但我不确定为什么。

将 gpsd 更新到 3.22(如在 buster-backports 存储库中)似乎已解决此问题。