第一次接触USRP B210,搭建开发环境就废了好大的劲,来来回回折腾好了几遍,多亏软件部的同事帮忙,总算把环境搭建好了。这里简单的记录一下,虽然出现的错误忘记怎么解决了,但是大概的流程还是简单记录下。
https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux 不得不说官网的资料很给力!
一 、UHD和GNURADIO驱动安装
驱动的安装全是看官网资料一步一步进行的,出现错误的时候都是在网上搜到哦的解决方法。
1)On Ubuntu systems, run:
sudo apt-get update
2)Once the system has been updated, then install the required dependencies for UHD and GNU Radio.
sudo apt-get -y install git swig cmake doxygen build-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-dev libudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doc libcppunit-1.13-0v5 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtils python-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutils qt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4 python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libqwt6abi1 libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-dev libncurses5-dbg libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk3.0 git-core libqt4-dev python-numpy ccache python-opengl libgsl-dev python-cheetah python-mako python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq-dev libzmq1 python-requests python-sphinx libcomedi-dev python-zmq
After installing the dependencies, you should reboot the system.
If the installation of the dependencies completes without any errors, then you can proceed to build and install UHD and GNU Radio.
cd $HOME mkdir workarea-uhd cd workarea-uhd Next, clone the repository and change into the cloned directory.
git clone https://github.com/EttusResearch/uhd cd uhd Next, checkout the desired UHD version. You can get a full listing of tagged releases by running the command:
git tag -l
Example truncated output of git tag -l
:
$ git tag -l ... release_003_009_004 release_003_009_005 release_003_010_000_000
Note: As of UHD Version 3.10.0.0, the versioning scheme has changed to be a quadruplet format. Each element and version will follow the format of: Major.API.ABI.Patch. Additional details on this versioning change can be found here.
After identifying the version and corresponding release tag you need, check it out:
# Example: For UHD 3.9.5: git checkout release_003_009_005
# Example: For UHD 3.10.1.0: git checkout release_003_010_001_000
cd host mkdir build cd build Next, invoke CMake to create the Makefiles.
cmake ../
make Next, you can optionally run some basic tests to verify that the build process completed properly.
sudo make install注意:有的测试会出现failed,这个时候忽略就行了。
sudo make install Finally, make sure that theLD_LIBRARY_PATH
environment variable is defined and includes the folder under which UHD was installed. Most commonly, you can add the line below to the end of your$HOME/.bashrc
file:
export LD_LIBRARY_PATH=/usr/local/lib If theLD_LIBRARY_PATH
environment variable is already defined with other folders in your$HOME/.bashrc
file, then add the line below to the end of your$HOME/.bashrc
file to preserve the current settings.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
完成之后可以在linux终端输入:uhd_fnd_devices,
没有连接板子的时候会出现
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc
No UHD Devices Found
连接上板子出现:cd $HOME mkdir workarea-gnuradio cd workarea-gnuradio Next, clone the repository.
git clone --recursive https://github.com/gnuradio/gnuradio Next, go into the repository and check out the desired GNU Radio version.
cd gnuradio git checkout v3.7.10.1 Next, create a build folder within the repository.
mkdir build cd build Next, invoke CMake to create the Makefiles.
cmake ../ Next, run Make to build GNU Radio.
make Next, you can optionally run some basic tests to verify that the build process completed properly.
make test Next, install GNU Radio, using the default install prefix, which will install GNU Radio under the /usr/local/lib folder. You need to run this as root due to the permissions on that folder.
sudo make install
sudo ldconfig
gnuradio-config-info --version gnuradio-config-info --prefix gnuradio-config-info --enabled-components
python $HOME/workarea-gnuradio/gnuradio/gr-audio/examples/python/dial_tone.py You can try launching the GNU Radio Companion (GRC) tool, a visual tool for building and running GNU Radio flowgraphs.
gnuradio-companion If "gnuradio-companion" does not start and complains about thePYTHONPATH
environment variable, then you may have to set this in your$HOME/.bashrc
file, as shown below.
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages