Skip to content

SDRMR - Cannot specify which USB device to use #33

@SiliconAvatar

Description

@SiliconAvatar

Describe the bug
When more than 1 RTL-SDR device is attached to the host, SDR Meter Reader will always attempt to connect to device 0 even when it is already in use, with no ability to select the other device.

To Reproduce
Plug in 2+ RTL-SDR USB devices into the host.

Expected behavior
There should be the ability to select which device to connect to, by device index or serial number ideally, similar to how RTL_433 allows the device to be selected.

Additional Information
I have 2 USB radio sticks, to read two separate RF devices (a utility meter & an outdoor weather station), each has a differently tuned antenna. On the RTL_433 program I use to read the weather station, I can specify that it should use the device with serial number "00000105". However since that device enumerated at index 0, SDRMR tries to connect to it and fails, with no ability to tell it to use the other device (with the correctly tuned antenna).

Log
Below is the log when starting, with device 0 already in use.

Starting RTLAMR with parameters:
AMR Message Type = scm
AMR Device IDs = 37841928
Time Between Readings = 0
Duration =  0
Electric Unit of measurement =  kWh
Gas Unit of measurement =  ft³
Water Unit of measurement =  gal
Gas Multiplier =  1.0
Electric Multiplier =  1.0
Water Multiplier =  1.0
Debug is  false
Found 2 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000105
  1:  Realtek, RTL2838UHIDIR, SN: 00000103
Using device 0: Generic RTL2832U OEM
usb_claim_interface error -6
Failed to open rtlsdr device #0.
23:31:15.779339 main.go:90: Error connecting to spectrum server: dial tcp 127.0.0.1:1234: connect: connection refused
rcvr.Connect
main.(*Receiver).NewReceiver
	/go/pkg/mod/github.com/bemasher/rtlamr@v0.9.3/main.go:90
main.main
	/go/pkg/mod/github.com/bemasher/rtlamr@v0.9.3/main.go:313
runtime.main
	/usr/lib/go/src/runtime/proc.go:271
runtime.goexit
	/usr/lib/go/src/runtime/asm_amd64.s:1695
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions