Using NooElec NESDR SMArt on a Raspberry Pi

RasPi LogoSo, you’ve got a Raspberry Pi (v2 or newer) and a NooElec NESDR SMArt and you would like to get them working together. By the time you have followed the steps in this post, you will be listening to your favorite FM radio station.

First let us take a moment to discuss the RasPi and radio software. The RasPi has plenty of power to run command line utilities to control the SDR dongle and play the audio, but doesn’t really have the necessary computing power to run a full GUI-based SDR application. But this need not limit you to command line usage only.

I will also show you how to setup your RasPi to act as a server, feeding your app data, to a conventional PC over the network. You then run the GUI-based software on that PC. The software on your PC acts as the frontend to a radio receiver on the backend.

With this second option, you can use any frontend software you choose and get all the provided bells and whistles. Some of your options are: qgrx, CubicSDR, and SDR# (SDRSharp).

For this example I am going to use the RASPBIAN STRETCH LITE distro. (Minimal image based on Debian Stretch) which does not come with a GUI. I chose that distro because chances are (after going through this tutorial) you will probably end up using your RasPi as a server for another application on another computer. This way you won’t be burdening the RasPi with the GUI. This means you will probably also access and administer your RasPi via SSH.

The first step to installing any software on just about any Linux computer is to update the operating system software and get the latest libraries.

Since we are talking about the RasPi, this is the code you need to type

sudo apt-get update
sudo apt-get upgrade

Answer Yes to any questions asking you if it should make changes. What these steps are doing is updating your computer.

SSH

(note: Everything can be done directly on the RasPi itself. SSH is only a convenience.)

Secure Shell is a means of remotely operating a computer. It allows you to run a console/terminal on one computer and have that operate on a remote computer.

For example, Once I get my RasPi booted and updated I open up the SSH port and run the SSH daemon. Then I can physically take my RasPi, detach the keyboard, mouse, and monitor and stick it somewhere out of the way. I then use my multi-monitored main workstation. I put up a tutorial or reference document on one monitor and open an SSH session to the RasPi on another monitor. I can then copy and paste from the documentation straight into the terminal.

On the minimal Raspbian distro, the SSH daemon is installed, but not yet enabled. You need to enable and then start the SSH service.

You’ll need to type this

sudo systemctl enable ssh
sudo systemctl start ssh

Damn Yankees

The minimal distro of Raspbian is pre-configured for GB English. That includes a GB English keyboard layout. If you are a Yankee, like me, then you want to, um, correct, that to US English (and the US English keyboard). To set the keyboard on the RasPi to a setting other than GB English, use the following: Set the language using sudo raspi-config and then sudo reboot. Once the RasPi has rebooted, you will be using the language settings you chose. (I mention this because the next section uses the "pipe" character (|) and it is in different places on the US and GB keyboard layouts.)

With the update & upgrade completed, your RasPi is up to date and knows where to find the latest versions of the packages available for your use. The package that we are interested in is rtl-sdr.

sudo apt-get install rtl-sdr

When that package is installed, it installs some drivers that conflict with the drivers already installed on the RasPi. What is needed is to remove the original drivers so the new drivers can be utilized. You do this by "blacklisting" the old drivers, so they don't load.

echo 'blacklist dvb_usb_rtl28xxu' | sudo tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf

Then do a sudo reboot
With things rebooted, it is time to test the installation.

rtl_test

Results of a passing test.

Then play a radio station. Change the frequency to a station in your area.

rtl_fm -f 93.3e6 -M wbfm -s 200000 -r 48000 - | aplay -r 48000 -f S16_LE

Now that you have confirmed that the turner is capable of receiving radio signals, let's shut it down for now with a ctrl-c.

The command to get the turner working to receive remote direction is simple enough. The only tricky part is knowing your proper IP address.

rtl_tcp -a 192.168.1.45

If you are going to be running a Windows box, you probably should start with SDR# (SDRSharp).

If you are on Windows 10, you may need to install Microsoft Visual C++ Redistributable 2012 64-bit. This will fix things if you get an error like "The type initializer for 'PortAudioSharp.PortAudioAPI' threw an exception." when attempting to run SDRSharp.

Fire up SDR# and it will be set to use a local AirSpy dongle. Change it to RTL-SDR (tcp). Then click on the settings cog and enter the IP address of your RasPi. Then tune in to your favorite FM radio station. You should hear everything just fine.

SDR# at startup.

Setting the source.

From here you should start to experiment and join the fabulous SDR community.

Leave a Reply

Your email address will not be published. Required fields are marked *