本文内容、开发板及配件仅限用于学校或科研院所开展科研实验!
温馨提示:“开源SDR实验室”是北京的。
本系列文档介绍4G/5G开源项目srsRAN(srsLTE升级版)的基本使用方法。本文给出该开源项目的基本介绍、安装方法即NB-IoT基本测试。
目录
一、srsRAN基本介绍
srsRAN是srsLTE的升级版,之前的srsLTE目前已经更名为srsRAN。
图1 srsLTE github
图2 srsRAN github
图3 srsRAN架构
srsRAN是一个4G/5G开源软件无线电套件。srsRAN支持UE和eNodeB/gNodeB应用,可与第三方核心网络解决方案一起使用,构建完整的端到端移动无线网络。srsRAN包括:
srsUE:全栈SDR 4G/5G-NSA UE应用(5G-SA即将推出),srsUE的具体内容参见https://docs.srslte.com/en/latest/usermanuals/source/srsue/source/1_ue_intro.html
srsENB:全栈SDR 4G eNodeB应用(5G-NSA和5G-SA即将推出),srsENB的具体内容参见https://docs.srslte.com/en/latest/usermanuals/source/srsenb/source/1_enb_intro.html
srsEPC:一个包含MME、HSS和S/P-GW的轻量级4G核心网络,srsEPC的具体内容参见https://docs.srslte.com/en/latest/usermanuals/source/srsepc/source/1_epc_intro.html
关于MME、HSS、S/P-GW的概念可以参考https://www.cspsprotocol.com/lte-epc/
https://blog.csdn.net/Rong_Toa/article/details/94983607
二、SoapySDR源码安装
本文后续实验用的硬件为LimeSDR-USB(即LimeSDR标准版)或LimeSDR Mini(即LimeSDR 迷你版),因此,我们需要安装SoapySDR,本文选择源码安装。
1、安装依赖包
sudo apt-get install cmake g++ libpython-dev python-numpy swig git libsqlite3-dev libi2c-dev libusb-1.0-0-dev libwxgtk3.0-dev freeglut3-dev
2、源码安装SoapySDR
例如,你要把SoapySDR下载到你的Download文件夹,则先进入到~/Download文件夹,然后依次执行以下命令。
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
mkdir build && cd build
cmake ..
make -j4
sudo make install
sudo ldconfig
三、LimeSuite源码安装
例如,回到Download文件夹,依次执行以下命令,
$ git clone https://github.com/myriadrf/LimeSuite.git
$ cd LimeSuite
mkdir builddir
cd builddir
cmake ../
make -j4
sudo make install
sudo ldconfig
如果你想允许非root用户访问基于usb的设备,如LimeSDR。则需要进入到LimeSuite/udev-rules文件夹,执行
sudo ./install.sh
四、srsGUI和srsRAN源码安装
如果你想用srsGUI(一个配合srsRAN可以实时显示的界面程序),那么你需要先安装srsGUI,然后再安装srsRAN。
1、srsGUI源码安装
(1)安装依赖包
sudo apt-get install libboost-system-dev libboost-test-dev libboost-thread-dev libqwt-qt5-dev qtbase5-dev
(2)srsGUI源码安装
git clone https://github.com/srsLTE/srsGUI.git
cd srsgui
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
2、srsRAN源码安装
(1)安装依赖包
sudo apt-get install build-essential cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev
(2)srsRAN源码安装
git clone https://github.com/srsRAN/srsRAN.git
cd srsRAN
mkdir build
cd build
cmake ../
make
make test
sudo make install
sudo srsran_install_configs.sh user
五、NB-IoT测试实验
所有的例子都可以在“./srsRAN/build/lib/examples”中找到。接下来我们以NB-IOT为例来测试源码安装是否成功。
https://docs.srslte.com/en/latest/app_notes/source/nbiot/source/index.html#nbiot-appnote
图4 NB-IoT基本系统架构
NB-IOT的基本实验硬件如图所示,途中的Machine1为一个电脑,该电脑接一个射频前端(例如LimeSDR),用cell_search_nbiot来搜索基站,用npdsch_ue来解码NB-IOT基站的下行数据。
http://blog.csdn.net/zoomdy/article/details/72764847,国内的NB-IoT主要运行在B5和B8频段。
由于国内用的是B5和B8频段,这里我们选用B8,因此,在以下命令中-b后边是8。
cell_search_nbiot -b 8
由于我没有设置允许非root用户使用usb设备,因此这里我需要输入sudo。
搜索到小区后的截图为,
搜索结束后,找到了几个小区。选定其中的959.8MHz这个,进行下行链路解码。输入命令:
sudo ./npdsch_ue -f 959.8e6
输入上述命令后,会自动弹出来类似于如下的界面。
终端输入的命令以及输出信息如下:
opensourcesdr@opensourcesdr:~/Downloads/srsRAN/build/lib/examples$ sudo ./npdsch_ue -f 959.8e6
Opening RF device...
Soapy has found device #0: addr=24607:1027, driver=lime, label=LimeSDR Mini [USB 3.0] 1D49762FC19C49, media=USB 3.0, module=FT601, name=LimeSDR Mini, serial=1D49762FC19C49,
Selecting Soapy device: 0
Detected LimeSDR. Consider using LTE rates for better RF performance.
Either compile with '-DUSE_LTE_RATES=True' or start srsENB/srsUE with '--expert.lte_sample_rates=true'
[INFO] Make connection: 'LimeSDR Mini [USB 3.0] 1D49762FC19C49'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
Setting up Rx stream with 1 channel(s)
Setting up Tx stream with 1 channel(s)
[INFO] RX LPF configured
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 5 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
Available device sensors:
- clock_locked
- lms7_temp
Available sensors for Rx channel 0:
- lo_locked
State of gain elements for Rx channel 0 (AGC not supported):
- TIA: 9.00 dB
- LNA: 30.00 dB
- PGA: -7.00 dB
State of gain elements for Tx channel 0 (AGC not supported):
- PAD: 0.00 dB
- IAMP: 0.00 dB
Rx antenna set to LNAH
Tx antenna set to BAND1
Set RX gain: 70.0 dB
[INFO] Selected RX path: LNAW
Set RX freq: 959.799995 MHz
Setting sampling rate 1.92 MHz
Actual sampling rate 1.92 MHz
[ERROR] Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)
[INFO] Rx calibration finished
NSSS with peak=64.880409, cell-id: 358, partial SFN: 0
*Found n_id_ncell: 358 DetectRatio= 0% PSR=1.06, Power=89.8 dBm
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Finding PSS... Peak: 9.2, FrameCnt: 0, State: 100
Finding PSS... Peak: 10.1, FrameCnt: 0, State: 100
Finding PSS... Peak: 4.2, FrameCnt: 0, State: 100
MIB received (CFO: +0.33 kHz) FrameCnt: 0, State: 100
MIB received (CFO: +0.32 kHz) FrameCnt: 0, State: 100
Finding PSS... Peak: 8.6, FrameCnt: 0, State: 1 0
Finding PSS... Peak: 5.1, FrameCnt: 0, State: 100
Finding PSS... Peak: 8.5, FrameCnt: 0, State: 1 0
MIB received (CFO: +0.64 kHz) FrameCnt: 0, State: 10
Finding PSS... Peak: 9.9, FrameCnt: 0, State: 100
MIB received (CFO: +0.22 kHz) FrameCnt: 0, State: 1 0
Finding PSS... Peak: 3.6, FrameCnt: 0, State: 100
MIB received (CFO: +0.23 kHz) FrameCnt: 0, State: 10
Finding PSS... Peak: 8.0, FrameCnt: 0, State: 100
Finding PSS... Peak: 6.0, FrameCnt: 0, State: 10
MIB received (CFO: +0.35 kHz) FrameCnt: 0, State: 10
Finding PSS... Peak: 2.8, FrameCnt: 0, State: 10
Finding PSS... Peak: 6.9, FrameCnt: 0, State: 10
MIB received (CFO: +0.42 kHz) FrameCnt: 0, State: 10
Finding PSS... Peak: 5.0, FrameCnt: 0, State: 10
Finding PSS... Peak: 8.1, FrameCnt: 0, State: 100
Finding PSS... Peak: 6.7, FrameCnt: 0, State: 100
Finding PSS... Peak: 7.2, FrameCnt: 0, State: 100
Finding PSS... Peak: 9.4, FrameCnt: 0, State: 100
Finding PSS... Peak: 7.2, FrameCnt: 0, State: 1 0
Finding PSS... Peak: 9.2, FrameCnt: 0, State: 1 0
Finding PSS... Peak: 8.1, FrameCnt: 0, State: 1 0
MIB received (CFO: -0.01 kHz) FrameCnt: 0, State: 1 0
MIB received (CFO: -0.13 kHz) FrameCnt: 0, State: 1 0
MIB received (CFO: -0.23 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.08 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.12 kHz) FrameCnt: 0, State: 1
Finding PSS... Peak: 8.2, FrameCnt: 0, State: 1
MIB received (CFO: -0.17 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.20 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.21 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.02 kHz) FrameCnt: 0, State: 1
Finding PSS... Peak: 9.1, FrameCnt: 0, State: 1
MIB received (CFO: -0.14 kHz)
MIB received (CFO: -0.16 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.08 kHz) FrameCnt: 0, State: 1
MIB received (CFO: -0.21 kHz) FrameCnt: 0, State: 1
SIGINT received. Exiting....1, FrameCnt: 4, State: 0 0
Saving PCAP fileeak: 1.0, FrameCnt: 4, State: 0
Bye
QObject::~QObject: Timers cannot be stopped from another thread
opensourcesdr@opensourcesdr:~/Downloads/srsRAN/build/lib/examples$
六、有用链接和联系方式
https://www.srsran.com/
https://docs.srslte.com/en/latest/general/source/1_installation.html
https://docs.srslte.com/en/latest/app_notes/source/nbiot/source/index.html#nbiot-appnote
https://wiki.myriadrf.org/Lime_Suite
https://github.com/srsran/srsRAN
https://github.com/srsran/srsGUI