A potential work-around for multiple RTL devices with their own spyserver

Show off any of your RTL-SDR or cheap SDR related projects.
Post Reply
Timpanogos Slim
Posts: 14
Joined: Mon Feb 10, 2020 1:39 am

A potential work-around for multiple RTL devices with their own spyserver

Post by Timpanogos Slim » Mon Feb 10, 2020 5:38 am

My vague plan at the moment is to have three rtl-sdr devices hung off of an allwinner h5 SBC. Each SDR will have its own usb bus, because that's a feature of the H5 - multiple usb host adapters. Based on my experiments tonight with a single SDR, three won't stress the cpu.

Here and elsewhere, the question of how to associate a specific RTL-SDR with a specific instance of spyserver seems to have always been "there's not a good way to do it" and that's probably the designed functionality since spyserver is really for airspy devices.

Multiple sources say that the serial number line in spyserver.config is only used when the device type is an airspy device.

The only exception to that, that I've seen, is another post on this forum, here:


"He did it right for 0 and 1 when he didn't prepend 0x"

I might try it but I'm gonna be skeptical for now.

Right now i have two sdr devices. My old e4000 dvb-t stick has a long serial number and no eeprom. my v3 rtl-sdr.com dongle of course has an eeprom and a default serial number of "1" which can be changed to anything.

read more about udev rules here: https://wiki.debian.org/udev

It turns out that the serial number is an attribute that can be used in a udev rule because it is reported through that api.

The udev rules that we've all been installing on our linux systems just make it so that every unprivileged user can utilize every sdr which is a good start.

I think I can write udev rules such that each individual rtl dongle gets assigned permissions so that it is only readable by a specific user.

Then each instance of spyserver will run as one of those users, and hopefully the "first available" sdr device for each of them is simply the only one that they can access, and it doesn't fall on its face when it tries to find sdr devices and can't open them.

Timpanogos Slim
Posts: 14
Joined: Mon Feb 10, 2020 1:39 am

Re: A potential work-around for multiple RTL devices with their own spyserver

Post by Timpanogos Slim » Tue Feb 11, 2020 9:54 pm

Now that i've been playing with it for a couple days, i have to admit i had no idea how hard it is to keep two instances of spyserver both configured for rtl-sdr from stepping on each other's toes.

it looks like when you start it up it walks sysfs to find the "first available" rtl-sdr, which turns out to mean any rtl-sdr even if the device is already locked e.g. not even available.

So your first and second instances both try to use the device with index 0.

I have not found any evidence to suggest that it can be convinced to do otherwise.

Probably a better idea to just dedicate an orange pi zero to each sdr if you want a small low power remote headless server.

Posts: 1
Joined: Tue Aug 11, 2020 7:54 pm

Re: A potential work-around for multiple RTL devices with their own spyserver

Post by LotarInc » Tue Aug 11, 2020 8:42 pm

Hi there,

I'm trying to setup two sdrs with different antennas (discone and HF longwire) on the same Raspberry pi

Did you managed to make two instances of spyserver play nice with two rtl_sdrs?
I'm currently struggling to make it work. I changed (rtl_eeprom) the serial numbers on both sdrs and setup different config files for each SDR.

My sdrs are now sn 00000101 and sn 00000102 specifically.
In both config files (second one as example), I setup the serial

as decimal
device_serial = 00000102

as decimal (short)
device_serial = 102

and hex
device_serial = 66

and (full lenght) hex
device_serial = 0x0000000000000066

Even tried the usb Device ID
device_serial = 005

Unfortunately, spyserver appeaser to not "find" my sdrs by their specific SNs, whatever variant I try. (i'm probably missing something very obvious here :? )

It hangs on
Listening for connections
not finding the SDR which would result in
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!

The only way to make it work (a single instance) is to set device_serial = 0 and let spyserver find the first available device (which is somewhat misleading in the info section of the config file, as spyserver looks for the first device, not taking into account if it is available or not. Probably with official airspy hardware it works as advertised)

Letting device_serial = 0 results in one instance (first one) running fine grabbing one of the two sdrs available and the second one in perpetual limbo trying to connect to the same sdr...

Any help would be appreciated :)

Posts: 1
Joined: Mon Dec 07, 2020 10:18 pm

Re: A potential work-around for multiple RTL devices with their own spyserver

Post by blankA » Mon Dec 07, 2020 10:47 pm

It's disheartening this hasn't been answered, my own conclusion is that it isn't possible to select by serial numbers outside of Airspy's hardware. Being that the RTLs S/N is decimal and the server needs a hex value. I'm in the testing stage for an outdoor based PoE powered Pi4 based receiver set and since the SDRs are cheap and the Pi4 has 4 ports I might as well fill them up. The main is for a wideband discone to be split and a second SDR dedicated to an up converter (ham it up because it's cheap), a flightaware SDR for ADS-B, and the other is likely to be trunk tracking. I do have an R2 and spyverter for mobile use but they are too expensive to throw outside in longterm testing for a project that could be killed by a lightning strike or destroyed by weather/moisture. It's not really a realistic option to go out every time the Pi power cycles and play the unplug goat rope with VNC just to get the right device per instances of spyserver especially because I wanted to use it with a VPN while I was away. dump1090 does allow picking a device by index which while not ideal is an improvement. I do appreciate your suggestion about multiple Orange Pi I'd have to put a PoE Passthrough Switch out there to power them though, perhaps that's the best option to avoid spyserver issues but keeping up with 4 separate hosts would be no less of a hassle perhaps more.

I do wish they would allow the spyserver to accept decimal serial numbers...

Post Reply