ads-b on raspberry pi

12
吉吉吉吉吉 YLI Yoshimoto Light Industry Raspberry Pi ででででででで でででででで ADS-B ででで でででででででででででで Linux ででで - で 05 で 2014/09/26(Fri) TENON 2014/9/26 1

Upload: yoshimoto-yukiyoshi

Post on 02-Dec-2014

428 views

Category:

Devices & Hardware


6 download

DESCRIPTION

ADS-B受信体験記

TRANSCRIPT

Page 1: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry

Raspberry Pi で航空機からの位置情報信号 ADS-B 受信を

実際にやってみる!かごしま Linux勉強会 -第 05回

2014/09/26(Fri)TENON

2014/9/26 1

Page 2: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry自己紹介

2014/9/26 2

吉本工業

ET ロボコン準優勝 (^ ^)v

Yukiyoshi yoshimoto

geckosjp

• 石川県小松市出身• 1966 年 8 月生まれ( A 型、乙女座)• 高校卒業後上京⇒福岡⇒鹿児島• 組み込みエンジニア(自称)• 1995 年 Slackware と出会う。

2013

まず、これにハマった!

かみさん、

さつまおごじょ ※ イメージ

Page 3: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry目標!

2014/9/26 3

• NeoCat さんが blog に書かれている「 Raspberry Pi で航空機からの位置情報信号ADS-B を受信」を実際に試してみる!(Ref. http://d.hatena.ne.jp/NeoCat/20140402/1396406442)

• 自宅で稼働させてみて何か活用できないか考察する。

• Flightradar24.com へデータをフィードすることは今回見送る。

そんなこと、何の意味があるの?

大変参考になった!

Page 4: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry

2014/9/26 4

出展: rtb aviation pictures

なんか、いいじゃん!

Page 5: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry必要機材

• R820T というチップを使った USB ドングルが必要らしい。

• Raspberry PI 確認していないけど、 Linux が走るマシンなら何でも Ok?

2014/9/26 5

R820T 搭載ドングルアンテナ Raspberry PI

Aitendo で購入!

Page 6: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustryソフトの準備

2014/9/26 6

sudo apt-get updatesudo apt-get install gitsudo apt-get install cmakesudo apt-get install libusb-1.0-0.devsudo apt-get install build-essentialsudo apt-get install pkg-config

★ 参考にした blog の内容を基にソフトの準備を行う。

■ 関連パッケージのインストール

git clone git://git.osmocom.org/rtl-sdr.git

■ rtl-sdr のソースの取得

cd rtl-sdrmkdir buildcd buildcmake ..makesudo make installsudo ldconfig

■ rtl-sdr のソースの取得

Page 7: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustryテスト

2014/9/26 7

デバイスを認識して、うまく行っているようだ!!

sudo rtl_test

■ rtl-sdr のテスト

pi@raspberrypi ~/rtl-sdr/build $ sudo rtl_testFound 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEMFound Rafael Micro R820T tunerSupported 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.6Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report ifsamples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...lost at least 164 bytes

■ 実行結果

rtl2830 や rtl2832 、 dvb_usb_rtl28xxu といった

ドライバがロードされている場合、 rmmod す

る必要があるようです。

Page 8: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustryFM ラジオを試してみる!

2014/9/26 8

sudo src/rtl_fm -M fm -f 106.7M -s 170k -A fast -r 44100 -l 0 -E deemp | sudo aplay -t raw -r 44100 -c 1 -f S16_L

■ rtl-sdr のテスト

pi@raspberrypi ~/rtl-sdr/build $ sudo src/rtl_fm -M fm -f 78.9M -s 170k -A fast -r 44100 -l 0 -E deemp | sudo aplay -t raw -r 44100 -c 1Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEMFound Rafael Micro R820T tunerTuner gain set to automatic.Tuned to 79155000 Hz.Oversampling input by: 6x.Oversampling output by: 1x.Buffer size: 8.03msExact sample rate is: 1020000.026345 HzSampling at 1020000 S/s.Output at 170000 Hz.Playing raw data 'stdin' : Unsigned 8 bit, Rate 44100 Hz, Monounderrun!!! (at least 6.612 ms long)underrun!!! (at least 8.504 ms long)underrun!!! (at least 9.857 ms long)

■ 結果

何故か「 underrun!!! 」が発生して、まともに音が出ない!

Why!

「 underrun!!! rtl_fm 」で検索すると色々と出てくるが、英文なのでよーわからん! ┐ (  ̄ヘ ̄)┌

Page 9: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustryいよいよ ADS-B 受信!

2014/9/26 9

git clone git://github.com/MalcolmRobb/dump1090.gitcd dump1090make

■ 参考にしたページに沿って「 dump1090 」をインストール。

./dump1090 --interactive --net

■ そして実行!

Hex Mode Sqwk Flight Alt Spd Hdg Lat Long Sig Msgs Ti/-------------------------------------------------------------------------------861B6C S 35000 6 10 10840DD8 S VNL102 37000 510 058 31.451 131.069 6 117 18990D0 S EVA191 39975 436 237 31.534 130.698 11 601 18990C9 S EVA131 36000 422 233 31.564 130.380 7 339 11

あっさり動いちゃった!!(ぱちぱち)

Page 10: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustryブラウザでアクセスしてみる!

2014/9/26 10

http://localhost:8080

■ アクセス!

Page 11: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry動作風景

2014/9/26 11

Page 12: ADS-B on raspberry pi

吉本軽工業

YLIYoshimotoLightIndustry今後の課題

• アンテナを屋外に設置

• Flightradar24.com にデータをフィード

• FM ラジオの再生( 「 underrun!!! 」 の解決)

• いつまでモチベーションが続くか・・・これが最も懸念される課題 ┐ (  ̄ヘ ̄)┌

2014/9/26 12