0. 准备
i3台式机 + ubuntu20 + ADALM PlutoSdr
1. 安装依赖
sudo apt update
根据SoapyPlutoSDR仓库,还依赖libiio、libad9361、SoapySDR。
1.1 libiio
参考:https://wiki.analog.com/resources/tools-software/linux-software/libiio
1.1.1 apt安装
sudo apt-get install libiio-utils
1.1.2 源码编译安装并测试
sudo apt-get install libxml2 libxml2-dev bison flex libcdk5-dev cmake
sudo apt-get install libaio-dev libusb-1.0-0-dev libserialport-dev libxml2-dev libavahi-client-dev doxygen graphviz
git clone https://github.com/pcercuei/libini.git
cd libini
mkdir build && cd build && cmake ../ && make && sudo make install
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
mkdir build && cd build && cmake ../ && make && sudo make install
PATH=/usr/lib/:$PATH
iio_info -s
1.2 libad9361
cd ~/Download
git clone https://github.com/analogdevicesinc/libad9361-iio
cd libad9361-iio
cmake ./CMakeLists.txt
make
sudo make install
1.3 SoapySDR
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
git checkout tags/soapy-sdr-0.7.2
mkdir build && cd build
cmake ..
make -j4
sudo make install
sudo ldconfig
2. Soapy SDR module for Pluto SDR
git clone https://github.com/pothosware/SoapyPlutoSDR
cd SoapyPlutoSDR
mkdir build
cd build
cmake ..
如果环境都搭建完成,会有这样的信息:
-- Build type not specified: defaulting to release.
-- Found LibIIO: /usr/lib/x86_64-linux-gnu/libiio.so (found suitable version "0.23", minimum required is "0.9")
-- LibIIO_INCLUDE_DIRS: /usr/include
-- LibIIO_LIBRARIES: /usr/lib/x86_64-linux-gnu/libiio.so
-- LibIIO_DEFINITIONS:
-- Performing Test HAS_STD_CXX11
-- Performing Test HAS_STD_CXX11 - Success
-- Found LibAD9361: /usr/local/lib/libad9361.so (found version "0.2")
-- LibAD9361_INCLUDE_DIRS: /usr/local/include
-- LibAD9361_LIBRARIES: /usr/local/lib/libad9361.so
-- LibAD9361_DEFINITIONS:
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Module PlutoSDRSupport configured with version: 0.2.1-a243128
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxjiani3/Downloads/SoapyPlutoSDR/build
$ make
Scanning dependencies of target PlutoSDRSupport
[ 20%] Building CXX object CMakeFiles/PlutoSDRSupport.dir/PlutoSDR_Registration.cpp.o
[ 40%] Building CXX object CMakeFiles/PlutoSDRSupport.dir/PlutoSDR_Settings.cpp.o
[ 60%] Building CXX object CMakeFiles/PlutoSDRSupport.dir/PlutoSDR_Streaming.cpp.o
[ 80%] Building CXX object CMakeFiles/PlutoSDRSupport.dir/Version.cpp.o
[100%] Linking CXX shared module libPlutoSDRSupport.so
[100%] Built target PlutoSDRSupport
$ sudo make install
[100%] Built target PlutoSDRSupport
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/SoapySDR/modules0.7/libPlutoSDRSupport.so
-- Set runtime path of "/usr/local/lib/SoapySDR/modules0.7/libPlutoSDRSupport.so" to ""
$
3. 验证
?参考:https://github.com/pothosware/SoapyPlutoSDR/wiki ?
$ SoapySDRUtil --probe="driver=plutosdr,hostname=192.168.2.1"
######################################################
## ? ? Soapy SDR -- the SDR abstraction library ? ? ##
######################################################
Probe device driver=plutosdr,hostname=192.168.2.1
[INFO] Opening PlutoSDR #0 192.168.2.1...
----------------------------------------------------
-- Device identification
----------------------------------------------------
? driver=PlutoSDR
? hardware=ADALM-PLUTO
? ad9361-phy,model=ad9363a
? ad9361-phy,xo_correction=39999821
? backend_version=0.21 (git tag: v0.21 ?)
? fw_version=v0.32
? hw_model=Analog Devices PlutoSDR Rev.C (Z7010-AD9363A)
? hw_model_variant=0
? hw_serial=1044730a19970002f8ff2c009c397b282f
? ip,ip-addr=192.168.2.1
? library_version=0.23 (git tag: dda3a8b)
? local,kernel=4.19.0-119999-g6edc6cd
? uri=ip:192.168.2.1
----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
? Channels: 1 Rx, 1 Tx
? Timestamps: NO
? Sensors: xadc_temp0, xadc_voltage0, xadc_voltage1, xadc_voltage2, xadc_voltage3, xadc_voltage4, xadc_voltage5, xadc_voltage6, xadc_voltage7, xadc_voltage8, adm1177_current0, adm1177_voltage0, ad9361-phy_temp0, ad9361-phy_voltage2
----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
? Full-duplex: YES
? Supports AGC: YES
? Stream formats: CS8, CS12, CS16, CF32
? Native format: CS16 [full-scale=2048]
? Antennas: A_BALANCED
? Full gain range: [0, 73] dB
? ? PGA gain range: [0, 73] dB
? Full freq range: [70, 6000] MHz
? ? RF freq range: [70, 6000] MHz
? Sample rates: [0.0651042, 61.44] MSps
? Filter bandwidths: 0.2, 1, 2, 3, 4, 6, 7, 8, 9, 10 MHz
----------------------------------------------------
-- TX Channel 0
----------------------------------------------------
? Full-duplex: YES
? Supports AGC: NO
? Stream formats: CS8, CS12, CS16, CF32
? Native format: CS16 [full-scale=32768]
? Antennas: A
? Full gain range: [0, 89] dB
? ? PGA gain range: [0, 89] dB
? Full freq range: [70, 6000] MHz
? ? RF freq range: [70, 6000] MHz
? Sample rates: [0.0651042, 61.44] MSps
? Filter bandwidths: 0.2, 1, 2, 3, 4, 6, 7, 8, 9, 10 MHz
|