Zigbee2MQTT stopped working again

unbutu@unbutu:~$ docker ps -a
CONTAINER ID   IMAGE                       COMMAND                  CREATED        STATUS                     PORTS      NAMES
e20f686c6272   eclipse-mosquitto:2         "/docker-entrypoint.…"   11 days ago    Up 5 hours                            eclipse-mosquitto
266260c880c7   gladysassistant/gladys:v4   "docker-entrypoint.s…"   11 days ago    Up 5 hours                            gladys
04ee08ed1942   eclipse-mosquitto:2         "/docker-entrypoint.…"   11 days ago    Up 5 hours                            gladys-z2m-mqtt
47f1e5a8bba7   koenkk/zigbee2mqtt:latest   "docker-entrypoint.s…"   2 weeks ago    Exited (1) 3 minutes ago              gladys-z2m-zigbee2mqtt
046e603b0580   nodered/node-red            "./entrypoint.sh"        4 months ago   Up 5 hours (healthy)                  node_red
f6297e171b08   containrrr/watchtower       "/watchtower --clean…"   4 months ago   Up 5 hours                 8080/tcp   watchtower
unbutu@unbutu:~$ rm /var/lib/docker/containers/47f1e5a8bba77449c1fb4e0f171fbb0c2b5d3f2a289442d0910f7e6dddec109d/47f1e5a8bba77449c1fb4e0f171fbb0c2b5d3f2a289442d0910f7e6dddec109d-json.log
rm: cannot remove '/var/lib/docker/containers/47f1e5a8bba77449c1fb4e0f171fbb0c2b5d3f2a289442d0910f7e6dddec109d/47f1e5a8bba77449c1fb4e0f171fbb0c2b5d3f2a289442d0910f7e6dddec109d-json.log': Permission denied

it doesn’t change anything.

@pierre-gilles

It’s true that it would be a nice feature to be able to shut down or reboot the system on which Gladys is installed, personally I do it via RDP on my mini-PC but it would be simpler if it were direct! :wink:

@elfedagger I did the same procedure on my setup without any trouble :thinking:

Otherwise another solution that comes to mind:

You stop all your containers (Gladys included), then you completely remove the Zigbee2mqtt container (the data won’t be lost, that’s on the disk in a volume):

docker rm gladys-z2m-zigbee2mqtt 

Then, you restart Gladys

docker restart gladys

Gladys should re-create the Zigbee2mqtt container normally.

After that, I can’t guarantee it’ll work, I don’t know how « severe » the corruption of your installation is, Zigbee2mqtt is independent software from Gladys, I don’t know what they do internally and whether this software is designed to withstand a hard-crash

In Gladys’ case, even though restarting the system during a « power cut » is not recommended, Gladys uses SQLite, an ACID database ( Propriétés ACID — Wikipédia ) that resists this kind of « rough treatment » :stuck_out_tongue:

Why not, why don’t you create a feature request?

1 Like

I think there already is one: Demande de mise en place d'un bouton arrêt et redémarrage du raspberry

3 Likes

I’ll try that, thanks.

1 Like

I remember ,I had voted for this request.

I followed your solution.
I have this in the Gladys logs.

2023-06-27T21:36:38+0200 <info> init.js:39 (Zigbee2mqttManager.init) Zigbee2mqtt                                                                                         USB dongle attached to /dev/ttyUSB0
2023-06-27T21:36:38+0200 <info> checkForContainerUpdates.js:14 (Zigbee2mqttManag                                                                                        er.checkForContainerUpdates) Checking for current installed versions and require                                                                                        d updates...
2023-06-27T21:36:38+0200 <info> installMqttContainer.js:114 (Zigbee2mqttManager.                                                                                        installMqttContainer) MQTT broker is starting...
2023-06-27T21:36:44+0200 <info> installMqttContainer.js:120 (Zigbee2mqttManager.                                                                                        installMqttContainer) MQTT broker container successfully started
2023-06-27T21:36:44+0200 <info> installZ2mContainer.js:33 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Zigbee2mqtt is being installed as Docker container...
2023-06-27T21:36:44+0200 <info> installZ2mContainer.js:34 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Pulling koenkk/zigbee2mqtt:latest image...
2023-06-27T21:36:46+0200 <info> installZ2mContainer.js:37 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Configuration of Device /dev/ttyUSB0
2023-06-27T21:36:46+0200 <info> installZ2mContainer.js:42 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Creation of container...
2023-06-27T21:36:46+0200 <info> installZ2mContainer.js:45 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Zigbee2mqtt successfully installed and configured as Docker c                                                                                        ontainer
2023-06-27T21:36:46+0200 <info> configureContainer.js:19 (Zigbee2mqttManager.con                                                                                        figureContainer) Z2M Docker container is being configured...
2023-06-27T21:36:46+0200 <info> configureContainer.js:30 (Zigbee2mqttManager.con                                                                                        figureContainer) Z2M configuration file already exists.
2023-06-27T21:36:46+0200 <info> installZ2mContainer.js:68 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Zigbee2mqtt container is (re)starting...
2023-06-27T21:36:51+0200 <info> installZ2mContainer.js:74 (Zigbee2mqttManager.in                                                                                        stallZ2mContainer) Zigbee2mqtt container successfully started
2023-06-27T21:36:51+0200 <info> connect.js:25 (Zigbee2mqttManager.connect) Conne                                                                                        cting Gladys to mqtt://localhost:1884 MQTT broker...
2023-06-27T21:36:51+0200 <info> connect.js:35 (MqttClient.<anonymous>) Connected                                                                                         to MQTT container mqtt://localhost:1884
2023-06-27T21:36:51+0200 <info> subscribe.js:12 (Zigbee2mqttManager.subscribe) S                                                                                        ubscribing to MQTT topic zigbee2mqtt/#
Et dans ceux de zigbee2mqtt j'ai ça.
Zigbee2MQTT:info  2023-06-27 19:55:58: Logging to console and directory: '/app/data/log/2023-06-27.19-55-58' filename: log.txt
Zigbee2MQTT:info  2023-06-27 19:55:58: Starting Zigbee2MQTT version 1.31.2 (commit #21f5125)
Zigbee2MQTT:info  2023-06-27 19:55:58: Starting zigbee-herdsman (0.14.117)
Zigbee2MQTT:error 2023-06-27 19:56:18: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-06-27 19:56:18: Failed to start zigbee
Zigbee2MQTT:error 2023-06-27 19:56:18: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-06-27 19:56:18: Exiting...
Zigbee2MQTT:error 2023-06-27 19:56:18: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adap

I have this error again ((Error: SRSP - SYS - ping after 6000ms).
I followed the zigbee2mqtt procedure for that again.

unbutu@unbutu:~$ ls -l /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 juin  27 18:17 usb-1a86_USB2.0-Serial-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 juin  27 18:17 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0cac220e7329ec11a0de6d7840c9ce8d-if00-port0 -> ../../ttyUSB1

And in my zigbee2mqtt configuration I have this.


I still don’t understand how my dongle can change USB port without me changing the port on my mini PC.
I changed the configuration of my dongle in Gladys, I changed the USB port of my RFLink in Node-RED since both had the same one.
I restarted everything and nothing. I still have the same error in the zigbee2mqtt logs

In your last message, when you list your ports, your ZigBee dongle is on ttyUSB1 but configured for ttyUSB0 in Gladys…

Wouldn’t that change after a reboot or powering off the box?
Maybe, at startup, one dongle reacts faster than the other and gets assigned the slot?

Edit: when you paste code, could you put it between 5 Spanish-style backticks (there’s probably a name for that)? It would make reading easier…
Ex :

Becomes : paste your code

I managed to solve my problem in another way.

unbutu@unbutu:~$ Using '/app/data' as data directory
Zigbee2MQTT:info  2023-06-28 18:41:44: Logging to console and directory: '/app/data/log/2023-06-28.18-41-44' filename: log.txt
Zigbee2MQTT:info  2023-06-28 18:41:44: Starting Zigbee2MQTT version 1.31.2 (commit #21f5125)
Zigbee2MQTT:info  2023-06-28 18:41:44: Starting zigbee-herdsman (0.14.117)
Zigbee2MQTT:info  2023-06-28 18:41:55: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2023-06-28 18:41:55: Coordinator firmware version: '{\"meta\":{\"maintrel\":1,\"majorrel\":2,\"minorrel\":7,\"product\":1,\"revision\":20210708,\"transportrev\":2},\"type\":\"zStack3x0\"}'
Zigbee2MQTT:info  2023-06-28 18:41:55: Currently 13 devices are joined:
Zigbee2MQTT:info  2023-06-28 18:41:55: prise conso (0xa4c13893729f42b1): TS011F_plug_1 - TuYa Smart plug (with power monitoring) (Router)
Zigbee2MQTT:info  2023-06-28 18:41:55: Prise alimentation pc (0xbc33acfffe5bb758): HG06337 - Lidl Silvercrest smart plug (EU, CH, FR, BS, DK) (Router)
Zigbee2MQTT:info  2023-06-28 18:41:55: Prise salon (0xbc33acfffe4e7381): HG06337 - Lidl Silvercrest smart plug (EU, CH, FR, BS, DK) (Router)
Zigbee2MQTT:info  2023-06-28 18:41:55: Prise chambre 2 (0xbc33acfffe4f5a81): HG06337 - Lidl Silvercrest smart plug (EU, CH, FR, BS, DK) (Router)
Zigbee2MQTT:info  2023-06-28 18:41:55: detecteur mvt salon (0xa4c13813814602bd): IH012-RT01 - TuYa Motion sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température vérandas (0xa4c138e51a0f2c1d): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température chambre 1 (0xa4c1388e45cc8a72): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température chambre 2 (0xa4c1384ded05f588): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température salle de bain (0xa4c138c521f91723): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température salon (0xa4c1383273810b6a): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Température poulailler (0xa4c138cb69488e66): IH-K009 - TuYa Temperature \u0026 humidity sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: pompe bassin (0xa4c138a2dfbbe259): WHD02 - TuYa Wall switch module (Router)
Zigbee2MQTT:info  2023-06-28 18:41:55: Capteur d'ouverture (0x00124b002a59da25): SNZB-04 - SONOFF Contact sensor (EndDevice)
Zigbee2MQTT:info  2023-06-28 18:41:55: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2023-06-28 18:41:56: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:info  2023-06-28 18:41:56: Connected to MQTT server
Zigbee2MQTT:info  2023-06-28 18:41:56: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info  2023-06-28 18:41:56: Started frontend on port 0.0.0.0:8080

I unplugged what was connected to the USB ports of my mini PC, leaving my Zigbee2MQTT dongle plugged in. I restarted Gladys. That forced my dongle to switch back to USB0; I checked that Zigbee2MQTT also saw it on USB0 and I restarted Gladys and Zigbee2MQTT. I started the Zigbee2MQTT logs and it had restarted.

I have a question: each time I started the Gladys and Zigbee2MQTT logs, I got results from two hours earlier. This time the startup is displayed at 18:41 and at that time Zigbee2MQTT wasn’t working. I started these logs at 20:41. When you run the logs, are the results instantaneous and it’s just the displayed time that’s wrong? Or do my results really date from two hours earlier and do I need to change something somewhere to have instant logs?

ps: did I do it correctly with the 5 apostrophes?

no you didn’t use them but you put the sequence below

Use the icon below or press CTRL + E

image

You will get this and paste your content in place of the example text
image

1 Like

oops I had hit the apostrophe on the 4 key of my keyboard five times. Thanks for the info, I’ll use that next time I’m in a bind :stuck_out_tongue_winking_eye:.

As for the times, it often happens that there’s an error between the GMT time (stored) and the time displayed in GMT+2.

1 Like

That’s the problem: it’s not the one on the 4 key but the one on the 7 key
And 3 apostrophes are enough at the beginning and at the end

1 Like