pbkhrv / rtl_433-hass-addons

Collection of Home Assistant add-ons that use rtl_433
239 stars 109 forks source link

Support SoapySDR Devices #198

Closed maranhaoBruno closed 1 month ago

maranhaoBruno commented 2 months ago

The problem

As soon as I start the add on it stops itself. I thought this was the result of not "finding" the device (I'm using a RSP1A bought directly from SDRPlay), so I created a configuration file where I include "device 3" since the device appears as "Bus 003 Device 003: ID 1df7:3000" when I type "lsusb" into the terminal. Do I have to install any SoapySDR drivers?

What addon are you reporting the bug for?

rtl_443

What is the addon version?

0.5.2

What type of MQTT Broker are you using?

Home Assistant Mosquitto MQTT Broker

Addon log messages

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[12:09:35] WARNING: rtl_433 now supports automatic configuration and multiple radios. The rtl_433_conf_file option is deprecated. See the documentation for migration instructions.
Starting rtl_433 -c /config/rtl_433/rtl_433.conf
rtl_433 version 23.11 branch  at 202311281352 inputs file rtl_tcp RTL-SDR
MQTT: Publishing MQTT data to 10.0.0.78 port 1883
MQTT: Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
MQTT: Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
MQTT: Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
Use "-F log" if you want any messages, warnings, and errors in the console.
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

Additional information

No response

deviantintegral commented 2 months ago

Can you turn on verbose logging in your rtl configuration? I don't see any messages here that indicate a radio is being found at all. If you only have one rtl device, you shouldn't need to specify it. Note the number is a basic index of devices, and not related to the USB bus path, and starts at zero.

maranhaoBruno commented 2 months ago

@deviantintegral Thanks for the response and the info on the indexing.

Thanks again for helping me troubleshoot this; would you mind telling me how to turn on verbose logging? Is this a system's level setting in my config file, because the system logger (https://www.home-assistant.io/integrations/logger/) doesn't appear to have a "verbose" setting.

I only have one radio, and I know it is not an issue with the hardware itself because I was able to listen to local FM stations when attached to my laptop.

deviantintegral commented 2 months ago

Ah, I meant in rtl_433 itself: https://github.com/merbanan/rtl_433/blob/master/conf/rtl_433.example.conf#L21-L25

Also, to answer on SoapySDR, it should just work out of the box. Something else to double check is to run rtl_433 directly on your laptop and see if it detects the radio.

maranhaoBruno commented 2 months ago

Your suspicion was correct, I'm getting "[SDR] No supported devices found." in the log. I wonder why that is. When I connected the RSP1A to my laptop I utilized it through the SDRconnect application, but I also believe I had to install some driver on my MacBook. I'll try to install the driver on my HASS RPi5.

maranhaoBruno commented 2 months ago

So I played around with the configuration file because an example one said that the default was to utilize RTL-SDR, but the Github page for this add-on states that the RSP1A is supported through SoapySDR. Adding device "" to the configuration file results in "[sdr_open] No input driver for SoapySDR compiled in." appearing in the log. I think the issue is a lack of SoapySDR on the platform.

deviantintegral commented 2 months ago

It looks like SoapySDR support is optional when building rtl_433: https://github.com/merbanan/rtl_433/blob/e25cfc0fa267b8aaff24956a41220de86774e8fe/docs/BUILDING.md?plain=1#L91-L94

The last build logs shows we're not building in SoapySDR support: https://github.com/pbkhrv/rtl_433-hass-addons/actions/runs/10955967463/job/30420977925#step:9:870

Could NOT find SoapySDR (missing: SoapySDR_DIR)

It looks like SoapySDR was only added to Alpine in 3.19, which came out in December 2023. We are upgraded to that version, so I think if we install it rtl_433 should link to it when building the docker images.

maranhaoBruno commented 2 months ago

@deviantintegral this is a little bit over my head, but what I'm understanding is that the rtl_433-hass-addons needs to be updated to support SoapySDR and the devices that rtl_433 supports through that driver, so I should sit tight until the next release, is that correct?

Addendum: I purchased the SRDplay RSP1A based on documentation of devices supported by rtl_433 found here (https://triq.org/rtl_433/HARDWARE.html), in the interim it may be nice to update the documentation of rtl_433-hass-addons to specify which devices are and are not currently supported.

Thanks for helping me troubleshoot this and everything you're doing for the HASS community.

deviantintegral commented 2 months ago

@maranhaoBruno I've added support for this in https://github.com/pbkhrv/rtl_433-hass-addons/pull/199. I've left testing steps, but if it's beyond your comfort that's OK.

Actually... I have a HackRF! I don't use it for rtl_433, but apparently it also requires soapysdr. So, I can test too.

deviantintegral commented 1 month ago

I've merged https://github.com/pbkhrv/rtl_433-hass-addons/pull/199 into the next branch.