Project

General

Profile

SDR PHY » History » Version 8

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