Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 46

fixeria, 07/11/2018 10:43 AM

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