先上成品
你需要
- 一台树莓派
- 一张3.5 inch的显示屏
- 一块SDR接收器
- 你聪明的大脑
需要 3.5 inch 屏幕镜像的可以找我,直接刷官网镜像开机后分辨率会怪怪的(大概)
正式开始
刷好后记得联网开启ssh(建议 systemctl enable ssh
),这样方便我们操作
然后记得更新下软件源,这里建议代理官方源,当然使用国内的树莓派源也是可以的
这里放一个官方源,防走丢
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
首先安装依赖
sudo apt-get update sudo apt-get install git cmake build-essential python3-pip libusb-1.0-0-dev libsdl2-2.0-0 libatlas-base-dev librtlsdr0
然后安装一些 Python 模块
sudo pip3 install numpy pygame -i https://pypi.tuna.tsinghua.edu.cn/simple some-package sudo pip install pyrtlsdr -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
到仓库 https://github.com/adafruit/FreqShow,把它 clone 下来到树莓派里
cd ~ git clone https://github.com/adafruit/FreqShow.git cd FreqShow
注意安装 rtlsdr 的驱动,否则会报一些奇奇怪怪的错误
apt-get install libusb-1.0-0-dev git cmake git clone https://github.com/rtlsdrblog/rtl-sdr-kerberos.git cd rtl-sdr-kerberos mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON make make install ldconfig
这里作者有个 tip
If using the official 7″ Raspberry Pi Touchscreen instead of a PiTFT, edit the filefreqshow.pyand comment out the following lines as shown (starting around line 73). Do NOT do this if using a PiTFT!
#os.putenv('SDL_VIDEODRIVER', 'fbcon') #os.putenv('SDL_FBDEV' , '/dev/fb1') #os.putenv('SDL_MOUSEDRV' , 'TSLIB') #os.putenv('SDL_MOUSEDEV' , '/dev/input/touchscreen')
大致意思就是,如果你不是使用PiTFT作为你的显示器的话,得把 freqshow.py 里边上面这几行代码给删掉
一切准备就绪后,直接运行 python freqshow.py
即可
演示视频
参考
- (Freq Show: Raspberry Pi RTL-SDR
Scanner) [https://cdn-learn.adafruit.com/downloads/pdf/freq-show-raspberry-pi-rtl-sdr-scanner.pdf] - (Rtl-sdr – rtl-sdr – Open Source Mobile Communications) [https://osmocom.org/projects/rtl-sdr/wiki/Rtl-sdr]