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

Rflink TCP mode does not reconnect after successful connection #23577

Closed
adrianmihalko opened this issue Apr 30, 2019 · 3 comments
Closed

Rflink TCP mode does not reconnect after successful connection #23577

adrianmihalko opened this issue Apr 30, 2019 · 3 comments

Comments

@adrianmihalko
Copy link

Home Assistant release with the issue:

0.92.0

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io/Linux

Component/platform:

https://www.home-assistant.io/components/rflink/

Description of problem:

HA does not reconnect in TCP mode, after successfull connection was made. It should periodically check connection, to check if remote side is available.

My setup:

Rflink on Arduino connected to ESP8266 running Esp-Link (for TCP mode as in the component description).

  1. I start with Rflink device OFF:
2019-04-30 23:14:37 INFO (MainThread) [homeassistant.components.rflink] Initiating Rflink connection
2019-04-30 23:14:40 ERROR (MainThread) [homeassistant.components.rflink] Error connecting to Rflink, reconnecting in 10
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/rflink/__init__.py", line 221, in connect
    transport, protocol = await connection
  File "uvloop/loop.pyx", line 1904, in create_connection
  File "uvloop/loop.pyx", line 1883, in uvloop.loop.Loop.create_connection
OSError: [Errno 113] Host is unreachable
2019-04-30 23:14:50 WARNING (MainThread) [homeassistant.components.rflink] disconnected from Rflink, reconnecting
2019-04-30 23:14:50 INFO (MainThread) [homeassistant.components.rflink] Initiating Rflink connection
2019-04-30 23:14:53 ERROR (MainThread) [homeassistant.components.rflink] Error connecting to Rflink, reconnecting in 10
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/rflink/__init__.py", line 221, in connect
    transport, protocol = await connection
  File "uvloop/loop.pyx", line 1904, in create_connection
  File "uvloop/loop.pyx", line 1883, in uvloop.loop.Loop.create_connection
OSError: [Errno 113] Host is unreachable

Correct, until it is not available it tries to connect every 10 sec.

  1. I plug in Rflink device:
2019-04-30 23:15:29 INFO (MainThread) [homeassistant.components.rflink] Initiating Rflink connection
2019-04-30 23:15:29 DEBUG (MainThread) [rflink.protocol] connected
2019-04-30 23:15:29 INFO (MainThread) [homeassistant.components.rflink] Connected to Rflink
2019-04-30 23:15:46 DEBUG (MainThread) [rflink.protocol] received data: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;

It is connected and received data.

Now, when for some reason connection is broken, or If I turn off Rflink device, HA does not check connection and never tries to reconnect, which means I must restart HA to restart connection to Rflink device.

Expected behavior:

After connection is broken, HA should check for connection based on interval reconnect_interval, if it is broken, try to reconnect.

Maybe reconnect_interval is only valid for local connections /dev/usb?

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):


Additional information:

@adrianmihalko adrianmihalko changed the title Rflink TCP mode does not reconnect after successfull connection Rflink TCP mode does not reconnect after successful connection Apr 30, 2019
@KennieNL
Copy link

KennieNL commented May 7, 2019

I think I've used to have this issue, but I use the following socat now which makes it reconnect when the connection is down:
socat pty,link=/config/serialport-rflink,echo=0 tcp:x.x.x.x:xxxx,forever,reuseaddr,keepalive,keepidle=10,keepintvl=10,keepcnt=2

@genestealer
Copy link

I found that the reconnect interval works fine for my identical set up. I appreciate this doesn't really help your situation but I thought it would be useful to know. ESP-Link to Arduino.

@stale
Copy link

stale bot commented Aug 8, 2019

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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants