Project

General

Profile

SDR PHY » History » Version 7

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