Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 34

wirelesss, 12/01/2016 01:16 PM

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