UBUNTU NOTE6

Ubuntu18.04

1.安装UDH

  • 安装UDH和相关依赖库:需要等待一段时间 参考链接
sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils cmake build-essential
  • 在家目录下的code目录下执行:
git clone git://github.com/EttusResearch/uhd.git
cd ~/code/udh/host
sudo mkdir build
sudo cmake ../
sudo make -j4
测试一下:
sudo make test
sudo ldconfig
export LD_LIBRARY_PATH=/usr/local/lib

2.安装GNURadio 3.7

  • 安装所需ubuntu18.04依赖库:默认安装GNURadio 3.7版本 参考链接
sudo apt install cmake git g++ libboost-all-dev python-dev python-mako \
python-numpy python-wxgtk3.0 python-sphinx python-cheetah swig libzmq3-dev \
libfftw3-dev libgsl-dev libcppunit-dev doxygen libcomedi-dev libqt4-opengl-dev \
python-qt4 libqwt-dev libsdl1.2-dev libusb-1.0-0-dev python-gtk2 python-lxml \
pkg-config python-sip-dev
  • 安装pip命令:
sudo apt-get install python3-pip
  • 安装GNURadio以及相关配置:需要等待一段时间
    在家目录下的code目录下执行:
git clone --recursive https://github.com/gnuradio/gnuradio.git
cd gnuradio
sudo mkdir build
cd build
sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/gnuradio ../
sudo make -j4
测试一下:
sudo make test
sudo make install

  • 在.barshrc添加环境变量:
sudo vim ~/.barshrc
# GNU Radio installation
export PATH=$PATH:/opt/gnuradio/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gnuradio/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/gnuradio/lib/pkgconfig
export PYTHONPATH=$PYTHONPATH:/opt/gnuradio/lib/python2.7/dist-packages
  • 测试一:运行声卡文件是否执行正常,电脑发出声音即为安装成功:
cd /usr/local/share/gnuradio/examples/audio
./dail_tone.py
  • 测试二:运行软件自带的例程/usr/local/share/gnuradio/examples/digital/ofdm下的tx_ofdm.grc文件
sudo gnuradio-companion
  • 演示结果:

3.安装 gr-osmosdr和gqrx-sdr 参考链接

apt list | grep hackrf

把搜索出来的结果,使用 apt-get remove 全部删除

sudo apt-get install gr-osmosdr
sudo apt-get install gqrx-sdr

问题:运行gqrx:
inux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown
Controlport disabled
No user supplied config file. Using “default.conf”
gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
FM demod gain: 3.05577
Resampling audio 96000 -> 48000
IQ DCR alpha: 1.04166e-05
terminate called after throwing an instance of ‘std::exception’
what(): std::exception
已放弃 (核心已转储)

解决:因为权限不够,执行sudo gqrx即可,包括执行gr-osmosdr命令也需sudo

运行sudo gqrx


运行 sudo osmocom_fft -a hackrf -v
UBUNTU NOTE6_第1张图片

==========================================

安装编译hackrf

  • 在家目录下的code目录下执行:
git clone --progress http://github.com/mossmann/hackrf.git
cd hackrf/host
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

USB连接HackrfOne 设备至ubuntu18.04执行:

hackrf_info 

显示结果如下即为配置成功:

hackrf_info version: git-e9c6c2d
libhackrf version: git-e9c6c2d (0.5)
Found HackRF
Index: 0
Serial number: 000000000000000026a468dc21934ca7
Board ID Number: 2 (HackRF One)
Firmware Version: 2018.01.1 (API:1.02)
Part ID Number: 0xa000cb3c 0x0057436b

你可能感兴趣的:(UBUNTU)