Adding GPS to Raspberry Pi running PiAware / Dump1090?

Did anyone find a solution to a “mobile” Dump1090 install? I have gpsd installed and it looks like my location is checked and updated by Piaware every 8-10 minutes. It would be nice if that interval could be changed to something quicker and then have a map option to recenter on the new location.

But my receiver log:

[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10836, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10836, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10836, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10837, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10837, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10837, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10837, 365m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10838, 365m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10838, 365m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10838, 365m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10838, 365m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91490, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10839, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10839, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91491, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 368m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10840, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91492, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91493, YY.10839, 367m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91493, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91493, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91493, YY.10838, 366m (WGS84)
[2020-01-07 23:49 MSK] gpsd reported location: XX.91493, YY.10838, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91493, YY.10837, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91493, YY.10837, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91494, YY.10837, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91494, YY.10836, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91494, YY.10835, 366m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91494, YY.10832, 365m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91494, YY.10831, 365m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91495, YY.10831, 365m (WGS84)
[2020-01-07 23:50 MSK] gpsd reported location: XX.91495, YY.10830, 365m (WGS84)

The only way I can see this happening is if your gpsd is alternating between reporting a location and reporting no location all the time.

What’s the GPS hardware you have?
If you connect to port 2947 and send this line:

?WATCH={"enable":true,"json":true};

what’s the output you get back from gpsd?

Connection with telnet to 2947 refused.

I use Vehicle Tracker “АвтоГРАФ -GSM/SL (GLONAS/GPS)” with external 1575/1602MHz antenna. When connected to the PC USB port, this tracker works as a GPS dongle. RasberryPi defines it as a com-port from which NMEA messages comes.

and reporting no location all the time
This is probably the reason. I see the absence of NMEA messages on this com-port several times per minute. A pause of about a second.

This is the port that piaware connects to, so if piaware is seeing gps positions you should be able to connect manually too. You probably need to connect from the Pi itself, to localhost - I think gpsd only binds to localhost, so external connections will fail.

Connected to localhost.
Escape character is ‘^]’.

{“class”:“VERSION”,“release”:“3.16”,“rev”:“3.16-4”,“proto_major”:3,“proto_minor”:11}
?WATCH={“enable”:true,“json”:true};
{“class”:“DEVICES”,“devices”:[{“class”:“DEVICE”,“path”:“/dev/ttyACM0”,“driver”:“u-blox”,“activated”:“2020-01-08T20:35:19.077Z”,“flags”:1,“native”:0,“bps”:9600,“parity”:“N”,“stopbits”:1,“cycle”:1.00,“mincycle”:0.25}]}
{“class”:“WATCH”,“enable”:true,“json”:true,“nmea”:false,“raw”:0,“scaled”:false,“timing”:false,“split24”:false,“pps”:false}

I’d expect to see some TPV messages, those are what I need to see (and in particular, the messages seen during the time when piaware is repeatedly logging about gps positions)

At the moment, this phenomenon has stopped.
In log only “msgs recv’d from dump1090-fa”

Again.

Summary

Linux piaware 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l

pi@piaware:~ $ telnet 127.0.0.1 2947
Trying 127.0.0.1…
Connected to 127.0.0.1.
Escape character is ‘^]’.
{“class”:“VERSION”,“release”:“3.16”,“rev”:“3.16-4”,“proto_major”:3,“proto_minor”:11}
?WATCH={“enable”:true,“json”:true};
{“class”:“DEVICES”,“devices”:[{“class”:“DEVICE”,“path”:“/dev/ttyACM0”,“driver”:“NMEA0183”,“activated”:“2020-01-14T19:05:27.089Z”,“flags”:1,“native”:0,“bps”:9600,“parity”:“N”,“stopbits”:1,“cycle”:1.00}]}
{“class”:“WATCH”,“enable”:true,“json”:true,“nmea”:false,“raw”:0,“scaled”:false,“timing”:false,“split24”:false,“pps”:false}
{“class”:“TPV”,“device”:“/dev/ttyACM0”,“mode”:2,“time”:“2020-01-14T19:05:28.000Z”,“ept”:0.005,“lat”:XX.914789833,“lon”:YY.109137333,“epx”:52.449,“epy”:15.545,“track”:0.0000,“speed”:0.037,“eps”:104.90}
{“class”:“SKY”,“device”:“/dev/ttyACM0”,“xdop”:13.99,“ydop”:4.15,“vdop”:1.30,“tdop”:15.08,“hdop”:1.00,“gdop”:28.41,“pdop”:1.64,“satellites”:[{“PRN”:2,“el”:45,“az”:57,“ss”:40,“used”:false},{“PRN”:5,“el”:17,“az”:116,“ss”:29,“used”:false},{“PRN”:6,“el”:12,“az”:40,“ss”:23,“used”:false},{“PRN”:12,“el”:53,“az”:112,“ss”:47,“used”:false},{“PRN”:14,“el”:6,“az”:282,“ss”:13,“used”:false},{“PRN”:21,“el”:3,“az”:210,“ss”:21,“used”:false},{“PRN”:24,“el”:11,“az”:178,“ss”:33,“used”:false},{“PRN”:25,“el”:82,“az”:325,“ss”:24,“used”:false},{“PRN”:29,“el”:54,“az”:268,“ss”:24,“used”:false},{“PRN”:31,“el”:27,“az”:311,“ss”:21,“used”:false},{“PRN”:126,“el”:30,“az”:141,“ss”:43,“used”:false},{“PRN”:68,“el”:4,“az”:357,“ss”:22,“used”:false},{“PRN”:69,“el”:7,“az”:44,“ss”:23,“used”:false},{“PRN”:74,“el”:20,“az”:154,“ss”:43,“used”:true},{“PRN”:75,“el”:59,“az”:164,“ss”:44,“used”:false},{“PRN”:76,“el”:63,“az”:314,“ss”:29,“used”:true},{“PRN”:77,“el”:10,“az”:327,“ss”:0,“used”:false},{“PRN”:84,“el”:2,“az”:43,“ss”:10,“used”:false},{“PRN”:85,“el”:56,“az”:30,“ss”:35,“used”:true},{“PRN”:86,“el”:59,“az”:244,“ss”:27,“used”:true},{“PRN”:87,“el”:2,“az”:228,“ss”:0,“used”:false}]}
{“class”:“TPV”,“device”:“/dev/ttyACM0”,“mode”:3,“time”:“2020-01-14T19:05:28.000Z”,“ept”:0.005,“lat”:XX.914789833,“lon”:YY.109137333,“alt”:390.300,“epx”:52.449,“epy”:15.545,“epv”:7.475,“track”:0.0000,“speed”:0.037,“climb”:0.000,“eps”:104.90}
{“class”:“TPV”,“device”:“/dev/ttyACM0”,“mode”:2,“time”:“2020-01-14T19:05:29.000Z”,“ept”:0.005,“lat”:XX.914790000,“lon”:YY.109138167,“epx”:52.449,“epy”:15.545,“track”:0.0000,“speed”:0.027,“eps”:104.90}
{“class”:“SKY”,“device”:“/dev/ttyACM0”,“xdop”:13.99,“ydop”:4.15,“vdop”:2.83,“tdop”:15.08,“hdop”:1.63,“gdop”:28.41,“pdop”:3.27,“satellites”:[{“PRN”:2,“el”:45,“az”:57,“ss”:40,“used”:false},{“PRN”:5,“el”:17,“az”:116,“ss”:28,“used”:false},{“PRN”:6,“el”:12,“az”:40,“ss”:23,“used”:false},{“PRN”:12,“el”:53,“az”:112,“ss”:47,“used”:false},{“PRN”:14,“el”:6,“az”:282,“ss”:13,“used”:false},{“PRN”:21,“el”:3,“az”:210,“ss”:21,“used”:false},{“PRN”:24,“el”:11,“az”:178,“ss”:32,“used”:false},{“PRN”:25,“el”:82,“az”:325,“ss”:24,“used”:false},{“PRN”:29,“el”:54,“az”:268,“ss”:24,“used”:false},{“PRN”:31,“el”:27,“az”:311,“ss”:20,“used”:false},{“PRN”:126,“el”:30,“az”:141,“ss”:43,“used”:false},{“PRN”:68,“el”:4,“az”:357,“ss”:22,“used”:false},{“PRN”:69,“el”:7,“az”:44,“ss”:23,“used”:false},{“PRN”:74,“el”:20,“az”:154,“ss”:42,“used”:true},{“PRN”:75,“el”:59,“az”:164,“ss”:44,“used”:false},{“PRN”:76,“el”:63,“az”:314,“ss”:27,“used”:true},{“PRN”:77,“el”:10,“az”:327,“ss”:0,“used”:false},{“PRN”:84,“el”:2,“az”:43,“ss”:14,“used”:false},{“PRN”:85,“el”:56,“az”:30,“ss”:35,“used”:true},{“PRN”:86,“el”:59,“az”:244,“ss”:27,“used”:true},{“PRN”:87,“el”:2,“az”:228,“ss”:0,“used”:false}]}
{“class”:“TPV”,“device”:“/dev/ttyACM0”,“mode”:3,“time”:“2020-01-14T19:05:29.000Z”,“ept”:0.005,“lat”:XX.914790000,“lon”:YY.109138167,“alt”:390.100,“epx”:52.449,“epy”:15.545,“epv”:7.475,“track”:0.0000,“speed”:0.027,“climb”:0.000,“eps”:104.90}
{“class”:“TPV”,“device”:“/dev/ttyACM0”,“mode”:2,“time”:“2020-01-14T19:05:30.000Z”,“ept”:0.005,“lat”:XX.914790333,“lon”:YY.109139000,“epx”:52.449,“epy”:15.545,“track”:0.0000,“speed”:0.031,“eps”:104.90}
{“class”:“SKY”,“device”:“/dev/ttyACM0”,“xdop”:13.99,“ydop”:4.15,“vdop”:1.30,“tdop”:15.08,“hdop”:1.00,“gdop”:28.41,“pdop”:1.64,“satellites”:[{“PRN”:2,“el”:45,“az”:57,“ss”:40,“used”:false},{“PRN”:5,“el”:17,“az”:116,“ss”:27,“used”:false},{“PRN”:6,“el”:12,“az”:40,“ss”:23,“used”:false},{“PRN”:12,“el”:53,“az”:112,“ss”:47,“used”:false},{“PRN”:14,“el”:6,“az”:282,“ss”:13,“used”:false},{“PRN”:21,“el”:3,“az”:210,“ss”:21,“used”:false},{“PRN”:24,“el”:11,“az”:178,“ss”:32,“used”:false},{“PRN”:25,“el”:82,“az”:325,“ss”:25,“used”:false},{“PRN”:29,“el”:54,“az”:268,“ss”:24,“used”:false},{“PRN”:31,“el”:27,“az”:311,“ss”:20,“used”:false},{“PRN”:126,“el”:30,“az”:141,“ss”:43,“used”:false},{“PRN”:68,“el”:4,“az”:357,“ss”:21,“used”:false},{“PRN”:69,“el”:7,“az”:44,“ss”:22,“used”:false},{“PRN”:74,“el”:20,“az”:154,“ss”:42,“used”:true},{“PRN”:75,“el”:59,“az”:164,“ss”:44,“used”:false},{“PRN”:76,“el”:63,“az”:314,“ss”:26,“used”:true},{“PRN”:77,“el”:10,“az”:327,“ss”:0,“used”:false},{“PRN”:84,“el”:2,“az”:43,“ss”:10,“used”:false},{“PRN”:85,“el”:56,“az”:30,“ss”:35,“used”:true},{“PRN”:86,“el”:59,“az”:244,“ss”:29,“used”:true},{“PRN”:87,“el”:2,“az”:228,“ss”:0,“used”:false}]}

Ok, so the problem is that it’s switching between a 2D lock and a 3D lock. When it’s only got a 2D lock, there is no altitude data, and piaware currently interprets that as “no position”. you then get a notification every time it goes from 2D back into 3D.

I’ll see what I can do for this case for 3.8.1

(in terms of the underlying cause … my initial guess was poor satellite geometry, but the SKY data suggests you’re seeing enough satellites above the horizon with reasonable SNRs, so I’m not sure…)

If this does not kill the memory card, then this is not a problem. In fact, I am experimenting with a local time server that would use GPS.
The fact that piaware discovered gpsd and uses it was an unexpected surprise for me. Perhaps this can be turned off because the receiver is stationary and there is no need to constantly update its coordinates.

There is a use-gpsd piaware config option that lets you do exactly that.

3 Likes

Hi OBJ et al -

Here it is 6-3/4 years later and I’m trying to use gpsd with Flightaware.

I have FA running, gpsd running, cgps -s shows good location and updates, but FA only updates location upon boot. When moving, there’s no position update. Diddled with use-gpsd but no difference.

Would like to update my position every 10-15 seconds or so as I drive down the highway. No network connection, just want to know if there are a/c really near or over my location, so polar coordinates with r = ground distance to target. Ideally, I’d have a radarscope readout that shows elevation angle maybe in a color. I want to be able to have a chance to spot an a/c while I’m moving.

Does FA do that yet?

Thanks again for supporting such a cool program!

Cheers - Jon

I can see a few possible issues here:

How far did you move? There’s a deadzone of ~250m.

The piaware location update stuff should work offline, but it’s not been tested, maybe you’re running into a bug specific to disconnected operation.

Where are you looking at for position updates? There’s no mechanism in the skyaware display to poll for an updated receiver location, if you want to see the receiver spot on the map move, you’ll probably need to force-refresh the page.

Good day OBJ -

Over 7 km. Drove toward KPHX from the house.

Did not try forcing a refresh of page. Will try that this am.

My object is to keep the center of the “map” (I know if not connected, there may/will be no new map underneath, but I’m using CARTO.com Light for the display) at my current location, range rings and all.

Thanks for the response.

Cheers and 73 - Jon N7UV

All-rightee!

Yes, refreshing the page does update the dot location. So does hitting the “reset map” button. But the two actions have different outcomes.

Refreshing the page accepts the new GPS position, but does not recenter the map on that position. I guess that’s to be expected. The range rings all stay as set before, but the whole bullseye drifts off screen as I move.

Hitting the reset map button recenters the map, but also forces the range rings and zoom level back to the default, which is not useful for my purpose.

Is it possible to add a feature to the map setup box below, that says “keep map centered on position”?

image

It’d be pretty cool to sit over by KSDL or KPHX and watch vehicles and a/c move around, and be able to compare tail numbers to what I see on the map and in front of my eyes.

Cheers and 73 - Jon N7UV