PlutoSDR是ADI的一个全双工SDR,近期尝试调试了GNURadio的环境,踩了很多的坑。有了GNURadio的环境就可以用PlutoSDR做很多事情了,然而在中文互联网上关于PlutoSDR的GNURadio环境部署资料甚少,外网也基本没有。根据目前的代码版本(2022年1月)总结下这个开发环境的部署和调试方法。
我踩过的坑:
GNURadio直接apt install,根据ADI官网的方案编译gr-iio插件。结果:gr-iio编译通不过,gr相关依赖项比较复杂比较难以调试。
GNURadio直接本地编译,从源代码clone。失败,没有高水平和开发经验的人比较难以调试这部分
使用GNURadio的已经安装的镜像部署虚拟机,镜像存在网络连接问题,剩余问题同1.
经过进一步的尝试发现,自己编译GNURadio的难度很高,预编译版本又会导致gr-iio的PLUTO插件编译出现问题。所以后来发现GNURadio的3.10版本已经集成了gr-iio模块,使用预编译版本可以避免在本地编译gr-iio模块,所以实际上ADI官网提供的方法已经落后了,并不是最适合最快捷的方式。目前最简单的方式是使用GNURadio的PPA安装然后切换到3.10的版本,在各自安装ADI的驱动库。在此对整个过程进行整理。
系统版本:Ubuntu 20.04 LTS
首先PPA安装GNURadio,以下的安装教程来自GNURadio的官网WIKI:
For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs. Be sure to uninstall any previously installed versions of gnuradio first.
To access the current released version (3.10), add the gnuradio/gnuradio-releases ppa (removing other gnuradio ppas if already configured)
$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases
To access the 3.9 released version, add the gnuradio/gnuradio-releases-3.9 ppa (removing other gnuradio ppas if already configured)
$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9
To access the 3.8 released version, add the gnuradio/gnuradio-releases-3.8 ppa (removing other gnuradio ppas if already configured)
$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8
To access the 3.7 released version (legacy), add the gnuradio/gnuradio-releases-3.7 ppa (removing other gnuradio ppas if already configured)
$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.7
Then, update the apt sources, and install gnuradio
$ sudo apt-get update
$ sudo apt install gnuradio
Attention: Do NOT try to install further packages like `gr-osmosdr` via Ubuntu's package management (i.e. using "apt"). Ubuntu will try to install a potentially incompatible version and your system will be in an undefined state.
Note on 3.10 packaging dependency For some distributions you may need to install the python module 'packaging' using pip (which may also need to be installed).
$ sudo apt install python3-pip $ pip install packaging
然后在系统内安装ADI提供的相关iio驱动库,需要git然后在本地编译,来自PLUTO的官方教程:
Libiio requires the following packages:
libxml2
libxml2-dev
bison
flex
cmake
git
libaio-dev
Install with apt:
(sudo) apt install libxml2 libxml2-dev bison flex cmake git libaio-dev libboost-all-dev
If you want the documentation for the C API you will require doxygen:
(sudo) apt install doxygen
If you want the USB backend add libusb support:
(sudo) apt install libusb-1.0-0-dev
If you want zeroconf add avahi support:
(sudo) apt install libavahi-common-dev libavahi-client-dev
Build and install libiio from source:
git clone cd libiio cmake . make sudo make install cd ..
Build and install libiio from source:
git clone cd libad9361-iio cmake . make sudo make install cd ..
部署完成目前的两个驱动后,就可以连入SDR设备在系统中查看这个设备的状态了:
iio_info -s
正常连入后再我的系统内就可以看见这样的指示:框出来的就是目前设备的号码
把设备号填入这个位置就可以连接上了。用简单的QT Time就可以看见基带的时域信号了,至此PlutoSDR就可以正常工作了。
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |