Newbie Issue: Failure to start Zigbee2MQTT

OK, just got the Sonoff Zigbee 3.0 USB Dongle Plus, which HA OS on x86 recognized. Installed Mosquitto without issues, but Zigbee2MQTT keeps throwing these errors:

[15:53:45] INFO: Preparing to start…
[15:53:45] INFO: Socat not enabled
[15:53:45] INFO: Starting Zigbee2MQTT…
Starting Zigbee2MQTT without watchdog.
[2025-02-18 15:53:46] info: z2m: Logging to console, file (filename: log.log)
[2025-02-18 15:53:46] info: z2m: Starting Zigbee2MQTT version 2.1.1 (commit #unknown)
[2025-02-18 15:53:46] info: z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-18 15:53:46] info: zh:ember: Using default stack config.
[2025-02-18 15:53:46] info: zh:ember: ======== Ember Adapter Starting ========
[2025-02-18 15:53:46] info: zh:ember:ezsp: ======== EZSP starting ========
[2025-02-18 15:53:46] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:46] info: zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2025-02-18 15:53:46] info: zh:ember:uart:ash: Serial port opened
[2025-02-18 15:53:46] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:49] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:49] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:51] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:51] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:54] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:54] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:56] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:56] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:59] error: z2m: Error while starting zigbee-herdsman
[2025-02-18 15:53:59] error: z2m: Failed to start zigbee-herdsman
[2025-02-18 15:53:59] error: z2m: Check Zigbee2MQTT fails to start/crashes runtime | Zigbee2MQTT for possible solutions
[2025-02-18 15:53:59] error: z2m: Exiting…
[2025-02-18 15:53:59] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:670:19)
at EmberAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1533:24)
at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:142:13)
at start (/app/index.js:161:5)

I’ve confirmed the Sonoff is recognized in HA via both via terminal and in HA hardware:

/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0
/dev/ttyUSB0

so have been testing both of these serial configurations in Z2M:

serial: port: >- /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0

serial: port: >- /dev/ttyUSB0

I’ve tried using ‘ezsp’ as the adapter callout here too, it’s even worse - this starts repeating if so:

error: Error: Failure to connect
[2025-02-18 13:01:21] error: zh:ezsp:uart: → Error: Error: {“sequence”:-1} after 10000ms

I also flashed the adapter with CC1352P2_CC2652P_launchpad_coordinator_20240710.hex, to see if that made a difference. Same thing.

Also, I did not set up the Sonoff in the discovered devices, as I didn’t want ZHA to interfere.

I know I’m screwing something up, just don’t know what… thanks for anyone who can help me!

As per the documentation the serial config must now include an adapter: option.

serial: 
  adapter: zstack
  port: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0

Thanks Tom for your response!

Yeah, I’ve tried adding the adapter to the serial config for ezsp, ember, and now zstack. So far still getting errors.

Do you have the ZBDongle-P or ZBDongle-E?

It’s the Zigbee 3.0 USB Dongle Plus

here’s the amazon link:

Check the model code printed on the device.

I recall one user who thought they ordered one model only to discover, after being told to read the printed code, that they actually received the other model.

You did not answer my question.

Tom, my apologies - you are right - on the dongle itself it says
Model: ZBDongle-P

Ok, that is definitely adapter: zstack.

https://www.zigbee2mqtt.io/guide/adapters/zstack.html (scroll down to your adapter).

I see that there got ya. The good news is that I did flash the correct firmware then (CC1352P2_CC2652P_launchpad_coordinator_20240710.hex)

Bad news is using this:

serial: 
  adapter: zstack
  port: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0

I get this:

Starting Zigbee2MQTT without watchdog.
[2025-02-19 17:18:23] info: 	z2m: Logging to console, file (filename: log.log)
[2025-02-19 17:18:23] info: 	z2m: Starting Zigbee2MQTT version 2.1.1 (commit #unknown)
[2025-02-19 17:18:23] info: 	z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-19 17:18:23] warning: 	zh:ezsp: 'ezsp' driver is deprecated and will only remain to provide support for older firmware (pre 7.4.x). Migration to 'ember' is recommended. If using Zigbee2MQTT see https://github.com/Koenkk/zigbee2mqtt/discussions/21462
[2025-02-19 17:18:33] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2025-02-19 17:18:33] error: 	zh:ezsp:ezsp: Connection attempt 1 error: Error: Failure to connect
[2025-02-19 17:18:48] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2025-02-19 17:18:48] error: 	zh:ezsp:ezsp: Connection attempt 2 error: Error: Failure to connect
[2025-02-19 17:19:08] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2025-02-19 17:19:08] error: 	zh:ezsp:ezsp: Connection attempt 3 error: Error: Failure to connect
[2025-02-19 17:19:33] error: 	zh:ezsp:uart: --> Error: Error: {"sequence":-1} after 10000ms
[2025-02-19 17:19:33] error: 	zh:ezsp:ezsp: Connection attempt 4 error: Error: Failure to connect
[2025-02-19 17:19:33] error: 	z2m: Error while starting zigbee-herdsman
[2025-02-19 17:19:33] error: 	z2m: Failed to start zigbee-herdsman
[2025-02-19 17:19:33] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-02-19 17:19:33] error: 	z2m: Exiting...
[2025-02-19 17:19:33] error: 	z2m: Error: Failure to connect

So why is z2m still trying to use the ezsp/ember driver?

Do you have yaml config in the add-on settings that is overriding the z2m configuration.yaml file?

OK, wow, and again pardon my green-ness here. Looking in the Zigbee2MQTT configuration file (which hey now I know exists), it shows this:

...
mqtt:
  server: mqtt://core-mosquitto:1883
  user: addons
  password: [passsword in here]  
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0
  adapter: ezsp
frontend:
  enabled: true
  port: 8099

Which is notably different than these entries in the config gui:

base_topic: zigbee2mqtt
server: mqtt://http://192.168.1.170:1883
user: mqtt_user
password: [passsword in here]


serial:
  adapter: zstack
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0

So I changed that adapter line in the config file to:

adapter: zstack

and now I get this:

[17:44:25] INFO: Preparing to start...
[17:44:25] INFO: Socat not enabled
[17:44:26] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2025-02-19 17:44:27] info: 	z2m: Logging to console, file (filename: log.log)
[2025-02-19 17:44:27] info: 	z2m: Starting Zigbee2MQTT version 2.1.1 (commit #unknown)
[2025-02-19 17:44:27] info: 	z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-19 17:44:27] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-02-19 17:44:27] info: 	zh:zstack:znp: Serialport opened
[2025-02-19 17:44:46] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2025-02-19 17:44:46] info: 	z2m: zigbee-herdsman started (reset)
[2025-02-19 17:44:46] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20240710,"transportrev":2},"type":"zStack3x0"}'
[2025-02-19 17:44:46] info: 	z2m: Currently 0 devices are joined.
[2025-02-19 17:44:46] info: 	z2m: Connecting to MQTT server at mqtt://http://192.168.1.170:1883
[2025-02-19 17:44:50] error: 	z2m: MQTT failed to connect, exiting... (getaddrinfo ENOTFOUND http)
[2025-02-19 17:44:50] info: 	z2m: Stopping zigbee-herdsman...
[2025-02-19 17:44:59] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2025-02-19 17:44:59] info: 	zh:zstack:znp: closing
[2025-02-19 17:44:59] info: 	zh:zstack:znp: Port closed
[2025-02-19 17:44:59] info: 	z2m: Stopped zigbee-herdsman

Excellent. You are making progress. Z2M can now connect to to your adaptor, it just can’t connect to your mqtt broker.

Change this:

server: mqtt://http://192.168.1.170:1883

to:

server: mqtt://192.168.1.170:1883

Holy crap! this now:

Starting Zigbee2MQTT without watchdog.
[2025-02-19 18:06:41] info: 	z2m: Logging to console, file (filename: log.log)
[2025-02-19 18:06:41] info: 	z2m: Starting Zigbee2MQTT version 2.1.1 (commit #unknown)
[2025-02-19 18:06:41] info: 	z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-19 18:06:41] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-02-19 18:06:41] info: 	zh:zstack:znp: Serialport opened
[2025-02-19 18:06:41] info: 	z2m: zigbee-herdsman started (resumed)
[2025-02-19 18:06:41] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20240710,"transportrev":2},"type":"zStack3x0"}'
[2025-02-19 18:06:41] info: 	z2m: Currently 0 devices are joined.
[2025-02-19 18:06:41] info: 	z2m: Connecting to MQTT server at mqtt://192.168.1.170:1883
[2025-02-19 18:06:41] info: 	z2m: Connected to MQTT server
[2025-02-19 18:06:41] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2025-02-19 18:06:41] info: 	z2m: Started frontend on port 8099
[2025-02-19 18:06:41] info: 	z2m: Zigbee2MQTT started!
[2025-02-19 18:06:46] info: 	z2m:mqtt: MQTT publish: topic 'homeassistant/binary_sensor/1221051039810110150109113 ... 

and several lines like that that go on for awhile… they look like entities and states etc.

Did we get it?!

Yep. You just need to pair some devices now.

But… before you do, have you changed your network key from the default and have you chosen an appropriate channel to minimise wifi interference?

You need to do this before pairing devices.

:grinning:

OK Tom, how do I send you a six-pack?

I’m serious!

Im going to try to pair some devices. I have smartthings stuff that I want to move over, and some new thirdreality smart plugs that are still in a box.

I know I have to unpair from ST and re-pair.

Any juicy nuggets of wisdom I should be prepared for?

Can’t thank you enough.

I edited my post before you replied:

Find which wifi channel(s) you are using (should be 1, 6 or 11) then pick a zigbee channel that is as far away from that as possible:

e.g.

Wifi channel 1 → use Zigbee channel 25. Don’t use zigbee channel 26, this is unsupported by some devices.

Or

Wifi channel 11 → Zigbee channel 11.

OR

Wifi channel 6 → Zigbee channel 11 or 25.

Set this in your z2m configuration.yaml file.

As for the key, you can get z2m to generate a random one, see Secure your Zigbee network | Zigbee2MQTT

Restart z2m before adding devices. Add the routing capable devices first (mains powered usually) then add the battery powered devices last.

Awesome advice.

So I changed the network portion to:

advanced:
    network_key: GENERATE

This caused this:

[2025-02-19 18:52:10] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-02-19 18:52:10] info: 	zh:zstack:znp: Serialport opened
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: Configuration is not consistent with adapter state/backup!
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: - PAN ID: configured=540, adapter=540
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: - Extended PAN ID: configured=eeac3476dab09bbb, adapter=eeac3476dab09bbb
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: - Network Key: configured=[random numbers?], adapter=c1453ece6627c57cfd4ea65ffb25b75c
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: - Channel List: configured=11, adapter=11
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: Please update configuration to prevent further issues.
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: If you wish to re-commission your network, please remove coordinator backup at /config/zigbee2mqtt/coordinator_backup.json.
[2025-02-19 18:52:10] error: 	zh:adapter:zstack:manager: Re-commissioning your network will require re-pairing of all devices!
[2025-02-19 18:52:10] error: 	z2m: Error while starting zigbee-herdsman
[2025-02-19 18:52:10] error: 	z2m: Failed to start zigbee-herdsman
[2025-02-19 18:52:10] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-02-19 18:52:10] error: 	z2m: Exiting...
[2025-02-19 18:52:10] error: 	z2m: Error: startup failed - configuration-adapter mismatch - see logs above for more information
    at ZnpAdapterManager.determineStrategy (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:252:35)

Even though it looked like it generated an new set of numbers.

Just delete this file:

/config/zigbee2mqtt/coordinator_backup.json.

It has the old key in it which does not match your new one.

Next time you start z2m a new backup will be generated.

OK, I got it! Thanks! New network key and channel changed.

I think I have to unpair zigbee stuff from SmartThings now. Is that just a semi-fancy way of saying simply delete it from my devices in the ST app? Can’t be that easy…