rsadsb/dump1090_rs

SoapySDR remotes aren't matching

Closed this issue · 9 comments

I'm unable to select a remote device using SoapySDR's driver syntax, even thought SoapySDRUtil can find it:

$ SoapySDRUtil --find="driver=remote, remote=192.168.1.184, remote:driver=rtlsdr"
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Found device 0
  available = Yes
  driver = remote
  label = Generic RTL2832U OEM :: 
  manufacturer = Realtek
  product = RTL2838UHIDIR
  remote = tcp://192.168.1.184:55132
  remote:driver = rtlsdr
  rtl = 0
  serial = 
  tuner = Elonics E4000


$ dump1090 --driver "driver=remote, remote=192.168.1.184, remote:driver=rtlsdr"
[-] using driver: driver=remote, remote=192.168.1.184, remote:driver=rtlsdr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: Other, message: "SoapySDR::Device::make() no match" }', dump1090_rs/src/main.rs:81:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

There aren't any examples, really for doing this type of connectivity with the code, but it seems like it should work as other applications (CubicSDR, for example) can use the same remote sdr source just fine. It's most likely something to do with the driver selection in the command line, but without any good docks here, i'm just trying various combinations and still getting nowhere.

Is this using https://github.com/pothosware/SoapyRemote? I'll add support for this.

Thanks for showing me SoapyRemote, pretty cool application.

Maye I need to make it clearer, but this is already supported and it works on my machine. The --driver already has the driver= by default, so removing the driver= makes this work perfectly.

dump1090 --driver "remote, remote=localhost, remote:driver=rtlsdr"

I'll close this issue, let me know if this doesn't work for you.

A minor point. you would need the following in a config file:

# rtlsdr
[[sdrs]]
driver = "remote, remote=localhost, remote:driver=rtlsdr"

[[sdrs.gain]]
key = "TUNER"
value = 49.6

Sorry was on a plane yesterday, but this still doesn't work here.

$ ping -w 1 -c 1 192.168.1.184
PING 192.168.1.184 (192.168.1.184) 56(84) bytes of data.
64 bytes from 192.168.1.184: icmp_seq=1 ttl=64 time=0.192 ms

--- 192.168.1.184 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.192/0.192/0.192/0.000 ms

$ dump1090 --driver "remote, remote=192.168.1.184, remote:driver=rtlsdr"
[-] using driver: remote, remote=192.168.1.184, remote:driver=rtlsdr
thread 'main' panicked at 'called Result::unwrap() on an Err value: Error { code: Other, message: "SoapySDR::Device::make() no match" }', dump1090_rs/src/main.rs:81:75
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

And this is after doing a fresh git pull just now.

and yes:

/usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/libremoteSupport.so

works fine with CubicSDR

$ SoapySDRUtil --check=remote
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################

Loading modules... done
Checking driver 'remote'... PRESENT

SoapySDRUtil --make="driver=remote"
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################

Make device driver=remote
driver=RTLSDR
hardware=E4000
origin=https://github.com/pothosware/SoapyRTLSDR
remote:version=0.5.2-unknown
rtl=0

$ echo $?
0

$ SoapySDRUtil --probe="driver=remote"
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################

Probe device driver=remote

----------------------------------------------------
-- Device identification
----------------------------------------------------
driver=RTLSDR
hardware=E4000
origin=https://github.com/pothosware/SoapyRTLSDR
remote:version=0.5.2-unknown
rtl=0

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
Channels: 1 Rx, 0 Tx
Timestamps: NO
Other Settings:
* Direct Sampling - RTL-SDR Direct Sampling Mode
[key=direct_samp, default=0, type=string, options=(0, 1, 2)]
* Offset Tune - RTL-SDR Offset Tuning Mode
[key=offset_tune, default=false, type=bool]
* I/Q Swap - RTL-SDR I/Q Swap Mode
[key=iq_swap, default=false, type=bool]
* Digital AGC - RTL-SDR digital AGC Mode
[key=digital_agc, default=false, type=bool]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
Full-duplex: YES
Supports AGC: YES
Stream formats: CS8, CS16, CF32
Native format: CS8 [full-scale=128]
Stream args:
* Buffer Size - Number of bytes per buffer, multiples of 512 only.
[key=bufflen, units=bytes, default=262144, type=int]
* Ring buffers - Number of buffers in the ring.
[key=buffers, units=buffers, default=15, type=int]
* Async buffers - Number of async usb buffers (advanced).
[key=asyncBuffs, units=buffers, default=0, type=int]
* Remote Format - The stream format used on the remote device.
[key=remote:format, default=CS8, type=string, options=(CS8, CS16, CF32)]
* Remote Scale - The factor used to scale remote samples to full-scale floats.
[key=remote:scale, default=128.000000, type=float]
* Remote MTU - The maximum datagram transfer size in bytes.
[key=remote:mtu, units=bytes, default=1500, type=int]
* Remote Window - The size of the kernel socket buffer in bytes.
[key=remote:window, units=bytes, default=44040192, type=int]
* Remote Priority - Specify the scheduling priority of the server forwarding threads.
[key=remote:priority, default=0.500000, type=float, range=[-1, 1]]
* Remote Protocol - Specify the transport protocol for the remote stream.
[key=remote:prot, default=udp, type=string, options=(udp, tcp, none)]
Antennas: RX
Full gain range: [0, 96] dB
IF1 gain range: [-3, 6] dB
IF2 gain range: [0, 9] dB
IF3 gain range: [0, 9] dB
IF4 gain range: [0, 2] dB
IF5 gain range: [3, 15] dB
IF6 gain range: [3, 15] dB
TUNER gain range: [-1, 42] dB
Full freq range: [51.999, 2200] MHz
RF freq range: [52, 2200] MHz
CORR freq range: [-0.001, 0.001] MHz
Sample rates: 0.25, 1.024, 1.536, 1.792, 1.92, 2.048, 2.16, 2.56, 2.88, 3.2 MSps

Here are all the commands, I haven't tried on a non-localhost so maybe that's the issue?

> SoapySDRServer --bind --driver=rtlsdr
######################################################
## Soapy Server -- Use any Soapy SDR remotely
######################################################

Server version: 0.5.2-unknown
Server UUID: efb5b6c8-f121-16e8-8567-9390a8c0372a
Launching the server... tcp://[::]:55132
Server bound to [::]:55132
Launching discovery server...
Connecting to DNS-SD daemon...
[INFO] Avahi version:  (null)
[INFO] Avahi hostname: (null)
[INFO] Avahi domain:   (null)
[INFO] Avahi FQDN:     (null)
[ERROR] avahi_entry_group_new() failed
Press Ctrl+C to stop the server
> cargo run --release -- --driver="remote, remote=localhost, remote:driver=rtlsdr"
[-] using soapysdr driver: driver=remote, remote=localhost, remote:driver=rtlsdr
[INFO] Opening Generic RTL2832U OEM :: 00000001...
[-] frequency: Ok(1090000000.0)
[-] sample rate: Ok(2400000.0)
[-] available gains: ["TUNER"]
[ Unrelated config error ]
[INFO] SoapyRemote::setupRxStream(remoteFormat=CS8, localFormat=CS16, scaleFactor=128, mtu=1500, window=44040192)
[INFO] Client side stream bound to [::1]:43472
[INFO] Client side status bound to [::1]:42650
[INFO] Using format CS8.
[INFO] Server side stream bound to [::1]:50099
[INFO] Server side stream connected to [::1]:43472
[INFO] Server side status connected to [::1]:42650
[INFO] Configured sender endpoint: dgram=1452 bytes, 714 elements @ 2 bytes, window=43008 KiB
[INFO] Client side stream connected to [::1]:50099
[WARNING] Set thread priority 0.5 failed: Operation not permitted
[INFO] Configured receiver endpoint: dgram=1452 bytes, 714 elements @ 2 bytes, window=43008 KiB
*8da38dd89909332ff0082df596f6;
*8da38dd89909332ff0082df596f6;
*5da1928cc4d669abbc609a692b63;
*8da88e295995a5d5812324a830fe;
*8da5fc87587365fdccec3017868c;
*8da5fc879989162ba06c22385579;
*8da40b1258dd0244bc7c2ab475cf;

Yes - i have the server running on the remote host, and the local host is able to see it and bind to it using SoapySDRUtil, as shown in my comment.

I'm unfortunately not in the same state as the remote, so I can't move it between hosts. But the "SDR server" and the "dump1090 host" are on the same local segment with no firewalling, so it does seem that it's an issue with non-local connections.

  • forgot to add, also tried with a resolvable hostname instead of the bare IP, and that did not work either/

Not sure if this is useful:

$ RUST_BACKTRACE=1 target/debug/dump1090_rs  --driver "remote, remote=tcp://192.168.1.184:55132, remote:driver=rtlsdr" 
[-] processing default config
[-] using soapysdr driver: driver=remote, remote=tcp://192.168.1.184:55132, remote:driver=rtlsdr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: Other, message: "SoapySDR::Device::make() no match" }', dump1090_rs/src/main.rs:85:45
stack backtrace:
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::result::unwrap_failed
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/result.rs:1613:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/result.rs:1295:23
   4: dump1090_rs::main
             at ./dump1090_rs/src/main.rs:85:13
   5: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
$ SoapySDRUtil --find="driver=remote"
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Found device 0
  available = Yes
  driver = remote
  label = Generic RTL2832U OEM :: 
  manufacturer = Realtek
  product = RTL2838UHIDIR
  remote = tcp://192.168.1.184:55132
  remote:driver = rtlsdr
  rtl = 0
  serial = 
  tuner = Elonics E4000

jfath commented

I think my build is working with soapyremote-server on a remote system:

me@mysystem-3700x:~/src/dump1090_rs$ target/release/dump1090_rs --driver "remote, remote=tcp://192.168.223.89:55132, remote:driver=airspy" --custom-config xu4radio.toml
[-] read in custom config: xu4radio.toml
[-] using soapysdr driver: driver=remote, remote=tcp://192.168.223.89:55132, remote:driver=airspy
[-] using config: Sdr {
channel: 0,
driver: "remote, remote=tcp://192.168.223.89:55132, remote:driver=airspy",
setting: None,
gain: [
Gain {
key: "TUNER",
value: 40.0,
},
],
antenna: None,
}
[-] Writing gain: TUNER = 40
[-] frequency: Ok(1090000000.0)
[-] sample rate: Ok(2400000.0)
[INFO] SoapyRemote::setupRxStream(remoteFormat=CS16, localFormat=CS16, scaleFactor=32767, mtu=1500, window=44040192)
[INFO] Client side stream bound to 192.168.222.39:37461
[INFO] Client side status bound to 192.168.222.39:51581
[INFO] Using format CS16.
[INFO] Server side stream bound to [::ffff:192.168.223.89]:43966
[INFO] Server side stream connected to [::ffff:192.168.222.39]:37461
[INFO] Server side status connected to [::ffff:192.168.222.39]:51581
[WARNING] StreamEndpoint resize socket buffer: set 43008 KiB, got 176 KiB
[INFO] Configured sender endpoint: dgram=1452 bytes, 357 elements @ 4 bytes, window=176 KiB
[INFO] Client side stream connected to 192.168.223.89:43966
[WARNING] StreamEndpoint resize socket buffer: set 43008 KiB, got 208 KiB
[INFO] Configured receiver endpoint: dgram=1452 bytes, 357 elements @ 4 bytes, window=208 KiB
SSSSSSSSOSSS ...

Ah, I see now, i'm using the wrong "driver" :

dump1090_rs$ target/release/dump1090_rs --driver "remote, remote=tcp://192.168.1.184:55132, remote:driver=rtlsdr"

[-] using soapysdr driver: driver=remote, remote=tcp://192.168.1.184:55132, remote:driver=rtlsdr
[-] frequency: Ok(1090000000.0)
[-] sample rate: Ok(2400000.0)
[-] available gains: ["IF1", "IF2", "IF3", "IF4", "IF5", "IF6", "TUNER"]
[!] driver=remote, remote=tcp://192.168.1.184:55132, remote:driver=rtlsdr not found in config, not setting sdr config settings
[INFO] SoapyRemote::setupRxStream(remoteFormat=CS8, localFormat=CS16, scaleFactor=128, mtu=1500, window=44040192)
[INFO] Client side stream bound to 192.168.1.4:45566
[INFO] Client side status bound to 192.168.1.4:38034
[INFO] Using format CS8.
[INFO] Server side stream bound to [::ffff:192.168.1.184]:55871
[INFO] Server side stream connected to [::ffff:192.168.1.4]:45566
[INFO] Server side status connected to [::ffff:192.168.1.4]:38034
[WARNING] StreamEndpoint resize socket buffer: set 43008 KiB, got 176 KiB
[INFO] Configured sender endpoint: dgram=1452 bytes, 714 elements @ 2 bytes, window=176 KiB
[INFO] Client side stream connected to 192.168.1.184:55871
[INFO] Configured receiver endpoint: dgram=1452 bytes, 714 elements @ 2 bytes, window=43008 KiB
*8da0000c592a840fad8731c56728;
*5dac30cdb7c960cd438aa6bf3784;
*8dac30cd9908ad8400580bc6d8c4;
*5da0000ccbd7ccb72937a8c8b662;
*8dac30cdf8200002004ab88865ec;
*8da0000c9910030d6804043b6611;

So, it's just the syntax. Time to update the documentation to make this a bit more obvious.

Thanks, @jfath for the validation and hint toward my actual issue.