Installing zigbee2mqtt (Failed to start EZSP layer with status=HOST_FATAL_ERROR)

Hello, I’ve been stuck for several days and I can’t find a solution despite a lot of searching.

I will try to summarize my installation/configuration as much as possible!

Hardware, I’m running DSM Synology, home assistant is in a docker container.

The whole thing is installed with a docker-compose with home assistant, mqtt which has already been running for quite some time for other hardware, fileeditor, esphome and nodered!
So I added zigbee2mqtt (koenkk/zigbee2mqtt) to docker-compose.

I have a Sonoff ZBBridge Pro Zigbee Gateway (ZBBridge-P) that I reset which worked perfectly under ZHA (completely uninstalled) with multiple devices.

Here is the z2m configuration.yaml:

homeassistant: false
frontend: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost:1883'
  user: l****t
  password: K*****8
  
serial:
    port: 'tcp://192.168.1.171:8888'
    adapter: ember
    zigbee_herdsman_debug: true
advanced:
  network_key:
    - 152
    - 57
    - 224
    - 63
    - 140
    - 156
    - 158
    - 21
    - 252
    - 36
    - 255
    - 77
    - 62
    - 67
    - 141
    - 198
  pan_id: 4038
  ext_pan_id:
    - 204
    - 169
    - 144
    - 92
    - 184
    - 180
    - 162
    - 152

The part of my docker-compose:

#zigbee2mqtt
 
version: '3.8'
services:
  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: always
    volumes:
      - ${RACINE}/zigbee2mqtt/data:/app/data
      - ${RACINE}/zigbee2mqtt/run/udev:/run/udev:ro
    ports:
      - 8888:8080
    network_mode: bridge
    environment:
      - TZ=Europe/Paris

 

And the log via Portainer of zigbee2mqtt not wanting to launch:

Using '/app/data' as data directory
[2024-06-10 05:13:34] info: 	z2m: Logging to console, file (filename: log.log)
[2024-06-10 05:13:34] info: 	z2m: Starting Zigbee2MQTT version 1.38.0 (commit #fe048e6)
[2024-06-10 05:13:34] info: 	z2m: Starting zigbee-herdsman (0.49.2)
[2024-06-10 05:13:34] info: 	zh:ember: Using default stack config.
[2024-06-10 05:13:34] info: 	zh:ember: ======== Ember Adapter Starting ========
[2024-06-10 05:13:34] info: 	zh:ember:ezsp: ======== EZSP starting ========
[2024-06-10 05:13:34] info: 	zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-06-10 05:13:34] info: 	zh:ember:uart:ash: Socket ready
[2024-06-10 05:13:34] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2024-06-10 05:13:37] info: 	zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-06-10 05:13:37] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2024-06-10 05:13:39] info: 	zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-06-10 05:13:39] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2024-06-10 05:13:42] info: 	zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-06-10 05:13:42] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2024-06-10 05:13:44] info: 	zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-06-10 05:13:44] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2024-06-10 05:13:47] error: 	z2m: Error while starting zigbee-herdsman
[2024-06-10 05:13:47] error: 	z2m: Failed to start zigbee
[2024-06-10 05:13:47] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-06-10 05:13:47] error: 	z2m: Exiting...
[2024-06-10 05:13:47] error: 	z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
    at EmberAdapter.initEzsp (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:850:19)
    at EmberAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:2683:24)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:127: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)

I checked this link of course, but I’m lost…

I hope you can clarify the following error for me because I suppose this is the problem: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.

Thank you very much

Did you flash Ember capable firmware on the Sonoff ZBBridge Pro ?

Hello Francis, my bad… what is this firmware?
I use Tasmota in version 12.2.0
Thank you

Zigbee firmware 7.4.x

I think the latest Zigbee firmware in th Tasmota repository is a 6.10.x, so you should use

serial:
    port: 'tcp://192.168.1.171:8888'
    adapter: ezsp

I’m going to work, I’m analyzing the firmware tomorrow.
I can already say that this code does not solve the problem but probably, it is part of it. I will correct this.

serial:
    port: 'tcp://192.168.1.171:8888'
    adapter: ezsp

Thank you, I will keep you informed!

Hello, should I use this version?
This is the most recent one I found.
Thanks

Ah, the Pro is a Ti chipset

it is

serial:
    port: 'tcp://192.168.1.171:8888'
    adapter: zstack
1 Like

Great! It going! Thanks!

I have this error now, I guess the address I have to broach it is not correct.

Here is the log:

[2024-06-18 18:59:25] info: 	z2m: Logging to console, file (filename: log.log)
[2024-06-18 18:59:25] info: 	z2m: Starting Zigbee2MQTT version 1.38.0 (commit #fe048e6)
[2024-06-18 18:59:25] info: 	z2m: Starting zigbee-herdsman (0.49.2)
[2024-06-18 18:59:25] info: 	zh:zstack:znp: Opening TCP socket with 192.168.1.171:8888
[2024-06-18 18:59:26] info: 	zh:zstack:znp: Socket connected
[2024-06-18 18:59:26] info: 	zh:zstack:znp: Socket ready
[2024-06-18 18:59:26] info: 	zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2024-06-18 18:59:27] info: 	zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2024-06-18 19:01:19] info: 	zh:controller: Wrote coordinator backup to '/app/data/coordinator_backup.json'
[2024-06-18 19:01:21] info: 	z2m: zigbee-herdsman started (reset)
[2024-06-18 19:01:21] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20220219,"transportrev":2},"type":"zStack3x0"}'
[2024-06-18 19:01:21] info: 	z2m: Currently 0 devices are joined:
[2024-06-18 19:01:21] info: 	z2m: Zigbee: disabling joining new devices.
[2024-06-18 19:01:21] info: 	z2m:mqtt: Connecting to MQTT server at mqtt://core-mosquitto:1883
[2024-06-18 19:01:21] error: 	z2m:mqtt: MQTT error: getaddrinfo ENOTFOUND core-mosquitto
[2024-06-18 19:01:21] error: 	z2m: MQTT failed to connect, exiting...
[2024-06-18 19:01:21] info: 	z2m: Stopping zigbee-herdsman...
[2024-06-18 19:01:22] error: 	z2m:mqtt: MQTT error: getaddrinfo ENOTFOUND core-mosquitto
[2024-06-18 19:01:23] error: 	z2m:mqtt: MQTT error: getaddrinfo ENOTFOUND core-mosquitto

I tried:
mqtt://core-mosquitto:1883
mqtt://localhost:1883
mqtt://172.17.0.3:1883

I have this in return:

Using '/app/data' as data directory
[2024-06-18 19:36:53] info: 	z2m: Logging to console, file (filename: log.log)
[2024-06-18 19:36:53] info: 	z2m: Starting Zigbee2MQTT version 1.38.0 (commit #fe048e6)
[2024-06-18 19:36:53] info: 	z2m: Starting zigbee-herdsman (0.49.2)
[2024-06-18 19:36:53] info: 	zh:zstack:znp: Opening TCP socket with 192.168.1.171:8888
[2024-06-18 19:36:53] info: 	zh:zstack:znp: Socket connected
[2024-06-18 19:36:53] info: 	zh:zstack:znp: Socket ready
[2024-06-18 19:36:53] info: 	zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2024-06-18 19:36:54] info: 	zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2024-06-18 19:37:12] error: 	z2m: Error while starting zigbee-herdsman
[2024-06-18 19:37:12] error: 	z2m: Failed to start zigbee
[2024-06-18 19:37:12] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-06-18 19:37:12] error: 	z2m: Exiting...
[2024-06-18 19:37:12] error: 	z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:101:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:127: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)

Thank you very much!

Check how you configured the other hardware, and just use the same mqtt settings

In my homeassistant configuration.yaml, I already have a relay card that works with my mqtt broker.
I don’t see how to make the connection.
Here is the code I use.
Thanks



# this example for version >= 2022.09
# example relay board SN is 100,then replace "relay0" with "relay100"
mqtt:
  switch:
    - unique_id: Dingtian-relay0-all
      name: "Dingtian-relay0 Switch0 All ON/OFF"
      command_topic: "/dingtian/relay6202/in/control"
      availability:
        - topic: "/dingtian/relay6202/out/lwt_availability"
          payload_available: "online"
          payload_not_available: "offline"
      payload_on: '{"type":"ON/OFF","idx":"1","status":"ON","time":"0","pass":"0"}
      {"type":"ON/OFF","idx":"2","status":"ON","time":"0","pass":"0"}'
      payload_off: '{"type":"ON/OFF","idx":"1","status":"OFF","time":"0","pass":"0"}
      {"type":"ON/OFF","idx":"2","status":"OFF","time":"0","pass":"0"}'
      optimistic: false
      qos: 0
      retain: false

# relay1~2
    - unique_id: Dingtian-relay0-r1
      name: "Dingtian-relay0 Switch1"
      state_topic: "/dingtian/relay6202/out/r1"
      command_topic: "/dingtian/relay6202/in/r1"
      availability:
        - topic: "/dingtian/relay6202/out/lwt_availability"
          payload_available: "online"
          payload_not_available: "offline"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      optimistic: false
      qos: 0
      retain: true

    - unique_id: Dingtian-relay0-r2
      name: "Dingtian-relay0 Switch2"
      state_topic: "/dingtian/relay6202/out/r2"
      command_topic: "/dingtian/relay6202/in/r2"
      availability:
        - topic: "/dingtian/relay6202/out/lwt_availability"
          payload_available: "online"
          payload_not_available: "offline"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      optimistic: false
      qos: 0
      retain: true


# input1~2
  binary_sensor:
    - unique_id: Dingtian-relay0-i1
      name: "Dingtian-relay0 Input1"
      state_topic: "/dingtian/relay6202/out/i1"
      availability:
        - topic: "/dingtian/relay6202/out/lwt_availability"
          payload_available: "online"
          payload_not_available: "offline"
      payload_on: "ON"
      payload_off: "OFF"
      qos: 0

    - unique_id: Dingtian-relay0-i2
      name: "Dingtian-relay0 Input2"
      state_topic: "/dingtian/relay6202/out/i2"
      availability:
        - topic: "/dingtian/relay6202/out/lwt_availability"
          payload_available: "online"
          payload_not_available: "offline"
      payload_on: "ON"
      payload_off: "OFF"
      qos: 0



So, on your Dingtian relay, how did you set the mqtt broker?

Indeed, I was able to find the exact address of the broker.
Here is what this correction gives:

Using '/app/data' as data directory
[2024-06-19 04:17:14] info: 	z2m: Logging to console, file (filename: log.log)
[2024-06-19 04:17:14] info: 	z2m: Starting Zigbee2MQTT version 1.38.0 (commit #fe048e6)
[2024-06-19 04:17:14] info: 	z2m: Starting zigbee-herdsman (0.49.2)
[2024-06-19 04:17:14] info: 	zh:zstack:znp: Opening TCP socket with 192.168.1.171:8888
[2024-06-19 04:17:14] info: 	zh:zstack:znp: Socket connected
[2024-06-19 04:17:14] info: 	zh:zstack:znp: Socket ready
[2024-06-19 04:17:14] info: 	zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2024-06-19 04:17:15] info: 	zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2024-06-19 04:17:19] info: 	z2m: zigbee-herdsman started (resumed)
[2024-06-19 04:17:19] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20220219,"transportrev":2},"type":"zStack3x0"}'
[2024-06-19 04:17:19] info: 	z2m: Currently 0 devices are joined:
[2024-06-19 04:17:19] info: 	z2m: Zigbee: disabling joining new devices.
[2024-06-19 04:17:19] info: 	z2m:mqtt: Connecting to MQTT server at mqtt://192.168.1.55:1883
[2024-06-19 04:17:49] error: 	z2m:mqtt: MQTT error: connack timeout
[2024-06-19 04:17:49] error: 	z2m: MQTT failed to connect, exiting...
[2024-06-19 04:17:49] info: 	z2m: Stopping zigbee-herdsman...
[2024-06-19 04:18:20] error: 	z2m:mqtt: MQTT error: connack timeout
[2024-06-19 04:18:51] error: 	z2m:mqtt: MQTT error: connack timeout
[2024-06-19 04:19:22] error: 	z2m:mqtt: MQTT error: connack timeout
[2024-06-19 04:19:26] info: 	zh:controller: Wrote coordinator backup to '/app/data/coordinator_backup.json'
[2024-06-19 04:19:26] info: 	zh:zstack:znp: closing
[2024-06-19 04:19:26] info: 	z2m: Stopped zigbee-herdsman
/app/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:264
  var er = new ERR_STREAM_WRITE_AFTER_END();

           ^
Error: write after end
    at writeAfterEnd (/app/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:264:12)
    at DerivedLogger.Writable.write (/app/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:300:21)
    at DerivedLogger.log (/app/node_modules/winston/lib/winston/logger.js:252:14)
    at Logger.log (/app/lib/util/logger.ts:164:25)
    at Logger.info (/app/lib/util/logger.ts:177:14)
    at Znp.onPortClose (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:113:16)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:529:35)
    at TCP.<anonymous> (node:net:350:12)

My user/password are good.
Thank you again!

Download mqtt explorer (mqtt-explorer.com) and see if you can connect.

1 Like

Hello!
I already had the MQTT Explorer program. :slight_smile:
My user/password works.

192.168.1.55
    dingtian
        relay6202
  $SYS
    broker
    version = mosquitto version 2.0.18
    uptime = 811107 seconds
       clients
       load
       messages
       store
       subscriptions
       shared_subscriptions
       retained messages
       publish
       bytes

Hello, I continue my investigations, I remain on this error above.

Access to the mqtt broker works.
The user used is admin to do the tests.

[2024-06-22 20:49:50] error: 	z2m:mqtt: Not connected to MQTT server!
[2024-06-22 20:49:50] error: 	z2m:mqtt: Cannot send message: topic: 'zigbee2mqtt/bridge/state', payload: '{"state":"offline"}

Since I’m using containers, maybe the LAN isn’t passing between items.
How can I check this?

Thanks!

Hello, I need help. Please…

How do you connect with mqtt-explorer ?

Hello Francis!

With mqtt://192.168.1.55:1883

My configuration.yaml (zigbee2mqtt)

homeassistant: false
frontend: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.55:1883
  user: *****
  password: *****
serial:
  port: tcp://192.168.1.171:8888
  adapter: zstack
  zigbee_herdsman_debug: true
advanced:
  network_key:
    - 152
    - 57
    - 224
    - 63
    - 140
    - 156
    - 158
    - 21
    - 252
    - 36
    - 255
    - 77
    - 62
    - 67
    - 141
    - 198
  pan_id: 4038
  ext_pan_id:
    - 204
    - 169
    - 144
    - 92
    - 184
    - 180
    - 162
    - 152
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false

Thank you!

Just want to emphasise this. My dongle is a P, not an E, so it required zstack. It took a good few Google searches to find this.

1 Like