# Zigbee2MQTT - 502 Bad gateway

**URL:** <https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325>\
**Category:** Entraide Home Assistant\
**Created:** [Juillet 12, 2022, 8:23 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325 "2022-07-12T20:23:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 12, 2022, 8:23 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/1 "2022-07-12T20:23:05Z")

</div>

Bonjour,

J'ai récemment installé Zigbee2Mqtt & Mosquitto broker mais je ne parviens pas à démarrer Zigbee2MQTT.

Lorsque j'essaye d'accéder à Zigbee2MQTT, il m'affiche erreur 502 bad gateway.

## System Health

| version | core-2022.7.3 |
| --- | --- |
| installation\_type | Home Assistant OS |
| dev | false |
| hassio | true |
| docker | true |
| user | root |
| virtualenv | false |
| python\_version | 3.10.5 |
| os\_name | Linux |
| os\_version | 5.15.32-v8 |
| arch | aarch64 |
| timezone | Europe/Brussels |
| config\_dir | /config |

> **Home Assistant Community Store**
>
> | GitHub API | ok |
> | --- | --- |
> | GitHub Content | ok |
> | GitHub Web | ok |
> | GitHub API Calls Remaining | 5000 |
> | Installed Version | 1.26.0 |
> | Stage | running |
> | Available Repositories | 1139 |
> | Downloaded Repositories | 5 |

> **Home Assistant Cloud**
>
> | logged\_in | false |
> | --- | --- |
> | can\_reach\_cert\_server | ok |
> | can\_reach\_cloud\_auth | ok |
> | can\_reach\_cloud | ok |

> **Home Assistant Supervisor**
>
> | host\_os | Home Assistant OS 8.2 |
> | --- | --- |
> | update\_channel | stable |
> | supervisor\_version | supervisor-2022.07.0 |
> | agent\_version | 1.2.1 |
> | docker\_version | 20.10.14 |
> | disk\_total | 58.0 GB |
> | disk\_used | 7.7 GB |
> | healthy | true |
> | supported | true |
> | board | rpi3-64 |
> | supervisor\_api | ok |
> | version\_api | ok |
> | installed\_addons | Terminal & SSH (9.6.0), Samba share (10.0.0), File editor (5.3.3), Duck DNS (1.15.0), Mosquitto broker (6.1.2), Zigbee2MQTT (1.26.0-1) |

> **Dashboards**
>
> | dashboards | 2 |
> | --- | --- |
> | resources | 2 |
> | views | 4 |
> | mode | storage |

> **Recorder**
>
> | oldest\_recorder\_run | July 4, 2022 at 5:55 PM |
> | --- | --- |
> | current\_recorder\_run | July 12, 2022 at 8:51 PM |
> | estimated\_db\_size | 119.38 MiB |
> | database\_engine | sqlite |
> | database\_version | 3.38.5 |

> **Spotify**
>
> | api\_endpoint\_reachable | ok |
> | --- | --- |

Voici le log de Mosquitto :

```auto
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[20:30:37] INFO: SSL is not enabled
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:30:40] INFO: Starting NGINX for authentication handling...
[20:30:41] INFO: Starting mosquitto MQTT broker...
1657650641: Warning: Mosquitto should not be run as root/administrator.
[20:30:46] INFO: Successfully send discovery information to Home Assistant.
[20:30:47] INFO: Successfully send service information to the Supervisor.
1657650641: mosquitto version 2.0.11 starting
1657650641: Config loaded from /etc/mosquitto/mosquitto.conf.
1657650641: Loading plugin: /usr/share/mosquitto/go-auth.so
1657650641: ├── Username/password checking enabled.
1657650641: ├── TLS-PSK checking enabled.
1657650641: └── Extended authentication not enabled.
1657650641: Opening ipv4 listen socket on port 1883.
1657650641: Opening ipv6 listen socket on port 1883.
1657650641: Opening websockets listen socket on port 1884.
1657650641: mosquitto version 2.0.11 running
1657650642: New connection from 127.0.0.1:59486 on port 1883.
1657650642: Client <unknown> closed its connection.
1657650644: New connection from 172.30.32.1:56275 on port 1883.
1657650644: New client connected from 172.30.32.1:56275 as 4nHK8b1vYlbQ6Czjk7Lgp7 (p2, c1, k60, u'homeassistant').
1657650665: New connection from 172.30.32.2:54052 on port 1883.
1657650665: Client <unknown> closed its connection.
1657650785: New connection from 172.30.32.2:54054 on port 1883.
1657650785: Client <unknown> closed its connection.
1657650905: New connection from 172.30.32.2:54056 on port 1883.
1657650905: Client <unknown> closed its connection.
1657651025: New connection from 172.30.32.2:54058 on port 1883.
1657651025: Client <unknown> closed its connection.

```

Le log de Zigbee2MQTT :

```auto
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/socat.sh
[21:32:39] INFO: Socat not enabled, marking service as down
cont-init: info: /etc/cont-init.d/socat.sh exited 0
cont-init: info: running /etc/cont-init.d/zigbee2mqtt.sh
cont-init: info: /etc/cont-init.d/zigbee2mqtt.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun socat (no readiness notification)
services-up: info: copying legacy longrun zigbee2mqtt (no readiness notification)
[21:32:47] INFO: Handing over control to Zigbee2MQTT Core ...
> zigbee2mqtt@1.26.0 start
> node index.js
Zigbee2MQTT:info 2022-07-12 21:33:00: Logging to console and directory: '/config/zigbee2mqtt/log/2022-07-12.21-33-00' filename: log.txt
Zigbee2MQTT:info 2022-07-12 21:33:01: Starting Zigbee2MQTT version 1.26.0 (commit #unknown)
Zigbee2MQTT:info 2022-07-12 21:33:01: Starting zigbee-herdsman (0.14.40)
Zigbee2MQTT:error 2022-07-12 21:33:12: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-07-12 21:33:12: Failed to start zigbee
Zigbee2MQTT:error 2022-07-12 21:33:12: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-07-12 21:33:12: Exiting...
Zigbee2MQTT:error 2022-07-12 21:33:12: undefined

```

Configuration de Zigbee2MQTT :

 ![image](https://forum.hacf.fr/uploads/default/original/2X/e/eb27579b9a73b681c79d5049de1fefef4b5bbc7a.png)  
Socat tcp-listen port : 8485

J'ai passé les 2 derniers jour à essayer de trouver une solution mais malheureusement en vain.  
J'ai vu que l'erreur 502 était une erreur "générique" qui pouvait être différente, dans mon cas je vois qu'il n'arrive pas à lancer zigbee-herdsman.

J'ai une clé Conbee II et une prise zigbee "Nous" achetées toutes les 2 il y a une semaine.

N'hésitez pas à me demander plus d'information.

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juillet 12, 2022, 9:36 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/2 "2022-07-12T21:36:49Z")

</div>

Salut  
As-tu essayé en ajoutant le port `:1883` à la fin de la ligne sur serveur mqtt ?

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 13, 2022, 6:29 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/3 "2022-07-13T06:29:48Z")

</div>

Je viens d’essayer, l’erreur est maintenant légèrement différente :

```auto
[08:22:34] INFO: Handing over control to Zigbee2MQTT Core ...
> zigbee2mqtt@1.26.0 start
> node index.js
Zigbee2MQTT:info 2022-07-13 08:22:49: Logging to console and directory: '/config/zigbee2mqtt/log/2022-07-13.08-22-49' filename: log.txt
Zigbee2MQTT:info 2022-07-13 08:22:50: Starting Zigbee2MQTT version 1.26.0 (commit #unknown)
Zigbee2MQTT:info 2022-07-13 08:22:50: Starting zigbee-herdsman (0.14.40)
Zigbee2MQTT:info 2022-07-13 08:22:51: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2022-07-13 08:22:51: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info 2022-07-13 08:22:51: Currently 0 devices are joined:
Zigbee2MQTT:info 2022-07-13 08:22:51: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2022-07-13 08:22:51: Connecting to MQTT server at mqtt://core-mosquitto:1883
Zigbee2MQTT:error 2022-07-13 08:22:52: MQTT failed to connect: Connection refused: Not authorized
Zigbee2MQTT:error 2022-07-13 08:22:52: Exiting...
Zigbee2MQTT:info 2022-07-13 08:22:52: Stopping zigbee-herdsman...
Zigbee2MQTT:info 2022-07-13 08:22:52: Stopped zigbee-herdsman

```

Il indique un problème d’autorisation

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juillet 13, 2022, 6:49 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/4 "2022-07-13T06:49:34Z")

</div>

OK donc maintenant que le serveur est joignable, c’est un souci de user/password plutôt

---

<div class="post-metadata">

**Author:** ![Pozzi](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pozzi/32/402_2.png) [@Pozzi](https://forum.hacf.fr/u/Pozzi)\
**Post date:** [Juillet 13, 2022, 10:17 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/5 "2022-07-13T10:17:08Z")

</div>

Vu que tu utilises HA Os et l’adon Mosquito, tu n’as pas besoin de renseigner le user/pwd, il utilisera un compte technique automatiquement.  
Et tu as juste à préciser base\_topic: zigbee2mqtt dans la zone mqtt.

---

<div class="post-metadata">

**Author:** ![bricodx](https://forum.hacf.fr/user_avatar/forum.hacf.fr/bricodx/32/10941_2.png) [@bricodx](https://forum.hacf.fr/u/bricodx)\
**Post date:** [Juillet 13, 2022, 10:34 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/6 "2022-07-13T10:34:17Z")

</div>

Es tu certain de cela ??? J’utilise HA OS et j’ai bien un USER et PASSWORD dans la config mqtt de zigbee2mqtt.  
Ce login et ce mdp sont ceux définis dans la partie LOGINS de la configuration de Mosquitto

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 13, 2022, 10:52 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/7 "2022-07-13T10:52:42Z")

</div>

Fausse joie, j'ai enlever user & password et également enlever server: mqtt://core-mosquitto:1883, ça a fonctionné quelque instants, j'ai pu lancer Zigbee2MQTT après une minute, j'ai de nouveau l'erreur 502 😕...

Voici le dernier log de Mosquitto :

```auto
1657708029: New connection from 172.30.32.2:55058 on port 1883.
1657708029: Client <unknown> closed its connection.
1657708140: Client 5O8s8qbXxzWuv6XFBkgY4R closed its connection.
1657708143: New connection from 172.30.33.3:57288 on port 1883.
error: received null username or password for unpwd check
1657708143: Client <unknown> disconnected, not authorised.
1657708149: New connection from 172.30.32.2:55062 on port 1883.
1657708149: Client <unknown> closed its connection.
1657708166: New connection from 172.30.33.3:57290 on port 1883.
error: received null username or password for unpwd check
1657708166: Client <unknown> disconnected, not authorised.
1657708192: New connection from 172.30.33.3:57292 on port 1883.
error: received null username or password for unpwd check
1657708192: Client <unknown> disconnected, not authorised.
1657708217: New connection from 172.30.33.3:57294 on port 1883.
error: received null username or password for unpwd check

```

Le log de Zigbee2MQTT

```auto
[12:45:03] INFO: Handing over control to Zigbee2MQTT Core ...
> zigbee2mqtt@1.26.0 start
> node index.js
Zigbee2MQTT:info 2022-07-13 12:45:16: Logging to console and directory: '/config/zigbee2mqtt/log/2022-07-13.12-45-16' filename: log.txt
Zigbee2MQTT:info 2022-07-13 12:45:16: Starting Zigbee2MQTT version 1.26.0 (commit #unknown)
Zigbee2MQTT:info 2022-07-13 12:45:16: Starting zigbee-herdsman (0.14.40)
Zigbee2MQTT:error 2022-07-13 12:45:27: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-07-13 12:45:27: Failed to start zigbee
Zigbee2MQTT:error 2022-07-13 12:45:27: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-07-13 12:45:27: Exiting...
Zigbee2MQTT:error 2022-07-13 12:45:27: undefined

```

Mosquitto à l'air d'avoir un problème au niveau du user & password.  
Du côté de Zigbee2MQTT il n'arrive de nouveau pas à lancer zigbee-herdsman...

Dans les intégrations, losrque je vais dans Mosquitto broker =\> Configure =\> Re-configure MQTT, j'ai ceci :

 ![image](https://forum.hacf.fr/uploads/default/original/2X/5/529a68787e6d8ce14cd239363e1709e9da4476c3.png)

Je ne sais pas si c'est à changer... ?

---

<div class="post-metadata">

**Author:** ![bricodx](https://forum.hacf.fr/user_avatar/forum.hacf.fr/bricodx/32/10941_2.png) [@bricodx](https://forum.hacf.fr/u/bricodx)\
**Post date:** [Juillet 13, 2022, 11:31 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/8 "2022-07-13T11:31:31Z")

</div>

houla ne mélange pas tout. tu n’arrives pas à démarrer zigbee2mqtt donc tu reconfigures Mosquitto ???

l’erreur 502 signifie que Z2m n’a pas terminé sa procédure de démarrage parce qu’il a rencontré une erreur. donc si tu ne le configures pas comme il faut, tu peux toujours tout modifier dans ton HA, il ne démarrera pas pour autant.

Comme tu as touché à la config mosquitto, il t’indique maintenant qu’il y a une erreur car tu n’as pas configuré un USER et un MDP.

> [@AnthonyD](#):
>
> `error: received null username or password for unpwd check`

donc commence par mettre ces deux éléments en place.  
Ensuite tu redémarres ton Mosquitto

puis tu configures ces même USER et MDP dans la partie MQTT de Z2M.  
Tu finis par redémarrer ton Z2M

---

<div class="post-metadata">

**Author:** ![Pozzi](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pozzi/32/402_2.png) [@Pozzi](https://forum.hacf.fr/u/Pozzi)\
**Post date:** [Juillet 13, 2022, 11:43 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/9 "2022-07-13T11:43:30Z")

</div>

pas besoin :

 ![image](https://forum.hacf.fr/uploads/default/original/2X/4/44b2801534d730a4ccf551a482b0f0a28d467a9e.png)

---

<div class="post-metadata">

**Author:** ![bricodx](https://forum.hacf.fr/user_avatar/forum.hacf.fr/bricodx/32/10941_2.png) [@bricodx](https://forum.hacf.fr/u/bricodx)\
**Post date:** [Juillet 13, 2022, 11:53 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/10 "2022-07-13T11:53:26Z")

</div>

> [@AnthonyD](#):
>
> ```auto
> 1657708029: New connection from 172.30.32.2:55058 on port 1883.
> 1657708029: Client <unknown> closed its connection.
> 1657708140: Client 5O8s8qbXxzWuv6XFBkgY4R closed its connection.
> 1657708143: New connection from 172.30.33.3:57288 on port 1883.
> error: received null username or password for unpwd check
> 1657708143: Client <unknown> disconnected, not authorised.
> 1657708149: New connection from 172.30.32.2:55062 on port 1883.
> 1657708149: Client <unknown> closed its connection.
> 1657708166: New connection from 172.30.33.3:57290 on port 1883.
> error: received null username or password for unpwd check
> 1657708166: Client <unknown> disconnected, not authorised.
> 1657708192: New connection from 172.30.33.3:57292 on port 1883.
> error: received null username or password for unpwd check
> 1657708192: Client <unknown> disconnected, not authorised.
> 1657708217: New connection from 172.30.33.3:57294 on port 1883.
> error: received null username or password for unpwd check
> 
> ```

qu’il soit automatique ou pas, si Z2M n’utilise pas les mêmes paramètres que Mosquitto, ça pause problème puisque mosquitto refuse la connexion de Z2M.

@AnthonyD que tu utilises une méthode ou l’autre, il faut que les deux possèdent les même paramètres

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 13, 2022, 6:01 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/11 "2022-07-13T18:01:54Z")

</div>

> [@bricodx](#):
>
> tu n’arrives pas à démarrer zigbee2mqtt donc tu reconfigures Mosquitto ???

Dans l’image que j’ai montrée «&nbsp;Broker options&nbsp;» je n’ai rien touché, je voulais juste être certain que je pouvais laisser ces informations et que je ne devais rien modifier.

Zigbee2MQTT fonctionne de nouveau (alors que je n’ai absolument rien modifier depuis ce midi)

Voici le log Zigbee2MQTT

```auto
[16:39:41] INFO: Handing over control to Zigbee2MQTT Core ...
> zigbee2mqtt@1.26.0 start
> node index.js
Zigbee2MQTT:info 2022-07-13 16:39:59: Logging to console and directory: '/config/zigbee2mqtt/log/2022-07-13.16-39-59' filename: log.txt
Zigbee2MQTT:info 2022-07-13 16:40:00: Starting Zigbee2MQTT version 1.26.0 (commit #unknown)
Zigbee2MQTT:info 2022-07-13 16:40:00: Starting zigbee-herdsman (0.14.40)
Zigbee2MQTT:info 2022-07-13 16:40:01: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2022-07-13 16:40:01: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info 2022-07-13 16:40:01: Currently 0 devices are joined:
Zigbee2MQTT:info 2022-07-13 16:40:01: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2022-07-13 16:40:01: Connecting to MQTT server at mqtt://core-mosquitto:1883
Zigbee2MQTT:info 2022-07-13 16:40:04: Connected to MQTT server
Zigbee2MQTT:info 2022-07-13 16:40:04: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info 2022-07-13 16:40:04: Started frontend on port 0.0.0.0:8099
Zigbee2MQTT:info 2022-07-13 16:40:04: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"unknown","coordinator":{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"},"log_level":"info","network":{"channel":11,"extendedPanID":"0xdddddddddddddddd","panID":6754},"permit_join":false,"version":"1.26.0"}'
Zigbee2MQTT:info 2022-07-13 16:40:04: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'

```

J’ai pu ajouter ma prise zigbee à Zigbee2MQTT, j’ai redémarré HA afin de voir si ça allait de nouveau m’afficher l’erreur 502 mais pour le moment ça tient…

Je préfère ne pas y toucher pour le moment et voir si ça reste comme ça.  
Si ça ne pose pas de problème je souhaiterais laisser le post ouvert quelques jours.

Déjà un grand merci pour votre aide 🙂

---

<div class="post-metadata">

**Author:** ![bricodx](https://forum.hacf.fr/user_avatar/forum.hacf.fr/bricodx/32/10941_2.png) [@bricodx](https://forum.hacf.fr/u/bricodx)\
**Post date:** [Juillet 14, 2022, 4:06 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/12 "2022-07-14T16:06:19Z")

</div>

normalement si la connexion se fait, c’est que toute la config est bonne. Donc en théorie ça ne devrait pas bouger 😉

A+ Fred

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 17, 2022, 6:45 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/13 "2022-07-17T18:45:02Z")

</div>

Ca fait maintenant plusieurs jours que l'accès à MQTT se fait et est stable.  
Merci beaucoup à Pulpy, Pozzi et bricodx pour votre aide.

Pour ceux qui ont le même problème et qui tombent sur ce topic, voici le dernier print screen de ma configuration Zigbee2MQTT :

 ![image](https://forum.hacf.fr/uploads/default/original/2X/c/c10db5f29315340e80fd30847827da7e04412639.png)

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Juillet 19, 2022, 7:19 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/15 "2022-07-19T19:19:56Z")

</div>

Mauvaise nouvelle, je n’ai rien changé à la configuration de Zigbee2MQTT (voir photo dans mon précédent post) ni à Mosquitto mais j’ai de nouveau l’erreur 502.  
Mosquitto n’affiche aucun problème dans les logs (à part qu’il ne faut pas l’exécuter comme administrateur) :

```auto
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[20:50:57] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:50:59] INFO: Starting NGINX for authentication handling...
[20:51:00] INFO: Starting mosquitto MQTT broker...
1658256660: Warning: Mosquitto should not be run as root/administrator.
[20:51:05] INFO: Successfully send discovery information to Home Assistant.
[20:51:06] INFO: Successfully send service information to the Supervisor.

```

Log Zigbee2MQTT :

```auto
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/socat.sh
[21:14:13] INFO: Socat not enabled, marking service as down
cont-init: info: /etc/cont-init.d/socat.sh exited 0
cont-init: info: running /etc/cont-init.d/zigbee2mqtt.sh
cont-init: info: /etc/cont-init.d/zigbee2mqtt.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun socat (no readiness notification)
services-up: info: copying legacy longrun zigbee2mqtt (no readiness notification)
[21:14:22] INFO: Handing over control to Zigbee2MQTT Core ...
> zigbee2mqtt@1.26.0 start
> node index.js
Zigbee2MQTT:info 2022-07-19 21:14:37: Logging to console and directory: '/config/zigbee2mqtt/log/2022-07-19.21-14-36' filename: log.txt
Zigbee2MQTT:info 2022-07-19 21:14:37: Starting Zigbee2MQTT version 1.26.0 (commit #unknown)
Zigbee2MQTT:info 2022-07-19 21:14:37: Starting zigbee-herdsman (0.14.40)
Zigbee2MQTT:error 2022-07-19 21:14:48: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-07-19 21:14:48: Failed to start zigbee
Zigbee2MQTT:error 2022-07-19 21:14:48: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-07-19 21:14:48: Exiting...
Zigbee2MQTT:error 2022-07-19 21:14:48: undefined

```

Lorsque je redémarre HA, je peux me connecter à Zigbee2MQTT, ça dure max une minute, ensuite la connexion s’arrête  
Si quelqu’un a de nouvelles idées … 🙂

---

<div class="post-metadata">

**Author:** ![AnthonyD](https://forum.hacf.fr/user_avatar/forum.hacf.fr/anthonyd/32/11343_2.png) [@AnthonyD](https://forum.hacf.fr/u/AnthonyD)\
**Post date:** [Août 16, 2022, 8:11 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/17 "2022-08-16T20:11:13Z")

</div>

J’ai désinstallé ZHA et tout est maintenant ok, je sais pas si il y a un lien mais ça peut être une piste pour ceux qui ont le même problème que moi…

---

<div class="post-metadata">

**Author:** ![olybop](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olybop/32/39920_2.png) [@olybop](https://forum.hacf.fr/u/olybop)\
**Post date:** [Octobre 19, 2023, 9:42 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/18 "2023-10-19T09:42:42Z")

</div>

Perso  
J’ai bien z2mqtt qui tourne mais il se met en erreur tous les 2 /3 jours en erreur 502. Bizarre (souvent la nuit)  
Je redémarre HA et cela revient ok

---

<div class="post-metadata">

**Author:** ![Nothing](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nothing/32/36642_2.png) [@Nothing](https://forum.hacf.fr/u/Nothing)\
**Post date:** [Octobre 19, 2023, 12:39 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/19 "2023-10-19T12:39:10Z")

</div>

@olybop  
Bj

Sans donner de détaille sur ta config , et tes paramètre de ta config surtout coté mosquito et z2m, bonbon pour t’aidé a trouvé …  
Quand cela arrive avant de faire quoi que ce soit, vas voir direct dans les journaux , au pire tu posté les ici.

Quel ta cle Zigbee?  
As tu d’autre clé d’installé ?  
As tu met une petite rallonge USB ?

As tu connecté celle ci sur un USB 3 ?

tu vois des questions il peux en avoir plein , pour déterminé ton souci…

---

<div class="post-metadata">

**Author:** ![olybop](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olybop/32/39920_2.png) [@olybop](https://forum.hacf.fr/u/olybop)\
**Post date:** [Octobre 19, 2023, 1:54 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/20 "2023-10-19T13:54:40Z")

</div>

Alors oui en effet pardon j'ai dis ça un peu comme un boulet... 😅  
Donc j'ai ha sur un pi3 avec ssd, 1 clé zigbee avec double adaptateur (USB vers usbc vers USB, j'avais passé rallonge sous le coude. 1 clé zwave, 1 boitier 433, pi3 en RJ45  
Le core en 2023.9.3  
Zigbee2 mqtt via mosquito  
Dans les.log rien de ouf il s'arrête comme ça.on dirait  
J'ai que lixee sur zigbee2mqtt. Fait avec le tuto en auto du forum.

La chelou la conso de 2000w en instantané y'a.rien qui tourne en n ce moment... Curieux est ce qu'il rattrape le vides ?

 ![1000030433](https://forum.hacf.fr/uploads/default/original/3X/7/b/7b751f6391ac0a6def8a879b5a0d5c1a535e017b.png)  
 ![1000030434](https://forum.hacf.fr/uploads/default/original/3X/2/f/2f8a0dd574426816116aca2de20b3ff96575e6ff.png)

Édit: ça dois être ça c'est revenu a 220v instantané

Edit2: le log parle de timeout (j'arrive pas avec mon tél a prendre tout le log, je suis pas chez moi)

 ![1000030436](https://forum.hacf.fr/uploads/default/original/3X/8/8/88a7544ffbd72be0d92da8364ca7d1462f891344.jpeg)

---

<div class="post-metadata">

**Author:** ![Nothing](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nothing/32/36642_2.png) [@Nothing](https://forum.hacf.fr/u/Nothing)\
**Post date:** [Octobre 19, 2023, 2:26 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/21 "2023-10-19T14:26:18Z")

</div>

Alors pour commencé tu devrais evité ceci

> [@olybop](#):
>
> USB vers usbc vers USB

Regarde si ta cle zwave et ta zigbee change pas de port entre elle ou d’autre clé cela arrive  
Tes clefs as tu prévu un hub alimenté , il se peux que ton pi a du mal a fournir les volts , donc l’alim de ta clé tombe. donc plus connecté.  
De plus tu es sur un SSD , donc alim peux être faiblarde

Va voir direct dans les journaux de zigbee, tu as peux t’etre loupe quelque chose.

Tu ne dis pas ta clé zigbee quel modèle ?

---

<div class="post-metadata">

**Author:** ![olybop](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olybop/32/39920_2.png) [@olybop](https://forum.hacf.fr/u/olybop)\
**Post date:** [Octobre 19, 2023, 3:12 UTC](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325/22 "2023-10-19T15:12:29Z")

</div>

Pas con pour l’histoire de l’alim va falloir que je passe sur un p’tit pc. C’est l’alim officielle du pi

SONOFF - Clé USB Zigbee 3.0 + antenne externe 20dBm (V2) ZBDongle-E

[Page suivante](https://forum.hacf.fr/t/zigbee2mqtt-502-bad-gateway/12325.md?page=2)
