FlightAware Discussions

Location is wrong on Skyview, but GPS is correct

My newly installed Piaware setup is working fine, except that my position shown on the Skyview map is about 500 metres off.

I have a GPS module on my Pi in order to use it as an NTP server; it’s also running Pihole as my DNS server. I think having the GPS is stopping me from being able to set the location manually in my site configuration on the Flightware My ADS-B page. I know I could set it manually for another Pi that did not have a GPS but I want it running on my main Pi. The config page just says “Your site location is set by your receiver.” and does not have the “set location” or “set height” buttons.

My GPS is spot-on with my location right now, although it does tend to jump around a little within 10m or so.

Is there anything I can do to fix this? Other than remove the GPS, that is.

There is a dump1090-fa setting controlling this accuracy:

dump1090-fa --help
--json-location-accuracy <n>  Accuracy of receiver location in json metadata: 0=no location, 1=approximate, 2=exact

On the piaware sd-card this is already set to exact, so your actual position must be wrong.

Is the position on your Flightaware stats page exact? (https://flightaware.com/adsb/stats/user/SpartanX#stats-100490)

Easiest solution is probably to change piaware not to use gpsd:

sudo piaware-config use-gpsd no

Then you can switch back to your feeder id for your first station (https://flightaware.com/adsb/stats/user/SpartanX#stats-100479)
(For Beginners - How to Get Back Existing Station Number in A Fresh Install)

Because once “Location: Receiver” is displayed on the stats page you can’t manually change the position anymore.

You could also reset the feeder-id and set claim a new station:

sudo systemctl stop piaware
sudo piaware-config feeder-id ""
sudo rm /var/cache/piaware/feeder_id
sudo systemctl start piaware

I’m not sure why your position would be that wrong when you say it only changes by 10m?
Setting the position manually is a good idea anyway.
Let’s see if that helps.

So it seems setting

sudo piaware-config use-gpsd no

introduces all kinds of errors for me.

But it seems all that happens is that the system log gets spammed, piaware is still working.

Anyway you can set this option back to yes if you don’t like getting your syslog spammed.

What are the errors?

Good morning. I’m not using the piaware sd card; I installed everything manually on an existing Raspbian Stretch system. I did follow the instructions here: https://flightaware.com/adsb/piaware/install to install piaware and dump1090-fa.

The position given on the stats page is accurate, and changes to reflect the little bit of jumping around my GPS does so it’s clearly getting the correct coordinates from gpsd. I have no idea why the location on the map should be 500m off. The GPS was not turned off throughout the installation so should have given good coordinates even immediately after a Pi reboot.

The use-gpsd option isn’t recognized on mine:

pi@PiHole:~ $ sudo piaware-config use-gpsd no
warning: cannot set option ‘use-gpsd’, it is not a known config option

I tried piaware-config -showall and use-gpsd wasn’t listed in the settings. I should be using the latest piaware I would think, 3.6.3, since I only installed it the other day.

Where would I put the dump1090-fa accuracy option so that it’s applied at startup?

Well it looked like multiple errors but it’s justone:

Apr 11 10:15:56 pi piaware[615]: failed to write status file: invalid command name "gpsd"
Apr 11 10:15:56 pi piaware[615]: traceback: invalid command name "gpsd"
Apr 11 10:15:56 pi piaware[615]:     while executing
Apr 11 10:15:56 pi piaware[615]: "gpsd is_connected"
Apr 11 10:15:56 pi piaware[615]:     (procedure "build_status" line 91)
Apr 11 10:15:56 pi piaware[615]:     invoked from within
Apr 11 10:15:56 pi piaware[615]: "build_status"
Apr 11 10:15:56 pi piaware[615]:     (procedure "write_status_file" line 2)
Apr 11 10:15:56 pi piaware[615]:     invoked from within
Apr 11 10:15:56 pi piaware[615]: "write_status_file"

Which is fixed by:

Edit: Yeah that’s as not a fix.

The error comes from programs/piaware/statusfile.tcl: The procedure gpsd is called but it doesn’t exist when use-gpsd is set to no.

Sorry i assumed you were on a piaware sd-card install.

On the package install it is easy, just edit

sudo nano /etc/default/dump1090-fa

It is in the last line, change the value after --json-location-accuracy to 2.
Ctrl-o and enter to save and Ctrl-x to exit. (or use any editor you like)

Yeah sorry it seems to be a new option in a testing version.
Anyway if you don’t mind your position being set by gpsd you don’t need that option anyway.

Ah yes, there’s the config file. I didn’t look in ‘default’ (everywhere else but not there).

I wondered if you were running a test version :wink: that explains it. I don’t mind the location being set by gpsd; it’s generally within a few metres. Unfortunately I bought the expensive GPS module, which it seems doesn’t have a ‘static location’ setting like the cheap ones do for use in timekeeping systems. I do have a cheap Chinese module on the way though.

My concern was more that the wrong location was being used for MLAT, than simply looking wrong on my map. Hopefully that won’t be the case since the stats page shows the correct coordinates so clearly piaware is seeing them.

…and setting that dump1090-fa option to 2 has done the trick. My map now shows where I am!

Thank you for the help - I’m happy now :smiley:

Now I just need to work on a better antenna than the one I made from a coffe can and bit of stripped coax in 2 minutes at 3am :laughing:

Yeah the “fix” i posted before was incorrect, you probably saw that already.

This should work though and it at least produces no errors for “use-gpsd no”.

diff --git a/programs/piaware/statusfile.tcl b/programs/piaware/statusfile.tcl
index c3417b4..403128b 100644
--- a/programs/piaware/statusfile.tcl
+++ b/programs/piaware/statusfile.tcl
@@ -156,7 +156,7 @@ proc build_status {} {
        # gps: GPS fix status
        # only report this if we actually got a gpsd connection at least,
        # as most installs won't have GPS.
-       if {[gpsd is_connected]} {
+       if {[piawareConfig get use-gpsd] && [gpsd is_connected]} {
                if {[info exists ::locationData(gpsd)]} {
                        lassign $::locationData(gpsd) lat lon alt altref
                        set data(gps) [status_entry "green" [format "GPS 3D fix at %.3f,%.3f" $lat $lon]]

Anyway it’s probably not a pretty fix but it’s a fix.

Is there a way to display the lat/long of the mouse on the skyview map (or a grid on the map). I see the lat/long of planes in the table , but not on the map.

The reason I want this is if a plane reports their position (by voice) in lat/long , I would like to easily move the cursor to that position

Not by default, but if you have a look at this GitHub repository: https://github.com/alkissack/Dump1090-OpenLayers3-html

One of the modifications there is to do exactly that.