使用RTL-SDR接收飞机信号

img

早就做了这个实验了,一直拖延着,终于忙里偷闲记录下来。

0x00 准备设备

  • RTL-SDR
  • Ubuntu 18.04

0x01 安装依赖的包

1
d4rk30@linux$ sudo apt-get install git cmake libusb-1.0-0-dev pkg-config

0x02 RTL-SDR安装驱动

1
2
3
4
5
6
7
8
d4rk30@linux$ git clone <https://github.com/osmocom/rtl-sdr.git>
d4rk30@linux$ cd rtl-sdr/
d4rk30@linux$ mkdir build
d4rk30@linux$ cd build/
d4rk30@linux$ cmake ../
d4rk30@linux$ make
d4rk30@linux$ sudo make install
d4rk30@linux$ sudo ldconfig

0x03 安装dump 1090

1
2
3
d4rk30@linux$ git clone <https://github.com/antirez/dump1090.git>
d4rk30@linux$ cd dump1090/
d4rk30@linux$ make

0x04 接收飞机信号

启动监听信号

1
d4rk30@linux$ sudo ./dump1090 --interactive --net

0x05 疑难问题

如果出现以下提示,是因为SDR设备被其他驱动占用了。

1
2
3
4
5
6
7
8
9
Found 1 device(s):
0: , , SN: (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

尝试输入命令:

1
d4rk30@linux$ rmmod dvb_usb_rtl28xxu rtl2832

如果不能解决,则把RTL默认驱动加入黑名单

1
2
3
d4rk30@linux$ cd /etc/modprobe.d/
d4rk30@linux$ touch black.conf
d4rk30@linux$ vim black.conf

加入:

1
2
3
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

然后重启设备。

0x06 参考链接

https://osmocom.org/projects/rtl-sdr/wiki/Rtl-sdr
https://www.freebuf.com/articles/wireless/77819.html