VDLデコード by Raspberry Pi + dumpvdl2

ACARSに代わるVHFデータ通信として、VDLが普及しつつあります。

B787をはじめこれからの航空機通信の主力となります。

Raspberry PiにてVDLを受信するまでの記録です。

必要機材:

Raspberry Pi基本セット + DVB-Tチューナ(RTL2832U) + VHFを受信できる屋外アンテナ

What is VDL Mode 2?

VDL (VHF Data Link) Mode 2 is a communication protocol between aircraft and a network of ground stations. It has a higher capacity than ACARS and a lot more applications. More information can be found on Wikipedia or SigIdWiki.

# DVB受信ドングルの認識確認(Bus 001 Device 004: ID 0bda:2838 にて認識)
lsusb
Bus 001 Device 006: ID 04e6:511a SCM Microsystems, Inc.
Bus 001 Device 005: ID 3275:0080 VidzMedia Pte Ltd
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# 必要ライブラリinstall
sudo apt install build-essential cmake git libglib2.0-dev pkg-config
sudo apt install librtlsdr-dev

# Install libacars library
cd
git clone https://github.com/szpajder/libacars
cd libacars
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

# SQLite (optional)
sudo apt install libsqlite3-dev
sudo ldconfig

# dumpvdl2
VDL Mode 2 message decoder and protocol analyzer. Contribute to szpajder/dumpvdl2 development by creating an account on GitHub.
.git" class="blog-card-thumbnail-link" target="_blank">
VDL Mode 2 message decoder and protocol analyzer. Contribute to szpajder/dumpvdl2 development by creating an account on GitHub.
# dumpvdl2ダウンロード & install
cd
git clone https://github.com/szpajder/dumpvdl2.git
cd dumpvdl2
mkdir build
cd build
cmake ../
make
sudo make install

# The last command installs the binary named dumpvdl2 to the default bin directory (on Linux it's /usr/local/bin). To display a list of available command line options, run:
/usr/local/bin/dumpvdl2 --help

# dumpvdl2の起動
sudo dumpvdl2 --rtlsdr 0 --gain 49.6 --correction 42 --output decoded:text:file:path=/tmp/vdl2.logrotate=daily

dumpvdl2 2.1.0 (libacars 2.1.2)
Warning: frequency not set - using VDL2 Common Signalling Channel as a default (136975000 Hz)
Sampling rate set to 1050000 sps
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
usb_claim_interface error -6
Failed to open rtlsdr device #0: error -6

# acarsdeco2にてDVB-Tが先に利用されているためのError
# acarsdeco2を終了させ、正常に起動できたときのmessage
# "[R82XX] PLL not locked!"は気にしない。
# logは/tmp/video/vdl2.logに出力

# 起動時にBaseStation.sqbを指定すると、航空機の型式” AC info: ”が追加して表示されます。

sudo dumpvdl2 --rtlsdr 0 --gain 49.6 --correction 42 --output decoded:text:file:path=/tmp/vdl2.log,rotate=daily --bs-db /tmp/BaseStation.sqb

dumpvdl2 2.1.0 (libacars 2.1.2)
Warning: frequency not set - using VDL2 Common Signalling Channel as a default (136975000 Hz)
Sampling rate set to 1050000 sps
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 1050000.026077 Hz
[R82XX] PLL not locked!
Center frequency set to 136975000 Hz
Device #0: gain set to 40.20 dB
Device 0 started
Allocating 15 zero-copy buffers

# 参考: --rtlsdr 1 136975000  rtlsdrドングルの番号を指定 acarsdecとかち合わないように注意 共通チャンネル136.975MHzを指定(デフォルト)

自動起動処理

# Copy the unit file to the systemd unit directory:
sudo cp /etc/dumpvdl2.service /etc/systemd/system/

# Copy the example environment file to /etc/default directory:
sudo cp etc/dumpvdl2 /etc/default/

# Edit /etc/default/dumpvdl2 with a text editor (eg. nano). Uncomment the DUMPVDL2_OPTIONS= line and put your preferred dumpvdl2 option set there. Example:
 DUMPVDL2_OPTIONS="--rtlsdr 0 --gain 39 --correction 0 --output decoded:text:file:path=/home/pi/vdl2.log,rotate=daily 136975000 136875000 136775000"
 DUMPVDL2_OPTIONS="--msg-filter all,-acars_nodata --rtlsdr 0 --gain 49.6 --correction 42 --output decoded:text:file:path=/tmp/video/dump-vdl/dumpvdl2.log,rotate=daily --bs-db /tmp/video/dump-vdl/BaseStation.sqb"


# Reload systemd configuration:
sudo systemctl daemon-reload

# Start the service:
sudo systemctl start dumpvdl2

# Verify if it's running:
systemctl status dumpvdl2

colorized logs by multitail

sudo apt install multitail
sudo cp ~/dumpvdl2/extras/multitail-dumpvdl2.conf /etc
sudo echo "include:/etc/multitail-dumpvdl2.conf" >> /etc/multitail.conf

# 起動
multitail -cS dumpvdl2 ./vdl2.log
dumpvdl2
dumpvdl2

VDLのログ:acarsよりも整っていて、情報が多い。

cat ./vdl2.log

[2021-01-11 16:59:29 JST] [136.975] [-17.6/-42.2 dBFS] [24.7 dB] [-28.3 ppm]
71BE29 (Aircraft, Airborne) -> F00225 (Ground station): Command
AC info: N604FE, MD11, FDX
AVLC type: I sseq: 4 rseq: 4 poll: 0
 ACARS:
  Reassembly: skipped
  Reg: .N604FE Flight: FX9815
  Mode: 2 Label: B6 Blk id: 1 More: 0 Ack: ! Msg num: F25A
  Message:
   /FUKJJYA.ADSB-180020308071D5B2347DAC946F78F9F171B538B3474494708AB0D1AE44B3094
C9470A841AB4CB2BE74947000E4F90BF00000F5349A10000F6ED
  ADS-C message:
   Acknowledgement:
    Contract number: 8
   Basic report:
    Lat: 41.2818146
    Lon: 147.6306725
    Alt: 37996 ft
    Time: 3555.875 sec past hour (:59:15.875)
    Position accuracy: <0.05 nm
    NAV unit redundancy: OK
    TCAS: OK
   Fixed projection:
    Lat: 38.4276009
    Lon: 144.2204475
    Alt: 38000 ft
    ETA: 2219 sec
   Predicted route:
    Next waypoint:
     Lat: 37.8164864
     Lon: 143.5396385
     Alt: 38000 ft
Wait a minute...
    Lon: 143.1528854
    Alt: 37956 ft
    ETA: 2217 sec
   Predicted route:
    Next waypoint:
     Lat: 40.4195595
     Lon: 144.9961853
     Alt: 37952 ft
     ETA: 780 sec
    Next+1 waypoint:
     Lat: 38.9063644
     Lon: 143.2280731
     Alt: 37952 ft
   Earth reference data:
    True track: 223.2 deg
    Ground speed: 372.0 kt
    Vertical speed: 48 ft/min
   Air reference data:
    True heading: 234.1 deg
    Mach speed: 0.8225
    Vertical speed: 48 ft/min

参考:dumpvdl2 –help

dumpvdl2 --help
dumpvdl2 2.1.0 (libacars 2.1.2)
Usage:

RTL-SDR receiver:

    dumpvdl2 [output_options] --rtlsdr <device_id> [rtlsdr_options] [<freq_1> [<freq_2> [...]]]

Read I/Q samples from file:

    dumpvdl2 [output_options] --iq-file <input_file> [file_options] [<freq_1> [<freq_2> [...]]]

General options:
    --help                                      Displays this text
    --version                                   Displays program version number
common options:
    <freq_1> [<freq_2> [...]]                   VDL2 channel frequencies, in Hz

Maximum number of simultaneous VDL2 channels supported is 8.
If channel frequencies are omitted, VDL2 Common Signalling Channel (136975000 Hz) will be used as default.

rtlsdr_options:
    --rtlsdr <device_id>                        Use RTL device with specified ID or serial number (default: ID=0)
    --gain <gain>                               Set gain (decibels)
    --correction <correction>                   Set freq correction (ppm)
    --centerfreq <center_frequency>             Set center frequency in Hz (default: auto)

file_options:
    --iq-file <input_file>                      Read I/Q samples from file
    --centerfreq <center_frequency>             Center frequency of the input data, in Hz (default: 0)
    --oversample <oversample_rate>              Oversampling rate for recorded data
                                                (sampling rate will be set to 105000 * oversample_rate)
                                                Default: 10
    --sample-format <sample_format>             Input sample format. Supported formats:
        U8                                      8-bit unsigned (eg. recorded with rtl_sdr) (default)
        S16LE                                   16-bit signed, little-endian (eg. recorded with miri_sdr)

Output options:
    --output <output_specifier>                 Output specification (default: decoded:text:file:path=-)
                                                (See "--output help" for details)
    --output-queue-hwm <integer>                High water mark value for output queues (0 = no limit)
                                                (default: 1000 messages, not applicable when using --iq-file or --raw-frames-file)
    --decode-fragments                          Decode higher level protocols in fragmented packets
    --gs-file <file>                            Read ground station info from <file> (MultiPSK format)
    --bs-db <file>                              Read aircraft info from Basestation database <file> (SQLite)
    --addrinfo terse|normal|verbose             Aircraft/ground station info verbosity level (default: normal)
    --station-id <name>                         Receiver site identifier
                                                Maximum length: 255 characters
    --msg-filter <filter_spec>                  Output only a specified subset of messages (default: all)
                                                (See "--msg-filter help" for details)

Text output formatting options:
    --utc                                       Use UTC timestamps in output and file names
    --milliseconds                              Print milliseconds in timestamps
    --raw-frames                                Print raw AVLC frame as hex
    --dump-asn1                                 Print full ASN.1 structure of CM and CPDLC messages
    --extended-header                           Print additional fields in message header
    --prettify-xml                              Pretty-print XML payloads in ACARS and MIAM CORE PDUs

こちらのページを参考にさせていただきました。ありがとうございます。

dumpvdl2の配布元はこちらになります。

https://github.com/szpajder/dumpvdl2