Repro steps:
Start without a device like /etc/defaul/gpsd DEVICES=""
Attach a json watcher like to gpsd like $ telnet localhost 2947 then enter ?WATCH={"enable":true,"json":true};
This looks like:
$ telnet localhost 2947 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. {"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14} ?WATCH={"enable":true,"json":true}; {"class":"DEVICES","devices":[]} {"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
Then on another console attach the device: $ sudo gpsdctl add /dev/ttyUSB0
In the telnet socket watch you will see: {"class":"DEVICE","path":"/dev/ttyUSB0","activated":2020-05-20T05:42:54.598Z}
And the last element in this is violating JSON. With the fix this no more happens.
Repro steps:
Start without a device like /etc/defaul/gpsd
DEVICES=""
Attach a json watcher like to gpsd like {"enable" :true," json":true} ;
$ telnet localhost 2947
then enter
?WATCH=
This looks like:
$ telnet localhost 2947 :"VERSION" ,"release" :"3.20" ,"rev": "3.20", "proto_ major": 3,"proto_ minor": 14} {"enable" :true," json":true} ; :"DEVICES" ,"devices" :[]} :"WATCH" ,"enable" :true," json":true, "nmea": false," raw":0, "scaled" :false, "timing" :false, "split24" :false, "pps":false}
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"class"
?WATCH=
{"class"
{"class"
Then on another console attach the device:
$ sudo gpsdctl add /dev/ttyUSB0
In the telnet socket watch you will see: :"DEVICE" ,"path" :"/dev/ ttyUSB0" ,"activated" :2020-05- 20T05:42: 54.598Z}
{"class"
And the last element in this is violating JSON.
With the fix this no more happens.