Having recently renewed my amateur radio licence, I decided it was time to see what I could do with a Raspberry Pi. You can now get software defined radios for incredibly low prices as use these for all sorts of things, one of these is for use as a receiver. You can simply buy one, plug it into a USB socket on your desktop, download sdrsharp and away you go, you do then need to connect the antenna to the USB device and this could result in a long run of cable.
Alternatively, you can connect the USB device to a Raspberry Pi, install some software, put the Pi outside in a waterproof box and connect via ethernet or wirelessly. I've gone for this option and used a wireless connection.
I've gone for the setup shown below, picked up from Amazon.
sudo apt update
sudo apt upgrade -y
sudo shutdown -r now
sudo apt-get install -y git cmake libusb-1.0-0-dev mc
git clone git://git.osmocom.org/rtl-sdr.git
Now we build the RTL SDR package.
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig
sudo nano /etc/udev/rules.d/rtl-sdr.rules
At the top of the file you will see this, change the 0660 to 0666 in both cases.
# original RTL2832U vid/pid (hama nano, for example)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"
# RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"
It should now look like this.
# original RTL2832U vid/pid (hama nano, for example)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", ENV{ID_SOFTWARE_RADIO}="1", MODE="0666", GROUP="plugdev"
# RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", ENV{ID_SOFTWARE_RADIO}="1", MODE="0666", GROUP="plugdev"
sudo nano /etc/modprobe.d/blacklist-rtl.conf
Paste this and and save and exit
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Now run the following
sudo apt-get install libvolk2-bin -y
volk_profile
This will take some time
Last thing to do is get the software to run at start up, I'm going to create a service to get this started on boot, we also need to provide the IP address that the pi is running at to the command line to get it running.
Let's create a file with sudo nano /bin/sdrstart
Paste this into the file.
#!/bin/bash
# Sets the variable $_IP as the ip address
_IP=$(hostname -I)
# Runs the rtl_tcp app and provides the output to it's own ip.
rtl_tcp -a $_IP
Make the file executable with sudo chmod +x /bin/sdrstart
Now we create a file for the service with sudo nano /etc/systemd/system/rtl.service
Paste this into the file.
[Unit]
Description SDR Start
After=network-online.target
[Service]
[Unit]
Description SDR Start
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/bin/bash /bin/sdrstart
PermissionStartOnly=true
StandardOutput=null
User=root
[Install]
WantedBy=multi-user.target
Save it and then run
sudo systemctl daemon-reload
sudo systemctl enable rtl.service
sudo service rtl restart
If you then run sudo service rtl status, you should see your Pi reporting that it's all up and running.
Give it a restart and you should be able to connect sdrsharp to the Pi using the RTL_SDR TCP option.
Thanks to Mike Richards G4WNC for the initial article and a lot of searching to fix a few little issues.
No comments:
Post a Comment