Project

General

Profile

osmo-bts-sysmo-remote / l1fw-proxy

By making use of the Layer1 Forwarding it is possible to run the osmo-bts-sysmo and osmo-pcu processes
off of the sysmoBTS hardware.

This can be of great help debugging as:

  • It is not necessary to cross compile and copy the binary to the sysmoBTS hardware
  • Debugging may be much easier on a more powerful platform as the sysmoBTS does not have sufficient storage space for all the debugging symbols and tools required.

Possible issues:

  • Some latency may be introduced (I do not know if this can become a significant issue on a LAN)

How to prepare the sysmoBTS

Create a systemd service file for the Layer 1 proxy. This is the only process that will run on the sysmoBTS hardware, so you should

systemctl stop osmo-bts
systemctl stop osmo-pcu

You may want to also disable these services so they do not restart on next boot.

systemctl disable osmo-bts
systemctl disable osmo-pcu

Create a systemd service file: /lib/systemd/system/l1fwd.service

[Unit]
Description=Layer 1 forwarding for sysmocom sysmoBTS

[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/l1fwd-proxy
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
Restart=always
RestartSec=2
RestartPreventExitStatus=1

# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1

[Install]
WantedBy=multi-user.target

Start this service:

systemctl daemon-reload
systemctl enable l1fwd
systemctl start l1fwd

Local Machine.

At the time of writing, you will need to make some minor changes to the source code, then compile and run osmo-bts-sysmo-remote:

This is because the program expects to be able to read the eeprom at /sys/bus/i2c/devices/i2c-1/1-0050/eeprom and this path is unlikely to exist on your local machine.
If osmo-bts cannot read the eeprom, it will be unable to read the band support and calibration data and will refuse to start up.

For help builidng, follow the instructions here: https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source

You need to patch the following files to change the location where the program will expect to find the eeprom

/src/osmo-bts-sysmo/eeprom.c
/src/osmo-bts-sysmo/misc/sysmobts_par.c

change

#define EEPROM_DEV

and

#define EEPROM_PATH

to point to a location on the local machine, /tmp/eeprom maybe?

Copy the eeprom from your sysmoBTS to this location.

Do something like:

dd if=/sys/bus/i2c/devices/i2c-1/1-0050/eeprom of=/tmp/eeprom

on the sysmoBTS

and then

scp root@bts_ip:/tmp/eeprom /tmp

or your local machine.

You need to set environment variable L1FWD_BTS_HOST to point to the IP of your bts.

So for example

export L1FWD_BTS_HOST=192.168.1.10
./src/osmo-bts-sysmo/osmo-bts-sysmo-remote -c /path/to/osmo-bts-sysmo.cfg

or simply:

L1FWD_BTS_HOST=192.168.1.10 ./src/osmo-bts-sysmo/osmo-bts-sysmo-remote -c /path/to/osmo-bts-sysmo.cfg

Note: It is also possible to run osmo-pcu-remote in the same manner, (and run osmo-bts-sysmo-remote with the -M flag.)

Add picture from clipboard (Maximum size: 48.8 MB)