LoginSignup
8
7

More than 1 year has passed since last update.

ラズパイでflightradar24にFeed提供

Last updated at Posted at 2020-06-29

はじめに

昨年秋、台風の中、果敢に飛行を続けるキャセイパシフィックの画像を見て、flightradar24にとても興味を持ちました。
いつかは自分もフィードするぞ、と思い早数か月…ようやく実現しました。(遅いよ)

果敢なキャセイが紹介されています

事前に必要なもの

(※1) 安いのを買うと、R820T2と書いていても、使えないことがあるので買うときはしっかりレビューを見て買いましょう。(2台目を迎え入れる羽目になりました。)

(※2) 地理院地図で住所を入れると経度・緯度が出てくれて、地点のピンを選択すると高度が出ます。高度、メートル表記なのですが、インストール時に求められるのはフィードなので、フィード換算しておきましょう。

インストール

  • raspbianは入れておいてください。

  • ラズパイにUSBを指してflightradar24feedは下記のコマンドを実行するだけです。(※0)

    • コマンド
    sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)" 
    
    • 実行結果(対話形式で入力していきます。)
    $ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
    ・・・
    fr24feed (1.0.25-3) を設定しています ...
    You don't seem to have any dump1090 installed. On the fr24feed start it will automatically install dump1090-mutability.
    Created symlink /etc/systemd/system/multi-user.target.wants/fr24feed.service →     
    /etc/systemd/system/fr24feed.service.
    ・・・
    ______  _  _         _      _                    _              _____    ___
    |  ___|| |(_)       | |    | |                  | |            / __  \  /   |
    | |_   | | _   __ _ | |__  | |_  _ __  __ _   __| |  __ _  _ __`' / /' / /| |
    |  _|  | || | / _` || '_ \ | __|| '__|/ _` | / _` | / _` || '__| / /  / /_| |
    | |    | || || (_| || | | || |_ | |  | (_| || (_| || (_| || |  ./ /___\___  |
    \_|    |_||_| \__, ||_| |_| \__||_|   \__,_| \__,_| \__,_||_|  \_____/    |_/
                   __/ |                                                        
                  |___/                                                         
    [main][i]FR24 Feeder/Decoder
    [main][i]Version: 1.0.25-3/generic
    [main][i]Built on Apr  8 2020 07:06:55 (HEAD-5e8ef0c.git/Linux/static_armel)
    [main][i]Running on: raspbian9
    [main][i]Local IP(s): 192.168.11.10
    [main][i]Copyright 2012-2020 Flightradar24 AB
    [main][i]https://www.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 systemctl stop fr24feed
    To terminate - press Ctrl+C at any point
    Step 1.1 - Enter your email address (username@domain.tld)
    $: hogehoge@test.com<=== ★(※1)
    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, you can find it in your account on the website under "My data sharing".
    https://www.flightradar24.com/account/data-sharing
    Otherwise leave this field empty and continue.
    $: <=== ★(※2)
    Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)$: yes  <=== ★(※3)
    IMPORTANT: For MLAT calculations the antenna's location should be entered very precise!
    Step 3.A - Enter antenna's latitude (DD.DDDD)
    $: <===★(※4)
    Step 3.B - Enter antenna's longitude (DDD.DDDD)
    $: <===★(※5)
    Step 3.C - Enter antenna's altitude above the sea level (in feet)
    $: <===★(※6) 
    Using latitude: ${入力した緯度}, longitude: ${入力した経度}, altitude: ${入力した標高}ft above sea level
    Validating email/location information...OK
    Latitude: ${入力した緯度}
    Longitude: ${入力した経度}
    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 <===★(※7)
    Step 4.1 - Receiver selection (in order to run MLAT please use DVB-T stick with dump1090 utility bundled with     fr24feed):
     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)$: <===★(※8)
    Checking for dump1090...NOT FOUND
    Step 4.3 - Enter your additional dump1090 arguments or leave empty
     <===★(※9)
    Step 5.1 - Would you like to enable RAW data feed on port 30002 (yes/no)$:yes
    Step 5.2 - Would you like to enable Basestation data feed on port 30003 (yes/no)$:yes
    Step 6 - Please select desired logfile mode:
     0 -  Disabled
     1 -  48 hour, 24h rotation
     2 -  72 hour, 24h rotation
    Select logfile mode (0-2)$: <===★(※10)
    Submitting form data...OK
    Congratulations! You are now registered and ready to share ADS-B data with Flightradar24.
    + Your sharing key (1cXXXXXXXXXXXXXX) ★(※11) has been configured and emailed to you for backup purposes.
    + Your radar id is T-RJTTXXX ★(※12), 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!
    

(※0) ラズパイが古いと、rtl-sdrやdump1090をインストールしてビルドしたりしないといけない模様。
(※1) flightradar24に登録したアドレス。
(※2) 初回は空欄でよい。再インストールなど、flightradar24のアカウントとシェアリングキーがある場合はそのシェアリングキーを入れる。
(※3) MLATの計算に参加?よくわからないのでyesを入力。
(※4) 事前に調べた緯度を入力。
(※5) 事前に調べた経度を入力。
(※6) 標高を「フィート」で入力。
(※7) 設定値に誤りがなければyesを入力。
(※8) 1を入力。
(※9) 追加のdump1090がない場合は空欄でよい。
(※10) ログのローテーションタイミングを選ぶ。1にしておいた。
(※11) 発行されたシェアリングキーが表示される。(後からメールにも届く + flightradar24にログインしても表示されるので控えておかなくてもよい。)
(※12) 発行されたRADAR IDが表示される。(後からメールにも届く + flightradar24にログインしても表示されるので控えておかなくてもよい。)

  • completedが出たら、起動する。

    sudo systemctl start fr24feed
    

インストール後の確認

ラズパイの確認

  • すべてOKになっていることを確認

    pi@raspberrypi:~ $fr24feed-status
    [ ok ] FR24 Feeder/Decoder Process: running.
    [ ok ] FR24 Stats Timestamp: 2020-06-29 14:14:24.
    [ ok ] FR24 Link: connected [UDP].
    [ ok ] FR24 Radar: ${RADAR_ID}
    [ ok ] FR24 Tracked AC:.
    [ ok ] Receiver: connected (239 MSGS/0 SYNC).
    [ ok ] FR24 MLAT: ok [UDP].
    [ ok ] FR24 MLAT AC seen: 1.
    

1. 起動後、すぐだとNGになる項目もあるので、起動後、少し時間をおいてからコマンドを実行するのが良い。

2. 1台目のUSBドングルはなぜか最後のMLAT ACだけNGになってしまい、いろいろ試しても改善しなかったので買いなおす羽目になりました。

  • Activeが"active"になっていることを確認
 pi@raspberrypi:~ $ sudo systemctl status fr24feed
 ● fr24feed.service - Flightradar24 Decoder & Feeder
 Loaded: loaded (/etc/systemd/system/fr24feed.service; enabled; vendor preset:
 Active: active (running) since Mon 2020-06-29 22:51:51 JST; 25min ago
 Process: 423 ExecStartPre=/usr/lib/fr24/create_missing_directories.sh (code=ex
 Process: 395 ExecStartPre=/usr/lib/fr24/unregister_kernel_modules.sh (code=exi
 Process: 319 ExecStartPre=/usr/lib/fr24/install_dump1090.sh (code=exited, stat
 Main PID: 433 (fr24feed)
 CGroup: /system.slice/fr24feed.service
        ├─433 /usr/bin/fr24feed
        └─990 /usr/bin/dump1090-mutability --raw --mlat --write-json /run/dum
 6月 29 22:51:50 raspberrypi systemd[1]: Starting Flightradar24 Decoder & Feeder.
 6月 29 22:51:51 raspberrypi systemd[1]: Started Flightradar24 Decoder & Feeder.
lines 1-13/13 (END)

flightradar24の確認

account.png

IDが2個あるのは、導入に失敗した残骸が残っている…

data.png

まれに調子が悪いと、NoDataになるが、微弱ながらもデータは取得できている)

引っかかったこと

  • インストール時、何からやればよいのかわからなかった

    • 本家のページ見るのを渋って、人様の熟成されたブログをあさって試行錯誤するも、うまくいかなかった。
      • なんでも、困ったときは本家を見るべき...
  • USBドングルがダメだったことに気づくのが遅かった

    • 何度となくインストール、レシーバーを選びなおすもfr24feed-statusを実行してもなかなかすべてがOKにならない。
      • R820T2と書いていても、使えないことがある...

Flightradar24の楽しみ方

(20200721追記)

  • 飛んでいる飛行機を押して航路を楽しむのもいいですが…こんな楽しみ方もあります。
    • 過去のデータが見れる

      • 空港の位置mark.png
        をクリックすると、予定されている飛行機が見えます。(空港情報のarrivals/depaturesにあるflightinfoを押すと次の画面が出ます。)
        fnj.png
    • どこまで過去分がさかのぼれるかは微妙なところですが、3年前に乗ったやつは見れました。
      hnd_to_jfk2.png

    • 上の画面でplayを選択すると、見れます。
      hnd_to_jfk.png

    • 検索も、できます。

インストールして何もしていなかったらメールが来た

  • しばらく放置しているとメールが来た件
    (20230330追記)
    インストールしてそのままにしていたら、ソフトウェアのバージョンのEOLを迎えました。
    メールを届けてくれるなんて、親切ですね。
    mail_1.png

メールに送付されている手順通りに更新を試みるも、updateが空振りしているようでした。
結局、再インストールをして、事なきを得ましたが…fr24feed-status を実行すると、FR24 MLAT AC seen: 1. がNGになってしまいました。。。NGになっていても、なぜか動いているこの不思議。

再インストールは、Flightradar24のfeederのアップデートがfr24feed_updater.shで出来ないならinstall_fr24_rpi.shで再インストールすればOK のページにお世話になりました。

このページでやっていることを繰り返すことになります。なので、緯度・経度は計っておいたほうが良いです。
あと、インストールしなおすとRADARが変わってしまいます。(今まで使っていたのが使えなくなります)

参考

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7