Difference between revisions of "OpenBTS: 2.8 dari SVN Install"

From OnnoWiki
Jump to navigation Jump to search
Line 348: Line 348:
 
  ./OpenBTS
 
  ./OpenBTS
  
K
+
Keluar message error
 
   
 
   
 
  bind() failed: Address already in use
 
  bind() failed: Address already in use
Line 354: Line 354:
 
  Aborted
 
  Aborted
  
Problem: OpenBTS shut down uncleanly and left a stray transceiver process.
+
'''PROBLEM:''' OpenBTS shutdown tidak bersih dan masih ada proses transceiver yang masih jalan.
 +
 
  
 
Solution: Kill the stray transceiver process and try again. Like this
 
Solution: Kill the stray transceiver process and try again. Like this

Revision as of 16:37, 1 March 2012

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 \
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

Hacking Source Code 2.8.0 untuk Clock 64MHz

COBA JANGAN LAKUKAN INI

Untuk clock 64MHz nampaknya kia perlu menghack source code supaya menggunakan Clock 64MHz.

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

Edit file berikut & kalimat berikut

UHDDevice.cpp:  const double master_clk_rt = 52e6;
USRPDevice.cpp: const double USRPDevice::masterClockRate = 52.0e6;
USRPping.cpp:   RadioDevice *usrp = RadioDevice::make(52.0e6/192.0);

agar menjadi

UHDDevice.cpp:  const double master_clk_rt = 64e6;
USRPDevice.cpp: const double USRPDevice::masterClockRate = 64.0e6;
USRPping.cpp:   RadioDevice *usrp = RadioDevice::make(64.0e6/236.0);

Ubah TransceiverRAD1

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

Edit file berikut & kalimat berikut

RAD1Device.cpp:const double RAD1Device::masterClockRate = (double) 52.0e6;
RAD1ping.cpp:  RAD1Device *usrp = new RAD1Device(52.0e6/192.0);
RAD1RxRawPower.cpp:  RAD1Device *rad1 = new RAD1Device(52.0e6/192.0);
rnrad1Core.cpp:  mFpgaMasterClockFreq = 52000000;

Agar menjadi

RAD1Device.cpp:const double RAD1Device::masterClockRate = (double) 64.0e6;
RAD1ping.cpp:  RAD1Device *usrp = new RAD1Device(64.0e6/236.0);
RAD1RxRawPower.cpp:  RAD1Device *rad1 = new RAD1Device(64.0e6/236.0);
rnrad1Core.cpp:  mFpgaMasterClockFreq = 64000000;

Install OpenBTS

Compile & Instalasi OpenBTS

sudo su
cd /usr/local/src/openbts/openbts/trunk
autoreconf -i
./configure --with-usrp1  # digunakan kalau kita pakai xtal 52MHz
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

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.3.0
  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

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

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

Lakukan di tiga (3) windows yang berbeda

cd /usr/local/src/openbts/openbts/trunk/apps
./OpenBTS
cd /usr/local/src/openbts/
smqueue/trunk/smqueue/smqueue
cd /usr/local/src/openbts/
subscriberRegistry/trunk/sipauthserve

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 Stray Transceiver Process

Masalah:

./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.


Solution: Kill the stray transceiver process and try again. Like this

[dburgess@localhost apps]$ ps
  PID TTY          TIME CMD
23233 pts/1    00:00:00 bash
23342 pts/1    00:00:32 transceiver
23369 pts/1    00:00:00 ps
[dburgess@localhost apps]$ kill -KILL 23342
[dburgess@localhost apps]$ !.
./OpenBTS 

You can also use killall:

killall transceiver

Referensi

Pranala Menarik

Persiapan Hardware

OpenBTS 2.6

OpenBTS 2.8

Ettus E110

Lain Lain

Catatan Legal dan Pendukung

Catatan Sejarah