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

Getting error of 'Adapter disconnected, stopping' every two hours. #20148

Open
MostHated opened this issue Dec 11, 2023 · 26 comments
Open

Getting error of 'Adapter disconnected, stopping' every two hours. #20148

MostHated opened this issue Dec 11, 2023 · 26 comments
Labels
problem Something isn't working

Comments

@MostHated
Copy link

MostHated commented Dec 11, 2023

What happened?

I am using a UZG-01 device via PoE. Tthe Z2M docker gives the following error after 1h 59m 55s and does this repeatedly after that amount of time over and over:

I did a continuous port check every 500ms to the UZG-01 on the port Z2M is connecting to, as well as the web interface, my home assistant box, etc, and didn't see the UZG-01's zigbee port go down, nor any of the others I was checking. While the connections were still reporting as up, the following error still occurred and when this happens, often a handful of devices will fall offline.

error 2023-12-05 15:16:52: Adapter disconnected, stopping
info  2023-12-05 15:16:52: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'offline'
info  2023-12-05 15:16:52: Disconnecting from MQTT server
info  2023-12-05 15:16:52: Stopping zigbee-herdsman...
error 2023-12-05 15:16:52: Failed to stop Zigbee2MQTT

Zigbee2MQTT version

1.34.0-1

Adapter firmware version

20230507

Adapter

ZigStar UZG-01 PoE (https://uzg.zig-star.com/product/)

Debug log

No response

@docstalek
Copy link

I have the same issue. Z2M running on an Alpine container on Proxmox. I have also tried running on an Ubuntu container and as Home Assistant Add-on. All show the same pattern, disconnect after 2 hours.

I have tried both with LAN and Wifi, with same result.

As a part of my debugging process, I tried to open a TCP connection towards the UZG-01 using telnet. After 2 hours, the connection is dropped by the UZG-01 with message "Connection closed by foreign host.".

For me the the problem seems to be on the UZG-01 side, with either the ESP32 firmware or the Z-Stack firmware.

@sadabla
Copy link

sadabla commented Dec 14, 2023

I have the same issue. Z2M and Mosquito running on Home Assistant using the SLZB-06 via ethernet.
This is a new setup and the issue is there since the beginning.

My logfile:
Zigbee2MQTT:error 2023-12-14 11:13:24: Adapter disconnected, stopping
Zigbee2MQTT:info 2023-12-14 11:13:24: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
Zigbee2MQTT:info 2023-12-14 11:13:24: Disconnecting from MQTT server
Zigbee2MQTT:info 2023-12-14 11:13:24: Stopping zigbee-herdsman...
Zigbee2MQTT:error 2023-12-14 11:13:24: Failed to stop Zigbee2MQTT

@comazone
Copy link

comazone commented Dec 18, 2023

I have the same problem. ZigStar lan every 2 hours disconnected. Z2M Current version: 1.34.0-1, ESP 0.6.10, Zigbee
20220218. This is my second zigbee net. First net on USB Zigbee on RFStar CC2562P work normally. I think this problem appeared after the latest z2m update

@dellorianes
Copy link

Same here with a tube-zb-gw-cc2652p2-v2 over ethernet.

@comazone
Copy link

comazone commented Dec 19, 2023

I changing DHCP lease time for IP adresses on my PfSense router, it was 7200 sec, and problem is gone. But i dont know why DHCP lease time influences on static IP adress my LAN ZigStar. 4 hours ZigStar not disconnect

@comazone
Copy link

Make sure DHCP is disabled in coordinator setup

image

@MostHated
Copy link
Author

Oh, really? Interesting. I use PFSense as well (though, that part is probably unrelated). Let me give that a try.

@comazone
Copy link

Try this method. May be it work for you too

@MostHated
Copy link
Author

Yeah, I was just setting a static dhcp mapping in pfsense, as I do for most everything. I set dhcp off on the device now, and put the address in and it is restarting now. I will keep an eye on it the next 2 hours and see how it goes. 👍

@docstalek
Copy link

I have also changed to static IP now. Let's see if that changes anything 🤞

@comazone
Copy link

On my clock 23:55, last disconnest was 14:46. Problem is gone

@MostHated
Copy link
Author

Yeah, so far I am at nearly 3 hours now, and I don't think it once ever made it past 1:59:00 before. On my end, all I did was change from DHCP to static on the coordinator. I didn't adjust anything on the firewall side. That is quite curious that having DHCP set on the device would cause the container to restart, but I guess it is what it is, lol. Maybe a container restart is automatic if the connection to the adapter is lost?

@docstalek
Copy link

Indeed, it worked! Finally a stable solution! 🥳
Excellent find, @comazone! Greatly appreciated! ❤️

So it seems that the ESP32 part has a poorly implemented DHCP client or something and drops all connections when it's renewing the IP lease.

@MostHated
Copy link
Author

I am a few moments shy of the 24 hour mark and things have been just fine now. 👍 Indeed, thanks @comazone

@sadabla
Copy link

sadabla commented Dec 22, 2023

I also use pfsense and static mapping in DHCP for the SLZB-06. Setting a static IP address solved the issue. Thanks a lot @comazone!

@udivankin
Copy link

As for me with Hamgeek LAN coordinator built with RF-BM-2652P2 and MJ-Ethernet01 from ColtSmart, setting static IP didn't help.

@mercenaruss
Copy link

Guys please open a issue here: https://github.com/mercenaruss/uzg-firmware
We will try to solve the issue.

@ashishpandey
Copy link

While static IP works around this issue, should zigbee2mqtt be resiliant to disconnects, specially when an immediate reconnection within a small window of time works? That should help a lot with stability. Sockets drop, this should not be a fatal error

@fliespl
Copy link

fliespl commented Mar 29, 2024

Anyone else is having this problem even with static ip set? I have had a run of 1 month without issues but then I ve had like 3 disconnections over a week where only device restart helped (uzg-01 with p7 chip).

@MostHated
Copy link
Author

MostHated commented Mar 29, 2024

Yeah, I thought I was losing my bananas. Ever since I made my last post, things have been working great up to this last month.
It has been quite frustrating. Multiple devices dropping off-line every few days. I feel that it has been better than it was before setting static IP, but during the time it was good, it was great, not a single drop off or anything from Dec 19th until around the start of March or somewhere there abouts.

I am not sure if you are using HomeAssistant, and this could be purely coincidental, but it feels this started when/soon after I installed 2024.3.x.

@mercenaruss
Copy link

this is related to p7 chip firmware.

@fliespl
Copy link

fliespl commented Mar 29, 2024

@marcusaram can you explain a little bit more? Is this something that might be fixed in the future? If so where - z2m or uzg firmware?

@MostHated
Copy link
Author

I, too, am very much interested in any additional details about that, it was a rather vague statement. Is there something we can do on our end to help with this? Ex: a firmware update or something?

@marcusaram
Copy link
Contributor

@marcusaram can you explain a little bit more? Is this something that might be fixed in the future? If so where - z2m or uzg firmware?

Hi, you should probably mention someone else. I did long time ago some small contributions to this project but actually not using zigbee2mqtt anymore. Besides that I've really no idea what is causing this issue 😅

@MostHated
Copy link
Author

I am sure he didn't notice and thought he mentioned the name above his. I didn't realize it was wrong either until just now, lol.

@fliespl
Copy link

fliespl commented Apr 2, 2024

@MostHated @marcusaram Of course I did mean @mercenaruss... Sorry about confusion, very close nicknames :) 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants