
Flightradar24で使用されているADS-Bの情報をデコードするdump1090をコマンドラインで使用してみます。
記事の目次
Flightradar24のサービスを停止する!
SDRのドングルをコマンドラインで使用できるようにするため、Flightradar24のサービスを停止します。
$ sudo systemctl stop fr24feed.service
dump1090のヘルプを参照してみる!
dump1090のヘルプを参照します。多機能であることがわかります。
pi@ras011p1:~ $ /usr/lib/fr24/dump1090 --help
-----------------------------------------------------------------------------
| dump1090 ModeS Receiver EB_SOURCE EB_VERSION |
-----------------------------------------------------------------------------
--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: 22)
--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-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 Print stats at exit
--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, ...)
--gnss Show altitudes as HAE/GNSS (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 /usr/share/dump1090-mutability/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
対話モード(interactive mode)を使用してみる!
試しに、対話モードを使用してみます。以下のような情報が、リアルタイムに更新されて表示されます。
$ /usr/lib/fr24/dump1090 --interactive Hex Mode Sqwk Flight Alt Spd Hdg Lat Long RSSI Msgs Ti/ ------------------------------------------------------------------------------- 8464D2 S 2011 ANA1097 3350 202 136 35.523 139.875 -23.6 251 11 86DDD4 S 2165 2550 -24.8 7 32 86D2AA S 7302 ANA265 17750 -23.4 15 42 84C43E S 2403 SFJ85 7625 235 264 35.460 139.818 -20.3 638 0 86D6A4 S 3345 ANA35 15375 342 256 35.347 139.585 -19.1 881 0 4D0109 S 3256 ICV5717 28000 309 257 35.441 139.872 -24.7 272 3
Web画面を表示してみる!
Web画面を表示してみます。dump1090を停止して、Flightradar24のサービスを起動します。
sudo systemctl start fr24feed.service
以下のように、RaspberrypiのIPアドレスを使用して、ブラウザでアクセスします。
http://10.1.5.11/dump1090/
おわりに
Flightradar24の仕組みを理解するために、dump1090をコマンドラインで動作させてみました。ADS-B情報を出力して、Webサーバで表示できるようにすると独自のFlightradar24のようなサイトが構築できるようです。
関連記事
関連書籍(Amazon)


