Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 48

laforge, 11/07/2023 04:01 PM
git:// deprecation

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 47 laforge
Additional information related to OsmoTRX is available at [[OsmoTRX:]].
91 32 laforge
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 1 jolly
97 17 jolly
The latest version can downloaded via git:
98 32 laforge
<pre>
99 47 laforge
git clone http://git.eversberg.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
h4. calypso-BTS
401
402
403 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.
404
405
The latest version can downloaded via git:
406 1 jolly
<pre>
407 48 laforge
git clone https://gitea.osmocom.org/sdr/libosmo-dsp
408
git clone https://gitea.osmocom.org/phone-side/osmocom-bb
409 32 laforge
</pre>
410 7 jolly
411 1 jolly
In order to compile Osmocom-BB with transceiver support, do the following:
412 32 laforge
<pre>
413 13 jolly
cd libosmo-dsp
414 17 jolly
autoreconf -i
415 1 jolly
./configure
416 20 jolly
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
417
make
418
make install
419
cd ..
420
421
cd osmocom-bb
422 17 jolly
# change branch:
423 13 jolly
git checkout -b jolly/testing origin/jolly/testing
424 20 jolly
cd src
425
make
426
# after it compiles, just enable transceiver support
427
cd host/layer23
428
./configure --enable-transceiver
429
make
430 32 laforge
</pre>
431 20 jolly
432 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).*
433 13 jolly
434
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:
435
436 32 laforge
<pre>
437 13 jolly
bts 0
438
 band DCS1800
439
 ipa unit-id 1801 0
440
 oml remote-ip 127.0.0.1
441
 rtp jitter-buffer 0
442 1 jolly
 paging queue-size 200
443 21 jolly
 paging lifetime 0
444 26 jolly
 fn-advance 30
445
 ms-power-loop -60
446
 timing-advance-loop
447
 settsc
448
 setbsic
449
 trx 0
450
  rxgain 0
451
  power 0
452
  slotmask 1 0 0 0 0 0 0 0
453 32 laforge
</pre>
454 26 jolly
455
Run osmocon and transceiver application in separate shells:
456
457 32 laforge
<pre>
458 26 jolly
# Please refer to Osmocom-BB wiki for compiling and running own firmware on compal phones...
459
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
460 32 laforge
</pre>
461 26 jolly
462 32 laforge
<pre>
463 26 jolly
transceiver -e 5 -r 99
464 32 laforge
</pre>
465 26 jolly
466
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:
467
468 32 laforge
<pre>
469 26 jolly
  slotmask 1 1 0 0 0 0 0 0
470 32 laforge
</pre>
471 26 jolly
472
Run two osmocon and transceiver application in separate shells:
473
474 32 laforge
<pre>
475 26 jolly
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
476 32 laforge
</pre>
477 26 jolly
478 32 laforge
<pre>
479 26 jolly
# This osmocon connects to the serial interface of the second phone.
480
# Note: "/tmp/osmocom_l2.2" is the second socket to which the transceiver will connect.
481
osmocon -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -m c123xor -c path_to/trx.highram.bin -r 99
482 32 laforge
</pre>
483 26 jolly
484 32 laforge
<pre>
485 26 jolly
transceiver -e 5 -r 99 -2
486
</pre>
487
488 32 laforge
h3. Linux-Call-Router (LCR) (optional)
489
490
491 26 jolly
Run LCR with debugging output.
492
493 32 laforge
<pre>
494 26 jolly
lcr start
495 32 laforge
</pre>
496 7 jolly
497 32 laforge
<pre>
498 17 jolly
** LCR  Version 1.14
499 7 jolly
500
LCR 1.14 started, waiting for calls...
501 32 laforge
</pre>
502 7 jolly
503
504
505 32 laforge
h2. Test
506 7 jolly
507 32 laforge
508
509
h3. Location Updating
510
511
512 1 jolly
Switch on the phone.
513 9 jolly
514 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:
515 32 laforge
<pre>
516 9 jolly
...
517
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
518
...
519 32 laforge
</pre>
520 9 jolly
521
522
523 32 laforge
h3. Call the music (LCR required)
524
525
526 9 jolly
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
527 17 jolly
528 9 jolly
529
530 32 laforge
h3. Echo and BFI test (LCR required)
531
532
533 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.
534
535
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.)
536
537 30 jolly
538 32 laforge
h2. See also
539
540
541 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)