ubuntu 16.04ϵͳLimeSDR V1.4ʹ��OpenAirInterface�LTEʵ�黷��

wangping
Thu, 27 Dec 2018 05:10:28 +0000
Lime-SDR

?ͻȻ����������һ��LimeSDR���������������ϣ��о��������д�ıȽϿ��ף����ԸϽ����֡�����ʹ�� […]

?ͻȻ���d������һ��LimeSDR�������������Y�ϣ����X�@���������ı��^���V�������s�o���֡�����ʹ�õ�16.04 ���ƒ��ݲ������D�ԡ�ĬĬ���c�Ρ����K�����Լ���ϵ�y����һЩbug��http://www.mobibrw.com/2018/10729/comment-page-1#comment-3451s

?����ϵ�y�{��
�ο�ubuntu 16.04���ӳ��ں˰�װ����ʱ�ں�CPU�{�����������ģʽ,�K�Ҳ����S�����l��,����Ј���ʧ��Ҳ�]�Pϵ��ֻ�����ܲ���ȫ���ö���

sudo apt-get install cpufrequtils
sudo touch /etc/default/cpufrequtils
sudo sed -i "/GOVERNOR.*/d" /etc/default/cpufrequtils
test -s /etc/default/cpufrequtils && sudo sed -i '$a\GOVERNOR=\"performance\"' /etc/default/cpufrequtils || echo "GOVERNOR=\"performance\"" | sudo tee /etc/default/cpufrequtils
sudo update-rc.d ondemand disable

���b��ه��

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

���g���bSoapySDR

cd ~
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
git pull origin master
mkdir build && cd build
cmake ..
make -j4
sudo make install
sudo ldconfig

���g���bLimeSDR

cd ~
git clone https://github.com/myriadrf/LimeSuite.git
cd LimeSuite
#Ŀǰ�Ĳ��Է��֣���������汾�Ĵ����޷������ķ����źţ�
#Ҳ�����ֻ������������Ǵ����õĻ�վ��
#�����о���ȷ���ǡ�Commit 9883bb97 by ignasj, 2017-06-30 ����04:20��
#���ڡ�lms7_device.cpp�����޸ĵ��µ����⣬ԭ��Ϊ���߷����������ò���ȷ
#��������ο� https://www.mobibrw.com/?p=11957
#��ֹĿǰ2018.09.03�汾�Ĵ���ò���Ѿ�������������ˣ�Ӧ���Ѿ���������ʹ���ˡ�
#������˵������ʹ������汾��
git checkout v17.06.0
# ����ɾ��buildĿ¼������buildĿ¼��Ҫ��ԭ����ɾ�����ļ���
# ԭ������buildĿ¼�´���mcu����Ĭ��Ӧ������������Ŀ¼��ȡmcu����ˢ�µ��豸
cd build
# cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake ..
make -j4
sudo make install
sudo ldconfig
cd ../udev-rules/
sudo bash install.sh
# Download board firmware
sudo LimeUtil --update
#�̼����ص�ַ http://downloads.myriadrf.org/project/limesuite/
#��������Ĺ̼��޷����أ����ԴӴ˴�����һ�ݿ���
#https://www.mobibrw.com/wp-content/uploads/2018/03/17.06-LimeUtils-fpga-fw.zip

���g���bUSRP��

sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests cmake build-essential
cd ~
git clone git://github.com/EttusResearch/uhd.git
cd uhd; mkdir host/build; cd host/build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
sudo ldconfig

#����ű��������ǵ�http://files.ettus.com/binaries/images/�������µľ����ļ�������ѹ���� /usr/share/uhd/imagesĿ¼��
sudo /usr/lib/uhd/utils/uhd_images_downloader.py

#�������ľ�������ʧ�ܣ����Գ���ִ����������ӱ�վ����
# cd ~ ; wget https://www.mobibrw.com/wp-content/uploads/2018/03/uhd-images_003.010.003.000-release.zip
# sudo unzip uhd-images_003.010.003.000-release.zip -d /user

���g�ĕr����F�����e�`��

Traceback (most recent call last):
  File "/home/bellnet/uhd/host/build/python/setup.py", line 9, in <module>
    from setuptools import setup
ImportError: No module named setuptools
python/CMakeFiles/pyuhd_library.dir/build.make:64: recipe for target 'python/build/timestamp' failed
make[2]: *** [python/build/timestamp] Error 1
CMakeFiles/Makefile2:3976: recipe for target 'python/CMakeFiles/pyuhd_library.dir/all' failed
make[1]: *** [python/CMakeFiles/pyuhd_library.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

��Ҫԭ���Ǜ]�а��bsetuptools�����·������b

sudo apt install python-pip
pip install setuptools==40.6.2

���±���make -j4�� ͨ������������

���d�K�≺�s��Ҫ���a��
cd ~
wget http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170710.tgz
tar xf opencells-mods-20170710.tgz

?���d�K���geNB
cd ~
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g

#git checkout develop

git checkout 08b8b3142df16831396a5283a015564ff56bf91c -b ubuntu
git apply ../opencells-mods/eNB.patch

#������绷�����ã����ںܶ�https����git�������⣬��ô��������ĸ����ļ�Դ�Ĳ�����

source oaienv
./cmake_targets/build_oai -I       # install SW packages from internet
# ./cmake_targets/build_oai  -w USRP --eNB # compile eNB
# ע������������±����limesdr���������ⲿ��Ҳ��Ҫ���±���

$ ./cmake_targets/build_oai -c -w LMSSDR --eNB

���²��E���пɟo������ľW�j�h��

#���ڹ��ڵ��û���˵������ļ��������ַ��Ҫ�޸�һ�£����������޷����ػ������طǳ��������
sed -i "s/git clone https:\/\/gist.github.com\/2190472.git \/opt\/ssh/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/ssh.tar.gz \&\& sudo tar -zxvf ssh.tar.gz -C \/opt/g" cmake_targets/tools/build_helper

sed -i "s/git clone https:\/\/gitlab.eurecom.fr\/oai\/asn1c.git \/tmp\/asn1c/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/asn1c.tar.gz \&\& tar -zxvf asn1c.tar.gz -C \/tmp/g" cmake_targets/tools/build_helper

sed -i "s/https:\/\/pypi.python.org\/packages\/18\/fa\/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00\/netifaces-0.10.4.tar.gz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/netifaces-0.10.4.tar.gz/g" cmake_targets/tools/build_helper

sed -i "s/https:\/\/github.com\/google\/protobuf\/releases\/download\/v2.6.1\/protobuf-2.6.1.tar.gz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/protobuf-2.6.1.tar.gz/g" cmake_targets/tools/build_helper

sed -i "s/git clone https:\/\/github.com\/protobuf-c\/protobuf-c.git/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/protobuf-c.tar.gz \&\& tar -zxvf protobuf-c.tar.gz/g" cmake_targets/tools/build_helper

sed -i "s/http:\/\/mirrors.dotsrc.org\/gcrypt\/gnutls\/v3.1\/gnutls-3.1.23.tar.xz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/gnutls-3.1.23.tar.xz/g" cmake_targets/tools/build_helper

sed -i "s/https:\/\/ftp.gnu.org\/gnu\/nettle\/nettle-2.5.tar.gz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/nettle-2.5.tar.gz/g" cmake_targets/tools/build_helper

#�����������⣬���߰汾��protobuf-c���������氲װ�İ汾��ƥ�䣬�ᵼ�±������
sed -i "s/cd protobuf-c/cd protobuf-c \&\& git checkout 2a46af42784abf86804d536f6e0122d47cfeea45/g" cmake_targets/tools/build_helper

���g���e��������g�]���e�`��Ո���^��
Log file for compilation has been written to: /home/bellnet/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt
oai_lmssdrdevif compilation failed
build have failed

���w��ԃlog

Scanning dependencies of target oai_lmssdrdevif
Building CXX object CMakeFiles/oai_lmssdrdevif.dir/home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp.o
/home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp: In function ��int trx_lms_start(openair0_device*)��:
/home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp:196:35: error: too few arguments to function ��int LMS_VCTCXOWrite(lms_device_t*, uint16_t, bool)��
     LMS_VCTCXOWrite(lms_device,129);
                                   ^
In file included from /home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp:39:0:
/usr/local/include/lime/LimeSuite.h:982:26: note: declared here
 API_EXPORT int CALL_CONV LMS_VCTCXOWrite(lms_device_t * dev, uint16_t val, bool memoty);
                          ^
CMakeFiles/oai_lmssdrdevif.dir/build.make:62: recipe for target 'CMakeFiles/oai_lmssdrdevif.dir/home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp.o' failed
make[3]: *** [CMakeFiles/oai_lmssdrdevif.dir/home/bellnet/openairinterface5g/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp.o] Error 1
CMakeFiles/Makefile2:815: recipe for target 'CMakeFiles/oai_lmssdrdevif.dir/all' failed
make[2]: *** [CMakeFiles/oai_lmssdrdevif.dir/all] Error 2
CMakeFiles/Makefile2:827: recipe for target 'CMakeFiles/oai_lmssdrdevif.dir/rule' failed
make[1]: *** [CMakeFiles/oai_lmssdrdevif.dir/rule] Error 2
Makefile:378: recipe for target 'oai_lmssdrdevif' failed
make: *** [oai_lmssdrdevif] Error 2

���e

vim targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp

ԭ���ļ�

#196��
 LMS_VCTCXOWrite(lms_device,129);

    if (LMS_SetSampleRate(lms_device,device->openair0_cfg->sample_rate,2)!=0)
    {
        fprintf(stderr, "Failed to set sample rate %s\n",LMS_GetLastErrorMessage());
        return -1;
    }
    printf("Set sample rate %f MHz\n",device->openair0_cfg->sample_rate/1e6);

�޸�LMS_VCTCXOWrite(lms_device,129��LMS_VCTCXOWrite(lms_device,129,true)���پ��g��ͨ�^��

���d�K���gEPC(���ľW��
cd ~
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
cd openair-cn
git checkout develop
git checkout 724542d0b59797b010af8c5df15af7f669c1e838 -b ubuntu16

#Ӧ�ò���
git apply ../opencells-mods/EPC.patch

#����û��ʹ�ã�������粻�ý���ִ����һ�������ڹ��ڵ��û���˵������ļ��������ַ��Ҫ�޸�һ�£����������޷����ػ������طǳ��������
sed -i "s/git clone https:\/\/gitlab.eurecom.fr\/oai\/freediameter.git -b eurecom-1.2.0/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/freediameter.tar.gz \&\& tar -zxvf freediameter.tar.gz \&\& cd freediameter \&\& git checkout eurecom-1.2.0 \&\& cd ../g" build/tools/build_helper

source oaienv; cd scripts

#��װ��������������
./build_hss -i
# Do you want to install freeDiameter 1.2.0 ?<y/N>: yes
# ��������������д���


#���ڹ��ڵ��û���˵������ļ��������ַ��Ҫ�޸�һ�£����������޷����ػ������طǳ��������
sed -i "s/git clone git:\/\/git.osmocom.org\/libgtpnl/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/libgtpnl.tar.gz \&\& tar -zxvf libgtpnl.tar.gz/g" ../build/tools/build_helper



#Install 3PP SW for mme and spgw
./build_mme -i
# Do you want to install freeDiameter 1.2.0 ?<y/N>: no
# Do you want to install asn1c rev 1516 patched? <y/N>: no
# Do you want to install libgtpnl ? <y/N>: yes
# ��������������д���



./build_spgw -i
# Do you want to install libgtpnl ? <y/N>: no

#����mme�ı���ģ�壬Ĭ�������mme�����������Debug�汾��
#������ᴥ��"src/gtpv2-c/nwgtpv2c-0.11/src/NwGtpv2c.c"�Ķ����쳣
#��mme: ~/openair-cn/src/gtpv2-c/nwgtpv2c-0.11/src/NwGtpv2c.c:487: nwGtpv2cCreateLocalTunnel: Assertion `0' failed.��
#��������쳣�����Ǵ����⣬ֱ�����Ӽ���
#������ǰѴ˴��ı������ΪRelWithDebInfo
sed -i "s/\"Debug\"/\"RelWithDebInfo\"/g" ../build/mme/CMakeLists.template

#������������ļ�������
sed -i "s/while 0/while (0)/g" ../src/utils/log.h

sed -i 's/char[ \t]*pid_dec\[32]/char pid_dec\[128]/g' ../src/utils/pid_file.c

#��ʽ���б������
./build_hss -c -v

./build_mme -v

./build_spgw -v

����EPC
# ���������ļ�
cd ~
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

# ���ó������������֣�����������ڷ��ʻ�������ʱ��ʹ��
# ���ֻ��һ�������������������������������������ʹ������������õ�������
# `ifconfig | grep "Link" | awk '{print $1}' | grep "en"`
# ������������ʵ�������������
sudo sed -i "s/PGW_INTERFACE_NAME_FOR_SGI.*/PGW_INTERFACE_NAME_FOR_SGI = \"`ifconfig | grep "Link" | awk '{print $1}' | grep "en"`\";/g" /usr/local/etc/oai/spgw.conf

# ���÷���MySQLʱ������룬"/usr/local/etc/oai/hss.conf"���˴��ٶ�MySQL������Ϊ"123"
sudo sed -i "s/^MYSQL_pass.*/MYSQL_pass = \"123\"/g" /usr/local/etc/oai/hss.conf

#�������ݿ⣬�������ṹ
./hss_db_import 127.0.0.1 root 123 oai_db ~/opencells-mods/opencells_db.sql

�޸��҂�UE��Ҫʹ�õ������ļ�
cd ~
cd openairinterface5g; source oaienv

#�����ļ�Ϊ"targets/PROJECTS/GENERIC-LTE-EPC/CONF/"Ŀ¼�µİ���lmssdr�������ļ�
sed -i "s/mobile_network_code.*/mobile_network_code = \"92\";/g" ./targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf
vim ./targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf

�ҵ�

////////// MME parameters:
mme_ip_address      = ( { ipv4       = "192.168.12.148";
                          ipv6       = "192:168:30::17";
                          active     = "yes";
                          preference = "ipv4";
                        }
                      );

NETWORK_INTERFACES :
{
    ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
    ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.150/24";

    ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
    ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.150/24";
    ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
};

��Q����

///////// 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
};

�yԇ���ܣ����������_�Ă�����Shell

echo -ne "\033]0;HSS\007"
cd ~
cd openair-cn; source oaienv; cd scripts;

#ò����Ҫ����֮ǰ������һ�����ݿ���У�������ܵ����豸�޷�������Ӧ���Ǹ�BUG
./hss_db_import 127.0.0.1 root 123 oai_db ~/opencells-mods/opencells_db.sql
./run_hss

run_mme.sh

echo -ne "\033]0;MME\007"
cd ~
cd openair-cn; source oaienv; cd scripts;
./run_mme

run_spgw.sh

echo -ne "\033]0;SPGW\007"
cd ~
cd openair-cn; source oaienv; cd scripts;
sudo -E ./run_spgw

run_eue.sh

echo -ne "\033]0;EUE\007"
cd ~
cd openairinterface5g; source oaienv

#�����ļ�Ϊ"targets/PROJECTS/GENERIC-LTE-EPC/CONF/"Ŀ¼�µİ���lmssdr�������ļ�
#��������ļ������ߵĽ��뷽ʽֱ����أ����߽�����������ϵ�RX1_H,TX1_2���������߽ӿ�
#����-d ����������ͼ�ν����������

sudo -E ./cmake_targets/lte_build_oai/build/lte-softmodem -O ./targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf --rf-config-file ./targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini -d

#�������֮�󣬳��� ��[PHY][E]TX : Timeout (sent 6800/7680)�� �����ĺ�ɫ���ݣ�Ȼ���˳������Զೢ�Լ��Σ�һ��Ϳ��Իָ�������

��������֮�ᣬ���֙C�������A���sҫ7�������\�I�ͣ������ҵ�һ������20892���\�I�̣�������Щ�W����ʽ���֙C�������_���@ʾEurecom�@����������\�I�̵����֡�

�O��ʹ�õ�SIM�����h���Ԍ�ُ�I�������}�����LTE�yԇ��(��s30Ԫÿ���Ę��ӣ������ȵă���Ո���������ˆD����Ϣ�M�Ќ��룬������ɫ�^�򣬿��Ʋ��Ɍ����oЧ������������O�ó��ˆD�Ę��ӣ��͕��o��“�W��

�����Ĵ��a������d���y�����ԏı�վ���dһ�ݿ�ؐ��

SoapySDRԴ���a���d
LimeSuiteԴ���a���d
USRPԴ���a���d
openairinterface5gԴ���a���d
openair-cnԴ���a���d
���]ʹ��LimeUtilˢ�µĹ̼�
����Ҫ�����Č���ܛ���ģ�SIM Personnalize tools���������c���@�Y���d

����l���֙C���O��o���B�ӵ��҂��Լ���Ļ�վ���ڴ_���yԇ����Ϣ���ȫ���_��ǰ���£����lte-softmodem���ڳ��F�ˆD�ļtɫ�e�`��Ϣ��

1 | [PHY][E]ERROR: Format 1A: rb_alloc (1ff) > RIV_max (144)

���șz���O���MTU������O���MTU��С���^1500,�t�������@�N���}��/usr/local/etc/oai/spgw.conf�Y�����õ�MTU��С����1500���@����С�����O�à�1536������ò�ƕ����‘��î�����
Ŀǰ��֪����С��Note1��ӛ��ϴ�“�W�r���O���MTU��С�����ǡ���B���^MTU��1536�Ļ�վ��ò�ƕ�ʹ���@�����֣����†��}��
һ�㽨�hAndroid�֙C����adb shell ifconfig�^��һ���֙C��ݔ����

�֙C���Ҫ���F�ϾW����Ҫ�ֹ�����һ��APN�����ˆD���������������

��Ҫ���O�à��ˆD��APN�f�h��APN���[�f�h�����dϵ�y���@����Ҫ�O�ã���tMME��������src/nas/emm/sap/emm_cn.c:358 ��ָ���쳣������Ҫ�ǅf�h��֧�֣�����̎��������������r�£��ѽ��Ԅ��O����MCC��MNC������]���Ԅ��O�ã�Ո�ֹ��޸ĳ�MCC 208��MNC 92��

�֙C���ĕr���Ђ�С���ɣ����Խ�Q�l�����SIM���Ć��}�����ǰ��֙C�O�ó��w��ģʽ����ȡ���w��ģʽ�����ԏ����֙C����������վ�K�����B�ӣ�����p�ٌ���SIM���Ĳ�β�����

����朽�

OpenAir, single machine Ubuntu 17.04, after major EPC update

LimeSDR installation

protobuf-c no longer compiles against protobuf-2.6.1

OpenAirInterface���b�f��

OpenAirInterface���b�̳�

How I can disable CPU frequency scaling and set the system to performance?

OAI ��ȫ��ֲ�

OpenAirInterface OAI ���Ž̳� 1

����ȫ������ʵ�� 4G LTE ��վ����ԭ����ʲô��

���ӽ��OLTE���W��

Program SIM Cards

OpenAirInterface Community Q&A

How to Connect OAI eNB (USRP B210) with COTS UE

OpenAirInterface configuration

How to Install LimeSDR on OpenInterface eNodeB

Towards Open Cellular EcosystemOpenAirInterfaceTM (OAI): Towards Open Cellular EcosystemTable of Contents

OpenAirInterface ���򿪷�ʽ������̬ϵͳ

Tutorial on how to setup OAI with Lime LMSDR