Satellite azimuth, elevation, & signal strength coming as floats from gpsd?
thanatos opened this issue · 1 comments
Hi; when I use your library with gpsd
, Satellite
data appears to come across as floating point data, and it was causing Gpsd
to not be able to read Satellite
/ Sky
data. I turned up logging, and that captured the JSON data that gpsd_proto
sees:
[2020-08-23T04:14:02Z TRACE gpsd_proto] {"class":"SKY","device":"/dev/ttyACM0","xdop":0.44,"ydop":0.57,"vdop":1.12,"tdop":0.70,"hdop":0.72,"gdop":1.50,"pdop":1.33,"satellites":[{"PRN":3,"el":35.0,"az":267.0,"ss":36.0,"used":true,"gnssid":0,"svid":3},{"PRN":4,"el":29.0,"az":311.0,"ss":30.0,"used":true,"gnssid":0,"svid":4},{"PRN":16,"el":41.0,"az":212.0,"ss":36.0,"used":true,"gnssid":0,"svid":16},{"PRN":22,"el":29.0,"az":242.0,"ss":39.0,"used":true,"gnssid":0,"svid":22},{"PRN":25,"el":4.0,"az":46.0,"ss":0.0,"used":false,"gnssid":0,"svid":25},{"PRN":26,"el":82.0,"az":177.0,"ss":40.0,"used":true,"gnssid":0,"svid":26},{"PRN":27,"el":0.0,"az":178.0,"ss":0.0,"used":false,"gnssid":0,"svid":27},{"PRN":29,"el":24.0,"az":58.0,"ss":17.0,"used":true,"gnssid":0,"svid":29},{"PRN":31,"el":56.0,"az":63.0,"ss":36.0,"used":true,"gnssid":0,"svid":31},{"PRN":32,"el":22.0,"az":139.0,"ss":34.0,"used":true,"gnssid":0,"svid":32},{"PRN":46,"el":15.0,"az":247.0,"ss":38.0,"used":true,"gnssid":1,"svid":133},{"PRN":51,"el":29.0,"az":227.0,"ss":0.0,"used":false,"gnssid":1,"svid":138},{"PRN":65,"el":59.0,"az":206.0,"ss":31.0,"used":true,"gnssid":6,"svid":1},{"PRN":66,"el":38.0,"az":321.0,"ss":34.0,"used":true,"gnssid":6,"svid":2},{"PRN":72,"el":22.0,"az":172.0,"ss":35.0,"used":true,"gnssid":6,"svid":8},{"PRN":74,"el":22.0,"az":49.0,"ss":0.0,"used":false,"gnssid":6,"svid":10},{"PRN":75,"el":68.0,"az":346.0,"ss":34.0,"used":true,"gnssid":6,"svid":11},{"PRN":76,"el":37.0,"az":261.0,"ss":34.0,"used":true,"gnssid":6,"svid":12},{"PRN":83,"el":4.0,"az":6.0,"ss":18.0,"used":false,"gnssid":6,"svid":19},{"PRN":84,"el":15.0,"az":59.0,"ss":0.0,"used":false,"gnssid":6,"svid":20},{"PRN":85,"el":6.0,"az":113.0,"ss":27.0,"used":true,"gnssid":6,"svid":21}]}
[2020-08-23T04:14:02Z ERROR offline_maps::gpsd] gpsd thread died with error: Gpsd(JsonError(Error("invalid type: floating point `35`, expected i16", line: 0, column: 0)))
As you can see, the values look like floats, like 35.0
for the el
member of the first satellite in that packet. The weird thing is, I've definitely used gpsd
, gpsd_proto
, and this GPS hardware together before, and it has worked just fine. I know neither the hardware nor the version of gpsd_proto
has changed, which makes me think this is a change in gpsd
, and how it encodes data.
While I get what look like floats, they always seem to end in .0
.
It was pretty easy to change gpsd_proto
to be floats; I'll send a PR too, shortly.
In case it matters,
I'm using gpsd: 3.21 (revision 3.21)
(I'm not sure what the version was when everything was working.)
gpsd_proto
0.6.0
My device identifies itself just as a "G-MOUSE"; it looks exactly like this;
Bus 001 Device 007: ID 1546:01a8 U-Blox AG [u-blox 8]
Lastly, thank you for gpsd_proto
; it's been very easy & nice to use.
As said in the PR: I think this is fine. My UC uses a currently a too old gpsd; Thus i cannot verify this. But it should not harm to have these fields as Option. Release 0.7.0 includes your change.