Building a Local ADS-B Flight Tracker with RTL-SDR and GNU Radio

From a 1090 MHz broadcast to an aircraft on a local map: how I built a receive-only tracker and what I learned at each step.

Project repository

1. Intro

I started this project with one question: how does an aircraft’s radio broadcast turn into a plane moving on a map? I built a receive-only tracker using an RTL-SDR Blog V4L, GNU Radio’s gr-adsb blocks, a small Python collector, and a browser dashboard.

It now works as a local 2D dashboard. I’ll walk through how each part contributes to that picture.

2. Demo dashboard

Before diving into the radio details, take the dashboard for a spin. It uses six fully synthetic aircraft, so feel free to click around. Select an aircraft from the list or map to open its details and received path; click empty map space to return to the overview.

Open the interactive demo in a new tab

3. Main concepts to know

ADS-B stands for Automatic Dependent Surveillance–Broadcast. In everyday terms, an aircraft figures out where it is using onboard navigation—usually GNSS—and broadcasts that position along with other details. Mode S is the broader transponder protocol: some messages answer interrogations, while Extended Squitter messages are broadcast on their own. My receiver listens for 1090 MHz Extended Squitter (1090ES), not the separate 978 MHz UAT link. The FAA overview explains the system.

1090ES uses pulse-position modulation (PPM) at 1 Mbit/s. Each message starts with an 8 μs preamble, followed by 56 or 112 data bits. A bit lasts 1 μs; a pulse in its first half means 1, and a pulse in its second half means 0. The DF17 messages I see are the 112-bit ADS-B Extended Squitter format. The ICAO technical description covers the format. Here’s the layout:

Bit positionsLengthFieldMeaning
1–55DFDownlink Format; 17 identifies ADS-B Extended Squitter from a Mode S transponder.
6–83CATransponder capability.
9–3224AAAircraft address, commonly called the ICAO address.
33–8856MEMessage field carrying the ADS-B data.
33–375TCType Code, the first five bits of ME. It tells the decoder how to interpret the message.
89–11224Parity / CRCError-detection bits checked by the decoder.

The Type Codes tell me what kind of update I’m looking at. These are the ones this project uses most:

Type CodeInformation
1–4Aircraft identification, such as a callsign.
9–18Airborne position and altitude.
19Airborne velocity, such as speed, track, and vertical rate.

Position has one extra wrinkle: latitude and longitude arrive in Compact Position Reporting (CPR) form, not as ordinary decimal coordinates. Each report is marked even or odd. For a global CPR position, the decoder combines a recent even and odd report from the same aircraft. Noise or overlapping transmissions can flip bits, so the decoder checks the CRC and rejects frames that fail. For more detail, see the ICAO description and Mode-S.org’s CPR reference.

4. Setup

I plugged the V4L into my MacBook Air M1 and assembled the dipole with its two elements extending in opposite directions from the base. For software, I used Radioconda and installed GNU Radio, RTL-SDR/OsmoSDR support, gr-adsb, and pyzmq in the same environment.

Before opening GNU Radio, I checked that the computer could see the dongle and stream samples. There’s a small rtl_test gotcha I’ll explain in the troubleshooting section.

The RTL-SDR Blog V4L receiver connected to a MacBook Air, with the antenna hardware visible in the foreground.
My receiver setup: the RTL-SDR plugged into the laptop before starting GNU Radio.
Sanitized terminal output from rtl_test: it detects one RTL-SDR Blog V4L, finds the Rafael Micro R820T tuner, reports sample streaming at 2,048,000 samples per second, and starts reading asynchronously. The device serial is redacted.
The computer sees the dongle and starts a sample stream. rtl_test keeps running; silence after “Reading samples in async mode…” means it has not reported dropped samples. This checks the device and sample stream, not ADS-B decoding. The serial number is hidden.

The editable flowgraph is adsb_rx_rtlsdr.grc; GNU Radio Companion generates adsb_rx.py from it.

5. Hardware and software: what each part does

Here’s how the aircraft broadcast travels through the receiver and dashboard.

Six steps from broadcast to map: aircraft send 1090 MHz PPM bursts; the RTL-SDR streams complex I/Q samples; GNU Radio detects and demodulates the message and checks its CRC; ZeroMQ passes decoded reports; Python filters fresh, plausible position reports and writes JSON; the dashboard maps only the positions received.
PartRole
Dipole antennaPicks up radio energy near 1090 MHz.
RTL-SDR Blog V4LTunes the signal and sends digital I/Q samples to the computer. It receives; it does not decode aircraft messages by itself.
GNU Radio / CompanionMoves samples through the flowgraph. Companion edits the graph and generates Python code.
gr-adsb blocksFind message bursts, demodulate the bits, check and decode supported Mode S / ADS-B messages.
ZeroMQCarries decoded messages from GNU Radio to the local Python subscriber.
Python subscriberGroups reports by aircraft, keeps recent data, filters positions, and writes the JSON snapshot.
Browser dashboardFetches the snapshot and draws aircraft and received paths on a MapLibre map.

6. Following the flowgraph

Now let’s follow one message from the antenna all the way to the map:

The GNU Radio Companion flowgraph: Osmocom Source feeds Complex to Mag², ADS-B Framer, ADS-B Demod, and ADS-B Decoder, then sends decoded messages to a ZeroMQ publisher. Time sinks monitor the signal at two points.
The saved GNU Radio Companion flowgraph used by the receiver.

6.1 Osmocom Source: sample the tuned signal

First the source tunes to 1090 MHz and samples at 2 million samples per second (2 MS/s). The saved graph uses 40 dB manual RF gain, plus 20 dB each for IF and baseband gain. That gives two samples for every 1 μs ADS-B bit. I and Q are the signal’s two components; together they describe its changing amplitude and phase. The source also needs the device index or serial for the SDR connected to your computer.

6.2 Complex to Mag²: expose pulse energy

The source gives us complex I/Q samples. The Mag² block turns each one into a power-like value:

power = I² + Q²

That makes the short pulses easier to spot. There’s no FFT in this decoder: it reads the pulse pattern over time.

GNU Radio Complex to Mag² time sink, showing low background power with intermittent narrow signal peaks over roughly 500 microseconds.
This is the Mag² output that feeds the framer: mostly low-level background with brief energy peaks. It is a signal diagnostic, not decoded aircraft data.

6.3 ADS-B Framer: find candidate bursts

The framer scans for energy above a threshold, then checks whether the pulse timing looks like the known preamble. If it matches, the framer marks a candidate burst for the demodulator. The threshold isn’t receiver gain: lowering it may reveal weaker bursts, but it can let more noise through too.

6.4 ADS-B Demod: recover the bits

Once the framer finds a likely burst, the demodulator compares the two halves of each 1 μs bit and decides where the pulse landed. Those decisions become the bit sequence passed to the decoder.

GNU Radio time sink connected to the ADS-B Demod output. The trace contains signal peaks and a red horizontal reference at the configured 0.0005 threshold.
This second time sink is connected to the ADS-B Demod output. The red line is the 0.0005 reference threshold; this is a later processing stage than the Mag² graph above.

6.5 ADS-B Decoder: validate and interpret a message

This is where the bits turn into aircraft information. The decoder checks the CRC, reads fields such as the downlink format and aircraft address, and interprets the Type Code. My graph uses Extended Squitter with error correction set to None, so it doesn’t try to repair failed frames. A CRC-passed message can still lack a usable position: airborne coordinates are CPR-encoded, and the decoder needs compatible reports before it can produce latitude and longitude.

GNU Radio decoder log: the first DF17 frame fails CRC. The next passes CRC and decodes aircraft address A0AFA5, Type Code 11 airborne position, and altitude 5,000 feet. The log reports valid_lat_lon false and NaN latitude and longitude, with raw CPR values lat 114418 and lon 66435.
My actual decoder output. The first DF17 candidate fails CRC; the next passes and decodes an airborne-position message with altitude. `valid_lat_lon: False` and `nan` mean the decoder has no usable coordinates to publish yet.

6.6 ZeroMQ and Python: pass only fresh positions

The decoded message then crosses from GNU Radio to my code over ZeroMQ at tcp://127.0.0.1:5001. aircraft_stream.py subscribes and groups reports by ICAO address. Because the decoder can carry an old latitude and longitude into a later callsign message, my subscriber checks the raw PDU bits and only accepts coordinates from airborne-position reports (DF17/18, TC 9–18):

frame_type = mode_s_df_and_type_code(pdu)
is_airborne_position = (
    frame_type is not None
    and frame_type[0] in {17, 18}
    and frame_type[1] in range(9, 19)
)

lat = finite_number(metadata.get("latitude")) if is_airborne_position else None
lon = finite_number(metadata.get("longitude")) if is_airborne_position else None

That way a callsign update can refresh the aircraft details without pretending the plane’s position was just updated. The subscriber also rejects implausible short-interval jumps, keeps up to 500 track points per aircraft, and starts a separate visible segment after a gap over 120 seconds. These checks help keep wild lines off the map, though no filter can guarantee every coordinate is right.

The subscriber keeps state in memory and safely replaces aircraft_snapshot_live.json as updates arrive. The dashboard fetches that file every 1.5 seconds. I initially sketched a SQLite database and local API, but the current build doesn’t have either; persistent storage can come later.

6.7 Dashboard: map observations

The browser draws each aircraft as a small plane silhouette. With two recent positions, the icon points along the direction it’s moving; with only one, it can use the reported heading. Select a plane to see its details and path. Missing fields show N/A. I leave out model, origin, and destination because this decoder doesn’t provide them. The displayed distance and duration describe what my receiver observed, not the aircraft’s whole trip.

7. Problems I faced while building

Things that broke along the way (open for fixes)

“No E4000 tuner found” from rtl_test -t

The dongle was detected and reported a Rafael Micro tuner, but rtl_test -t complained that it couldn’t find an E4000. It turns out -t runs an E4000-specific benchmark. For a general streaming check, I ran rtl_test without the flag and stopped it with Control-C.

Flat graph, small bursts, and the detection threshold

My main time sink stayed near zero even though the Mag² graph showed little bursts of energy. The threshold started at 10m (0.01 in GNU Radio notation); I lowered it to 0.0002 while tuning. The saved flowgraph now defaults to 0.0005. Lowering the threshold doesn’t amplify anything—it just lets the framer consider weaker candidates—so I watched for decoded messages too.

PMT rejected a NumPy float; NumPy rejected np.NaN

The framer stopped on ValueError: can't convert <class 'numpy.float32'> type to pmt. It was passing a NumPy scalar where PMT expected a regular Python float. This conversion fixed that local package error:

pmt.to_pmt(("SOB", float(snr)))

Then the installed decoder hit another compatibility issue: NumPy 2 removed np.NaN. Changing it to np.nan fixed that one. Both edits live in my local Radioconda package; they aren’t tracked as project patches yet.

Companion froze and the terminal was hard to read

Running the generated adsb_rx.py from its own Terminal kept the logs visible. I set the decoder print level to None to quiet the debug flood, then added start_flight_tracker.command so I could start the subscriber, flowgraph, and web server together.

Implausible map jumps

I traced the huge jumps to a coordinate sanity check in gr-adsb that compared latitude twice and never checked longitude. There’s now a project patch for that. The subscriber also checks whether nearby points imply an impossible speed, and the dashboard breaks the line after long gaps.

8. What I learned

The biggest thing I learned is to check each stage separately. A visible dongle doesn’t mean a working receiver; signal energy doesn’t mean a valid frame; and a valid frame may not include a position.

GNU Radio gave me a way to learn from existing DSP and ADS-B blocks without writing a decoder from scratch. My code picks up after those blocks and turns their output into a tracker I can shape myself.

9. Running the project

To run it live, point FLIGHT_TRACKER_PYTHON in .flight-tracker.env at the Python executable in your GNU Radio environment, then launch:

cp .flight-tracker.env.example .flight-tracker.env
# Edit FLIGHT_TRACKER_PYTHON in .flight-tracker.env
./start_flight_tracker.command

The launcher starts the subscriber, flowgraph, and local web server, then opens the dashboard for you. Keep its Terminal window open; press Control-C there when you’re done. A live setup on another computer needs the SDR, GNU Radio, compatible gr-adsb blocks, and Python dependencies.

10. References