<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.myriadrf.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cswiger</id>
	<title>Myriad-RF Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.myriadrf.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cswiger"/>
	<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/Special:Contributions/Cswiger"/>
	<updated>2026-04-22T00:27:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1652</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1652"/>
		<updated>2018-04-07T17:31:45Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew] (Latest) Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] E-UTRAN_User_Guide.pdf  that may be useful, explains config options like rach_numberOfRA_Preambles&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Another option for troubleshooting is T-tracer - instructions [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/basic]&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_T-tracer_1.jpg]]&lt;br /&gt;
Description of elements [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/enb]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1651</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1651"/>
		<updated>2018-04-07T16:52:07Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew] (Latest) Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] E-UTRAN_User_Guide.pdf  that may be useful, explains config options like rach_numberOfRA_Preambles&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Another option for troubleshooting is T-tracer - instructions [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/basic]&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_T-tracer_1.jpg]]&lt;br /&gt;
Description of elements [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/enb]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1650</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1650"/>
		<updated>2018-04-07T16:32:42Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] E-UTRAN_User_Guide.pdf  that may be useful, explains config options like rach_numberOfRA_Preambles&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Another option for troubleshooting is T-tracer - instructions [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/basic]&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_T-tracer_1.jpg]]&lt;br /&gt;
Description of elements [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/enb]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=File:OAI_T-tracer_1.jpg&amp;diff=1649</id>
		<title>File:OAI T-tracer 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=File:OAI_T-tracer_1.jpg&amp;diff=1649"/>
		<updated>2018-04-07T16:29:09Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: Screenshot of OAI T-tracer during data download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screenshot of OAI T-tracer during data download&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1648</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1648"/>
		<updated>2018-04-07T16:08:35Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] E-UTRAN_User_Guide.pdf  that may be useful, explains config options like rach_numberOfRA_Preambles&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Another option for troubleshooting is T-tracer - instructions [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/basic]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1647</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1647"/>
		<updated>2018-04-06T14:20:06Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] E-UTRAN_User_Guide.pdf  that may be useful, explains config options like rach_numberOfRA_Preambles&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1646</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1646"/>
		<updated>2018-04-06T14:15:59Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Older formal documentation [https://svn.eurecom.fr/openair4G/trunk/targets/DOCS/] that may be useful:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1642</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1642"/>
		<updated>2018-04-05T21:52:45Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the entities and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1640</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1640"/>
		<updated>2018-04-02T20:19:03Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using the LimeSDR and target user equipment Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1639</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1639"/>
		<updated>2018-04-02T20:05:33Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna use go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1638</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1638"/>
		<updated>2018-04-02T20:00:53Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
LimeSuite version&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Version information:&lt;br /&gt;
  Library version:      v18.01.0-g6df6ea22&lt;br /&gt;
  Build timestamp:      2018-02-08&lt;br /&gt;
  Interface version:    v2017.12.0&lt;br /&gt;
  Binary interface:     18.01-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1637</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1637"/>
		<updated>2018-04-02T19:51:33Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection running iperf / aperf&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1636</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1636"/>
		<updated>2018-04-02T19:50:25Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Startup process - as detailed in [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/] source the /openair-cn/oaienv, cd scripts and ./run_hss, run_mme then as root (sudo -E) ./run_spgw and finally&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/bin/lte-softmodem.Rel14 -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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1635</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1635"/>
		<updated>2018-04-02T19:45:25Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Also set configuration in /usr/local/etc/oai/mme.conf Globally unique MME identifier  and Tracking Area Identity&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;GUMMEI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;; MME_GID=&amp;quot;4&amp;quot; ; MME_CODE=&amp;quot;1&amp;quot;; }                   # YOUR GUMMEI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    TAI_LIST = (&lt;br /&gt;
         {MCC=&amp;quot;244&amp;quot; ; MNC=&amp;quot;91&amp;quot;;  TAC = &amp;quot;1&amp;quot;; }                                   # YOUR TAI CONFIG HERE&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
to match the lte-softmodem config file  targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;tracking_area_code  =  &amp;quot;1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_country_code =  &amp;quot;244&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    mobile_network_code =  &amp;quot;91&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1634</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1634"/>
		<updated>2018-04-02T19:34:27Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Screenshot of a good connection&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:OAI_LTE_8-09_Mbps_xforms.jpg]]&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=File:OAI_LTE_8-09_Mbps_xforms.jpg&amp;diff=1633</id>
		<title>File:OAI LTE 8-09 Mbps xforms.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=File:OAI_LTE_8-09_Mbps_xforms.jpg&amp;diff=1633"/>
		<updated>2018-04-02T19:31:26Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: OAI xforms for working UE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OAI xforms for working UE&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1632</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1632"/>
		<updated>2018-04-02T19:28:10Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:56.461835 IP 172.16.0.10.47668 &amp;gt; ord30s25-in-f206.1e100.net.https: Flags [P.], seq 1:217, ack 1, win 229, options [nop,nop,TS val 43729 ecr 7671639], length 216&lt;br /&gt;
17:41:56.491983 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.47668: Flags [.], ack 217, win 170, options [nop,nop,TS val 7671748 ecr 43729], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. it is pingable from the OAI host&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1631</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1631"/>
		<updated>2018-04-02T19:26:03Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
1e100 is a googol, the UE phoning home. I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1630</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1630"/>
		<updated>2018-04-02T19:23:07Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB#step-3-update-tables-oai_dbmmeidentity-and-oai_dbpdn]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1629</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1629"/>
		<updated>2018-04-02T19:21:46Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
For SIM programming this is a very useful page [https://philclaridge.com/how-to-program-a-sysmocom-sjs1-sim-for-use-with-oai/] that uses the strategy of copying a user that already exists in the example mysql oai_db &#039;users&#039; table.  They will also need to be put in the &#039;pdn&#039; packet-data-network as detailed in step 2 of section 2.3 of [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1628</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1628"/>
		<updated>2018-04-02T19:11:41Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The next obstacle was authentication, the OP issue mentioned above.  A fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
/usr/local/etc/oai/hss.conf was setup with this as a random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1627</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1627"/>
		<updated>2018-04-02T19:09:03Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be piswords cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1626</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1626"/>
		<updated>2018-04-02T19:07:27Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
That means going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be pisword cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1625</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1625"/>
		<updated>2018-04-02T19:05:53Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
For me that meant going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and will email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be pisword cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The last puzzle piece with the lousy bursty throughput and those log errors:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
was partly solved by using the lte-softmodem -d switch  Enable soft scope and L1 and L2 stats (Xforms), since it was built with the -x --xforms option, and&lt;br /&gt;
partly by randomly moving the phone around and noticing there was a sweet spot where Firefox would download and install very fast.&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1624</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1624"/>
		<updated>2018-04-02T18:59:06Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
For me that meant going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and will email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be pisword cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1623</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1623"/>
		<updated>2018-04-02T18:57:36Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
For me that meant going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and will email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be pisword cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tool is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
chuck@SatelliteS855:~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1622</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1622"/>
		<updated>2018-04-02T18:55:21Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
While GSM is fairly easy to authenticate, you can use about any sim, LTE requires a SIM for which you know the Key Ki. &amp;lt;br/&amp;gt;&lt;br /&gt;
For me that meant going ahead and buying the Sysmocom sysmoUSIM-SJS1 10 pack with the ADM keys.   &amp;lt;br/&amp;gt;&lt;br /&gt;
They are very good and will email the info for each card before you get them - the IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 and KIK1.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Another option might be pisword cards from Alibaba or ebay. &amp;lt;/br&amp;gt;&lt;br /&gt;
Will also need an affordable Scm Microsystems USB Smart Card Reader SCR3310V2. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The target UE, the SGS4Mini, that worked fine with osmocom gsm/gprs and had an Option for LTE bands&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Band 3 - dl 1805 to 1880&lt;br /&gt;
Band 7 - dl 2620 to 2690&lt;br /&gt;
Band 8 - dl 925 to 960&lt;br /&gt;
Band 20 - dl 791 to 821&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
expecting to use band 7 which has a known working lte-softmodem configuration file for the LimeSDR (enb.band7.tm1.25PRB.lmssdr.conf). However on plugging in the SIM, the LTE&amp;lt;br/&amp;gt;&lt;br /&gt;
option disappeared, leaving only WCDMA UMTS and good ol&#039; gsm.  Much head scratching, searching and finding the Service Mode for the phone  [https://android.stackexchange.com/questions/102077/how-to-safely-activate-lte-on-s4-mini-gt-i9195-running-4-2-2], finally tried changing the SIM MCC/MNC - mobile country code, mobile network code  [http://www.mcc-mnc.com/]. The Sysmocom SIMS come with 901/70 which looks like Satellite Network, unused network code. Tried the default OAI MCC/MNC 208/93 France, Unused network code, also UK, no luck. Tried a US code and got the LTE option but would not register. Finally discovered the IMEI of the phone contains a code for the country or origin [http://www.samsungsfour.com/tutorials/find-out-galaxy-smartphone-country-of-origin-from-imei-code.html], which in this case turns out to be Finland - tried a carrier there 244/91 and during tests with the easy to setup OpenLTE found the network &amp;quot;FI SONERA&amp;quot; finally.  So the target UE likes 244/91 OK. Another helpful tools is the phone service mode mentioned above, *#0011# and then hit (menu) Back and then (menu) Key Input and enter Q0000 and wait. Then Select UMTS -&amp;gt; Debug Screen -&amp;gt; Phone Control -&amp;gt; Network Control -&amp;gt; Band Selection -&amp;gt; LTE Band and can pick 3,7,8,20 or * to narrow and speed up the network search. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
That ordeal over, the next obstacle was authentication, the OP issue mentioned above. Here are notes on that. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I think my fail to connect issue was due to a confusion about OP and OPc programmed in the card.&amp;lt;br/&amp;gt;&lt;br /&gt;
I setup /usr/local/etc/oai/hss.conf with this as random guess&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That should give an OPc of:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP: 11111111111111111111111111111111&lt;br /&gt;
Ki:  39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&lt;br /&gt;
chuck@SatelliteS855:~/src/sysmo-usim-tool$ ./auchss.py -o 11111111111111111111111111111111 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 11111111111111111111111111111111&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 327ed2b3a3437b08d5ad35875d222f29      &amp;lt;-- this &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Matches db:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mysql&amp;gt; select hex(OPc) from users where imsi=&#039;244910000022771&#039;;&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| hex(OPc)                         |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
| 327ED2B3A3437B08D5AD35875D222F29 |&lt;br /&gt;
+----------------------------------+&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but not the sim. I don&#039;t know how to get an OP to put in hss.conf from the existing OPc and Ki   so reprogram the card with that OPc - use:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=327ED2B3A3437B08D5AD35875D222F29 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
--OR-- create a new OP&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~$ openssl rand -hex 16&lt;br /&gt;
2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
&lt;br /&gt;
~/src/sysmo-usim-tool$ ./auchss.py -o 2f22315911b5ff00591be8b3898b4c09 -k 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OP: 2f22315911b5ff00591be8b3898b4c09&lt;br /&gt;
KI: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
OPc: 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;and program the card with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
To test that - update /usr/local/etc/oai/hss.conf with:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPERATOR_key = &amp;quot;2f22315911b5ff00591be8b3898b4c09&amp;quot;; # random from openssl rand -hex 16&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and startup &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./run_hss&lt;br /&gt;
...&lt;br /&gt;
IMSI: 244910000022771Key: 39.86.0f.df.8d.53.1c.df.38.35.82.c4.ae.ef.a6.07.&lt;br /&gt;
OPc: 32.7e.d2.b3.a3.43.7b.08.d5.ad.35.87.5d.22.2f.29.&lt;br /&gt;
RijndaelKeySchedule: K 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
Compute opc:&lt;br /&gt;
K: 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
In: 2F22315911B5FF00591BE8B3898B4C09&lt;br /&gt;
Rinj: BAF9FDFD245CBD2392E371BBE936E22B&lt;br /&gt;
Out: 95DBCCA435E94223CBF8990860BDAE22&lt;br /&gt;
Query: UPDATE `users` SET `OPc`=UNHEX(&#039;95dbcca435e94223cbf8990860bdae22&#039;) WHERE `users`.`imsi`=&#039;244910000022771&#039;&lt;br /&gt;
IMSI 244910000022771 Updated OPc 327ed2b3a3437b08d5ad35875d222f29 -&amp;gt; 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
correct! Just needs to program the SIM and it should connect OK this time :\&lt;br /&gt;
&lt;br /&gt;
The options in pysim are:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-k KI, --ki=KI Ki (default is to randomize)&lt;br /&gt;
-o OPC, --opc=OPC OPC (default is to randomize)&lt;br /&gt;
--op=OP Set OP to derive OPC from OP and KI&lt;br /&gt;
&lt;br /&gt;
~/src/pysim$ python pySim-prog.py --pcsc-device=0 --type=&amp;quot;sysmoUSIM-SJS1&amp;quot; --mcc=244 --mnc=91 --imsi=244910000022771 --opc=95dbcca435e94223cbf8990860bdae22 --ki=39860FDF8D531CDF383582C4AEEFA607 --iccid=8988211000000227713 --pin-adm=57942614 --acc=0002 &lt;br /&gt;
Insert card now (or CTRL-C to cancel)&lt;br /&gt;
Generated card parameters :&lt;br /&gt;
&amp;gt; Name : Magic&lt;br /&gt;
&amp;gt; SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000&lt;br /&gt;
&amp;gt; ICCID : 8988211000000227713&lt;br /&gt;
&amp;gt; MCC/MNC : 244/91&lt;br /&gt;
&amp;gt; IMSI : 244910000022771&lt;br /&gt;
&amp;gt; Ki : 39860FDF8D531CDF383582C4AEEFA607&lt;br /&gt;
&amp;gt; OPC : 95dbcca435e94223cbf8990860bdae22&lt;br /&gt;
&amp;gt; ACC : 0002&lt;br /&gt;
&lt;br /&gt;
Programming ...&lt;br /&gt;
Done !&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That made progress indeed - at first could still not find the network - then fired up OpenLTE and let it fail on band20 a while - switched back to OAI band7 and soon as I changed the settings in service mode for LTE band selection it attached and got logs immediately!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 620 subframeP 6 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 627 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 627] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 29 : Received short BSR LCGID = 1 bsr = 33&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 4, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
[MAC][I][UL_failure_indication] [eNB 0][UE 0/80e6] Frame 733 subframeP 4 Signaling UL Failure for UE 0 on CC_id 0 (timer 0)&lt;br /&gt;
[PHY][E]ERROR: Format 1A: rb_alloc (1ff) &amp;gt; RIV_max (144)&lt;br /&gt;
[PHY][I][eNB 0][RAPROC] Frame 739 Terminating ra_proc for harq 4, UE 1&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 739] Frame 6, Subframe 0 CC_id 0 MAC CE_LCID 27 (ce 0/3): CRNTI 80e6 (UE_id 0) in Msg3&lt;br /&gt;
[MAC][I][rx_sdu] [eNB 0] CC_id 0 MAC CE_LCID 30: Received long BSR LCGID0 = 0 LCGID1 = 0 LCGID2 = 0 LCGID3 = 0&lt;br /&gt;
[PHY][I]UE 0 : rnti 80e6&lt;br /&gt;
[MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 80e6 : in synch, PHR 40 dB CQI 10&lt;br /&gt;
[RRC][I]UE rnti 80e6 failure timer 0/20000&lt;br /&gt;
[PHY][W][eNB 0, CC 0] frame 733, subframe 8, UE 0: ULSCH consecutive error count reached 20, triggering UL Failure&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tcpdump -i gtp0 gets this&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;17:41:53.720681 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464584546 ecr 19291], length 0&lt;br /&gt;
17:41:56.144615 IP ord36s02-in-f170.1e100.net.https &amp;gt; 172.16.0.2.41084: Flags [F.], seq 0, ack 1, win 170, options [nop,nop,TS val 464586970 ecr 19291], length 0&lt;br /&gt;
17:41:56.281482 IP ord30s25-in-f206.1e100.net.https &amp;gt; 172.16.0.10.43027: Flags [F.], seq 152, ack 276, win 170, options [nop,nop,TS val 1924538862 ecr 42718], length 0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I can ping the phone!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 172.16.0.10&lt;br /&gt;
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=73.9 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=4 ttl=64 time=61.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=5 ttl=64 time=37.2 ms&lt;br /&gt;
64 bytes from 172.16.0.10: icmp_seq=8 ttl=64 time=69.2 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1621</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1621"/>
		<updated>2018-04-02T18:10:08Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Warning: the config file /usr/local/etc/oai/hss.conf contains:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;## HSS options&lt;br /&gt;
#OPERATOR_key = &amp;quot;1006020f0a478bf6b699f15c062e42b3&amp;quot;; # OP key matching your database&lt;br /&gt;
#OPERATOR_key = &amp;quot;11111111111111111111111111111111&amp;quot;; # OP key matching your database&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The OPERATOR_key or &#039;OP&#039; is an important part of the UE authentication, along with the key Ki and OPc. In fact, when the hss starts up is recalculates all the subscribers OPc from their key and this OPERATOR_key so they have to match what you use to write the OPc to the SIM card later.  I picked a random OP (openssl rand -hex 16) and calculated the OPc from that with auchss.py [https://gitlab.fokus.fraunhofer.de/bri/osmo-sim-auth]. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1620</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1620"/>
		<updated>2018-04-02T17:57:05Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be built later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1619</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1619"/>
		<updated>2018-04-02T17:56:28Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be buil5 later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1618</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1618"/>
		<updated>2018-04-02T17:52:01Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after any tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be actually build later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1617</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1617"/>
		<updated>2018-04-02T17:50:36Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C -x&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after and tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be actually build later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1616</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1616"/>
		<updated>2018-04-02T17:48:06Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Beware if that particular kernel is no longer the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after and tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be actually build later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1615</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1615"/>
		<updated>2018-04-02T15:46:39Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Watch out that that particular kernel does NOT become the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after and tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be actually build later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the config file openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Here is a good discussion of the nodes and interfaces (S1-MME,  S1-U, etc) to help visualize the interconnects [https://en.wikipedia.org/wiki/System_Architecture_Evolution] &amp;lt;br/&amp;gt; &lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI to YOUR Internet facing interface:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1614</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1614"/>
		<updated>2018-04-02T15:32:10Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Watch out that that particular kernel does NOT become the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after and tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Do Download and Patch EPC from [https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]&amp;lt;br/&amp;gt;&lt;br /&gt;
Install 3rd party software for EPC&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source oaienv&lt;br /&gt;
cd scripts&lt;br /&gt;
./build_hss -i&lt;br /&gt;
Installing mysql -  root user password:  Pa$$word            &amp;lt;intentionally including example password&amp;gt; &lt;br /&gt;
installs freeDiameter - auth like RADIUS  https://en.wikipedia.org/wiki/Diameter_(protocol)&lt;br /&gt;
installs apache, php    -- for phpMyAdmin   pick apache&lt;br /&gt;
Configure database for phpmyadmin with dbconfig-common? Yes&lt;br /&gt;
phpmyadmin password:   Pa$$word&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
That was to install all the prereqs for hss - it will be actually build later, meanwhile prepare for&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_mme -i&lt;br /&gt;
freeDiameter - no&lt;br /&gt;
asn1c rev - no&lt;br /&gt;
libgtpnl - yes      hope this does not conflict with osmosgsn, ggsn  GTP&lt;br /&gt;
wireshark - done previously (non-root CAN run it)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;$ ./build_spgw -i&lt;br /&gt;
libftpnl - no this time&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Next, actually compile them - just up-arrow and delete the -i&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./build_hss&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/hss/build/oai_hss&#039; -&amp;gt; &#039;/usr/local/bin/oai_hss&#039;&lt;br /&gt;
oai_hss installed&lt;br /&gt;
$ ls /usr/local/bin/oai_hss&lt;br /&gt;
/usr/local/bin/oai_hss&lt;br /&gt;
&lt;br /&gt;
./build_mme&lt;br /&gt;
mme compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/mme&#039; -&amp;gt; &#039;/usr/local/bin/mme&#039;&lt;br /&gt;
mme installed&lt;br /&gt;
auth_request compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/mme/build/auth_request&#039; -&amp;gt; &#039;/usr/local/bin/auth_request&#039;&lt;br /&gt;
auth_request installed&lt;br /&gt;
&lt;br /&gt;
./build_spgw&lt;br /&gt;
spgw compiled&lt;br /&gt;
&#039;/home/chuck/src/oai/openair-cn/build/spgw/build/spgw&#039; -&amp;gt; &#039;/usr/local/bin/spgw&#039;&lt;br /&gt;
spgw installed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
We are going to use this configuration:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HSS is on localhost: 127.0.0.1&lt;br /&gt;
eNB is on 127.0.0.10&lt;br /&gt;
MME is on 127.0.0.20&lt;br /&gt;
SPGW is on 127.0.0.30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
I learned something about loopback lo interface here - you already have all 255^3 addresses available ready to use!&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# ping 127.90.90.90&lt;br /&gt;
PING 127.90.90.90 (127.90.90.90) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=1 ttl=64 time=0.025 ms&lt;br /&gt;
64 bytes from 127.90.90.90: icmp_seq=2 ttl=64 time=0.032 ms&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So backup and edit the above enb.band7.tm1.25PRB.lmssdr.conf  to use this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mme_ip_address = ( { ipv4 = &amp;quot;127.0.0.20&amp;quot;;          -- rest the same&lt;br /&gt;
&lt;br /&gt;
NETWORK_INTERFACES : &lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1_MME = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1_MME = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
     ENB_INTERFACE_NAME_FOR_S1U = &amp;quot;lo&amp;quot;;&lt;br /&gt;
     ENB_IPV4_ADDRESS_FOR_S1U = &amp;quot;127.0.0.10/8&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Install This Configuration for EPC&lt;br /&gt;
in home ~  This uses the package d/l from [http://open-cells.com/d5138782a8739209ec5760865b1e53b0/opencells-mods-20170823.tgz]&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo mkdir -p /usr/local/etc/oai&lt;br /&gt;
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd src/oai/openair-cn; source oaienv; cd scripts&lt;br /&gt;
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance&lt;br /&gt;
HSS S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
HSS S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating HSS certificate for user &#039;hss.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:51:15 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
HSS S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So that cert is good for ONE YEAR   Warning if still using it then&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# less /usr/local/etc/oai/freeDiameter/hss.cert.pem&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Feb 24 18:51:15 2018 GMT&lt;br /&gt;
            &#039;&#039;&#039;Not After : Feb 24 18:51:15 2019&#039;&#039;&#039; GMT&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance&lt;br /&gt;
File /usr/local/etc/oai/freeDiameter/mme.cert.pem not found&lt;br /&gt;
MME S6A: Did not find valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
MME S6A: generating new certificate in /usr/local/etc/oai/freeDiameter...&lt;br /&gt;
Creating MME certificate for user &#039;mme.OpenAir5G.Alliance&#039;&lt;br /&gt;
...&lt;br /&gt;
Certificate is to be certified until Feb 24 18:53:02 2019 GMT (365 days)&lt;br /&gt;
&lt;br /&gt;
Write out database with 1 new entries&lt;br /&gt;
Data Base Updated&lt;br /&gt;
/home/chuck/src/oai/openair-cn/scripts&lt;br /&gt;
MME S6A: Found valid certificate in /usr/local/etc/oai/freeDiameter&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then in /usr/local/etc/oai/spgw.conf   change SGI&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;enp0s31f6&amp;quot;;  &lt;br /&gt;
to &lt;br /&gt;
PGW_INTERFACE_NAME_FOR_SGI = &amp;quot;eno1&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This is already set:&lt;br /&gt;
PGW_MASQUERADE_SGI = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next discussion about MCC,MNC and headache getting an ebay special Galaxy S4Mini GT-I9195 [https://en.wikipedia.org/wiki/Samsung_Galaxy_S4_Mini] working on LTE with Sysmocom SIMS&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1613</id>
		<title>OpenAirInterface LTE</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=OpenAirInterface_LTE&amp;diff=1613"/>
		<updated>2018-04-02T15:07:24Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: Created page with &amp;quot;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered.   Result: Data transmission with...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on a working OAI LTE project using a Samsung Galaxy S4 Mini, mainly pointers to build guides used and summary of obstacles encountered. &lt;br /&gt;
&lt;br /&gt;
Result: Data transmission with an off the shelf cell phone up to 8Mbps (iperf) with very limited range using two antenna for tx and rx (proper duplexer project pending).  That is, the phone must be experimentally positioned a less than a half meter from the LimeSDR and moved around until a good constellation display is found for best results. &lt;br /&gt;
&lt;br /&gt;
Guides for installation:&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNB]Main OAI page for setup with usrp device&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/05/10/limesdr-installation/]open-cells LimeSDR setup&amp;lt;br/&amp;gt;&lt;br /&gt;
[https://open-cells.com/index.php/2017/08/22/all-in-one-openairinterface-august-22nd/]Recent (8/22/2017) all-in-one box build of OAI eNodeB and EPC components.&lt;br /&gt;
&lt;br /&gt;
Hardware used:&amp;lt;br&amp;gt;&lt;br /&gt;
Dell OptiPlex 9010 - quad core i7-3770 CPU @ 3.40GHz  with USB3 support and hyperthreading turned off per OAI [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/setup-for-real-time-performance]recommendations &amp;lt;br/&amp;gt;&lt;br /&gt;
Bash script to turn off hyperthreading (/usr/local/bin/set-hyper-threading) from discussion [https://askubuntu.com/questions/942728/disable-hyper-threading-in-ubuntu/942843#942843].&amp;lt;br/&amp;gt;&lt;br /&gt;
Ubuntu 16.04 LTS Xenial - with low latency kernel &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;root@DellOptiPlex9010:~# uname -a&lt;br /&gt;
Linux DellOptiPlex9010 4.13.0-36-lowlatency #40~16.04.1-Ubuntu SMP PREEMPT Sat Feb 17 00:18:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The latest available lowlatency kernel can be found with a search for the kernel module gpt.ko that will be needed to run the gateway module&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# apt-file search gtp.ko  | grep lowlatency&lt;br /&gt;
linux-image-4.13.0-36-lowlatency: /lib/modules/4.13.0-36-lowlatency/kernel/drivers/net/gtp.ko&lt;br /&gt;
# apt install linux-image-4.13.0-36-lowlatency&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Watch out that that particular kernel does NOT become the primary boot image in grub.conf after an apt upgrate - or manually pick the kernel on startup, or change grub.conf to boot that particular image [https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry] - example /etc/default/grub:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRUB_DEFAULT=&amp;quot;Advanced options for Ubuntu&amp;gt;Ubuntu, with Linux 4.13.0-36-lowlatency&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
So now we have a platform with i7-3770, no hyperthreading and lowlatency ready for OAI LTE.&amp;lt;br&amp;gt;&lt;br /&gt;
And off we go:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git&amp;lt;/nowiki&amp;gt;     Near 200MB &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd  openairinterface5g&lt;br /&gt;
~/src/oai/openairinterface5g$ source oaienv&lt;br /&gt;
~/src/oai/openairinterface5g$ ./build_oai -I --install-optional-packages&amp;lt;/nowiki&amp;gt;          &amp;lt;-- left this running in a screen, installs a bunch of pkgs -- hope it does not break my 2G stuff!&amp;lt;br/&amp;gt;&lt;br /&gt;
---- later ----&amp;lt;br/&amp;gt;&lt;br /&gt;
came home to find a question in the screen, about allowing non-root users to run wireshark packet capture - choose the not-recommended &#039;yes&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
then fail on python ssl - had to fix with&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;python -m easy_install --upgrade pyOpenSSL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
from [https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att]&lt;br /&gt;
re-run ./build_oai  above and completed successfully&amp;lt;br/&amp;gt;&lt;br /&gt;
Next run&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ source oaienv&amp;lt;/nowiki&amp;gt;     Since I exited the screen with env set&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;~/src/oai/openairinterface5g$ ./cmake_targets/build_oai --eNB -w LMSSDR -c -C&lt;br /&gt;
&amp;lt; ... &amp;gt;&lt;br /&gt;
-- Build files have been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/lte_build_oai/build&lt;br /&gt;
Compiling lte-softmodem&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt&lt;br /&gt;
lte-softmodem compiled&lt;br /&gt;
Log file for compilation has been written to: /home/chuck/src/oai/openairinterface5g/cmake_targets/log/oai_lmssdrdevif.Rel14.txt&lt;br /&gt;
oai_lmssdrdevif compiled&lt;br /&gt;
liboai_device.so is linked to LMSSDR device library&lt;br /&gt;
10. Bypassing the Tests ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
More on build options:&amp;lt;br/&amp;gt;&lt;br /&gt;
A fellow in the discourse how-to-install-limesdr-on-openinterface-enodeb uses:  &amp;lt;nowiki&amp;gt;./build_oai -I --eNB -x -w LMSSDR&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Add -x to enable xforms (soft scope),  -w hardware EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)&lt;br /&gt;
--eNB  Makes the LTE softmodem  -I    Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...   &amp;lt;-- I did this seperately above&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Above command had -c clean    Erase all files to make a rebuild from start&amp;lt;br/&amp;gt;&lt;br /&gt;
-C  clean-all    Erase all files made by previous compilations, installations&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The open-cells limesdr-installation used&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./cmake_targets/build_oai -c -w LMSSDR --eNB --UE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
for -c clean,  -w hardware,  --eNB and also --UE  Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file  -- default given config file is &lt;br /&gt;
/home/chuck/src/oai/openairinterface5g/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf&amp;lt;br/&amp;gt;&lt;br /&gt;
What you end up with after that build is:&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; targets/bin/liboai_device.so -&amp;gt;  targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/liboai_lmssdrdevif.so.Rel14&lt;br /&gt;
 targets/bin/lte-softmodem.Rel14&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
and any custom LimeSDR tweaks like setting external clock reference or printing confirmation of antenna uses go in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
plus it&#039;s just fun to read in itself with /usr/local/include/lime/LimeSuite.h open in another term. Of course rebuild lte-softmodem after and tweaks or experiments. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=Osmocom_GSM&amp;diff=1460</id>
		<title>Osmocom GSM</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=Osmocom_GSM&amp;diff=1460"/>
		<updated>2018-02-22T00:13:41Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Running the transceiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes on running the Osmocom GSM stack with  [[LimeSDR]] hardware.&lt;br /&gt;
&lt;br /&gt;
== Hardware support ==&lt;br /&gt;
&lt;br /&gt;
For details of Osmocom support for LimeSDR and dependencies such as [[Lime Suite]] and SoapyUHD that must be installed, see:&lt;br /&gt;
&lt;br /&gt;
* http://osmocom.org/projects/osmotrx/wiki/LimeSDR&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For information on the OsmoTRX GSM transceiver:&lt;br /&gt;
&lt;br /&gt;
* http://osmocom.org/projects/osmotrx/wiki/OsmoTRX&lt;br /&gt;
&lt;br /&gt;
== Network-on-the-box (NITB) ==&lt;br /&gt;
&lt;br /&gt;
For details of how to configure the OpenBSC software to run in network-in-the-box mode, see:&lt;br /&gt;
&lt;br /&gt;
* https://osmocom.org/projects/osmonitb/wiki/OsmoNITB OsmoNITB&lt;br /&gt;
&lt;br /&gt;
== Running the transceiver ==&lt;br /&gt;
&lt;br /&gt;
Update 2/21/2018 &lt;br /&gt;
The   osmo-trx project page for LimeSDR  [https://osmocom.org/projects/osmotrx/wiki/LimeSDR_Family] now recommends :&lt;br /&gt;
 # osmo-trx -s 4 -b 4&lt;br /&gt;
&lt;br /&gt;
Although the -e (edge) option for LimeSDR still appears to work:&lt;br /&gt;
 # osmo-trx -e -a &#039;driver=lime,device=0&#039;&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1203</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1203"/>
		<updated>2017-08-16T01:09:30Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&amp;lt;/br&amp;gt;&lt;br /&gt;
Note, update (Aug 15, 2017) - The center frequency should be corrected below to 1575.42MHz. &lt;br /&gt;
It would marginally work with the original 1545.42 but 1575.42 is rock solid gps sim performance. &lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device, and a Galaxy S4 after using airplane mode, restart and patience. The coverage area is at least a room, even with -42db PAD attenuation.  Here I am visiting Trinity College Cambridge with the qstarz and it&#039;s app. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of International GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=Osmocom_GSM&amp;diff=1027</id>
		<title>Osmocom GSM</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=Osmocom_GSM&amp;diff=1027"/>
		<updated>2017-03-05T21:56:41Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details how to build an Osmocom GSM Network-in-the-Box (NITB) configuration that supports [[LimeSDR]]. &lt;br /&gt;
&lt;br /&gt;
== Base dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Packaged ===&lt;br /&gt;
&lt;br /&gt;
Packaged dependencies can be installed with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$ sudo apt-add-repository ppa:george-edison55/cmake-3.x&lt;br /&gt;
$ sudo apt-add-repository ppa:myriadrf/drivers&lt;br /&gt;
$ sudo add-apt-repository ppa:ettusresearch/uhd&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install build-essential git cmake python-mako libsqlite3-dev libboost-all-dev libmnl-dev libssl-dev libpcap-dev libi2c-dev libusb-1.0-0-dev libsoapysdr-dev autoconf libtool libpcsclite-dev libortp-dev libdbi-dev libdbd-sqlite3 uhd-host libuhd-dev uhd-soapysdr&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lime Suite ===&lt;br /&gt;
&lt;br /&gt;
At the present time Lime Suite should be built from source, instead of using packages. See the [[Lime Suite|wiki page]] for details.&lt;br /&gt;
&lt;br /&gt;
== Osmocom software ==&lt;br /&gt;
&lt;br /&gt;
=== OpenBSC, OsmoBTS &amp;amp; dependencies ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tested commit: 66af97ce0760c0c015b2bc5c8c3290345571b122&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$ git clone https://github.com/fairwaves/osmo-combo&lt;br /&gt;
$ cd osmo-combo&lt;br /&gt;
$ git submodule init&lt;br /&gt;
$ git submodule update&lt;br /&gt;
$ ./apply_patches.sh static-build&lt;br /&gt;
$ sudo make&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OsmoTRX ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tested commit: d22657a26d22d265cfeb57636a2fbe9c3e9c0f16&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$ git clone https://github.com/myriadrf/osmo-trx&lt;br /&gt;
$ cd osmo-trx&lt;br /&gt;
$ autoreconf -i&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
# that the default branch, myriadrf/limesdr, is the one that should be used and not master or any of the others;&lt;br /&gt;
# LimeSDR support will eventually be merged upstream, following which it is planned to maintain this via the Osmocom repository and to delete this fork;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
&lt;br /&gt;
Starting the tranceiver module needs the -e (edge) options for LimeSDR to work:&lt;br /&gt;
 # osmo-trx -e -a &#039;driver=lime,device=0&#039;&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1026</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1026"/>
		<updated>2017-03-02T01:19:53Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device, and a Galaxy S4 after using airplane mode, restart and patience. The coverage area is at least a room, even with -42db PAD attenuation.  Here I am visiting Trinity College Cambridge with the qstarz and it&#039;s app. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of International GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1025</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1025"/>
		<updated>2017-03-02T01:02:16Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge with the qstarz and it&#039;s app. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of International GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1024</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1024"/>
		<updated>2017-03-02T00:26:48Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of International GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1023</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1023"/>
		<updated>2017-03-02T00:25:40Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of International GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1022</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1022"/>
		<updated>2017-03-02T00:24:10Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of Internation GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Maldives_Sats_s1.jpg]]  [[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1021</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1021"/>
		<updated>2017-03-02T00:21:00Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of Internation GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Now with emissions in progress try various devices and experience the wonders of rf, distance, position orientation, how you hold you hand, etc can all effect the  SNR. It may take some trickery as many receivers have build in processes to speed up signal lock, such as obtaining their own ephemeris etc. For the smart phone Galaxy S4 I put it in airplane mode, restart, open GpsTEST app and altho it found many satellites very fast, it took a long time to actually get a fix. Just found the QStarz snr jumped considerably when a hand is placed slightly behind it. &amp;lt;br/&amp;gt;&lt;br /&gt;
Anyway, here&#039;s the screenshots of simulating location in the Maldives created above, using the QStarz app:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:﻿Maldives_Sats_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Maldives_Map_s1.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=File:Maldives_Map_s1.jpg&amp;diff=1020</id>
		<title>File:Maldives Map s1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=File:Maldives_Map_s1.jpg&amp;diff=1020"/>
		<updated>2017-03-02T00:10:11Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: Map of location in Maldives&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Map of location in Maldives&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=File:Maldives_Sats_s1.jpg&amp;diff=1019</id>
		<title>File:Maldives Sats s1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=File:Maldives_Sats_s1.jpg&amp;diff=1019"/>
		<updated>2017-03-02T00:09:24Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: Satellites seen&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Satellites seen&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1018</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1018"/>
		<updated>2017-03-01T20:27:04Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Execution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of Internation GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, &amp;quot;/home/chuck/src/gps-sdr-sim/gpssim_10M.s8&amp;quot;, False)&lt;br /&gt;
 self.blocks_interleaved_char_to_complex_0 = blocks.interleaved_char_to_complex(False)&lt;br /&gt;
 self.osmosdr_sink_0 = osmosdr.sink( args=&amp;quot;numchan=&amp;quot; + str(1) + &amp;quot; &amp;quot; + &amp;quot;device=soapy,lime=0&amp;quot; ) &lt;br /&gt;
 self.osmosdr_sink_0.set_antenna(&amp;quot;BAND1&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1017</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1017"/>
		<updated>2017-03-01T20:22:22Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Execution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of Internation GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matched can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1016</id>
		<title>GPS Simulation</title>
		<link rel="alternate" type="text/html" href="https://wiki.myriadrf.org/index.php?title=GPS_Simulation&amp;diff=1016"/>
		<updated>2017-03-01T16:51:58Z</updated>

		<summary type="html">&lt;p&gt;Cswiger: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page details experiences using LimeSDR to simulate GPS.&lt;br /&gt;
&lt;br /&gt;
These experiments were inspired by the excellent procedure written up here [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html].&lt;br /&gt;
We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna, and a Galaxy S4 after using airplane mode, restart and patience.  Here I am visiting Trinity College Cambridge. &lt;br /&gt;
&lt;br /&gt;
[[File:TrinityCollege_s1r1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Software to git clone  - https://github.com/osqzss/gps-sdr-sim &amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed. &amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ gcc gpssim.c -lm -O3 -o gps-sdr-sim&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds).  You can increase that to 6000 or more to get longer default running times.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR is known to work with 10e6, and 8 bit interleaved I/Q data format converted to complex float in the graph. That is too slow to generate in real time, depending on your cpu, so one strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [http://sdrgps.blogspot.com/2016/12/gps-fake-out-with-limesdr.html] links to a grc file, or it&#039;s easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [ftp://ftp.unibe.ch/aiub/rinex/rinex211.txt] - especially the file name format). There is a global network of Internation GNSS Service installations [http://www.igs.org/network] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ftp -p cddis.gsfc.nasa.gov&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Login anonymous &#039;ftp&#039; and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&#039;brdc&#039; + &amp;lt;3 digit day of year&amp;gt; + &#039;0.&#039; +  &amp;lt;2 digit year&amp;gt; + &#039;n.Z&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;n&#039; for gps (don&#039;t get the &#039;g&#039; files, that is glonass), and &#039;Z&#039; for compressed. Day of year can be found with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ date +%j&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Get yesterdays - for example, today, Feb 28, 2017, I would get &#039;brdc0580.17n.Z&#039;, uncompress&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ uncompress brdc0580.17n.Z&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Pick a place - All you need now is a location to go, Google maps is good for entering latitude,longitude and seeing where it goes, or pick a spot, right click and pick &amp;quot;Directions to here&amp;quot; and a little url hacking to get the coordinates, like 1.8605853,73.5213033 for a spot in the Maldives.  To do: use the gpssim with a user motion file instead of a static location, there is even support for Google Earth and SatGen software.   &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution ==&lt;br /&gt;
&lt;br /&gt;
Get ready to host some large files, ranging from 5 to 20GB in size, if going with a larger USER_MOTION_SIZE full duration and/or trying 16 bit. Create the rf data file, using 10e6 samples per second in interleaved 8bit I/Q sample format, using the day of year 059 merged broadcast ephemeris file:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ ./gps-sdr-sim -e brdc0590.17n -l 1.8605853,73.5213033,5 -t 2017/02/28,22:00:00 -o gpssim_10M.s8 -s 10e6 -b 8 -v&lt;br /&gt;
Using static location mode.&lt;br /&gt;
     9.313e-09    0.000e+00   -5.960e-08    0.000e+00&lt;br /&gt;
     9.011e+04    0.000e+00   -1.966e+05    0.000e+00&lt;br /&gt;
     1.86264514923e-09   1.77635683940e-15     319488      1938&lt;br /&gt;
    18&lt;br /&gt;
Start time = 2017/02/28,22:00:00 (1938:252000)&lt;br /&gt;
Duration = 600.0 [sec]&lt;br /&gt;
02   78.1   5.0  25142702.4   4.5&lt;br /&gt;
04  305.9  10.6  24630434.2   4.0&lt;br /&gt;
10  244.0  20.9  23656748.6   3.2&lt;br /&gt;
12  174.6  31.9  22801339.9   2.6&lt;br /&gt;
13   59.8  27.2  23001942.1   2.8&lt;br /&gt;
15   80.1  60.3  20615340.0   1.7&lt;br /&gt;
18  273.8  42.7  21969027.9   2.1&lt;br /&gt;
20    3.4  36.7  22141445.5   2.3&lt;br /&gt;
21  322.3  14.4  24860118.2   3.7&lt;br /&gt;
24  152.1  21.2  23574508.7   3.2&lt;br /&gt;
25  227.1  49.6  21537006.8   1.9&lt;br /&gt;
26  310.2   0.2  25799081.3   5.1&lt;br /&gt;
29    2.7  52.0  21259731.6   1.8&lt;br /&gt;
32  211.7   0.4  25733242.7   5.0&lt;br /&gt;
Time into run =  1.6&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then get some coffee - it&#039;s a slow single threaded process which is why we have to create a data file and then transmit it instead of realtime radio broadcast. When done make sure your gnuradio-companion graph is setup with the right source filename, data types, sink driver, antenna, etc.  Anything miss-matches can cause it to frustratingly run but not work. &lt;br /&gt;
[[File:Grc_xmit_only.jpg]]&amp;lt;br/&amp;gt;&lt;br /&gt;
Then click the run button or create top_block.py and run it on the command line and your gps simulated broadcast should be visible to devices a few inches away from the antenna. You can play with various gain settings in the sink block - looks like a setting of &#039;0&#039; sets the power amp driver to -52 db attenuatin and a setting of 10 you get -42 db:&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;[INFO] SoapyLMS7::setGain(Tx, 0, PAD, -42 dB)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Community}}&lt;/div&gt;</summary>
		<author><name>Cswiger</name></author>
	</entry>
</feed>