Project

General

Profile

CalypsoBTS » History » Version 5

laforge, 01/15/2017 01:39 PM

1 1 fixeria
2 3 fixeria
h1. [[CalypsoBTS]]
3 1 fixeria
4
5 3 fixeria
This tutorial describes how to turn cheap Calypso based phone(s) into a BTS. Due to hardware limitations the [[CalypsoBTS]] setup cannot provide normal quality of service and only can be used to learn how the base stations works. Because Calypso based phone cannot perform BTS functionality itself, in this tutorial we consider how to use it with "OsmoBTS":http://openbsc.osmocom.org/trac/wiki/OsmoBTS and "OpenBTS":http://openbts.org/ front-ends.
6
7
8
h2. Requirements
9
10
11 1 fixeria
First of all you have to understand what you're doing and possible consequences. You can use the frequencies you have valid license for. In many countries you cannot operate any GSM RF equipment unless you have obtained a proper license from the regulatory authority. Accomplishing to operate a BTS without having such a license and/or interfering with a public telecommunications network is a crime and punishable under applicable law! 
12
13 3 fixeria
Also you need to have a "working setup":http://bb.osmocom.org/trac/wiki/Software/GettingStarted of [[OsmocomBB]]. And finally some things can be differ in your distribution, so you should be able to solve possible problems yourself because it's your machine.
14 1 fixeria
15
16 3 fixeria
h2. TRX preparation
17
18
There are two [[OsmocomBB]] branches provide the transceiver firmware and application. I advice you to use the jolly/testing branch because it have multiple phones support. The transceiver app is an external interface of [[CalypsoBTS]] which abstracts a BTS software from the L1 physical layer. It needs libosmo-dsp as a dependency:
19
20
<pre>
21
<code class="sh">
22 1 fixeria
git clone git://git.osmocom.org/libosmo-dsp.git
23
cd libosmo-dsp/
24
autoreconf -i
25
./configure
26
make
27
sudo make install
28
cd ..
29 3 fixeria
</code></pre>
30 1 fixeria
31
Then clone and compile the jolly/testing branch:
32
33 3 fixeria
<pre>
34
<code class="sh">
35 1 fixeria
# Get the sources	
36
git clone git://git.osmocom.org/osmocom-bb.git trx
37
cd trx/
38
git checkout jolly/testing
39
cd src/
40
41
# It needs TX support
42
# Just uncomment 'CFLAGS += -DCONFIG_TX_ENABLE' in target/firmware/Makefile
43
44
# And make with transceiver support
45
make HOST_layer23_CONFARGS=--enable-transceiver
46 3 fixeria
</code></pre>
47 1 fixeria
48
And at this step your transceiver is ready. Let's check how it works!
49
50
51 3 fixeria
h4. A bit of theory
52
53
54 1 fixeria
It is very important to have a good clock synchronization between the BTS and mobile phones. Time-division (TDMA) systems require very accurate counting of the time segments and when they start and stop. If the towers clocking were out of sync, then communications would falter as each node would be trying to deal with segments that were slightly offset and this would introduce errors. The GPS signals can be used as clock source. But there is more simple way to grab the clock from existing public mobile networks.
55
56 3 fixeria
Using [[rssibin|RSSI]] or cell_log find the strongest cell and remember it's ARFCN number.
57 1 fixeria
58
59 3 fixeria
h4. Usage
60
61
62
<pre>
63 1 fixeria
Usage: ./transceiver -a arfcn_sync
64
Some useful options:
65
  -h   --help             this text
66
  -d   --debug MASK       Enable debugging (e.g. -d DL1C:DTRX)
67
  -e   --log-level LOGL   Set log level (1=debug, 3=info, 5=notice)
68
  -D   --daemonize        For the process into a background daemon
69
  -s   --disable-color    Don't use colors in stderr log output
70
  -a   --arfcn-sync ARFCN Set ARFCN to sync to
71
  -p   --arfcn-sync-pcs   The ARFCN above is PCS
72
  -2   --second-phone     Use second phone for TS 1
73
  -r   --realtime PRIO    Set realtime scheduler with given prio
74 3 fixeria
</code></pre>
75 1 fixeria
76 3 fixeria
Where --arfcn-sync or --arfcn-sync-pcs indicates the *ARFCN of clock source cell*. High priority scheduling required for handling bursts (-r 99). Just try to sync:
77 1 fixeria
78 3 fixeria
<pre>
79
<code class="sh">
80 1 fixeria
# Load the TRX firmware in first terminal
81
cd trx/src/
82
sudo host/osmocon/osmocon -r 99 -m c123xor -p /dev/ttyUSB0 -c target/firmware/board/compal_e88/trx.highram.bin
83
84
# In second terminal run the transceiver
85
cd trx/src/host/layer23/src/transceiver/
86
sudo ./transceiver -a <ARFCN> -r 99
87 3 fixeria
</code></pre>
88 1 fixeria
89
And you should see something like this:
90
91 3 fixeria
<pre>
92 1 fixeria
<0012> l1ctl.c:383 Reset received: Starting sync.
93
<0012> l1ctl.c:338 Sync acquired, setting BTS mode ...
94
<0011> trx.c:194 TRX CLK Indication 1255520
95
<0011> trx.c:194 TRX CLK Indication 1255571
96
<0011> trx.c:194 TRX CLK Indication 1255622
97
<0011> trx.c:194 TRX CLK Indication 1255673
98
<0011> trx.c:194 TRX CLK Indication 1255724
99
<0011> trx.c:194 TRX CLK Indication 1255775
100
<0011> trx.c:194 TRX CLK Indication 1255826
101
<0011> trx.c:194 TRX CLK Indication 1255877
102
<0011> trx.c:194 TRX CLK Indication 1255928
103
<0011> trx.c:194 TRX CLK Indication 1255979
104
<0011> trx.c:194 TRX CLK Indication 1256030
105
<0011> trx.c:194 TRX CLK Indication 1256081
106 2 fixeria
...
107 3 fixeria
</code></pre>
108 1 fixeria
109
If something goes wrong, find another ARFCN and try again.
110
111
112 5 laforge
h2. [[CalypsoBTS]] with [[OsmoBTS:]]
113 1 fixeria
114 5 laforge
[[OsmoBTS:]] is a software implementation of Layer2/3 of a BTS.  It supports a variety of different hardware backends.
115 1 fixeria
116 5 laforge
The simplest way to test how it works is to use [[OsmoBTS:]] with [[OpenBSC:]] in [[OsmoNITB:]] mode. [[OsmoNITB:]] is a simple core network implementation - network in the box. It emulates basic core elements like MSC, HLR, VLR, etc.
117 3 fixeria
118
h3. Dependences
119
120 5 laforge
Make sure that you have installed [[libosmocore:]]
121 3 fixeria
122
Install/update the following packages in your distribution:
123
124 1 fixeria
<pre>
125 5 laforge
sudo apt-get install sqlite3 libdbi-dev libdbd-sqlite3 libsctp-dev
126
</pre>
127 1 fixeria
128 3 fixeria
h4. oRTP
129
130 5 laforge
This package installs the open source RTP protocol required for libosmo-abis. It can be downloaded at "Current [[OsmoBTS:]] source works fine with **0.22.0 oRTP** version only. Otherwise there may be problems with voice support.
131 3 fixeria
132
<pre>
133
<code class="sh">
134 1 fixeria
wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz
135
tar -xvf ortp-0.22.0.tar.gz
136
cd ortp-0.22.0/
137
./configure
138
make
139
sudo make install
140
sudo ldconfig
141
cd ..
142
</code></pre>
143
144
145 3 fixeria
h4. libosmo-abis
146 1 fixeria
147
<pre>
148 5 laforge
git clone git://git.osmocom.org/libosmo-abis.git
149
</pre>
150 3 fixeria
151
Sometimes it is necessary to point to different pkgconfig path, because your distribution may use other pkgconfig path than the default path of the packages above. Use the following prefix: 
152
153 1 fixeria
<pre>
154 5 laforge
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
155
</pre>
156 1 fixeria
157 3 fixeria
<pre>
158
<code class="sh">
159 1 fixeria
cd libosmo-abis
160
autoreconf -i
161
./configure
162
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
163
make
164
sudo make install
165
sudo ldconfig
166
cd ..
167 3 fixeria
</code></pre>
168 1 fixeria
169
170 3 fixeria
h4. libosmo-netif
171 1 fixeria
172 3 fixeria
173 5 laforge
This package is dependency of [[OsmoNITB:]].
174 1 fixeria
175 3 fixeria
<pre>
176
<code class="sh">
177 1 fixeria
git clone git://git.osmocom.org/libosmo-netif.git
178
cd libosmo-netif/
179
autoreconf -i
180
./configure
181
make
182
sudo make install
183
sudo ldconfig
184
cd ..
185
</code></pre>
186
187 3 fixeria
188 5 laforge
h3. [[OsmoNITB:]]
189 1 fixeria
190 3 fixeria
191
The latest version can downloaded via git:
192
193 1 fixeria
<pre>
194 5 laforge
git clone git://git.osmocom.org/openbsc.git
195
</pre>
196 1 fixeria
197
Finish the installation:
198
199 3 fixeria
<pre>
200 1 fixeria
<code class="sh">
201
cd openbsc/openbsc/
202 3 fixeria
autoreconf -i
203 1 fixeria
./configure
204
make
205
sudo make install
206
cd ../..
207
</code></pre>
208
209 3 fixeria
210 5 laforge
h3. [[OsmoBTS:]]
211 1 fixeria
212 3 fixeria
213
The latest version can downloaded via git:
214
215 1 fixeria
<pre>
216 5 laforge
git clone git://git.osmocom.org/osmo-bts.git
217
</pre>
218 1 fixeria
219
Finish the installation:
220
221 3 fixeria
<pre>
222
<code class="sh">
223 1 fixeria
cd osmo-bts
224
autoreconf -i
225
./configure --enable-trx
226
make
227
sudo make install
228
cd ..
229 3 fixeria
</code></pre>
230 1 fixeria
231
232 3 fixeria
h3. Basic configuration
233 1 fixeria
234 3 fixeria
235 5 laforge
Now wee need to configure [[OpenBSC:]] and [[OsmoBTS:]] to work together with [[CalypsoBTS]].
236 3 fixeria
237
<pre>
238
<code class="sh">
239 1 fixeria
# Create the configuration folder if it isn't exist yet
240
mkdir ~/.osmocom
241
242
cd ~/.osmocom
243
touch ~/.osmocom/open-bsc.cfg
244
touch ~/.osmocom/osmo-bts.cfg
245 3 fixeria
</code></pre>
246 1 fixeria
247
Then init default configuration:
248
249 3 fixeria
<pre>
250
<code class="sh">
251
# Run [[OpenBSC]]
252 1 fixeria
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
253
254
# In another terminal
255
telnet localhost 4242
256
en
257
write file
258
exit
259
260 3 fixeria
# Kill [[OpenBSC]]
261 1 fixeria
Ctrl + C
262 3 fixeria
</code></pre>
263 1 fixeria
264 3 fixeria
Configure [[OsmoBTS]] manually:
265 1 fixeria
266 3 fixeria
<pre>
267 1 fixeria
bts 0
268
 band DCS1800
269
 ipa unit-id 1801 0
270
 oml remote-ip 127.0.0.1
271
 rtp jitter-buffer 0
272
 paging queue-size 200
273
 paging lifetime 0
274
 fn-advance 30
275
 ms-power-loop -60
276 2 fixeria
 timing-advance-loop
277 1 fixeria
 settsc
278
 setbsic
279
 trx 0
280
  rxgain 0
281
  power 0
282
  slotmask 1 0 0 0 0 0 0 0
283
</code></pre>
284
285 3 fixeria
**NOTE: "ms-power-loop" at osmo-bts.cfg should be set to -65, in order to prevent saturating the input. Also if the phone is only one or few meters away, "ms max power" should be set to 0. In case of long distance test it can be set to 30 (DCS) or 33 (GSM 900).**
286 1 fixeria
287
In case of one phone as TRX only one timeslot will be available for [[OsmoBTS]]. This is enough for basic network functionality including Location Update, SMS and USSD support. For the voice calls support you need one more phone serving a TCH channel. In case of two phones change slotmask to:
288
289 3 fixeria
<pre>
290 5 laforge
slotmask 1 1 0 0 0 0 0 0
291
</pre>
292 1 fixeria
293 3 fixeria
Now find and change following initial config parameters of [[OpenBSC]]:
294 2 fixeria
295 3 fixeria
<pre>
296 2 fixeria
# In network section
297 1 fixeria
network country code <MNC (for test use 001)>
298 2 fixeria
mobile network code <MCC (for test use 01)>
299
short name <NAME>
300 1 fixeria
long name <NAME>
301 2 fixeria
302 3 fixeria
# In trx[0":http://download.savannah.gnu.org/releases/linphone/ortp/sources/]. section
303 2 fixeria
arfcn <your BTS ARFCN (see note)>
304 3 fixeria
</code></pre>
305 2 fixeria
306 3 fixeria
*Warning:* Only use an ARFCN you have a *valid license* for.
307 1 fixeria
308 3 fixeria
For other configuration parameters description, see "OpenBSC VTY reference":http://openbsc.osmocom.org/trac/wiki/osmo-nitb_VTY.
309 2 fixeria
310
311 3 fixeria
h3. Voice calls support
312
313
By default [[NiTB]] has built-in voice call routing support. In this case you need at least one timeslot serving TCH/H or TCH/F. If you do a call from one phone to another, you will need one channel for each phone. However, it is possible to allow two traffic channels on a single timeslot. To do this configure second timeslot (TS1) as TCH/H at open-bsc.cnf:
314
315
<pre>
316 1 fixeria
...
317
trx 0
318
   rf_locked 0
319 2 fixeria
   arfcn <ARFCN>
320 1 fixeria
   nominal power 23
321 2 fixeria
   max_power_red 0
322 1 fixeria
   rsl e1 tei 0
323
   timeslot 0
324
    phys_chan_config CCCH+SDCCH4
325
    hopping enabled 0
326 2 fixeria
   timeslot 1
327 1 fixeria
    phys_chan_config TCH/H
328 2 fixeria
    hopping enabled 0
329
    ...
330 1 fixeria
331
mncc-int
332
 default-codec tch-f amr
333 2 fixeria
 default-codec tch-h amr
334
...
335
</code></pre>
336
337 3 fixeria
338 1 fixeria
h3. LCR (optional)
339 2 fixeria
340 5 laforge
If you want to manage/route calls outside of [[OsmoNITB:]], you can replace internal call control by 
341 1 fixeria
"Linux Call Router": http://isdn.eversberg.eu/
342 4 msuraev
343 2 fixeria
344 3 fixeria
h4. opencore-amr
345
346
This package installs GSM adaptive multirate codecs and the EFR codec. The Full-Rate and Half-Rate codecs are included in LCR's repository.
347
348 5 laforge
It can be downloaded at http://sourceforge.net/projects/opencore-amr/files/opencore-amr/
349
350 3 fixeria
<pre>
351
<code class="sh">
352 2 fixeria
tar xvzf opencore-amr-x.x.x.tar.gz
353
cd opencore-amr-x.x.x
354 1 fixeria
./configure
355 2 fixeria
make
356 1 fixeria
sudo make install
357
sudo ldconfig
358
cd ..
359 3 fixeria
</code></pre>
360 2 fixeria
361 1 fixeria
362 3 fixeria
h4. Sip-Sofia
363
364 1 fixeria
365 2 fixeria
This package installs the open source SIP stack of Nokia Research Center.
366 3 fixeria
367 5 laforge
It can downloaded at http://sourceforge.net/projects/sofia-sip/files/sofia-sip/
368 1 fixeria
369
<pre>
370 3 fixeria
<code class="sh">
371
tar xvzf sofia-sip-x.xx.xx.tar.gz
372 1 fixeria
cd sofia-sip-x.xx.xx
373
./configure
374
make
375 2 fixeria
sudo make install
376
sudo ldconfig
377 1 fixeria
cd ..
378 2 fixeria
</code></pre>
379 3 fixeria
380 1 fixeria
381 2 fixeria
h4. LCR
382 3 fixeria
383
384
This package installs the open source PBX software to bridge ISDN (DSS1) / SIP / GSM (MNCC protocol).
385 1 fixeria
386
The latest version can downloaded via git:
387
<pre>
388 5 laforge
git clone git://git.misdn.eu/lcr.git
389
</pre>
390 2 fixeria
391 3 fixeria
Now configure, as described here:
392 1 fixeria
393
<pre>
394
<code class="sh">
395 3 fixeria
cd lcr
396
autoreconf -i
397 2 fixeria
./configure --with-sip --with-gsm-bs --with-gsm-ms
398 1 fixeria
</code></pre>
399 2 fixeria
400 3 fixeria
Please note, that Half-Rate codec (--enable-gsmhr) codec is so slow, that only one or two calls may occupy CPU completely. So avoid it's usage except for testing.
401 2 fixeria
402
Sometimes it is necessary to point to different pkgconfig path, because your distribution may use other pkgconfig path than the default path of the packages above. Use the following prefix:
403
404 3 fixeria
<pre>
405 5 laforge
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
406
</pre>
407 1 fixeria
408 3 fixeria
The configure result should include:
409 1 fixeria
410
<pre>
411
configure: Compiled with GSM network side support 
412
configure: Compiled with GSM mobile side support
413
configure: Compiled with GSM AMR codec support
414 2 fixeria
configure: Compiled with SIP support
415 3 fixeria
</code></pre>
416 1 fixeria
417 2 fixeria
Finish the installation:
418 1 fixeria
419
<pre>
420 2 fixeria
<code class="sh">
421 3 fixeria
make
422
sudo make install
423 1 fixeria
sudo ldconfig
424
cd ..
425
</code></pre>
426
427 3 fixeria
428 1 fixeria
h3. LCR configuration (optional)
429
430
431
h4. options.conf
432 3 fixeria
433 1 fixeria
<pre>
434 5 laforge
edit /usr/local/etc/lcr/options.conf
435
</pre>
436 3 fixeria
437
Add a line to show logging to the console:
438
439
<pre>
440 5 laforge
debug 0x100000
441
</pre>
442 1 fixeria
443 3 fixeria
444 1 fixeria
h4. interface.conf
445
446
447
The simplest configuration uses only the GSM interface. It allows LCR to forward calls from GSM to GSM or from GSM to a call test feature. 
448 3 fixeria
449
<pre>
450 5 laforge
edit /usr/local/etc/lcr/interface.conf
451
</pre>
452 1 fixeria
453 3 fixeria
You can remove (or comment out) everything and just add this interface:
454 2 fixeria
455
<pre>
456 1 fixeria
[gsm]
457 3 fixeria
gsm-bs
458 2 fixeria
tones yes
459 1 fixeria
earlyb no
460
extern
461
</code></pre>
462
463 3 fixeria
464 1 fixeria
h4. routing.conf
465 2 fixeria
466 3 fixeria
467 1 fixeria
<pre>
468 5 laforge
edit /usr/local/etc/lcr/routing.conf
469
</pre>
470 3 fixeria
471 2 fixeria
You can remove (or comment out) everything and just add these rulesets:
472
473 3 fixeria
<pre>
474 1 fixeria
# All calls from interface 'gsm' are forwarded to rule set 'gsm'.
475
[main]
476
interface=gsm                           : goto ruleset=gsm
477
                                        : disconnect cause=31
478 2 fixeria
479
# All calls that dial '99' prefix, will be test calls. All other calls will be forwarded back to 'gsm' interface.
480
[gsm]
481
dialing=99                              : test
482
                                        : extern interfaces=gsm
483 3 fixeria
</code></pre>
484 2 fixeria
485
486 3 fixeria
h2. Running
487
488
489 2 fixeria
I suggest to have one shell for every process to run, rather than stating all processes as daemon from one shell. Not starting as daemon allows to easily see the debugging output.
490
491
492 3 fixeria
h4. 1. Transceiver
493
494
495 2 fixeria
First load the TRX firmware. In case of one phone:
496
497 3 fixeria
<pre>
498
<code class="sh">
499
# Shell #1424
500 2 fixeria
cd trx/src/
501
sudo host/osmocon/osmocon -m c123xor -p /dev/ttyUSB0 -c target/firmware/board/compal_e88/trx.highram.bin -r 99
502
503 3 fixeria
# Shell #1425
504 1 fixeria
cd trx/src/host/layer23/src/transceiver/
505
sudo ./transceiver -a <ARFCN to sync> -r 99
506 3 fixeria
</code></pre>
507 1 fixeria
508
In case of two phones you should run two osmocon applications:
509
510 3 fixeria
<pre>
511
<code class="sh">
512 1 fixeria
# Shell #1424
513
cd trx/src/
514 3 fixeria
sudo host/osmocon/osmocon -m c123xor -p /dev/ttyUSB0 -s /tmp/osmocom_l2 -c target/firmware/board/compal_e88/trx.highram.bin -r 99
515 1 fixeria
516 2 fixeria
# Shell #1425
517
cd trx/src/
518 1 fixeria
sudo host/osmocon/osmocon -m c123xor -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -c target/firmware/board/compal_e88/trx.highram.bin -r 99
519
520 3 fixeria
# Shell #1426
521 2 fixeria
cd trx/src/host/layer23/src/transceiver/
522
sudo ./transceiver -a <ARFCN> -2 -r 99
523
</code></pre>
524 3 fixeria
525 1 fixeria
Make sure that transceiver successfully synchronized to the clock source BTS.
526 2 fixeria
527 3 fixeria
528 1 fixeria
h4. 2. [[OpenBSC]]
529
530
531
Open another shell and start [[OpenBSC]]:
532 3 fixeria
533 2 fixeria
<pre>
534 5 laforge
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
535
</pre>
536 2 fixeria
537 3 fixeria
[[OpenBSC]] runs as a stand-alone network with given config file and data base. In order to use LCR, add '-m' option. In this case the LCR replaces the built-in call control.
538 1 fixeria
539 3 fixeria
<pre>
540 5 laforge
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
541
</pre>
542 3 fixeria
543 1 fixeria
Very important is the option '-C'. On certain machines, osmo-nitb will halt from time to time while writing counters to database. This Without this option, audio might interrupt several seconds from time to time.
544 2 fixeria
545 1 fixeria
The debugging is useful for early tests, because you will quickly see what happens if a mobile requests something.
546 3 fixeria
547 2 fixeria
<pre>
548
<0005> bsc_init.c:423 
549
WARNING: You are running an 'accept-all' network on a BTS that is not barred. This configuration is
550
likely to interfere with production GSM networks and should only be used in a RF shielded environment 
551
such as a faraday cage!
552
553
<001a> input/ipaccess.c:831 enabling ipaccess BSC mode
554 3 fixeria
DB: Database initialized.
555 2 fixeria
DB: Database prepared.
556
</code></pre>
557 3 fixeria
558
559
h4. 2.1 LCR (optional)
560 2 fixeria
561
562 3 fixeria
Start the LCR:
563 1 fixeria
564 3 fixeria
<pre>
565 1 fixeria
<code class="sh">
566 2 fixeria
sudo lcr start
567 3 fixeria
</code></pre>
568 2 fixeria
569
You should see following output:
570
571 3 fixeria
<pre>
572 2 fixeria
** LCR  Version 1.14
573
574
000000 DEBUG (in sip.cpp/sip_init() line 1997): SIP globals initialized
575
LCR 1.14 started, waiting for calls...
576
000000 TRACE 05.02.16 00:05:03.444 --: LCR 1.14 started, waiting for calls...
577 3 fixeria
</code></pre>
578 2 fixeria
579 3 fixeria
And following message at [[OpenBSC]] log:
580 2 fixeria
581 3 fixeria
<pre>
582 2 fixeria
<0006> mncc_sock.c:273 MNCC Socket has connection with external call control application
583
</code></pre>
584 3 fixeria
585 2 fixeria
586 5 laforge
h4. 3. [[OsmoBTS:]]
587 3 fixeria
588
589 5 laforge
And finally start the [[OsmoBTS:]] instance:
590 3 fixeria
591 2 fixeria
<pre>
592 3 fixeria
593 2 fixeria
<pre>
594
((*))
595
  |
596
 / \ [[OsmoBTS]]
597
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
598
...
599
<000a> trx_if.c:176 No response from tranceiver
600 3 fixeria
<000a> trx_if.c:176 No response from tranceiver
601 1 fixeria
<000a> trx_if.c:176 No response from tranceiver
602 2 fixeria
</code></pre>
603 3 fixeria
604
605
h2. Test
606
607
608 2 fixeria
609
h3. Location Updating
610 3 fixeria
611 2 fixeria
612 3 fixeria
Switch on the phone.
613 2 fixeria
614
If you have a SIM card for your network MCC/MNC, you can use it and do automatic network search. If not, do a manual network and select this network. You should see debugging output on [[OpenBSC]] like this:
615
616 3 fixeria
<pre>
617 2 fixeria
...
618
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
619 3 fixeria
...
620 2 fixeria
</code></pre>
621
622 3 fixeria
623
h3. USSD
624
625 5 laforge
Request @*#100#@ to know which phone number is associated with your IMSI.
626 3 fixeria
627
628 2 fixeria
h3. Call the music (LCR required)
629
630
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
631 3 fixeria
632
633 2 fixeria
h3. Echo and BFI test (LCR required)
634
635
Enter phone number 993 to select the test function 3 of LCR. This test function echoes back everything that is received. Note that it will re-transcode the speech data, so the audio from your voice is compressed and decompressed twice until you can hear a fraction of a second later.
636
637 3 fixeria
You may experience short beeps. These beeps represent all bad frames that could not be decoded or got lost over the air. (Without this test, the missing frames will be extrapolated from previous frame, so some loss rate will not be recognized by the remote end.)
638 2 fixeria
639 3 fixeria
640
h2. VTY control interface
641
642 2 fixeria
It is possible (of course) to control your working setup manually. Connect the [[OpenBSC]] VTY telnet interface (port 4242 by default):
643
644
<pre>
645
telnet localhost 4242
646
en
647 1 fixeria
648 2 fixeria
# Type 'list' for help
649 1 fixeria
# Go to 'configure terminal' if you want to change some configuration params
650 3 fixeria
651 2 fixeria
[[OpenBSC]]#
652
  help        Description of the interactive help system
653
  list        Print command list
654 1 fixeria
  write       Write running configuration to memory, network, or terminal
655 2 fixeria
  show        Show running system information
656
  exit        Exit current mode and down to previous mode
657
  disable     Turn off privileged mode command
658
  configure   Configuration from vty interface
659
  copy        Copy configuration
660
  terminal    Set terminal line parameters
661
  who         Display who is on vty
662
  logging     Configure log message to this terminal
663
  drop        Debug/Simulation command to drop Abis/IP BTS
664
  bts         BTS related commands
665
  sms         SMS related comamnds
666
  subscriber  Operations on a Subscriber
667
  sms-queue   SMS Queue
668
  meas-feed   Measurement export related
669
670 3 fixeria
# Example: sending an SMS
671 2 fixeria
subscriber imsi <IMSI> sms sender imsi <IMSI2> send Hello, world!
672 1 fixeria
</code></pre>
673 3 fixeria
674 2 fixeria
See "VTY reference":http://openbsc.osmocom.org/trac/wiki/osmo-nitb_VTY for details.
675
676 3 fixeria
677 5 laforge
h1. [[CalypsoBTS]] with OpenBTS
678 2 fixeria
679 3 fixeria
680 5 laforge
OpenBTS is another open source software project aimed to replace legacy telecommunication protocols and traditionally complex, proprietary hardware systems by IP a flexible software architecture. It implements the BTS side protocol stack and also some core network elements like [[OpenBSC:]] in [[OsmoNITB:]] mode.
681 3 fixeria
682
683
h3. Installation and configuration
684
685
686 5 laforge
Follow this "howto":https://github.com/RangeNetworks/dev/wiki in the project wiki. Once you have OpenBTS up and running, you need to change the following configuration parameters in the database (/etc/OpenBTS/OpenBTS.db):
687 2 fixeria
688
<pre>
689
Control.GSMTAP.TargetIP = 127.0.0.1
690 1 fixeria
GSM.Radio.NeedBSIC = 1
691
GSM.Radio.Band = 1800
692 2 fixeria
GSM.CellSelection.Neighbors =   (set to empty string)
693
GSM.RACH.MaxRetrans = 3
694
GSM.RACH.TxInteger = 8
695
GSM.Radio.C0 = <your ARFCN>
696 3 fixeria
Control.LUR.OpenRegistration = ^26242.*$ (see note)
697 2 fixeria
</code></pre>
698
699
**Note:** in this example only IMSIs with MCC 262 and the MNC 42 will be allowed to register to the network, change that accordingly.
700
701 3 fixeria
702 2 fixeria
h3. TRX executable
703 3 fixeria
704 5 laforge
Make sure that OpenBTS in not running. In the folder where the OpenBTS executable resides, create a script with the filename 'transceiver' with the following content:
705 3 fixeria
706
<pre>
707 2 fixeria
#!/bin/bash
708
exec <your path to osmocom-bb>/src/host/layer23/src/transceiver/transceiver -a <ARFCN> -r 99
709 3 fixeria
</code></pre>
710 2 fixeria
711
Where ARFCN is the channel of clock source cell.
712
And make it executable:
713
714 3 fixeria
<pre>
715
<code class="sh">
716 2 fixeria
sudo chmod +x transceiver
717 3 fixeria
</code></pre>
718 1 fixeria
719
720 3 fixeria
h2. Running
721
722
723 1 fixeria
Run TRX application on the phone as described above.
724
725 5 laforge
You now can start up OpenBTS and should hopefully see the BTS by performing a manual network search with your phone. Monitor the output of osmocon and the transceiver/OpenBTS to see if all goes well. If anything should fail, reboot the phone and start over. 
726 1 fixeria
727 5 laforge
The OpenBTS CLI allows you to monitor system status and change many operating parameters of OpenBTS and the Transceiver in real time. Its executable is located at /OpenBTS/OpenBTSCLI.
728 1 fixeria
729
Have a fun!
Add picture from clipboard (Maximum size: 48.8 MB)