Setting up the BTS

From Rhizomatica Wiki
Revision as of 23:55, 24 March 2016 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Other languages:
English • ‎español

Connect the antennas:

Transmitting antenna should be be dual band / receiving doesn't matter.

We recommend using an attenuator like this one [1]. Or let the BTS emit some of that good old radiation until you can figure out how to turn off the amps!

On work machine

Create shared ethernet connection: set ipv4 settings to "Shared to other computers"

Get the 2 ips from the BTS:

 arp -n #shows arp table

turn on bts - will assign ip to bts

 arp-n # will now show 2 new ips, probably on eth0  (of each bts in box)

ipaccess-find can also be used to find BTSs on an interface:

 $ ipaccess-find eth0
 ipaccess-find (C) 2009 by Harald Welte
 Trying to find ip.access BTS by broadcast UDP...
 MAC_Address='24:62:78:00:00:5a'  IP_Address=''  Serial_Number='162'  Unit_ID='sysmoBTS 1002'

log into BTS:

 ssh root@IP #either new IP address from 2nd arp -n

check power status:

 sbts2050-util sbts2050-pwr-status


root@NTQ0107973S:~# sbts2050-util sbts2050-pwr-status
Main Supply :(ON)  [(24.00)Vdc, 1.34 A]
Master SF   : ON   [  4.97 Vdc, 0.97 A]
Slave SF    : ON   [  4.97 Vdc, 0.91 A]
Power Amp   : ON   [ 24.75 Vdc, 0.77 A]
PA Bias: ON   [  9.00 Vdc, ---- A]

(this power amp is ON!)

turn off power amplifier

 sbts2050-util sbts2050-pwr-enable 1 1 0  #1 1 0 = master slave amplifier

For power amp to be off this should be:

root@NTQ0107973S:~# sbts2050-util sbts2050-pwr-status
Main Supply :(ON)  [(24.00)Vdc, 0.56 A]
Master SF   : ON   [  4.94 Vdc, 0.98 A]
Slave SF    : ON   [  4.97 Vdc, 0.91 A]
Power Amp   : OFF  [ 10.75 Vdc, 0.05 A]
PA Bias: OFF  [  0.00 Vdc, ---- A]  #means power amp is OFF!

sbts2050-util sbts2050-temp 

- during troubleshooting : 75C is pretty high, 50-60C is normal

sysmobts-util :

This is the sysmoBTS utility cli thing:

 sysmobts-util trx-nr #shows which transceiver we are on (0 master, 1 slave)

Possible param names: ethaddr clk-factory temp-dig-max temp-rf-max serial-nr hours-running boot-count key model-nr model-flags trx-nr

Run the script

On the work machine copy the following code into a file called

#!/usr/bin/fab -f
Rhizomatica BTS Toolkit

Automate maintenance on the BTS

import sys
from fabric.api import env, run, task

def ssh():
    env.user = 'root'
    env.password = ''

def setup():
    run('sbts2050-util sbts2050-pwr-enable 1 1 0')
    run('sed -i s/NO_START=0/NO_START=1/ /etc/default/osmo-nitb')
    run('mv /etc/rc5.d/ /home/root/ || true')
    run('mv /etc/rc5.d/S30osmo-bsc /etc/rc5.d/K30osmo-bsc || true')
    run('mv /etc/rc5.d/S30osmo-bsc-mgcp /etc/rc5.d/K30osmo-bsc-mgcp || true')
    run('mv /etc/rc5.d/S30osmo-nitb /etc/rc5.d/K30osmo-nitb || true')
    run('sed -i -e "s/sysmobts-2050\/201208\//sysmobts-2050\/201208-testing\//g" /etc/opkg/*')
    run('opkg remove openggsn osmo-sgsn lcr')
    run('opkg update')
    run('opkg upgrade || true')
    run('opkg upgrade')

    trx_nr = int(run('sysmobts-util trx-nr'))

def osmo(trx_nr):
    etc_osmo_bts = """
! OsmoBTS () configuration saved from vty
log stderr
  logging color 0
  logging timestamp 0
  logging level all everything
  logging level rsl info
  logging level oml info
  logging level rll notice
  logging level rr notice
  logging level meas notice
  logging level pag info
  logging level l1c info
  logging level l1p info
  logging level dsp debug
  logging level abis notice
line vty
 no login
bts 0
  band 850
  ipa unit-id 1000 %(trx_nr)d
  oml remote-ip
    """ % {'trx_nr': trx_nr}
    run("echo '%s' > /etc/osmocom/osmo-bts.cfg" % (etc_osmo_bts,))

def network(trx_nr):
    if trx_nr == 0:
        ip = ""  # master
        ip = ""  # slave

    interfaces = """
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address %s
    """ % (ip,)
    run("echo '%s' > /etc/network/interfaces" % (interfaces,))

def help():
    print "%s -H bts_ip setup" % (sys.argv[0],)

Make it executable and then run it:

  chmod +x # makes the scripts executable
 ./ -H btsip setup

wait a while until finished, then do it on the other bts

when both are done, ssh into each box and reboot both of them

Upon reboot, DHCP issued IP will be replaced by a static ip for each: and

The BTS LED should now show only if BSC is connected

Copy keys to BTS from BSC

from inside BSC: ssh-copy-id root@


☎☎ make some calls! ☎☎


Crashing network script:

Problem: Sometimes has trouble with updating packages.

ssh into the BTS and run package scripts by hand:

opkg update opkg upgrade

go back and run the script again.

Quick and dirty fix

That is caused by some SSL/HTTPS misconfiguration. Quick and dirty way to fix it:

sed -i -e 's/https/http/g' /etc/opkg/*.conf

Malconfigured IP Address (still looking for IP via DHCP)

How to look for DHCP and/or ARP packets: tcpdump -v -n -i eth1 port 67 or port 68 or arp

Configure the network in /etc/dhcp/dhcpd.conf, rebooted the secondary BTS, it might have something like assigned. Ssh into it, configure /etc/network/interfaces manually, adding:


as the last line. also:

echo "nameserver" > /etc/resolv.conf

Reboot it, then copy on the BSC and run it against the secondary BTS (who was now on

BTS Can't get to the internets - opkg fails

Check if BTS can connect:


BTS probably needs a gateway:

change ip to 192.168.x.x range (if that's a succesful gateway - try route -n on a computer with working internet)

ifconfig eth0

reconnect again with the new ip:

ssh root@

now add a gateway on the same subnet that works:

route add default gw

you might want add nameserveer to resolve.conf:

vi /etc/resolv.conf



now try to ping google or run opkg update.

If it works, run the setup script at the new ip:

./ -H setup