mikenye / docker-readsb

Multi-architecture readsb container with support for RTLSDR, bladeRF and plutoSDR (x86_64, arm32v7, arm64v8)
83 stars 4 forks source link

Error when using 2 dongles on same device. #25

Closed pmd5700 closed 4 years ago

pmd5700 commented 4 years ago

If I have 2 dongles plugged into my device and start readsb, I get the following error:

readsb           | Tue Aug 18 15:37:11 2020 EDT  Mictronics v3.9.0 starting up.
readsb           | [mlat_hub] Tue Aug 18 15:37:11 2020 EDT  Mictronics v3.9.0 starting up.
readsb           | [mlat_hub] Net-only mode, no SDR device or file open.
readsb           | rtlsdr: error querying device #0: No such file or directory
readsb           | [cmd] /usr/local/bin/readsb exited 1

If I remove the 2nd dongle, I get

readsb           | Tue Aug 18 15:43:58 2020 EDT  Mictronics v3.9.0 starting up.
readsb           | rtlsdr: using device #0: Generic RTL2832U (Realtek, RTL2832U, SN 00001090)
readsb           | [mlat_hub] Beast TCP input: Name resolution for adsbx failed: Name or service not known
readsb           | [mlat_hub] Beast TCP input: Name resolution for piaware failed: Name or service not known
readsb           | Found Rafael Micro R820T tuner
readsb           | rtlsdr: tuner gain set to 49.6 dB
mikenye commented 4 years ago

Hi @pmd5700,

Sorry you're having problems. In order to help you, are you able to complete the following steps and post your output?

  1. Stop any existing programs that are using your RTL-SDR radios.
  2. Start the readsb container...
    • Mapping through the USB bus (so the container can access all RTL-SDR radios); and
    • Change the entrypoint to bash so none of the services are started
$ docker run --rm -it --device /dev/bus/usb:/dev/bus/usb --entrypoint bash mikenye/readsb
root@5e2ef605eca8:/#
  1. Once in the container shell, issue the command rtl_eeprom, which will should display information about the RTL-SDR radios it can see:
root@5e2ef605eca8:/# rtl_eeprom
Found 1 device(s):
  0:  Generic RTL2832U

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner

Current configuration:
__________________________________________
Vendor ID:              0x0bda
Product ID:             0x2832
Manufacturer:           Realtek
Product:                RTL2832U
Serial number:          00001000
Serial number enabled:  yes
IR endpoint enabled:    no
Remote wakeup enabled:  no
__________________________________________
  1. Capture all of the output from the commands above, and post them to this issue. :-)

You can then log out of the container (it will automatically be deleted due to the --rm argument), and restart your services using your RTL-SDRs.

Thanks.

pmd5700 commented 4 years ago
pi@raspberrypi:/opt/adsb $ sudo docker run --rm -it --device /dev/bus/usb:/dev/bus/usb --entrypoint bash mikenye/readsb
root@6b3293249466:/# rtl_eeprom
Found 2 device(s):
  0:  Generic RTL2832U OEM
  1:  Generic RTL2832U

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner

Current configuration:
__________________________________________
Vendor ID:              0x0bda
Product ID:             0x2838
Manufacturer:           Realtek
Product:                RTL2838UHIDIR
Serial number:          00000978
Serial number enabled:  yes
IR endpoint enabled:    yes
Remote wakeup enabled:  no
__________________________________________
root@6b3293249466:/#

FYI - the device 0 being used right now is the 2nd dongle that I plugged in. I normally use other device for ADSB.

mikenye commented 4 years ago

Can you repeat the above, but replace the rtl_eeprom command with rtl_eeprom -d 1 please?

Thanks.

pmd5700 commented 4 years ago
pi@raspberrypi:/opt/adsb $ sudo docker run --rm -it --device /dev/bus/usb:/dev/bus/usb --entrypoint bash mikenye/readsb
root@3aef2346b41c:/# rtl_eeprom -d 1
Found 2 device(s):
  0:  Generic RTL2832U OEM
  1:  Generic RTL2832U

Using device 1: Generic RTL2832U
Found Rafael Micro R820T tuner

Current configuration:
__________________________________________
Vendor ID:              0x0bda
Product ID:             0x2832
Manufacturer:           Realtek
Product:                RTL2832U
Serial number:          00001090
Serial number enabled:  yes
IR endpoint enabled:    no
Remote wakeup enabled:  no
__________________________________________
root@3aef2346b41c:/#
mikenye commented 4 years ago

Thanks. Can you post the section of your docker-compose.yml that defines your readsb container?

pmd5700 commented 4 years ago
  readsb:
    image: mikenye/readsb:latest
    tty: true
    container_name: readsb
    restart: always
    devices:
      - /dev/bus/usb/001/005:/dev/bus/usb/001/005
    ports:
      - 8080:8080
      - 30005:30005
    networks:
      - adsbnet
    environment:
      - TZ=America/New_York
      - PULLMLAT=adsbx:30105,piaware:30105
    command:
      - --dcfilter
      - --device-type=rtlsdr
      - --json-location-accuracy=2
      - --lat=XX
      - --lon=YY
      - --modeac
      - --ppm=0
      - --net
      - --stats-every=3600
      - --quiet
      - --write-json=/run/readsb
mikenye commented 4 years ago

That should hopefully solve your problem.

pmd5700 commented 4 years ago

That worked!