Setup fails for Zigbee2Mqtt

If I run

sudo systemctl status zigbee2mqtt
[sudo] Passwort für openhabian: 
● zigbee2mqtt.service - Zigbee2MQTT
     Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; enabled; preset: enabled)
     Active: active (running) since Thu 2025-10-02 17:45:19 CEST; 15s ago
   Main PID: 66247 (npm start)
      Tasks: 23 (limit: 9348)
        CPU: 12.389s
     CGroup: /system.slice/zigbee2mqtt.service
             ├─66247 "npm start"
             ├─66263 sh -c "node index.js"
             └─66264 node index.js

it seems like the Zigbee is launched. Running the command like

sudo journalctl -u zigbee2mqtt.service -f
Okt 02 17:50:36 sensor-farm npm[67756]:     at process.handleQuit (/opt/zigbee2mqtt/index.js:173:13))
Okt 02 17:50:36 sensor-farm npm[67756]: [2025-10-02 17:50:36] error:         z2m: Not connected to MQTT server!
Okt 02 17:50:36 sensor-farm npm[67756]: [2025-10-02 17:50:36] error:         z2m: Cannot send message: topic: 'zigbee2mqtt/bridge/state', payload: '{"state":"offline"}
Okt 02 17:50:36 sensor-farm systemd[1]: zigbee2mqtt.service: Deactivated successfully.
Okt 02 17:50:36 sensor-farm systemd[1]: Stopped zigbee2mqtt.service - Zigbee2MQTT.
Okt 02 17:50:36 sensor-farm systemd[1]: zigbee2mqtt.service: Consumed 12.585s CPU time.
Okt 02 17:50:36 sensor-farm systemd[1]: Started zigbee2mqtt.service - Zigbee2MQTT.
Okt 02 17:50:38 sensor-farm npm[67846]: > zigbee2mqtt@1.42.0 start
Okt 02 17:50:38 sensor-farm npm[67846]: > node index.js
Okt 02 17:50:38 sensor-farm npm[67860]: Starting Zigbee2MQTT without watchdog.
Okt 02 17:51:05 sensor-farm npm[67860]: [2025-10-02 17:51:05] error:         z2m: Error while starting zigbee-herdsman
Okt 02 17:51:05 sensor-farm npm[67860]: [2025-10-02 17:51:05] error:         z2m: Failed to start zigbee
Okt 02 17:51:05 sensor-farm npm[67860]: [2025-10-02 17:51:05] error:         z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Okt 02 17:51:05 sensor-farm npm[67860]: [2025-10-02 17:51:05] error:         z2m: Exiting...
Okt 02 17:51:05 sensor-farm npm[67860]: [2025-10-02 17:51:05] error:         z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
Okt 02 17:51:05 sensor-farm npm[67860]:     at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:113:27)
Okt 02 17:51:05 sensor-farm npm[67860]:     at Controller.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
Okt 02 17:51:05 sensor-farm npm[67860]:     at Zigbee.start (/opt/zigbee2mqtt/lib/zigbee.ts:69:27)
Okt 02 17:51:05 sensor-farm npm[67860]:     at Controller.start (/opt/zigbee2mqtt/lib/controller.ts:161:27)
Okt 02 17:51:05 sensor-farm npm[67860]:     at start (/opt/zigbee2mqtt/index.js:154:5)
Okt 02 17:51:05 sensor-farm systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE

it seems it cannot reach the Zigbee-stick

Okt 02 18:28:34 sensor-farm npm[4460]: Starting Zigbee2MQTT without watchdog.
Okt 02 18:29:01 sensor-farm npm[4460]: [2025-10-02 18:29:01] error:         z2m: Error while starting zigbee-herdsman
Okt 02 18:29:01 sensor-farm npm[4460]: [2025-10-02 18:29:01] error:         z2m: Failed to start zigbee
Okt 02 18:29:01 sensor-farm npm[4460]: [2025-10-02 18:29:01] error:         z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Okt 02 18:29:01 sensor-farm npm[4460]: [2025-10-02 18:29:01] error:         z2m: Exiting...
Okt 02 18:29:01 sensor-farm npm[4460]: [2025-10-02 18:29:01] error:         z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
Okt 02 18:29:01 sensor-farm npm[4460]:     at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:113:27)
Okt 02 18:29:01 sensor-farm npm[4460]:     at Controller.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
Okt 02 18:29:01 sensor-farm npm[4460]:     at Zigbee.start (/opt/zigbee2mqtt/lib/zigbee.ts:69:27)
Okt 02 18:29:01 sensor-farm npm[4460]:     at Controller.start (/opt/zigbee2mqtt/lib/controller.ts:161:27)
Okt 02 18:29:01 sensor-farm npm[4460]:     at start (/opt/zigbee2mqtt/index.js:154:5)
Okt 02 18:29:01 sensor-farm systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Okt 02 18:29:01 sensor-farm systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'.
Okt 02 18:29:01 sensor-farm systemd[1]: zigbee2mqtt.service: Consumed 12.576s CPU time.
Okt 02 18:29:01 sensor-farm systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 14.
Okt 02 18:29:01 sensor-farm systemd[1]: Stopped zigbee2mqtt.service - Zigbee2MQTT.
Okt 02 18:29:01 sensor-farm systemd[1]: zigbee2mqtt.service: Consumed 12.576s CPU time.
Okt 02 18:29:01 sensor-farm systemd[1]: Started zigbee2mqtt.service - Zigbee2MQTT.
Okt 02 18:29:03 sensor-farm npm[4615]: > zigbee2mqtt@1.42.0 start
Okt 02 18:29:03 sensor-farm npm[4615]: > node index.js

Hmmm, what more information are useful? I’ve connected a USB-stick

 port: 8081
homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
  user: openhabian
  password: openhabian
serial:
  port: >-
    /dev/serial/by-id/usb-SMLIGHT_SMLIGHT_SLZB-07_5480766aa418f01193056a7db887153e-if00-port0
advanced:
  network_key:

Any hints?

The first error is that no mqtt-server is found. did you install mosquitto and is it running?

What’s the result of ls -l /dev/serial/by-id

Some outputs:

sudo journalctl -u mosquitto.service -f
Okt 03 08:04:42 sensor-farm systemd[1]: Starting mosquitto.service - Mosquitto MQTT Broker...
Okt 03 08:04:43 sensor-farm systemd[1]: Started mosquitto.service - Mosquitto MQTT Broker.

sudo ss -tuln|grep 1883
tcp   LISTEN 0      100                   0.0.0.0:1883       0.0.0.0:*          
tcp   LISTEN 0      100                      [::]:1883          [::]:*      
sudo systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT Broker
     Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-10-03 08:04:43 CEST; 1h 18min ago
       Docs: man:mosquitto.conf(5)
             man:mosquitto(8)
   Main PID: 592 (mosquitto)
      Tasks: 1 (limit: 9348)
        CPU: 2.009s
     CGroup: /system.slice/mosquitto.service
             └─592 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

ls -l /dev/serial/by-id/
insgesamt 0
lrwxrwxrwx 1 root root 13  3. Okt 07:17 usb-SMLIGHT_SMLIGHT_SLZB-07_5480766aa418f01193056a7db887153e-if00-port0 -> ../../ttyUSB0

Anything else I can check?

hmm, your right. It seems the stick cannot be reached.
You could directly enter /dev/ttyUSB0 in configuration.yaml.
Have you tried a different usb port? Did the stick work before?

I tried to specify the stick directly like

serial:
  port: >-
    /dev/ttyUSB0

as well as using a different USB-port. Results are the same.

Don’t know what you are asking for. I get the sensor states via Zigbee and they are displayed (although I’m not quite sure about their update interval). Therefore I would say “It worked before” - but in sense of the Mqtt - I didn’t test before because this is my first install of the broker.

Why is is like this?

port: >-

Shouldn’t it be:

port: /dev/serial/by-id/usb-SMLIGHT_SMLIGHT_SLZB-07_5480766aa418f01193056a7db887153e-if00-port0

The result must be the same. Its the syntax of yaml-files when not everything fits into one line. You could therefore start multiline code.

Are you running zigbee2mqtt as user root?

Not that I’m aware of. I just run the “regular” install scripts - and then little bit of checking as root.

Should it be run as root? If so how to check and/or adapt it?

It doesn’t have to run as root.
On my system it has a systemd service and the user is selected in there.
/etc/systemd/system/zigbee2mqtt.service

Hmmm…. I have openhabian selected as user

sudo cat /etc/systemd/system/zigbee2mqtt.service 
[sudo] Passwort für openhabian: 
[Unit]
Description=Zigbee2MQTT
After=network.target

[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=/opt/zigbee2mqtt
StandardOutput=inherit
# Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5)
StandardError=inherit
Restart=always
User=openhabian

[Install]
WantedBy=multi-user.target

with the followup details

groups openhabian
openhabian : openhab adm tty dialout cdrom sudo audio video plugdev games users input render bluetooth netdev spi i2c gpio openhabian mosquitto

It “should” work then.
Change the user to root and start it just to see what happens?

where are they displayed? in the UI on port 8081?

I changed it to root and did the following

$ sudo systemctl daemon-reload
/opt/zigbee2mqtt/data $ sudo systemctl restart zigbee2mqtt 
/opt/zigbee2mqtt/data $ sudo journalctl -u zigbee2mqtt.service -f

but the results are the same :frowning:

In the UI as a Zigbee device. The port 8081 is not up and nobody runs it.

ahh. The stick has it’s own UI. Don’t know those. Your sure that you can run both in parallel or is the device blocked by your UI?

Honestly I don’t know. I was thinking that I can run Zigbee coordinator AND the mosquitto broker at the same time, meaning connect what I can connect with Zigbee and in case I need MQTT I connect with the MQTT broker.

Hmmm… don’t know if the stick has its own UI. I was guessing that the Z2M would rather use it - but honestly that’s more guessing and I don’t know if my ideas could be working perfectly together.
Matter of fact is that the Zigbee2Matter broker doesn’t run.

Of course, you even have to. But there seems to be a misunderstanding. The coordinator is your hardware. z2m connects your coordinator to the mqtt broker which connects to openhab.

You said you can see the sensor states. Where? In openhab? Which OS are you on? Are you using openhabian? Docker? …
You cannot run the zigbee binding and z2m in parallel on the same stick.
But without knowing the setup it’s hard to understand.

Lots of examples for z2m can be found here:
https://community.openhab.org/t/zigbee2mqtt-revisited-no-more-ugly-transformations/86362

edit: Another way is of course to use the autodetect option in mqtt. But I tried it long time ago without success. So I have no experience how it’s working now.

Thanks for clarifications

I have installed on my Pi4, 8GB, Openhabian 5.0.1. Although the intro message says

 Platform = BCM43455 37.4MHz Raspberry Pi 3+-0190

I double checked that its version 1.4. I’ve plugged into the Pi the SLZB-07 directly but moved it now to an extra USB-hub since it seems like it losses after a certain time the connection to my temperature sensor. The temperature is displayed within Openhabian and I don’t know where else to display the values.

The temperature sensor is connected via Zigbee binding from Openhabian.

Please let me know what kind of additional information is required or useful.

The reasons why I tried to run z2m is that I want to display the LinkQuality of my sensors (to see how good they are reachable). If there is another way to get that kind of information I can ask in another thread or perhaps it exists one already.

But I don’t know definitely which config is possible and which makes sense. Since I’ve just chosen the option on the openhabian-configwithout any further notice that it won’t make any sense I’m still assuming that its possible.

You cannot use both at the same time. it’s either the zigbee binding or zigbee2mqtt.
You have to decide. Both want the zigbee stick exclusively. If you de-install the binding and restart zigbee2mqtt it will probably start

zigbee2mqtt has more functions, more control and supports more hardware but is harder to configure as you’ve got the additional mqtt-layer.

Thanks for clarification. Perhaps this could be more clear on the installation page.