OAI 环境搭建
1 环境介绍
Name | Version |
---|---|
Ubuntu | 18.04 |
oai5g | 2020.w28 |
openair-cn | master (2020-07-15) |
2 内核设置
- disable C-states from BIOS (or from GRUB)
# 注意这是针对intel的cpu 我暂时将intel改成了amd sudo vi /etc/default/grub #在末尾添加: GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_pstate=disable" GRUB_CMDLINE_LINUX_DEFAULT="quiet processor.max_cstate=1 intel_idle.max_cstate=0 idle=poll" sudo vi /etc/modprobe.d/blacklist.conf #在末未添加:(将Intel的电源管理加入黑名单) blacklist intel_powerclamp sudo reboot
- disable CPU freq. scaling
sudo apt-get install cpufrequtils # 添加`GOVERNOR=“performance”到下面文件 sudo vim /etc/default/cpufrequtils # 执行下面命令,否则重启后设置会被还原 # 不知道是不是我的电脑是AMD的 下面第一句会提示 # error cpufre:-inf LSB script for ondemand # 换成第二句(被注释掉)就可以了 sudo update-rc.d ondemand disable #sudo systemctl disable ondemand.service sudo /etc/init.d/cpufrequtils restart
- install low-latency kernel
sudo apt-get install linux-lowlatency sudo apt-get install linux-image-`uname -r | cut -d- -f1-2`-lowlatency sudo apt-get install linux-headers-`uname -r | cut -d- -f1-2`-lowlatency reboot
3 安装 openairinterface5g
cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -I -w USRP --eNB --UE --nrUE --gNB
A. Failed to connect to gist.github.com
问题描述:
解决办法:
最初,这个问题挂代理也无法解决。后来查阅相关资料后,是域名解析不对。需要在/etc/hosts
文件里附加:
140.82.118.4 gist.github.com
140.82.118.4 是由IP 查询网址得出的。
之后如下用代理即可完成安装。
proxychains4 ./build_oai -I -w USRP --eNB --UE --nrUE --gNB
4 安装 openair-cn(core-network)
A.安装依赖时遇到的问题
问题描述:
在安装./build_spgw -i
依赖时报错
解决办法:
重新安装对应版本内核,4.9.105
这里注意一下,是选三个文件。一个是结尾有all.deb
的,另外两个是名字里有lowlatency
的。最初我只选了两个lowlatency
的,结果会报依赖错误。
B. 运行时遇到的问题
问题描述:
./run_mme
时报Function s6a_init (&mme_config) has failed
错误。
解决办法:
参考网上其他文章,看到两个方法,一是换内核,二是修改FQDN。 两种方法我都试过了,结果均是失败。现在考虑继续换其他内核,或者降低openair-cn的版本。
降低版本并没有解决问题,考虑换其他内核的方法。
安装和运行HSS
HSS用到了mysql
和phpmyadmin
来管理UE的数据,主要是mysql
,phpmyadmin
是管理mysql
的可视化网页端。
run
sudo ./build_hss -i
to install the required packagessudo apt autoremove sudo apt-get install phpmyadmin # browser can not show the `127.0.0.1/phpmyadmin` page sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf sudo a2enconf phpmyadmin sudo /etc/init.d/apache2 reload # then it should work
如果安装的时候没有提示设置mysql密码,那么需要重置密码reset the password for mysql
sudo cat /etc/mysql/debian.cnf mysql -u debian-sys-maint -p Enter password: use mysql; update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost'; update user set plugin="mysql_native_password"; flush privileges; quit; sudo service mysql restart mysql -u root -p
配置文件
hss.conf 和 hss_fd.conf运行
sudo ./run_hss
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur sudo ./build_hss --clean sudo ./run_hss
结果图:
安装和运行MME
run
sudo ./build_mme -i
to install the required packages配置文件
mme.conf 和 mme_fd.conf运行
./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ lyzh.openair4G.eur ./build_mme -c ./run_mme
版权声明:本文为u011745228原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。