My Raspberry Pi RTL Dongle server cards run the server as a service under
From previous tests, I know that a Pi3-B can support up to 4 RTL-SDR server instances, so switching between two should be easy. To add a second instance we just need to create a second Service file that’s a duplicate of the original with just one line changed. Here’s a copy of the original, single device, service file:
ExecStart=/bin/sh -c ‘/usr/local/bin/rtl_tcp -a $(hostname -I)’
The line we need to change is the ExecStart as this line actually starts the server. To add another instance it should read:
ExecStart=/bin/sh -c ‘/usr/local/bin/rtl_tcp -a $(hostname -I) -d1 -p1235’
The -d suffix is the device number which counts from 0 and the -p1235 entry forces the second server instance to use port 1235.
Here’s a step-by-step guide to adding a second instance. NB: Back-up your SD card first!
- Open a terminal session (Ctl-Atl-t)
- Enter: cd /etc/
systemd/system sudocp rtlsdr.service rtlsdr1.service sudonano rtlsdr1.service
- Edit the ExecStart line to add: -d1 -p1235 as in
- Press Ctl-x followed by y to save and close the file
- Make sure you have two dongles connected to the Pi
sudo systemctlstart rtlsdr1
sudo systemctlstatus rtlsdr1 This checks the status so you should see your dongle reported
- If all is well enter:
sudo systemctlenable rtlsdr1 This will make the second instance automatically run at boot.
That’s it! If you want to stop either service from starting at boot use: sudo systemctl disable rtlsdr or rtlsdr1
To start or stop a service it’s
Mike – G4WNC