zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Zigbee2MQTT stops intermittently

Open desvalets opened this issue 6 months ago • 6 comments

What happened?

Z2m just stops intermittently, no error messages showing in log.

What did you expect to happen?

Z2M should run without intermittent stops

How to reproduce it (minimal and precise)

Not able to reliably reproduce as error occurs randomly. However, one hints : this patterns has occured following OS upgrades previously

Zigbee2MQTT version

1.40.2 commit: e06848d

Adapter firmware version

20210708

Adapter

SONOFF ZigBee 3.0 USB Dongle Plus, TI CC2652P Coordinator

Setup

Z2M is installed plain on UBUNTU 24.04 (intel HP elite desk ) not using docker container.
Home assistant installed in docker container on same device. HA MQTT integration used.
Z2M running in a background terminal task using nohup (i.e not using a service) . MQTT broker is on a different IP address on same internal network on a raspberry pi 4 - running 24/7.

In 2 recent incidents HA shows zigbee devices becoming unavailable at 23:06/sept 30 and 00:29/ oct 2 . I provide 2 log extracts for the 2 incidents.

Possible issues ? :

  1. the Z2m device is connected via wired ethernet port but the MQTT broker platform is connected via Wifi - could this be a problem with flaky wifi ? 2) Z2M runs in a background terminal as I had difficulty setting up the Z2M service. Issue ?

uname : Linux ziggy-elitedesk 6.14.0-33-generic #33~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 19 17:02:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux /etc/issue.net : Ubuntu 24.04.3 LTS

Device database.db entry

No response

Debug log

2025-09-30 23-06-z2m-debug-log.txt 2025-10-02 00-29-z2m-debug-log.txt

desvalets avatar Oct 02 '25 15:10 desvalets

1.40.2 is a very old version, try updating to a more recent one.

Koenkk avatar Oct 02 '25 18:10 Koenkk

OK Will update and report back

desvalets avatar Oct 02 '25 19:10 desvalets

I updated Z2M to version 2.6.2. And I think I found the reason for the intermittent stops experienced. It looks like it has nothing to do with Z2M but is a fault due to use of SSH and NOHUP. To recap : To start Z2M : from a remote machine I open an ssh session to the Z2M platform. In the SSH session I run nohup sudo npm start & (this was on Z2M 1.4) . I then leave the remote machine without cleanly exiting the SSH session. Z2M starts and runs without issue. At some point later, the remote machine goes into standby thereby terminating the SSH session. Immediately, or up to a couple hours later, Z2M just stops. Data from journalctl -b -e shows that the terminal session owning the nohup job has terminated. Obviously Z2M stops. According to what I can read about NOHUP, this is not the expected behaviour. Alternatively logging directly into the Z2M platform, I start Z2M in a terminal, leave it running and there is no further issue with intermittent stops.

desvalets avatar Oct 05 '25 12:10 desvalets

For some time now, I've also noticed that ZigBee2MQTT has stopped working. Rebooting HomeAssistant doesn't help, but if HomeAssistant is running normally and I restart the ZigBe2MQTT add-on, everything works again. I can't find anything in the logs, and the processor and memory also seem to be sufficient.

I'd like some tips on what could be causing this problem.

I suspect the dongle as I have a Sonoff ZigBee 3.0 USB dongle and ZigBee2MQTT version 2.6.2-1. Because it's been working very stable for about seven, eight years, I suspect the dongle and bought a new one to have a backup. Now I'm running into the problem that I need to flash the new one with the contents of the old one to take over the network, but because the current dongle has been running for so long, I imagine there's a firmware update available that might solve the problem. I'd like to hear the best way to approach this. Flash the new one with the current configuration and then update the currently working firmware to a new one, and then update the new one to a new firmware as well?

I'd love to hear from you.

Thanks in advance. Wilfried

wilfriedbaars avatar Oct 07 '25 11:10 wilfriedbaars

For a few weeks I have massive problems with this addon. Randomly all of my devices are getting unavailable at the same time. The logs are showing nothing (no errors, no warnings), except in the mqtt broker it shows that z2m loses connection (time out) and then reconnects. So it seems like the whole z2m addon just freezes.

I have multiple zigbee bridge; which I all tried (currently I have the Sonoff ZB-Dongle E with the latest firmware and using ember).

delobre01 avatar Nov 11 '25 23:11 delobre01

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jan 11 '26 00:01 github-actions[bot]