Zigbee2mqtt bad gateway

Boa noite.
Preciso da vossa ajuda, estou a tentar instalar zigbee2mqtt, tudo parece estar bem, mas ao abrir no side bar a pagina tenho um erro de 502: Bad Gateway.

Estou a usar uma pen ConBee2.
A instalação do HA é uma VM em VirtualBox.

Junto os logs com debug ativo:

[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] socat.sh: executing... 
[19:39:50] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing... 
[19:39:50] INFO: MQTT available, fetching server detail ...
[19:39:50] INFO: MQTT server settings not configured, trying to auto-discovering ...
[19:39:51] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[19:39:51] INFO: MQTT credentials not configured, trying to auto-discovering ...
[19:39:51] INFO: Configuring'addons' mqtt user
[19:39:51] INFO: Previous config file found, checking backup
[19:39:51] INFO: Creating backup config in '/config/zigbee2mqtt/data/.configuration.yaml.bk'
[19:39:51] INFO: Adjusting Zigbee2mqtt core yaml config with add-on quirks ...
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:39:52] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.22.0 start
> node index.js
Zigbee2MQTT:debug 2021-11-15 19:39:56: Loaded state from file /config/zigbee2mqtt/data/state.json
Zigbee2MQTT:info  2021-11-15 19:39:56: Logging to console and directory: '/config/zigbee2mqtt/data/log/2021-11-15.19-39-54' filename: log.txt
Zigbee2MQTT:info  2021-11-15 19:39:56: Starting Zigbee2MQTT version 1.22.0 (commit #unknown)
Zigbee2MQTT:info  2021-11-15 19:39:56: Starting zigbee-herdsman (0.13.164)
Zigbee2MQTT:debug 2021-11-15 19:39:56: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/data/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/data/database.db.backup","databasePath":"/config/zigbee2mqtt/data/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"deconz","path":"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2410214-if00"}}'
CREATED DECONZ ADAPTER
Zigbee2MQTT:info  2021-11-15 19:39:56: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2021-11-15 19:39:56: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:debug 2021-11-15 19:39:59: Zigbee network parameters: {"channel":15,"extendedPanID":"0xdddddddddddddddd","panID":6754}
Zigbee2MQTT:info  2021-11-15 19:39:59: Currently 0 devices are joined:
Zigbee2MQTT:warn  2021-11-15 19:39:59: `permit_join` set to  `true` in configuration.yaml.
Zigbee2MQTT:warn  2021-11-15 19:39:59: Allowing new devices to join.
Zigbee2MQTT:warn  2021-11-15 19:39:59: Set `permit_join` to `false` once you joined all devices.
Zigbee2MQTT:info  2021-11-15 19:39:59: Zigbee: allowing new devices to join.
Zigbee2MQTT:debug 2021-11-15 19:44:56: Saving state to file /config/zigbee2mqtt/data/state.json
Zigbee2MQTT:debug 2021-11-15 19:49:56: Saving state to file /config/zigbee2mqtt/data/state.json
Zigbee2MQTT:debug 2021-11-15 19:54:56: Saving state to file /config/zigbee2mqtt/data/state.json
Zigbee2MQTT:debug 2021-11-15 19:59:56: Saving state to file /config/zigbee2mqtt/data/state.json

E a configuração:

data_path: /config/zigbee2mqtt/data
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
serial:
  port: >-
    /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2410214-if00
  adapter: deconz
advanced:
  log_level: debug
  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

Agradeço desde já a vossa ajuda.
Luis

Tens o Mosquitto Broker bem configurado (ou instalado sequer)? MQTT credentials not configured

[19:39:51] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[19:39:51] INFO: MQTT credentials not configured, trying to auto-discovering ...
1 Curtiu

Olá Jorge, obrigado pela tua ajuda.
Já tinha o Mosquitto Broker instalado, agora segui um tutorial e configurei um user password, penso que ja avancei mais um pouco:

[21:50:02] INFO: MQTT available, fetching server detail ...
[21:50:02] INFO: MQTT server settings not configured, trying to auto-discovering ...
[21:50:03] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[21:50:03] INFO: Previous config file found, checking backup
[21:50:03] INFO: Creating backup config in '/config/zigbee2mqtt/data/.configuration.yaml.bk'
[21:50:03] INFO: Adjusting Zigbee2mqtt core yaml config with add-on quirks ...
[cont-init.d] zigbee2mqtt.sh: exited 0.

Mas agora tenho o seguinte erro:

Zigbee2MQTT:debug 2021-11-15 21:50:07: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/data/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/data/database.db.backup","databasePath":"/config/zigbee2mqtt/data/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"deconz","path":"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2410214-if00"}}'
CREATED DECONZ ADAPTER
Zigbee2MQTT:error 2021-11-15 21:50:18: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-11-15 21:50:18: Failed to start zigbee
Zigbee2MQTT:error 2021-11-15 21:50:18: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-11-15 21:50:18: Exiting...
Zigbee2MQTT:error 2021-11-15 21:50:18: undefined

E continuo a ter o erro: 502: bad gateway

Isso poderá também ser um erro de cache do browser. Experimenta limpar a cache, reinicia o HA e tenta de novo.

Achas que não é um erro importante?

Dá-me a impressão que o ConBee2 é que está a falhar, deve ser alguma incompatibilidade:

2021-11-15T22:30:55.666Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2410214-if00","adapter":"deconz"},"databasePath":"/config/zigbee2mqtt/data/database.db","databaseBackupPath":"/config/zigbee2mqtt/data/database.db.backup","backupPath":"/config/zigbee2mqtt/data/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2021-11-15T22:30:55.667Z zigbee-herdsman:deconz:driver Opening with /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2410214-if00
2021-11-15T22:30:55.687Z zigbee-herdsman:deconz:driver Serialport opened
2021-11-15T22:30:55.689Z zigbee-herdsman:controller:log Started with result 'resumed'
2021-11-15T22:30:55.689Z zigbee-herdsman:controller:log Injected database: true, adapter: true
2021-11-15T22:30:55.691Z zigbee-herdsman:deconz:driver send read parameter request from queue. seqNr: 1 paramId: 1
2021-11-15T22:30:58.667Z zigbee-herdsman:deconz:adapter checking coordinator simple descriptor
2021-11-15T22:30:58.671Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0x0 EP:0 SeqNr. 2 request id: 1
2021-11-15T22:31:05.695Z zigbee-herdsman:deconz:driver Timeout for request - CMD: 0xa seqNr: 1
Zigbee2MQTT:error 2021-11-15 22:31:05: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-11-15 22:31:05: Failed to start zigbee
Zigbee2MQTT:error 2021-11-15 22:31:05: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-11-15 22:31:05: Exiting...
Zigbee2MQTT:error 2021-11-15 22:31:05: undefined
[22:31:05] INFO: Zigbee Herdsman debug logging enabled
2021-11-15T22:31:05.695Z zigbee-herdsman:deconz:driver Timeout for request - CMD: 0xa seqNr: 1

Onde compram estas cenas agora que é um risco mandar vir do oriente? :grinning_face_with_smiling_eyes:

Pode ser um problema na alimentação da Conbee. Experimenta ligar a um hub USB com alimentação externa.

Problema resolvido.
Deixo aqui o que fiz para resolver:

  1. Como estou a correr o HA no VM no VirtualBox, tive que instalar uma extensão:
    image

  2. Com esta extenção instalada já me permitiu, na configuração da VM, mudar a porta USB para USB 2.0:


    Nota: com a VM desligada.

Deixo aqui a configuração final do Zigbee2MQTT para ajudar alguem que necessite, de notar que a ligação ao MQTT Mosquitto é com autenticação com user:

data_path: /config/zigbee2mqtt/data
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  user: mqtt-user
  password: <password do user criado no HA>
serial:
  port: /dev/ttyACM0
  adapter: deconz
advanced:
  log_level: error
  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

Uma nota muito importante se estiverem a usar um pen ConBee2, é necessário colocar na configuração adapter: deconz, ex:

serial:
  port: /dev/ttyACM0
  adapter: deconz

E aqui está o Zigbee2MQTT a funcionar:

Deu luta? Deu… muita, mas a satisfação de estar a funcionar é optima.

Se alguem necessitar de ajuda, contactem-me por mensagem privada, terei todo o gosto de ajudar.

2 Curtiram

Para OS Linux (ubuntu) onde utilizam o VirtualBox, será necessário um passo adicional.

Adicionar o utilizador ao grupo de acesso:
sudo gpasswd -a yourusername vboxusers

Verificar os grupos do utilizador:
groups yourusername

1 Curtiu

Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade