In the following post, we are going to talk about how to deploy a fully LTE network on your Raspberry PI 4B+

Prerequisites

  • Raspberry PI 4B+ with minimum 4GBi RAM
  • The host should have internet connectivity on eth0
  • Prepare your MicroSD with Fedora 5.13.12-100.fc33.aarch64 from Fedora Download
  • UHD USRP B200 for more information you can check UHD USRP B Series
  • UHD USRP N3000 for more information you can check UHD USRP N Series

Lets start the installation steps:

Preparing the environment

Step 0. Disable the firewall

$ sudo systemctl disable firewalld && sudo systemctl stop firewalld

Step 1. Install upgrade the OS

 sudo dnf upgrade -y  && sudo dnf install cmake fftw3-devel mbedtls-devel lksctp-tools-devel libconfig-devel boost-devel git gcc gcc-c++ -y

Step 2. Install the UHD Drivers for the USRP

For more informations on how to install UHD Drivers on different types of OS check the UHD Documentation.

 sudo yum install uhd uhd-devel -y 

If the above command is not installing the packages its required to define the ettus.repo

 sudo vi /etc/yum.repos.d/ettus.repo

Paste the following content in the files and save the file:

 [ettus-uhd-stable-repo]
  name=Ettus Research - UHD Stable $releasever-$basearchthon serial timeout
  baseurl=http://files.ettus.com/binaries/uhd/repo/uhd/fedora/$releasever/$basearch
  gpgcheck=0

Now to install the required binaries run the following command:

 sudo yum --enablerepo='ettus-uhd-stable-repo' install uhd

Step 3. Verify that the UHD driver is working as expected

Connect the USRP device to the Raspberry PI. In this example we are going to use a USRP B200mini for SDR component.Use the usb-3.0 cable or the ethernet cable and run the following command.

sudo uhd_find_devices

Make sure that you have the same or a similar output from the command.

[INFO] [UHD] linux; GNU C++ version 10.2.1 20200804 (Red Hat 10.2.1-2); Boost_107300; UHD_3.15.0.0
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
   serial: 315A8CF
   name: B200mini
   product: B200mini
   type: b200

Step 4. Download the LTE binary components

We are going to place all the binaries required for srs under the /usr/local/bin/

 wget https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/aarch64/srsenb
 wget https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/aarch64/srsepc
 wget https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/aarch64/srslte_install_configs.sh

Move the files from the current directory under the /usr/local/bin/

 sudo mv srsenb /usr/local/bin/srsenb ; sudo chmod a+x /usr/local/bin/srsenb
 sudo mv srsepc /usr/local/bin/srsepc ; sudo chmod a+x /usr/local/bin/srsepc
 sudo mv srslte_install_configs.sh /usr/local/bin/srslte_install_configs.sh ; sudo chmod a+x /usr/local/bin/srslte_install_configs.sh

Make sure that you have the following library configuration set in your .bashrc file:

export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib64:/usr/local/lib64/libsrslte_rf.so.0"

Step 5. Download the srs conf files

 mkdir -p /etc/srslte/
 curl -o /etc/srslte/enb.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/enb.conf
 curl -o /etc/srslte/epc.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/epc.conf
 curl -o /etc/srslte/mbms.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/mbms.conf
 curl -o /etc/srslte/rr.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/rr.conf
 curl -o /etc/srslte/sib.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/sib.conf
 curl -o /etc/srslte/user_db.csv https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/user_db.csv
 curl -o /etc/srslte/drb.conf https://github.com/midu16/midu16.github.io/blob/main/assets/binaries/srs/configs/drb.conf
 sudo chmod 775 /etc/srslte/*

Step 6. Running the application

Open two terminal connections to your Raspberry PI 4B+

Terminal number 1:

 sudo srsepc

The command will generate the following output:

Built in Release mode using 20.10.1.


---  Software Radio Systems EPC  ---

Reading configuration file /etc/srslte/epc.conf...
HSS Initialized.
Failed to open file "/tmp/epc.pcap" for writing
MME S11 Initialized
MME GTP-C Initialized
MME Initialized. MCC: 0xf901, MNC: 0xff70
SPGW GTP-U Initialized.
SPGW S11 Initialized.
SP-GW Initialized.
Received S1 Setup Request.
S1 Setup Request - eNB Name: srsenb01, eNB id: 0x19b
S1 Setup Request - MCC:901, MNC:70
S1 Setup Request - TAC 7, B-PLMN 0x9f107
S1 Setup Request - Paging DRX v128
Sending S1 Setup Response

Terminal number 2:

Before starting the srsenb we should masquarade the SGi interface to the eth0 of the Raspberry PI 4B+ interface:

 sudo srsepc_if_masq.sh eth0

Now we can start the srsenb:

 srsenb

The command will generate the following output:

---  Software Radio Systems LTE eNodeB  ---
Reading configuration file /etc/srslte/enb.conf...
Built in Release mode using 20.10.1.
/home/midu/Desktop/srsLTE-release_20_10_1/srsenb/src/enb_cfg_parser.cc.890: Force DL EARFCN for cell PCI=1 to 1934
Opening 1 channels in RF device=UHD with args=default
[INFO] [UHD] linux; GNU C++ version 10.2.1 20200804 (Red Hat 10.2.1-2); Boost_107300; UHD_3.15.0.0
[INFO] [LOGGING] Fastpath logging disabled at runtime.
Opening USRP channels=1, args: type=b200,master_clock_rate=23.04e6
[INFO] [B200] Detected Device: B200mini
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Asking for clock rate 23.040000 MHz...
[INFO] [B200] Actually got clock rate 23.040000 MHz.
Setting frequency: DL=1878.4 Mhz, UL=1783.4 MHz for cc_idx=0


==== eNodeB started ===
Type <t> to view trace