Skip to content
22.05.2015 / Fliker09

How to become independent mobile operator (USRP B200 + OpenBTS)

Today me and my colleague made an experiment — we tried getting up our own mobile base station. We succeeded! In order to save this success I decided write it down for future reference. Lets start!

First thing to mention is PC configuration. As far as we know it should run on Beagle Bone Black with Debian 7 Wheezy (with some small tweaks) and, in our case, PC x86_64 with Ubuntu 12.04. We will try later to run on Banana Pi with Lubuntu 14.12 and PC x86_64 with Ubuntu 15.04; I will update this article correspondingly. Bear in mind that we succeeded only with voice calls — SMS, GPRS and VoIP are waiting for our configuration and testing, but AFAIK it should work. OK, now let’s get to the dirty work!

The usual thing — update the packages DB:

sudo apt-get update

Install required packages:

sudo apt-get install nano bash-completion libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-thread-dev libboost-test-dev subversion git build-essential cmake python-dev autoconf libtool libosip2-dev libusb-dev sqlite3 libsqlite3-dev libreadline6-dev libncurses5-dev python-cheetah php5 php5-cgi libapache2-mod-php5 libusb-1.0.0-dev libortp-dev asterisk

Pretty crazy mix, but I didn’t look thoroughly — just used the one I found. Now let’s create a working directory and switch to it:

mkdir ~/src
cd ~/src

In order to use SDR devices, in our case USRP B200, we need UHD. In case of Ubuntu 12.04 running on PC x86_64 we can skip compilation — DEB packet exists:

sudo dpkg -i uhd_003.008.004-release_Ubuntu-12.04-x86_64.deb
sudo apt-get -f install

For BBB you need to compile… Sad but fact:

git clone git://
cd uhd/host
mkdir build
cd build
sudo make install
cd ../../..
sudo /usr/local/lib/uhd/utils/

The stock transceiver application coming with OpenBTS didn’t work well for us (and won’t work at all on BBB), so we will use osmo-trx:

git clone git://
cd osmo-trx
autoreconf -i
./configure #for BBB: ./configure --with-neon
sudo make install
cd ..

It’s time to get the OpenBTS itself!

svn co openbts

We need a53 library first:

cd openbts/a53/trunk
sudo make install
cd ../../..

Compile OpenBTS:

#For BBB we need to tweak a file:
sed -i s/AM_CFLAGS\ \=\ \$\(STD_DEFINES_AND_INCLUDES\)\ \-std\=gnu99\ \-march\=native/AM_CFLAGS\ \=\ \$\(STD_DEFINES_AND_INCLUDES\)\ \-std\=gnu99\ \-march\=armv7\-a/ openbts/openbts/trunk/Transceiver52M/
#Now to the dirty part:
cd openbts/openbts/trunk
autoreconf -i
./configure --with-uhd

OpenBTS needs to be configured, through DB:

sudo mkdir /etc/OpenBTS
sudo sqlite3 -init apps/OpenBTS.example.sql /etc/OpenBTS/OpenBTS.db ".quit"
cd ../..

For subscriber registration we need sipauthserve:

sudo mkdir -p /var/lib/asterisk/sqlite3dir
cd subscriberRegistry/trunk
sudo sqlite3 -init subscriberRegistry.example.sql /etc/OpenBTS/sipauthserve.db ".quit"
cd ../..

Message manager is needed! Compile smqueue:

cd smqueue/trunk
autoreconf -i
sudo sqlite3 -init smqueue/smqueue.example.sql /etc/OpenBTS/smqueue.db ".quit"
cd ~

Final assembling step:

mkdir bin
cd bin
cp ../src/openbts/smqueue/trunk/smqueue/smqueue .
cp ../src/openbts/subscriberRegistry/trunk/sipauthserve .
cp ../src/openbts/openbts/trunk/apps/{OpenBTS,OpenBTSCLI} .

First thing to do after all this pain — run the connection with our SDR device:

sudo osmo-trx -f

We can now run OpenBTS bundle:

sudo su
./smqueue &
./sipauthserve &

If OpenBTS doesn’t exit and you see something like this:

system ready
use the OpenBTSCLI utility to access CLI

it means the system is up and needs just final touches. Let’s do it!

sudo ./OpenBTSCLI
config Control.LUR.OpenRegistration .* # everybody will be able to connect to your network!
config GSM.Identity.MNC 07 #7, or something bigger, because you don't want to have the same code as one of the already existing GSM operators in your region
config GSM.Identity.MCC 262 #set it accordingly to your country!
config GSM.Radio.C0 85 #channel 85. Why? Good question!
sudo killall OpenBTS
sudo ./OpenBTS

Now take your phone and connect to your newly created mobile base station! You will receive shortly a SMS with your IMSI — you will need it for further configuration. Last step — we need Asterisk to server our voice calls:

sudo mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.backup
sudo mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.backup
sudo nano /etc/asterisk/extensions.conf #copy the content from here:
sudo nano /etc/asterisk/sip.conf #copy the content from here:

Modify IMSI codes to the corresponding ones and change callerid to the desired ones. Final command:

sudo service asterisk restart

Make your first call and cry like a child! To be completed…


Добавить комментарий

Заполните поля или щелкните по значку, чтобы оставить свой комментарий:


Для комментария используется ваша учётная запись Выход / Изменить )

Фотография Twitter

Для комментария используется ваша учётная запись Twitter. Выход / Изменить )

Фотография Facebook

Для комментария используется ваша учётная запись Facebook. Выход / Изменить )

Google+ photo

Для комментария используется ваша учётная запись Google+. Выход / Изменить )

Connecting to %s

%d такие блоггеры, как: