[ 基本設定 ]
Raspberry PiのOSは一般的なRaspbianを使用しています。これについては沢山の情報がありますので、ここでは省略します。
WiFiの設定については「Raspberry PiのWiFi化」を御覧ください。
[ チューナーの設定とADS-Bデコーダー ]
RTL2832UはUSBチップも兼ねています。これをサポートしたドライバーとADS-Bのデコードを行うアプリケーションを導入します。前者はrtl-sdrというパッケージでADS-Bデコーダーはdump1090というパッケージを使用しました。導入についてはまるまる以下のページに乗っているコマンドを打ち込めば完了します。
「ADS-B and the Raspberry Pi Revisited」
この説明はRaspberry Piを前提として書かれていますがノートPC上のUbuntuでも全く同じ手順で大丈夫でした。該当ページが無くなってしまうといけないので必要なコマンドだけ以下に書き出しておきます。
sudo apt-get update
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install build-essential
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
sudo cp /home/pi/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot
rtl_test -t でRT2832Uのハードウェアに関する情報が表示されれば成功です。
sudo apt-get install pkg-config
cd ~
git clone git://github.com/MalcolmRobb/dump1090.git
cd dump1090
make
./dump1090 を実行して何かしら文字が連続して表示されれば成功です。
./dump1090 –net > /dev/null
みたいにして外部からwebブラウザーで http://10.0.1.22:8080/ みたいに接続するとGoogle Map上に飛行機がプロットされた格好の良い画面が表示されます。
これでADS-Bを受信して個人的に楽しむ環境が完成しました。付属のアンテナをマンションの窓の内側に貼り付けただけですが、かなり多くの航空機からの電波を受信することが出来ています。一番遠くでは杭州よりも遠いところの航空機も見えていました。おおよそ180Kmくらいのところでした。ちゃんとしたアンテナを設置すれば、この倍くらいの距離がカバー出来るそうです。
Kazunori Gotoh liked this on Facebook.
Toki Ume liked this on Facebook.
Flightradar24データ提供計画 – 基本ソフトウェア編: [ 基本設定 ] Raspberry PiのOSは一般的なRaspbianを使用しています。これについては沢山の情報がありますので、ここでは省略します。… http://t.co/IUFhsWFx9T
Hiroki Sakon liked this on Facebook.
RT @nkozawa: Flightradar24データ提供計画 – 基本ソフトウェア編: http://t.co/6bLwgyimJ5
[…] – ハードウェア編 Flightradar24データ提供計画 – 基本ソフトウェア編 […]
ログです。宜しくお願い致します。
pi@raspberrypi ~ $ rtl_test -t
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6
Failed to open rtlsdr device #0.
pi@raspberrypi ~ $ cd ~
pi@raspberrypi ~ $ git clone git://github.com/MalcolmRobb/dump1090.git
Cloning into ‘dump1090’…
remote: Counting objects: 1401, done.
remote: Compressing objects: 100% (549/549), done.
remote: Total 1401 (delta 839), reused 1401 (delta 839)
Receiving objects: 100% (1401/1401), 4.13 MiB | 658 KiB/s, done.
Resolving deltas: 100% (839/839), done.
pi@raspberrypi ~ $ cd dump1090
pi@raspberrypi ~/dump1090 $ make
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c dump1090.c
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c anet.c
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c interactive.c
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c mode_ac.c
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c mode_s.c
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c net_io.c
gcc -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o `pkg-config –libs librtlsdr` -lpthread -lm
gcc -O2 -g -Wall -W `pkg-config –cflags librtlsdr` -c view1090.c
gcc -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o `pkg-config –libs librtlsdr` -lpthread -lm
pi@raspberrypi ~/dump1090 $ ./dump1090 –interactive
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6
Error opening the RTLSDR device: Device or resource busy
pi@raspberrypi ~/dump1090 $ sudo apt-get install pkg-config
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています
状態情報を読み取っています… 完了
pkg-config はすでに最新バージョンです。
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 38 個。
pi@raspberrypi ~/dump1090 $ make
make: Nothing to be done for ‘all’.
pi@raspberrypi ~/dump1090 $ ./dump1090 –interactive
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6
Error opening the RTLSDR device: Device or resource busy
pi@raspberrypi ~/dump1090 $
pinatuさま、こんにちは
どうも最初のrtl_test -tの結果がよろしく無いように思います。私の場合は以下のように表示されます。
$ rtl_test -t
Found 1 device(s):
0: Generic RTL2832U OEM
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
No E4000 tuner found, aborting.
メッセージの”Kernel driver is active, or device is claimed by second instance of librtlsdr.”でググってみますと以下のwebサイトが見つかりました。
http://sntk.hatenablog.com/entry/2014/02/21/211101
おそらく似たような問題が起こっているように思いますので参考まで。