SWA Flights in PiAwate with No SWA Prefix

Has anyone else noticed in PiAware that many of the SWA flights do not have the “SWA” prefix on the flight number? When you click on the show in FlightAware link, it comes to an error page, but adding SWA to the number resolves it.

Is this a problem with how we are receiving the ADS-B data, or how SWA is broadcasting it?

Southwest isn’t putting their ICAO callsign/prefix (SWA) in the transponder. We fix this on our backend but PiAware doesn’t have a way to do it currently.

I have the same issue with WestJet flights. I used an if statement to check for alpha characters, if there are none I prepend WJA to the flight number for the FlightAware link. For your situation you would prepend SWA. So far, it has worked out well, and all the flights that only contain numbers are indeed WestJet flights that are tracked in my coverage zone in accordance to my pi’s readings.

You can edit the script.js file in the dump1090/public_html file to include it.

Traverse to the directory:



cd /usr/share/dump1090/public_html/


Open up the editor with script.js:



sudo vi script.js


Travel down the file with page down until you come up to the line that says



html += '&nbsp;<a href="http://flightaware.com/live/flight/'+selected.flight+'" target="_blank">[FlightAware]</a>';


Type the letter “i” to get into “INSERT” mode, you should see “-- INSERT --” at the bottom left of your screen.

Change the file to look like this:



if (!selected.flight.match(/[a-z]/i)){
        html += '&nbsp;<a href="http://flightaware.com/live/flight/SWA'+selected.flight+'" target="_blank">[FlightAware]</a>';
        }
        else{
    html += '&nbsp;<a href="http://flightaware.com/live/flight/'+selected.flight+'" target="_blank">[FlightAware]</a>';
    }


Push the escape key, then type:



:wq!


That will save and quit the editor.

Go to your webpage and reload it. Now the flight number will show up in the list with just the numbers, but if you click on the FlightAware link at the top, it will add the SWA to the link and bring you to the proper flight.

There is also a way to change it in the table, I can post that if you would like.

Hope this helps.

Actually what would be really handy here is if there was a FlightAware URL based on the 24-bit ICAO identifier that redirected to the correct flight page. (Hypothetically, something like flightaware.com/live/icao/0DECAF)
The local map has the ICAO value to hand, and that’s much more likely to be correct than the callsign - and FlightAware has the data to pick the right flight from the ICAO.

Yeah that’s doable.

Alaska is the same way, so I see West Jet, SWA and Alaska here in Seattle and only get flight numbers.

Great idea. That would also help resolve (easily) identifying A/C with out full ADS-B. I wouldn’t have to manually look it up.

Nice idea, could turn into a maintenance headache as aircraft ownership changes (maybe tables like this could be maintained by trusted contributors).

Well, my point was that if FlightAware have managed to do the mapping from 123 → SWA123 from the information in the data feed (which is keyed by ICAO) already, then they have the data to do an ICAO → flight mapping immediately, ownership changes or not.

Was there a place where we could download the ICAO information locally? I know there are sites where you can query them but using a script to constantly query the site would be frowned upon (or query it once and cache it locally may be okay but if everybody starts doing that, that would be a bad thing.)

http://www.airframes.org/ will allow you to search the ICAO number. Unfortunately it does not allow “outside” queries.

You can download the US database from the FAA. It gets updated monthly. It’s large. In a text only file, the master is 193 MB.

I wouldn’t trust that web site. I entered my N number and it came up with data from when it was registered to another A/C (cancelled in 2008). So, they’re not updating correctly. My A/C has had N456TS from year 2011+.

Perhaps you should contact the admin and mention it?

Thought on WestJet, I know we can force it so it shows up but there are other carriers in the US that are doing this also (like SWA). I think the ICAO registration for WestJet - they all start with “C” so we can make that assumption if there are flights showing just the number and the ICAO starting with “C”.

Of course, there are more than just one carrier in the USA that is doing that so there’s still the problem…

There are dozens of carriers around the world that do this, so we need to implement a more granular solution like we do on the FA back-end.

I know it’s probably not high on their priority list, but I was able to do it with the FAA’s database in a few minutes of rusty coding.

You can check it out at http://theonlyski.com/query.php?ICAO=A63D42 (change the ICAO ID for the aircraft you want to search for).

If I can do it, FA surely can!

It’s worth mentioning, this is only the FAA database! Also don’t bother with SQL injection attempts, you’ll be wasting your time. 8)