Flightradar24 - how does it work?

A survey of friends showed that very few people know that this service is supported only by enthusiasts who send data to the server. Even less know that anyone can join the project.
We fill this gap. How it works we will continue under a cat.
Iron
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)
This device sends special packages on the frequency 1090 MHz containing the main flight parameters, the type of aircraft, its coordinates, destination, etc.
The signal on the spectrum looks like something like this:

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

But that's not all. Some airplanes transmit data packets, but they lack GPS coordinates. If you receive data simultaneously from multiple receivers whose coordinates 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), more information about it can be found on the site .
And finally, the last question is how the data is received. The answer is simple, anyone can host the receiver, the price of the question ranges from $ 0 to $ 50. For example, the Flightaware service receiver map looks like this:

As you can see, the coverage of the Russian part leaves much to be desired, so some quite have a chance to be 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 each having a length of 6.8 cm (1/4 dipole at 1090 MHz)
Also desirable place with a more or less open view of at least part of the sky, because GHz signals are absorbed by obstacles such as houses or trees.
I already had Raspberry Pi and 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 kits for free to users in areas where coverage is currently not enough. You can send a request via the link ( Flightradar or Flightaware), of course, it is advisable to try those who live in a fairly remote area.
I used a set of RTL-SDR V3, which together with the antenna and mini tripod cost $ 27 with free shipping from China:

By the way, as the second bonus, everyone sending data to the server, both Flightradar24 and Flightaware provide unlimited access to the premium account and all server functions (separately such access costs about $ 50 / month). So if someone is interested in aviation and wants to have expanded access to such an account, installing an RTLSDR receiver is a cheap alternative.
Testing
Installation is extremely simple, on the Raspberry Pi, just plug in 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 receiver, e-mail address), then the software will work automatically, the attention of the user is no longer required. In parallel, you can activate a premium account (for FR24 under the link https://www.flightradar24.com/premium/signup?account=free ) and immediately use all its features (flight tracks, etc.).
You can go to the IP address of the Raspberry Pi page and see the current status: You

can see much more information on the Flightradar24 account page:

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

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

Why would it be necessary? Firstly, simply out of interest, secondly, Flightradar24, unfortunately, filters part of the data and shows not all aircraft (for example, military, government, or business jets may not appear). Having launched 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 the source code, so that anyone can even create their own version of Flightradar, with blackjack and other bells and whistles.
findings
As you can see, everything is not so difficult, while it is quite interesting and inexpensive. To understand the price order: 10 years ago the Airnav RadarBox receiver cost about $ 1000, now RTL-SDR, which does the same, can be borrowed for $ 10.
In my case, the receiver was launched only for testing, there is no practical sense to keep it permanently on, the coverage of the European part already reaches 100%. For the inhabitants of the Russian hinterland, on the contrary, it can be quite interesting - there is an opportunity to do a useful job for air travelers around the world, expanding the coverage area, and get access to the Premium account of the above-mentioned sites.
All successful experiments.