本文几乎照搬 all in one openairinterface
Name | Version |
---|---|
Ubuntu | 18.04.4(all packages upgraded) |
UHD | 3.15.0.HEAD-0-gaea0e2de |
openair-cn | commit 724542d0b59797b010af8c5df15af7f669c1e838 |
openairinterface | commit edb74831dabf79686eb5a92fbf8fc06e6b267d35 |
添加OAI库作为授权的远端系统
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
参考链接–安装USRP驱动(UHD)
下载原作者Laurent的补丁
cd ~
wget https://open-cells.com/opencells-mods-20190923.tgz
tar xf opencells-mods-20190923.tgz
# maybe go back to home directory (leave openairinterface5g directory)
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
cd openair-cn
git checkout develop
当时的develop分支commit:724542d0b59797b010af8c5df15af7f669c1e838
克隆上面代码现在需要帐号了,如果你没用的话,可以考虑下载作者上传的压缩包
openair-cn
tar xf openair-cn.tgz
cd openair-cn
git checkout develop
Apply the patch(打上作者提供的补丁):
git apply ~/opencells-mods/EPC.patch
安装第三方依赖
cd openair-cn
source oaienv
cd scripts
./build_hss -i
For ubuntu 18.04, we set back the legacy mysql security level
# 如果你有密码就用下面注释掉的那一句
sudo mysql -u root << END
#sudo mysql -u root -pYOURPASSWORD << END
USE mysql;
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
END
sudo systemctl restart mysql.service
sudo mysql_secure_installation
The last command will ask a few questions:
./build_mme -i
./build_spgw -i
cd openair-cn
source oaienv
cd scripts
./build_hss
./build_mme
./build_spgw
如果你遇到任何编译的问题,日志文件在 openair-cn/build/log
下,在这个文件里找
error:
的字符串
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout edb74831da
source oaienv
./cmake_targets/build_oai -I # install SW packages from internet
./cmake_targets/build_oai -w USRP --eNB --UE # compile eNB and UE
./build_oai -w USRP
找不到uhd库
具体的原因应该是你安装uhd库时没有安装到默认的目录(/usr/local), 比如我安装
多个版本的uhd库时, 就会安装到(/usr/local/opt/uhd_x_x_x)目录下, 其中
uhd_x_x_x
的x
指的是uhd的版本号. 多个版本可以创建软连接来管理.
解决办法是在/path/to/cmake_targets/CMakeLists.txt
文件里添加uhd的头文件和
库文件搜索目录, 如下图所示.
sudo mkdir -p /usr/local/etc/oai
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai
cd openair-cn; source oaienv; cd scripts
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance
./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance
spgw.conf
Only the SGi output to internet need to be configured.
In /usr/local/etc/oai/spgw.conf,
your should set the Ethernet interface that is connected to Internet, and,
to tell to the PGW to implement NAPT for the UE traffic
PGW_INTERFACE_NAME_FOR_SGI = "enp3s0";
PGW_MASQUERADE_SGI = "yes";
SIM MCC/MNC should be duplicated in a couple of file
////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.20";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
GUMMEI_LIST = ( MCC="208" ; MNC="92"; MME_GID="4" ; MME_CODE="1"; } );
TAI_LIST = ({MCC="208" ; MNC="92"; TAC = "1"; } );
eNB(x300) ( _ Update Date: 2020.07.27 Monday_)
oai enb x300 additional config
添加下面内容在enb.band*.***
配置文件的RUs = (
模块里\
sdr_addrs = "type=x300,addr=192.168.10.2";
The final RUs
section should be edited as shown below.
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 5
att_rx = 0;
bands = [7];
max_pdschReferenceSignalPower = -27;
max_rxgain = 117;
eNB_instances = [0];
sdr_addrs = "type=x300,addr=192.168.40.2";
}
);
打开四个终端窗口
In each window
cd openair-cn; source oaienv; cd scripts; ./run_hss
cd openair-cn; source oaienv; cd scripts; ./run_mme
cd openair-cn; source oaienv; cd scripts; sudo -E ./run_spgw
sudo bash
cd ~/openairinterface5g; source oaienv
cd cmake_targets/lte_build_oai/build
sudo ./lte-softmodem -O ~/opencells-mods/enb.10MHz.b200
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/freediameter.git -b \
eurecom-1.2.0
cd freediameter
git apply ~/opencells-mods/freediameter1.2.0.postOAI.patch
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../
make -j4
sudo make install