うっかりコンソールのログを消してしまい、
いろいろあるものをつないでそれっぽく備忘録にしてるので、
細部は異なる可能性がある。
目的は、FlightAware の PiAware と、FlightRadar 24 の fr24 を、
どうにか同居できないか、と調べてみたら、英語圏での情報は割りかし充実。
結論から言うと、
1.PiAware をインストール。
2.fr24 をインストール。
上記のみで実現できた。順番が非常に大事で、fr24 で動く dump1090 は、
PiAware では動作しない。逆に PiAware で動いてる dump1090 は、
fr24 でも動く。ただし、この場合には fr24 デフォルトではなく、
dump1090 が LISTEN してるローカルのポートを、fr24 が見に行く感じ。
●PiAware のインストール方法
事前に FlightAware でアカウントを作成しておく。
インストール自体は、
これ以上の情報は必要ない。ポイントは、
・PiAware のイメージは、Raspberry Pi Writer では焼けなかった。
=> 面倒でも Etcher を使いましょう。
・リモートから SSH で接続して fr24 をインストールしたい
=> Windows で焼いた時に見える boot の中に ssh という空ファイルを設置。
・ネットワーク関係の設定
有線LANを使いたかったので、
boot 内の piaware-config.txt というファイルを編集。
wired-type dhcp
これを
wired-type static
に変更。
wired-address 192.168.1.10
wired-netmask 255.255.255.0
wired-broadcast 192.168.1.255
wired-gateway 192.168.1.254
wired-nameservers 8.8.8.8 8.8.4.4
上記を追加。
wireless-network yes
これを
wireless-network no
に変更。
無線 LAN 使いたいなら、raspi-config で無線 LAN を有効にしてから、
wireless-network yes にして、
wireless-ssid MyWifiNetwork
wireless-password s3cr3t99
このあたりを適宜設定すればうまくいくかもしれない。(やってないのでわからない)
インストール後は、なんか気持ち悪いくらいすべてが自動でアカウントと結びついて、
勝手に解析データを送り始める。
変更した方がいいところは、MLAT を有効にする場合には、緯度経度、アンテナ高を、
別途入力する必要がある。
●fr24 のインストール
PiAware 動作確認後に、SSH でログインして、
$ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
| || |() | | | | | | / __ \ / |
| | | | _ __ _ | |_ | |_ _ __ __ _ | | __ _ _ ' / /' / /| | | _| | || | / _
|| ' \ | || '|/ _ | / _
| / _` || '| / / / /| |
| | | || || (| || | | || |_ | | | (| || (| || (| || | ./ /__ |
_| |||| _, ||| || _||| _,| _,| _,||| ___/ |/
/ |
|/
[main][i]FR24 Feeder/Decoder
[main][i]Version: 1.0.27-2/generic
[main][i]Built on Mar 25 2021 14:17:10 (HEAD-76766f9.git/Linux/static_armel)
[main][i]Running on: raspbian10
[main][i]Local IP(s): xxx.xx.xx.xx,fe80::d8e4:a6db:9bed:49f1
[main][i]Copyright 2012-2021 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)
$:xxxxxxxxx@xxxxxxxx
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.
$:xxxxxxxxxxxxxxxxxx
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!
Step 3.A - Enter antenna's latitude (DD.DDDD)
$:xx.xxxxxx
Step 3.B - Enter antenna's longitude (DDD.DDDD)
$:xx.xxxxxx
Step 3.C - Enter antenna's altitude above the sea level (in feet)
$:xxx
Using latitude: xx.xxxx, longitude: xx.xxxx, altitude: xxxft above sea level
Validating email/location information...OK
The closest airport found is ICAO:EGAC IATA:BHD near Belfast.
Latitude: xx.xxxxxx
Longitude: xx.xxxxxx
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 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 (xxxxxxxxxxxxxxxx) has been configured and emailed to you for backup purposes.
- Your radar id is T-xxxxxxx, 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!
pi@piaware:~ $
自分の場合には、自動的に AVR(TCP) が選択されて、
ほんとに何もする事なく、PiAware との並行運用ができてしまった。
ポイントらしいポイントといえば、
PiAware と同様に、緯度経度、メールアドレス、シェアリングキー、
これを事前にメモっておく事くらいで。
●Raspberry pi 4 は必要か
今回は、Raspberry pi 3 model B+ にインストールした。
負荷の推移を見ていると、RPi2 MB+ でも問題なく動作するように思える。
※2022/07/08追記
現時点で RPi2 MB+ で半年以上順調に稼働中。酷暑でも CPU 温度が50度近いが、
PiAware 含め全部が問題なく動いております。
ただ、PiAware は自身が Web サーバとなって、
fr24 よりもかなり高度なインターフェイスがあるので、
「動くけどかったるい」感じになるのではないかと想像する。
かといって、RPi4 が必要かと言われたら、
別にそこまでの性能はいらない気がする。もちろん、大は小を兼ねる、
的な見地から、金銭的、電源的制約がなければ、最初から RPi4 でも、
全然ありだと思う。
● RTL-2832U ドングルはどうすべきか
Amazon で3千円くらいで売ってるプラスチック筐体の、
テレビ用の RTL-2832U でも、動作は問題ないと思われるが、
熱的な面で信頼性がかなりあやしい。
実際に使ってる人の話を聞いても、「壊れたら替える」という、
消耗品的な発想で使っている人が多いように思う。
もちろん運用上それが許される環境であればいいけど、
自分は金額も1千円も変わらんので、RTL-SDR.COM を購入した。
アルミ筐体で、内部基盤にはサーマルシートが張ってあって、
一応熱対策に気を使っている形跡は見えるけど、ケースに密着してないし、
一番熱くなるチップセットには何も対策がなかったりする。
自分は、RTLチップに、RPI 用の小さなヒートシンクをつけてみた。
かなり外のアルミ筐体は熱くなるので、全体のヒートシンク代わりに、
使ってない HDD を密着させて使っている。HDD がかなり熱くなるので、
一応放熱に一役買っている事は間違いなさそう。
●追記(2023/01/19)
再起動時に、fr24 の MLAT のステータスが No や Fail になる事が度々あり、
いろいろ試してみたのだけど、いずれもあまりうまく行かず。
原因は piaware より fr24 の方が先に起動してしまい、
piaware 側の dump が LITEN 始める前に、fr24が起動してしまう、
という事が原因と思われる。
https://intaa.net/archives/21762
こちらの、ユニットファイルを編集する方法が確実で、
最もスマート。