Zigbee2mqtt 502: badgateway

Hello
i’ve been looking at many post before to open that topic, … I’m still struggling with mqtt set up.
I’m running HA on a raspberry 4 with the native os. I installed Zigbee and connected some devices with a skyconnect USB, it works. Then I discovered mqtt, installed the mqqt broker mosquitto and zigbee2mqtt, When i launched zigbee2mqtt I get an error 502: bad gateway, My analysis is that it comes from the adapter, so I changed the adapter to ezsp. Same problem, is it linked to the fact that I’ve already zigbee devices linked to my HA , or is this a pb linked to the adapter, or ?? I need you advice, below my errors and config. any ideas ? thank you

error log
with adapter ezsp
20:56:49] INFO: Preparing to start…
[20:56:49] INFO: Socat not enabled
[20:56:51] INFO: Starting Zigbee2MQTT…
Zigbee2MQTT:info 2023-11-11 20:56:57: Logging to console and directory: ‘/config/zigbee2mqtt/log/2023-11-11.20-56-57’ filename: log.txt
Zigbee2MQTT:info 2023-11-11 20:56:57: Starting Zigbee2MQTT version 1.33.2 (commit #unknown)
Zigbee2MQTT:info 2023-11-11 20:56:57: Starting zigbee-herdsman (0.21.0)
Error: Reset error: Error: {“sequence”:-1} after 10000ms
at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:299:23
at Queue.executeNext (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:32:32)

Error log without adapter zfsp
[20:59:30] INFO: Preparing to start…
[20:59:31] INFO: Socat not enabled
[20:59:33] INFO: Starting Zigbee2MQTT…
Zigbee2MQTT:info 2023-11-11 20:59:38: Logging to console and directory: ‘/config/zigbee2mqtt/log/2023-11-11.20-59-38’ filename: log.txt
Zigbee2MQTT:info 2023-11-11 20:59:38: Starting Zigbee2MQTT version 1.33.2 (commit #unknown)
Zigbee2MQTT:info 2023-11-11 20:59:38: Starting zigbee-herdsman (0.21.0)
Zigbee2MQTT:error 2023-11-11 20:59:59: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-11-11 20:59:59: Failed to start zigbee
Zigbee2MQTT:error 2023-11-11 20:59:59: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
Zigbee2MQTT:error 2023-11-11 20:59:59: Exiting…
Zigbee2MQTT:error 2023-11-11 20:59:59: 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:103:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
at Zigbee.start (/app/lib/zigbee.ts:60:27)
at Controller.start (/app/lib/controller.ts:101:27)
at start (/app/index.js:107:5)

Configuration

ata_path: /config/zigbee2mqtt
socat:
enabled: false
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: false
mqtt:
server: mhttp://homeassistant.local:8123/
user: mqtt-user
password: xxxxx
serial:
port: /dev/ttyUSB0
adapter: ezsp
permit_join: true
frontend: true
zigbee_herdsman_debug: true
advanced:
log_level: debug

:thinking:

1 Like

Txs Krskrab, after correction same error

You don’t say how but I assume because you haven’t mentioned Zigbee2MQTT to this point you had used ZHA to do this.

(this means at this point ZHA is using your Zigbee adapter)

So you setup a MQTT broker and then went to setup Z2M?

And you now have this error. - because Zigbee2MQTT cannot open the adapter port - ZHA currently is using it. That means Z2M won’t start. Which results in

502 is ‘server error’ : bad gateway. Read: your Z2M instance isn’t starting properly.

So this…

One adapter, one integration. You can use ZHA Or Zigbee2MQTT for that coordinator stick not both.

1 Like

Thank you, I removed all linked devices, then the coordinator from ZHA.