Cant get Zigbee2MQTT to run container (Docker Synology) *SOLVED

Maybe? Let me get some more details on your setup so I understand.

  1. Is Z2M is running in a docker container or as an addon in HA?
  2. Is MQTT is running in a docker container or as an addon in HA?

What it looks like is that it both cannot connect to MQTT and it’s also having issues with the adapter.

Since I am running HA in a docker I cannot use addons (if I understand correctly)
It is not running HomeassitantOS and can therefore not use addons right?
Therefore both MQTT and Z2M are containers running in a docker.

My MQTT config is very plain I have to admit. Am I missing something here?

# Place your local configuration in /mosquitto/confing/

allow_anonymous true
listener 1883
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

Ahhhh completely missed that you’re running Container. Sorry about that!

Can you post the docker compose file for MQTT and Z2M? I wonder if the adapter is being passed through properly. Everything after this [39m: z2m: Error: Failure send version:{"type":"Buffer","data":[0,0,0,4]} leads me to think that the adapter isn’t being detected.

I have not used docker compose. (I do it all in Synology DSM.) But I will try to get it and send it. Thanks a million already! :slight_smile:

1 Like

Not a problem! Happy to help!

hmm I’ve been digging around a bit but I cant figure out how to get the compose file just yet. How can I get this file? I have only been using GUI Docker and not Docker Compose.

Ummmm… you can’t. But, can you screen cap the settings in your NAS? Specifically for Z2M. Since you can get into MQTT with MQTT Explorer, I doubt that’s the issue.

These are the settings that in shows in the Docker UI.
Sorry if this is not what you meant. I am still new to this stuff.
The z2m config.yaml I already sent previously.

I opened the Z2MQTT Log file and it seems to be more telling than the log in the dockerUI somehow. Heres what it says;

[2024-05-13 18:20:02] info: 	z2m: Logging to console, file (filename: log.log)
[2024-05-13 18:20:02] info: 	z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 18:20:02] info: 	z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 18:20:02] warning: 	zh:ezsp: Deprecated driver 'ezsp' currently in use, 'ember' will become the officially supported EmberZNet driver in next release. If using Zigbee2MQTT see https://github.com/Koenkk/zigbee2mqtt/discussions/21462
[2024-05-13 18:20:12] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2024-05-13 18:20:12] error: 	zh:ezsp:ezsp: Connection attempt 1 error: Error: Failure to connect
    at SerialDriver.resetForReconnect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:347:19)
    at SerialDriver.emit (node:events:517:28)
    at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:348:22
    at Queue.execute (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:35:20)
    at SerialDriver.openSerialPort (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:108:13)
    at SerialDriver.connect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:63:13)
    at Ezsp.connect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:353:17)
    at Driver.startup (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:164:13)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:124:29)
    at Zigbee.start (/app/lib/zigbee.ts:62:27)
[2024-05-13 18:20:27] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2024-05-13 18:20:27] error: 	zh:ezsp:ezsp: Connection attempt 2 error: Error: Failure to connect
    at SerialDriver.resetForReconnect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:347:19)
    at SerialDriver.emit (node:events:517:28)
    at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:348:22
    at Queue.execute (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:35:20)
    at SerialDriver.openSerialPort (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:108:13)
    at SerialDriver.connect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:63:13)
    at Ezsp.connect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:353:17)
    at Driver.startup (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:164:13)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:124:29)
    at Zigbee.start (/app/lib/zigbee.ts:62:27)
[2024-05-13 18:20:44] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":1} after 4000ms
[2024-05-13 18:20:44] error: 	zh:ezsp:uart: -!- break waiting (1)
[2024-05-13 18:20:44] error: 	zh:ezsp:uart: Can't send DATA frame (0,0,0): 000001000009
[2024-05-13 18:20:48] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":1} after 4000ms
[2024-05-13 18:20:48] error: 	zh:ezsp:uart: -!- break rewaiting (1)
[2024-05-13 18:20:48] error: 	zh:ezsp:uart: Can't resend DATA frame (0,0,1): 000001000009
[2024-05-13 18:20:48] error: 	z2m: Error while starting zigbee-herdsman
[2024-05-13 18:20:48] error: 	z2m: Failed to start zigbee
[2024-05-13 18:20:48] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-05-13 18:20:48] error: 	z2m: Exiting...
[2024-05-13 18:20:48] error: 	z2m: Error: Failure send version:{"type":"Buffer","data":[0,0,1,0,0,9]}
    at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:686:23
    at Queue.execute (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:35:20)
    at Ezsp.version (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:466:24)
    at Driver.startup (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:173:9)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:124:29)
    at Zigbee.start (/app/lib/zigbee.ts:62:27)
    at Controller.start (/app/lib/controller.ts:109:27)
    at start (/app/index.js:107:5)

It looks like trouble with the USB device to me indeed. (from my limited understanding that is haha.)

1 Like

Yup. Ok, so I don’t see where it’s passing in the USB stick to /dev/usbTTY0. Typically, in a docker compose (which I don’t think you can use), you need to pass in the USB stick (using /dev/<something>).

Yup. That’s exactly what it is. I’ll see if I can dig up something to how to pass in the USB stick. I don’t have that NAS, so a little hard for me to troubleshoot it.

Yup. Ok, so I don’t see where it’s passing in the USB stick to /dev/usbTTY0. Typically, in a docker compose (which I don’t think you can use), you need to pass in the USB stick.

So, I found this: Synology Docker USB Passthru for Zigbee :frowning:

I’m not sure that’s the best news.

Awesome we got the culprit atleast…
Yes I changed that (in the Comfig.yaml) to;

serial:
  port: /dev/ttyUSB0
  adapter: ezsp

As that is my USB SkyConnect.

I already manually installed the USB driver for that one to get my skyconnect working at all in HA with ZHA.
(I followed this tutorial for that: https://www.youtube.com/watch?v=GjZI4Mw0a4c )

So, wait… you were able to get it to passthrough???

(annoying reply timer…)
Yes the SkyCOnnect USB works fine in HomeAssist using ZHA.
When i SSH the ‘ls’ command I dont see the ttyACM0 that everyone mentions in the Zigbee2mqtt install tutorials. So I changed those references to my ttyUSB0. (for which I installed the drivers.)

Can you get into the terminal for the docker container for Z2M?

If so, try this: ls /dev/ttyUSB0 and ls /dev/serial/by-id/ and see what both of those commands do.

the first command opens the folder. the second returns; ls: cannot access '/dev/serial/by-id/': No such file or directory.

since I am dumping so many logs anyway… When I copen up the terminal through the docker UI. The terminal freezes pretty much instantly as the container crashes.
This is what it shows at that time;

(I have reached the limit of replies I can send in a day :frowning: So I will be back in 19 hours…

You do know only ZHA or Zigbee2MQTT can use the Skyconnect at the same time ? So you have to disable ZHA before starting Zigbee2MQTT.

I have to admit I only figured this out last night after my latest post. I disabled the ZHA integration in the home assistant devices & Integrations. And then launched the container. But I still get the same error as above.
Maybe I should disable it and then reboot HA And all the containers?

It seems MQTT has a page on the error I get but no luck for me yet.

OMG I FINALLY FOT IT WORKING!!!

Turns out all I had to do was REMOVE ZHA instead of disabling it.
Now using

  port: /dev/ttyUSB0
  adapter: ezsp

did the trick!

Thanks everyone for your help! I am up and running! :smiley:

2 Likes