Running osmo nitb on LimeSDR USB with Ubuntu 18.04 - Chapoly1305/sdr GitHub Wiki

Table of Contents

Introduction

NOTE: Prior to actually running the network, please refer to the CAUTION note in the Running paragraph. Use the tutorial at your own risk!

This wiki page describes what I did to run osmo-nitb (Osmocom Network in the Box) on a LimeSDR-USB board. I used Xubuntu 18.04 running inside a VirtualBox VM. The host box is Xubuntu 16.04 LTS. The setup can be replicated on a host machine.

The osmo-nitb project's page is located here: https://osmocom.org/projects/osmonitb/wiki/OsmoNITB

Prerequisites

Linux Users

The procedures are executed via a non-root user. If root privileges are required, sudo is used.

USB 3.0 Connection to LimeSDR-USB

I have tested the setup via the USB 3.0 connection to LimeSDR-USB. Cannot confirm if it works with USB 2.0 .

Usage of MyriadRF PPAs

Please use MyriardRF's PPA (described later) and not Lime Snap packages. Please run the procedures in this wiki page on a clean system (no other Lime/UHD/Soapy/GNURadio/Osmocom stuff has been installed).

VirtualBox USB 3.0 Support

If you plan to run this setup in a VirtualBox machine (as I did), please install the VirtualBox Extension Pack on your host as described here: https://www.virtualbox.org/wiki/Downloads

Installation

The following paragraphs describe the steps needed on the machine that's going to run osmo-nitb (host or VM). If you are running in a VM, please execute the steps in the VM and not on the host.

Common Packages

Not mandatory but suggested to install the following packages:

sudo apt-get install git g++ gcc make python3 python3-pip

USB rules for udev

In order to be able to access the LimeSDR-USB over USB without root privileges, please install the following package and then restart the system:

sudo apt-get install limesuite-udev
sudo reboot

MyriadRF PPA

MyriadRF provide a repository with latest version of drivers tools and apps for LimeSDR. To enable this repository (Ubuntu PPA), please execute the following steps (also described in https://wiki.myriadrf.org/Packaging):

sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:ettusresearch/uhd
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo apt-get update

Updating to Latest LimeSDR Firmware

In order for the setup to work correctly and have a version match between the tools/libraries/drivers and the firmware on the LimeSDR, please update the firmware by installing LimeSuiteGUI:

sudo apt-get install limesuite

Run it:

LimeUtil --update

If the firmware of your device is the latest, you will see

Connected to [LimeSDR-USB [USB 3.0] 9081C05C32C37]
Existing firmware is same as update (4)
Existing gateware is same as update (2.23)
Firmware and Gateware update is not required.
Programming update complete!

Installing Soapy Libraries

UHD is no longer required, the LimeSDR is now supported natively.

Soapy are described as follows by Ubuntu's package descriptions:

SoapySDR is a library providing a common interface to SDR (software
defined radio) hardware. Support for different hardware is added through
external modules.

Therefore, SoapySDR will allow us to access LimeSDR through the Soapy API.

The resulting stack is also briefly described here: http://osmocom.org/projects/osmotrx/wiki/LimeSDR

Begin by installing the following packages:

sudo apt-get install soapysdr soapysdr-module-lms7

To verify that it works as expected, please execute:

SoapySDRUtil --find - you should see something like the below if your SoapySDR installation works correctly:

Found device 0
  addr = 1d50:6108
  driver = lime
  label = LimeSDR-USB [USB 3.0] 9081C05C32C37
  media = USB 3.0
  module = FX3
  name = LimeSDR-USB
  serial = 0009081C05C32C37

Installing osmo-nitb

The osmo-nitb software can be installed from the nightly Ubuntu 18.04 builds. osmo-bts-trx now supports Limesdr, so no longer need to compile it from scratch.

References:

https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.04/

To add the Osmocom repository, please execute the following steps:

wget --https-only https://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_18.04/Release.key
sudo apt-key add Release.key
sudo su
echo "deb https://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_18.04/ ./" > /etc/apt/sources.list.d/osmocom-latest.list
exit

sudo apt-get update
sudo apt-get install osmocom-nitb osmo-bts-trx osmo-trx-lms

# You will need to manually stop and disable the osmo-bts-trx or the ports will be occupied by this service.
# You might also need to reboot to make it effective
sudo systemctl stop osmo-bts-trx
sudo systemctl disable osmo-bts-trx

# Select LimeSDR or UHD by renaming the default config file. 
sudo mv /etc/osmocom/osmo-trx-lms.cfg /etc/osmocom/osmo-trx.cfg

# Optional: I have prepared 3 config files for your reference, you don't have to use these files.
git clone https://github.com/Ghost-Assassin/sdr.git
sudo cp ./sdr/osmo-nitb-limesdr/* /etc/osmocom/

We are installing two Osmocom packages:

  • osmocom-nitb - the "network-in-the-box" packages - contains a full GSM core network (MSC, HLR, SMSC, etc.) and a Base Station Controller (BSC)
  • osmo-bts-trx - Base Transceiver Station (BTS) that works with the osmo-trx TRX software. The TRX software acts as a Layer 1 device (modem) using the LimeSDR.

Configuration

We need to configure the osmo-nitb and osmo-bts-trx components. The following setup configures the network in the GSM 850 band as an example. Please be careful when choosing bands - take current commercial networks into consideration in your area as well as local radio frequency allocation (in case the band you choose is reserved for us by another radio system).

Configuring osmo-nitb

The osmo-nitb component uses a configuration file with CLI commands that it loads on startup. Options can be changed through a Telnet CLI too, similar to Cisco equipment. The file is named openbsc.cfg .

An example openbsc.cfg configuration file: https://github.com/dartdart26/sdr/blob/master/osmo-nitb-limesdr/openbsc.cfg

Please note the following lines:

network country code - MCC to use for the network (e.g. 284 for Bulgaria)

mobile network code - MCC to use for the network - please select an unused value for your country

band GSM850 - the GSM band to use, please change accordingly

ip.access unit_id 1801 0 - please note the 1801 value - this ID must match the one configured in the osmo-bts.cfg file

arfcn 172 - the ARFCN option selects which channel in the configured band the network is going to use, please see below

In order to select a correct ARFCN value, please use an ARFCN calculator, e.g. : https://www.sqimway.com/gsm_band.php

Configuring osmo-bts-trx

The osmo-bts-trx component (the BTS) is configured in a similar way to the osmo-nitb component. The configuration file is named osmo-bts-trx.cfg . An example file: https://github.com/dartdart26/sdr/blob/master/osmo-nitb-limesdr/osmo-bts.cfg

Please note the following lines:

band GSM850 - please configure the same band as in the openbsc.cfg file

ipa unit-id 1801 0 - please match the 1801 ID with the same ID in openbsc.cfg file

Running the Network

CAUTION: Please only run the setup if you have ensured that you will not interfere with production GSM networks or other radio systems operating in your area! If you can't select such bands in your area, either use a Faraday cage or attenuators (hard to do on a mobile phone...) . I am not an expert on RF, but I am thinking that if Osmocom doesn't support MS power control, even if LimeSDR is low power, the MS might not be. Bottom line - please use at your own risk and please try to ensure you will not interfere with other systems.

Now we are finally ready to run the network! Please execute in the given order.

sudo osmo-trx-lms -C /etc/osmocom/osmo-trx.cfg # root needed for thread options set by the process

osmo-nitb -c /etc/osmocom/openbsc.cfg # change the path to your openbsc.cfg file

osmo-bts-trx -c /etc/osmocom/osmo-bts.cfg

Once the 3 processes are running, please select 2G only or similar on your mobile and search for networks. Hopefully, you will see the network and you can now try to attach to it.

Hints

When attached to the network, you can use the *#100# USSD code to request your MSISDN (telephone number). Then, you can try calling other phones on the network or sending SMS messages to them.