Cannot start Zigbee2MQTT [SOLVED] (DOH!)

I just spent most of the day restoring Home Assistant due to a ischemic crash. (An interrupted restore).

Most things are working except for Zigbee2MQTT. The logs don’t tell me much:

[22:55:32] INFO: Preparing to start...
[22:55:32] INFO: Socat not enabled
[22:55:32] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-07-01 22:55:34: Logging to console and directory: '/config/zigbee2mqtt/log/2023-07-01.22-55-34' filename: log.txt
Zigbee2MQTT:info  2023-07-01 22:55:34: Starting Zigbee2MQTT version 1.32.0 (commit #unknown)
Zigbee2MQTT:info  2023-07-01 22:55:34: Starting zigbee-herdsman (0.16.0)
Zigbee2MQTT:error 2023-07-01 22:55:34: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-07-01 22:55:34: Failed to start zigbee
Zigbee2MQTT:error 2023-07-01 22:55:34: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-07-01 22:55:34: Exiting...
Zigbee2MQTT:error 2023-07-01 22:55:34: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0'
    at SerialPort.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28)
    at SerialPort._error (/app/node_modules/@serialport/stream/dist/index.js:75:22)
    at /app/node_modules/@serialport/stream/dist/index.js:111:18

Does that last line say that the Zigbee dongle isn’t being found? I looked at /dev/serial/by-id/ and found:

➜  by-id ls -al
total 0
drwxr-xr-x    2 root     root            60 Jul  1 22:38 .
drwxr-xr-x    4 root     root            80 Jul  1 22:38 ..
lrwxrwxrwx    1 root     root            13 Jul  1 22:38 usb-0658_0200-if00 -> ../../ttyACM0

Restarting the host or switching the USB ports didn’t make any difference. If it helps, I am running HAOS native X-86 on an Intel NUC.

If you haven’t already done so, try powering off the PC. I’ve run into a few instances where a cold start was required to reset a USB device.

Thanks. No difference.
How can I find where the Zigbee dongle mounted?

Yes that is what this error is saying:

Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0

Look in Settings → System → Hardware → All Hardware

What, specifically, am I looking for? There’s nothing in the list that says “Zigbee”.
I did find ttyACM0, but port: /dev/ttyACM0 doesn’t work either.

You are looking for your zigbee dongle.

If you can’t see it, try plugging it into a windows PC. Does it show up under “Other Devices” in device managed?

If not there may be something wrong with your dongle.

No, it just mounts as a COM port.
But, my Z-wave devices do work, so how could the dongle be bad?
I can see all my devices in the Z-Wave JS UI.
If I use: port: /dev/ttyACM0
there are no errors in the log, but the UI gives a 502 (Bad Gateway) error.

All I did was to restore my HA from a 2-day old backup.

Whats the brand of your stick? I had this exact same problem a few months ago with a sonoff stick. Turned out to be a “dodgy” nvram. I had a lot of hassle to restore my config (stick config).

From the error:

Someone tell me again, why Zigbee2MQTT instead of ZHA?

Have you tried this? From Zigbee2MQTT fails to start | Zigbee2MQTT

Verify that the user you run Zigbee2MQTT as has write access to the port

This can be tested by executing: test -w [PORT] && echo success || echo failure ( e.g. test -w /dev/ttyACM0 && echo success || echo failure).

If it outputs failure it could mean your user does not have access to the port. To test assign write access by executing: sudo chown [USER] [PORT] (e.g. sudo chown pi /dev/ttyACM0).

if it outputs failure, then you need to permanently give your user permission to the device.

#Method 1: Give your user permissions on every reboot.

1 Like

Thanks. I am running HAOS, so I am Root:

I had some issues like this a while ago, I tried everything and nothing worked. Ended up reflashing the USB stick and then suddenly everything was golden.

FYI: this is what I have under hardware in HAOS

Is this a serious question or out of frustration?

Thanks, but as I said above (almost) all of my Zigbee devices are working. I can see them on ZWave-JS, but Zigbee2MQTT won’t start.

I’ve never used Z-wave so excuse me if I have misunderstood something, but how is Zwave related to Zigbee2Mqtt and why would you see Zigbee-devices there if your Zigbee stick is not communicating properly?

You’re right, one has nothing to do with the other and very strange that his zigbee devices are working… :thinking:

Strange is my middle name.

This is what my hardware shows for ttyACM0:

DEVLINKS: >-
  /dev/serial/by-id/usb-0658_0200-if00
  /dev/serial/by-path/pci-0000:00:14.0-usb-0:4:1.0
DEVNAME: /dev/ttyACM0
DEVPATH: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/tty/ttyACM0
ID_BUS: usb
ID_MODEL: '0200'
ID_MODEL_ENC: '0200'
ID_MODEL_ID: '0200'
ID_PATH: pci-0000:00:14.0-usb-0:4:1.0
ID_PATH_TAG: pci-0000_00_14_0-usb-0_4_1_0
ID_REVISION: '0000'
ID_SERIAL: '0658_0200'
ID_TYPE: generic
ID_USB_DRIVER: cdc_acm
ID_USB_INTERFACES: ':020201:0a0000:'
ID_USB_INTERFACE_NUM: '00'
ID_USB_MODEL: '0200'
ID_USB_MODEL_ENC: '0200'
ID_USB_MODEL_ID: '0200'
ID_USB_REVISION: '0000'
ID_USB_SERIAL: '0658_0200'
ID_USB_TYPE: generic
ID_USB_VENDOR: '0658'
ID_USB_VENDOR_ENC: '0658'
ID_USB_VENDOR_ID: '0658'
ID_VENDOR: '0658'
ID_VENDOR_ENC: '0658'
ID_VENDOR_ID: '0658'
MAJOR: '166'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '4475517338'

Z-wave is a big mystery to me. Why do I need Zigbee2MQTT anyway? I just want to add or delete Zigbee devices to my network.

When I use /dev/serial/by-id/usb-0658_0200-if00, the log shows errors connecting to the dongle. When I use /dev/ttyACM0, there are no log errors, but I get a 502 Bad Gateway error when opening the UI.