GSM with Osmocom Part 5: Software BTS with LimeSDR & osmo-bts-trx

Osmo-BSC accepts Abis over IP connections from a number of different sources,

There’s a list of supported BTS hardware that can talk out of the box to the Osmo-BSC, such as the Ericsson RBS series, ip.access nanoBTS, Nokia and Siemens units and even a virtual BTS so you can simulate the connections.

If you’re using any of these premade BTS hardware options, or osmo-bts-virtual, you probably just need to setup the basics on your BTS and point it to your BSC, end of story.

The below post will touch on using common SDR hardware to act as our BTS. If you’re not using SDR hardware you can just skip ahead to the next post on BSCs.

But, if you’re in the same boat as me, without any commercial BTS / RAN hardware, we’ll be setting it up by using an SDR platforms (In my case LimeSDR) and that’s what this tutorial will focus on.

Osmo-TRX

In order to bring in a large array of SDR hardware, Osmocom have introduced Osmo-TRX, which handles the Layer 1 physical layer of the BTS, and connects to Osmo-BTS which serves as the BTS and talks Abis over IP to the MSC.

Certain hardware can talk directly to Osmo-BTS, but we’re going to rely on Osmo-TRX to act as the middleman between our SDR hardware and the BTS.

The above diagram from the Osmocom wiki shows how this fits together with generic SDR platforms, here’s how it fits together for us:

osmo-trx-lms will take care of the SDR side of the equation, pretty much serving as a modem and sending everything it gets on the Uu interface to osmo-bts-trx over UDP, and everything it receives from osmo-bts-trx over UDP it sends out the Uu interface.

osmo-bts-trx will then setup an Abis over IP connection to our BSC.

The LimeSDR

My ever growing collection of SDR hardware now includes a LimeSDR which I’ll be using for this series.

Before we can get too far we’ve got to setup the prerequisites for the LimeSDR to be able to interface with Osmo-TRX.

Osmocom now provide a binary for interfacing with LimeSDR boards directly, instead of having to use the UHD abstraction. This is a much cleaner way of interfacing with the boards and the path I’ll be taking.

Software Install

For this tutorial series I’ll be using Ubuntu 18.04 and trying where possible to use packages from Repos instead of compiling from source.

LimeSuite provides the drives and utilities for interfacing with the LimeSDR.

add-apt-repository -y ppa:myriadrf/drivers
apt-get update
apt-get install limesuite limesuite-udev

Next we’ll connect up the LimeSDR to a USB3 port, confirm it’s there and upgrade it’s firmware:

 LimeUtil --find

Assuming your LimeSDR is hooked up and everything installed you should see an output similar to this:

In which case we can upgrade the LimeSDR firmware with:

LimeUtil --update  

Next we’ll start installing Osmocom Sources;

wget https://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_10/Release.key  
apt-key add Release.key && rm Release.key
echo "deb https://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_18.04/ ./" > /etc/apt/sources.list.d/osmocom-latest.list 
apt-get update

Now that we’ve got the Osmocom Debian repos added we can install the packages we need,

We’re going to install Osmo-BTS-TRX for talking to the BSC over Abis, and install Osmo-TRX-LMS for talking to the SDR.

apt-get install osmo-bts-trx osmo-trx-lms

After you’ve installed the packages, Osmo-BTS-TRX will run as a daemon, we’ll stop it for now and bring it up manually in the foreground.

systemctl disable osmo-bts-trx
systemctl disable osmo-trx-bts

Software Config

So now we’ve got two pieces of the puzzle, it’s time to connect the SDR to Osmo-TRX-LMS and connect Osmo-TRX-LMS to Osmo-BTS-TRX.

We’ll begin by running Osmo-TRX-LMS to connect to the LimeSDR and encapsulate the Uu data into UDP packets we send to Osmo-BTS-TRX.

Config files for Osmocom are installed in /etc/osmocom/ so we’ll run everything from that directory.

osmo-trx-lms -C osmo-trx-lms.cfg

If all was successful you’ll see something similar to what I’ve got below, showing Osmo-TRX-LMS has connected to the SDR and is ready to go.

But if you go scanning the airwaves now, you won’t see any data coming out of the SDR’s transmitter.

That’s because Osmo-TRX-LMS needs to connect to Osmo-BTS-TRX,

We’ll leave Osmo-TRX-LMS running, so let’s open up another session and start Osmo-BTS-TRX.

osmo-bts-trx -c osmo-bts-trx.cfg

You’ll see for starters that it’s Opened our transceiver (hooray),

You’ll see this reflected in the Osmo-TRX-LMS stdout, but it’ll show the poweroff command has been sent to it, so what gives?

Well, the answer becomes clear if you leave Osmo-BTS-TRX running for a minute or two,

Eventually the process stops, reporting:

<000d> abis.c:142 Signalling link down
<0001> bts.c:292 Shutting down BTS 0, Reason Abis close

So what’s going on? In the same way we saw our Virtual BTS shut itself down, without a connection to the BSC (Via the Abis interface) the BTS will shut itself down, as it’s not able to run on it’s own.

This took me a shamefully long time to work out that’s why it was stopping…

In our next post we’ll introduce our BSC and provision a BTS on it.

Further Reading:

OsmoTRX – Osmocom Wiki

OsmoBTS – OsmocomWiki

LimeSDR – Osmocom Wiki

5 thoughts on “GSM with Osmocom Part 5: Software BTS with LimeSDR & osmo-bts-trx

  1. Hi. thanks for your good instruction.
    What is oml address(192.168.122.1)? if i installed all trx,bts, and msc on a same machine what should it set?

  2. Hello. I tried to connect usrp 210 to osmo-trx-uhd. uhd is installed and find usrp correctly. my log when run osm-trx-uhd is as bello. is it ok?why it show not any information about usrp ?

    osmo-trx-uhd -C osmo-trx-uhd.cfg
    Mon Jul 22 07:17:58 2024 DLGLOBAL cpu_sched_vty.c:471 Setting SCHED_RR priority 18
    Mon Jul 22 07:17:58 2024 DLGLOBAL telnet_interface.c:88 Available via telnet 127.0.0.1 4237
    Mon Jul 22 07:17:58 2024 DLCTRL control_if.c:1014 CTRL at 127.0.0.1 4236
    Mon Jul 22 07:18:01 2024 DDEVDRV gps_ctrl.cpp:167 [GPS] update_cache: Malformed GPSDO string: GPSTCXO, Firmware Rev 0.929b
    Mon Jul 22 07:18:04 2024 DMAIN osmo-trx.cpp:621 — Transceiver active with 1 channel(s)
    Mon Jul 22 07:18:04 2024 DLSTATS stats.c:169 Stats timer expire_count=2: We missed 1 timers
    Mon Jul 22 07:18:04 2024 DLGLOBAL rate_ctr.c:350 Stats timer expire_count=5: We missed 4 timers

  3. This is my log when run bts-trx. is it ok?
    osmo-bts-trx -c osmo-bts-trx.cfg
    ((*))
    |
    / \ OsmoBTS
    control_if.c:1014 CTRL at 127.0.0.1 4238
    telnet_interface.c:88 Available via telnet 127.0.0.1 4241
    input/ipaccess.c:1099 enabling ipaccess BTS mode, OML connecting to 192.168.75.190:3002
    trx_if.c:1267 phy0.0: Opening TRXC/TRXD connections to 127.0.0.1
    input/ipa.c:141 192.168.75.190:3002 connection done
    input/ipaccess.c:612 TCP Keepalive is enabled
    input/ipaccess.c:624 TCP keepalive idle_timeout=30s, interval=3s, retry_count=10 user_timeout=330000ms
    input/ipaccess.c:920 received ID_GET for unit ID 6969/0/0
    oml.c:277 O&M Get Attributes [2], unknown 0xa7 is unsupported by BTS
    oml.c:1166 OC=RADIO-CARRIER(02) INST=(00,00,ff): ADM STATE Locked -> Unlocked
    oml.c:238 (bts=0,trx=0): O&M Get Attributes [0], Manufacturer Dependent State is unsupported by TRX
    oml.c:238 (bts=0,trx=0): O&M Get Attributes [2], unknown 0xa7 is unsupported by TRX
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,00): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,01): ADM STATE Locked -> Unlocked
    trx_if.c:694 phy0.0: Discarding duplicated RSP from old CMD ‘RSP SETFORMAT 1 1’
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,02): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,03): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,04): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,05): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,06): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=CHANNEL(03) INST=(00,00,07): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=GPRS-NSE(f0) INST=(00,ff,ff): ADM STATE Locked -> Unlocked
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[0] (150 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[1] (180 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[2] (180 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[3] (1680 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[4] (520 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[5] (165 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:684 OC=BTS(01) INST=(00,ff,ff): Ignoring T200[6] (1680 ms) as sent by BSC due to suspected LAPDm bug!
    oml.c:1166 OC=BASEBAND-TRANSCEIVER(04) INST=(00,00,ff): ADM STATE Locked -> Unlocked
    oml.c:1166 OC=BTS(01) INST=(00,ff,ff): ADM STATE Locked -> Unlocked
    input/ipa.c:141 192.168.75.190:3003 connection done
    input/ipaccess.c:612 TCP Keepalive is enabled
    input/ipaccess.c:624 TCP keepalive idle_timeout=30s, interval=3s, retry_count=10 user_timeout=330000ms
    input/ipaccess.c:920 received ID_GET for unit ID 6969/0/0
    pcu_sock.c:1018 PCU socket not connected, dropping message
    pcu_sock.c:830 Failed to send SI1 to PCU: rc=-5
    pcu_sock.c:1018 PCU socket not connected, dropping message
    pcu_sock.c:830 Failed to send SI2 to PCU: rc=-5
    pcu_sock.c:1018 PCU socket not connected, dropping message
    pcu_sock.c:830 Failed to send SI3 to PCU: rc=-5
    trx_if.c:708 phy0.0: Discarding duplicated RSP from old CMD ‘RSP POWERON 0’
    trx_if.c:708 phy0.0: Discarding duplicated RSP from old CMD ‘RSP SETSLOT 0 0 5’

Leave a Reply

Your email address will not be published. Required fields are marked *