lunedì 20 aprile 2015

How to configure your RaspberryPI (or PC, or a similar hardware) to use "Remote RTL_UDP" Android App by MichelinoK

First of all....what can i do with the app "Remote RTL_UDP" by MichelinoK?
Simple...control your remote dongle and listen with your Android phone (or anything else that support realtime MP3 stream) to the tuned frequency, change modulation,change frequency,enable/disable agc,control squelch and gain, store frequencies in a databse and select them to easy tune your dongle,import SDRSharp's database (.XML).

This manual is written using a RaspberryPI as the primary hardware where the dongle is connected, but you can use any hardware capable of running rtl_fm and icecast at the same time (icecast can run on external hw, at home I use a QNAP that run icecast).
If not specified, don't logout from the RaspberryPI during the installation process.

So...let's start!

I'll assume that your RaspberryPI has IP=192.168.2.60, during this tutorial, change the IP to match yours.

First step: Install dependencies and rtl_udp onto your RaspberryPI

- login remotely into your RaspberryPI with a standard user (I use putty to connect and have a simple terminal); usually use pi/raspberry as username/password (if not changed).
- clone the external repository of rtl_udp and install it using these commands:

If you already have rtl-sdr installed on your system (maybe a more recent version), you can skip the last two commands and copy the rtl_udp executable just generated in your existing /usr/local/bin/ folder.
Reboot your RaspberryPI (sudo reboot)

Second step: Install ezstream
- login remotely into your RaspberryPI with a standard user (I use putty to connect and have a simple terminal); usually use pi/raspberry as username/password (if not changed).

- execute this command:

sudo apt-get install ezstream

Now, using your favourite text editor (i love the "nano" editor) create a file called mystream.xml and paste this text into it:

<ezstream>
<url>http://192.168.2.60:8000/live.mp3</url>
<sourcepassword>raspberry</sourcepassword>
<format>MP3</format>
<filename>stdin</filename>
<!--
Important:
For streaming from standard input, the default for continuous streaming
is bad. Set <stream_once /> to 1 here to prevent ezstream from spinning
endlessly when the input stream stops:
-->
<stream_once>1</stream_once>
<!--
The following settings are used to describe your stream to the server.
It's up to you to make sure that the bitrate/quality/samplerate/channels
information matches up with your input stream files.
-->
<svrinfoname>Your Radio</svrinfoname>
<svrinfourl>Radio di test</svrinfourl>
<svrinfogenre>Rock_HipHop_Swing</svrinfogenre>
<svrinfodescription>A description of your stream</svrinfodescription>
<svrinfobitrate>128</svrinfobitrate>
<svrinfoquality>2.0</svrinfoquality>
<svrinfochannels>1</svrinfochannels>
<svrinfosamplerate>44100</svrinfosamplerate>
<!-- Turn off YP directory advertising -->
<svrinfopublic>0</svrinfopublic>
</ezstream>

You now have ezstream installed and configured.
Notice the password "raspberry" (third line), this is the password to be used later during the configuration of icecast.
Logout from the RaspberryPI.

Third step: Install icecast server

If you already have icecast running on external hw, you can skip this step and modify the previuos file to point to the icecast server you're already running (change IP,port and password to match your configuration).

- login remotely into your RaspberryPI with a standard user (I use putty to connect and have a simple terminal); usually use pi/raspberry as username/password (if not changed).
- execute this command:

sudo apt-get install icecast2

During the installation, it will ask you if you want to configure the Icecast2, answer "yes".
When asks for hostname, leave it to "localhost".
When asks for password, change it to "raspberry" without quotes.
When asks for relay password, change it to "raspberry" without quotes.
When asks for administration password, change it to "raspberry" without quotes.
Logout from the RaspberryPI.

Final steps:

- Open with a web browser from your pc this address:

http://192.168.2.60:8000

You should see the admin interface of icecast (you can close the browser).

- login remotely into your RaspberryPI with a standard user (I use putty to connect and have a simple terminal); usually use pi/raspberry as username/password (if not changed).
- execute this command:

Now run VLC from your pc or open a webbrowser capable of playing a realitme mp3 stream and open this address:

http://192.168.2.60/live.mp3

You should hear some "noise".

If you want to terminate the stream from the RaspberryPI, simply CTRL-c on the RaspberryPI console.

Once everything is ok, you can run "rtl_udp --help" (again...without quotes) and see a lot of options.
Modify the above provided command to match your configuration (for example you can add the -p switch and set the ppm correction). There's a lot of options to play with!.

The "--scale 2" is the audio multiplier, usefull if you're gonna listen to AM stations (you'll notice that when switching to FM, your audio volume will be much stronger than in AM mode).

The RaspberryPI configuration is terminated.

Let's move to the Android App.

To use the app, the RaspberryPI server must be running!

Install VLC on your Android phone and run it then open the stream at this address: http://192.168.2.60/live.mp3

You must hear noise, put VLC to the background (keeping it running!).

Install the Android app (from the provided links at the end of this post) and run it for the first time (be sure to have wifi enabled and connected to the same lan of the RaspberryPI).

Set hostname with the IP of the RaspberryPI (in our tutorial 192.168.2.60) and set port to 6020, then click on the "Save" button.

Now move to the "Commands" section.

It is VERY important to keep in mind that the app doesn't know the actual state of the server (frequency,agc,modulation,and so on), so the values you see every first time you run the app are not true. You can however start rtl_udp with the correct parameters to match the initial setup of the app.
In this section you can change modulation,enter the frequency,change squelch,agc and gain.
To manually enter a frequency, just tap the "frequency display" then you must click on "SET" button to tune to the frequency you've entered.
You can fine tune using the provided buttons below the frequency display.
If you click on "ADD DB", the app will store the actual frequency and modulation onto the internal database (it will ask you for a description).

Now move to the "Database" section.

Once you've added some frequency from the "Commands" section, you can easily tune to the stored frequencies by just double tapping the interested one.
I'll notice that the icon near the frequency will change, meaning that you've tuned to that frequency.
Long pressing a frequency will let you delete the stored frequency.

You can see every operation of the app on the RaspberryPI console.

Importing SDRSharp .XML frequencies

Move to the SDRSharp section.
Enable the receiver and if you want to overwrite the current database, switch the "Overwrite" switch too.Run the Windows executable "RTL_UDP_Frequencies_Uploader.exe" and click on "Search phone".
When the app will find the phone, click on "Load and send..." and select your SDRSharp .XML file (where frequencies are stored).
On the phone you'll see a progressbar while importing the frequencies.
You can now turn off "Enable receiver" switch on the app.

Final consideration:

You can use the Android App outside your lan, you just have to port forward the 6020 and 8000 port to your RaspberryPI's IP

Moin, I just installed the RemoteRadio App and it seems to work fine. Thanks for writing this application. Anyhow, I miss one thing: I use a "HamItUp" converter, that mixes all frequencies 125MHz up. This enable to receive Stations from 0 MHz up to 30 MHz while the RTL SDR is tuned from 125 MHz to 155 MHz. With other SDR receivers like gqrx and SDRSharp it's possible to define this Lo-frequency. It would be very helpfull if you can add such a function to your RemoteRadio App.