zigbee2mqtt-frontend
zigbee2mqtt-frontend copied to clipboard
[Bug]: 502: Bad Gateway
What happened?
Raspberry PI 4 (32-bit) Home Assistant 2022.8.4 Supervisor 2022.08.3 Operating System 8.4 Frontend 20220802.0 - latest ConBee II usb
Zigbee2MQTT Current version: 1.27.0-1
Configuration:
data_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: mqtt://mqtt.basement.lab:1883
serial:
port: /dev/ttyACM0
advanced:
channel: 15
Z2M portal gives a "502: bad gateway" error.
Netstat does not show anything bound to 8485 and curl to http or https returns a failed to connect.
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.11:42551 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8099 0.0.0.0:* LISTEN
tcp 0 232 172.30.33.0:22 192.168.1.17:28193 ESTABLISHED
tcp 0 0 :::22 :::* LISTEN
udp 0 0 127.0.0.11:46403 0.0.0.0:*
I tried switching to the dev branch but that branch the app doesn't even start or produce any logs.
At first when I started the app it started up fine and no other error had shown up... I was going to attach the log to show it, but seems after a bit there are now errors connecting to the adapter...
> [email protected] start
> node index.js
Zigbee2MQTT:info 2022-08-14 10:47:12: Logging to console and directory: '/config/zigbee2mqtt/log/2022-08-14.10-47-11' filename: log.txt
Zigbee2MQTT:info 2022-08-14 10:47:12: Starting Zigbee2MQTT version 1.27.0 (commit #unknown)
Zigbee2MQTT:info 2022-08-14 10:47:12: Starting zigbee-herdsman (0.14.46)
Zigbee2MQTT:error 2022-08-14 10:47:32: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-08-14 10:47:32: Failed to start zigbee
Zigbee2MQTT:error 2022-08-14 10:47:32: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-08-14 10:47:32: Exiting...
Zigbee2MQTT:error 2022-08-14 10:47:32: 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:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:131:29)
at Zigbee.start (/app/lib/zigbee.ts:58:27)
at Controller.start (/app/lib/controller.ts:101:27)
at start (/app/index.js:109:5)
[10:47:34] INFO: Handing over control to Zigbee2MQTT Core ...
> [email protected] start
> node index.js
Zigbee2MQTT:info 2022-08-14 10:47:40: Logging to console and directory: '/config/zigbee2mqtt/log/2022-08-14.10-47-40' filename: log.txt
Zigbee2MQTT:info 2022-08-14 10:47:41: Starting Zigbee2MQTT version 1.27.0 (commit #unknown)
Zigbee2MQTT:info 2022-08-14 10:47:41: Starting zigbee-herdsman (0.14.46)
Relevant hardware info:
Subsystem: tty Device path: /dev/ttyACM0
DEVLINKS: >-
/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2495710-if00
/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0
DEVNAME: /dev/ttyACM0
DEVPATH: >-
/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/tty/ttyACM0
ID_BUS: usb
ID_MODEL: ConBee_II
ID_MODEL_ENC: ConBee\x20II
ID_MODEL_ID: '0030'
ID_PATH: platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0
ID_PATH_TAG: platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_3_1_0
ID_REVISION: '0100'
ID_SERIAL: dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2495710
ID_SERIAL_SHORT: DE2495710
ID_TYPE: generic
ID_USB_DRIVER: cdc_acm
ID_USB_INTERFACES: ':020201:0a0000:'
ID_USB_INTERFACE_NUM: '00'
ID_VENDOR: dresden_elektronik_ingenieurtechnik_GmbH
ID_VENDOR_ENC: dresden\x20elektronik\x20ingenieurtechnik\x20GmbH
ID_VENDOR_ID: 1cf1
MAJOR: '166'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '33385911816'
What browsers are you seeing the problem on?
Firefox
Relevant stacktrace
Zigbee2MQTT:error 2022-08-14 10:47:32: 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:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:131:29)
at Zigbee.start (/app/lib/zigbee.ts:58:27)
at Controller.start (/app/lib/controller.ts:101:27)
at start (/app/index.js:109:5)
Did you download state.json.zip?
I will not attach state.json.zip
EDIT: Fixed the wrong port being used ... $ test -w /dev/ttyACM0 && echo success || echo failure success
An update -- found a thread discussion the disconnect/reconnect issue. This was solved by following this page: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually and updating to deCONZ_RaspBeeII_0x26780700.bin.GCF. Sadly the Z2M is still failing with the same error as above.
After updating the firmware I was able to get the edge version starting as well ... same error though:
> [email protected] start
> node index.js
Zigbee2MQTT:info 2022-08-14 17:50:54: Logging to console and directory: '/config/zigbee2mqtt/log/2022-08-14.17-50-54' filename: log.txt
Zigbee2MQTT:info 2022-08-14 17:50:55: Starting Zigbee2MQTT version 1.27.0-dev (commit #36a4754)
Zigbee2MQTT:info 2022-08-14 17:50:55: Starting zigbee-herdsman (0.14.47)
Zigbee2MQTT:error 2022-08-14 17:51:15: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-08-14 17:51:15: Failed to start zigbee
Zigbee2MQTT:error 2022-08-14 17:51:15: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-08-14 17:51:15: Exiting...
Zigbee2MQTT:error 2022-08-14 17:51:15: 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:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:131:29)
at Zigbee.start (/app/lib/zigbee.ts:58:27)
at Controller.start (/app/lib/controller.ts:101:27)
at start (/app/index.js:109:5)
[17:51:17] INFO: Handing over control to Zigbee2MQTT Core ...
> [email protected] start
> node index.js
Zigbee2MQTT:info 2022-08-14 17:51:24: Logging to console and directory: '/config/zigbee2mqtt/log/2022-08-14.17-51-24' filename: log.txt
Zigbee2MQTT:info 2022-08-14 17:51:24: Starting Zigbee2MQTT version 1.27.0-dev (commit #36a4754)
Zigbee2MQTT:info 2022-08-14 17:51:24: Starting zigbee-herdsman (0.14.47)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, Same Issue, with same Device:
[12:04:01] INFO: Preparing to start... [12:04:02] INFO: Socat not enabled [12:04:05] INFO: Starting Zigbee2MQTT... Zigbee2MQTT:info 2022-11-13 12:04:11: Logging to console and directory: '/config/zigbee2mqtt/log/2022-11-13.12-04-11' filename: log.txt Zigbee2MQTT:info 2022-11-13 12:04:11: Starting Zigbee2MQTT version 1.28.2 (commit #unknown) Zigbee2MQTT:info 2022-11-13 12:04:11: Starting zigbee-herdsman (0.14.68) Zigbee2MQTT:error 2022-11-13 12:04:32: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-11-13 12:04:32: Failed to start zigbee Zigbee2MQTT:error 2022-11-13 12:04:32: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-11-13 12:04:32: Exiting... Zigbee2MQTT:error 2022-11-13 12:04:32: 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:58:27) at Controller.start (/app/lib/controller.ts:101:27) at start (/app/index.js:109:5)
@jpgaiffas this is closed,. you may want to open a new issue and reference this one. I got mine working as a bunch of try-and-fails so I'm not sure if this is the 100% solution or not but add adapter: deconz to the serial segment.
serial:
adapter: deconz
port: /dev/ttyACM0
Also, if you're not getting the immediate connection error wait for 3-5 minutes after the bad gateway and it may actually respond ... mine took about 3 minutes after start of the pi to recognize and talk to the stick for the first time, every time after that it's within 30 seconds.