KD9IXX
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Installing and Configuring SDRtrunk and Rdio-Scanner for Remote Streaming

After several hours of frustration this evening, I FINALLY figured out how to make SDRtrunk and Rdio-Scanner play nice and work. I learned about some caveats and weirdness that has to be worked around or configured properly to operate as intended. This article assumes you have an up to date installation of ubuntu server on a physical machine which has an SDR plugged in.

I decided to use SDRTrunk because I have worked with it previously and it seems to work well for my county’s radio system and my single SDR setup. Luckily for me, at some point not too long ago rdio-scanner seems to have added improved support for SDRtrunk. With the aformentioned support added it no longer requires Dirwatch which is great from a disk perspective, saving lots of disk writes. The unfortunate part though is much of the configuration and even some basic information is either scattered about in random places or just plain nonexistent. This little article aims to change that and hopefully help anyone who also wants to set up a remote, headless SDRtrunk/Rdio-scanner streaming setup.

Installing librtlsdr and udev rules

First things first, we need to install librtlsdr and the proper udev rules to blacklist the dvbt drivers from running and meddling with our connection.

  1. sudo apt-get install build-essential cmake git libusb-dev libusb-1.0-0-dev
  2. git clone https://github.com/librtlsdr/librtlsdr.git
  3. cd librtlsdr
  4. mkdir build && cd build
  5. cmake ../ -DINSTALL_UDEV_RULES=ON
  6. make
  7. sudo make install
  8. sudo ldconfig

Now you should have the rtl_sdr binaries built and installed on your system with the udev rules installed. Plug in your SDR if it isn’t already and run rtl_test to check that the kernel hasn’t loaded the dvbt drivers and the utility can connect to your SDR. If theres any errors, check the udev rules exist at /etc/udev/rules.d/ and reboot.

Installing SDRtrunk

Assuming all went well so far, now lets install SDRtrunk. Latest binary as of writing is 0.6.0, though there appears to be a bug filed (3 days ago!) that breaks headless operation. The current dev/nightly builds seems to work properly so use those for the time being. Make sure your playlists are backed up just in case!

  1. wget https://github.com/DSheirer/sdrtrunk/releases/download/nightly/sdr-trunk-linux-x86_64-vnightly.zip
  2. unzip sdr-trunk-linux-x86_64-vnightly.zip

Run bin/sdr-trunk to autogenerate the SDRtrunk folder in your home directory and then exit the program.

Configuring SDRtrunk

In the Channels section of the SDRtrunk GUI, you must input all the control channels for your system. Make sure to tick the auto-start option as well.

You also need your systems’ talkgroups. There are a few ways to go about this, the easy way is to pay RadioReference $15 so you can get access to download the .csv of your local system’s info. Unless your system is really large I do not recommend doing that as the RadioReference CEO is an asshat. For my local county system there is <100 talkgroups and I was salty, so I manually created each one. I did this on my local Windows machine in the SDRtrunk GUI, but you can code it by hand in an XML file.

There are a few key things to note here:

  • If you have the option for talkgroups to auto-populate for your system, whatever the name you set in SDRtrunk is what will appear for both the short name and full name. You can change the full name manually with the setting still on, but you cannot change the short name. If you do, it will save until another call comes in and will revert to whatever it is in SDRtrunk.

  • As you go through talkgroup creation, make sure to scroll down to the bottom of the alias page to the streaming section and move your rdio-scanner instance to ACTIVE! This is the part I overlooked and made me go insane wondering why SDRtrunk connected fine to rdio-scanner but no calls were coming through. I suggest just enabling streaming for all, and mute in the rdio-scanner interface.

  • When you setup a stream in SDRtrunk for rdio-scanner, make sure your API key is not disabled (When you create the key, DONT flip the disable switch!) and when you enter the URL for your rdio-scanner instance, make sure to also include the port (usually 3000) after the URL for it to connect!

  • Create at least one or more talkgroups IN RDIO-SCANNER before using the auto-populate feature to avoid any no talkgroup/channel info errors. This might not be required, but I did so and it seemed to help.

Installing Rdio-Scanner

Pretty simple as there isn’t anything to install unless you are building from source.

  1. wget https://github.com/chuot/rdio-scanner/releases/download/v6.6.3/rdio-scanner-linux-amd64-v6.6.3.zip
  2. unzip rdio-scanner-linux-amd64-v6.6.3.zip

This should give you a pdf and the main executable. Run the executable and then change the default password, create your system with its ID, and add the aforementioned few talkgroups.

Testing

I tested via RDP and GUI, but I think as long as you have your playlist setup properly and configured correctly you should be able to do this remotely. Run the rdio-scanner executable and leave it running while you run sdr-trunk. If all goes well your SDR should be detected, playlist should initialize, trunking channels should be scanned and the active one locked on, and then hopefully you start seeing calls coming through. Those calls should be recorded as they happen, then immediately upload to rdio-scanner. Make sure you have “Live Feed’ ticked to hear calls as they come in.

Headless Setup

I set up my applications using systemd services. I also specifically made sure that rdio-scanner has to be up before SDRtrunk to allow for it to connect properly.

[Unit]
Description=SDR-Trunk
After=syslog.target
Requires=rdioscanner.service

[Service]
ExecStart=/home/trevor/sdr-trunk-linux-x86_64-vnightly/bin/sdr-trunk
Restart=always
RestartSec=120
WorkingDirectory=/home/trevor/sdr-trunk-linux-x86_64-vnightly
User=trevor
SyslogIdentifier=sdr_trunk

[Install]
WantedBy=multi-user.target

And here is the service for rdio-scanner.

[Unit]
Description=RdioScanner
After=syslog.target

[Service]
ExecStart=/home/trevor/rdio-scanner
Restart=always
RestartSec=120
WorkingDirectory=/home/trevor
User=root
SyslogIdentifier=rdio_scanner

[Install]
WantedBy=multi-user.target

Once you have those files created at /etc/systemd/system/sdrtrunk.service and /etc/systemd/system/rdioscanner.service respectively, run the following

  1. sudo systemctl daemon-reload
  2. sudo systemctl enable sdrtrunk.service
  3. sudo systemctl enable rdioscanner.service
  4. sudo systemctl start rdioscanner.service
  5. sudo systemctl start sdrtrunk.service

which should reload the systemctl daemon for any service changes, enable both programs to start at boot (with SDRtrunk requiring Rdio-scanner to start first), and then start the programs. Run sudo systemctl status <name>.service to check they are running as well as journalctl -xe for more detailed output.

If everything went well then congrats! You should be able to listen to your local trunked radio system using rdio-scanner and SDRtrunk!