Skip to content

3. ADS‐B

JJX edited this page Sep 13, 2024 · 7 revisions

If you already have an instance of Dump1090 or one of its forks running you can directly start feeding

Hardware preparation

You need to change the id / serial number of the SDR dongle you want to use for ADS-B, to distinguish it reliably from other rtl-sdr dongles. You do not want to mix it up after a reboot, it will result in not working ADS-B.

Plug your ADS-B dongle in a PC with no other RTL-SDR dongle connected. This can be your Raspberry Pi or every other linux computer with the rtl-sdr library installed.

Set the new serial with

rtl_eeprom -s 10000001

Now you can access your stick with the serial number 10000001. Beware that smaller numbers like 2 do not work.

Install dump1090-fa

sudo apt-get install dump1090-fa
  • Reboot the Pi and connect via ssh again

NTP

An accurate clock is needed for us. The Pi itself does not contain a realtime clock but NTP will be good enough. Make sure you have a working NTP configuration by typing

timedatectl

The resulting output should look like this

               Local time: Sat 2022-02-26 22:35:33 UTC
           Universal time: Sat 2022-02-26 22:35:33 UTC
                 RTC time: n/a
                Time zone: 
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no

Make sure that the system clock is syncronized

Configure dump1090

sudo nano /etc/default/dump1090-fa
  • Set your receiver location
  • To determine the position do not use your mobile phones GPS functionality since it can be quite unreliable, instead use a service like openstreetmap.org where you can right click on the map to show the address and coordinates.
LAT="51.xxxx"
LON="7.yyyyy"
  • Turn on adaptive gain settings (recommended)
ADAPTIVE_DYNAMIC_RANGE=yes

Start dump1090

sudo service dump1090-fa start

Check the output

  • Check the number of planes you receive
cat /run/dump1090-fa/aircraft.json|grep -c hex
  • It is very likely that it won't work, in this case you need to check the log
tail -f /var/log/dump1090-fa.log
  • If you run into the following error message
Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules
  • You need to create a udev rule file for your particular rtl-sdr dongle
  • To do this check the vendor id and product id of your usb dongle
lsusb
  • It will give you a list of all the USB Devices connected similar to the following one
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • The vendor id in this case is 0bda and the product id is 2838
  • Now create a rule file
sudo nano /etc/udev/rules.d/rtl-sdr.rules
  • And put the following in it
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838",  MODE="0666"
  • Dont forget to change the vendor and product id to the ones matching your sdr dongle
  • now reboot and check again if you see a number of Planes and if not check the logfile again

Request API credentials

  • Request a station name (location/city) by sending an email to us: [email protected]
  • Station name policy: We want to keep it clean and tidy. E.g. if you live in Berlin and you're the first station there, we'd assign you "Berlin". If that's already taken and the station is e.g. in the Koepenick district of Berlin, we'd give you "BerlinKoepenick" as station name.

Connecting to the Chaos ADS-B API

To continue you need to add the repository to your system like shown in the Install Chapter

Install the feeder application

sudo apt install adsbfeederc2is

If you are not asked for your credentials during the installation of the package, run

sudo nano /etc/default/adsbfeederc2is

Fill in your credentials. Then, restart the service with

sudo systemctl restart adsbfeederc2is

Make it work with other forks of dump1090

If you are not using the mutability fork of dump1090 the aircraft json file can be in a different path. You can change the path in /etc/default/adsbfeederc2is according to your setup.

If you are using readadsb you may need to activate json output first. Check here for more info https://github.com/wiedehopf/readsb/blob/dev/README-json.md

Take it a step further