How I track airplanes using a RaspberryPi and a DVB‑T stick via #PiAware

Back in the ear­ly 1990s, picking someo­ne up from Nai­ro­bi JKI­Air­port some­ti­mes also inclu­ded tuning into 119.700 MHz on the beloved Stan­dard C168. A VHF radio, tun­ed to the fre­quen­cy of Nai­ro­bi approach that tells you whe­ther the expec­ted pla­ne would be lan­ding soon. Unab­le to under­stand any air­craft radio com­mu­ni­ca­ti­on back in the days, I never real­ly had a bene­fit from this ser­vice, even though it was still cool.

Flightradar24-AugRealThe view from my bal­co­ny via Flightradar24 (pro) on my iPho­ne 4S.

Fast for­ward now in 2014, web­sites like flightradar24.com or flightaware.com pro­vi­de anyo­ne with a quick update on the posi­ti­on of almost any com­mer­cial air­pla­ne. Apps like flightradar24 even pro­vi­de an aug­men­ted rea­li­ty view, which is very sweet and also prac­ti­cal, as you won’t have to decode any cryp­tic audi­ble com­mu­ni­ca­ti­on and just iden­ti­fy your tar­get air­craft on a map and can track it up to the air­port. They do this via the ADS‑B signal (Auto­ma­tic depen­dent sur­veil­lan­ce-broad­cast) that anyo­ne with the right equip­ment can easi­ly pick up. Com­pa­nies like Fligh­tA­wa­re get their data from “dif­fe­rent government air traf­fic con­trol and pri­va­te data­link sources” and also “ope­ra­te a world­wi­de net­work of ADS‑B recei­vers that track ADS-B-equip­ped air­craft fly­ing around the glo­be”. Obvious­ly, the­re’s a demand for this data.

Tracking hard­ware has been avail­ab­le for some time now and often only made sen­se for enthu­si­asts or real pro­fes­sio­nals who knew what they were doing and who also had a need for that data, as parts were still some­what expen­si­ve. The Mode‑S Beast is one such examp­le whe­re a Ger­man radio ham had crea­ted an FPGA based deco­der some years ago (the FPGA com­po­nent alo­ne is just damn cool).

My set­up
With the avai­la­bi­li­ty of cheap DVB‑T sticks that can be tur­ned into broad­band radio scan­ners (I also pre­sen­ted this method during Bar­Camp Rhein­Main in 2013), pri­va­te indi­vi­du­als can now also recei­ve and decode ADS‑B signals and feed them into a world­wi­de network.
You pro­bab­ly won’t run your desk­top or lap­top com­pu­ter 24h/7d, but credit-card sized com­pu­ters like the Raspber­ry Pi do pro­vi­de just enough com­pu­ting power to do the job. All you’ll need is a sta­ble inter­net con­nec­tion and a power sup­ply that deli­vers 5V for the Raspber­ry­Pi. I do have the hard­ware, I have broad­band inter­net con­nec­ti­vi­ty, electri­ci­ty and haven’t real­ly made use of my Raspber­ry­Pi late­ly (only used it as a TOR ser­ver for guest wifi access), so when Fligh­tA­wa­re announ­ced this PiA­wa­re pro­ject that allows you to turn any Raspber­ry­Pi with such a DVB‑T stick into an ADS‑B recei­ver, I quick­ly agreed to install it on mine.

jke-piaware
Ever­ything in a box: Raspber­ry­Pi (with a coo­ling kit in a neat VESA box), pas­si­ve USB exten­si­on (saves space and has two more ports for e.g. a key­board), RTL2832U / R820T DVB‑T stick, Edi­max EW-7811Un 150 Mbit/s Wire­less IEEE802.11b/g/n nano USB Adap­ter, 8GB SD card, microUSB power supply.

The good part is that you don’t have to do any cra­zy geek shit, so it is very much idi­ot-pro­of for peop­le like me. Just install the PiA­wa­re image on an SD-card, plug in all hard­ware com­pon­ents and start the RaspPi. Then visit their web­site and claim your ID. It’s real­ly just as simp­le as that.

jke-flightaware-map

Once the sys­tem is up and run­ning, you can quick­ly view live data by ope­ning the local IP address in your brow­ser which then loads a map and all avail­ab­le data. It’s 5:25am on this screen­shot, and you can alrea­dy see inco­m­ing car­go pla­nes that want to land on Frank­furt air­port. The­se are all signals that have been broad­cas­ted from the­se pla­nes and were then picked up by a small device on my bal­co­ny. And all of this just becau­se some smart peop­le had crea­ted a pie­ce of soft­ware that reads data from a 10€ che­a­po DVB‑T stick and then for­wards it to ano­t­her ser­ver around the glo­be. It still ama­zes me and I love it.

Sin­ce I do live on the top floor of a four-storey buil­ding, in the vicini­ty of EDDF (Frank­furt Air­port) and have a nice view from the bal­co­ny, I quick­ly figu­red that I should move my litt­le pro­ject out­side and place the magne­tic foot of the anten­na on the metal gate of the bal­co­ny, while all com­pon­ents are hid­ded in a plastic box. Some­thing that also remin­ded me of my WiFi mod for the Water Resour­ces Manage­ment Office in Embu in 2006: put ever­ything in a plastic box and install it as high as possible.

Anten­na
Anten­nae or anten­nas. I love them. I guess the thing that attracts me the most in radio tech­no­lo­gy are anten­nas. My geek level on this topic is that whenever I climb a moun­tain or visit a tall buil­ding, the first thing I think of is the Rx/­Tx-ratio and how the spot would qua­li­fy for an out­door anten­na. While others enjoy the view, I just won­der about field strength. So when the need aro­se to replace the stock anten­na that comes with most DVB‑T don­gles with some­thing bet­ter, I rea­li­zed that they aren’t that bad and that I would just need to install a new anten­na stick (becau­se, also, I did­n’t want to mess with the tiny MCX-con­nec­tor on the cable).

DVB-T antenna fix

The distance screw is from an old main­board on a desk­top com­pu­ter and I just sol­de­red a pie­ce of wire onto this screw, then later on cove­r­ed the brass with heat shrink tubes to water­pro­of it a bit. It’s a col­li­ne­ar anten­na accord­ing to this manu­al and with a wav­elength of about 1090 MHz or 275mm (= 300000 m/s / 1090000 1/s), the first part is 1/2 Λ the second 3/4 Λ long and the third one is sup­po­sed to be a litt­le less than 3/4 Λ, but my pie­ce of wire was­n’t long enough, so let’s just test it this way. The beau­ty about this set­up is that I can easi­ly upgrade it by just sol­de­ring more wire on a cheap, old screw.

My ADS-B antenna on the balconyThe finis­hed anten­na on the balcony.

Results
my PiAware feed statsGoing by this chart (gene­ra­ted via the PiA­wa­re backend), moving the anten­na out­door pro­bab­ly was­n’t such a bad idea. :-)

Afri­ca?
Fligh­tA­wa­re’s coverage map dis­plays the typi­cal gap, or lack of data from the Afri­can continent…

ADS B Coverage Map FlightAware

…and Flightradar24 isn’t that much better:

ADS B Coverage Map Flightradar24

Let’s hope that someo­ne will be able to clo­se this huge gap in future, even though it may requi­re some invest­ments into hard­ware and con­nec­ti­vi­ty (inter­net & electri­ci­ty). I’d love to see someo­ne from Nai­ro­bi set­ting this up in an office — may­be someo­ne at the iHub Nai­ro­bi? I under­stand that it just requi­res litt­le band­width and is small enough not to acci­dent­al­ly “walk away”.

Update:
What I real­ly like about this pro­ject is that Fligh­tA­wa­re crea­ted an approach that allows new­bies like me to get this thing going wit­hin minu­tes. It just takes the hard­ware and the down­loa­ded image, and I won’t have to con­fi­gu­re anything unless I want to. Just con­nect it to your net­work and Fligh­tA­wa­re will auto­ma­ti­cal­ly attri­bu­te your PiA­wa­re set­up to your user account (based on the same exter­nal IP). After all it’s just a collec­tion of scripts that com­bi­ne some smart soft­ware here and the­re, but this also lowers the bar­ri­er for peop­le like me who just want to con­tri­bu­te data to a net­work that is based on crowd­sour­ced information.

14 comments » Write a comment