Project

General

Profile

SDR PHY » History » Version 18

fixeria, 08/09/2018 07:17 PM

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