Author Topic: How can I control my RTL dongle Linux?  (Read 5514 times)

Anton Janovsky (ZR6AIC)

  • Administrator
  • Jr. Member
  • *****
  • Karma: +0/-0
How can I control my RTL dongle Linux?
« on: December 14, 2013, 09:51:51 AM »
How can I control my RTL dongle Linux?

Anton Janovsky (ZR6AIC)

  • Administrator
  • Jr. Member
  • *****
  • Karma: +0/-0
Re: How can I control my RTL dongle on Linux?
« Reply #1 on: December 30, 2013, 04:20:07 PM »
Here is my hardware configuration for linux (ubuntu) and Raspberry Pi.
Read the complete instillation procedure on my blog at http://zr6aic.blogspot.com/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html





1) Raspberry PI + PSU.
2) External power USB hub. ( Preferably don't connect RTL Dongle directly into Raspberry Pi)
3) RTL-2832U USB Dongle.
Software configuration
First update you Raspberry Pi wheezy Linux to the latest version.

Code: [Select]
sudo apt-get update
Now install the required utils to compile the RTL-2832U USB dongle driver

Code: [Select]
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0.dev
sudo apt-get install build-essential

Now install the RTL-2832U USB dongle driver src and compile

Code: [Select]
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
if it was successful you should see no return on the previous command.

I have been told that the Raspberry crash if you don't reboot before inserting the dongle.

so just run sudo
Code: [Select]
shutdown -r 0
Install the RTL-2832U USB dongle on external powered USB HUB

Code: [Select]
sudo ldconfig
Run this command
Code: [Select]
sudo rtl_test -t to test the compiled driver
I had to reboot and run the command sudo ldconfig again before the test worked.
If U are using a RTL2832+R820T dongle U will get this error below when running the rtl_test -t command
**************************************
Code: [Select]
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle

Found Rafael Micro R820T tuner

Supported gain values (there was a string of values)

No E4000 tuner found, aborting
[/color]
Just ignore it the normal rtl_tcp command will work.

**************************************
pi@raspberrypi ~ $
Code: [Select]
sudo rtl_test -t

Found 1 device(s):

  0:  ezcap USB 2.0 DVB-T/DAB/FM dongle



Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle

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] PLL not locked for 51000000 Hz!

[E4K] PLL not locked for 2201000000 Hz!

[E4K] PLL not locked for 1101000000 Hz!

[E4K] PLL not locked for 1242000000 Hz!

E4K range: 52 to 2200 MHz

E4K L-band gap: 1101 to 1242 MHz


To run the rtl server type
Code: [Select]
sudo rtl_tcp -a and you ip address of your Pi.



Code: [Select]
sudo rtl_tcp -a 192.168.10.135Found 1 device(s).
Found Elonics E4000 tuner
Using ezcap USB 2.0 DVB-T/DAB/FM dongle
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=192.168.10.135:1234' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).

Wala the Raspberry SDR Server is running! :) :)
listening to Audio on the local speaker jack

Code: [Select]
sudo rtl_fm -f 144800000 -s 44100 -g 9 -l 10 - | aplay -t raw -r 44100 -c 1 -f S16_LE
I had to set the volume in the mixer to hear something.

to get your soundcard playback details run the command 
Code: [Select]
sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7

You will have to configer your .asoundrc file (you can read about it in my websdr sound card section)
just use default as alsa device it should work

here is a example of .asoundrc config file content

Code: [Select]
pcm.!default {
 
        type hw

        card 0

}

ctl.!default {

        type hw

        card 0

}

pcm.usb {

        type plug

        slave {

                pcm "hw:1,0"

        }

}

ctl.usb {

        type plug

        slave {

                ctl "hw;1,0"

        }

}
Here is how you set your audio level


Code: [Select]
sudo alsamixer

alsamixer





Some Debugging
if you get this error below you tried to start the server when its already running.

Code: [Select]
sudo rtl_tcp -a 192.168.10.135

Found 1 device(s).

[color=red]usb_claim_interface error -6[/color]

Failed to open rtlsdr device #0.

There is already running rtl server just kill the server and your rtl_tcp will now start.

Read more at my blog how to setup the clients http://zr6aic.blogspot.com/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html





look at the video http://www.youtube.com/watch?feature=player_embedded&v=FZwPKs9R9Ys

Android client conneting to your rtl_tcp server
« Last Edit: January 29, 2014, 09:38:16 AM by Anton Janovsky (ZR6AIC) »