Skip to content

Instantly share code, notes, and snippets.

@leandrofilipe
Last active November 10, 2023 15:39
Show Gist options
  • Save leandrofilipe/cacbff1288baf98c0ace4ea3dc7d6ebe to your computer and use it in GitHub Desktop.
Save leandrofilipe/cacbff1288baf98c0ace4ea3dc7d6ebe to your computer and use it in GitHub Desktop.
ADS-B Setup

※ ADS-B Setup on Raspberry Pi ※

Some info: https://forum.flightradar24.com/threads/10232-How-to-Install-dump1090-mutability_1-15-dev-on-RPi

Installation of DUMP1090

  1. Install pre-built package of dump1090-mutability_1.15~dev on RPi/Raspbian (STRETCH & BUSTER):

    $ sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/dump1090/master/install_dump1090_mut_1.15.sh)"

    Alternative for Raspbian BUSTER:

    $ sudo apt-get update 
    $ sudo apt-get install lighttpd 
    $ sudo apt-get install dump1090-mutability
    $ sudo lighty-enable-mod dump1090  
  • Show DUMP1090 parameters:

    $ ./dump1090 --help

    List:

    -----------------------------------------------------------------------------
    | dump1090 ModeS Receiver        dump1090-mutability v1.15-dev-216-gae6a7ac |
    -----------------------------------------------------------------------------
    --device-index <index>   Select RTL device (default: 0)
    --gain <db>              Set gain (default: max gain. Use -10 for auto-gain)
    --enable-agc             Enable the Automatic Gain Control (default: off)
    --freq <hz>              Set frequency (default: 1090 Mhz)
    --ifile <filename>       Read data from file (use '-' for stdin)
    --iformat <format>       Sample format for --ifile: UC8 (default), SC16, or SC16Q11
    --throttle               When reading from a file, play back in realtime, not at max speed
    --interactive            Interactive mode refreshing data on screen. Implies --throttle
    --interactive-rows <num> Max number of rows in interactive mode (default: 15)
    --interactive-ttl <sec>  Remove from list if idle for <sec> (default: 60)
    --interactive-rtl1090    Display flight table in RTL1090 format
    --raw                    Show only messages hex values
    --net                    Enable networking
    --modeac                 Enable decoding of SSR Modes 3/A & 3/C
    --net-only               Enable just networking, no RTL device or file used
    --net-bind-address <ip>  IP address to bind to (default: Any; Use 127.0.0.1 for private)
    --net-http-port <ports>  HTTP server ports (default: 8080)
    --net-ri-port <ports>    TCP raw input listen ports  (default: 30001)
    --net-ro-port <ports>    TCP raw output listen ports (default: 30002)
    --net-sbs-port <ports>   TCP BaseStation output listen ports (default: 30003)
    --net-bi-port <ports>    TCP Beast input listen ports  (default: 30004,30104)
    --net-bo-port <ports>    TCP Beast output listen ports (default: 30005)
    --net-ro-size <size>     TCP output minimum size (default: 0)
    --net-ro-interval <rate> TCP output memory flush rate in seconds (default: 0)
    --net-heartbeat <rate>   TCP heartbeat rate in seconds (default: 60 sec; 0 to disable)
    --net-buffer <n>         TCP buffer size 64Kb * (2^n) (default: n=0, 64Kb)
    --net-verbatim           Do not apply CRC corrections to messages we forward; send unchanged
    --forward-mlat           Allow forwarding of received mlat results to output ports
    --lat <latitude>         Reference/receiver latitude for surface posn (opt)
    --lon <longitude>        Reference/receiver longitude for surface posn (opt)
    --max-range <distance>   Absolute maximum range for position decoding (in nm, default: 300)
    --fix                    Enable single-bits error correction using CRC
    --no-fix                 Disable single-bits error correction using CRC
    --no-crc-check           Disable messages with broken CRC (discouraged)
    --mlat                   display raw messages in Beast ascii mode
    --stats                  With --ifile print stats at exit. No other output
    --stats-range            Collect/show range histogram
    --stats-every <seconds>  Show and reset stats every <seconds> seconds
    --onlyaddr               Show only ICAO addresses (testing purposes)
    --metric                 Use metric units (meters, km/h, ...)
    --hae                    Show altitudes as HAE (with H suffix) when available
    --snip <level>           Strip IQ file removing samples < level
    --debug <flags>          Debug mode (verbose), see README for details
    --quiet                  Disable output to stdout. Use for daemon applications
    --show-only <addr>       Show only messages from the given ICAO on stdout
    --ppm <error>            Set receiver error in parts per million (default 0)
    --html-dir <dir>         Use <dir> as base directory for the internal HTTP server. Defaults to ./public_html
    --write-json <dir>       Periodically write json output to <dir> (for serving by a separate webserver)
    --write-json-every <t>   Write json output every t seconds (default 1)
    --json-location-accuracy <n>  Accuracy of receiver location in json metadata: 0=no location, 1=approximate, 2=exact
    --dcfilter               Apply a 1Hz DC filter to input data (requires lots more CPU)
    --help                   Show this help
    
    Debug mode flags: d = Log frames decoded with errors
                      D = Log frames decoded with zero errors
                      c = Log frames with bad CRC
                      C = Log frames with good CRC
                      p = Log frames with bad preamble
                      n = Log network debugging info
                      j = Log frames to frames.js, loadable by debug.html
    
  • Fetch data from port <port number>

    $ nc localhost <port number>

Installation of FR24

  1. Install FR24 feeder using command::

    $ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"

    Instructions on this page: https://www.flightradar24.com/raspberry-pi
    Manual: https://feed.flightradar24.com/fr24feed-manual.pdf

    This will install the feeder application following by geographical configuration and receiver configuuration.
    It will present a signup wizard, asking for email, sharing key, latitude, longitude, antenna height etc...

  2. Enter values below:

    Welcome to the FR24 Decoder/Feeder sign up wizard!
    
    Before you continue please make sure that:
    
    1 - Your ADS-B receiver is connected to this computer or is accessible over network
    2 - You know your antenna's latitude/longitude up to 4 decimal points and the altitude in feet
    3 - You have a working email address that will be used to contact you
    4 - fr24feed service is stopped. If not, please run: sudo service fr24feed stop
    
    To terminate - press Ctrl+C at any point
    
    Step 1.1 - Enter your email address ([email protected])
    $: <email address>
    
    Step 1.2 - If you used to feed FR24 with ADS-B data before enter your sharing key.
    If you don't remember your sharing key, please use the retrival form:
    https://feed.flightradar24.com/forgotten_key.php
    
    Otherwise leave this field empty and continue.
    $: <sharing key>
    
    Verifying sharing key...OK
    
    Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)
    $: yes
    
    IMPORTANT: For MLAT calculations the antenna's location should be entered very precise!
    
    Step 3.A - Enter antenna's latitude (DD.DDDD)
    $: <latitude>
    
    Step 3.B - Enter antenna's longitude (DDD.DDDD)
    $: <longitude>
    
    Step 3.C - Enter antenna's altitude above the sea level (in feet)
    $: <altitude>
    
    Using latitude: xx.xxxx, longitude: -xxx.xxxx, altitude: xxxft above sea level
    
    Validating email/location information...OK
    
    The closest airport found is ICAO:EGGW IATA:LTN near London.
    
    Latitude: 51.874722
    Longitude: -0.368330
    Country: United Kingdom
    
    Flightradar24 may, if needed, use your email address to contact you regarding your data feed.
    
    Would you like to continue using these settings?
    
    Enter your choice (yes/no)$: yes
    
    We have detected that you already have a dump1090 instance running. We can therefore 
    automatically configure the FR24 feeder to use existing receiver configuration, or you can 
    manually configure all the parameters.
    
    Would you like to use autoconfig (*yes*/no)$: no
    
    Step 4.1 - Receiver selection:
    1 - DVBT Stick (USB)
    -----------------------------------------------------
    2 - SBS1/SBS1er (USB/Network)
    3 - SBS3 (USB/Network)
    4 - ModeS Beast (USB/Network)
    5 - AVR Compatible (DVBT over network, etc)
    6 - microADSB (USB/Network)
    7 - SBSx via Basestation (localhost:30006)
    
    Enter your receiver type (1-7)$: 4
    
    Step 4.2 - Please select connection type:
    
    1 - Network connection
    2 - USB directly to this computer
    
    Enter your connection type (1-2)$: 1
    
    Step 4.3A - Please enter your receiver's IP address/hostname
    $: 127.0.0.1
    
    Step 4.3B - Please enter your receiver's data port number
    $: 30005
    
    Step 5.1 - Would you like to enable RAW data feed on port 30334 (yes/no)$: yes
    
    Step 5.2 - Would you like to enable Basestation data feed on port 30003 (yes/no)$: yes
    
    Step 6A - Please select desired logfile mode:
    0 - Disabled
    1 - 48 hour, 24h rotation
    2 - 72 hour, 24h rotation
    Select logfile mode (0-2)$: 2
    
    Step 6B - Please enter desired logfile path (/var/log/fr24feed):
    $:
    
    Submitting form data...OK
    
    Congratulations! You are now registered and ready to share ADS-B data with Flightradar24.
    + Your sharing key (XXXXXXxxXXXxXXxX) has been configured and emailed to you for backup purposes.
    + Your radar id is T-EGGWxxx, please include it in all email communication with us.
    + Please make sure to start sharing data within one month from now as otherwise your ID/KEY will be deleted.
    
    Thank you for supporting Flightradar24! We hope that you will enjoy our Premium services that will be 
    available to you when you become an active feeder.
    
    To start sending data now please execute:
    sudo systemctl start fr24feed
    
    Saving settings to /etc/fr24feed.ini...OK
    
    Installation and configuration completed!
    

Useful commands

Reference: https://forum.flightradar24.com/threads/9866-FR24feed-uploader-Additional-Info

  • Check fr24feed status:

    $ sudo fr24feed-status
    (non-pi versions over 1.23) $ sudo fr24feed --status
  • Start fr24feed (starts on reboot):

    $ sudo systemctl start fr24feed
    (old) $ sudo service fr24feed start
  • Stop fr24feed:

    $ sudo systemctl stop fr24feed
    (old) $ sudo service fr24feed stop
  • Restart fr24feed:

    $ sudo systemctl restart fr24feed
    (old) $ sudo service fr24feed restart
  • View log:

    $ cat /var/log/fr24feed/fr24feed.log
  • List associated files:

    $ dpkg-query -L fr24feed
    ```
    
  • Dump1090-Mutability status/restart/stop/reconfig:

    $ sudo service dump1090-mutability status (sudo systemctl status dump1090-mutability)
    $ sudo service dump1090-mutability restart (sudo systemctl restart dump1090-mutability)
    $ sudo service dump1090-mutability stop (sudo systemctl stop dump1090-mutability)
    $ sudo dpkg-reconfigure dump1090-mutability
  • Start fr24-feed with full screen output to diagnose possible errors:

    $ sudo fr24feed
    (CTRL-C to terminate)
  • Check for crashed/running instances causing port or start issues:
    (following command will report a PID for each process)

    $ pgrep -l fr24feed - list running FR24 processes
    $ pgrep -l dump1090 - list dump1090 instances
  • Kill process; replace with corresponding FR24 process number:

    $ sudo kill -9 <pid>
  • Re-run signup, re-enter key or reconfigure:

    $ sudo fr24feed --signup
    (Enter the identical details as first signup)
  • Uninstall or remove fr24feed (to remove radar ID -> email support):

    $ sudo apt-get remove fr24feed

    Optionally, to also remove any associated dependencies (may break other software):

    $ sudo apt-get remove --purge fr24feed  
  • Manually check for update:

    $ sudo apt-get install fr24feed
  • Check configuration file:

    $ less /etc/fr24feed.ini
  • Check port usage:

    $ lsof -i | grep fr24
  • List running FR24 and DUMP1090 processes:

    $ pgrep -l fr24feed
    $ pgrep -l dump1090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment