Project

General

Profile

SDR PHY » History » Version 15

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