After the fantastic feedback i got for my blog post about ADSB reception with RTL-SDR (and Docker), the next point in my list is ACARS.
The basics: What is ACARS?
ACARS is short for Aircraft Communications Addressing and Reporting System, a digital data link between an aircraft and a ground station and/or satellite.
The on-board avionic computer system (aircraft) consists of the ACARS Management Unit (ACARS MU) and a Control Display Unit (CDU) for sending and receiving digital information messages from the ground-based stations.
Ground equipment is made up of a network of radio transceivers managed by a central site computer called AFEPS (Arinc Front End Processor System), which handles and routes messages. Generally, ground ACARS units are either government agencies such as the Federal Aviation Administration, an airline operations headquarters, or, for small airlines or general aviation, a third-party subscription service. Usually government agencies are responsible for clearances, while airline operations handle gate assignments, maintenance, and passenger needs. (Wikipedia)
This is a message send by the CFD (Central Fault Display) of an aircraft 😉
#CFB.1/WRN/WN1511161031 383100506MAINTENANCE STATUS TOILET
Or something like this
N12114 CO0070 1EHAM REQUEST GATE ASSIGNMENT ETA0447
You’re now interested how to receive such messages with minimal Hardware? You have your Raspberry Pi 2 ready? Docker installed? RTL-SDR attached? Then read on.
If not, start with my earlier blog posts to get the basics:
Choose your weapon
- up to four channels decoded simultaneously
- error detection AND correction
- input from sound file , alsa sound card or software defined radio (SRD) via a rtl dongle or airspy
- could send decoded acars to a server via UDP in Planeplotter format or its own dedicated format
Ok, first we nee a fresh and clean new directory for our files. Just create one called acarsdec.
Next we have to download the acarsdec sourcecode. Head over to this page and click the latest version (currently 3.2). You can now download the compressend source (acarsdec-3.2.tar.gz). Put this file into your acarsdec folder.
Now extract this file – we need the Makefile for the next step. Copy the Makefile to your acarsdec folder – the other extracted files are not needed anymore, just remove them – but keep the compressed source file (acarsdec-3.2.tar.gz)!
You should now have 2 files in your acarsdec folder: the Makefile and the source zip. All good? Ok, now we have to modify the Makefile to be able to build the acarsdec programm for our Raspberry Pi. Open the Makefile and change the first lines like this:
CFLAGS= -Ofast -mfpu=neon-vfpv4 -funroll-loops -pthread -D WITH_RTL -I.
LDLIBS= -lm -pthread -lrtlsdr
Just remove all the other lines beginning with #CFLAGS, CFLAGS, #LDLIBS or LDLIBS.
Well done (i hope). Next step is the Dockerfile to build our Image. Create a new file called Dockerfile in your acarsdec folder and add the following content:
# add (and extract) sourceode to /tmp
ADD acarsdec-3.2.tar.gz /tmp
# copy modified makefile to sourcefolder
COPY Makefile /tmp/acarsdec-3.2/Makefile
# set workdir ;)
# set the etrypoint to acarsdec
That should be all 🙂 Now proceed and build the image
Lets build the docker image. Just got to your acarsdec folder (yes, the ,one with the three files in it) and run
docker build --rm -t acarsdec .
Docker will now download my rtl-sdr baseimage for Raspberry Pi, compile acarsdec and build the image. Easy, is’nt it?
After the image is build, you can do a dry-run: docker run -it --rm acarsdec – this should output the help information of the tool:
Need at least one of -a|-f|-r options
Acarsdec/acarsserv 3.2 Copyright (c) 2015 Thierry Leconte
Usage: acarsdec [-v] [-o lv] [-A] [-n ipaddr:port] [-l logfile] [-g gain] [-p ppm] -r rtldevicenumber f1 [f2] ... [f4]
-v : verbose
-A : don't display uplink messages (ie : only aircraft messages)
-o lv : output format : 0: no log, 1 one line by msg., 2 full (default)
-l logfile : Append log messages to logfile (Default : stdout).
-n ipaddr:port : send acars messages to addr:port on UDP in planeplotter compatible format
-N ipaddr:port : send acars messages to addr:port on UDP in acarsdev nativ format
-i stationid : station id used in acarsdec network format.
-g gain : set rtl preamp gain in tenth of db (ie -g 90 for +9db). By default use AGC
-p ppm : set rtl ppm frequency correction
-r rtldevice f1 [f2]...[f4] : decode from rtl dongle number or S/N rtldevice receiving at VHF frequencies f1 and optionaly f2 to f4 in Mhz (ie : -r 0 131.525 131.725 131.825 )
For any input source , up to 4 channels could be simultanously decoded
Looks good? Cool, then let’s try a real test-run 🙂
docker run -it --rm --device=/dev/bus/usb acarsdec -v -g 450 -r 0 131.450 131.550
Let me explain this command a bit. –device=/dev/bus/usb gives the Container access to our usb devices (rtl-sdr stick), -g 450 sets the tuner gain to ~45db, the parameter -r 0 <freq1> <freq2> sets the 2 ACARS frequencies for Australia and enables them on stick nr 0 (our first stick – yes you could use multiple). Depeding on the country your sitting, you should check other frequencies (i added a short overview at the bottom of this post)
Now you should get the first ACARS messages 🙂
If something is not clear or not working, just drop me a line in the comments or via Twitter
Current ACARS Frequencies
|131.550||Primary Channel worldwide|
|130.025||Secondary channel for USA & Canada|
|129.125||Additional channel for USA & Canada|
|130.450||Additional channel for USA & Canada|
|131.125||Additional channel for USA|
|136.700||Additional channel for USA|
|136.800||Additional channel for USA|
|131.725||Primary channel in Europe|
|131.475||Air Canada company channel|
|131.450||Primary channel for Japan / Australia|
|136.925||ARINC European Channel|
|136.850||SITA Canadian Frequency|