https://www.marcelpost.com/wiki/index.php?title=Rpi-rtl-sdr&feed=atom&action=historyRpi-rtl-sdr - Revision history2024-03-28T12:04:37ZRevision history for this page on the wikiMediaWiki 1.39.5https://www.marcelpost.com/wiki/index.php?title=Rpi-rtl-sdr&diff=3106&oldid=prevAdmin at 09:45, 23 April 20192019-04-23T09:45:14Z<p></p>
<p><b>New page</b></p><div>In 2013 I bought one of these cheap USB DVB-T RTL-SDR dongles. <br />
<br />
[[File:R820T.jpg|200px|thumb|none|R820T with remote control and antenna]]<br />
<br />
[[File:Rtlsdr r820t mini float.jpg|200px|thumb|none|Inside the R820T]]<br />
<br />
<br />
<br />
Details:<br />
<br />
<pre><br />
Tuner Frequency Range<br />
Elonics E4000 52 - 2200 MHz with a gap from 1100 MHz to 1250 MHz (varies)<br />
<br />
VID PID Tuner Device Name<br />
0x0bda 0x2838 E4000 ezcap USB 2.0 DVB-T/DAB/FM dongle<br />
</pre><br />
<br />
Source: http://sdr.osmocom.org/trac/wiki/rtl-sdr<br />
<br />
It came with a small magnetic-base antenna and some software. Initially I used it on Windows and was able to receive signals between 50MHz - 1GHz. There are mods available to make them listen on lower frequencies (HF) but I got it to show aircraft's transponder messages using RTL1090. Combined with Google Maps and VirtualRadar it is fascinating and fun to see what flies overhead..<br />
<br />
[[File:RTL1090 and VirtualRadar.jpg|200px|thumb|none|VirtualRadar showing realtime transponder messages]]<br />
<br />
<br />
Currently I am attempting to use one of these dongles to act as an aprs receiver (Rx-Only iGate) for 2m (145.175MHz). If this works I will free up one of my handheld transceivers and I will be able to bring down the power consumption and size of the project considerably.<br />
<br />
Linux uses rtl_fm to communicate with these devices.<br />
<br />
<br />
This is what you should see when plugging in the RTL-SDR on a Debian 9 system:<br />
<br />
<pre><br />
Apr 22 08:34:14 debian kernel: [ 358.696018] usb 8-5: new high-speed USB device number 6 using ehci-pci<br />
Apr 22 08:34:14 debian kernel: [ 358.856014] usb 8-5: New USB device found, idVendor=0bda, idProduct=2838<br />
Apr 22 08:34:14 debian kernel: [ 358.856018] usb 8-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
Apr 22 08:34:14 debian kernel: [ 358.856020] usb 8-5: Product: RTL2841UHIDIR<br />
Apr 22 08:34:14 debian kernel: [ 358.856022] usb 8-5: Manufacturer: Realtek<br />
Apr 22 08:34:14 debian kernel: [ 358.856024] usb 8-5: SerialNumber: 00000001<br />
Apr 22 08:34:14 debian mtp-probe: checking bus 8, device 6: "/sys/devices/pci0000:00/0000:00:1d.7/usb8/8-5"<br />
Apr 22 08:34:14 debian mtp-probe: bus: 8, device: 6 was not an MTP device<br />
Apr 22 08:34:14 debian kernel: [ 359.121689] usb 8-5: dvb_usb_v2: found a 'Realtek RTL2832U reference design' in warm state<br />
Apr 22 08:34:14 debian kernel: [ 359.179365] usb 8-5: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer<br />
Apr 22 08:34:14 debian kernel: [ 359.179381] DVB: registering new adapter (Realtek RTL2832U reference design)<br />
Apr 22 08:34:14 debian kernel: [ 359.227932] i2c i2c-8: Added multiplexed i2c bus 9<br />
Apr 22 08:34:14 debian kernel: [ 359.227934] rtl2832 8-0010: Realtek RTL2832 successfully attached<br />
Apr 22 08:34:14 debian kernel: [ 359.227943] usb 8-5: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...<br />
Apr 22 08:34:14 debian kernel: [ 359.257263] r820t 9-001a: creating new instance<br />
Apr 22 08:34:14 debian kernel: [ 359.264401] r820t 9-001a: Rafael Micro r820t successfully identified<br />
Apr 22 08:34:14 debian kernel: [ 359.267992] rtl2832_sdr rtl2832_sdr.1.auto: Registered as swradio0<br />
Apr 22 08:34:14 debian kernel: [ 359.267994] rtl2832_sdr rtl2832_sdr.1.auto: Realtek RTL2832 SDR attached<br />
Apr 22 08:34:14 debian kernel: [ 359.267996] rtl2832_sdr rtl2832_sdr.1.auto: SDR API is still slightly experimental and functionality changes may follow<br />
Apr 22 08:34:14 debian kernel: [ 359.274612] Registered IR keymap rc-empty<br />
Apr 22 08:34:14 debian kernel: [ 359.274710] input: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:1d.7/usb8/8-5/rc/rc0/input32<br />
Apr 22 08:34:14 debian kernel: [ 359.274811] rc rc0: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:1d.7/usb8/8-5/rc/rc0<br />
Apr 22 08:34:14 debian kernel: [ 359.276298] usb 8-5: dvb_usb_v2: schedule remote query interval to 200 msecs<br />
Apr 22 08:34:14 debian kernel: [ 359.286751] lirc_dev: IR Remote Control driver registered, major 244<br />
Apr 22 08:34:14 debian kernel: [ 359.287484] usb 8-5: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully initialized and connected<br />
Apr 22 08:34:14 debian kernel: [ 359.287526] usbcore: registered new interface driver dvb_usb_rtl28xxu<br />
Apr 22 08:34:14 debian kernel: [ 359.344649] rc rc0: lirc_dev: driver ir-lirc-codec (dvb_usb_rtl28xxu) registered at minor = 0<br />
Apr 22 08:34:14 debian kernel: [ 359.344651] IR LIRC bridge handler initialized<br />
</pre><br />
<br />
<br />
<br />
test audio out by listening to a local FM broadcast station (update frequency for your area)<br />
<br />
<pre><br />
rtl_fm -f 102.1M -s 170k -r 44100 -o 1 - | aplay -t raw -r 44100 -f S16_LE -c 1 -V mono -<br />
</pre><br />
<br />
<br />
rtl_fm<br />
<br />
* -s 170k = Sampling bandwidth, use 170k for Wide-Band FM, 25k for Narrow-Band FM<br />
* -r 44100 = output sampling rate; must always be less than the Sampling Bandwidth<br />
* -o 1 = Oversampling<br />
<br />
NOTE:<br />
<br />
<br />
aplay<br />
<br />
* -c 1 = Channels (use 2 for stereo)<br />
* -V mono = VU-meter (show signal strength on screen)<br />
* -r 44100 = sampling rate (max=44100) (must match output sampling rate from rtl_fm)<br />
<br />
<br />
<br />
===streaming over TCP===<br />
<br />
If your device does not have a soundcard available you can stream the audio over the network.<br />
<br />
On the server:<br />
<br />
(required packages: apt-get install sox libsox-fmt-mp3 socat)<br />
<br />
<pre><br />
rtl_fm -f 106.1M -s 170k -r 44100 - | sox -traw -r44100 -es -b16 -c1 -V1 - -tmp3 - | socat -u - TCP-LISTEN:8080<br />
</pre><br />
<br />
<br />
On the receiver:<br />
<br />
(required packages: apt-get install sox libsox-fmt-mp3 netcat)<br />
<br />
<pre><br />
netcat <server> 8080 | play -t mp3 -<br />
</pre><br />
<br />
<br />
<br />
===testing APRS packets with MultimonNG===<br />
<br />
Feeding a pre-recorded aprs packet in .wav format into multimon (it supports .mp3 as well)<br />
<br />
<pre><br />
multimon-ng -a AFSK1200 -t wav -i <soundfile.wav><br />
</pre><br />
<br />
<br />
<br />
===creating a Virtual Sound Device for the RTL-SDR===<br />
<br />
This will allow us to simply connect soundmodem to the virtual sound device and all we need to do then is feed it with audio from the RTL-SDR.<br />
<br />
<pre><br />
# modprobe snd-aloop<br />
<br />
-or-<br />
<br />
# echo "snd-aloop" >> /etc/modules<br />
(reboot) <br />
</pre><br />
<br />
===send RTL-SDR audio to the virtual sound device===<br />
<br />
<pre><br />
$ rtl_fm -f <freq> -s 100k -r 22050 - | aplay -r 22050 -f S16_LE -t raw -c 1 -D hw:Loopback,0,0<br />
</pre><br />
<br />
<br />
Confirm audio is coming through:<br />
<br />
<pre><br />
arecord -f S16_LE -r 22050 -D plughw:1,1 - | aplay -r 22050 -f S16_LE -<br />
</pre><br />
<br />
We can now use the virtual sound device to configure soundmodem<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
(more info here when I get it to work!)</div>Admin