wiki:OpenBTS

Orbit + OpenBTS

All that you will need to create a tiny GSM network using Orbit Hardware is a GSM Phone, any SIM Card and the OpenBTS software. Actually you need a few more pieces of software but they are included in the steps below. The additional software is Asterisk which handles Voice over IP, you need Asterisk because OpenBTS "just" implements the GSM wireless communication between the phone and the base station, but asterisk stitches voice calls together using the TCP/IP stack. Additional software also includes SMQueue to give you Text Messaging and the NMCli.py software makes it easy to add "subscribers" to your tiny GSM network, we will also install SIPAUTHSERVE.

The following book was my guide when I was doing this install → http://openbts.org/site/wp-content/uploads/ebook/Getting_Started_with_OpenBTS_Range_Networks.pdf

The first thing you should ask is → Which SDR's does OpenBTS support for GSM? → http://openbts.org/w/index.php/RadioIntegration

I have had all of my success with the N210, which was available on Orbit Sandbox 3 at the time of writing this article. How did I know the N210 was available on SB3? → If you can find the "Orbit Online Scheduler" then you should be able to find the "Orbit Status Page", you can ask the "Orbit Status Page", "On which nodes is the N210 installed?"

Once you know which box is hosting your target SDR, the next thing you should do is to verify that the SDR is working on your target box.

Starting from scratch, let's make sure we start with an Image that already has SDR support:

davemsolomon@console.sb3:~$ omf load -t node1-1 -i ubuntu-14-04-64bit-sdr.ndz
davemsolomon@console.sb3:~$ omf tell -a on -t node1-1

SSH to the target box with the SDR:

davemsolomon@console.sb3:~$ ssh root@node1-1

Before doing anything with OpenBTS, make sure the SDR is happy:

root@node1-1:~# uhd_usrp_probe
linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b

-- Opening a USRP2/N-Series device...
-- Current recv frame size: 1472 bytes
-- Current send frame size: 1472 bytes
  _____________________________________________________
 /
|       Device: USRP2 / N-Series Device
|     _____________________________________________________
|    /
|   |       Mboard: N210r4
|   |   hardware: 2577
|   |   mac-addr: 00:80:2f:0a:cc:db
|   |   ip-addr: 192.168.10.2
|   |   subnet: 255.255.255.255
|   |   gateway: 255.255.255.255
|   |   gpsdo: none
|   |   serial: F297B6
|   |   FW Version: 12.4
|   |   FPGA Version: 10.1
...

OK! the SDR looks happy! Let's move on.

Install the dependencies

root@node1-1:~# apt-get install software-properties-common python-software-properties
root@node1-1:~# add-apt-repository ppa:git-core/ppa
root@node1-1:~# apt-get update
root@node1-1:~# apt-get install git
root@node1-1:~# apt-get install bind9
root@node1-1:~# apt-get -f install

Download and prepare to build OpenBTS, Asterisk, SMQueue and Node Manager

root@node1-1:~# git clone https://github.com/RangeNetworks/dev.git
root@node1-1:~# cd dev
root@node1-1:~/dev# ./clone.sh
root@node1-1:~/dev# ./switchto.sh master

Build packages for OpenBTS with support for our SDR as well as Asterisk, SMQueue, SIPAUTHSERVE and Node Manager:
(this will take about 10 minutes, grab a cup of coffee)

root@node1-1:~/dev#./build.sh N210 

Now that all of our packages are built, let's install OpenBTS:

root@node1-1:~/dev# cd BUILDS/
root@node1-1:~/dev/BUILDS# cd 2015-10-13--03-22-27/
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i openbts_5.0_amd64.deb

Now that we have installed OpenBTS let's verify that OpenBTS is happy with our SDR:

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# cd /OpenBTS/
root@node1-1:/OpenBTS# ./transceiver
linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b

Using internal clock reference
-- Opening a USRP2/N-Series device...
-- Current recv frame size: 1472 bytes
-- Current send frame size: 1472 bytes

Excellent! Let's start OpenBTS and make sure there aren't any errors in the log:

root@node1-1:/OpenBTS# service openbts start
openbts start/running, process 12711

root@node1-1:/OpenBTS# tail /var/log/upstart/openbts.log
--   Successfully tuned to 945.200000 MHz
--
1444721928.697975 139804996573056:
system ready

1444721928.698023 139804996573056:
use the OpenBTSCLI utility to access CLI

1444721928.698218 139804996573056: OpenBTSCLI network socket support for tcp:49300

Perfect!

Let's add text message support:

root@node1-1:/OpenBTS# cd ~/dev/BUILDS/2015-10-13--03-22-27/
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i smqueue_5.0_amd64.deb
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service smqueue start
smqueue start/running, process 12904

Let's check the SMQueue Logs:

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# tail /var/log/upstart/smqueue.log
EMERG 0:12904 2015-10-13T03:45:50.6 ../SR/SubscriberRegistry.cpp:183:init: /var/lib/asterisk/sqlite3dir does not exist
ALERT 12904:12904 2015-10-13T03:45:50.7 smqueue.cpp:2798:main: smqueue (re)starting
smqueue logs to syslogd facility LOCAL7, so there's not much to see here

I think that is healthy.

Let's install and start SIPAUTHSERVE

root@node1-1:~# cd ~/dev/BUILDS/2015-10-13--03-22-27/
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i sipauthserve_5.0_amd64.deb
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service sipauthserve start
sipauthserve start/running, process 12987

Let's check the SIPAUTHSERVE Logs:

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# tail /var/log/upstart/sipauthserve.log
ALERT 12987:12987 2015-10-13T04:06:31.3 sipauthserve.cpp:328:main: /OpenBTS/sipauthserve (re)starting

Let's install and start Asterisk

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i range-asterisk_11.7.0.4_amd64.deb
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service asterisk start
asterisk start/running, process 13566

Let's check the Asterisk logs:

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# tail /var/log/upstart/asterisk.log
No 'modules.conf' found, no modules will be loaded.
Unable to load config file 'acl.conf'
Unable to open AMI configuration manager.conf, or configuration is invalid. Asterisk management interface (AMI) disabled.
Unable to load config file 'udptl.conf'
Could not load udptl config; using defaults
Can't find indications config file indications.conf.
Could not load features.conf
Could not find valid ccss.conf file. Using cc_max_requests default
Could not find valid ccss.conf file. Using cc_[state]_devstate defaults
No 'modules.conf' found, no modules will be loaded.

Let's stop everything, install "configuration" packages and then start everything

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service openbts stop
openbts stop/waiting
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service sipauthserve stop
sipauthserve stop/waiting
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service smqueue stop
smqueue stop/waiting
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service asterisk stop
asterisk stop/waiting

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i range-configs_5.1-master_all.deb
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# dpkg -i range-asterisk-config_5.0_all.deb
ln -s /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so /usr/lib/odbc/libsqlite3odbc.so

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service openbts start
openbts start/running, process 13672
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service asterisk start
asterisk start/running, process 13700
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service sipauthserve start
sipauthserve start/running, process 13852
root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# service smqueue start
smqueue start/running, process 13867

Let's add a subscriber to our tiny GSM network.

We need the IMEI of the phone you are using, your phone can tell you it's IMEI when you dial a special code.

Dial *#06#

If your phone is on and OpenBTS is running then by now your Phone and OpenBTS have most likely seen each other. Since we are using a SIM card we did not create we do not know anything about the encryption keys that were used when the SIM Card was created. Our tiny GSM network won't be encrypted but setting up subscribers will be easy. We can tell OpenBTS to give us a list of every IMEI (International Mobile Equipment Identity) and IMSI (International Mobile Subscriber Identity) it has seen, we will need the IMSI of our Test Phone so that we can tell OpenBTS to authorize the phone to use our GSM network.

We will run the tmsis command inside the OpenBTS CLI in order to get a listing of IMEI and IMSI's.

root@node1-1:~/dev/BUILDS/2015-10-13--03-22-27# cd /OpenBTS/
root@node1-1:/OpenBTS# ./OpenBTSCLI
OpenBTS Command Line Interface (CLI) utility
Copyright 2012, 2013, 2014 Range Networks, Inc.
Licensed under GPLv2.
Includes libreadline, GPLv2.
Connecting to 127.0.0.1:49300...
Remote Interface Ready.
Type:
 "help" to see commands,
 "version" for version information,
 "notices" for licensing information,
 "quit" to exit console interface.
OpenBTS> tmsis
IMSI TMSI IMEI AUTH CREATED ACCESSED TMSI_ASSIGNED
310410762747144 -    357507061173160 1    25m     19s      0
310410629684240 -    013441007348570 0    12m     12m      0
732111141359282 -    013594001284780 0    17m     17m      0
425010300522982 -    357507061982450 0    24m     24m      0 

The IMEI is a match even if the last digit doesn't match. Let's say I typed in *#06# on my phone and got back 357507061982456, I could conclude that 357507061982450 is a match, now I would need to grab the IMSI, the IMSI in the table above for my IMEI is 425010300522982. The IMSI is required when configuring subscribers.

Let's add our test subscriber phone and assign it the phone number 2165554444:

root@node1-1:/OpenBTS# cd ~/dev/NodeManager/
./nmcli.py sipauthserve subscribers create "orangesim" IMSI425010300522982 2165554444

root@node1-1:~/dev/NodeManager# ./nmcli.py sipauthserve subscribers create "orangesim" IMSI425010300522982 2165554444                       
raw request: {"command":"subscribers","action":"create","fields":{"name":"orangesim","imsi":"IMSI425010300522982","msisdn":"2165554444","ki":""}}
raw response: {
        "code" : 200,
        "data" : "both ok"
}

Echo SMS

Text to 411

Test Tone

Dial 2602

Echo Call

Dial 2600
Last modified 9 years ago Last modified on Oct 13, 2015, 8:32:13 AM
Note: See TracWiki for help on using the wiki.