初代 Raspberry Pi にDVB-Tドングルを繋いで構築した ADS-B 受信機が、 FlightAware へデータ提供するためのシステム、PiAwareに FlightRadar24 へのデータ提供機能を追加しました。
FlightRadar24インストールバッチ
FlightRadar24のフィードを導入するため、チュートリアルに従ってターミナル上で次のコマンドを実行します。
1 |
$ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)" |
インストールスクリプトがダウンロードされると、そのまま自動的にインストールウィザードが始まります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
$ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)" --2022-12-28 12:25:02-- https://repo-feed.flightradar24.com/install_fr24_rpi.sh Resolving repo-feed.flightradar24.com (repo-feed.flightradar24.com)... 104.17.45.52, 104.17.43.52, 104.17.46.52, ... Connecting to repo-feed.flightradar24.com (repo-feed.flightradar24.com)|104.17.45.52|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1349 (1.3K) [application/x-sh] Saving to: ‘STDOUT’ 100%[==========================================>] 1.32K --.-KB/s in 0.002s 2022-12-28 12:25:03 (658 KB/s) - written to stdout [1349/1349] Hit:1 http://repo.feed.flightradar24.com flightradar24 InRelease Hit:2 http://flightaware.com/mirror/raspbian/raspbian stretch InRelease Hit:3 http://flightaware.com/adsb/piaware/files/packages stretch InRelease Hit:4 http://flightaware.com/mirror/raspberrypi/debian stretch InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done dirmngr is already the newest version (2.1.18-8~deb9u4). 0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded. Executing: /tmp/apt-key-gpghome.A6Oqc2JSGl/gpg.1.sh --recv-key --keyserver keyserver.ubuntu.com C969F07840C430F5 gpg: key C969F07840C430F5: "Flightradar24 <support@fr24.com>" not changed gpg: Total number processed: 1 gpg: unchanged: 1 Hit:1 http://repo.feed.flightradar24.com flightradar24 InRelease Hit:2 http://flightaware.com/mirror/raspbian/raspbian stretch InRelease Hit:3 http://flightaware.com/adsb/piaware/files/packages stretch InRelease Hit:4 http://flightaware.com/mirror/raspberrypi/debian stretch InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done fr24feed is already the newest version (1.0.30-3). 0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded. ______ _ _ _ _ _ _____ ___ | ___|| |(_) | | | | | | / __ \ / | | |_ | | _ __ _ | |__ | |_ _ __ __ _ __| | __ _ _ __`' / /' / /| | | _| | || | / _` || '_ \ | __|| '__|/ _` | / _` | / _` || '__| / / / /_| | | | | || || (_| || | | || |_ | | | (_| || (_| || (_| || | ./ /___\___ | \_| |_||_| \__, ||_| |_| \__||_| \__,_| \__,_| \__,_||_| \_____/ |_/ __/ | |___/ error | Local time: 2022-12-28 12:28:41 +0900 error | GMT+0 time: 2022-12-28 03:28:41 +0900 error | Your machine should be set as GMT+0 time zone! warning | Time zone is not set to GMT+ [main][i]FR24 Feeder/Decoder [main][i]Version: 1.0.30-3/generic [main][i]Built on Sep 1 2022 09:40:07 (HEAD-00021a4.git/Linux/static_armel) [main][i]Running on: raspbian9 [main][i]Local IP(s): 192.168.1.201 [main][i]Copyright 2012-2022 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 |
ウィザード:アカウント情報入力
ウィザードのまず始めは、FlightRadar24へ登録しているメールアドレスから。
1 2 |
Step 1.1 - Enter your email address (username@domain.tld) $:EMAIL@EXAMPLE.COM |
そして今回はレシーバの新規登録なので、シェアキーは空欄のまま返します。
1 2 3 4 5 6 |
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. $: |
FlightRadar24以外のサービス(FlightAwareなど)へもデータ提供を併用する場合、MLATは有効にしないよう勧められているので、 no を返答します。
1 2 |
Step 1.3 - Would you like to participate in MLAT calculations? (yes/no) $:no |
ウィザード:位置情報の入力
次に最寄りの空港施設コードを聞かれますが、この後でレシーバ設置場所の緯度経度を入力するのでここは空欄で返答。
1 2 3 4 5 6 7 8 9 10 11 |
Step 2 - Enter nearest airport code (IATA or ICAO) We need to know your antenna's approximate position to filter bogus traffic as well as to enable ground position decoding. You can either enter nearest airport code or leave the field empty to provide exact antenna location. If your antenna is farther than 20 miles from the nearest airport we strongly recommend providing its true position instead as it may affect decoder's performance. If you will ever need to change the location, please run the sign-up wizard again. Enter airport code or leave empty $: |
そしてレシーバ設置場所の正確な緯度経度を入力するのですが、もし分からなければGoogle Mapsで知りたい場所で右クリックすれば、ポップアップメニューの一番上に緯度経度が表示され、さらにこれをクリックすればその緯度経度がクリップボード内に格納されるので便利です。
1 2 3 4 5 |
Step 3.A - Enter antenna's latitude (DD.DDDD) $:00.0000 Step 3.B - Enter antenna's longitude (DDD.DDDD) $:000.0000 |
緯度経度に続いて標高をフィートで入力します。Google Earthを開いて知りたい場所にポインタを合わせると、ウィンドウ右下にその地点の標高がメートル表記で得られるので、それをフィートへ換算して入力。
1 2 |
Step 3.C - Enter antenna's altitude above the sea level (in feet) $:260 |
送られた情報を精査後、その情報を元にシステムが最寄りの空港施設を選出します。
1 2 3 4 5 6 7 8 |
Using latitude: 00.0000, longitude: 000.0000, altitude: 260ft above sea level Validating email/location information...OK The closest airport found is ICAO:RJTA IATA:NJA near Kanagawa. Latitude: 35.454601 Longitude: 139.449997 Country: Japan |
メールアドレスの取扱いに関する確認の後、PiAwareで既に使用中のdump1090インスタンスを見つけると、接続設定を聞かれますが、取り敢えず autoconfig で自動設定してもらいます。
1 2 3 4 5 6 7 8 9 10 |
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 |
最後にログファイルの時刻表記を好みで設定すれば、FlightRadar24向けフィード提供サービスのインストールは終わりです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Step 6 - Please select desired logfile mode: 0 - Disabled 1 - 48 hour, 24h rotation 2 - 72 hour, 24h rotation Select logfile mode (0-2)$:1 Submitting form data...OK Congratulations! You are now registered and ready to share ADS-B data with Flightradar24. + Your sharing key (94acfd24a40f0231) has been configured and emailed to you for backup purposes. + Your radar id is T-RJTA488, 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! |
FlightRadar24サイトでレーダステータス確認
早速、FlightRadar24のレーダステータスページを確認すると、インストール終了直後はまだオフラインでしたが、
慌てずそのまましばらく待つと、疎通が確立されてオンラインになりました。
dump1090からデータを受け取れるようにする
しかしこのまま待ち続けても肝心の受信データが提供されないので、ログを確認してみるとdump1090インスタンスと正常に接続できていない様子。
1 2 3 4 5 6 7 8 9 10 11 12 |
$ tail -f /var/log/fr24feed/fr24feed.log ==> /var/log/fr24feed/fr24feed.log <== 2022-12-28 12:36:23 | [reader][i]Connecting to DVBT-TCP-BEAST-RAW receiver via (tcp://localhost:30005) 2022-12-28 12:36:23 | BeastBase::connectTcp(): Unable go connect, error: Cannot assign requested address[reader][e]Could not connect to tcp://localhost:30005 2022-12-28 12:36:27 | [feed][n]ping 8 2022-12-28 12:36:28 | [feed][n]syncing stream result: 1 2022-12-28 12:36:28 | [reader][i]Connecting to DVBT-TCP-BEAST-RAW receiver via (tcp://localhost:30005) 2022-12-28 12:36:28 | BeastBase::connectTcp(): Unable go connect, error: Cannot assign requested address[reader][e]Could not connect to tcp://localhost:30005 2022-12-28 12:36:33 | [reader][i]Connecting to DVBT-TCP-BEAST-RAW receiver via (tcp://localhost:30005) 2022-12-28 12:36:33 | BeastBase::connectTcp(): Unable go connect, error: Cannot assign requested address[reader][e]Could not connect to tcp://localhost:30005 2022-12-28 12:36:38 | [reader][i]Connecting to DVBT-TCP-BEAST-RAW receiver via (tcp://localhost:30005) 2022-12-28 12:36:38 | BeastBase::connectTcp(): Unable go connect, error: Cannot assign requested address[reader][e]Could not connect to tcp://localhost:30005 |
こちらのスレッドを参考に、設定ファイルを書き換えてみました(Great Tnx!!)。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
前) receiver="avr-tcp" fr24key="#################" host="127.0.0.1:30002" bs="no" raw="no" logmode="1" logpath="/var/log/fr24feed" mlat="no" mlat-without-gps="no" 後) receiver="beast-tcp" fr24key="#################" host="127.0.0.1:30005" bs="no" raw="no" logmode="1" logpath="/var/log/fr24feed" mlat="no" mlat-without-gps="no" |
サービスを再起動すると、今度はdump1090からデータを受け取り、FlightRadar24へ送信できていることがログからもわかります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
$ sudo systemctl restart fr24feed $ systemctl status fr24feed ● fr24feed.service - Flightradar24 Decoder & Feeder Loaded: loaded (/etc/systemd/system/fr24feed.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-12-28 12:40:27 JST; 5s ago Process: 17439 ExecStartPre=/usr/lib/fr24/create_missing_directories.sh (code=exited, status=0/SUCCESS) Process: 17432 ExecStartPre=/usr/lib/fr24/unregister_kernel_modules.sh (code=exited, status=0/SUCCESS) Process: 17426 ExecStartPre=/usr/lib/fr24/install_dump1090.sh (code=exited, status=0/SUCCESS) Main PID: 17445 (fr24feed) CGroup: /system.slice/fr24feed.service └─17445 /usr/bin/fr24feed Dec 28 12:40:26 piaware1 systemd[1]: Starting Flightradar24 Decoder & Feeder... Dec 28 12:40:27 piaware1 systemd[1]: Started Flightradar24 Decoder & Feeder. $ tail -f /var/log/fr24feed/fr24feed.log 2022-12-28 12:48:35 | [feed][i]sent 1,11 AC 2022-12-28 12:48:35 | 22-12-28 12:48:35.875 [D][:] sent 1 of 12 aircraft, 11 ignored, 0 outdated 2022-12-28 12:48:41 | [feed][i]sent 0,11 AC 2022-12-28 12:48:41 | 22-12-28 12:48:41.475 [D][:] sent 0 of 11 aircraft, 11 ignored, 0 outdated 2022-12-28 12:48:47 | [feed][i]sent 1,9 AC 2022-12-28 12:48:47 | 22-12-28 12:48:47.045 [D][:] sent 1 of 10 aircraft, 9 ignored, 0 outdated 2022-12-28 12:48:52 | [feed][i]sent 1,10 AC 2022-12-28 12:48:52 | 22-12-28 12:48:52.505 [D][:] sent 1 of 11 aircraft, 10 ignored, 0 outdated 2022-12-28 12:48:57 | [feed][i]sent 1,10 AC 2022-12-28 12:48:57 | 22-12-28 12:48:57.964 [D][:] sent 1 of 11 aircraft, 10 ignored, 0 outdated |
FlightRadar24のレーダステータスページにも提供されたデータの集計が表示されていました。
レーダサイト側に障害が発生してオフラインが続くと、メールでお知らせしてくれる機能がFlightAware、FlightRadar24どちらにもあるのですが、前者はオフラインが最低でも6時間続かないと知らせてくれないのに対し、FlightRadar24では最小値を1時間とすることができるので、より早い障害対応をとることが可能です。
そして、FlightRadar24へデータ提供すると、アカウントステータスが本来は有償のBusinessクラスへアップグレードされるのが、何よりも魅力でしょう。