tbouron / MMM-FlightTracker

MagicMirror module that uses ADS-B systems to track nearby planes
Apache License 2.0
13 stars 10 forks source link
ads-b magic-mirror-modules magicmirror magicmirror2

MagicMirror² Module: Flight Tracker

MMM-FlightTracker is a module for MagicMirror² that allows you to display real time information about gather from nearby planes transponders. The data is received over radio signals, coming from nearby planes that is gather through an ADS-B receiver (this is how FlightRadar24 gets most of its data) connected directly to server running MagicMirror², or over a TCP stream of SBS1 messages.

Screenshot of the Flight Tracker module - Passing by

Screenshot of the Flight Tracker module - At the window

Screenshot of the Flight Tracker module - No planes

Usage

Prerequisites

This module requires that you have librtlsdr installed on your system.

Homebrew (macOS):

brew install librtlsdr

Debian based Linux distros:

apt-get install librtlsdr-dev

It also requires to have either:

Setup

Clone this module into your MagicMirror's modules directory and install the dependencies:

cd modules
git clone https://github.com/tbouron/MMM-FlightTracker
cd MMM-FlightTracker
npm i

Then add the module to your MagicMirror's configuration. Here is an example:

/* MagicMirror/config/config.js */
{
    /* ...your other config here */

    modules: [

        /* ...your other modules here */

        {
            module: 'MMM-FlightTracker',
            header: 'Nearby planes',
            position: 'top_left',
            config: {
                interval: Number,
                animationSpeed: Number,
                passingByThreshold: Number,
                orderBy: '(age|altitude|speed|distance):(asc|desc)',
                limit: Number,
                speedUnits: 'metric|imperial|knots',
                altitudeUnits: 'metric|imperial',
                latLng: [55.9411885, -3.2753781],
                showAirline: Boolean,
                showType: Boolean,
                showSpeed: Boolean,
                showAltitude: Boolean,
                showHeading: Boolean,
                client: {
                    mode: 'rtlsdr|network',
                    host: 'acme.com',
                    port: 30003
                }
            }
        }
    ]
}

Configuration options

Configuration key Description Default Required
interval Interval to check if new planes are nearby. This value is in seconds. 1 Yes
animationSpeed Animation speed to display/hide the module when planes come and go. This value is in milliseconds. 1000 No
passingByThreshold The threshold altitude to determine if a plane is "at the window" or just "passing by". If no set (or negative) then all planes will be treated the same way. -1 No
latLng Your current coordinates, as an Array of Number. E.g. [55.9411885, -3.2753781].

When defined, the distance and bearing, from your coordinates to the plane, will be displayed if available (requires the plane's coordinates to be known).
undefined No
orderBy The property to order the list of planes by. The syntax for this configuration option is as follow <property>:<order>.

Valid values for <property> are:
  • age (e.g. most recent or older plane tracked)
  • altitude
  • speed
  • distance (available only if you supply latLng configuration and the plane broadcast its coordinates)

Valid values for <order> are: asc or desc
undefined No
limit Limit the number of planes to display. If not set (or negative) then all tracked planes are displayed. -1 No
speedUnits The unit to use for speed. By default, it will use the unit defined at the global config. Can be metric, imperial or knots. Global unit config No
altitudeUnits The unit to use for altitude and distance to the plane (if latLng is defined). By default, it will use the unit defined at the global config. Can be metric or imperial. Global unit config No
showAirline Whether or not show the airline for each flight, if available. true No
showType Whether or not show the aircraft type for each flight, if available. true No
showSpeed Whether or not show the aircraft speed for each flight, if available. true No
showAltitude Whether or not show the aircraft altitude for each flight, if available. true No
showHeading Whether or not show the aircraft heading for each flight, if available. true No
client The configuration for the ADS-B client. By default, the mode is set to rtlsdr (not other options are needed in this mode). In case of network mode, options host and port are required. {mode: 'rtlsdr'} No