「RaspberryPiとDVB-TでADS-B」の版間の差分
(→方向性) |
(→方向性) |
||
79行目: | 79行目: | ||
===方向性=== | ===方向性=== | ||
− | どのdump1090を使用するか? | + | どのdump1090を使用するか?<br /> |
歴史順に並べると、 | 歴史順に並べると、 | ||
1. [https://github.com/antirez/dump1090 dump1090-antirez] | 1. [https://github.com/antirez/dump1090 dump1090-antirez] | ||
− | 2. [https://github.com/MalcolmRobb/dump1090 dump1090-MalcolmRobb] | + | 2. [https://github.com/MalcolmRobb/dump1090 dump1090-MalcolmRobb] |
− | 3. [https://github.com/mutability/dump1090 dump1090-mutability] | + | 3. [https://github.com/mutability/dump1090 dump1090-mutability] |
− | 4. [https://github.com/adsbxchange/dump1090-fa dump1090-fa] | + | 4. [https://github.com/adsbxchange/dump1090-fa dump1090-fa] |
=='''FlightAware'''== | =='''FlightAware'''== |
2019年2月7日 (木) 02:55時点における版
書き直し中
環境
ボード | Raspberry Pi 3 Model B |
OS | Raspbian Stretch with desktop 2018-11-13 |
ストレージ | SanDisk Ultra microSDHC Class10 16GB |
DVB-T | TV28Tv2DVB-T(R820T) |
アンテナ | ダイヤモンド D555 120MHz/1090MHz帯受信専用 |
その他 | MCX-P/SMA-J変換ケーブル ダイヤモンド 2D1SR M-SMA変換ケーブル ダイヤモンド BK10 モービルアンテナ取付金具 |
準備
OS
「Raspbian インストール」などで検索
省略
IP固定
「Raspberry Pi Strech IP固定」などで検索
$ sudo nano /etc/dhcpcd.conf
末尾に追記
interface eth0
static ip_address=192.168.1.183/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
保存: Ctrl + o > リターン
終了: Ctrl + x
再起動
$ sudo reboot
hosts
Menu > 設定 > RaspberryPiの設定 > システムタブ > ホスト名 fr24 OK > 再起動
遠隔操作
運用にモニター、マウス、キーボードは必要ないので遠隔操作にする
標準で入っているRealVNCを使用
VNC有効
Menu > 設定 > RaspberryPiの設定 > インターフェイスタブ > VNC有効 > OK
解像度の変更
Menu > 設定 > RaspberryPiの設定 > システムタブ > 解像度 > 1280x720程度 > OK > 再起動
シャットダウンし、モニター、マウス、キーボードを取り外して電源入れ直し
WindowsPCなどのVNCクライアントから接続を試す
成功していれば、以降はVNCクライアントの窓の中で作業
方向性
どのdump1090を使用するか?
歴史順に並べると、
1. dump1090-antirez 2. dump1090-MalcolmRobb 3. dump1090-mutability 4. dump1090-fa
FlightAware
Enterprise Account($ 89.95/月)を無料でくれるそうです。
参考: PiAware - dump1090 ADS-B integration with FlightAware ✈ FlightAware
インストール
$ wget http://ja.flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.6.3_all.deb
$ sudo dpkg -i piaware-repository_3.6.3_all.deb
$ sudo apt-get update
$ sudo apt-get install piaware
$ sudo piaware-config allow-auto-updates yes
$ sudo piaware-config allow-manual-updates yes
$ sudo apt-get install dump1090-fa
$ sudo reboot
ここから先、既に登録済みで作業を進めたので新規で登録の挙動が分かりません
統計の確認
https://flightaware.com/adsb/stats/user/<username>
MLATが近所の数台のレシーバーと同期し測量しますので観測地の高度と緯度経度の設定はしておいたほうがいいと思います。
動作確認
RaspberryPiの場合 http://127.0.0.1:8080 他のPCの場合 http://192.168.1.183:8080
コンフィグを書き換える場合
$ sudo leafpad /usr/share/dump1090-fa/html/config.js
Flightradar24
Business Plan($ 499.99/年)を無料でくれるそうです。
事前に用意
- メールアドレス 例: abc@gmail.com
- sharingkey(新規の場合は必要なし)
- アンテナの緯度 例: 35.xxxx
- アンテナの経度 例: 139.xxxx
- アンテナの海抜 例: 海抜+設置高さ=xx (単位feet)
インストール
$ sudo apt-get install dirmngr
$ sudo wget -O /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules"
$ sudo bash -c "$(wget -O - http://repo.feed.flightradar24.com/install_fr24_rpi.sh)"
赤字が入力
[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) $:メールアドレス 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. $:既得のsharingkey(新規の場合は空エンター) Verifying sharing key...OK 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) $:35.xxxx Step 3.B - Enter antenna's longitude (DDD.DDDD) $:139.xxxx Step 3.C - Enter antenna's altitude above the sea level (in feet) $:xx.x Using latitude: 35.xxxx, longitude: 139.xxxx, altitude: xxft above sea level 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): $:空エンター Submitting form data...OK Congratulations! You are now registered and ready to share ADS-D data with Flightradar24. + 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 Settings saved, please run "sudo service fr24feed restart" to use new configuration. Installation and configuration completed!
サービス再起動
$ sudo service fr24feed restart
再起動
$ sudo reboot
動作確認
RaspberryPiの場合 http://127.0.0.1:8754 他のPCの場合 http://192.168.1.183:8754
設定を間違えてるようなので変更
Settingsボタンを押し、
Receiver: ModeS Beast(TCP) Host/IP: 127.0.0.1:30005
右下のSaveボタンを押し、Restartボタンを押す
Flightradar24 Premiumに登録
https://www.flightradar24.com/premium/
ここから先、既に登録済みで作業を進めたので新規で登録の挙動が分かりません
Radarbox24
Business Plan($ 39.95/月)を無料でくれるそうです。
参考: Radarbox24 Raspberry Pi Client
インストール CATEGORY A
$ sudo bash -c "$(wget -O - http://apt.rb24.com/inst_rbfeeder.sh)"
Installation finished
再起動
$ sudo reboot
ユーザー登録
https://www.radarbox24.com/raspberry-pi/claim
sharing keyの登録
Google翻訳 私たちのシステムは共有鍵を使って動作します。 このキーはステーションを識別し、サーバーに送信されるパケットに存在します。 ラズベリーpiで初めてソフトウェアを実行すると、共有キーが自動的に作成され、設定ファイルに保存されます。 以前のインストールの共有鍵を既に持っている場合は、構成ファイルを変更してキーで保存することができます。 あなたの共有履歴を失うことはありません。 各インストールには一意の共有キーが必要です。 あなたの現在のキーを表示するには、あなたのラズベリーパイコンソールを入力してください:
$ sudo rbfeeder --showkey --no-start
PlaneFinder
最新版のバージョン確認
https://planefinder.net/sharing/client
Linux ARMHF (Raspberry Pi, BeagleBone, Radarcape etc.)のDebian Package(.deb)のURL
インストール バージョンは適宜変更
$ wget http://client.planefinder.net/pfclient_x.x.xx_armhf.deb
$ sudo dpkg -i pfclient_x.x.xx_armhf.deb
ブラウザで設定
RaspberryPiの場合 http://127.0.0.1:30053 他のPCの場合 http://192.168.1.183:30053
- メールアドレス 例: abc@gmail.com
- アンテナの緯度 例: 35.xxxx
- アンテナの経度 例: 139.xxxx
Create a new sharecode (メールにsharecodeが届きます。)
- Receiver data format: Beast
- IP address: 127.0.0.1
- Port: 30005
Complete configuration
動作確認
RaspberryPiの場合 http://127.0.0.1:30053 他のPCの場合 http://192.168.1.183:30053
ADS-B Exchange
参考: ADS-B Exchange
設定方法
http://www.adsbexchange.com/how-to-feed-from-vrs/
VRS Web Admin
PaspberryPiの場合 http://127.0.0.1:8081/VirtualRadar/WebAdmin/Index.html 他のPCの場合 http://192.168.1.183:8081/VirtualRadar/WebAdmin/Index.html
Options→Rebroadcast Servers
こんな感じで入力して右上×ボタン押して、画面下のSaveボタン
再起動
$ sudo reboot
動作確認
VRS Web AdminのRebroadcast serversでカウントされてれば成功してると思います。
PaspberryPiの場合 VRS Web Admin http://127.0.0.1:8081/VirtualRadar/WebAdmin/Index.html 他のPCの場合 VRS Web Admin http://192.168.1.183:8081/VirtualRadar/WebAdmin/Index.html
確認
http://www.adsbexchange.com/ のGlobal Radar View(直リンクできないようです)
Nginx
http://192.168.1.183:8080/data/aircraft.json を参照したい場合、CORSに該当し困ることがあります。
特定ポートをlighttpdにバイパスしつつCORS対策するだけの機能を作ってみます。
ポート50000 → dump1090-faのポート8080
ポート50001 → PlaneFinderのポート30053
インストール
$ sudo service lighttpd stop $ sudo apt-get install nginx $ sudo /etc/init.d/nginx start
デフォルトのシンボリックリンク削除
$ sudo unlink /etc/nginx/sites-enabled/default
設定作成 ※ /etc/nginx/nginx.confでincludeになっているのでhttp{…}ディレクティブは必要無し
$ sudo leafpad /etc/nginx/sites-available/proxy
server { listen 50000; server_name localhost; location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "POST, GET, OPTIONS"; add_header Access-Control-Allow-Headers "Origin, Authorization, Accept"; add_header Access-Control-Allow-Credentials true; proxy_pass http://127.0.0.1:8080/; } } server { listen 50001; server_name localhost; location / { #add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "POST, GET, OPTIONS"; add_header Access-Control-Allow-Headers "Origin, Authorization, Accept"; add_header Access-Control-Allow-Credentials true; proxy_pass http://127.0.0.1:30053/; } }
シンボリックリンク
$ sudo ln -s /etc/nginx/sites-available/proxy /etc/nginx/sites-enabled/
再起動
$ sudo reboot
確認
http://192.168.1.183:50000/data/aircraft.json http://192.168.1.183:50001/ajax/aircraft.json
MyRadar24
3Dビューワー作りました。
dump1090-faのサブディレクトリで起動するよう設定してみます。
MyRadar24 動作サンプル
install
ダウンロード version0.6
$ wget http://dz.plala.jp/wiki_data/myradar24v0.6.zip
$ unzip myradar24v0.6.zip
登録
$ sudo mkdir /usr/share/dump1090-fa/html/3d
$ sudo cp -R myradar24v0.6/. /usr/share/dump1090-fa/html/3d/
設定
$ sudo leafpad /usr/share/dump1090-fa/html/3d/js/script.js
書き換え
(事前にBingMapsのbasic keyを取得してください。既にFlightAware dump1090で使用してる場合、同じものが使用できます。)
// Controls page title, righthand pane when nothing is selected
PageName = "MyRadar24";
// Provide a Bing Maps API key here to enable the Bing imagery layer.
// You can obtain a free key (with usage limits) at
// https://www.bingmapsportal.com/ (you need a "basic key")
var BingMapsAPIKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
var myLat = 35.xxxx;
var myLon = 139.xxxx;
var standardTime = 'JST'; //Standard Time spell
var offsetTime = '+9'; // UTC offset Decimal https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
var removeTime = 10; //Time to delete from lost (s)
動作確認
http://192.168.1.183:8080/3d/ (FlightAware dump1090のローカルIPアドレスに/3d/を加えたもの)
ローカルエリア内の他のPCは動作しました。 RaspberryPiのChromiumはCORSエラーが出ました。CORS対策してもWebGLエラーが出ました。 結果、RaspberryPiのブラウザで操作することはできない気がします。
カメラのデフォルト位置の調整
MyRadar24を起動してる状態でSpaceキーを押すと画面に数値が表示されます。 (もう一度押すと消えます。) マウス操作して理想の場所まで移動。
カメラのデフォルト位置の設定
$ sudo leafpad /usr/share/dump1090-fa/html/3d/js/script.js
書き換え
// Default camera position (play and space key press)
var camLon = 139.8256;
var camLat = 35.6959;
var camDist = 138434;
var camPan = -0.027;
var camTilt = 1.055;
uninstall
$ rm myradar24v0.6.zip
$ rm -r myradar24v0.6
$ sudo rm -r /usr/share/dump1090-fa/html/3d
airport data
設定済データの確認
$ sudo leafpad /usr/share/dump1090-fa/html/3d/json/airports.json
データのダウンロード
http://ourairports.com/data/
airports.csvをダウンロード。
MicrosoftExcelやLibreOfficeなどで開き内容確認。
あまりに量が多いため全てを登録するとMyRadar24は動かなくなります。
2行目から最終行までを選択しiso_countryの列でデータの並び替え。
不必要な国の行を全て削除。
それでもデータ量が多いようであればtype列でデータの並び替えをし、heliportの行など削除。
データをCSVで保存。
オンラインサービスでCSVからJSONに変換
http://www.csvjson.com/csv2json
出来たJSONデータを新規テキストに貼り付け。
行の頭に以下追加
{ "airport": [
最終行に以下追加
] }
保存しairports.jsonにリネーム。
/usr/share/dump1090-fa/html/3d/json/airports.jsonを上書き保存。
延命化
swap
無効化
Stretchの場合
$ sudo dphys-swapfile swapoff $ sudo systemctl stop dphys-swapfile $ sudo systemctl disable dphys-swapfile
tmpfs
有効化
$ sudo nano /etc/fstab
末尾に追記
tmpfs /tmp tmpfs defaults,size=32m,noatime,mode=1777 0 0 tmpfs /run/user/1000 tmpfs defaults,size=32m,noatime,mode=1777 0 0 #tmpfs /run/dump1090-fa tmpfs defaults,size=32m,noatime,mode=1777 0 0 #tmpfs /run/piaware tmpfs defaults,size=32m,noatime,mode=1777 0 0 #tmpfs /home/pi/.local/share/VirtualRadar tmpfs defaults,size=32m,noatime,mode=1777 0 0 #tmpfs /home/pi/.cache/lxsession/LXDE-pi tmpfs defaults,size=16m,noatime,mode=1777 0 0
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo reboot
確認
$ df -F tmpfs
rsyslog
停止
$ sudo nano /etc/rsyslog.conf
使わないモノをコメントアウト
############### #### RULES #### ############### # # First some standard log files. Log by facility. # #auth,authpriv.* /var/log/auth.log #*.*;auth,authpriv.none -/var/log/syslog #cron.* /var/log/cron.log #daemon.* -/var/log/daemon.log #kern.* -/var/log/kern.log #lpr.* -/var/log/lpr.log #mail.* -/var/log/mail.log #user.* -/var/log/user.log # # Logging for the mail system. Split it up so that # it is easy to write scripts to parse these files. # #mail.info -/var/log/mail.info #mail.warn -/var/log/mail.warn #mail.err /var/log/mail.err # # Some "catch-all" log files. # #*.=debug;\ # auth,authpriv.none;\ # news.none;mail.none -/var/log/debug #*.=info;*.=notice;*.=warn;\ # auth,authpriv.none;\ # cron,daemon.none;\ # mail,news.none -/var/log/messages # # Emergencies are sent to everybody logged in. # #*.emerg :omusrmsg:*
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo reboot
folder2ram
RAMディスク化
インストール
$ sudo wget -O /sbin/folder2ram https://raw.githubusercontent.com/bobafetthotmail/folder2ram/master/debian_package/sbin/folder2ram $ sudo chmod +x /sbin/folder2ram $ sudo folder2ram -configure will now open the configuration file with your favourite text editor write its name and press enter (nano, vim, gedit are the most common) リターン
$ sudo nano /etc/folder2ram/folder2ram.conf
末尾に追記
tmpfs /var/log tmpfs /var/tmp tmpfs /var/spool tmpfs /var/cache/samba
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo folder2ram -mountall $ sudo folder2ram -enablesystemd
再起動
$ sudo reboot
確認
$ df -F tmpfs
他の頻繁に書き込みされるlogを探す場合
$ cd / $ sudo find . -path "./proc" -prune -o -path "./sys" -prune -o -type f -name "*.*" -mmin -5 -ls
journald
$ sudo nano /etc/systemd/journald.conf
追記
Storage=volatile
保存: Ctrl + o > リターン
終了: Ctrl + x
再起動
$ sudo reboot
jbd2
jbd2/mmcblk0p2が1分毎に60KB程度書き込みを行ってるように見える。
停止する方法が見当たらない。
5分毎の書き込みに変更することは可能な様子。
$ sudo nano /etc/fstab
変更 PARTUUIDは環境による
#PARTUUID=5cfaeb3f-02 / ext4 defaults,noatime 0 1 PARTUUID=5cfaeb3f-02 / ext4 defaults,noatime,commit=299 0 1
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo reboot
確認
$ sudo apt-get install iotop $ cd /var/tmp $ sudo iotop -obtaqqq > output.txt しばらくしたら停止 Ctrl+C $ sudo nano output.txt
終了: Ctrl + x
更新履歴
- 2018.01.04 公開