Zigbee2mqtt not starting up anymore


I’ve been running zigbee2mqtt with a zbmini for about 3 months now and this morning it stopped working.
None of my zigbee device would respond anymore so I restarted the plugin and here is what I get into the log:

> [email protected] start
> node index.js
Zigbee2MQTT:error 2021-09-06 22:44:51: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-09-06 22:44:51: Failed to start zigbee
Zigbee2MQTT:error 2021-09-06 22:44:51: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-09-06 22:44:51: Exiting...
Zigbee2MQTT:error 2021-09-06 22:44:51: Error: Error while opening socket
    at Socket.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:257:24)
    at Socket.emit (events.js:412:35)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Any Idea about how to fix that?


Stop zigbee2mqtt, disconnect your adapter (remove from usb), reconnect your adapter, start zigbee2mqtt.
This works for me.

Thanks for the feedback
this didn’t make the trick since I am using a sonoff bridge
However, I solved it by issueing again the following command to map the zigbee chip to the TCP server:

backlog rule1 on system#boot do TCPStart 8888 endon ; rule1 1 ;* *template {"NAME":"Sonoff ZHABridge","GPIO":[56,208,0,209,59,58,0,0,0,0,0,0,17],"FLAG":0,"BASE":18} ; module 0


Solved my problem also. Thank you for that!
How did you find this solution?

Solved my issue as well. Thanks

I went throughh the installation process of the sonoff gateway and, by connecting the dots, figured out that this might be the issue.

1 Like

I also have a sonoff bridge but i’m new to this world… How did you do that? Where and how did you set it up. I have had my sonoff bridge running (and working with ZHA) but i updatet the firmware to Tasmota 10.0.0 and now try to get it to work with Zigbee2mqtt. Please help :slight_smile:


You can follow this great tuto:

Dou you use ZHA or Z2M?

Because I have the same problem that you but I use the Zigbee to Mqtt and your solution is used for what integration ZHA or Z2M?


I completely dropped Z2M. Had too many issues with it.
Moved to ZHA. 100% happy with it!

Ok, thanks

helped me too. thanks

Thank you!

Had the same problem - came home one day and Zigebee2MQTT just wasn’t working.
I kept getting

Error while starting zigbee-herdsman


Error while opening socket

Tried lots of things, but this was the answer. Thank you for posting this solution.

Did you ever find a solution ?

All from a sudden I also have this problem. I’ve tried to reach the project for help but it seems that I’m alone in the dark.

@lzyla @GerryG But this solution seems to prepare the device for ZHA, Isn’t it? The port opened is not the 20108 for zigbee2mqtt. Did you moved to ZHA?

Edit: OK, now I see that if you change the zigbee2mqtt target port to the ZHA one it works. :+1:
Then I wonder why to instruct on the docs to “not doing the #6 point” and tell people to use other port.

My situation was similar. I’m going to give a break-down of the specifics in case someone has a similar issue that could provide them with the help of my solution. I have two Zigbee controllers: a Sonoff Dongle-P and HUSBZB-1 (Zigbee and Z-Wave). I have both controllers (dongles) plugged in through a 10-port USB 3.0 Hub (using USB A to A Cable Extensions of 6 inches for the purpose of extending the dongles away from the 3.0 ports as they’re known to cause interference with Zigbee dongles).

My HUSBZB is controlling my ZHA and soon to also be my Z-Wave devices. My Sonoff is to handle my Z2M (was providing this support while connected directly to my Dell Optiplex 7050 that I’m using in place of O-Droid N2+ as it has massive increase of speed over it). When I got my HUSBZB dongle I decided I would connect it and my Sonoff Dongle-P to the USB hub. While the HUSBZB connected mostly okay (had to plug in hub with nothing attaching and reboot the Optiplex from CLI), I then connected the HUSBZB and turned it on after HA finished restarting and this handled by ZHA devices mostly okay (the problems I had were the result of trying to use an old ZHA integration rather than starting fresh).

Next I plugged in my Sonoff to the USB hub (I don’t recall exactly what order I performed this in a I had been working at restoring HA from my N2+ to the Optiplex, which is a story for another day). At any rate, my Sonoff was recognized by HA in the Settings > System > Hardware, it was unable to be connected to Z2M (sort of). I say sort of because devices that I was adding to ZHA were being added to my Z2M and my Mosquitto Broker was listing the devices, allowing me to make modifications, and also see the changes to their states, but I simply couldn’t interact with Z2M. When I would go to Z2M addon (as the integration was saying the addon was turned off), the addon would remain greyed out when hitting Start and wouldn’t enable (in fact, it would list a series of log entries, but wouldn’t actually start up).

For reference, my Z2M addon has the following configuration YAML (passwords and user name changed - setting up Z2M and the Mosquitto broker are more involved than this, and a person should look this up on their part up on their own time):

data_path: /config/zigbee2mqtt
  enabled: true
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: true
  server: mqtt://core-mosquitto
  port: >-

So now that you have the back-story, here’s the moment you were waiting for - the solution (and no, I didn’t use Tasmota as I haven’t gotten to the level of doing a lot of flashing). I made sure that the Sonoff that was listed in the “Hardware” section was inside my Z2M addon. I disconnected my Sonoff, that was to be used for my Z2M, from my USB and went to the CLI and did a:

ha host reboot

This command rebooted my Dell Optiplex and HA along with it.

  • Once HA started back up, I plugged in my Sonoff Dongle to the USB Hub. At first it didn’t want to work (the addon would load, logs looked good, but when I went to the Z2M integration, it gave me a 502 unavailable error - at least pretty sure it was the 502).
  • So I did a normal restart of the HA through the Developer Tools. When HA came back up, I made sure that the add-on had automatically started and I clicked on the integration and voila, success!

Hope this tale helps some of you