ubuntu HackRF One相关环境搭建
本文内容、开发板及配件仅限用于学校或科研院所开展科研实验!
淘宝店铺名称:开源SDR实验室
HackRF链接:https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-13257850194.8.69503d888aIzVL&id=526187854860
一、安装依赖:
$ sudo apt‐get install git build‐essential cmake libusb‐1.0‐0‐dev liblog4cpp5‐dev libboost‐dev libboost‐system‐dev libboost‐thread‐dev libboost‐program‐options‐dev swig
二、创建存放hackrf源码的文件夹,下载hackrf源码
$ mkdir ~/SDR
进入创建的SDR文件夹,
$ cd ~/SDR
下载hackrf源码,
$ git clone https://github.com/mossmann/hackrf.git
三、编译安装hackrf电脑中的软件环境
进入hackrf/host文件夹
$ cd ~/SDR/hackrf/host
创建build文件夹并进入该文件件
$ mkdir build && cd build
cmake编译
$ cmake ../ ‐DINSTALL_UDEV_RULES=ON
make编译和install安装
$ make
$ sudo make install
$ sudo ldconfig
四、测试hackrf电脑软件环境安装是否成功
连接hackrf设备USB至电脑USB接口,命令行输入hackrf_info命令后,会看到如下类似信息:
$ hackrf_info
Found HackRF board.
Board ID Number: 2 (HackRF One)
Firmware Version: ...
Part ID Number: ...
Serial Number: ...
至此,说明hackrf电脑软件环境安装成功。
五、sudo-apt安装GNU Radio
$ sudo apt‐get install gnuradio gnuradio‐dev gr‐iqbal
六、源码下载安装GrOsmoSDR
$ cd ~/SDR
$ git clone git://git.osmocom.org/gr‐osmosdr
$ cd gr‐osmosdr
创建build文件夹并进入该文件夹
$ mkdir build && cd build
$ cmake ../
$ make
$ sudo make install
$ sudo ldconfig
七、源码下载安装Gqrx
$ cd ~/SDR
$ git clone https://github.com/csete/gqrx.git
$ cd gqrx
$ mkdir build && cd build
$ qmake ../ (或者qmake ../gqrx.pro)
$ make
$ sudo make install
$ sudo ldconfig
备注:
如果所有软件都用apt-get方式来安装的话,则一步一步的按照以下方法来操作:
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gnuradio
sudo apt-get install gr-osmosdr
sudo apt-get install hackrf
sudo apt-get install gqrx-sdr
sudo apt-get install libhackrf-dev
To remove the hackrf following command is used:
sudo apt-get remove hackrf
Following command is used to remove the hackrf package along with its dependencies:
sudo apt-get remove --auto-remove hackrf