Project

General

Profile

CalypsoBTS » History » Version 1

fixeria, 02/19/2016 10:49 PM

1 1 fixeria
= CalypsoBTS =
2
3
This tutorial describes how to turn cheap Calypso based phone(s) into a BTS. Due to hardware limitations the CalypsoBTS setup cannot provide normal quality of service and only can be used to learn how the base stations works. Because Calypso based phone cannot perform BTS functionality itself, in this tutorial we consider how to use it with [http://openbsc.osmocom.org/trac/wiki/OsmoBTS OsmoBTS] and [http://openbts.org/ OpenBTS] front-ends.
4
5
== Requirements ==
6
7
First of all you have to understand what you're doing and possible consequences. You can use the frequencies you have valid license for. In many countries you cannot operate any GSM RF equipment unless you have obtained a proper license from the regulatory authority. Accomplishing to operate a BTS without having such a license and/or interfering with a public telecommunications network is a crime and punishable under applicable law! 
8
9
Also you need to have a [http://bb.osmocom.org/trac/wiki/Software/GettingStarted working setup] of OsmocomBB. And finally some things can be differ in your distribution, so you should be able to solve possible problems yourself because it's your machine.
10
11
== TRX preparation ==
12
There are two OsmocomBB branches provide the transceiver firmware and application. I advice you to use the jolly/testing branch because it have multiple phones support. The transceiver app is an external interface of CalypsoBTS which abstracts a BTS software from the L1 physical layer. It needs libosmo-dsp as a dependency:
13
14
{{{
15
#!sh
16
git clone git://git.osmocom.org/libosmo-dsp.git
17
cd libosmo-dsp/
18
autoreconf -i
19
./configure
20
make
21
sudo make install
22
cd ..
23
}}}
24
25
Then clone and compile the jolly/testing branch:
26
27
{{{
28
#!sh
29
# Get the sources	
30
git clone git://git.osmocom.org/osmocom-bb.git trx
31
cd trx/
32
git checkout jolly/testing
33
cd src/
34
35
# It needs TX support
36
# Just uncomment 'CFLAGS += -DCONFIG_TX_ENABLE' in target/firmware/Makefile
37
38
# And make with transceiver support
39
make HOST_layer23_CONFARGS=--enable-transceiver
40
}}}
41
42
And at this step your transceiver is ready. Let's check how it works!
43
44
==== A bit of theory ====
45
46
It is very important to have a good clock synchronization between the BTS and mobile phones. Time-division (TDMA) systems require very accurate counting of the time segments and when they start and stop. If the towers clocking were out of sync, then communications would falter as each node would be trying to deal with segments that were slightly offset and this would introduce errors. The GPS signals can be used as clock source. But there is more simple way to grab the clock from existing public mobile networks.
47
48
Using [wiki:rssi.bin RSSI] or cell_log find the strongest cell and remember it's ARFCN number.
49
50
==== Usage ====
51
52
{{{
53
Usage: ./transceiver -a arfcn_sync
54
Some useful options:
55
  -h   --help             this text
56
  -d   --debug MASK       Enable debugging (e.g. -d DL1C:DTRX)
57
  -e   --log-level LOGL   Set log level (1=debug, 3=info, 5=notice)
58
  -D   --daemonize        For the process into a background daemon
59
  -s   --disable-color    Don't use colors in stderr log output
60
  -a   --arfcn-sync ARFCN Set ARFCN to sync to
61
  -p   --arfcn-sync-pcs   The ARFCN above is PCS
62
  -2   --second-phone     Use second phone for TS 1
63
  -r   --realtime PRIO    Set realtime scheduler with given prio
64
}}}
65
66
Where --arfcn-sync or --arfcn-sync-pcs indicates the '''ARFCN of clock source cell'''. High priority scheduling required for handling bursts (-r 99). Just try to sync:
67
68
{{{
69
#!sh
70
# Load the TRX firmware in first terminal
71
cd trx/src/
72
sudo host/osmocon/osmocon -r 99 -m c123xor -p /dev/ttyUSB0 -c target/firmware/board/compal_e88/trx.highram.bin
73
74
# In second terminal run the transceiver
75
cd trx/src/host/layer23/src/transceiver/
76
sudo ./transceiver -a <ARFCN> -r 99
77
}}}
78
79
And you should see something like this:
80
81
{{{
82
<0012> l1ctl.c:383 Reset received: Starting sync.
83
<0012> l1ctl.c:338 Sync acquired, setting BTS mode ...
84
<0011> trx.c:194 TRX CLK Indication 1255520
85
<0011> trx.c:194 TRX CLK Indication 1255571
86
<0011> trx.c:194 TRX CLK Indication 1255622
87
<0011> trx.c:194 TRX CLK Indication 1255673
88
<0011> trx.c:194 TRX CLK Indication 1255724
89
<0011> trx.c:194 TRX CLK Indication 1255775
90
<0011> trx.c:194 TRX CLK Indication 1255826
91
<0011> trx.c:194 TRX CLK Indication 1255877
92
<0011> trx.c:194 TRX CLK Indication 1255928
93
<0011> trx.c:194 TRX CLK Indication 1255979
94
<0011> trx.c:194 TRX CLK Indication 1256030
95
<0011> trx.c:194 TRX CLK Indication 1256081
96
...
97
}}}
98
99
If something goes wrong, find another ARFCN and try again.
100
101
== CalypsoBTS with OsmoBTS ==
102
[http://openbsc.osmocom.org/trac/wiki/OsmoBTS OsmoBTS] is a software implementation of Layer2/3 of a BTS. Currently it supports a few hardware back-ends only:
103
104
* Multiple indoor and outdoor BTS products called ​sysmoBTS which is sold by ​[http://sysmocom.de/ sysmocom].
105
* Multiple indoor and outdoor ​fairwaves BTSs, like UmDESK and UmSITE.
106
* Wideband SDR transceiver hardware supported by OpenBTS transceiver or [http://openbsc.osmocom.org/trac/wiki/OsmoTRX OsmoTRX] PHY layer software, including the UmTRX, the USRP family, etc.
107
* A pretty crazy experimental BTS hardware based on several OsmocomBB phones.
108
109
The simplest way to test how it works is to use OsmoBTS with OpenBSC in NiTB mode. Refer [http://openbsc.osmocom.org/trac/wiki/OpenBSC project home] for details. NiTB is a simple core network implementation - network in the box. It emulates basic core elements like MSC, HLR, VLR, etc.
110
111
=== Dependences ===
112
Make sure that you have installed [http://bb.osmocom.org/trac/wiki/libosmocore libosmocore].
113
114
Install/update the following packages in your distribution:
115
116
{{{sudo apt-get install sqlite3 libdbi-dev libdbd-sqlite3 libsctp-dev}}}
117
118
==== oRTP ====
119
This package installs the open source RTP protocol required for libosmo-abis. It can be downloaded at [http://download.savannah.gnu.org/releases/linphone/ortp/sources/]. Current OsmoBTS source works fine with **0.22.0 oRTP** version only. Otherwise there may be problems with voice support.
120
121
{{{
122
#!sh
123
wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz
124
tar -xvf ortp-0.22.0.tar.gz
125
cd ortp-0.22.0/
126
./configure
127
make
128
sudo make install
129
sudo ldconfig
130
cd ..
131
}}}
132
133
==== libosmo-abis ====
134
135
{{{git clone git://git.osmocom.org/libosmo-abis.git}}}
136
137
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: 
138
139
{{{PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....}}}
140
141
{{{
142
#!sh
143
cd libosmo-abis
144
autoreconf -i
145
./configure
146
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
147
make
148
sudo make install
149
sudo ldconfig
150
cd ..
151
}}}
152
153
==== libosmo-netif ====
154
155
This package is dependency of OsmoNITB.
156
157
{{{
158
#!sh
159
git clone git://git.osmocom.org/libosmo-netif.git
160
cd libosmo-netif/
161
autoreconf -i
162
./configure
163
make
164
sudo make install
165
sudo ldconfig
166
cd ..
167
}}}
168
169
=== OsmoNITB ===
170
171
The latest version can downloaded via git:
172
173
{{{git clone git://git.osmocom.org/openbsc.git}}}
174
175
Finish the installation:
176
177
{{{
178
#!sh
179
cd openbsc/openbsc/
180
autoreconf -i
181
./configure
182
make
183
sudo make install
184
cd ../..
185
}}}
186
187
=== OsmoBTS ===
188
189
The latest version can downloaded via git:
190
191
{{{git clone git://git.osmocom.org/osmo-bts.git}}}
192
193
Finish the installation:
194
195
{{{
196
#!sh
197
cd osmo-bts
198
autoreconf -i
199
./configure --enable-trx
200
make
201
sudo make install
202
cd ..
203
}}}
204
205
=== Configuration ===
206
207
Now wee need to configure OpenBSC and OsmoBTS to work together with CalypsoBTS.
208
209
{{{
210
#!sh
211
# Create the configuration folder if it isn't exist yet
212
mkdir ~/.osmocom
213
214
cd ~/.osmocom
215
touch ~/.osmocom/open-bsc.cfg
216
touch ~/.osmocom/osmo-bts.cfg
217
}}}
218
219
Then init default configuration:
220
221
{{{
222
#!sh
223
# Run OpenBSC
224
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
225
226
# In another terminal
227
telnet localhost 4242
228
en
229
write file
230
exit
231
232
# Kill OpenBSC
233
Ctrl + C
234
}}}
235
236
Configure OsmoBTS manually:
237
238
{{{
239
bts 0
240
 band DCS1800
241
 ipa unit-id 1801 0
242
 oml remote-ip 127.0.0.1
243
 rtp jitter-buffer 0
244
 paging queue-size 200
245
 paging lifetime 0
246
 fn-advance 30
247
 ms-power-loop -60
248
 timing-advance-loop
249
 settsc
250
 setbsic
251
 trx 0
252
  rxgain 0
253
  power 0
254
  slotmask 1 0 0 0 0 0 0 0
255
}}}
256
257
**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).**
258
259
In case of one phone as TRX only one timeslot will be available for OsmoBTS. This is enough for basic network functionality including SMS and USSD support. For the voice calls support you need one more phone serving a TCH channel. In case of two phones change slotmask to:
260
261
{{{slotmask 1 1 0 0 0 0 0 0}}}
262
263
Now find and change following initial config parameters of OpenBSC.
264
265
{{{
266
# In network section
267
network country code <MNC (for test use 001)>
268
mobile network code <MCC (for test use 01)>
269
short name <NAME>
270
long name <NAME>
271
272
# In trx[0] section
273
arfcn <your BTS ARFCN (see note)>
274
}}}
275
276
'''Warning:''' Only use an ARFCN you have a '''valid license''' for.
277
278
WIP...
Add picture from clipboard (Maximum size: 48.8 MB)