OpenBTS: 2.8 dari SVN Install Clock 52MHz

From OnnoWiki
Jump to navigation Jump to search

Sumber: http://wush.net/trac/rangepublic/wiki/BuildInstallRun

Teknik yang di jelaskan disini hanya untuk Sebuah OpenBTS saja.

A complete installation of OpenBTS P2.8 comprises these components:

  • OpenBTS itself. This is the GSM implementation from the TDMA part of L1 up through L3 and the L3/L4 boundary. Its SIP interface is normally on port 5062. This is located in openbts/trunk.
  • Transceiver. This is the software radiomodem, implementing the lower part of L1. OpenBTS starts the transceiver automatically. These are located in openbts/trunk/Transceiver*.
  • A SIP PBX or softswitch (Asterisk, FeeeSWITCH, etc.) This component connects speech calls. Its SIP interface is normally on port 5060. This is not packaged with OpenBTS.
  • Sipauthserver. This is the SIP registration and authorization server, used to process location updating requests from OpenBTS and perform corresponding updates in the subscriber registry database. Its SIP interface normally runs on port 5064. This is located in subscriberRegistry/trunk.
  • Smqueue. This is the store-and-forward text messaging server. It needs to be started independently of OpenBTS. Its SIP interface is normally run on port 5063. Smqueue is not required in installations that do not support text messaging. This is located in smqueue/trunk.
  • Rrlpserver. This is the RRLP aiding server and it is run as a CGI script in a web server. Rrlpserver is not required if RRLP is not being used. This is located in RRLP/trunk.
Openbts system diagram.png

Prasyarat


Instalasi Paket Pendukung dan Asterisk

Instalasi paket / library pendukung tambahan

sudo apt-get install autoconf libtool libosip2-dev libortp-dev \
libusb-1.0-0-dev g++ sqlite3 libsqlite3-dev erlang ibreadline6-dev libboost-all-dev \
asterisk asterisk-mysql cmake

Load GNURadio

sudo ldconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

Cek apakah USRP GNURadio terinstalasi dengan baik menggunakan

pkg-config --cflags usrp

Harus keluar informasi, misalnya,

-I/usr/local/include 

Jika tidak maka instalasi GNURadio gagal. Cara yang tampaknya baik bisa di baca di Instalasi GNURadio 3.3.0 di Ubuntu 11.10

Download Source Code OpenBTS via SVN

sudo su
cd /usr/local/src
svn co http://wush.net/svn/range/software/public openbts

Edit OpenBTS

sudo su
cd /usr/local/src/openbts/openbts/trunk/apps

Edit

vi OpenBTS.cpp

Edit

// Start the transceiver interface.
// Sleep long enough for the USRP to bootload.
sleep(5);

supaya menjadi

sleep(15);

Install OpenBTS

Compile & Instalasi OpenBTS

sudo su
cd /usr/local/src/openbts/openbts/trunk
autoreconf -i
./configure --with-usrp1                # *RECOMMENDED* untuk clock 52MHz, butuh libusrp
./configure --with-uhd                  # NOT RECOMMENDED
./configure --with-usrp1 --with-resamp  # untuk clock 64MHz, butuh libusrp
make clean
make
make install
cd /usr/local/src/openbts/openbts/trunk/apps
ln -s ../Transceiver52M/transceiver 
cd /usr/local/src/openbts/openbts/trunk/
sudo mkdir -p /usr/local/share/usrp/rev4/
sudo cp Transceiver52M/std_inband.rbf /usr/local/share/usrp/rev4/

Instalasi Database Konfigurasi OpenBTS

cd /usr/local/src/openbts/openbts/trunk
sudo mkdir /etc/OpenBTS
rm /etc/OpenBTS/OpenBTS.db
sudo sqlite3 -init ./apps/OpenBTS.example.sql /etc/OpenBTS/OpenBTS.db
.exit

Beberapa catatan minimal yang harus di set dari database OpenBTS

  • GSM.Radio.Band - Set parameter ini untuk menentukan GSM band yang sesuai dengan hardware yang kita gunakan.
  • GSM.Radio.C0 - Ini adalah ARFCN. Set sesuai dengan band yang kita gunakan.
  • Control.LUR.OpenRegistration - Set menggunakan regular expression sesuai denan IMSI dari test phone. Parameter ini memberitahukan OpenBTS untuk tidak me-reject handset karena registration server di bawah tidak me-responds. Sehingga sangat bermanfaat untuk proses debugging dan inisialisasi sistem. Tentang regular expression dapat dibaca di http://en.wikipedia.org/wiki/Regular_expression

Agar semua SIM card register tanpa AMPUN konfigurasi pada prompt OpenBTS>

config Control.LUR.OpenRegistration \W+
configsave

Baca tentang cara konfigurasi OpenBTS 2.8

Contoh Error Saat Compile OpenBTS

Jika GNURadio tidak terinstalasi dengan baik akan keluar Error berikut

configure: error: Package requirements (usrp > 3.1) were not met:
No package 'usrp' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables USRP_CFLAGS
and USRP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Alternatif solusinya

  1. Gunakan GNURADIO 3.4.2
  2. Masukan PKG_CONFIG_PATH ke .bashrc
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Instalasi Smqueue

Smqueue dapat di instalasi dengan melakukan langkah berikut

cd /usr/local/src/openbts/smqueue/trunk
autoreconf -i
./configure 
make clean
make 
make install

Selanjutnya, inisialisasi konfigurasi database OpenBTS

cd /usr/local/src/openbts/smqueue/trunk
rm -Rf /etc/OpenBTS/smqueue.db
sudo sqlite3 -init  smqueue/smqueue.example.sql /etc/OpenBTS/smqueue.db
.exit

Instalasi Subscriber Registry

Lakukan

cd /usr/local/src/openbts/subscriberRegistry/trunk/configFiles
sudo mkdir /var/lib/asterisk/
sudo mkdir /var/lib/asterisk/sqlite3dir
sudo sqlite3 -init subscriberRegistryInit.sql /var/lib/asterisk/sqlite3dir/sqlite3.db
.exit

Buat link CGI

vi /etc/apache2/sites-enabled/000-default 
ScriptAlias /cgi/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
 </Directory>
cd /usr/lib/cgi-bin/
ln -s /usr/local/src/openbts/subscriberRegistry/trunk/srmanager.cgi

Yang agak repot adalah menginstalasi Asterisk Real Time

Naga-naganya masih banyak sekali Error di template database subscriber registry :(

-- Loading resources from subscriberRegistryInit.sql
Error: incomplete SQL: CREATE TABLE 'sip_buddies'
(
id                    integer,
name                  VARCHAR(80) not null,
context               VARCHAR(80),
callingpres           VARCHAR(30) DEFAULT 'allowed_not_screened',
deny                  VARCHAR(95),
permit                VARCHAR(95),
secret                VARCHAR(80),
md5secret             VARCHAR(80),
remotesecret          VARCHAR(250),
transport             VARCHAR(10),
host                  VARCHAR(31) not null,
nat                   VARCHAR(5) DEFAULT 'no' not null,
type                  VARCHAR(10) DEFAULT 'friend' not null,
accountcode           VARCHAR(20),
amaflags              VARCHAR(13),
callgroup             VARCHAR(10),
callerid              VARCHAR(80),
defaultip             VARCHAR(40) DEFAULT '0.0.0.0',
dtmfmode              VARCHAR(7) DEFAULT 'rfc2833',
fromuser              VARCHAR(80), 
fromdomain            VARCHAR(80),
insecure              VARCHAR(4),
language              CHAR(2),
mailbox               VARCHAR(50),
pickupgroup           VARCHAR(10),
qualify               CHAR(3),
regexten              VARCHAR(80),
rtptimeout            CHAR(3),
rtpholdtimeout        CHAR(3),
setvar                VARCHAR(100),
disallow              VARCHAR(100) DEFAULT 'all',
allow                 VARCHAR(100) DEFAULT 'ulaw' not null,
fullcontact           VARCHAR(80),
ipaddr                VARCHAR(40),
port                  int(5) DEFAULT 0,
username              VARCHAR(80),
defaultuser           VARCHAR(80),
subscribecontext      VARCHAR(80),
directmedia           VARCHAR(3),
trustrpid             VARCHAR(3),
sendrpid              VARCHAR(3),
progressinband        VARCHAR(5),
promiscredir          VARCHAR(3),
useclientcode         VARCHAR(3),
callcounter           VARCHAR(3),
busylevel             int(11),
allowoverlap          VARCHAR(3) DEFAULT 'yes',
allowsubscribe        VARCHAR(3) DEFAULT 'yes',
allowtransfer         VARCHAR(3) DEFAULT 'yes',
ignoresdpversion      VARCHAR(3) DEFAULT 'no',
template              VARCHAR(100),
videosupport          VARCHAR(6) DEFAULT 'no',
maxcallbitrate        int(11),
rfc2833compensate     VARCHAR(3) DEFAULT 'yes',
'session-timers'      VARCHAR(10) DEFAULT 'accept',
'session-expires'     int(6) DEFAULT 1800,
'session-minse'       int(6) DEFAULT 90,
'session-refresher'   VARCHAR(3) DEFAULT 'uas',
t38pt_usertpsource    VARCHAR(3),
outboundproxy         VARCHAR(250),
callbackextension     VARCHAR(250),
registertrying        VARCHAR(3) DEFAULT 'yes',
timert1               int(6) DEFAULT 500,
timerb                int(9),
qualifyfreq           int(6) DEFAULT 120,
contactpermit         VARCHAR(250),
contactdeny           VARCHAR(250),
lastms                int(11) DEFAULT 0 not null,
regserver             VARCHAR(100),
regseconds            int(11) DEFAULT 0 not null,
useragent             VARCHAR(100),
cancallforward        CHAR(3) DEFAULT 'yes' not null,
canreinvite           CHAR(3) DEFAULT 'yes' not null,
mask                  VARCHAR(95),
musiconhold           VARCHAR(100),
restrictcid           CHAR(3),
calllimit             int(5),
WhiteListFlag         timestamp not null default '0',
WhiteListCode         varchar(8) not null default '0',
rand                  varchar(33) default ,
sres                  varchar(33) default ,
ki                    varchar(33) default ,
kc                    varchar(33) default ,
RRLPSupported         int(1) default 1 not null,
hardware	      VARCHAR(20),
regTime               INTEGER default 0 NOT NULL"
a3_a8                 varchar(45) default NULL
primary key(id)
) 
;

Instalasi Sipauthserve

Sipauthserve adalah daemon yang memberikan SIP authentication services. Variabel SIP.Proxy.Registration di OpenBTS harus menunjuk pada hostname & port Sipauthserve. OpenBTS harus sudah di buat sebelum membuat Sipauthserve.

Compile Sipauthserve

cd /usr/local/src/openbts/subscriberRegistry/trunk
make

Setup database untuk Sipauthserve

rm /etc/OpenBTS/sipauthserve.db
cd /usr/local/src/openbts/subscriberRegistry/trunk
sqlite3 -init sipauthserve.example.sql /etc/OpenBTS/sipauthserve.db
.exit

Cek Sebelum Menjalankan OpenBTS

Cek USRP apakah sudah di deteksi sistem operasi

ls -lR /dev/bus/usb | grep usrp

Harusnya akan keluar seperti

crw-rw---- 1 root usrp 189, 2 2012-02-22 07:39 003

Cek sambungan antara PC ke USRP

cd /usr/local/src/openbts/openbts/trunk/Transceiver52M
./USRPping

Harusnya keluar

ALERT 3078412512 USRPDevice.cpp:526:setTxFreq: set TX: 8.254e+08failed
    baseband freq: 0
    DDC freq:      5.74e+07
    residual freq: 5.74e+07
ALERT 3078412512 USRPDevice.cpp:546:setRxFreq: set RX: 8.254e+08failed
    baseband freq: 0
    DDC freq:      -6.6e+06
    residual freq: -0.00596046
19000: 0 0
19001: 0 0
19002: 0 0
19003: 0 0
19004: 0 0
19005: 0 0

Contoh jika gagal

usrp_open_interface:usb_claim_interface: failed interface 2
could not claim interface 2: Device or resource busy
usrp_basic_rx: can't open rx interface


Error UHD

Error saat USRPping

cd /usr/local/src/openbts/openbts/trunk/Transceiver52M
./USRPping

Error

linux; GNU C++ version 4.6.1; Boost_104601; UHD_003.004.001-101-gff2649ca

ALERT 3063285456 UHDDevice.cpp:409:parse_dev_type: USRP1 is not supported using the UHD driver
ALERT 3063285456 UHDDevice.cpp:410:parse_dev_type: Please compile with GNU Radio libusrp support
Segmentation fault

SOLUSI:

Kita punya masalah dengan UHD rupanya USRP1 tidak cocok dengan UHD. Lebih baik menggunakan GNURadio 3.4.2

Menjalankan OpenBTS

Lakukan di tiga (3) windows yang berbeda

/etc/init.d/asterisk restart
cd /usr/local/src/openbts/openbts/trunk/apps
./OpenBTS &
cd /usr/local/src/openbts/subscriberRegistry/trunk/
./sipauthserve &
cd /usr/local/src/openbts/smqueue/trunk/smqueue/
./smqueue &

Mengkonfigurasi OpenBTS

OpenBTS saat ini menggunakan CLI sendiri untuk di konfigurasi. Ini bisa di akses melalui

cd /usr/local/src/openbts/openbts/trunk/apps
./OpenBTSCLI

Lebih detail-nya bisa di baca di Konfigurasi OpenBTS 2.8

Beberapa Error

Saat menjalankan OpenBTS akan keluar Error

ALERT 3079285616 USRPDevice.cpp:546:setRxFreq: set RX: 9.002e+08failed
    baseband freq: 8.96e+08
    DDC freq:      -4.2e+06
    residual freq: 0.00298023
ALERT 3079285616 Transceiver.cpp:540:driveControl: RX failed to tune
ALERT 3079272144 TRXManager.cpp:342:tune: RXTUNE failed with status 1
ALERT 3079272144 TRXManager.cpp:395:powerOn: POWERON failed with status 1
ALERT 3079272144 TRXManager.cpp:409:setPower: SETPOWER failed with status 1
ALERT 3079272144 TRXManager.cpp:409:setPower: SETPOWER failed with status 1
1329902709.029597 3079272144: 

Welcome to OpenBTS.  Type "help" to see available commands.

OpenBTS> ALERT 3045964656 TRXManager.cpp:409:setPower: SETPOWER failed with status 1
ALERT 3068914544 TRXManager.cpp:86:clockHandler: TRX clock interface timed out, assuming TRX is dead.
Aborted

Biasanya ini di barengi dengan konsumsi CPU yang sangat tinggi.

PROBLEM: Kemungkinan besar anda menjalankan program transceiver yang salah. Untuk USRP 64MHz gunakan Transceiver/transceiver. Untuk USRP 52MHz gunakan Transceiver52M/transceiver.

SOLUSI: Set path TRX.Path yang benar di OpenBTS.config.



Error SubscriberRegistry database

Keluar error saat menjalankan OpenBTS

EMERG 3077609168 SubscriberRegistry.cpp:160:init: Cannot open SubscriberRegistry database: unable to open database file

SOLUSI:

Lakukan Instalasi Subscriber Registry


Error SubscriberRegistry.UpstreamServer

Keluar error saat menjalankan smqueue server

cannot find configuration value SubscriberRegistry.UpstreamServer

SOLUSI:

Jalankan SipAuth Server sebelum smqueue server

Error Stray Transceiver Process

Masalah:

cd /usr/local/src/openbts/openbts/trunk/apps
./OpenBTS

Keluar message error

bind() failed: Address already in use
terminate called after throwing an instance of 'SocketError'
Aborted

PROBLEM: OpenBTS shutdown tidak bersih dan masih ada proses transceiver yang masih jalan.

SOLUSI: Kill proses transceiver yang masih jalan dan coba sekali lagi seperti di bawah ini.

ps | grep transceiver

Keluar misalnya

30208 pts/1    00:00:00 transceiver

Kill

kill -KILL 30208

atau

killall transceiver

Referensi

Pranala Menarik

Persiapan

OpenBTS 2.6

OpenBTS 2.8

Multi OpenBTS 2.8

Ettus E110

Lain Lain

Catatan Legal dan Pendukung

Catatan Sejarah