After my last two blogposts , many of you asked “Why Docker on a Raspberry?” if you can install all the software directly (“There are so much tutorials“). Yeah, that’s right – but think how much work you have to invest to get the following setup running:
- Raspberry Pi 2 & 2 RTL-SDR Sticks
- Nr 1 is monitoring ADSB via dump1090
- Nr 2 is monitoring ACARS on 2 frequencies via acarsdec
- FR24FEED (www.flightradar24.com) is taking the data from dump1090 and feeds it to FR24
- FlightAirMap (PHP/MySQL) is taking the data from acarsdec and dump1090 to generate a comprehensive statistic and live map of your received data.
- A Mysql server for storing the Data behind FlightAirMap
You need five services which you have to install/compile, to configure, to link and to manage.
But there is a much more convenient solution: docker-compose and one (!) configuration file 🙂
|FlightAirMap & dump1090 Screenshots|
let me give you a quick overview. Every “cube” in the following graph is a docker service. Every service is linked in a certain way to another service. Beside these interconnections, some services also share connections to the outside – web interfaces (FlightAirMap & dump1090) or push connections to an external service (FR24 Feeder). The diagram shows you the ‘deluxe’ version. If you don’t have 2 SDR-Sticks around or you don’t need the FR24 Feeder – don’t worry, I’ll start with the basics system and explain how to extend it with different components – it’s easy as playing with LEGO 😉
The “budget” system (dump1090 & FlightAirMap)
This is the minimal FlightAirMap-System. It consinst of dump1090 and a RTL-SDR stick as an ADSB receiver and FlightAirMap + MySQL as map & statistic hub. Both webinterfaces (dump1090 and FlightAirMap) will be accessible form outside.
Please ssh to your raspberry, create a folder (compose-airmap for example) and put the contents of the listing below in a file called docker-compose.yml – oh, and please make sure you edit the following lines:
|5||the –lat & –lon values have to be set accordingly to your receiver location|
|45||Set your timezone (list of timezones)|
|54||Set your countrycode (AU=Australia, DE=Germany, …)|
|55 & 56||Set your lat & lon values (as in line 5)|
# define dump1090 service
# use device 0, set receiver position to sydney/australia (--lat xx, --lon xx)
command: "--device-index 0 --quiet --net --modeac --lat -33.8650 --lon 151.2094"
# expose port 30003 for flightairmap
# expose port 8080 on the host (http://rapberry:8080)
# define mysql database
# set mysql credentials
# bind the folder /opt/flight/mysql on the raspberry as datastorage
#define flightairmap service
# bind port 80 to the host (access via http://raspberry)
# set the configuration
# the next four values are taken from the mysql config
# set the dump1090 host
# change these values to your country / position
# link to database and dump1090
And now let the magic happen 😉 Execute a docker-compose up in the folder containing the docker-compose.yml
Docker will now download all the needed images and start the containers. FlightAirMap will then download and insert basic data to the Mysql database (flight routes, aircraft infos and so on).
Both steps will take a descent amount of time depending on your internet connection. In case something goes wrong or got stuck – just press CTRL+C and run docker-compose up again.
If everything is done, you should be able to connect to the dump1090 interface by opening http://<yourraspberryip>:8080 and to the FlightAirMap interface by opening http://<yourraspberryip>.
The “medium” system (“budget” + fr24feed)
fr24feed is a small application which sends the output of dump1090 to FlightRadar24 where your data will be combined with many other feeders to one big worldmap.
So if you want to use the feeder, just add the following code to your docker-compose.yml. If you don’t plan to send data, just skip this part 🙂
Please make sure you change the FR24KEY 🙂
# get data from service dump1090 port 30005
command: "--fr24key=YOURFR24KEY --receiver=beast-tcp --logmode=0 --host=dump1090:30005"
# link to dump1090 service
Add the above code to the docker-compose.yml and start via docker-compose up
The “deluxe” system (“medium” + acarsdec)
This solution needs 2 RTL-SDR sticks as we have to decode two different bands of frequencies (ACARS & ADSB). You don’t need to add the fr24feed if you not plan to push your data to flightradar24.
As dump1090 is using the first RTL-SDR stick, acarsdec is configured to use the second (index 1)
Please make sure you set the correct frequencies – 131.450 & 131.550 are for Australia – you’ll find the frequencies for your location in my last post about ACARS.
# define arcarsdec
# send acars messages to host flightairmap port 9999
# use device 1 (2 of 2) and scan frequencies 131.450 and 131.550
command: "-o 1 -v -Nflightairmap:9999 -g 450 -r 1 131.450 131.550"
# link to flightairmap service
Add the above code to the docker-compose.yml and start via docker-compose up – short after docker downloaded the image and started the containers, you should see the ACARS message coming in 🙂
I hope you like my post – and as usual:
if you have questions, see errors or need more information, drop me a line via the comments or via twitter