hackrf前期安装日志

0. 前期准备

可以使用虚拟机或者双系统安装,本教程只适合ubuntu 14下的安装,对于ubuntu 16及以上的版本,可能出现未知的错误。理论上64位与32位系统应该不存在区别,一下是在虚拟机上64位ubuntu 14.04配置下的安装,利用的源来自United States

 

1.安装host

1.1.安装依赖

$ sudo apt-get update

$ sudo apt-get install build-essential cmake libusb-1.0-0-dev pkg-config

1.2.下载host

$ sudo apt install git

$ git clone--progress http://github.com/mossmann/hackrf.git

1.3. 安装host

$ sudo cdhackrf/host

$ mkdirbuild

$ cd build

$ sudoapt-get install libfftw3-dev

$ cmake ../-DINSTALL_UDEV_RULES=ON

$ sudo make

$ sudo makeinstall

$ sudo ldconfig

1.4.验证host是否安装成功

$ cd

$ hackrf_info

结果如下:

$hackrf_info

FoundHackRF board.

Board ID Number:XXXXXX

FirmwareVersion: XXXXXX

Part IDNumber: XXXXXX

SerialNumber: 0xXXXXXX

 

2.安装Gnuradio

2.1.安装依赖

$ sudoapt-get -y install git-core cmake g++ python-dev swig pkg-config libfftw3-devlibboost1.55-all-dev libcppunit-dev libgsl0-dev libusb-dev libsdl1.2-devpython-wxgtk2.8 python-numpy python-cheetah python-lxml doxygen libxi-devpython-sip libqt4-opengl-dev libqwt-dev libfontconfig1-dev libxrender-dev python-sippython-sip-dev

可能出现的问题(例如):

libboost1.55-all-dev: Depends: libboost1.55-dev butit is not going to be installed

解决方案,缺什么补装什么:

sudo apt-get install libboost1.55-dev

完成现象:

Reading package lists... Done

Building dependency tree      

Reading state information... Done

cmake is already the newest version.

doxygen is already the newest version.

g++ is already the newest version.

libcppunit-dev is already the newest version.

libfftw3-dev is already the newest version.

libgsl0-dev is already the newest version.

libusb-dev is already the newest version.

pkg-config is already the newest version.

python-cheetah is already the newest version.

python-dev is already the newest version.

python-sip is already the newest version.

python-sip-dev is already the newest version.

swig is already the newest version.

libboost1.55-all-dev is already the newest version.

libqwt-dev is already the newest version.

python-wxgtk2.8 is already the newest version.

git-core is already the newest version.

libfontconfig1-dev is already the newest version.

libqt4-opengl-dev is already the newest version.

libsdl1.2-dev is already the newest version.

libxi-dev is already the newest version.

libxrender-devi s already the newest version.

python-lxml is already the newest version.

python-numpy is already the newest version.

0 upgraded,0 newly installed, 0 to remove and 289 not upgraded.

 

2.2.修改PythonPATH

$ export PYTHONPATH=/usr/local/lib/python2.7/dist-packages

2.3.下载GNURadio 源码

$ git config --global http.sslVerify false

$ git clone --recursive http://git.gnuradio.org/git/gnuradio.git

2.4.编译安装

注意两个问题,一个是LaTeX的安装,如果不安装之后的安装会报错,是否对后面安装有影响未知,以下命令用于安装LaTeX

$ sudo apt-get install texlive

另一个问题是系统时间问题,安装过程可能会出现在带future的错误,那是因为安装文件的日期超前于系统时间,解决方法是将系统时间手动调成未来的时间,比如一年后。

之后开始安装gnuradio

$ cd gnuradio

$ mkdir build

$ cd build

$ cmake ../

$ make

$ sudo make install

$ sudo ldconfig

安装过程比较慢,需要注意安装过程中的进程代码不应该出现error之类的报错。

安装成功的现象,输入下列命令,打开软件:

$ cd

$ gnuradio-companion

点击 file—open,打开/usr/local/share/gnuradio/examples/digital/ofdm文件夹下(只要你按

照本教程来做,那么这些文件路径应该就与作者一致)的tx_ofdm.grc 文件,依次点击运行按钮(绿色三角形),结果如下:

 

3.安装gr-osmosdr

如果前面都正常安装,该步骤不会报任何错误

$ git clonegit://git.osmocom.org/gr-osmosdr

$ cd gr-osmosdr

$ mkdir build

$ cd build

$ cmake ../

$ make

$ sudo makeinstall

$ sudo ldconfig

 

4. 安装Gqrx

4.1 下载

$ sudo apt-get purge --auto-remove gqrx                             #该步骤不一定成功,不过似乎不影响之后的安装

$ sudo apt-get purge --auto-remove gqrx-sdr

$ sudo add-apt-repository -y ppa:bladerf/bladerf

$ sudo add-apt-repository -y ppa:ettusresearch/uhd

$ sudo add-apt-repository -y ppa:myriadrf/drivers

$ sudo add-apt-repository -y ppa:myriadrf/gnuradio

$ sudo add-apt-repository -y ppa:gqrx/gqrx-sdr

$ sudo apt-get update

$ sudo apt-get install gqrx-sdr                   #最关键一步,如果安装报错,问题可能需要从安装Gnuradio的2.1步骤开始找起

4.2运行gqrx

$ cd

$ gqrx

如果成果打开,界面如下

hackrf前期安装日志_第1张图片

4.3设置连接

输入,记录下图中加高亮的6的字符:

$ hackrf_info

 

打开gqrx,点击运行键旁的芯片图案,设置参数如下图:

完成所有过程后,就可以将板子当作收音机来使用了!

你可能感兴趣的:(hackrf)