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

TODO : Auto reconnect #70

Open
doudz opened this issue Nov 21, 2020 · 10 comments
Open

TODO : Auto reconnect #70

doudz opened this issue Nov 21, 2020 · 10 comments

Comments

@doudz
Copy link
Collaborator

doudz commented Nov 21, 2020

No description provided.

@ZeGuigui
Copy link

How complicated is this to add auto reconnect? Just switched to zha and I have a wifi zigate. I had not seen the issue before upgrading :(

@doudz
Copy link
Collaborator Author

doudz commented Dec 15, 2020

It shouldn't be hard since this feature already exists for other zigpy radio
Just need a bit of time to add this

@ZeGuigui
Copy link

I started looking on my own. If what I understand is right (but my Python skills are not very developped) I might propose a pull request. I have to dig a little bit more and find a way to test my code on my HA instance (with some debug to check if reconnect do work)

@doudz
Copy link
Collaborator Author

doudz commented Dec 15, 2020

it should be ok in dev branch

@ZeGuigui
Copy link

Thanks. I was miles away from something that complete. I will give it a try tonight.

@ZeGuigui
Copy link

First tests with last commit not very conclusive.
Starting at 00:46:34 UTC I get some ZiGate doesn't answer to command error messages in my log files.
There is no trace of reconnect action (grep -i reconnect or grep -i lost return no line)

At 00:28:30 there is a log message Closed serial connection:

# cat home-assistant.log | grep zigate | grep -i connect
2020-12-15 20:46:30 DEBUG (MainThread) [zigpy_zigate.uart] Connection made
2020-12-16 00:28:30 DEBUG (MainThread) [zigpy_zigate.uart] Closed serial connection
2020-12-16 05:12:07 DEBUG (MainThread) [zigpy_zigate.uart] Connection made

The last connection made is from a manual reload integration in HA. I attached my zigate related logs if that can help.

@doudz
Copy link
Collaborator Author

doudz commented Dec 16, 2020

ok, thanks for feedback.
So the connection loss is not detected but we see "Closed serial connection" so there's something to check.
I have to test using a real ZiGate WiFi

Maybe after many NoResponseError we could assume the connection is lost

@ZeGuigui
Copy link

I traced back the error message to def connection_lost(self, exc) -> None: in uart.py so definitively the loss of the connection is registered. The real question is why is the reconnect not done? We might need to investigate zigpy code but as I mentionned above my python skills are rudimentary! I am more a Java or Perl afficionado.

@baimard
Copy link

baimard commented Jan 29, 2021

Dear team, any news for this issue ?

@tygerlord
Copy link

Dear team, any news for this issue ?

Seems not...

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

4 participants