ページへ戻る

− Links

 印刷 

Gentoo Linuxな生活​/Flightrador24のFeedで悩む :: Nest Of Hawk

xpwiki:Gentoo Linuxな生活/Flightrador24のFeedで悩む

ページ内コンテンツ
  • Flightrador24とは
  • Feedってなんじゃ?
  • そもそもどうやって受信するの?
  • ソフトのインストール
    • ツール類をインストールする
    • dump1090の設定
    • fr24feedの設定
    • 最後に再起動時の自動起動設定

Flightrador24とは anchor.png[1]

Flightrador24[2]は、ADS-Bの情報など、飛行機が発信するトランスポンダーの情報を元に、機体識別、位置情報などを把握し、一覧化してくれているサービスです。飛行機好きには非常に便利なサービスで、フリーでも使用できるのですが、広告を外したり、機能追加をしようとすると、有償でお金がかかります。

Page Top

Feedってなんじゃ? anchor.png[3]

そもそもどうやってその飛行機が発信するトランスポンダーの情報を得ているのかというと、世界各国にあるレーダーやアンテナから、受信した情報を送ってもらい、整合をとってから一覧化しているのです。さて、このレーダー、オフィシャルに航空管制のシステムで作られたものだけでは、管轄できる空域に穴があいたり、そもそも使わせてくれるのか?という疑問があります。

そこで、有志で受信可能な環境を持っているユーザーから、受信したADS-B情報を送ってもらい、情報を補完しているというわけ。で、この情報提供者には、お礼で有償サービスを使わせてくれているというのが、Feedする意義です。

Page Top

そもそもどうやって受信するの? anchor.png[4]

今飛行機が情報をやり取りしているADS-Bは、1090MHzの周波数帯でやりとりされております。この周波数の電波を受信するには、「R820T2」というRealtekのチップを使ったチューナーを用いて受信いたします。Amazonさんで「R820T2」のキーワードで検索するといっぱい出てきます。わたしはこれ[5]を購入いたしました。で、これをPCのUSBポートに刺し、アンテナを窓際に設置すれば、受信準備完了です。USBドングルを刺して、電源ONのLEDが点灯すれば、デバイスを認識した証拠です。dmesgとかで見てみましょう。

usb 1-4.3: new high-speed USB device number 9 using xhci_hcd
usb 1-4.3: New USB device found, idVendor=0bda, idProduct=2838, bcdDevice= 1.00
usb 1-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-4.3: Product: RTL2838UHIDIR
usb 1-4.3: Manufacturer: Realtek
usb 1-4.3: SerialNumber: 00000001

こんなのでたら、認識している証拠です。

Page Top

ソフトのインストール anchor.png[6]

Page Top

ツール類をインストールする anchor.png[7]

まず、/etc/portage/package.licenseに、以下の記述を追加します。

>=app-misc/fr24feed-1.0.25_p3 Flightradar24

続いて、以下のコマンドを叩く。

# emerge fr24feed

rtl-sdr,dump1090,fr24feedの各パッケージがインストールされます。

Page Top

dump1090の設定 anchor.png[8]

dump1090は、先程のUSBドングルから1090MHz帯の受信情報を落としてくるツールです。emergeのパッケージも中途半端で、バイナリのコンパイルしかしてくれないので、こんなファイルを準備する。

/etc/conf.d/dump1090

# /etc/conf.d/dump1090 - configuration file for /etc/init.d/dump1090

RECEIVER_OPTIONS="--device-index 0 --gain -10 --ppm 0 --quiet"
DECODER_OPTIONS="-max-range 360 --fix"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"
JSON_OPTIONS="--json-location-accuracy 1"

/etc/init.d/dump1090

#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

depend() {
       use net
}

start() {
       ebegin "Starting dump1090"
       start-stop-daemon --start --quiet --pidfile /run/dump1090.pid \
               --background --make-pidfile --exec /usr/bin/dump1090 \
   -1 /var/log/dump1090.log -2 /var/log/dump1090.log \
               -- ${RECEIVER_OPTIONS} ${DECODER_OPTIONS} ${NET_OPTIONS} ${JSON_OPTIONS}
       eend ${?}
}

stop() {
       ebegin "Stopping dump1090"
       start-stop-daemon --stop --quiet --pidfile /run/dump1090.pid
       eend ${?}
}

さて、これで起動するシェルができました。で、dump1090を起動しておきます。

# /etc/init.d/dump1090 start
Page Top

fr24feedの設定 anchor.png[9]

まずはFlightrador24のページ[2]で、アカウント登録を行います。ここで使用したメアドが、以下の設定で使われるので覚えておいてくださいね♪ さて、コマンド入力しましょう

# fr24feed --signup

main][i]FR24 Feeder/Decoder
[main][i]Version: 1.0.18-9/generic
[main][i]Built on Apr 20 2017 09:25:30 (T201704200925/Linux/static_arm)
[main][i]Copyright 2012-2017 Flightradar24 AB
[main][i]http://flightradar24.com
[main][i]DNS mode: PING

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 (username@domain.tld)
$:<FR24に登録したメールアドレス>

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, pelase use the retrival form:
http://feed.flightradar24.com/forgotten_key.php

Otherwise leave this field empty and continue.
$:<リターンで勝手に設定される>

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!

前提ですが、アンテナを設置する場所の緯度、軽度、高度は、国土地理院のホームページの地理院地図で調べられます。緯度、軽度は10進方式で入力。地形の海抜高度がわかりますから、さらにそこからアンテナ設置位置を想定で足し合わせて、さらにフィートに変換して以下に入力します。

Step 3.A - Enter antenna's latitude (DD.DDDD)
$:<アンテナ設置位置の緯度を入力>

Step 3.B - Enter antenna's longitude (DDD.DDDD)
$:<アンテナ設置位置の経度を入力>

Step 3.C - Enter antenna's altitude above the sea level (in feet)
$:アンテナ設置位置高さ

Using latitude: DD.DDDD, longitude: DDD.DDDD, altitude: FFft above sea level

Validating email/location information...OK

The closest airport found is ICAO:RJTT IATA:HND near Tokyo.

Latitude: DD.DDDD
Longitude: DDD.DDDD
Country: Japan

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)$: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)$:0

Step 6B - Please enter desired logfile path (/var/log):
$:/var/log

Submitting form data...OK

Congratulations! You are now registered and ready to share ADS-B data with Flightradar24.
+ Your sharing key (xxxxxxxxxxxxxxx) has been configured and emailed to you for backup purposes.
+ Your radar id is T-RJTTXXX, please include it in all email communication with us.
+ Please make sure to start sharing data within the next 3 days 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 service fr24feed start

Saving settings to /etc/fr24feed.ini...OK
Installation and configuration completed!

これで以下を実行すると動き出します。

# /etc/init.d/fr24feed start

fr24feedが起動している状態で、http://<fr24feedが起動しているIPアドレス>:8754 にアクセスすると、フィーダーの状態がブラウザで表示されます。設定変更とかもできますので、ご確認あれ~♪

とりあえずうまくADS-Bが捕捉できれば、feedがされてBusinessアカウントが与えられます。お試しあれ~♪

Page Top

最後に再起動時の自動起動設定 anchor.png[10]

# rc-update add dump1090 default
# rc-update add fr24feed default

完了でっす。


Last-modified: 2020-11-08 (日) 23:15:31 (JST) (1257d) by maruo