Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 42

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