Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 39

wirelesss, 12/08/2016 03:22 PM

1 32 laforge
{{>toc}}
2 31 laforge
3 38 wirelesss
h1. Installing a [[OsmoTRX:]] based GSM network from scratch
4 1 jolly
5 33 laforge
{{include(Disclaimer-user-content)}}
6 1 jolly
7 38 wirelesss
*This document is outdated by now and only applies if you would like to use hardware based on [[OsmoTRX:]]!*
8 32 laforge
9 38 wirelesss
This document describes how to install, configure and run [[OsmoTRX:]], [[OsmoBTS:]], [[osmo-nitb|OsmoNITB:]] and LCR.
10 32 laforge
11 1 jolly
In order to use this quick howto, you must have basic knowledge about GIT and be familiar with compiling packages from source.
12
13
14
15 32 laforge
h2. Prerequisite
16
17
18 23 jolly
These packages may be available from you distribution. If not, install them by hand as follows.
19
20 17 jolly
21 32 laforge
h3. opencore-amr (optional, for LCR only)
22 1 jolly
23
24 32 laforge
This package installs GSM adaptive multirate codecs and the EFR codec. The Full-Rate codec is included in LCR's repository.
25
26
<pre>
27 1 jolly
tar xvzf opencore-amr-x.x.x.tar.gz
28
cd opencore-amr-x.x.x
29 35 wirelesss
./configure
30
make
31
make install
32
ldconfig
33
cd ..
34 34 wirelesss
</pre>
35
36 1 jolly
37
38
h3. Sip-Sofia (optional, for LCR only)
39 32 laforge
40
41 1 jolly
This package installs the open source SIP stack of Nokia Research Center.
42
43 38 wirelesss
It can be downloaded at http://sourceforge.net/projects/sofia-sip/files/sofia-sip/":http://sourceforge.net/projects/opencore-amr/files/opencore-amr/
44 1 jolly
45
<pre>
46
tar xvzf sofia-sip-x.xx.xx.tar.gz
47
cd sofia-sip-x.xx.xx
48 35 wirelesss
./configure
49
make
50
make install
51
ldconfig
52
cd ..
53 34 wirelesss
</pre>
54
55 1 jolly
56
h3. oRTP
57
58
59
This package installs the open source RTP protocol required for libosmo-abis.
60
61
<pre>
62
tar xvzf ortp-x.xx.x.tar.gz
63
cd ortp-x.xx.x
64 35 wirelesss
./configure
65
make
66
make install
67
ldconfig
68
cd ..
69 1 jolly
</pre>
70 32 laforge
71 1 jolly
h3. others
72 32 laforge
73 1 jolly
74
sqlite3, libdbi, dbd-sqlite3 (driver) should should be available from your distribution.
75 32 laforge
76 1 jolly
77
78 35 wirelesss
h2. Building and installing 
79 1 jolly
80 34 wirelesss
81 39 wirelesss
Build the following projects according to:[[Build from source]]
82 1 jolly
83 35 wirelesss
* libosmocore
84
* libosmo-abis
85
* openbsc
86
* osmobts with @./configure --enable-trx@
87 34 wirelesss
88
89 38 wirelesss
h3. [[OsmoTRX:]]
90 28 ipse
91 32 laforge
92 38 wirelesss
Refer to page  [[OsmoTRX:]] for build instructions.
93 32 laforge
94
95
h3. Linux-Call-Router (LCR) (optional)
96
97
98 17 jolly
This package installs the open source PBX software to bridge ISDN (DSS1) / SIP / GSM (MNCC protocol)
99
100
The latest version can downloaded via git:
101 32 laforge
<pre>
102 17 jolly
git clone git://git.misdn.eu/lcr.git/
103 32 laforge
</pre>
104 17 jolly
105
Now configure, as described here:
106
107 32 laforge
<pre>
108 18 jolly
cd lcr
109 1 jolly
autoreconf -i
110 18 jolly
./configure --with-sip --with-gsm-bs --with-gsm-ms
111 32 laforge
</pre>
112 1 jolly
113
I strongly suggest not to use the Half-Rate codec (--enable-gsmhr) except for testing, because this codec is so slow, that only one or two calls may occupy CPU completely.
114
115 17 jolly
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:
116 32 laforge
<pre>
117 1 jolly
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
118 32 laforge
</pre>
119 17 jolly
120
The configure result should include:
121 32 laforge
<pre>
122 17 jolly
configure: Compiled with GSM network side support
123 1 jolly
configure: Compiled with GSM mobile side support
124
configure: Compiled with GSM half rate codec support
125 17 jolly
configure: Compiled with GSM AMR codec support
126
configure: Compiled with SIP support
127 32 laforge
</pre>
128 17 jolly
129
Finish the installation:
130 32 laforge
<pre>
131 17 jolly
make
132
make install
133
ldconfig
134
cd ..
135 32 laforge
</pre>
136 17 jolly
137
138
139 32 laforge
h2. Configuration examples
140 17 jolly
141 32 laforge
142
143 38 wirelesss
h3. [[OsmoBTS:]]
144 32 laforge
145
146
<pre>
147 3 jolly
mkdir ~/.osmocom
148
edit ~/.osmocom/osmo-bts.cfg
149 32 laforge
</pre>
150 3 jolly
151 32 laforge
<pre>
152 2 jolly
bts 0
153 3 jolly
 band DCS1800
154 2 jolly
 ipa unit-id 1801 0
155
 oml remote-ip 127.0.0.1
156
 rtp bind-ip 127.0.0.1
157
 rtp jitter-buffer 0
158
 paging lifetime 0
159
 gsmtap-sapi bcch
160
 gsmtap-sapi ccch
161
 gsmtap-sapi rach
162
 gsmtap-sapi agch
163 1 jolly
 gsmtap-sapi pch
164 2 jolly
 gsmtap-sapi sdcch
165
 gsmtap-sapi pacch
166
 gsmtap-sapi pdtch
167
 gsmtap-sapi sacch
168
 fn-advance 20
169
 ms-power-loop -10
170
 timing-advance-loop
171
 trx 0
172
  rxgain 0
173
  power 0
174 32 laforge
</pre>
175 1 jolly
176 4 jolly
177
178 38 wirelesss
h3. [[OpenBSC:]]
179 32 laforge
180
181
<pre>
182 4 jolly
mkdir ~/.osmocom
183
edit ~/.osmocom/open-bsc.cfg
184 32 laforge
</pre>
185 4 jolly
186 32 laforge
*Be sure to change 'arfcn' to a frequency you have license for!*
187 4 jolly
188 32 laforge
<pre>
189 4 jolly
e1_input
190
 e1_line 0 driver ipa
191
 e1_line 0 port 0
192
network
193
 network country code 262
194
 mobile network code 42
195 32 laforge
 short name [[OpenBSC]]
196
 long name [[OpenBSC]]
197 4 jolly
 auth policy accept-all
198
 location updating reject cause 13
199
 encryption a5 0
200
 neci 1
201
 paging any use tch 0
202 1 jolly
 rrlp mode ms-based
203 4 jolly
 mm info 1
204 1 jolly
 handover 0
205
 handover window rxlev averaging 10
206
 handover window rxqual averaging 1
207
 handover window rxlev neighbor averaging 10
208
 handover power budget interval 6
209
 handover power budget hysteresis 3
210
 handover maximum distance 9999
211
 timer t3101 10
212 4 jolly
 timer t3103 0
213 1 jolly
 timer t3105 0
214
 timer t3107 0
215 4 jolly
 timer t3109 0
216
 timer t3111 0
217 1 jolly
 timer t3113 60
218
 timer t3115 0
219
 timer t3117 0
220 22 jolly
 timer t3119 0
221 1 jolly
 timer t3122 10
222
 timer t3141 0
223 4 jolly
 dtx-used 0
224
 subscriber-keep-in-ram 0
225 1 jolly
 bts 0
226 4 jolly
  type sysmobts
227
  band DCS1800
228
  cell_identity 0
229
  location_area_code 1
230 1 jolly
  training_sequence_code 7
231
  base_station_id_code 63
232
  ms max power 0
233
  cell reselection hysteresis 4
234
  rxlev access min 0
235
  periodic location update 30
236 4 jolly
  channel allocator descending
237
  rach tx integer 9
238 1 jolly
  rach max transmission 7
239 4 jolly
  channel-descrption attach 1
240
  channel-descrption bs-pa-mfrms 5
241
  channel-descrption bs-ag-blks-res 1
242
  ip.access unit_id 1801 0
243
  oml ip.access stream_id 255 line 0
244
  neighbor-list mode automatic
245 1 jolly
  trx 0
246 4 jolly
   rf_locked 0
247
   arfcn 869
248
   nominal power 0
249
   max_power_red 0
250
   rsl e1 tei 0
251
    timeslot 0
252 1 jolly
     phys_chan_config CCCH+SDCCH4
253
     hopping enabled 0
254
    timeslot 1
255 4 jolly
     phys_chan_config TCH/F
256 1 jolly
     hopping enabled 0
257
    timeslot 2
258
     phys_chan_config TCH/F
259
     hopping enabled 0
260
    timeslot 3
261
     phys_chan_config TCH/F
262
     hopping enabled 0
263
    timeslot 4
264
     phys_chan_config TCH/F
265 4 jolly
     hopping enabled 0
266
    timeslot 5
267 5 jolly
     phys_chan_config TCH/F
268 4 jolly
     hopping enabled 0
269 1 jolly
    timeslot 6
270 4 jolly
     phys_chan_config TCH/F
271 17 jolly
     hopping enabled 0
272 4 jolly
    timeslot 7
273 12 jolly
     phys_chan_config TCH/F
274
     hopping enabled 0
275 32 laforge
</pre>
276 12 jolly
277
278 1 jolly
279 32 laforge
h3. Linux-Call-Router (LCR) (optional)
280 1 jolly
281 32 laforge
282
283
h4. options.conf
284
285
286
<pre>
287 12 jolly
edit /usr/local/etc/lcr/options.conf
288 32 laforge
</pre>
289 12 jolly
290
Add a line to show logging to the console:
291 32 laforge
<pre>
292 4 jolly
debug 0x100000
293 32 laforge
</pre>
294 4 jolly
295 1 jolly
296
297 32 laforge
h4. interface.conf
298
299
300 1 jolly
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.
301
302 32 laforge
<pre>
303 1 jolly
edit /usr/local/etc/lcr/interface.conf
304 32 laforge
</pre>
305 1 jolly
306
You can remove (or comment out) everything and just add this interface:
307
308 32 laforge
<pre>
309 4 jolly
[gsm]
310 1 jolly
gsm-bs
311
tones yes
312
earlyb no
313
extern
314 32 laforge
</pre>
315 4 jolly
316
317 32 laforge
h4. routing.conf
318
319
320
<pre>
321 4 jolly
edit /usr/local/etc/lcr/routing.conf
322 32 laforge
</pre>
323 4 jolly
324
You can remove (or comment out) everything and just add these rulesets:
325
326 32 laforge
<pre>
327 4 jolly
[main]
328
interface=gsm                           : goto ruleset=gsm
329
                                        : disconnect cause=31
330
331 1 jolly
[gsm]
332
dialing=99                              : test
333 4 jolly
                                        : extern interfaces=gsm
334 32 laforge
</pre>
335 1 jolly
336 6 jolly
Look at the main rule set. All calls from interface 'gsm' are forwarded to rule set 'gsm'.
337
338
Look at the gsm rule set. All calls that dial '99' prefix, will be test calls. All other calls will be forwarded back to 'gsm' interface.
339
340
341
342 32 laforge
h2. Running
343
344
345 17 jolly
I suggest to have one shell for every process to run, rather than stating all processes as damon from one shell. Not starting as deamon allows to easily see the debugging output.
346 1 jolly
347 9 jolly
348 38 wirelesss
h3. [[OpenBSC:]]
349 1 jolly
350 32 laforge
351 38 wirelesss
Open a shell and start [[OpenBSC:]]:
352 32 laforge
353
<pre>
354 1 jolly
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
355 32 laforge
</pre>
356 1 jolly
357 38 wirelesss
[[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.
358 1 jolly
359 32 laforge
<pre>
360 6 jolly
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
361 32 laforge
</pre>
362 1 jolly
363 6 jolly
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.
364
365 1 jolly
The debugging is usefull for early tests, because you will quickly see what happens if a mobile requests something.
366
367 32 laforge
<pre>
368 6 jolly
<0005> bsc_init.c:422 
369
WARNING: You are running an 'accept-all' network on a BTS that is not barred.
370 1 jolly
This configuration is likely to interfere with production GSM networks and
371
should only be used in a RF shielded environment such as a faraday cage!
372
373 6 jolly
<0019> input/ipaccess.c:925 enabling ipaccess BSC mode
374
DB: Database initialized.
375 1 jolly
DB: Database prepared.
376
<001d> sms_queue.c:220 Attempting to send 20 SMS
377 32 laforge
</pre>
378 6 jolly
379 1 jolly
380
381 38 wirelesss
h3. [[OsmoBTS:]]
382 1 jolly
383 32 laforge
384 38 wirelesss
Open a shell and start [[OsmoBTS:]]:
385 32 laforge
386
<pre>
387 6 jolly
osmobts-trx -c ~/.osmocom/osmo-bts.cfg
388 32 laforge
</pre>
389 1 jolly
390 32 laforge
<pre>
391 1 jolly
((*))
392
  |
393 32 laforge
 / \ [[OsmoBTS]]
394 1 jolly
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
395 6 jolly
...
396
<000a> trx_if.c:176 No response from tranceiver
397 1 jolly
<000a> trx_if.c:176 No response from tranceiver
398 6 jolly
<000a> trx_if.c:176 No response from tranceiver
399 32 laforge
</pre>
400 1 jolly
401
402
403 38 wirelesss
h3. [[OsmoTRX:]]
404 6 jolly
405
406 38 wirelesss
Refer to the [[OsmoTRX:]] page on how to run [[OsmoTRX:]].
407 1 jolly
408
409 38 wirelesss
h4. [[UmTRX:]]
410 6 jolly
411 32 laforge
412 38 wirelesss
The installation/setup/calibration of [[UmTRX:]] is beyond the scope of this document. Please refer to:
413 32 laforge
414
* https://github.com/fairwaves
415
* http://files.ettus.com/uhd_docs/manual/html/build.html
416
* http://wush.net/trac/rangepublic/wiki/BuildInstallRun
417
418
419
h4. calypso-BTS
420
421
422 7 jolly
Building Osmocom-BB with arm-elf toolchain is also beyond the scope of this document. If you managed to compile and run Osmocom-BB you should be able to run the transceiver too.
423
424
The latest version can downloaded via git:
425 32 laforge
<pre>
426 7 jolly
git clone git://git.osmocom.org/libosmo-dsp.git
427
git clone git://git.osmocom.org/osmocom-bb.git
428 32 laforge
</pre>
429 7 jolly
430 1 jolly
In order to compile Osmocom-BB with transceiver support, do the following:
431 32 laforge
<pre>
432 13 jolly
cd libosmo-dsp
433 17 jolly
autoreconf -i
434 1 jolly
./configure
435 20 jolly
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
436
make
437
make install
438
cd ..
439
440
cd osmocom-bb
441 17 jolly
# change branch:
442 13 jolly
git checkout -b jolly/testing origin/jolly/testing
443 20 jolly
cd src
444
make
445
# after it compiles, just enable transceiver support
446
cd host/layer23
447
./configure --enable-transceiver
448
make
449 32 laforge
</pre>
450 20 jolly
451 32 laforge
*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).*
452 13 jolly
453
Now you should start with a single phone for one timeslot only. If it works, you can try two phones to serve two timeslots. Since you have only one slot, you will only be able to transmit broadcast, do location updating and send/receive SMS. Here is the "osmo-bts.cfg" for a single timeslot:
454
455 32 laforge
<pre>
456 13 jolly
bts 0
457
 band DCS1800
458
 ipa unit-id 1801 0
459
 oml remote-ip 127.0.0.1
460
 rtp jitter-buffer 0
461 1 jolly
 paging queue-size 200
462 21 jolly
 paging lifetime 0
463 26 jolly
 fn-advance 30
464
 ms-power-loop -60
465
 timing-advance-loop
466
 settsc
467
 setbsic
468
 trx 0
469
  rxgain 0
470
  power 0
471
  slotmask 1 0 0 0 0 0 0 0
472 32 laforge
</pre>
473 26 jolly
474
Run osmocon and transceiver application in separate shells:
475
476 32 laforge
<pre>
477 26 jolly
# Please refer to Osmocom-BB wiki for compiling and running own firmware on compal phones...
478
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
479 32 laforge
</pre>
480 26 jolly
481 32 laforge
<pre>
482 26 jolly
transceiver -e 5 -r 99
483 32 laforge
</pre>
484 26 jolly
485
When using two phones, two timeslots can be served. I suggest to configure second timeslot (TS 1) as TCH/H at openbsc.cnf. This way it is possible to allow two traffic channels on a single timeslot. If you do a call from one phone to another, you will need one channel for each phone. In order to use two phones, you need to change the alot map of osmo-bts.cnf:
486
487 32 laforge
<pre>
488 26 jolly
  slotmask 1 1 0 0 0 0 0 0
489 32 laforge
</pre>
490 26 jolly
491
Run two osmocon and transceiver application in separate shells:
492
493 32 laforge
<pre>
494 26 jolly
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
495 32 laforge
</pre>
496 26 jolly
497 32 laforge
<pre>
498 26 jolly
# This osmocon connects to the serial interface of the second phone.
499
# Note: "/tmp/osmocom_l2.2" is the second socket to which the transceiver will connect.
500
osmocon -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -m c123xor -c path_to/trx.highram.bin -r 99
501 32 laforge
</pre>
502 26 jolly
503 32 laforge
<pre>
504 26 jolly
transceiver -e 5 -r 99 -2
505 32 laforge
</pre>
506 26 jolly
507
508
509 32 laforge
h3. Linux-Call-Router (LCR) (optional)
510
511
512 26 jolly
Run LCR with debugging output.
513
514 32 laforge
<pre>
515 26 jolly
lcr start
516 32 laforge
</pre>
517 7 jolly
518 32 laforge
<pre>
519 17 jolly
** LCR  Version 1.14
520 7 jolly
521
LCR 1.14 started, waiting for calls...
522 32 laforge
</pre>
523 7 jolly
524
525
526 32 laforge
h2. Test
527 7 jolly
528 32 laforge
529
530
h3. Location Updating
531
532
533 1 jolly
Switch on the phone.
534 9 jolly
535 38 wirelesss
If you have a SIM card for your network 262 42, 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:
536 32 laforge
<pre>
537 9 jolly
...
538
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
539
...
540 32 laforge
</pre>
541 9 jolly
542
543
544 32 laforge
h3. Call the music (LCR required)
545
546
547 9 jolly
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
548 17 jolly
549 9 jolly
550
551 32 laforge
h3. Echo and BFI test (LCR required)
552
553
554 9 jolly
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.
555
556
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.)
557
558 30 9600
559 32 laforge
h2. See also
560
561
562 38 wirelesss
* https://osmocom.org/projects/openbsc/wiki/Multi-BTS_with_handover -- NITB plus two dual channel BTS (based on [[OsmoBTS:]]) with handover support
Add picture from clipboard (Maximum size: 48.8 MB)