Featured image of post Automatic Dependent Surveillance-Broadcast (ADSB)

Automatic Dependent Surveillance-Broadcast (ADSB)

W3RDW Blog - First Post

This is the first post from my HAM radio hobby site, https://w3rdw.radio. From now on, I will be posting HAM radio content only on the W3RDW site. You can find a link on my WhiteMatterTech site.


Creating an ADS-B Flight Tracker Using Affordable Equipment and Docker on Ubuntu

This guide will demonstrate how to set up an ADS-B flight tracker using an inexpensive antenna, Docker, and Ubuntu. ADS-B, which stands for Automatic Dependent Surveillance – Broadcast, is a technology that enables aircraft to determine their location using satellite navigation and transmit this information periodically. By establishing your own ADS-B receiver, you can monitor flights in your vicinity and contribute to the global flight tracking network.

My setup consists of an ESXi host with an Ubuntu 21.04 VM. The recommended USB dongle is passed through to this VM. While a deep understanding of Docker isn’t mandatory, it can be helpful for addressing potential USB issues and making custom configurations. If you need help installing Docker, refer to this Docker installation tutorial and this Docker Compose installation tutorial.

Prerequisites

To get started, you’ll need an RTL SDR USB dongle, an ADS-B antenna, and an Ubuntu machine (either physical or virtual). The SMA extension cable is optional but can be useful for extending the antenna’s reach. Here are some recommended components:

Please note that I may earn a commission for purchases made through the affiliate links below, which helps support this blog. The price remains the same for you, regardless of whether you use my links or not. Thank you for your support!

Step 1: Hardware Setup

Setting up the hardware is simple.

  1. Connect the ADS-B antenna to the RTL SDR USB dongle, using an extension cable if needed.
  2. Connect the RTL SDR USB dongle to your Ubuntu machine.
  3. Verify that your system recognizes the USB dongle.

Step 2: Configuring Environment Variables

Create a .env file in your project directory and configure the following environment variables with your specific information:

1
touch .env
1
2
3
4
5
6
7
8
9
FEEDER_TZ=America/New_York
ADSB_SDR_SERIAL=0
ADSB_SDR_PPM=001
FEEDER_LAT=your_latitude
FEEDER_LONG=your_longitude
FEEDER_ALT_M=altitude_in_meters
FEEDER_ALT_FT=altitude_in_feet
FEEDER_NAME=whatever_you_want
FR24_SHARING_KEY=sharingkey_from_flightradar24.com

Step 3: Defining the Docker Compose Configuration

We’ll create a docker-compose.yml file to define the services for our ADS-B flight tracker. This file will include readsb for data collection, fr24 for Flightradar24 integration, tar1090 for web-based visualization, and watchtower for automated updates.

  • readsb: Collects data from the ADS-B receiver and makes it available for processing, visualization, and integration.
  • fr24: Integrates your ADS-B data with Flightradar24, a widely used flight tracking service. Sharing your data with Flightradar24 allows you to contribute to their network and access additional features.
  • tar1090: A web-based tool for visualizing ADS-B data, providing a user-friendly interface to track aircraft, view flight paths, and explore flight information.
  • watchtower: An automated update tool for Docker containers that ensures your ADS-B flight tracker components are always current by automatically downloading the latest Docker images and restarting the services.

Create the docker-compose.yml file in your project directory:

1
touch docker-compose.yml

Paste the following configuration into the docker-compose.yml file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
version: '3.8'

volumes:
  readsbpb_rrd:
  readsbpb_autogain:

services:
  readsb:
    image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest
    tty: true
    container_name: readsb
    hostname: readsb
    restart: always
    devices:
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - 8080:8080
    environment:
      - TZ=${FEEDER_TZ}
      - READSB_DEVICE_TYPE=rtlsdr
      - READSB_RTLSDR_DEVICE=0
      - READSB_GAIN=autogain
      - READSB_LAT=${FEEDER_LAT}
      - READSB_LON=${FEEDER_LONG}
      - READSB_RX_LOCATION_ACCURACY=2
      - READSB_STATS_RANGE=true
      - READSB_NET_ENABLE=true
    volumes:
      - readsbpb_rrd:/run/collectd
      - readsbpb_autogain:/run/autogain
    tmpfs:
      - /run/readsb
      - /var/log

  fr24:
    image: ghcr.io/sdr-enthusiasts/docker-flightradar24:latest
    tty: true
    container_name: fr24
    restart: always
    depends_on:
      - readsb
    ports:
      - 8754:8754
    environment:
      - BEASTHOST=readsb
      - TZ=${FEEDER_TZ}
      - FR24KEY=${FR24_SHARING_KEY}
    tmpfs:
      - /var/log

  tar1090:
    image: mikenye/tar1090:latest
    tty: true
    container_name: tar1090
    restart: always
    depends_on:
      - readsb
    environment:
      - TZ=${FEEDER_TZ}
      - BEASTHOST=readsb
      - MLATHOST=mlathub
      - LAT=${FEEDER_LAT}
      - LONG=${FEEDER_LONG}
      - GRAPHS1090_DARKMODE=true
    tmpfs:
      - /run:exec,size=64M
      - /var/log:size=32M
    ports:
      - 8078:80

  watchtower:
    image: containrrr/watchtower:latest
    tty: true
    container_name: watchtower
    restart: always
    environment:
      - TZ=${FEEDER_TZ}
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_POLL_INTERVAL=86400
      - WATCHTOWER_ROLLING_RESTART=true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

You should now have a .env file and a docker-compose.yml file in your directory, ready to launch the services.

Step 4: Launching the ADS-B Flight Tracker

Open your terminal, navigate to the directory containing the docker-compose.yml file, and run the following command to start the ADS-B flight tracker:

1
docker-compose up -d

This command downloads the required Docker images and starts the services defined in your docker-compose.yml file. Your ADS-B flight tracker will then begin receiving and processing data from aircraft in your area.

Step 5: Accessing the Web Interface

Once the services are operational, you can access the web interfaces:

  • ADSB Data: http://localhost:8080 (using readsb)
  • Flightradar24 Integration: http://localhost:8754

These interfaces display real-time data about nearby aircraft, including flight paths and other pertinent information.

To make these resources accessible on the web, consider setting up a CloudFlare tunnel for secure tunneling. You can find a guide on how to do this here: https://nexus-security.github.io/using-cloudflared-for-tunneling-to-internal-resources/.These tutorial can help you securely access your ADS-B data both internally and externally, just like I do: https://adsb.w3rdw.radio.

Conclusion

You’ve successfully set up an ADS-B flight tracker on Ubuntu using affordable equipment and Docker. This setup allows you to track flights and contribute to the global ADS-B network. The web interfaces provide real-time flight data, paths, and other valuable information about air traffic in your region. Feel free to explore additional features and customize your setup to enhance your ADS-B flight tracking experience. Happy tracking!

Licensed under CC BY-NC-SA 4.0