-
Notifications
You must be signed in to change notification settings - Fork 18
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
Zigpy Zigate Wifi - Close connection to ZHA #89
Comments
Hi, your bug seems to be similar to issue #55 |
Do you know how I could watch my firmware version of zigate ? |
you should be able to see it in the visualization tab in ZHA configuation |
3.1d for me, new question ... where is the last firmware ... |
Merci beaucoup ! Je vais essayer voir si ça corrige. |
another bug :
Always same deconnection ...
There is a really big problem, I can't identify what happend. I can do every debug you want, to try to solve this issue ! Could you please take this problem in consideration ? |
Same here, I can also help with debug if you need information |
I use firmware 3.1e |
Hi, |
And after nothing |
I just performed a test against the code in the dev branch which is supposed to implement the reconnect feature.
but no reconnection attempt was made by the lib. I had to force integration reload to have the connection back:
|
I added some debug code into the lib, just to be sure.
The "connection lost" messages I added are never called when we hit a disconnect. We might need to examine zigpy implementation in details to understand if this code (which is common to xbee, combee...) do work with other devices or if there is just a duplicated bug. Connection lost with USB devices is probably a rare issue |
Like it seems to come after 'No response to command 0x0530', that is to say, a 'hardware' crash, this is probably common to xbee, combee and other but they don't crash so we don't see the same trouble. I think we are dealing with 2 bugs. To check. |
For me it's a global connection problem. After a delay, connection crash and we have lot of errors. Depending on the command that we send we have a different return. But the basic problem is the connection |
My 2 cents, don't know if this is related, but in Wifi, the plugin needs to maintain the IP connection, otherwise after a Timeout ( 4 or 5 minutes) the line is droped |
is it possible to add simply a "ping" or other every 30s to maintain the connection ? |
Do other Zigbee radio modules have the same troubles ? |
that a very good question, with the title of this issue I don't know if other product owner read this thread |
Most other zigbee radio modules are USB modules |
I can confirm I'm affected with zigate on usb. For now I have rollback to HASS version 2021.3.0 (docker install) |
deCONZ radios have much problems with USB disconnections and comports is not mapped OK in docker (in native deCONZ and ZHA). Tasmota, and ESPHome that using ESP chips looks working OK with EFR32 and TI chips also tuya ZBGW is working OK with EFR32 radios over Ethernet. EFR32 / bellows is going in fault state if the counter is going of sync then loosing packages in the WiFi / Eth network but is nicely logged in the error log. |
Interesting, can you confirm that you don't use any wifi between zigate/usb and your home assistant ? |
I confirm. I'm using Hass with docker on a NUC running archlinux. I don't know if it can influence but my USB Zigate is on a USB hub. I can try without tonight if you want? |
Thank you, I don't think that it's necessary. The main point is that wifi seem not be the cause. As far as I'm remember when I put my PiZigate directly on my raspberry pi3, I already have 'Devices Offline' disconnects on my zigbee2mqtt, so this seems to exonerate wifi |
I need to check logs, but I think that plugin already ask periodically for state of sensors... |
To my mind, after Retry command, if module don't answer again then we should initialize connection like we do on start. What do you think about? |
This seems a good process. |
so I do that simply ...
I have no more error ... : logs
Entyre file :
|
Why are you not submitting a PR ? so your patch would be merge into the code |
Because I've tested, and I have an other error I need to solve that before the PR. After 24 h of usage I have this : the thread goes into an error, and I don't know why :(
|
You don't need to use threads when working with asyncio, you can use tasks: async def connect(self):
...
self._watchdog_task = asyncio.create_task(self.watchdog_loop())
def close(self):
...
self._watchdog_task.cancel()
async def watchdog_loop(self):
while True:
await asyncio.sleep(30)
LOGGER.warning("Check ---")
try:
await self.get_network_state()
except Exception as exc:
LOGGER.warning("Failed to get network state, treating as disconnect", exc_info=exc)
self.connection_lost(exc) # Treat this as a disconnect
break I don't have a ZiGate to test but this is roughly what other radio libraries do. |
I don't know why I can't deal with asyncio, but I'm gone try again with your sample code. Thank you. |
I tried updating to 0.8.0, it just doesn't work, my solution still works with the 0.7.3 package. I downgrade everything to HASS... Very sad situation! |
@baimard What does the debug log show with 0.8.0? https://www.home-assistant.io/integrations/zha/#debug-logging |
you need more ? |
The whole debug log, not just the warnings. The two status codes are:
|
ok I will show you tomorow. |
Sorry for delay, I have new born at home :)
|
After a while (look last log line)
|
Same issue. |
any news ? |
I have the same issue. I don't even have that many devices, maybe 14. NoFreeAPSAckHandles is the most common error I get. None of my automation sees anything at this time. Sensors go dead as well. I'm on the latest ZiGate firmware too. It was working fine until I added six new devices today. What gives? |
What version of Home Assistant are you running? Can post post debug logs? |
Absolutely, what logs do you want? I'm on the latest version of HA on top of Fedora 36 ARM64. I'm using the serial UART ZiGate, not the Wi-Fi one. |
Some warning logs:
|
To me it looks like there is a resource leak somewhere, and the HA system runs out of "APSAckHandles" (whatever those are) shortly after startup. I'm going to try and reload the integration and see if that makes a difference. |
2022.7.3? The ZHA debug logs: https://www.home-assistant.io/integrations/zha/#debug-logging |
Yes that version. Restarting HA now. |
Coming online again... please wait a few minutes. Thank you for your prompt response! |
Hot damn, restarted Home Assistant and nothing is wrong now. WTF. Hang on, I may have spoken too soon tho. |
Yeah spoke too soon. I'm not seeing any errors in the logs right now, but my sensors definitely aren't updating. |
I pushed the presence buttons on my sensors and that caused some of them to update, but not all. Will attach the log right now. |
Yeah, unless I push the button on a sensor, the sensor will not update its values in HASS. There can be many minutes, or many hours, before an update comes in. I must be doing something wrong in my configuration? |
@puddly as reported earlier, a command cannot be send until the previous one is completed received by the targeted device 0x8011 message ( with address mode 0x02) if using address mode 0x07 then you need to wait for the message handled by the new hop ( 0x8012 message)
This is the main change that we have done on our fork
Envoyé de mon iPhone
… Le 12 juil. 2022 à 20:15, Rudd-O ***@***.***> a écrit :
Yeah, unless I push the button on a sensor, the sensor will not update its values in HASS. There can be many minutes, or many hours, before an update comes in. I must be doing something wrong in my configuration?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Finally got the errors again:
|
Dear,
Home Assistant : 2021.5.4
ZHA : Last version in HASS
ZiGate-WiFi v2.00 with esp-link v3.2.50-gfe4f565-dirty
I use Zigate wifi with ZHA in Home Assistant, after random time (30 min to 4hours), Home Assistant show that :
After this message, all my sensor light etc. not work with the device.
Home assistant don't send any request to my zigate wifi.
Tcpdump :
192.168.4.252 si my HASS
192.168.4.227 Zigate Wifi
So two questions :
Thank you
The text was updated successfully, but these errors were encountered: