home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.89k stars 28.98k forks source link

EDL21 not getting data after few minutes or hours #98409

Open FrankV84 opened 11 months ago

FrankV84 commented 11 months ago

The problem

Hello,

I have added EDL21 integration, everything looks good, but after a few minutes or sometimes hours, no current data arrives.

i have 2 of this Sensors (https://www.ebay.de/itm/313884760667)

Then after a restart it works again for a while.

I have disconnected one of this Sensor, then it works now.

regards,

Frank

What version of Home Assistant Core has the issue?

core-2023.7.3

What was the last working version of Home Assistant Core?

What type of installation are you running?

Home Assistant Container

Integration causing the issue

EDL21

Link to integration documentation on our website

https://www.home-assistant.io/integrations/edl21/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

edl21 documentation edl21 source

StephanU commented 10 months ago

Hi @FrankV84,

I'm using the same type of cable with two smart meters for over a year now without problems, so this does work (for some of us ^^).

Do you have two "identical" smart meters (regarding brand/type)? Are the smart meters connected to the Raspberry directly or via an usb hub?

Could you try switching the usb cables for the two smart meters to see if there is a problem with a cable itself? Does the problem occure on one specific usb port? If so, Could you try using a different usb port?

FrankV84 commented 10 months ago

Hi Stephan,

Yes I use the same smart meters with different sn directly connected to the pi.

i use now node red to send the information via mqtt to home assistant, it worked now since nearly two weeks

strubbi77 commented 10 months ago

I can confirm that I have the same problem. After some time one of the 2 sensors is stopping to work. Didn't have time to go into the issue deeper.

christophweser commented 9 months ago

I also have the same problem.

Out of nothing you see in the logs: b'' ^ 2023-09-24 19:58:20.169 WARNING (MainThread) [sml.asyncio] Timeout while waiting for meter data. Please check reading device. Restarting edl21 2023-09-24 20:00:30.186 WARNING (MainThread) [sml.asyncio] Timeout while waiting for meter data. Please check reading device. Restarting edl21 2023-09-24 20:02:40.198 WARNING (MainThread) [sml.asyncio] Timeout while waiting for meter data. Please check reading device. Restarting edl21 2023-09-24 20:04:50.210 WARNING (MainThread) [sml.asyncio] Timeout while waiting for meter data. Please check reading device. Restarting edl21

After restarting HA it works again for a time span between half day and 2-3 days till it's again stuck.

Any idea?

chhell commented 9 months ago

Unfortunately, I also have the same error pattern.

christophweser commented 9 months ago

Any solution or hints how to solve? (After having ONE of the TWO disconnected is runs like a charme.)

nilsella commented 9 months ago

I have the same problem. It was working for a long time without any problem. But now i have to restart HA several times to make it work again... I hope somebody has a solution for it... :-)

Ottmar0815 commented 9 months ago

I have the same problem since a few weeks.

Greetings

christophweser commented 8 months ago

Has anyone heard/figured out some helpful news as it seems no one is able to provide a bugfix I guess?

StephanU commented 8 months ago

I also have this problem occasionally. I cannot see anything in the implementation of this integration which could explain this behavior. I still think that this is some kind of hardware issue related to the usb port.

christophweser commented 8 months ago

Hey Stephan,

form my tests it doesn't come from the USB port as I changed all possible permutations and it only occurs at least in my setup as soon as a second sensor is connected.

From my experience as a software developer it looks from the outside a bit like a synchronization issue when two entities fighing for a ressource. Sad but true I have at the moment no time to have a look by myself.

(Just to point it out again: all the respect and thanks to the guys writing stuff for HA!)

issue-triage-workflows[bot] commented 5 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

hag2k commented 5 months ago

Hi, I am still facing the same issue and installed all recent Updates. BR

3xo commented 5 months ago

Also having the same issue after a fresh install of EDL21 with two Hichi IR readers connected directly to Raspberry Pi4 USB ports.

Logger: sml.asyncio Source: runner.py:188 First occurred: 21:06:20 (6 occurrences) Last logged: 21:10:40

Timeout while waiting for meter data. Please check reading device. Restarting edl21

Maxxxel commented 5 months ago

For 4 days i dont get any new data now....

3xo commented 5 months ago

Restarting HA should fix it. I am now using "vzlogger" as add-on to connect to the IR readers and then publish to mqtt. However the same disconnect issue is appearing at random after some time.

I also found this error message in the hosts log at the same time the readers disconnect:

kernel: cp210x ttyUSB: usb_serial_generic_read_bulk_callback - urb stopped: -32

It seems this is related to a kernel issue mentioned for example here: https://github.com/raspberrypi/linux/issues/2406 As a workaround i am now using an automation that checks if one of the sensors is not updating to trigger a add-on restart which reconnects the readers.

JulianPSLearner commented 2 months ago

Having the identical Problem. I have two Weidmann Sensors for measuring my electricity Meter. As soon as I plug in the second one, nothing works anymore. Any work around to fix it? I have the latest HA Core from today

Maxxxel commented 2 months ago

I just made my own python script to read the data and post it via mqtt.

idelsink commented 2 months ago

So not sure about everyone's setup but I had the same. I use rootless podman and have a USB device mounted in the container. For me it sometimes happend that after a reboot of the server the created container got started and then it would break. It is still unclear to me what exactly happened, but also inside the container it looked almost like the data that came in was delayed. I got chunks of bytes really slowly.

The "fix" for me is to instead of start and stop a created container is to always recreate the container when it starts. I'm (still for now) using systemd-generate to get the systemd unit files and I use the --new flag to create a service that creates a new container every time. My setup has been running stable since for a long time now (few weeks)

Perhaps when this issue occurs with container deployments it might have something to do with left-over resources from the mounted hardware?