使用rtl-usb接收无线电

准备:

1. 硬件:RTL-SDR R820T2 TUNER,某宝上30左右一个

2. CentOS


1. 下载RTL-SDR软件

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

2. 编译&安装

$cd cmake
$cmake ..
$make install

增加/etc/modprobe.d/no-rtl.conf

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

3. 接收FM广播

$rtl_fm -f 955e5 -M wbfm -s 480k -r 48000 - | aplay -r 48k -f S16_LE


4. 复位USB接口

#include 
#include 
#include 
#include 
#include 
void main(int argc, char **argv)
{
        const char *filename;
        int fd;
        filename = argv[1];
        fd = open(filename, O_WRONLY);
        ioctl(fd, USBDEVFS_RESET, 0);
        close(fd);
        return;
}

[root@dev sdr]# gcc -o reset reset.c 
reset.c: In function ‘main’:
reset.c:13:2: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
  close(fd);
  ^
[root@dev sdr]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0e0f:000b VMware, Inc. 
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc. 
Bus 001 Device 003: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
[root@dev sdr]# ./reset /dev/bus/usb/001/003 
[root@dev sdr]# 

5. 接收飞机飞行数据

git clone https://github.com/antirez/dump1090.git
export PKG_CONFIG_PATH=/root/sources/sdr/rtl-sdr/rtl-sdr/cmake/
make
./dump1090 --interactive

参考:

http://www.rtlsdr.org

http://sdr.osmocom.org/trac/wiki/rtl-sdr

http://www.evil0x.com/posts/6401.html

http://www.cnblogs.com/k1two2/p/5758136.html

你可能感兴趣的:(无线)