Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hanging on [rtl_433] Allocating 15 zero-copy buffers #202

Open
LavaTiger99 opened this issue Oct 10, 2024 · 10 comments
Open

Hanging on [rtl_433] Allocating 15 zero-copy buffers #202

LavaTiger99 opened this issue Oct 10, 2024 · 10 comments

Comments

@LavaTiger99
Copy link

The problem

Setup:
HomeAssistant Green device
Mosquitto broker installed & working
rtl_433_next never worked (didn't auto-connect to mosquitto)
Successfully installed rtl_433, and device pings started showing up in the logs, and it was automatically pushing to MQTT (seen in mqtt explorer)
After a couple hours, it stopped publishing/working. After trying to restart it multiple times, the startup of rtl_433 keeps hanging on [rtl_433] Allocating 15 zero-copy buffers
Strange, since it worked fine a few hours ago.
Tried uninstalling it, reinstalling it.
Tried updating librtlsdr:

[core-ssh ~]$ apk add librtlsdr
(1/2) Installing libusb (1.0.26-r3)
(2/2) Installing librtlsdr (2.0.1-r0)
OK: 107 MiB in 103 packages

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

Starting rtl_433 with rtl_433.conf...
[rtl_433] rtl_433 version 23.11 branch  at 202311281352 inputs file rtl_tcp RTL-SDR
[rtl_433] Found Rafael Micro R820T/2 tuner
[rtl_433] Exact sample rate is: 250000.000414 Hz
[rtl_433] [SDR] Using device 0: Realtek, RTL2838UHIDIR, SN: 00000001, "Generic RTL2832U OEM"
[rtl_433] Allocating 15 zero-copy buffers

Additional information

No response

@deviantintegral
Copy link
Collaborator

Installing librtlsdr won’t do anything there because that’s not inside the addon container. But, we already include otherwise your radio wouldn’t show up at all.

I would start by enabling verbose mode, enabling key / value output, and disabling any protocol filters. See if you’re getting any data at all, even if it’s not from devices you care about.

I’ll also say some of the radios out there are not very robust. In one of my installs I had to both move the radio to a separate powered USB hub, and I had to disable frequency hopping and use two radios because they would lock up after a while.

@uffevedenbrant
Copy link

uffevedenbrant commented Oct 14, 2024

My first SDR radio i bought last week Beginning oct 2024 worked without any issues at all. Took the complete setup to my summer house as its there i have the need for 433.
But it was a little fun to have it in town as well so i ordered a second one.
Failed completely. I could see rtl_433 (next) seeing 433 devices but it really did not look like the first one.
rtl_433 MQTT Auto Discovery (next) actually never added the devices..

However as i had one working instance and one failing i did some comparision.
The one that worked had a file ../config/rtl_433/rtl_433.conf.template with a lot of config in it.
The one that failed hada empty file.

I copied the content from the working HA instans to the failing and then the failing started to wrok.
No clue if the installation in some way created the 0-byte file or something else happened.
However while testing i removed/installed the rtl- addons multiple times so i guess it should have been fixed with reinstallations.

Config in working HA instance. ( note that i never configured this file in the working HA instance.. )

@uffevedenbrant
Copy link

uffevedenbrant commented Oct 14, 2024

Unfortunately the comments created a mess in the config example.. But below is the config statements only without comments..

output mqtt://${host}:${port},user=${username},pass=${password},retain=${retain}
report_meta time:iso:usec:tz

protocol -59
protocol -60
protocol -82
protocol -88
protocol -89
protocol -90
protocol -95
protocol -110
protocol -123
protocol -140
protocol -156
protocol -168

@uffevedenbrant
Copy link

Only diff that i now can think of is that on the first install i went for the standard rtl_433 and then later decided to install the "next" version.

On the second i installed the "next" version immediately.
If there is a diff in the installation and the file is zerobyte in "next" and has some reasonable content in the standard version..
But if the file exists.. It will not be touched/replaced..

@LavaTiger99
Copy link
Author

LavaTiger99 commented Oct 15, 2024

Ok, so now devices are being detected by it, but on startup it does not seem to be publishing to MQTT (mosquito, default settings). Initially when I first installed the rtl433 addon, it automatically published to mqtt without any config file. Since then I have installed, uninstalled the addons, tried next and non-next versions trying to get things to work. Now it is not publishing to mqtt on startup even when I created a manual config file with mqtt credentials... I'm thinking all of my installing & uninstalling has messed things up. I removed the config/rtl_433 folder after uninstalling, but is there anything else I need to remove to completely fresh install everything?

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
Starting rtl_433 with rtl_433.conf...
[rtl_433] rtl_433 version 23.11 branch  at 202311281352 inputs file rtl_tcp RTL-SDR
[rtl_433] Detached kernel driver
[rtl_433] Found Rafael Micro R820T/2 tuner
[rtl_433] [SDR] Using device 0: Realtek, RTL2838UHIDIR, SN: 00000001, "Generic RTL2832U OEM"
[rtl_433] Exact sample rate is: 250000.000414 Hz
[rtl_433] Allocating 15 zero-copy buffers
[rtl_433] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[rtl_433] 
[rtl_433] time      : 2024-10-15 16:32:39
[rtl_433] model     : Govee-Water
[rtl_433] id        : 27188
[rtl_433] event     : Button Press
[rtl_433] detect_wet: 0
[rtl_433] Raw Code  : 6a34305439e8
[rtl_433] Integrity : CRC

@deviantintegral
Copy link
Collaborator

I removed the config/rtl_433 folder after uninstalling, but is there anything else I need to remove to completely fresh install everything?

That should be it. It should create the rtl_433 folder and default configuration file on first start. Does your addon config have the legacy conf_file directive set? If so, remove that:

https://github.com/pbkhrv/rtl_433-hass-addons/blob/main/rtl_433/run.sh#L27

@Robbi-Wan-Kenobi
Copy link

Where you able to solve this issue? I'm having the same Allocating 15 zero-copy buffers problem.
Is there a way to debug this issue, or get more information on ways to solve it?

@MichalDuban
Copy link

Hi, I have very similar issue. I installed the addon, but there is Allocating 15 zero-copy buffers problem. I was able to get some detailed log (please check below). I think this coule be problematic line? [sdr_set_center_freq] Failed to set center freq.

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
[16:37:22] 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/-F log
rtl_433 version 23.11 branch  at 202311281352 inputs file rtl_tcp RTL-SDR
Failed to stat "/config/-F log"
Found Rafael Micro R828D tuner
[SDR] Using device 0: RTLSDRBlog, Blog V4, SN: 00000001, "Generic RTL2832U OEM"
Exact sample rate is: 250000.000414 Hz
[sdr_set_center_freq] Failed to set center freq.
Allocating 15 zero-copy buffers

Hope this will help to solve the issue. Thanks!

@MichalDuban
Copy link

Could it be cause by driver incopatibility? I found interesting post here. They are using different drivers, which should be backward-compatible with older devices..

@kostalmichal
Copy link

I have the same problem with RTL-SDR Blog v4. I tried it on windows, where I had similar problem, but updating drivers solved the problem. Should it be possible to update driver in this addon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants