After my last two blogposts [1][2], 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 | |
The system
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.
Let’s start
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:
Line No. | |
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) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# define dump1090 service dump1090: image: "sysrun/rpi-dump1090:tedsluis" # 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: - "30003" - "30005" devices: - "/dev/bus/usb" # expose port 8080 on the host (http://rapberry:8080) ports: - "8080:8080" # define mysql database mysql: image: "hypriot/rpi-mysql" environment: # set mysql credentials - MYSQL_ROOT_PASSWORD=secure - MYSQL_USER=flight - MYSQL_PASSWORD=flight - MYSQL_DATABASE=flight volumes: # bind the folder /opt/flight/mysql on the raspberry as datastorage - /opt/flight/mysql:/var/lib/mysql #define flightairmap service flightairmap: image: "sysrun/rpi-flightairmap:caccdb6" stdin_open: true tty: true restart: always expose: - "9999" ports: # bind port 80 to the host (access via http://raspberry) - "80:80" environment: # set the configuration - FLIGHT_INSTALLED=false - FLIGHT_TIMEZONE=Australia/Sydney # the next four values are taken from the mysql config - FLIGHT_DB_HOST=mysql - FLIGHT_DB_USER=flight - FLIGHT_DB_PASS=flight - FLIGHT_DB_NAME=flight # set the dump1090 host - FLIGHT_SBS1_HOST=dump1090 - FLIGHT_SBS1_PORT=30003 # change these values to your country / position - FLIGHT_SQUAWK_CO=AU - FLIGHT_CENTER_LAT=-33.865143 - FLIGHT_CENTER_LON=151.209900 links: # link to database and dump1090 - "mysql" - "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 🙂
1 2 3 4 5 6 7 |
fr24feed: image: "sysrun/rpi-fr24feed:1.0.13" # get data from service dump1090 port 30005 command: "--fr24key=YOURFR24KEY --receiver=beast-tcp --logmode=0 --host=dump1090:30005" links: # link to dump1090 service - "dump1090" |
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
# define arcarsdec acarsdec: image: "sysrun/rpi-acarsdec:3.2" # 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" restart: always devices: - "/dev/bus/usb" links: # link to flightairmap service - "flightairmap" |
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