Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 31

laforge, 02/19/2016 10:47 PM

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