Project

General

Profile

SDR PHY » History » Version 5

fixeria, 01/23/2018 05:20 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 5 fixeria
!graph_trxcon.png!
57
58 2 fixeria
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.
59
60
h3. 1. "UHD driver":http://files.ettus.com/manual/
61
62
Follow the "Installing and/or Building UHD" section of official project documentation. After the installation, make sure that your device is recognized properly:
63
64
<pre>
65
$ uhd_find_devices
66
$ uhd_usrp_probe
67
</pre>
68
69
h3. 2. "GNU Radio":https://www.gnuradio.org/
70
71
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.
72
73
During the build configuration process, make sure you have the following components:
74
75
* python-support
76
* gr-digital
77
* gr-filter
78
* gr-blocks
79
* gr-uhd
80
81
For binary or already installed builds, use the following command to get build info:
82
83
<pre>
84
$ gnuradio-config-info --enabled-components
85
</pre>
86
87
h3. 3. [[GR-GSM:]] with transceiver
88
89
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/.
90
91
<pre>
92
# Get the source code
93
$ git clone git://git.osmocom.org/gr-gsm
94
$ cd gr-gsm/
95
$ git checkout fixeria/trx
96
97
# Configure and compile
98
$ mkdir build
99
$ cd build
100
$ cmake ..
101
$ make
102
103
# Install
104
$ sudo make install
105
$ sudo ldconfig
106
</pre>
107
108
h3. 4. [[OsmocomBB:]]
109
110
You need to compile OsmocomBB with the [[TRX_Interface|TRX interface]] support. Please refer the corresponding [[TRX_Interface|wiki page]].
111
112
h2. Running
113
114 4 fixeria
First of all, please see [[SDR_PHY#Project-status|known limitations]].
115 2 fixeria
116
h3. Hardware preparation
117
118
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*.
119
120
_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._
121
122
Finally, connect your SDR hardware and make sure it's working. 
123
124
h3. Transceiver
125
126
Check available configuration options:
127
128
<pre>
129
$ grgsm_trx --help
130
131
...
132
133
  TRX interface specific
134
   -i --remote-addr  Set remote address (default 127.0.0.1)
135
   -p --base-port    Set base port number (default 5700)
136
137
  Radio interface specific
138
   -a --device-args  Set device arguments
139
   -s --sample-rate  Set sample rate
140
   -g --rx-gain      Set RX gain (default 30)
141
   -G --tx-gain      Set TX gain (default 10)
142
      --rx-antenna   Set RX antenna (default RX2)
143
      --tx-antenna   Set TX antenna (default TX/RX)
144
      --ppm          Set frequency correction (default 0)
145
</pre>
146
147
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.
148
149
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.
150
151
PPM value is typically measured at runtime, so no need to specify it manually.
152
153
<pre>
154
$ grgsm_trx --rx-gain 30 --tx-gain 80
155
linux; GNU C++ version 4.8.5; Boost_105500; UHD_003.010.002.000-0-122bfae1
156
157
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
158
This is free software: you are free to change and redistribute it.
159
There is NO WARRANTY, to the extent permitted by law.
160
161
[i] Init Radio interface
162
-- Detected Device: B200
163
-- Operating over USB 3.
164
-- Initialize CODEC control...
165
-- Initialize Radio control...
166
-- Performing register loopback test... pass
167
-- Performing CODEC loopback test... pass
168
-- Setting master clock rate selection to 'automatic'.
169
-- Asking for clock rate 16.000000 MHz... 
170
-- Actually got clock rate 16.000000 MHz.
171
-- Performing timer loopback test... pass
172
-- Setting master clock rate selection to 'manual'.
173
-- Asking for clock rate 26.000000 MHz... 
174
-- Actually got clock rate 26.000000 MHz.
175
-- Performing timer loopback test... pass
176
-- Asking for clock rate 26.000000 MHz... OK
177
[i] Init CTRL interface
178
[i] Init complete
179
</pre>
180
181
At this step transceiver is ready.
182
183
h3. The trxcon application
184
185
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.
186
187
<pre>
188
$ cd osmocom-bb/src/
189
$ host/trxcon/trxcon
190
191
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
192
This is free software: you are free to change and redistribute it.
193
There is NO WARRANTY, to the extent permitted by law.
194
195
<0001> l1ctl_link.c:235 Init L1CTL link (/tmp/osmocom_l2)
196
<0003> trx_if.c:646 Init transceiver interface
197
<0005> sched_trx.c:112 Init scheduler
198
<0000> trxcon.c:277 Init complete
199
</pre>
200
201
See help details.
202
203
h3. L2&3 applications
204
205
At this step you should be able to run the higher layer applications.
206
207
For example, run [[ccch_scan]]:
208
209
<pre>
210
$ cd osmocom-bb/src/
211
$ cd host/layer23/src/misc/
212
$ ./ccch_scan -i 127.0.0.1 -a <ARFCN>
213
</pre>
214
215
It should synchronize with a BTS on specified ARFCN, and start decoding BCCH messages.
216
217
h2. Related pages
218
219
* [[TRX Interface]]
220
* [[FakeTRX]]
221
222
h2. Project status
223
224
Known limitations (not implemented):
225
226
* AGC (Automatic Gain Control)
227
* Power measurement
228
* Frequency Hopping
229
230
Work in progress:
231
232
* GAPK based audio back-end
233
* TCH/H implementation
234
235
Future plans:
236
237
* Extend supported hardware list (Soapy?)
238
* PC/SC physical SIM interface
239
* AMR (Adaptive Multi-Rate)
240
241
h2. Further reading / watching
242
243
https://media.ccc.de/v/34c3-8952-running_gsm_mobile_phone_on_sdr
244
TODO: publish the slides
Add picture from clipboard (Maximum size: 48.8 MB)