Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 44

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