Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨

Home Page:https://www.zigbee2mqtt.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zigbee2Mqtt gives me 502: Bad Gateway

dyarfaradj opened this issue · comments

What happened

I've got a CC2531 chip that I flashed with the correct firmware and it's tuning on and in the zigbee2mqtt logs I can see that it finds it. Before I had flashed the CC2531 chip Zigbee2Mqtt gave me error so I assume the chip is working fine.

When I try to open the Zigbee2Mqtt interface I get a 502: Bad Gateway and in the supervisor log I get this message:

21-10-21 11:05:39 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.5:8099 ssl:default [Connect call failed ('172.30.33.5', 8099)]

Zigbee2mqtt
Current version: 1.21.2-1

data_path: /config/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost:1883
  user: mqtt
  password: xxxxx
serial:
  port: /dev/ttyACM0
advanced:
  log_level: warn
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}
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

I've also tried with:

mqtt:
base_topic: zigbee2mqtt
server: mqtt://localhost:1883
same problem.

When I set

permit_join: true

I get this, but it still doesn't work:

What did you expect to happen

Open the GUI without any 502 error.

How to reproduce it (minimal and precise)

Start Zigbee2MQTT, go to ingress

Debug info

Zigbee2MQTT version: 1.21.2-1
Adapter hardware: CC2531
Adapter firmware version: https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip

Link to community home where I've tried different stuff that doesn't work https://community.home-assistant.io/t/zigbee2mqtt-gives-me-502-bad-gateway/348856

From your screenshot I assume you are using Home Assistant OS (potentially on a pi)? You may need to add forwarding in home assistant's configuration. I had to add the following to /config/configuration.yaml

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

From your screenshot I assume you are using Home Assistant OS (potentially on a pi)? You may need to add forwarding in home assistant's configuration. I had to add the following to /config/configuration.yaml

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

Yes, I'm running home assistant on a Pi 3. I've added those configuration and restarted the server but still same issue. What firmware did you flash the chip on?

Did you restart home assistant after the config? If not try doing so first.
I'm using a newer TI chip. (https://slae.sh/projects/cc2652/).

What url are you using to connect to HA. When I connect with homeassistant.local:8123 I can access the z2m UI. If I use 192.168.x.y:8123 I get a 401.

It may be worth increasing the log level to info or debug so see everything that is going on.

Ahh, but did you flash any firmware on to it yourself?

I'm using duckdns.org, and I've tried with the local ip. Same result...
I believe it's something with the stick maybe. I'll try to reflash and see if I can solve it

The 502 generally means the add-on didn't properly start.

The 502 generally means the add-on didn't properly start.

Yeah... tried to reflash as well no luck same issue. Do you know if there is any other addon as alternative?

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days