Project

General

Profile

SDR PHY » History » Version 4

fixeria, 01/23/2018 05:11 PM

1 2 fixeria
h1. SDR (Software Defined Radio) hardware
2
3
Unlike the obsolete [[Phones|Calypso based phones]], "SDR (Software Defined Radio)":https://en.wikipedia.org/wiki/Software-defined_radio has many advantages, providing much more freedom for the implementation of mobile side [[Software|GSM protocol stack]]. This page describes all steps required for running the higher layer (L2&3) applications (e.g. [[mobile]] or [[ccch_scan]]) on SDR hardware.
4
5
h2. SDR PHY vs Calypso
6
7
h3. What's so special about SDR?
8
9
* General purpose hardware
10
** i.e. not limited to any particular technology and/or protocol stack,
11
** could be used as PHY for GSM, LTE, IEE802.11, GPS, Bluetooth, etc.
12
* Becomes cheap and available for everyone
13
** e.g. RTL-SDR, LimeSDR-Mini
14
* Becomes even smaller than a credit card
15
** e.g. XTRX
16
* Open Source friendly
17
** GNU Radio, GQRX, OpenBTS, OsmoTRX, srsLTE, etc.
18
** some drivers, firmware and PCB schematics are available
19
20
h3. Advantages over Calypso
21
22
* No need to relay on a 'black box' DSP
23
* No hardware availability problem
24
* No reverse engineering required
25
* No freq. band limitations
26
27
h3. Disadvantages
28
29
* Low output power
30
* General purpose hardware
31
** No screen, no keyboard,
32
** No built-in SIM reader,
33
** No built-in audio
34
** etc.
35
36
h3. What is it for?
37
38
* Another hardware platform for [[OsmocomBB]]
39
* 100% Open Source GSM L1 implementation
40
** GSM TS 05.02 scheduling
41
** GSM TS 05.03 channel coding
42
** GSM TS 05.04 (de)modulation
43
** GSM TS 05.10 synchronization
44
45
h2. Supported SDR hardware
46
47
At the moment, only USRP hardware is supported via UHD driver. This limitation caused by the requirement of RX / TX time tags persistence.
48
49
The current implementation is known to work on the following devices:
50
51
* USRP B2X0, including 'mini'
52
* Fairwaves [[UmTRX:]]
53
54
h2. Software installation
55
56
The signal processing part is based on [[GR-GSM:]] (https://github.com/ptrkrysik/gr-gsm) project, which is represented by a set of "GNU Radio":https://www.gnuradio.org/ blocks for GSM. So, first of all you need to install "GNU Radio":https://www.gnuradio.org/ with compiled-in "UHD driver":http://files.ettus.com/manual/ support.
57
58
h3. 1. "UHD driver":http://files.ettus.com/manual/
59
60
Follow the "Installing and/or Building UHD" section of official project documentation. After the installation, make sure that your device is recognized properly:
61
62
<pre>
63
$ uhd_find_devices
64
$ uhd_usrp_probe
65
</pre>
66
67
h3. 2. "GNU Radio":https://www.gnuradio.org/
68
69
Despite "GNU Radio":https://www.gnuradio.org/ is available as a binary package on some distributions, we recommend to build the latest release version from source. Please follow the corresponding "building guide":https://wiki.gnuradio.org/index.php/BuildGuide.
70
71
During the build configuration process, make sure you have the following components:
72
73
* python-support
74
* gr-digital
75
* gr-filter
76
* gr-blocks
77
* gr-uhd
78
79
For binary or already installed builds, use the following command to get build info:
80
81
<pre>
82
$ gnuradio-config-info --enabled-components
83
</pre>
84
85
h3. 3. [[GR-GSM:]] with transceiver
86
87
For now, the transmitter implementation lives in separate branches. This manual compilation from source is required. "General building process":https://github.com/ptrkrysik/gr-gsm/wiki/Manual-compilation-and-installation and dependences are described in the "project's wiki":https://github.com/ptrkrysik/gr-gsm/wiki/.
88
89
<pre>
90
# Get the source code
91
$ git clone git://git.osmocom.org/gr-gsm
92
$ cd gr-gsm/
93
$ git checkout fixeria/trx
94
95
# Configure and compile
96
$ mkdir build
97
$ cd build
98
$ cmake ..
99
$ make
100
101
# Install
102
$ sudo make install
103
$ sudo ldconfig
104
</pre>
105
106
h3. 4. [[OsmocomBB:]]
107
108
You need to compile OsmocomBB with the [[TRX_Interface|TRX interface]] support. Please refer the corresponding [[TRX_Interface|wiki page]].
109
110
h2. Running
111
112 4 fixeria
First of all, please see [[SDR_PHY#Project-status|known limitations]].
113 2 fixeria
114
h3. Hardware preparation
115
116
You need to have two antennas connected: one for RX, another for TX. Both antennas should be chosen for a proper frequency band, otherwise the distance will be limited. Also, it's strongly recommended to use a band-pass filter for TX in order to *avoid interference*.
117
118
_Note: There is a bug of USRP B2X0 hardware, which affects the burst transmission quality. It appears when both transmission and reception are performed of the same side of device. To mitigate this, please use an attenuator or antenna with some resistance between the active pin and ground._
119
120
Finally, connect your SDR hardware and make sure it's working. 
121
122
h3. Transceiver
123
124
Check available configuration options:
125
126
<pre>
127
$ grgsm_trx --help
128
129
...
130
131
  TRX interface specific
132
   -i --remote-addr  Set remote address (default 127.0.0.1)
133
   -p --base-port    Set base port number (default 5700)
134
135
  Radio interface specific
136
   -a --device-args  Set device arguments
137
   -s --sample-rate  Set sample rate
138
   -g --rx-gain      Set RX gain (default 30)
139
   -G --tx-gain      Set TX gain (default 10)
140
      --rx-antenna   Set RX antenna (default RX2)
141
      --tx-antenna   Set TX antenna (default TX/RX)
142
      --ppm          Set frequency correction (default 0)
143
</pre>
144
145
If you already have another transceiver runing, e.g. [[OsmoTRX:]], choose a different TRX base port. Keep in mind that a single transceiver process occupies six UDP ports at the same time.
146
147
Choose proper RX / TX antennas and corresponding gain values depending on your device. TX gain requires more attention and should be set depending on your environment and antennas used. Feel free to use a spectrum browser, such as GQRX or osmocom_fft, for measuring the proper values.
148
149
PPM value is typically measured at runtime, so no need to specify it manually.
150
151
<pre>
152
$ grgsm_trx --rx-gain 30 --tx-gain 80
153
linux; GNU C++ version 4.8.5; Boost_105500; UHD_003.010.002.000-0-122bfae1
154
155
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
156
This is free software: you are free to change and redistribute it.
157
There is NO WARRANTY, to the extent permitted by law.
158
159
[i] Init Radio interface
160
-- Detected Device: B200
161
-- Operating over USB 3.
162
-- Initialize CODEC control...
163
-- Initialize Radio control...
164
-- Performing register loopback test... pass
165
-- Performing CODEC loopback test... pass
166
-- Setting master clock rate selection to 'automatic'.
167
-- Asking for clock rate 16.000000 MHz... 
168
-- Actually got clock rate 16.000000 MHz.
169
-- Performing timer loopback test... pass
170
-- Setting master clock rate selection to 'manual'.
171
-- Asking for clock rate 26.000000 MHz... 
172
-- Actually got clock rate 26.000000 MHz.
173
-- Performing timer loopback test... pass
174
-- Asking for clock rate 26.000000 MHz... OK
175
[i] Init CTRL interface
176
[i] Init complete
177
</pre>
178
179
At this step transceiver is ready.
180
181
h3. The trxcon application
182
183
As we don't use Calypso-based phones, the [[osmocon]] application is useless here. Instead, you need to run another application called trxcon. You should use the same TRX base port as specified to transceiver.
184
185
<pre>
186
$ cd osmocom-bb/src/
187
$ host/trxcon/trxcon
188
189
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
190
This is free software: you are free to change and redistribute it.
191
There is NO WARRANTY, to the extent permitted by law.
192
193
<0001> l1ctl_link.c:235 Init L1CTL link (/tmp/osmocom_l2)
194
<0003> trx_if.c:646 Init transceiver interface
195
<0005> sched_trx.c:112 Init scheduler
196
<0000> trxcon.c:277 Init complete
197
</pre>
198
199
See help details.
200
201
h3. L2&3 applications
202
203
At this step you should be able to run the higher layer applications.
204
205
For example, run [[ccch_scan]]:
206
207
<pre>
208
$ cd osmocom-bb/src/
209
$ cd host/layer23/src/misc/
210
$ ./ccch_scan -i 127.0.0.1 -a <ARFCN>
211
</pre>
212
213
It should synchronize with a BTS on specified ARFCN, and start decoding BCCH messages.
214
215
h2. Related pages
216
217
* [[TRX Interface]]
218
* [[FakeTRX]]
219
220
h2. Project status
221
222
Known limitations (not implemented):
223
224
* AGC (Automatic Gain Control)
225
* Power measurement
226
* Frequency Hopping
227
228
Work in progress:
229
230
* GAPK based audio back-end
231
* TCH/H implementation
232
233
Future plans:
234
235
* Extend supported hardware list (Soapy?)
236
* PC/SC physical SIM interface
237
* AMR (Adaptive Multi-Rate)
238
239
h2. Further reading / watching
240
241
https://media.ccc.de/v/34c3-8952-running_gsm_mobile_phone_on_sdr
242
TODO: publish the slides
Add picture from clipboard (Maximum size: 48.8 MB)