Raspberry Pi + Docker = From blank SD to feeding in 15 mins

I am a long time user of FlightAware and a regular ADS-B Feeder via piaware.
I am in the process of increasing my number of Raspberry Pi’s and sites and have been keen to have an easy way to get from a blank SD card to a running Pi quickly.

Currently running through this process, the amount of work required to set up dump1090, Flightaware piaware, planefinder and flightradar24 on a Raspberry Pi is around 15 minutes. When setting up a new site, there is a little bit of prep work, but I have managed to set up a new site in about 25 minutes.

I have managed to come up with a rapid workflow that allows me to go from blank Pi to full configured extremely quickly.
And because I’ve done most of the leg work, with a single configuration file, you too could have your Pi running in as long as it takes to type a couple of lines and download the images required.

Requirements

  • Raspberry Pi 2
  • RTL-SDR Dongle
  • A blank micro SD card (16GB preferred, class 10)
  • A small amount of time

The aim
To quickly install dump1090, planefinder client, flightradar 24 client and flightaware client and be feeding to them in under an hour (thankfully it’s much less).

Firstly a quick thank you
Firstly to Frederik Granna whose blog post sysrun.io/2015/11/12/raspber … r-rtl-sdr/ got me playing
Secondly to the folks at Flightaware who have made their client so easy to install, it almost doesn’t require this guide.

What is Docker and why use it?
Docker is a software that allows me in this particular case, to wrap all the nasty configuration for multiple feed clients and programs into a single file, a few containers and at the end of the day - a single command to get it all going.
It makes the process simple… because I’ve done all the hard work for you.
Furthermore, it allows the very easy deployment of multiple Raspberry Pi’s with slight changing of configuration.
This means you can just change the GPS co-ordinates of the config, the share code and start docker up. No messy re-configuration.
It also allows slight changes to be made to configuration, so that testing slight variations can be done quickly, easily and without ruining all the hard work that has gone into making the previous configuration (because you can simply revert).
More details: docker.com

Procedure

  1. Micro SD card in hand, follow the Hypriot OS details via this blog: blog.hypriot.com/getting-started … arm-device
  2. After logging in as root, blacklist the RLT-SDR driver by adding your specific device to a config file /etc/modprobe.d/rtl-sdr-blacklist.conf with the contents:

blacklist dvb_usb_rtl28xxu
blacklist e4000
blacklist rtl2832

  1. Make a directory to store your Docker files and clone my git repo


$ mkdir Docker
$ cd Docker
$ git clone https://bitbucket.org/inodes/docker-rtlsdr-pfclient
$ cd docker-rtlsdr-pfclient

  1. Move the example docker-compose.yml_suggestion file to docker-compose.yml


$ mv docker-compose.ml_suggestion ../docker-compose.yml
$ cd ..

  1. and make edits to make it your own changing:
    a) Latitude and Longitude (e.g. Sydney, Australia -33.7968 150.7823 - see where-am-i.net)
    b) PPM (optional - leave as 1 - more on this later)
    c) Username and Password (for Flightaware)
    d) MAC Address of container (this can be anything your would like, or an old MAC address or even generated hellion.org.uk/cgi-bin/randmac.pl) - unique required per piaware client
    e) FR24 Key - previously sourced or see below for a sign up procedure
    f) Planefinder share code - previously sourced or see below for a sign up procedure
  2. Run docker-compose up to prepare (followed by patience)


$ docker-compose up

  1. Go and have a rest while step 6 finishes up
  2. Once finish, press Ctrl + C to stop
  3. Run docker-compose start to start the docker containers

$ docker-compose start
Starting Docker_dump1090-piaware_1
Starting Docker_fr24feed_1
Starting Docker_pfclient_1

  1. Done…

You can now access:

IP_of_RPI:30053 - Web interface for Planefinder
IP_of_RPI:8754 - Web interface for Flightradar 24
IP_of_RPI:8080 - Web interface for Dump 1090

Creating Accounts…
In the above post it assumes you have:

  • Planefinder sharecode
  • Flightradar 24 key
  • Flightware login and password

You may also just require additional share codes for example for new locations.
Docker also makes this easy.

New Planefinder Sharecode

  1. Pull down planefinder docker container then run it with the basic options below

$ docker pull inodes/rtlsdr-pfclient
$ docker run -it --device=/dev/bus/usb -p 30053:30053 inodes/rtlsdr-pfclient
2015-12-09 11:46:13.558687 We were unable to locate a configuration file and have entered configuration mode by default. Please visit: http://172.17.0.2:30053 to complete configuration.
2015-12-09 11:46:13.570186 Web server is now listening on: http://172.17.0.2:30053
2015-12-09 11:46:13.570307 Echo port is now listening on: 172.17.0.2:30054

  1. Ignore the IP’s above, and instead connect to new container using ](http://)<your_pi_ip>:30053
  2. On the configuration page presented enter the following and then press “Create a new share code”
    a) Email address
    b) Receiver Lat (write this down and keep it consistent)
    c) Receiver Lon (write this down and keep it consistent)
  3. Press Ctrl + C on the Docker command
  4. Enter this sharecode into the docker-compose.yml from step 4 in previous post

New Flightradar 24 Key

  1. Pull down Flightradar 24 docker container then run it with option below

$ docker pull inodes/rtlsdr-fr24feed
$ docker run -it inodes/rtlsdr-fr24feed --signup

  1. Follow the steps provided
  2. Press Ctrl + C on the Docker command
  3. Enter this key into the docker-compose.yml as per previous post

New Flightaware Account

  1. Just use flightaware.com/account/join/
  2. Ensure MAC address is unique per client. Docker makes it easy to migrate a pre-existing feeder to Docker because you can just add the MAC address to your config and continue feeding as per usual (Your MAC address is listed under “Site identifier” on your stats page).

@glennstewart

Great write up - many thanks.

I took a look at Docker after tedsluis posted details about his setup. http://discussions.flightaware.com/ads-b-flight-tracking-f21/running-dump1090-mutability-in-docker-container-t36436.html. I found it an intriguing concept but couldn’t quite get my head round it.

If I get some time this weekend, I’ll give it a try.

Once again, many thanks.

No worries at all. As long as you’re able to install the latest Hypriot Docker Image for Raspberry Pi frin http://blog.hypriot.com/downloads/ then follow the image instructions from http://blog.hypriot.com/getting-started-with-docker-on-your-arm-device/ (Windows, OS X and Linux), you just need a couple of basics and you’re ready to go.

After that, the blacklisting of the RLT-SDR drives is essential.
Because I’ve done most of the configuration, if you just want to install Flightaware and dump1090, you only need to install a single container.

So you can edit the docker-compose file to remove the other containers.

The only issue with Docker and piaware is that piaware always expects to contact dump1090 on localhost, which is why I bundle dump1090 and piaware together.
The other two containers contain Flightradar 24 and Planefinder contacting dump1090 on port 30005.

See:
hub.docker.com/r/inodes/rtlsdr- … 0-piaware/

Also see a page from a colleague who works with me here in Sydney:
sysrun.io/2015/11/12/raspber … r-rtl-sdr/


git clone https://bitbucket.org/inodes/docker-rtlsdr-pfclient

is challenging me for a username & password.

Sorry about that. I have made the repo public, so it’s good to go.
Please retry.


[13:05:34] 1$ git clone https://bitbucket.org/inodes/docker-rtlsdr-pfclient
Cloning into 'docker-rtlsdr-pfclient'...
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.

A simplistic description of Docker Container would be a virtual machine without the hardware virtualization overhead most other hypervisors such as VMware and Hyper-V require. Great for when there is a need to spin up single or multiple instances of the same application while keeping it separate from others running on the same physical machine. It also makes deploying an already setup application easier as the post states but at the cost of an increase in system overhead due to the fact the Docker Engine needs to run on the device as well.

I am begginer with docker but installation processed correct.

Problem is with mlat aircraft only. Not appear on web dump1090.
There are adsb aircraft only /green/.

And it is possible use statement piaware-config …or how?
I need copy mlat data to port 30106 for transfer to BS.

                                Many thanks for any advice.

Certainly worth pointing out. This is easy of configuration > size and overhead. It’s a reason to recommend a Pi 2 and also why I went with Wheezy versus Jessie.
Currently working on an Ubuntu Trusty version of the same containers to allow Linux/Windows uses to spin up the Docker containers with similar results.

@fduok this is certainly due to the version of dump1090 being used.
With this in mind, you could go one step further and create your own Dockerfiles instead and publish these changes to your own hub.docker.com.

For this, first visit Docker’s own website and run through some of the tutorials:
docs.docker.com/mac/step_two/

I have all of my Dockerfiles public on bitbucket.org/inodes/

For the Raspberry Pi this includes:

  1. The base image - bitbucket.org/inodes/docker-rtl … eimage/src
  2. The dump1090 + piaware - bitbucket.org/inodes/docker-rtl … iaware/src (this is the one that you could change to use a different dump1090)
  3. The planefinder container - bitbucket.org/inodes/docker-rtlsdr-pfclient/src
  4. The flightradar24 container - bitbucket.org/inodes/docker-rtlsdr-fr24feed/src

Once you have these Dockerfiles locally, you can make your own changes then push these out to your own hub.docker.com repo.
Then alter the docker-compose.yml to use your own images instead of mine.

Worth nothing that I do pull some files down from my bitbucket.org site, so either swap these out for your own github.com/ account

I’ve created some basic dump1090 containers that you can use to test dump1090 settings.
I currently don’t have my Raspberry Pi’s with me, so I’ve created both an x86 Ubuntu version and know the RPI Dockerfile version.

So for running it on OS X, Linux, Windows… as long as you have Docker installed and running then it’s as simple as:



$ docker pull inodes/docker-x86-rtlsdr-dump1090
$ docker run -it -v /dev/bus/usb:/dev/bus/usb -p 8080:8080 inodes/docker-x86-rtlsdr-dump1090 --help


Then swap the --help for whatever dump1090 flags you want to test with. For example --interactive and --net
These would form the changes for the start script you would include in your copy of start-dump1090-piaware.sh from bitbucket.org/inodes/docker-rtl … iaware/src

I can’t build my RPI version until I have access to my RPI, but a basic Dockerfile would be:



FROM inodes/rtlsdr-baseimage:latest

WORKDIR /tmp

RUN git clone https://github.com/tedsluis/dump1090.git \
    && cd /tmp/dump1090 \
    && make

WORKDIR /tmp/dump1090

EXPOSE 8080 30001 30002 30003 30004 30005

ENTRYPOINT "./dump1090"]


The run the following from the directory containing the Dockerfile:



% docker build -t rtlsdr-dump1090 .


The to run on your RPI would be:



docker run -it --device=/dev/bus/usb -p 8080:8080 rtlsdr-dump1090 --help


The as above, swap --help for whichever command line options are required (e.g. --interactive --net)
To see output connect to ](http://)<YOUR_RPI_IP>:8080
To stop Docker, run + C on the command line running your docker container, change the options passed to dump1090 and start again.

Thank you very much for answer.
Going to study now,
Today will long night for me.

        Thanks.       Vaclav.

I’m looking at installing my setup using this but first wanted to know if there are any issues with updates to piaware/planefinder/FR24 software etc once in a Docker container?

That’s another thing that’s great about Docker. The first time you pull the containers, it will install the very latest at that point. But because containers are stateless (which means they don’t store any permanent application data - which is fine, because it uploads the data to a feeder service like Flightaware).

Want to update? Easy… just stop the container in question and repull.



$ docker-compose stop
Stopping Docker_dump1090-piaware_1
Stopping Docker_fr24feed_1
Stopping Docker_pfclient_1

$ docker images
(this will list images)

$ docker pull inodes/rtlsdr-dump1090-piaware
$ ....


This will re-create the container if there is a change.
You can actually use docker-compose as well, which will use the docker-compose.yml - great if you’re using all three containers I wrote.


$ docker-compose stop
$ docker-compose build
$ docker-compose up -d --no-deps
<Ctrl> + X
$ docker-compose start

I’ll have to check this, but fairly certain this would work.

were you thinking about adding an container for adbsexchange.com?
That would be a great addition…

Sounds like a great idea. Fairly straightforward to do. I’ll look into doing both a Raspberry Pi and x86(OSX/Windows/Ubuntu) container.

I installed this a couple of weeks back now and everything seems to be running OK except the range maps in dump1090 are located somewhere over the Netherlands and not near my system in the UK. Before I start hunting for the solution in my install do you have any other ideas what could be wrong?

I noted the same thing as well in one of my three installs. Not entirely sure what the issue was, but it seemed that in the particular build at the time there was a default in the config that put dump1090 over The Netherlands (the first heat map was centered around this region too).

You can always delete the container running dump1090 and re-run, which will completely recompile everything from scratch. But I am keen to see if this resolves it for you as it has done for me.

In the file /usr/share/dump1090-mutability/html/config.js there are two settings DefaultCenterLat and DefaultCenterLon that and/or SiteLat and SiteLon. You more than likely need to set these to the lat/lon of your feeder so the JavaScript knows where to center the map by default. That or set the LAT and LON settings in /etc/default/dump1090-mutability which overrides the settings in config.js.

Unfortunately not for me. The map centres on my location (central United Kingdom) but the range map is still over the Netherlands. The rings are all correct though so some bits are coming in correctly. I’ll continue to play at the weekend when I have more time available.