0%

RTL-SDR的一些玩法

软件定义电台

rtl-sdr

安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
~$ sudo apt-get install rtl-sdr

~$ rtl_eeprom
Found 1 device(s):
0: Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner

Current configuration:
__________________________________________
Vendor ID: 0x0bda
Product ID: 0x2838
Manufacturer: Realtek
Product: RTL2838UHIDIR
Serial number: 00000001
Serial number enabled: yes
IR endpoint enabled: yes
Remote wakeup enabled: no

收音机功能

1
2
3
4
5
6
7
8
9
10
11
12
13
14
~$ rtl_fm -f 87.0e6 -M wbfm -s 200000 -r 48000 - | aplay -r 48 -f S16_LE
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 87216000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 6.83ms
Sampling at 1200000 S/s.
Output at 200000 Hz.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

gr-air-modes 使用

编译

  • 这里请参照该项目的README.md指导安装.
1
2
3
4
~$ git clone https://github.com/bistromath/gr-air-modes
~$ cd gr-air-modes && mkdir build
~$ cd build
~$ cmake ../

收集飞行数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
~$ modes_rx -s osmocom -t 1234 -r 2.4e6 --kml air-tracker.kml
linux; GNU C++ version 6.3.0 20170221; Boost_106200; UHD_003.009.005-0-unknown

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.10
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy soapy redpitaya
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
Found Rafael Micro R820T tuner
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
[R82XX] PLL not locked!
Gain is 33
Rate is 2400000
(-26 0.06682075) Type 17 BDS0,9-1 (track report) from 780d1c with velocity 458kt heading 268 VS -64
(-40 0.07617875) No handler for message type 24 from 19f157
(-38 0.15085075) Type 0 (short A-A surveillance) from adae05 at 4375ft (speed <75kt)
[...]

读取飞行数据

gpsprune

  • Debian 系统可以通过系统直接安装.
1
2
3
~$ sudo apt-get install gpsprune -y
[...]
~$ gpsprune
  • 通过File-->Open File,打开对话框,找到并选择air-tracker.kml文件,就会看到如下图所示的界面,一些蓝色的线条与点,把上面的小地球点亮就会加载地图进来.

![gpsprune]](/imgs/rtl-sdr/gpsprune.png)

Google Earth

  • 从谷歌网站去下载地图软件,这里是需要科学上网才能下载与使用的.
1
~$ sudo dpkg -i google-earth-pro-stable_current_amd64.deb
  • 打开软件Add-->Network Link如下图所示,打开对话框,找到并选择air-tracker.kml文件.

add-link

  • 可以根据需要,设置Refresh,如:自动刷新…

google-map.png

GnuRadio

源码安装

安装Volk

1
2
3
4
5
6
~$ env PYTHON_CONFIGURE_OPTS="--enable-shared --enable-static" pyenv install --verbose 3.10.7
~$ pip install mako
~$ git clone --recursive https://github.com/gnuradio/volk.git
~$ cd volk && mkdir build && cd build
~$ cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/home/michael/.pyenv/versions/3.10.7/bin/python3 -DCMAKE_INSTALL_PREFIX=$HOME/.local ../
~$ make -j10 && make install

支持UHD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
~$ git clone https://github.com/EttusResearch/uhd.git
~$ cd uhd/host && mkdir build && cd build

~$ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=OFF -DENABLE_TESTS=OFF -DENABLE_DOXYGEN=OFF -DCMAKE_INSTALL_PREFIX=$HOME/.local ../
[...]
-- ######################################################
-- # UHD enabled components
-- ######################################################
-- * LibUHD
-- * LibUHD - C API
-- * LibUHD - Python API
-- * Examples
-- * Utils
-- * Tests
-- * USB
-- * B100
-- * B200
-- * USRP1
-- * USRP2
-- * X300
-- * MPMD
-- * SIM
-- * N300
-- * N320
-- * E320
-- * E300
-- * X400
-- * OctoClock
-- * Manual
-- * API/Doxygen
-- * Man Pages
--
-- ######################################################
-- # UHD disabled components
-- ######################################################
-- * DPDK
--
-- ******************************************************
-- * You are building the UHD development master branch.
-- * For production code, we recommend our stable,
-- * releases or using the release branch (maint).
-- ******************************************************
-- Building version: 4.3.0.0-6-g5aa6bc44
-- Using install prefix: /home/michael/.local
-- Configuring done
-- Generating done

  • SoapySDR
1
2
3
4
~$ git clone https://github.com/pothosware/SoapySDR
~$ cd SoapySDR && mkdir build && cd build
~$ cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/home/michael/.pyenv/versions/3.10.7/bin/python -DCMAKE_INSTALL_PREFIX=$HOME/.local ../
~$ make -j 10 && make install
  • boost_1.69
1
2
3
4
~$ wget -c https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2
~$ tar xvf boost_1_80_0.tar.bz2 && cd boost_1_80_0
~$ ./bootstrap.sh --prefix=${HOME}/.local
~$ ./b2 && b2 install