All Projects → fredclausen → docker-acarshub

fredclausen / docker-acarshub

Licence: GPL-3.0 License
Docker container to utilize RTLSDR dongle(s) to view/stream ACARS/VDLM2 aircraft data transmissions

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
shell
77523 projects
CSS
56736 projects
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-acarshub

docker-flightradar24
Multi-architecture docker container running flightradar24 fr24feed. Designed to work in tandem with mikenye/readsb (arm32v7/arm64/x86_64).
Stars: ✭ 71 (+491.67%)
Mutual labels:  docker-container, rtlsdr
flight2bq
RTLSDR ADS-B dump1090 to Google BigQuery
Stars: ✭ 33 (+175%)
Mutual labels:  aircraft, rtlsdr
vdlm2dec
vdl mode 2 SDR decoder
Stars: ✭ 56 (+366.67%)
Mutual labels:  acars, vdlm2
readsb
ADS-B decoder swiss knife
Stars: ✭ 114 (+850%)
Mutual labels:  aircraft, rtlsdr
composable-sdr
SDR DSP utilities embedded in Haskell
Stars: ✭ 26 (+116.67%)
Mutual labels:  rtlsdr, rtlsdr-dongle
linode-k8s-autoscaler
Autoscaling utility for horizontally scaling Linodes in an LKE Cluster Node Pool based on memory or cpu usage
Stars: ✭ 27 (+125%)
Mutual labels:  docker-container
TecoGAN-Docker
This is a fork of the TecoGAN project (https://github.com/thunil/TecoGAN) that adds support for docker.
Stars: ✭ 86 (+616.67%)
Mutual labels:  docker-container
FlightAirMap-3dmodels
3D models used by FlightAirMap with Cesium
Stars: ✭ 23 (+91.67%)
Mutual labels:  aircraft
xiaomi-r3g-openwrt-builder
OpenWrt builder for any supported routers using Docker. Scheduled to run weekly
Stars: ✭ 25 (+108.33%)
Mutual labels:  docker-container
docker-dotnet-sonarscanner
🐳 Sonar Scanner MsBuild Dockerfile for dotNet Projects
Stars: ✭ 21 (+75%)
Mutual labels:  docker-container
docker-eks
Docker container for creating AWS EKS Cluster
Stars: ✭ 16 (+33.33%)
Mutual labels:  docker-container
Apache
Docker container running Apache running on Ubuntu, Composer, Lavavel, TDD via Shippable & CircleCI
Stars: ✭ 15 (+25%)
Mutual labels:  docker-container
Docker-Minecraft-PaperMC-Server
Starts a Minecraft PaperMC 1.18 server
Stars: ✭ 80 (+566.67%)
Mutual labels:  docker-container
docker-jira
Simple container for Atlassian JIRA
Stars: ✭ 14 (+16.67%)
Mutual labels:  docker-container
doctrine-expressive-example
Example PHP REST API application built with Expressive using Doctrine ORM, complete with associations, pagination, and DB connectivity inside Docker containers. Used in #Beachcasts videos on YouTube.
Stars: ✭ 36 (+200%)
Mutual labels:  docker-container
murmur
Murmur server (Mumble) Docker container - https://mumble.info
Stars: ✭ 31 (+158.33%)
Mutual labels:  docker-container
bluechatter
Deploy & Scale a chat app using Cloud Foundry, Docker Container and Kubernetes
Stars: ✭ 64 (+433.33%)
Mutual labels:  docker-container
docker-sogo
Run sogo in a docker container.
Stars: ✭ 20 (+66.67%)
Mutual labels:  docker-container
docker
A simple guide to get you started on docker. (Might be outdated but it should still give you a basic overview.)
Stars: ✭ 21 (+75%)
Mutual labels:  docker-container
marthas rescue shooter game
This is a shooter game featuring Martha, a battle aircraft pilot who's trying to rescue her father. In this app, you will be able to help her by shooting and destroying the enemy's aircraft. Built with Javascript and Phaser 3.
Stars: ✭ 31 (+158.33%)
Mutual labels:  aircraft

fredclausen/acarshub

Banner GitHub Workflow Status Docker Pulls Docker Image Size (tag) Discord

Docker container to view and also stream ACARS messages to ACARS.io/Airframes.io.

Uses libacars, the airframe's fork of acarsdec and dumpvdl2 for SDR side of decoding.

Also, we make extensive use of the airframes work to make the messages more 'human-readable' as well as provide more detail for each of the messages.

Builds and runs on amd64, arm64, arm/v7, arm/v6 and 386 architectures.

IMPORTANT NOTE FOR RASPBERRY PI OS 32 BIT USERS

After March 1st, 2022 32 bit Rasperry Pi OS machines may not run ACARS Hub properly. I will be updating the base image of the container to Debian Bullseye and this will cause ACARS Hub to cease working if you are not prepared. Please see this for instructions on how to fix.

Supported tags and respective Dockerfiles

  • latest (master branch, Dockerfile)
  • Version and architecture specific tags available

Thanks

Thanks to mikenye for his excellent ADSB docker containers from which I shamelessly copied a lot of the ideas for setting up the docker container, as well as his excellent work to move this project from its humble beginnings to what it is now.

Additional thanks goes to the folks over at airframes.io for their tireless work in figuring out what all of these ACARS messages mean and making their work available in usable packages.

I am missing a boat load of people who have provided feed back as this project has progressed, as well as contributed ideas or let me bounce thoughts off of them. You've all molded this project and made it better than I could have done on my own.

Required hardware

You will need an RTLSDR dongle, and if you want to feed both VDLM2 and ACARS you will need two dongles with unique serial numbers.

Up-and-Running with docker run

docker volume create acarshub &&
docker run \
 -d \
 --rm \
 --name acarshub \
 -p 80:80 \
 -e STATION_ID_ACARS="YOURIDHERE" \
 -e FREQS_ACARS="130.025;130.450;131.125;131.550" \
 -e ENABLE_ACARS="true" \
 -v acars_data:/run/acars \
 --device /dev/bus/usb:/dev/bus/usb \
 --mount type=tmpfs,destination=/database,tmpfs-mode=1777 \
fredclausen/acarshub

You should obviously replace STATION_ID_ACARS with a unique ID for your station, as well as frequencies appropriate to your region.

Up-and-Running with Docker Compose

version: '3.8'

volumes:
  acars_data:

services:
  acarshub:
    image: fredclausen/acarshub
    tty: true
    container_name: acarshub
    restart: always
    devices:
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - 80:80
    environment:
      - STATION_ID_ACARS=YOURIDHERE
      - FREQS_ACARS=130.025;130.450;131.125;131.550
      - ENABLE_ACARS=true
    volumes:
      - acars_data:/run/acars
    tmpfs:
      - /database:exec,size=64M

Please keep in mind that this is a barebones configuration to get you started. You will certainly need to set additional configuration options to get ACARS Hub working in the way you want.

Ports

Port Description
80 Port used for the web interface
15550 Port used for exposing JSON ACARS data
15555 Port used for exposing JSON VDLM2 data

Volumes / Database

It is recommended to give the container a volume so that database and message data is persisted between container restarts/upgrade. If you wish to persist this database between container restarts, mount a volume to /run/acars/.

The database is used on the website for various functions. It is automatically pruned of data older than 7 days old.

The reality of running any kind of database on a Pi is that database performance can be lacking. I have found that a database that has seven days worth of data, on a moderately busy site like mine, can reach file sizes of 17Mb and have 112,000+ rows of data. In other words, an awful lot of data, and with database sizes that large you will see a degradation in search performance. Queries might take a few seconds to execute after you type your search terms on the search page.

If you set DB_SAVEALL to a blank value you will gain back a lot of performance because messages with no informational value won't be stored. The trade-off in disabling saving all messages means you won't have all messages logged which may or may not be important to you.

It is also recommended you use a tmpfs mount to reduce SD card writes.

Environment variables

There are quite a few configuration options this container can accept.

General

Variable Description Required Default
FEED Used to toggle feeding to ACARS.io. If set to any non-blank value feeding will be enabled. No Blank
ENABLE_WEB Enable the web server. Set to a blank value to disable the web server. No true
QUIET_LOGS By default the container displays all logging messages. If you wish to only see errors and critical messages in the container logs set QUIET_LOGS to a non-blank value. No Blank
QUIET_MESSAGES By default the decoders will not output their received messages to the container logs. If you want to see these messages in the logs set QUIET_MESSAGES to a blank value. No true
DB_SAVEALL By default the container will save all received messages in to a database, even if the message is a blank message. If you want to increase performance/decrease database size, set this option to blank to only save messages with at least one informationial field. No true
DB_SAVE_DAYS By default the container will save message data for 7 days. If you wish to over-ride this behavior, set this to the number of days you wish to have retained. No blank
DB_ALERT_SAVE_DAYS By default the container will save message data for 7 days. If you wish to over-ride this behavior, set this to the number of days you wish to have retained. No blank
DB_BACKUP If you want to run a second database for backup purposes set this value to a SQL Alchemy formatted URL. See the link for supported DB types. This database will have to be managed by you, as ACARS Hub will only ever write incoming data to it. No Blank
IATA_OVERRIDE Override or add any custom IATA codes. Used for the web front end to show proper callsigns; See below on formatting and more details why this might be necessary. No Blank
TAR1090_URL Flights where the container is able to, it will generate a link to a tar1090 instance so that you can see the position of the aircraft that generated the message. By default, it will link to ADSB Exchange, but if desired, you can set the URL to be a local tar1090 instance. No Blank
AUTO_VACUUM If you find your database size to be too large you can temporarily enable this and on the next container startup the database will attempt to reduce itself in size. When you do this startup time will take a few minutes. It is recommended to leave this flag disabled and only enable it temporarily. No False
PLANEPLOTTER If you want to output data in plane plotter format for use in Plane Plotter set this option to true. Only VDLM2 output is supported. No False

Please note that for TAR1090_URL the required format is http[s]://**HOSTNAME** only. So if your tar1090 instance is at IP address 192.168.31.10 with no SSL, the TAR1090_URL would look like http://192.168.31.10

ADSB

The ACARS Hub website contains the ability to display ADSB targets along side ACARS messages. To enable this feature you need to have an available aircraft.json file generated from readsb and available on tar1090webserverurl/data/aircraft.json. Mike Nye's tar1090 is the recommended container to run to easily get this data. By turning this on you will get a map that shows the ADSB targets picked up by your readsb instance and enable you to click on planes to see what messages they've sent.

The following options will set the options for ADSB

Variable Description Required Default
ENABLE_ADSB Turns on ADSB in ACARS Hub Yes, if you want to monitor ADSB Blank
ADSB_URL The IP address or URL for your tar1090 instance Yes http://tar1090/data/aircraft.json
ADSB_LAT The latitude of your ADSB site No, but recommended 0
ADSB_LON The longitude of your ADSB site No, but recommended 0
DISABLE_RANGE_RINGS Turn off range rings on your map. Set to a blank value to disable range rings. No Blank

If you run Mike's tar1090 container on the same machine as ACARS Hub then the default value for ADSB_URL is fine. If you don't, the formatting for ADSB_URL should be the full URL path to aircraft.json from your readsb source.

If you desire enhanced ADSB and ACARS message matching and thus show coloured aircraft icons on Live Map, and are running Mike's tar1090 container, you can enable the following option:

- TAR1090_ENABLE_AC_DB=true

In the configuration options for tar1090. Setting this will include additional aircraft information in the aircraft.json file that is not normally part of the ADSB broadcast, such as the aircraft's tail number and aircraft type. Please enable this with caution: there is increased memory usage in the tar1090 container so RAM constrained systems should be cautious enabling this.

ACARS

Variable Description Required Default
ENABLE_ACARS Toggle ACARS decoding on. If set to any non-blank value ACARS decoding will start. Set to "external" if you want to not use an SDR and push acarsdecoder json data to UDP port 5550 (needs port mapping 5550:5550/udp). No Blank
STATION_ID_ACARS Your unique ID for the ACARS feed. Used on the ACARS.io site. Follow the guide here for formatting. Yes, if ENABLE_ACARS is enabled Blank
FREQS_ACARS List of frequencies, separaed by a single ;, used for ACARS monitoring. Yes, if ENABLE_ACARS is enabled AND you are not using custom SDR definitions (see below) Blank

VDLM2

Variable Description Required Default
ENABLE_VDLM Toggle VDLM decoding on. If set to any non-blank value VDLM decoding will start. Set to "external" if you want to not use an SDR and push vdmldec json data to UDP port 5555 (needs port mapping 5555:5555/udp). No Blank
STATION_ID_VDLM Your unique ID for the VDLM feed. Used on the ACARS.io site. Follow the guide here for formatting. Yes, if ENABLE_VDLM is enabled Blank
FREQS_VDLM List of frequencies, separated by a single ;, used for VDLM monitoring. Yes, if ENABLE_VDLM is enabled AND you are not using custom SDR definitions (see below) Blank
VDLM_FILTER_ENABLE By default dumpvdl2 filters out certain kinds of messages. These messages have been determined to be generally not interesting and not of any import so it's safe to discard these. See note below. If you wish to see all VDLM2 messages your station is receiving set this value to be blank. No true
  • If you were previously running ACARS Hub and the vdlm2dec decoder you may see a "drop" in message rate in your stats. This is normal and is a result of vdlm2dec not doing any filtering and dumpvdl2 doing filtering. If you disable the filter you will see an increase in SD card writes so use with caution.

RTL Device assignment

Variable Description Required Default
BYPASS_SDR_CHECK If you experience issues with ACARS Hub failing to start because it cannot find your SDRs based on their serial, set this to any non-blank value to force it to bypass the check. Depending on the reason ACARS Hub could not map a serial to an SDR is because there is a problem with the SDR, and as a result ACARS Hub still won't start up properly, but there are cases where it might. It is suggested you also replace the serial number in Method 1 or 2 below with the device index (found via rtl_test). No Blank

You have two options that can be used interchangeably to assign RTLSDR devices in the container. The first method is most likely what most users will want

Method 1: Auto-assignment of SDRs

The container will auto-assign frequencies to an SDR based on the number of available SDRs and what decoder you've set up for that frequency. You can use both Method 1 and Method 2 to assign SDRs in the container, but ensure the serials used in one method are not used in the other.

Variable Description Required Default
SERIAL List of SDRs and configuration options (see below), with each SDR separated by a ; Yes, if Method 2 below is not used Blank

Example: SERIAL=00012507,2,-10,160;00012095,0,280,160

Method 2: Assign Specific Frequencies to a Specific SDR

If you wish to not have frequencies auto-assigned use this method. You can use both Method 1 and Method 2 to assign SDRs in the container, but ensure the serials used in one method are not used in the other. For each SDR you want to specify the frequency assignment/decoder, use one value from each of the following tables:

Variable Description Required Default
ACARS_x SDR with configuration options. Replace x with 0, and for every SDR you add under ACARS increase the number by one Yes, if Method 1 is not used above and you want ACARS decoding. See below for formatting the SDR line Yes, if Method 1 is not used
VDLM_x SDR with configuration options. Replace x with 0, and for every SDR you add under VDLM increase the number by one Yes, if Method 1 is not used above and you want VDLM decoding. See below for formatting the SDR line Blank

For frequency assignment, use the following:

Variable Description
ACARS_FREQ_x list of frequencies, each separated by a single ;, to be used by the ACARS_x decoder above. Ensure the number used is the same in both configuration variables: ie ACARS_0 and ACARS_FREQ_0
VDLM_FREQ_x list of frequencies, each separated by a single ;, to be used by the VDLM_x decoder above. Ensure the number used is the same in both configuration variables: IE VDLM_0 and VDLM_FREQ_0

Configuring the SDR options

To format the SDR configuration correctly, the container expects the following options:

  • SDR serial
  • PPM correction
  • Gain (see below for options there)
  • RTL Multiplier - for setting the bandwidth, used by ACARS only

If you don't wish to set the value for a certain option, you can skip it by leaving it blank

So if your serial for the SDR was 00012095, you had no PPM correction, and a gain of 28.0 and wanted to use the default RTL Multiplier: SERIAL=00012095,,28.0,

If you have more than one SDR being auto-assigned (NOT APPLICABLE to Method 2 above), separate each SDR with a ;

Example: SERIAL=00012095,,28.0,;00012507,2,A460

  • The ACARS Decoder supports AGC/Automatic Gain Control. To enable, prepend the gain value with an A. Additionally, you will need to set the gain value for VDLM. See below.
  • If you are not using ACG and wish to set the gain manually, use dBm format: 28.0
  • If you are using Auto-Assignment of the SDRs and wish to use ACG if the decoder is being used for ACARS, but want a specific value for VDLM, pre-pend the value with an A: A46.0
  • For the sample rate, use 192 for 2.4 MS/s and 160 for 2.0MS/s (default)

Viewing the messages

The container implements a basic web interface, listening on port 80, which will show messages as they are received.

If QUIET_LOGS is disabled, received messages are also logged to the container log.

Which frequencies should you monitor?

The ACARS.io/Airframes.io website has a great list of community derived frequencies that aircraft typically will broadcast ACARS/VDLM on, and what regions those are applicable to. The values provided in the example docker-compose/docker run example above are frequencies I have found to be good in the United States, with a decent level of traffic. I imagine the list is not complete, and could be refined better.

Some notes about frequencies:

  • acarsdec and dumpvdl2 are limited to monitoring 8 frequencies apiece
  • The spread of frequencies for each decoder has to be within 2 Mhz.

Logging

  • All processes are logged to the container's stdout. If QUIET_LOGS is disabled, all received aircraft messages are logged to the container log as well. General logging can be viewed with docker logs [-f] container.

A note about data sources used for the web site

A brief primer on some terms:

  • All ACARS/VDLM broadcasts that have a callsign appended to the message will use a two letter airline code

  • IATA is a two letter airline identification code. Many airlines don't actually have an IATA code and use their own internal code.

  • ICAO is an international standard, unique-across-the-world three letter airline code.

In order to make the website more usable, I have included a database used by the container to convert the two airline codes used in the messages from IATA to ICAO codes, and to show their long-form name. This data was found from public, free sources. The data had some errors in it, some of which was due to the age of the data, and some of it is due to airlines not always using the correct IATA codes in their broadcoast messages.

My observations are US centric, but from what I have seen there are "errors" you might notice in the converted callsigns.

  • US Airlines that have acquired airlines as part of mergers (for instance, American Airlines/AA/AAL, who has, among others, merged with America West/US/AWE) would show up as their legacy callsign if the aircraft being picked up was part of the airline that was merged in to the bigger airline. I've selectively fixed some of these errors because the IATA code of the legacy airline was not in use by anyone else.

  • Some airlines (UPS and FedEx, particularlly, among others) don't use their designated IATA callsigns period, or seem to be using contracted planes which are using an alternative two letter airline code in their message.

  • There are three IATA code regions that cover the world. If an airline flies only in one region, and another flies in a separate region, those airlines are allowed to use the same IATA code. The airline code generated from the database might use the wrong IATA code because of this.

So what this means is you will occasionally see callsigns on the web front end that are wrong. The above mentioned UPS will show up BHSxxxx/BahamasAir which is obviously not right, at least for my part of the world. I am hesitant to "fix" too many of these "errors" in the database because this container is being used all around the world.

The end result of this is that in messages where the airline code is improperly mapped the Flight Aware link generated will lead to the wrong flight. The TAIL link generated should be correct.

The Fix

If you add in the ENV variable IATA_OVERRIDE you can change your local web site to display the correct airline for your region.

Formatting is as follows: IATA|ICAO|Airline Name

If you have multiple airlines you wish to override, you add in a ; between them, such as the following: UP|UPS|United Parcel Service;US|AAL|American Airlines

For anyone in the US, I suggest adding IATA_OVERRIDE=UP|UPS|United Parcel Service to start out with.

If there are airlines you notice that are wrong because the data used is wrong (IATA codes do change over time as airlines come and go), or airlines that are missing from the database that do have an IATA code, submit a PR above and I'll get it in there!

Accessing ACARS/VDLM data with external programs

If you wish to access the JSON data that the decoders acarsdec and dumpvdl2 generate with an external program, such as FlightAirMap or Plane Plotter, expose the following ports in your docker-compose configuration:

  • Port 80 for the web site
  • Port 14444 for TCP VDLM2 Plane Plotter
  • Port 15555 for UDP VDLM2 JSON
  • Port 15550 for UDP ACARS JSON

Note about Plane Plotter export format

This is currently untested in those programs, so specific set up instructions for those programs are not available. If this format does not work (ie, it needs ACARS Hub to connect to it rather that it connect to ACARS Hub) please open an issue and let me know.

Additionally this format does not export ACARS at all and only supports VDLM2.

YAML Configuration for Ports

    ports:
      - 80:80
      - 15550:15550
      - 15555:15555
      - 14444:14444

And then you will be able to connect to yourpisipaddress:15555, yourpisipaddress:15550, or youripaddress:14444 respectively, in whatever program can decode ACARS/VDLM JSON.

Website tips and tricks

  • On the Live Message page pressing the p key on your keyboard will pause the message updates so you can catch up. Pressing p again will cause the page to refresh again and display messages as they come in.
  • On the search page enter your search terms and then press enter to start the search.

Future improvements

ACARS decoding appears to be in active development, and as such, I expect a lot of movement in data-visualization and presentation to happen. This container will follow those developments and add in functionality as it appears.

Getting Help

You can log an issue on the project's GitHub or visit the discord server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].