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

Zigbee2MQTT stops with 'Adapter disconnected' error and does not restart #17809

Open
gribouk opened this issue May 27, 2023 · 40 comments
Open

Zigbee2MQTT stops with 'Adapter disconnected' error and does not restart #17809

gribouk opened this issue May 27, 2023 · 40 comments
Labels
problem Something isn't working stale Stale issues

Comments

@gribouk
Copy link

gribouk commented May 27, 2023

What happened?

Dear All,

I am running Zigbee2MQTT in a docker with Sonoff zStack3x0 Coordinator revision 20210708 radio.
Every now and then I discover Zigbee2MQTT exiting operation without restart with following error:

error 2023-05-27 10:59:52: Adapter disconnected, stopping
info  2023-05-27 10:59:52: MQTT publish: topic 'zigbee2mqtt_sonoff_p_coordinator/bridge/state', payload '{"state":"offline"}'
info  2023-05-27 10:59:52: Disconnecting from MQTT server
info  2023-05-27 10:59:52: Stopping zigbee-herdsman...
error 2023-05-27 10:59:52: Failed to stop Zigbee2MQTT

below is my docker starting command which instructs explicitely to restart the container:

:~# docker run -d --name zigbee2mqtt_3 --restart=unless-stopped --device=/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0ead2e5b5586ec11b18ee13719c2d21c-if00-port0:/dev/ttyUSB0 -p 8082:8082 -v /zigbee2mqtt/zigbee2mqtt-data-3:/app/data -v /run/udev:/run/udev:ro -e TZ=Europe/Kiev koenkk/zigbee2mqtt

Regards,

What did you expect to happen?

If an error aqures, the container restarts....

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.30.4 commit: b2dd21e

Adapter firmware version

20210708

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus-P

Debug log

error 2023-05-27 10:59:52: Adapter disconnected, stopping
info  2023-05-27 10:59:52: MQTT publish: topic 'zigbee2mqtt_sonoff_p_coordinator/bridge/state', payload '{"state":"offline"}'
info  2023-05-27 10:59:52: Disconnecting from MQTT server
info  2023-05-27 10:59:52: Stopping zigbee-herdsman...
error 2023-05-27 10:59:52: Failed to stop Zigbee2MQTT
@gribouk gribouk added the problem Something isn't working label May 27, 2023
@schumi2004
Copy link

schumi2004 commented May 31, 2023

I'm experiencing the same thing but not in a docker environment. (Running Home Assistant in Proxmox)
At random moments the adapter disconnects.

Adapter: SONOFF Zigbee 3.0 USB Dongle Plus-P
Adapter firmware: 20221226
Z2M version: 1.30.4

error 2023-05-31 11:48:26: Adapter disconnected, stopping
info 2023-05-31 11:48:26: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
info 2023-05-31 11:48:26: Disconnecting from MQTT server
info 2023-05-31 11:48:26: Stopping zigbee-herdsman...
error 2023-05-31 11:48:26: Failed to stop Zigbee2MQTT

@Iroamstaff
Copy link

If it can help you I had a similar problem as soon as I touched the adapter, my raspberry or my SSD the adapter disconnected. The problem came from the charger of my SSD which had an alternating current leak on the USB ground. To solve this problem I grounded

@EPicLURcher
Copy link

Is this similar to this bug: #17947

@gribouk
Copy link
Author

gribouk commented Jun 7, 2023

Is this similar to this bug: #17947

No, that one is of different origin - i do not have problems finding the radio, the problem is that z2m does not reboot properly on failure.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2023

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

@github-actions github-actions bot added the stale Stale issues label Jul 8, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2023
@MostHated
Copy link

I am having this issue once every two hours, nearly on the dot, but using a PoE adapter.

@ashishpandey
Copy link

I am also seeing this frequently. I have zigbee2mqtt running in docker, connected to zigstar UZG-01 over ethernet. The docker container dies frequently with below error

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

it would be preferable for zigbee2mqtt to be more resilient to connectivity errors

@MostHated
Copy link

I, too, am using a UZG-01 over ethernet. 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 zigbee port go down, nor any of the others I was checking, but the Z2M docker gave that same error after 1h 59m 55s and does this repeatedly once the connection time eaches that same point:

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

@ashishpandey
Copy link

Z2M docker gave that same error after 1h 59m 55s and does this repeatedly once the connection time eaches that same point

Good observation. I setup my docker with auto restart, and see the issue repeat every 2 hours. the adapter is up, but disconnects still happen at the 2 hour mark

I saw the issue you reported: #20148

@dellorianes
Copy link

I have the same problem.
I use HA as a virtual machine. My coordinator is a tube-zb-gw-cc2652p2-v2 working by IP with Zigbee2mqtt.
randomly, the zigbee2mqtt stop working with the error:
Zigbee2MQTT:error 2023-12-19 16:46:44: Adapter disconnected, stopping
Zigbee2MQTT:error 2023-12-19 16:46:44: Failed to stop Zigbee2MQTT

As soon as I realize the zigbee network ios down I check the coordinator, in its IP, and it looks like the coordinator is ok.

I have to re-start the addon in order to have it working again.

Do you solve it?

@MostHated
Copy link

A few of us who had a disconnected adapter, showing that uptime of the connection reset at the same time as the addon restarting were able to fix it (so far, it seems, at least) my setting static IP on the coordinator. Not sure if yours is the same, though.

#20148

@jdodgen
Copy link

jdodgen commented Jan 8, 2024

I'm experiencing a similar problem. Except it USB connected.
#20231

@elordude
Copy link

elordude commented Feb 8, 2024

Any resolution on this? my system was working without issues until few weeks ago - i've resorted to add a cron job to restart the Zigbee2MQTT docker every two hours.

0 */2 * * * /usr/bin/docker restart zigbee2mqtt >/dev/null 2>&1

Not the most elegant solution but it is working, I know that if the timing aligns with the reload my scripts will not trigger.

@tackin
Copy link

tackin commented Feb 9, 2024

I had the same issues today.
I have a Sonoff Dongle Plus E connected to a raspi1. And made a ser2net-connection to a zigbe2mqtt docker container running on a raspi4.
Worked at the beginning. I started ser2net manually on the pi1. Today I tried to replace the manual start with a service. After that zigbee2mqtt errored with "adapter disconnected ..." every minute.
I disabled the service again and startet ser2net manually again and every thing is fine with zigbee2mqtt.
My guess :
ser2net.service
... ExecStart=/usr/local/sbin/ser2net -c /etc/ser2net/ser2net.yaml
...
starts ser2net which first look into usr/local/etc/ser2net/sert2net.yaml than in the config-file mentioned in the ser2net.service:

ser2net -h tells me:
.....
-c - use a config file besides /usr/local/etc/ser2net/ser2net.yaml
....
Which will/may lead to a total broken running ser2net if both files exists and do configs for the dongle.

Or it is because of some bad systemd-woodoo for ser2net on an old raspi1.

@Kowi030
Copy link

Kowi030 commented Feb 10, 2024

Same problem here: Adapter disconnected, stopping

@jdodgen
Copy link

jdodgen commented Feb 10, 2024 via email

@Kowi030
Copy link

Kowi030 commented Feb 11, 2024

Can you post the code please?

@ThorstenDtk
Copy link

I have the same problem, I'm using a Sonoff Dongle Plus E. Z2M runs without any problems, but when I start more than one OTA the adapter disconnects after a few seconds. When I update a device one by one then sometimes it completes, but most of the time the error occurs and I have to stop z2m, edit state.json and start z2m because otherwise the update hangs and cannot be restarted.

@DarkosGahan
Copy link

I am having the same problem except for me it gets disconnected whenever I change a device parameter i.e: when I set calibration to 0 on a zigbee plug. I

Sonoff Dongle Plus E
zigbee: 1.35.3
FW: 6.10.3.0 build 297 ( tried with 7.1.3 ) same issue

I have read that the dongle E is experimental so I ordered a version P
let's see

@ThorstenDtk
Copy link

Does any of you know what 'adapter disconnected' means? I'm wondering if this is a problem with the hardware and if the adapter really isn't reachable. Or if this is an issue with Z2M. What would be the best way to figure out?

@DarkosGahan
Copy link

Does any of you know what 'adapter disconnected' means? I'm wondering if this is a problem with the hardware and if the adapter really isn't reachable. Or if this is an issue with Z2M. What would be the best way to figure out?

What I can tell is that it's a real disconnect. I am running Home Assistant with zigbee2mqtt as local addon and when I get the message I see the USB getting reset in que qemu logs.

@FixussuxiF
Copy link

Same here but dongle directly into the machine.
The first time it happened about one week ago.
While discovering new devices in z2m the "count down" stopped while interviewing it (so, it got the device in the list but not paired, z2m stopped in the menatime)
But just today it happened without me trying to pair new devices, (eventually z2m restarts and shades are going up and down, lights on and off..

is the situation worsening!?

here some data

Home assistant green
Zigbee2MQTT
1.35.3
EZSP v8
6.10.3.0 build 297
frontend 0.6.156
zigbee_herdsman_converters_version 18.28.3
zigbee_herdsman_version 0.33.8

not always the log.txt has the last things happening (while is stopping)

log.txt:

info 2024-02-17 14:58:48: Zigbee2MQTT started!
info 2024-02-17 14:58:48: MQTT publish: topic 'zigbee2mqtt/Hue Luz lavanderia', payload '{"brightness":254,"linkquality":192,"power_on_behavior":"off","state":"OFF","update":{"installed_version":16785162,"latest_version":16785162,"state":"idle"},"update_available":null}'
info 2024-02-17 14:58:48: MQTT publish: topic 'zigbee2mqtt/Pasillo Dimmer botton/type', payload '{"light":"led"}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":240,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":240,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":240,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":236,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":236,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":236,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":236,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Switch luz cocina gabinetes', payload '{"current":0,"energy":22.62,"linkquality":236,"power":0,"power_outage_memory":"restore","state":"OFF","switch_type":"toggle","voltage":241}'
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/Felice Baño Duscia RGB', payload '{"brightness":254,"color":{"h":248.08695652173915,"hue":248.08695652173915,"s":90.19607843137256,"saturation":90.19607843137256},"color_mode":"hs","color_temp":475,"do_not_disturb":null,"linkquality":184,"state":"OFF"}'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Switch luz cocina gabinetes' failed: 'Error: Command 0xa4c138eee1f5ef9e/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Luz Cama2 Ikea' failed: 'Error: Command 0xbc026efffef36a58/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Luz Cama1 ikea' failed: 'Error: Command 0x4c5bb3fffee181b1/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Armario Center Left' failed: 'Error: Command 0x30fb10fffe59894b/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Armario Right Right ' failed: 'Error: Command 0x287681fffe6ad1d0/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Armario Center Right ' failed: 'Error: Command 0x60b647fffe500225/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Felice Armario Left Left' failed: 'Error: Command 0x287681fffe5109d5/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Lámpara de tierra cuarto Felice ikea1' failed: 'Error: Command 0xb43522fffeb948e2/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Lámpara de tierra cuarto Felice ikea3' failed: 'Error: Command 0xb43522fffe836524/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'brightness' to 'Lámpara de tierra cuarto Felice ikea2' failed: 'Error: Command 0xb43522fffe6c361b/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Mesa Salon' failed: 'Error: Command 0xf082c0fffebf9cf9/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra' failed: 'Error: Command 0xf082c0fffebfe30f/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Camilo Armario R' failed: 'Error: Command 0xf082c0fffe25c2a6/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Camilo Armario L' failed: 'Error: Command 0x287681fffe8fd6ee/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Luz Sx Baňo Felice ' failed: 'Error: Command 0x7cb94c7830740000/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Luz Dx Baňo Felice' failed: 'Error: Command 0x7cb94c7825070000/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Center Left' failed: 'Error: Command 0x30fb10fffe59894b/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Right Right ' failed: 'Error: Command 0x287681fffe6ad1d0/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Center Right ' failed: 'Error: Command 0x60b647fffe500225/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Left Left' failed: 'Error: Command 0x287681fffe5109d5/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea1' failed: 'Error: Command 0xb43522fffeb948e2/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea3' failed: 'Error: Command 0xb43522fffe836524/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea2' failed: 'Error: Command 0xb43522fffe6c361b/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Luz Cama2 Ikea' failed: 'Error: Command 0xbc026efffef36a58/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Luz Cama1 ikea' failed: 'Error: Command 0x4c5bb3fffee181b1/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Center Left' failed: 'Error: Command 0x30fb10fffe59894b/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Right Right ' failed: 'Error: Command 0x287681fffe6ad1d0/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Center Right ' failed: 'Error: Command 0x60b647fffe500225/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Armario Left Left' failed: 'Error: Command 0x287681fffe5109d5/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea1' failed: 'Error: Command 0xb43522fffeb948e2/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea3' failed: 'Error: Command 0xb43522fffe836524/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Lámpara de tierra cuarto Felice ikea2' failed: 'Error: Command 0xb43522fffe6c361b/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Baño Cami especio D' failed: 'Error: Command 0xa4c138dc443ee6d1/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Baño Cami especio L' failed: 'Error: Command 0xa4c138378aaef294/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Luz sofa 24' failed: 'Error: Command 0x287681fffe151a4a/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Luz sofa pequeño' failed: 'Error: Command 0x287681fffe0869c7/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'state' to 'Felice Baño Duscia RGB' failed: 'Error: Command 0xa4c1389c16270e14/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Luz Cama2 Ikea' failed: 'Error: Command 0xbc026efffef36a58/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Luz Cama1 ikea' failed: 'Error: Command 0x4c5bb3fffee181b1/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Armario Center Left' failed: 'Error: Command 0x30fb10fffe59894b/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Armario Right Right ' failed: 'Error: Command 0x287681fffe6ad1d0/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Armario Center Right ' failed: 'Error: Command 0x60b647fffe500225/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Felice Armario Left Left' failed: 'Error: Command 0x287681fffe5109d5/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Lámpara de tierra cuarto Felice ikea1' failed: 'Error: Command 0xb43522fffeb948e2/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Lámpara de tierra cuarto Felice ikea3' failed: 'Error: Command 0xb43522fffe836524/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Publish 'set' 'color_temp' to 'Lámpara de tierra cuarto Felice ikea2' failed: 'Error: Command 0xb43522fffe6c361b/1 lightingColorCtrl.moveToColorTemp({"colortemp":250,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 14:58:49: Adapter disconnected, stopping
info 2024-02-17 14:58:49: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
info 2024-02-17 14:58:49: Disconnecting from MQTT server
info 2024-02-17 14:58:49: Stopping zigbee-herdsman...
error 2024-02-17 14:58:49: Failed to stop Zigbee2MQTT

info 2024-02-17 20:09:40: MQTT publish: topic 'zigbee2mqtt/Felice Armario Center Left', payload '{"brightness":254,"color_mode":"color_temp","color_options":null,"color_temp":357,"linkquality":144,"power_on_behavior":null,"state":"ON","update":{"installed_version":50331664,"latest_version":50331664,"state":"idle"},"update_available":null}'
info 2024-02-17 20:09:40: MQTT publish: topic 'zigbee2mqtt/Felice Armario Right Right ', payload '{"brightness":254,"color_mode":"color_temp","color_options":null,"color_temp":357,"linkquality":148,"power_on_behavior":null,"state":"ON","update":{"installed_version":50331664,"latest_version":50331664,"state":"idle"},"update_available":null}'
info 2024-02-17 20:09:40: MQTT publish: topic 'zigbee2mqtt/Felice Armario Center Right ', payload '{"brightness":254,"color_mode":"color_temp","color_options":null,"color_temp":357,"linkquality":180,"power_on_behavior":null,"state":"ON","update":{"installed_version":50331664,"latest_version":50331664,"state":"idle"},"update_available":null}'
error 2024-02-17 20:09:44: Publish 'set' 'brightness' to 'Felice Armario Left Left' failed: 'Error: Command 0x287681fffe5109d5/1 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (sendZclFrameToEndpointInternal error)'
error 2024-02-17 20:09:45: Adapter disconnected, stopping
info 2024-02-17 20:09:45: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
info 2024-02-17 20:09:45: Disconnecting from MQTT server
info 2024-02-17 20:09:45: Stopping zigbee-herdsman...
error 2024-02-17 20:09:45: Failed to stop Zigbee2MQTT

@EPicLURcher
Copy link

are you using the serial port as per the instruction in the add on install guide: port: /dev/ttyUSB0

I was having this issue last year, and changed to the full path, and this fixed my issue. My config looks like

port: >-
/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0

@DarkosGahan
Copy link

DarkosGahan commented Feb 17, 2024

are you using the serial port as per the instruction in the add on install guide: port: /dev/ttyUSB0

I was having this issue last year, and changed to the full path, and this fixed my issue. My config looks like

port: >- /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0

In my case, yes I was using the full path. meanwhile I read that the sonoff dongle-E was experimental and somehow buggy. I ordered a dongle-P, started from scratch. Since then everything is running fine again.

moreover, I was having issues with OTA where updates were running for days without finishing. and indeed adding new devices was a no-go Z2M restarting in the middle of the interview.

since the dongle-P FW updates run fine.

BTW not sure if DEVs are reading this thread but I am also on a HA forum where ppl seem to suffer the same kind of issues with conbee's.

@ThorstenDtk
Copy link

In my case, yes I was using the full path. meanwhile I read that the sonoff dongle-E was experimental and somehow buggy. I ordered a dongle-P, started from scratch. Since then everything is running fine again.

I just finished the migration of ~100 devices from DeConz, I'm not keen on re-pairing all of them again. In my case OTA updates are the only cause of these errors. Updates of non-battery devices sometimes works, sometimes it doesn't. But after editing state.json the updates resume and finally complete. I can live with that. But the tradfri switches take a long time to update (4-10 hours), and for those the update always starts from scratch.

@elordude
Copy link

elordude commented Feb 17, 2024

I'm not using full path but i'm using specific dev link /dev/ttyZIGB defined using usb-serail.rules it worked flawless for many months without issue, and it recently started having problems. My ZigBee adapter a nortek gocontrol husbzb-1 - I have OpenHab running natively and Home Assistant/ZigBee2MQTT running as docker containers. Everytime there is a disconnect I do not see any usb errors on the host logs - even with the two hours Z2M docker container restart I still have few disconnects, I disable the OTA Automatic check to see if it helps. I wonder if this is a docker bug and not an Z2M issue.

`lrwxrwxrwx 1 root root 7 Feb 13 11:28 /dev/ttyCADDX -> ttyUSB2
lrwxrwxrwx 1 root root 7 Feb 13 11:28 /dev/ttyINSTEON -> ttyUSB0
lrwxrwxrwx 1 root root 7 Feb 16 05:04 /dev/ttyZIGB -> ttyUSB3
lrwxrwxrwx 1 root root 7 Feb 16 05:04 /dev/ttyZWAVE -> ttyUSB1

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FT9JX8IX", SYMLINK+="ttyCADDX"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8a2a", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="ttyZWAVE"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8a2a", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="ttyZIGB"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A906XNGT", SYMLINK+="ttyINSTEON"

Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Zigbee2MQTT:error 2024-02-13 16:00:12: Adapter disconnected, stopping
Zigbee2MQTT:error 2024-02-13 16:00:13: Failed to stop Zigbee2MQTT
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Zigbee2MQTT:error 2024-02-14 14:00:12: Adapter disconnected, stopping
Zigbee2MQTT:error 2024-02-14 14:00:12: Failed to stop Zigbee2MQTT
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Zigbee2MQTT:error 2024-02-14 18:00:12: Adapter disconnected, stopping
Zigbee2MQTT:error 2024-02-14 18:00:12: Failed to stop Zigbee2MQTT
Using '/app/data' as data directory
Zigbee2MQTT:error 2024-02-14 18:00:23: Adapter disconnected, stopping
Zigbee2MQTT:error 2024-02-14 18:00:23: Failed to stop Zigbee2MQTT
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Zigbee2MQTT:error 2024-02-16 05:04:54: Adapter disconnected, stopping
Zigbee2MQTT:error 2024-02-16 05:04:54: Failed to stop Zigbee2MQTT
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory
Using '/app/data' as data directory

`

@MFornander
Copy link

Same problem here. Docker setup and using a SLZB-06 over Ethernet PoE, not USB. Z2M quits with "adapter disconnected" and doesn't restart.

@Kowi030
Copy link

Kowi030 commented Mar 4, 2024

For me the solution was to swap my Raspberry 3 for an Intel Nuc. With the new system everything is running smoothly again.

@fumantsu
Copy link

I don't want to disappoint all you guys but you are commenting to a closed issue. Nobody will pay attention.

@tackin
Copy link

tackin commented Mar 14, 2024

I don't want to disappoint all you guys but you are commenting to a closed issue. Nobody will pay attention.

.... except those with the same problem guided to this issue by a google-search. Just reading the postes helped me solving it. Thanks to everybody commenting on even closed issues. ;-)

@fumantsu
Copy link

fumantsu commented Mar 14, 2024 via email

@webbertakken
Copy link

Started seeing this behaviour after adding 2 additional devices. Has been running great for months before that.

Perhaps it errors out after a certain threshold?

@stefan-schweiger
Copy link

@Koenkk can we get this issue reopend as it seems to still affect many people?

@DennisDeKoster
Copy link

@Koenkk can we get this issue reopend as it seems to still affect many people?

Yes please, I'm having the same issue since a while. Been running before without issues. Maybe something critical changed with updates over time?

@stefan-schweiger
Copy link

stefan-schweiger commented Apr 18, 2024

For whatever reason it seems to happen more often currently. Before I had it about once a day, but for the last few days this keeps happening 3-4 times a day.

@Koenkk Koenkk reopened this Apr 20, 2024
@Koenkk
Copy link
Owner

Koenkk commented Apr 20, 2024

For those using POE adapters, please check if the issue also happens when connecting over USB. If it doesn't the issue is likely in your network setup.

@stefan-schweiger
Copy link

Is there any additional logging to activate for the USB problems which would help to track this down?

@Koenkk
Copy link
Owner

Koenkk commented Apr 22, 2024

Not from z2m, but you can take a look at dmesg whenever it crashes.

@jdodgen
Copy link

jdodgen commented Apr 22, 2024

Can you post the code please?

Sorry to not get back. it runs as a script from the console when it fails I log date and reboot
z2m is part of a bigger system and runs as a separate process communicating through message queues

def task(watch_dog_queue):
    while True:
        # not sure why they need this but this will run it
        os.chdir("/opt/zigbee2mqtt")
        print(os.getcwd())
        # subprocess.run(["sudo", "systemctl", "stop", "zigbee2mqtt"])  # just incase 
        subprocess.run(["/usr/bin/npm", "start"]) # runs forever or until it crashes
        # previous plan was to attempt restart of z2m but it seems 
        # only a reboot fixes things, a very brut force solution
        # This will be changed when the z2m problem is figured out
        print("exited, attempting restart")
        watch_dog_queue.put(["shutdown", "zigbee2mqtt problems"])
        time.sleep(10) # just to keep it out of a hard loop    

here are the important parts of my "watchdog" it does a graceful shutdown of other processes, then calling os._exit(-1)

        item = watch_dog_queue.get(timeout=const.watch_dog_queue_timeout)
        ...
        (command, oprand) = item
        ...
        if command == "shutdown":
                ....
                os._exit(-1)

My code runs from .bashrc and I log date and reboot

sudo python3 main.py
sudo echo `date` >> bootlog
sudo reboot

current bootlog

Tue 09 Jan 2024 06:11:15 PM PST
Tue 09 Jan 2024 07:09:41 PM PST
Wed 10 Jan 2024 01:55:15 PM PST
Wed 10 Jan 2024 02:33:00 PM PST
Wed 10 Jan 2024 05:40:45 PM PST
Fri 12 Jan 2024 12:46:18 PM PST
Fri 12 Jan 2024 01:22:16 PM PST
Fri 12 Jan 2024 03:13:30 PM PST
Sat 13 Jan 2024 10:48:08 AM PST
Thu 25 Jan 2024 03:54:54 PM PST
Sat 27 Jan 2024 12:30:26 PM PST
Mon 29 Jan 2024 03:29:15 PM PST
Thu 01 Feb 2024 05:23:51 PM PST
Sun 04 Feb 2024 01:01:43 PM PST
Fri 01 Mar 2024 08:02:48 PM PST
Mon 04 Mar 2024 12:34:44 PM PST

@filipefumaux
Copy link

Also same same here

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

No branches or pull requests