Difference between revisions of "RTL-SDR"

From YobiWiki
Jump to navigation Jump to search
m
 
(51 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
* http://rtlsdr.org/
 
* http://rtlsdr.org/
 
* http://www.rtl-sdr.com/ (blog)
 
* http://www.rtl-sdr.com/ (blog)
  +
* https://twitter.com/rtlsdrblog
  +
* [http://www.amazon.com/gp/product/B00KCDF1QI/ Kindle book]
 
* http://superkuh.com/rtlsdr.html (with list of apps)
 
* http://superkuh.com/rtlsdr.html (with list of apps)
   
 
==[http://www.trekstor.co.uk/detail-home-entertainment-en/product/dvb-t-stick-terres20.html Trekstor DVB-T Stick Terres 2.0]==
 
==[http://www.trekstor.co.uk/detail-home-entertainment-en/product/dvb-t-stick-terres20.html Trekstor DVB-T Stick Terres 2.0]==
  +
19.99€ at Saturn in Berlin
It contains hopefully the RTL2832U, together with Elonics E4000 tuner
 
  +
<br>It contains hopefully the RTL2832U, together with Elonics E4000 tuner
 
<br>Seen by lsusb as 1f4d:c803 G-Tek Electronics Group, which matches Lifeview LV5TDeluxe according to [http://sdr.osmocom.org/trac/wiki/rtl-sdr osmocom]
 
<br>Seen by lsusb as 1f4d:c803 G-Tek Electronics Group, which matches Lifeview LV5TDeluxe according to [http://sdr.osmocom.org/trac/wiki/rtl-sdr osmocom]
 
<br><br>/var/log/syslog
 
<br><br>/var/log/syslog
Line 30: Line 33:
 
E4K L-band gap: 1107 to 1241 MHz
 
E4K L-band gap: 1107 to 1241 MHz
 
</pre>
 
</pre>
  +
==[http://www.trekstor.co.uk/detail-apple-accessories/product/Terres%20mini.html Trekstor DVB-T Stick Terres mini]==
==rtl-sdr==
 
  +
29.99€ at Saturn in Berlin
sudo apt-get install rtl-sdr
 
  +
<br>'''NOT''' based on RTL2832!!
  +
<br>'''NOT recognized''' by rtl_test
  +
<pre>
  +
New USB device found, idVendor=187f, idProduct=0202
  +
New USB device strings: Mfr=1, Product=2, SerialNumber=0
  +
Product: MDTV Receiver
  +
Manufacturer: MDTV Receiver
  +
firmware: agent aborted loading dvb_nova_12mhz_b0.inp (not found?)
  +
</pre>
  +
<pre>
  +
$ rtl_test -t
  +
No supported devices found.
  +
</pre>
  +
I promptly returned it to the shop.
  +
  +
  +
  +
==Kali-packaged softwares==
  +
===Install===
  +
Gnuradio v3.5 is available in [[LMDE]] but does not contain rtl-sdr support
  +
<br>Gnuradio v3.7 is available in Debian but most third party sw does not support yet the v3.7 API
  +
<br>Gnuradio v3.6 is available in [[Kali]]
  +
<br>See [[Kali#Add_Kali_repositories_to_LMDE|here]] how to add Kali repositories, which is the one we'll choose.
  +
<br>Add to /etc/apt/preferences.d/kali-package-repositories.pref
  +
<pre>
  +
Package: /gnuradio/ /^gr-/ /hackrf/ /rtlsdr/ kalibrate-rtl /libosmo/ gqrx /multimon/ /uhd-/ /libvolk/
  +
Pin: release n=kali
  +
Pin-Priority: 990
  +
</pre>
  +
  +
apt-get install gnuradio gnuradio-dev gnuradio-doc libgnuradio-baz libgnuradio-grextras libgnuradio-iqbalance libgnuradio-osmosdr libgnuradio-osmosdr-apps \
  +
librtlsdr-bin hackrf-tools kalibrate-rtl rtlsdr-scanner gr-scan gqrx multimon-ng gr-air-modes
  +
  +
===rtl-sdr===
  +
Is available in Debian as rtl-sdr and in Kali as librtlsdr-bin
 
rtl_test -t
 
rtl_test -t
 
Play radio, 96.3MHz:
 
Play radio, 96.3MHz:
Line 44: Line 82:
 
cd ../build/src
 
cd ../build/src
 
./rtl_test -t
 
./rtl_test -t
  +
Sources contain one additional tool:
==[http://sourceforge.net/projects/gqrx/ gqrx]==
 
  +
./rtl_power -f 88M:108M:125k -1 fm_stations.csv
Get latest and check for missing libs
 
  +
./rtl_power -f 100M:1G:1M -i 5m -1 survey.csv
ldd|grep found
 
  +
To analyze the result:
apt-get install libzeroc-ice34
 
  +
wget -O heatmap.py http://kmkeen.com/tmp/heatmap.py.txt
./gqrx
 
  +
python heatmap.py survey.csv survey.png
  +
python heatmap.py fm_stations.csv fm_stations.png
  +
===GNURadio===
  +
* http://blog.opensecurityresearch.com/2012/06/getting-started-with-gnu-radio-and-rtl.html
  +
===[http://sourceforge.net/projects/gqrx/ gqrx]===
  +
gqrx
  +
===[https://github.com/EarToEarOak/RTLSDR-Scanner RTLSDR Scanner]===
  +
rtlsdr-scanner
  +
If needed, can also come from sources:
  +
git clone https://github.com/EarToEarOak/RTLSDR-Scanner
  +
cd RTLSDR-Scanner/git
  +
ln -s ../../pyrtlsdr/rtlsdr
  +
./rtlsdr_scan.py
  +
===kalibrate-rtl===
  +
kal
  +
TODO
  +
===osmocom===
  +
osmocom_siggen
  +
osmocom_siggen_nogui
  +
osmocom_spectrum_sense
  +
osmocom_fft
  +
TODO
  +
===gr-scan===
  +
TODO
  +
===gr-air-modes===
  +
TODO
  +
  +
==pyrtlsdr==
  +
Python wrapper for rtl-sdr
  +
git clone https://github.com/roger-/pyrtlsdr
  +
===waterfall===
  +
git clone https://github.com/keenerd/rtlsdr-waterfall
  +
cd rtlsdr-waterfall
  +
ln -s ../pyrtlsdr/rtlsdr
  +
sudo apt-get install python-pyglet
  +
./waterfall.py
  +
use: waterfall.py <lower freq> <upper freq>
  +
frequencies in hertz
  +
example: waterfall.py 929e6 930e6
  +
arrow keys pan and zoom (shift for bigger steps)
  +
brackets to adjust gain
  +
click and drag to select
  +
A for autocorrelation
  +
C for constellation
  +
esc to quit
  +
./waterfall.py 92e6 93e6
  +
Quite detailed waterfall
  +
<br>Select with mouse -> constellation (C) or autocorrelation (A)
  +
==rtlizer==
  +
git clone https://github.com/csete/rtlizer
  +
./build
  +
./rtlizer 640x360+0+0
  +
Quite fast to scan quickly with arrow keys
   
 
==SDR#==
 
==SDR#==
Line 65: Line 156:
 
ln -s /usr/lib/x86_64-linux-gnu/librtlsdr.so.0 librtlsdr.so
 
ln -s /usr/lib/x86_64-linux-gnu/librtlsdr.so.0 librtlsdr.so
 
mono SDRSharp.exe
 
mono SDRSharp.exe
  +
==[https://en.wikipedia.org/wiki/Automatic_dependent_surveillance-broadcast ADS-B]==
==GNURadio==
 
  +
===rtl_adsb===
* http://blog.opensecurityresearch.com/2012/06/getting-started-with-gnu-radio-and-rtl.html
 
  +
rtl-sdr contains already a basic decoder:
  +
<pre>
  +
Use: rtl_adsb [-R] [-g gain] [-p ppm] [output file]
  +
[-d device_index (default: 0)]
  +
[-V verbove output (default: off)]
  +
[-S show short frames (default: off)]
  +
[-Q quality (0: no sanity checks, 0.5: half bit, 1: one bit (default), 2: two bits)]
  +
[-e allowed_errors (default: 5)]
  +
[-g tuner_gain (default: automatic)]
  +
[-p ppm_error (default: 0)]
  +
filename (a '-' dumps samples to stdout)
  +
(omitting the filename also uses stdout)
  +
</pre>
  +
  +
===dump1090===
  +
Dumping ADS-B aeronautic data from 1090MHz
  +
sudo apt-get install librtlsdr-dev
  +
git clone https://github.com/antirez/dump1090.git
  +
make
  +
Usage:
  +
./dump1090
  +
./dump1090 --help
  +
./dump1090 --interactive --net --enable-agc --metric
  +
With "--net" go to http://127.0.0.1:8080
  +
  +
Actually this fork is much more advanced:
  +
git clone https://github.com/MalcolmRobb/dump1090
  +
make
  +
  +
===Antenna===
  +
I decided to construct my own 1090MHz antenna and I chose a [https://en.wikipedia.org/wiki/File:Dipolehalfwavebalun.png folded dipole to coax 4:1 balun] because the folded dipole makes it more rigid than 2 wires dandling in opposite directions and the balun is very easy to do out of coax cable.
  +
<br>Instructions: half wavelength is ~137mm, so is the dipole length. Length of the coax balun is about 90mm with a velocity factor of 0.66.
  +
<br>That's it.
  +
<br>See [https://en.wikipedia.org/wiki/File:Dipolehalfwavebalun.png pic from Wikipedia] for wiring.
  +
<br><br>To be held vertically
  +
<br>[[Image:Antenna1090.jpg]]
  +
<br><br>Here is a quick test done with dump1090 (MalcolmRobb's fork) on the balcony (south-south-east) on 10/11/2013 at 23:37, a time when the sky was quite calm.
  +
<br><br>[[Image:Dump1090_1.png|1000px]]
  +
<br><br>I'm located in Brussels and the farthest aircraft seen is GFA6, travelling from London to Bahrain and passing over Bitburg, 183 km away from my little antenna.
  +
<br>Not that bad!
  +
<br><br>To compare, here is the exhaustive list of aircrafts by flightradar24 at the same time:
  +
<br><br>[[Image:Dump1090_201311102337_flightradar.png|605px]]
  +
  +
==DAB==
  +
===rtltcpaccess===
  +
It allows to run the Terratec NOXON DAB MediaPlayer under wine, replacing the original RTL283XACCESS.dll by a hook to rtl_tcp
  +
git clone https://github.com/steve-m/rtltcpaccess
  +
./dab_install.sh
  +
Run in a window:
  +
rtl_tcp
  +
Then in another one:
  +
wine "$(winepath -u "C:\Program Files\NOXON Media\NOXON DAB MediaPlayer\NOXON DAB MediaPlayer.exe")"
  +
===SDR-J===
  +
cf http://www.sdr-j.tk/index.html
  +
<br>TODO
  +
  +
==DVB-T==
  +
After all it's initially a DVB-T receiver, isn't it?
  +
* http://www.linuxtv.org/wiki/index.php/RealTek_RTL2832U
  +
  +
<!--
  +
==TODO==
  +
http://www.radioamatoripeligni.it/i6ibe/noaa_rtl2832/noaartl2832.htm
  +
http://www.radioamatoripeligni.it/i6ibe/sdrsharp/sdrsharp.htm
  +
http://www.radioamatoripeligni.it/i6ibe/tvsharp/tvsharp.htm
  +
http://www.radioamatoripeligni.it/i6ibe/rtl2832hf/dongle.htm
  +
http://www.radioamatoripeligni.it/i6ibe/panadapter/panadapter.htm
  +
http://www.radioamatoripeligni.it/i6ibe/hdsdr/hdsdr.htm
  +
http://www.radioamatoripeligni.it/i6ibe/ads-b/ads-b.htm
  +
http://www.rtl-sdr.com/rtl-sdr-tutorial-analyzing-gsm-with-airprobe-and-wireshark/
  +
-->

Latest revision as of 21:55, 19 May 2014

Resources

Trekstor DVB-T Stick Terres 2.0

19.99€ at Saturn in Berlin
It contains hopefully the RTL2832U, together with Elonics E4000 tuner
Seen by lsusb as 1f4d:c803 G-Tek Electronics Group, which matches Lifeview LV5TDeluxe according to osmocom

/var/log/syslog

New USB device found, idVendor=1f4d, idProduct=c803
New USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: RTL2838UHIDIR
Manufacturer: Realtek
SerialNumber: 00000001
$ rtl_test -t
Found 1 device(s):
  0:  Lifeview LV5TDeluxe

Using device 0: Lifeview LV5TDeluxe
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 
Benchmarking E4000 PLL...
[...]
E4K range: 52 to 2212 MHz
E4K L-band gap: 1107 to 1241 MHz

Trekstor DVB-T Stick Terres mini

29.99€ at Saturn in Berlin
NOT based on RTL2832!!
NOT recognized by rtl_test

New USB device found, idVendor=187f, idProduct=0202
New USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: MDTV Receiver
Manufacturer: MDTV Receiver
firmware: agent aborted loading dvb_nova_12mhz_b0.inp (not found?)
$ rtl_test -t
No supported devices found.

I promptly returned it to the shop.


Kali-packaged softwares

Install

Gnuradio v3.5 is available in LMDE but does not contain rtl-sdr support
Gnuradio v3.7 is available in Debian but most third party sw does not support yet the v3.7 API
Gnuradio v3.6 is available in Kali
See here how to add Kali repositories, which is the one we'll choose.
Add to /etc/apt/preferences.d/kali-package-repositories.pref

Package: /gnuradio/ /^gr-/ /hackrf/ /rtlsdr/ kalibrate-rtl /libosmo/ gqrx /multimon/ /uhd-/ /libvolk/
Pin: release n=kali
Pin-Priority: 990
apt-get install gnuradio gnuradio-dev gnuradio-doc libgnuradio-baz libgnuradio-grextras libgnuradio-iqbalance libgnuradio-osmosdr libgnuradio-osmosdr-apps \
  librtlsdr-bin hackrf-tools kalibrate-rtl rtlsdr-scanner gr-scan gqrx multimon-ng gr-air-modes

rtl-sdr

Is available in Debian as rtl-sdr and in Kali as librtlsdr-bin

rtl_test -t

Play radio, 96.3MHz:

rtl_fm -f 96.3e6 -W -s 200000 -r 48000 - | aplay -r 48k -f S16_LE

If needed, from sources:

git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../
make
cd ../build/src
./rtl_test -t

Sources contain one additional tool:

./rtl_power -f 88M:108M:125k -1 fm_stations.csv
./rtl_power -f 100M:1G:1M -i 5m -1 survey.csv

To analyze the result:

wget -O heatmap.py http://kmkeen.com/tmp/heatmap.py.txt
python heatmap.py survey.csv survey.png
python heatmap.py fm_stations.csv fm_stations.png

GNURadio

gqrx

gqrx

RTLSDR Scanner

rtlsdr-scanner

If needed, can also come from sources:

git clone https://github.com/EarToEarOak/RTLSDR-Scanner
cd RTLSDR-Scanner/git
ln -s ../../pyrtlsdr/rtlsdr
./rtlsdr_scan.py

kalibrate-rtl

kal

TODO

osmocom

osmocom_siggen
osmocom_siggen_nogui
osmocom_spectrum_sense
osmocom_fft

TODO

gr-scan

TODO

gr-air-modes

TODO

pyrtlsdr

Python wrapper for rtl-sdr

git clone https://github.com/roger-/pyrtlsdr

waterfall

git clone https://github.com/keenerd/rtlsdr-waterfall
cd rtlsdr-waterfall
ln -s ../pyrtlsdr/rtlsdr 
sudo apt-get install python-pyglet
./waterfall.py
use: waterfall.py <lower freq> <upper freq>
   frequencies in hertz
   example: waterfall.py 929e6 930e6
   arrow keys pan and zoom (shift for bigger steps)
   brackets to adjust gain
   click and drag to select
   A for autocorrelation
   C for constellation
   esc to quit
./waterfall.py 92e6 93e6

Quite detailed waterfall
Select with mouse -> constellation (C) or autocorrelation (A)

rtlizer

git clone https://github.com/csete/rtlizer
./build
./rtlizer 640x360+0+0

Quite fast to scan quickly with arrow keys

SDR#

sudo apt-get install mono-complete monodevelop
sudo apt-get install libportaudio2
svn co https://subversion.assembla.com/svn/sdrsharp/trunk sdrsharp.svn
cd sdrsharp.svn/
monodevelop

Open file .sdl
If opened as text, modify version 12 -> 11 and open again
Switch to Release; Build All; Exit
cd Release/ Edit SDRSharp.exe.config
=> enable RTLSDR

ln -s /usr/lib/x86_64-linux-gnu/libportaudio.so.2 libportaudio.so
ln -s /usr/lib/x86_64-linux-gnu/librtlsdr.so.0 librtlsdr.so
mono SDRSharp.exe

ADS-B

rtl_adsb

rtl-sdr contains already a basic decoder:

 Use:	rtl_adsb [-R] [-g gain] [-p ppm] [output file]
	[-d device_index (default: 0)]
	[-V verbove output (default: off)]
	[-S show short frames (default: off)]
	[-Q quality (0: no sanity checks, 0.5: half bit, 1: one bit (default), 2: two bits)]
	[-e allowed_errors (default: 5)]
	[-g tuner_gain (default: automatic)]
	[-p ppm_error (default: 0)]
	filename (a '-' dumps samples to stdout)
	 (omitting the filename also uses stdout)

dump1090

Dumping ADS-B aeronautic data from 1090MHz

sudo apt-get install librtlsdr-dev
git clone https://github.com/antirez/dump1090.git
make

Usage:

./dump1090
./dump1090 --help
./dump1090 --interactive --net --enable-agc --metric

With "--net" go to http://127.0.0.1:8080

Actually this fork is much more advanced:

git clone https://github.com/MalcolmRobb/dump1090
make

Antenna

I decided to construct my own 1090MHz antenna and I chose a folded dipole to coax 4:1 balun because the folded dipole makes it more rigid than 2 wires dandling in opposite directions and the balun is very easy to do out of coax cable.
Instructions: half wavelength is ~137mm, so is the dipole length. Length of the coax balun is about 90mm with a velocity factor of 0.66.
That's it.
See pic from Wikipedia for wiring.

To be held vertically
Antenna1090.jpg

Here is a quick test done with dump1090 (MalcolmRobb's fork) on the balcony (south-south-east) on 10/11/2013 at 23:37, a time when the sky was quite calm.

Dump1090 1.png

I'm located in Brussels and the farthest aircraft seen is GFA6, travelling from London to Bahrain and passing over Bitburg, 183 km away from my little antenna.
Not that bad!

To compare, here is the exhaustive list of aircrafts by flightradar24 at the same time:

Dump1090 201311102337 flightradar.png

DAB

rtltcpaccess

It allows to run the Terratec NOXON DAB MediaPlayer under wine, replacing the original RTL283XACCESS.dll by a hook to rtl_tcp

git clone https://github.com/steve-m/rtltcpaccess
./dab_install.sh

Run in a window:

rtl_tcp

Then in another one:

wine "$(winepath -u "C:\Program Files\NOXON Media\NOXON DAB MediaPlayer\NOXON DAB MediaPlayer.exe")"

SDR-J

cf http://www.sdr-j.tk/index.html
TODO

DVB-T

After all it's initially a DVB-T receiver, isn't it?