Tracking airplanes in real time with ADS-B

Decoding

Prior to the adoption of satellite assisted navigation, it was fairly difficult to determine the position of an aircraft. As a result, ADS-B originally coded only the flight number, flight altitude, direction and speed. The receiver added a time stamp. This information was sufficient to act as a form of basic protection against collision with other aircraft and as a means of providing identification to ground based surveillance radar. When an aircraft in transit received ADS-B signals, this meant that another aircraft was most probably located somewhere in the area. Crews took precautionary measures if signals indicated that the flight level of the transmitting aircraft was the same as their their own.

Beginning with the introduction of GPS, ADS-B data telegrams transmit the position of the aircraft with an accuracy of within 100 meters. This is equivalent to specifying degrees with up to three decimal places. Information that is this detailed no longer fits into a 112 bit data string. Therefore the so-called Compact Position Reporting (CPR) function divides the information into two data telegrams. One of these is an odd frame and the other even. The two can be distinguished by figuring out whether the 22nd data bit (F Flag) has been set to 1 (EVEN) or 0 (ODD) [7].

Dump1090 assumes the tedious task of decoding. The pre-converted data appears with a simple call and without the need for any additional switch. In the example taken from Listing 6, the 112 bit hex string contains the ODD frame information for longitude and latitude. Calling Dump1090 with the --interactive switch computes all of the flight data and then displays them in a table (Figure 2).

Listing 6

Output of dump1090

$ ./dump1090
*8d3c675458c38511495f2a4769a9;
CRC: 000000 (ok)
DF 17: ADS-B message.
  Capability     : 5 (Level 2+3+4 (DF0,4,5,11,20,21,24,code7 - is airborne))
  ICAO Address   : 3c6754
  Extended Squitter  Type: 11
  Extended Squitter  Sub : 0
  Extended Squitter  Name: Airborne Position (Baro Altitude)
    F flag   : odd
    T flag   : non-UTC
    Altitude : 38000 feet
    Latitude : 34980 (not decoded)
    Longitude: 89898 (not decoded)
Figure 2: This is an example of using the call ./dump1090 --interactive to update data in the terminal window.

The value in the first column stands for the unchangeable 24 bit mode S address for the transponder. The airplane gets the transponder code (Sqwk) from air traffic control. It is valid for as long as the aircraft remains in the monitored air space. The Flight column contains the flight number. Altitude (Alt) and speed (Spd) appear in feet and knots. The flight heading (Hdg) shows the angle to north. Accordingly, 067 corresponds to the direction east by northeast. Latitude (Lat) and longitude (Long) are shown in degrees. The relative signal strength is shown in the Sig column. Each of the following columns provide information about the frequency with which data telegrams are received. See below for how a telegram receives a time stamp.

If the user wants to place the data in a file for analysis, replicating the column headings and the horizontal line can be problematic. Listing 7 shows how to use Egrep in order to filter the data before placing it in the flightdata.txt file.

Listing 7

flightdata.txt

$ ./dump1090 --net --interactive | egrep -v ,Hex|----' > flightdata.txt

Webserver

The Dump1090 program has its own webserver. It is started by calling Dump1090 with the --net switch. The application writes the current position data to the directory path of the server. This is accessed viahttp://localhost:8080/data.json. Just type https://localhost:8080 into the web browser. The home page Java script filesread the data continuously and write the airplane location to a map (Figure 3).

Figure 3: Airplanes on an interactive map.
Figure 4: The examples delivered by the manufacturer show the current CPU load.

The switch at the upper left of the map determines the map source. You will run into some problems if you select the free map OpenStreetMap. The Google logo remains visible and the link to the free OpenStreetMap license is missing. We have corrected both of these issues for Figure 3. The number of flight paths is also not correct. The webserver only displays the flight path for the flight that has just been clicked.

Specify the port with the parameter --net-http-port 8080 (Listing 8). In the example this port 8080. The flag --aggressive increases the number of recognized airplanes via limited redundancy testing. The --metric switch converts the altitude and speed into meters and kilometers per hour by dividing the altitude by 3,2828 and multiplying the speed by 1,852.

Listing 8

Output of dump1090 --aggressive

$ ./dump1090 --net --net-http-port 8080 --aggressive --interactive --metric

Buy this article as PDF

Express-Checkout as PDF

Pages: 7

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Taking the Raspberry Pi over hill and dale

    The Raspberry Pi is the heart of many different projects, be they navigation devices or flight scanners. When equipped with a suitable keyboard and simple monitor, the little computer can also be put to use for tasks in the great outdoors.