vendredi 31 août 2018



Raspberry become a RTL SDR server

Pre requesit

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update


Plug your RTL SDR device

lsusb
You got something like that:

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver

Manual Installation

The first step is to install a few packages that are required by the RTL-SDR server. You may already have some of these so don’t worry if you see a message that you already have the latest version.
To install these packages, type the following at the LXTerminal command line.
sudo apt-get install -y  git cmake pkg-config libusb-1.0-0-dev

Now you can download the RTL-SDR code from osmocom by typing the following at the command line:

git clone git://git.osmocom.org/rtl-sdr.git


The next step is to build RTL-SDR using the following commands. NB: Some of these may take a while so it’s probably time for a beer!

  1. cd rtl-sdr
  2. mkdir build
  3. cd build
  4. cmake ../ -DINSTALL_UDEV_RULES=ON
  5. make
  6. sudo make install
  7. sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
  8. sudo ldconfig


Blacklist the DVB-T Drivers

The later versions of Raspbian include standard drivers so that the Dongles can operate in their original role as a USB Radio/TV device. Unfortunately, these drivers prevent access to the dongle by the rtl-sdr software. The solution is to create a dedicated blacklist file to prevent the unwanted drivers from loading.  Here’s the process:
List DVB drivers:
lsmod

Module Size Used by
dvb_usb_rtl2832u   15117  0
dvb_usb                   13368  1  dvb_usb_rtl2832u
dvb_core                  81677  2  dvb_usb

rc_core                     16948  14 ir_sharp_decoder,ir_xmp_decoder,lirc_dev,ir_lirc_codec,dvb_usb_rtl28xxu,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_jvc_decoder,dvb_usb_v2,ir_rc6_decoder,ir_sanyo_decoder
 
From the command line enter the following:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
 
This creates a new file so enter the following lines:

blacklist dvb_usb_rtl2832u 
blacklist dvb_usb
blacklist dvb-core


Press control-X followed by Y to exit and save the modified file.
Now reboot the Pi:
sudo reboot

First tests

That completes the build and you can run a quick test by making sure your dongle is connected and typing: rtl_test -t
To start the server you need to access the Pi command line and type: 
rtl_tcp -a ‘your Pi’s IP address’
As a practical example, the start command for my setup is:
rtl_tcp -a 192.168.1.100


Start server at boot

sudo nano /etc/systemd/system/rtltcp.service

Then add this to the empty file (Make sure you are using the right IP address for your installation):

[Unit]
Description=RTLTCP
After=network.target
[Service]
ExecStartPre=/bin/sleep 30
ExecStart=/usr/local/bin/rtl_tcp -a 192.168.1.100
[Install]
WantedBy=multi-user.target

Hit Ctl +X then Y to save. Then:

sudo systemctl enable rtltcp.service

That makes it start at boot automatically

You now have an rtl_tcp server that can be accessed from anywhere. (If you open the appropriate router ports up).