[This is a post 3 in two-part series :), for hardware setup go here]
While running SDR radio on Raspberry was fine, I kinda wanted to move this to one of my x86 servers. Due to this, I had to revisit my old guide.
When device is plugged in, trace should be seen in
dmesg. If everything is fine, you should see some activity.
dmesg | tail
[4306437.661393] usbcore: registered new interface driver dvb_usb_rtl28xxu
To get SDR running, there is some work involved with its compilation. Note the
DETACH_KERNEL_DRIVER=ON flag enabling SDR application to access device without disabling its driver. Rest is really similar to official instructions.
sudo apt-get install -y git build-essential cmake libusb-1.0-0-dev libglib2.0-dev
git clone git://git.osmocom.org/rtl-sdr.git
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
sudo make install
This is an ideal time to test it. As I have the
iptables active, I manually enable port on external interface. Other than that I will not restrict application to a single IP but allow it to listen on all interfaces.
iptables -A INPUT -i eth0 -p tcp --dport 1234 -j ACCEPT
/usr/local/bin/rtl_tcp -a 0.0.0.0
The last step is to enable running it as a service. We need to create a separate user, enable service, and finalize it all with reboot.
sudo adduser --disabled-password --gecos "" sdr
sudo usermod -a -G plugdev sdr
sudo cat > /lib/systemd/system/rtl_tcp.service <<- EOF
ExecStart=/usr/local/bin/rtl_tcp -a 0.0.0.0
sudo systemctl enable /lib/systemd/system/rtl_tcp.service
And that’s it. Now you can run SDR TCP server on your Ubuntu server.