-
Notifications
You must be signed in to change notification settings - Fork 28
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
Keeping connection open freezes KLF #30
Comments
Hmm, i did not experience this. What firmware version do you have? I guess there is not so much we can do here. Looks like a problem only velux can fix. |
Werner, I had the same symptoms. These two fixes have solved the root causes for me: @Julius2342 would you be so kind to release a new version of pyvlx including these fixes? |
I think we can close this issue. Please reopen if problem still exists. |
@Julius2342 Unfortunately I still see this issue on 0.2.12. |
do you see anything in the logs? |
Nothing but this stacktrace. The connection seems to survive a few restarts of Home Assistant, but at some point I get the following stacktrace and the only way to recover is power cycling the KLF and restarting Home Assistant.
|
Hmm ... no idea how to add a timeout to creating a connection ... |
My velux connection also fails after every few reboots of Home Assistant |
I had a deeper look inside the issue, the problem is that disconnecting the SSL-Connecton is not async: https://github.com/Julius2342/pyvlx/blob/master/pyvlx/connection.py#L76 It looks like the shutdown of Hass became quicker recently, so the shutting down of the SSL connections is not awaited (not in the await meaning). Therefore the connections on the KLF200 side are not closed down correctly and after several reconnects the KLF200 refused to take new connections. |
Any news on this issue? Still seeing this behaviour on home assistant 0.110.1. |
Also having this issue pretty consistently and can do the same ^ |
I also can confirm that KLF freezes. Actually after each HA reboot I have to restart the KLF. |
As said, i have no idea how to mitigate this and i need help:
The only suspicion i have is that the SSL connection is not disconnected properly, bc the process ends before everythng is cleared up correctly. But this is just a suspicion. I have no idea what was changed within HASS and what could cause this problem. |
I read in a FHEM forum that they automatically reboot the KLF via API if they recognized any connection problems (I don't know how, maybe they count them somehow) to avoid a manual reboot. This would support your suspicion. I'm not familiar with all this IP sockets and event loops, but when I tried today to build up several new connections without closing them properly I could not identify any connection problems. I used the demo files from https://www.velux.com/klf200 to perform some tests. Also I tried reproduce the "SSL handshake takes too long" issue by restarting HA several times but I could not identify any connection problems. However always if I update my HA, I have to reboot the KLF. Not sure what exactly is causing this issue. |
@pawlizio : How can you reboot via API if you cant connect? 🤔 |
Of course you have to reboot in advance, not if you don't have any possibility to connect. What I understand is that 2 sockets can be established at maximum with the KLF and that KLF does not close them properly after 15 minutes without communication, as written in their API description. So your suspicion is that KLF freezes or becomes irresponsive if you use both sockets without closing them properly, Now a possible solution is that if pyvlx establishes a connection for the first time an automatic reboot of the KLF could be initiated. In this way you ensure that you always have the 2nd socket if you loose your connection. Just count the reconnects within pyvlx and on each 2nd connection force a reboot (after 1st connection, after 3rd connection and so on). |
I am still experiencing this issue too. (My current plan is to put a WeMo on the Velux power supply so I can restart it each night!)
Incidentally my Velux has two clients - HomeAssistant and a Savant host - so that might explain why I’m hitting any connection limit so quickly and often.
… On 25 Jun 2020, at 5:55 pm, Paul Daumlechner ***@***.***> wrote:
Of course you have to reboot in advance, not if you don't have any possibility to connect.
What I understand is that 2 sockets can be established at maximum with the KLF and that KLF does not close them properly after 15 minutes without communication, as written in their API description. So your suspicion is that KLF freezes or becomes irresponsive if you use both sockets without closing them properly,
Now a possible solution is that if pyvlx establishes a connection for the first time an automatic reboot of the KLF could be initiated. In this way you ensure that you always have the 2nd socket if you loose your connection. Just count the reconnects within pyvlx and on each 2nd connection force a reboot (after 1st connection, after 3rd connection and so on).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm experiencing this issue, mainly when I updated HA. I'm powering the KLF via one of the Raspberry Pi USB port, so in theory I could power the USB off to force a reboot but it's probably complicated to do with HassOS (plus I have other devices on the other USB ports). |
I created a pull request #43 for testing purpose. I implemented the same in my custom component today. |
@Julius2342: A few days ago I saw this velux API implementation and just now had an idea. There is an explanation under which condition the TLS does not work: As a consequent in order to avoid unresponsive communication, we should try to deactivate house status monitor before closing any connection. May this could solve most of the problems during HA restarts. |
Hello! I've got similar issue: home-assistant/core#48182 Enrico |
Hello,
I have my connection with KLF 200 open for an infinite time (it should react any time I issue a command). However, within usually 24 hours I lose the ability to talk to KLF (no reaction) and when trying to establish a connection I receive:
The only thing that helps is to unplug the KLF200 from the power source and replug it and have it fresh started. Any idea what the reason for this could be / any way to work around this?
The text was updated successfully, but these errors were encountered: