Probably everyone who at least once met or saw off relatives or friends on a plane used the free Flightradar24 service. This is a very convenient way to track the position of the aircraft in real time.

As a survey of acquaintances showed, very few people know that this service is supported only by enthusiasts who send data to the server. Even fewer know that anyone can join the project.
Let's fill this gap. How it works will continue under the cut.
Hardware
The very first question is where the data comes from.
Each civilian aircraft is equipped with a special transmitter, the so-called ADS-B transponder:

(photo from Garmin website)
This device sends special packets on a frequency of 1090 MHz containing the main flight parameters, aircraft type, its coordinates, destination, etc.
The signal on the spectrum looks something like this:

And what is most important for us, it is not difficult to decode this data, an RTL-SDR receiver, about $ 8, connected to a computer, is enough. Actually, the idea is probably already clear - if we collect data from many receivers, we will get a picture, something like this:

But that's not all. Some aircraft transmit data packets, but they do not contain GPS coordinates. If you receive data simultaneously from multiple receivers, the coordinates of which are known, then by analyzing the delays at different receivers, you can find out the location of the aircraft. This technology is called multilateration (MLAT), you can read more about it .
And finally, the last question is how the data is received. The answer is simple, anyone can host a receiver, the issue price ranges from $0 to $50. For example, this is how the Flightaware receiver map looks like:

As you can see, the coverage of the Russian part leaves much to be desired, so some have a good chance of being the first.
To receive data, you need:
— Raspberry Pi2/3 with internet connection (price from $20)
— RTL-SDR-dongle (price from $10)
- at least the simplest antenna of 2 pieces of wire 6.8 cm long each (1/4 dipole at 1090 MHz)
A place with a more or less open view of at least part of the sky is also desirable. gigahertz signals are absorbed by obstacles like houses or trees.
I already had both a Raspberry Pi and an RTL-SDR, so I didn't have to buy anything. But anyone can try to get a ready-made receiver for free - and Flightradar and Flightaware send out kits for free to users from areas where coverage is currently insufficient. You can send a request using the link or ), of course, it is advisable to try for those who live in a fairly remote area.
I used a kit from RTL-SDR V3, which together with antenna and mini tripod cost $27 with free shipping from China:

By the way, as a second bonus, for everyone sending data to the server, both Flightradar24 and Flightaware provide unlimited access to premium account and all server functions (separately such access costs about $50/month). So if someone is interested in aviation and wants to have extended access to such an account, installing an RTLSDR receiver is a very cheap alternative.
The test is
Installation is extremely simple, on the Raspberry Pi, just connect the receiver and run one command:
sudo bash -c "$(wget -O - http://repo.feed.flightradar24.com/install_fr24_rpi.sh)"The script will request the necessary data (coordinates and type of the receiver, email address), then the software will work automatically, the user's attention is no longer required. At the same time, you can activate a premium account (for FR24, follow the link ) and immediately use all its features (flight tracks, etc.).
You can go to the Raspberry Pi IP address page and see the current status:

Much more information can be seen on the Flightradar24 account page:

I live on the 6th floor relatively close to the airport, so the number of aircraft observed per day was more than 1000, even with a simple antenna on the windowsill. Interestingly, even with such an antenna, the maximum range to the received board was 215 miles. Different antenna options can be found on ebay by typing ads-b antenna in the search.
Alternative to
Bonus for those who had the patience to read this far. Some readers may wonder: is it possible to do without third-party services like Flightradar? Of course, you can run the decoder on the Raspberry Pi directly. You can download the sources at .
It is enough to type 3 commands on the Raspberry Pi:
git clone https://github.com/antirez/dump1090.git
cd dump1090/
makeThen the decoder can be launched with the command:
./dump1090 --interactive --netThe decoder starts working, and we see "raw data" - a list of visible "boards":

Now you can go to the browser on the Raspberry Pi and admire your own, local Flightradar, the picture might look something like this:

Why might this be necessary? Firstly, just out of interest, and secondly, Flightradar24, unfortunately, filters some of the data and shows not all aircraft (for example, military, government, or business jets may not be shown). By running our own local service, we see everything "as is", without any censorship. But, of course, the amount of data is limited by our local location and the quality of the antenna, and MLAT technology will not be available either. Dump1090 is available in source code, so those who wish can even create their own version of Flightradar, with blackjack and other bells and whistles.
Conclusions
As you can see, it's not all that complicated, and it's quite interesting and inexpensive. To put the price in perspective: just 10 years ago, the Airnav RadarBox receiver cost around 1000$, now you can get an RTL-SDR that does the same thing for $10.
In my case, the receiver was launched only for testing, there is no practical point in keeping it constantly on, the coverage density of the European part already reaches 100%. For residents of the Russian outback, on the contrary, this can be quite interesting - it becomes possible both to do a useful thing for air travelers around the world by expanding the coverage area, and to get access to the Premium account of the aforementioned sites.
All successful experiments.
Source: habr.com
