Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 43

wirelesss, 12/09/2016 09:59 AM

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