2xSDR Pi

SDR using Raspberry Pi: Tracking airplanes above our heads – recieving ADS-B data with visualization using DVB-T dongle

Raspberry Pi SDR

 

Note: There’s a newer version of this entry – updated with latest tests, much easier to install: https://blog.jokielowie.com/en/2017/01/sledzimy-samoloty-cz-2-ads-b-i-mlat-najtanszy-odbiornik-dla-flightaware-oraz-flightradar-24/.

Last time I’ve shared with you the Raspberry Pi “computer for a buck”. Unless you’re are learning Python or playing Minecraft – or better – you’re already bored – I have a new thing fro you. It’s a very nice idea that you can use as your graduation or school project – and it’s all about tracking airplanes high in the sky. From hardware point – you will need a DVB-T/DAB USB dongle – quite easy to obtain and also – quite cheap. We will be aiming to build a very cheap platform to send data back to Flight Radar 24 (and for us too), which gives us premium access and increases coverage of this particular service. So what’s it all about ?

  • spotting – it’s basically taking photos of the airplanes (regular airlines) that are travelling at RNAV. To take a photo – you need to know exactly when they are gonna fly-by and you need to know who’s flying – where to, where from etc.
  • receiving radio signal – we need to receive a specially modulated signal that airplanes are sending and interpret it – I’ll get back to this
  • drawing on the map the up to date position of the airplane and sharing this over local network
  • you can also try to listen to classic FM radio
  • as well as CB, TAXI corporations chatter
  • tracking amateur baloons that go up high into stratosphere
  • if you live near the airport you can also listen to chatter just like LiveATC.net does
  • basically listening to any radio from 50MHz to 2GHz, and demodulating digital signals
  • feeding FlightRadar24 with data and getting premium access


So it’s a lot like HAM Radio, but you don’t need any license – because we’re just listening. Before Internet age, HAM radio was very popular, then got a bit forgotten. Today we have resurection – a lot of interest, because of the cheap electronics. Don’t forget – we’re not TRANSMITTING – just listening, we don’t need LICENSE and we don’t need to build exciters. But what do we need – some expensive equipment ? No! Thanks to great work on drivers for USB dongles with Realtek chipset (DVB-T, DAB or FM) by Antti Palosaari, he discovered that they can be configured to pass-through any raw radio data – not demodulated – leaving this to the software. Hence SDR – Software Defined Radio.

You wil need:

  • any PC with Windows or Linux (preferably RaspberryPi/Linux any vesion, since it’s very low on power – can run anytime)
  • USB DVB-T  dongle– tuner USB to receive DVB-T/DAB(+). There’re many combination those with Eltronics 4000 (E4000) tuner seem to be the best to our project.  But it’s always the RTL2832U chip that is need. So take this tuner+chipset combination in mind.
  • OPTION: piece of copper wire to get better reception of our data – a better antenna
 antena_parts-300x258

 

The DVB-T dongle is easy accessible – Ebay, brick and mortar shops, just take caution on the tuner. One option is here ($13 with postage): http://dx.com/p/rtl2832u-r820t-mini-dvb-t-dab-fm-usb-digital-tv-dongle-black-170541. Browse through comments to find out otherm more up to date soruces. Let’s begin!

  • let’s make sure that our Raspberry Pi works with Rasbian using kernel version of at least 3.6.11+. To check:

    We should get this or better (4.x.yz is also fine – just above 3.6.11+):

    If not – update your kernel using the following command:

    After reboot we should find the latest kernel running

    This means that our dongle has been recognized. Now attach the antenna that comes with the dongle and try to position it near window (it’s magnetic). The standard antenna could give us coverage of anything between 50 up to 80km. Airplanes use the 1090MHz frequency for ADS-B, and it’s attenuated by clouds so if it’s raining – expect 30-40km range. Such antenna is good for a start, but it’s a good idea to ask for help – a fellow HAM radio operator will help yopu to build an antenna for up to 200km coverage. He will speak of things like Ohms and impendance.

  • Insert the USB dongle – and enter:

    Which should give us the confirmation of the chipset running:

  • Let’s start to install software – first some libraries to build software to decode ADS-B messages:

  • Now we need the sources using git – the application called rtl-sdr. No worries it’s just like using other Linux distros: Gentoo, Ubuntu czy ArchLinux. For our Raspbian we enter those commands:

  • This will pull necessary files and start build (complilng, linking etc.) If this fails – name your error in comments. Let’s test our  rtl_sdr library (this will most likely fail but read along):

  • Great! But if it failed – which is common nowadays, since most of the kernels in Pis will properly recognize the DVB-T as it supposed to be: DVB-T dongle reciever and NOT a SDR device as we want it – we need to tell Pi to communicate in our RAW SDR mode with the dongle. All out need to do is to create the file:

    which will tell Pi that it’s not supposed to load drivers (called kernel modules) when this donlge is inserted or found in USB slot:

  • Reboot. If it works well now we can build another needed program – this time to interpret the messages: dump1090:
  • That’s it now enter:

  • which should give you simliar data – given we have planes in range and correctly installed antenna:

  • Yeah this works on this little antenna! But how to display that in some fancy way ? Let’s choose a very nice and well maintained VirtualRadar, which works using .NET 3.5 in Windows or with mono on Linux
  • After instalaltion we should change the protocol to BaseStation, and in network options we set our IP address of Raspberry Pi running dum1090 (here it’s 10.0.0.212), with default port of 30003.
  • VirtualRadar shows the data using Google Maps and local webpage, so start your fav browser and enter: http://127.0.0.1:8080/VirtualRadar/GoogleMap.htm
Configuration of VirtualRadar
Configuration of VirtualRadar
Virtual Radar working with Pi
Virtual Radar working with Pi
ADS-B antenna
ADS-B antenna

How to get Flight Radar Premium account

  • Let’s share the data for fun and profit! Download always updated fr24feed_arm-le_225s and register on Flight Radar webpage to get the key. Type it as HERETYPETHEKEY:

  • If it’s correctly connecting – it will look like this:

  • And after a short while you will get your premium access – confirm you’re feedeing the data. dump1090 works now both for our VirtualRadar and simultaneously for Flight Radar 24

Auto start at boot

  • Our software should be able to run during startup, and we should monitor if they are working, so let’s start by installing the screen program

    Then we will tell Pi to periodically check if our software is running – using the system scheduler – cron, while we can see how they are doing by using screen:
    On the console:

    type in editor:

That’s it! It will start at latest in 30 minutes.