Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.22k stars 1.69k forks source link

Unknown error occurred and dongle disconnect after attempting to configure Sonoff Zigbee 3.0 USB Dongle Plus V2 (ZBDongle-E) in Home Assistant #24402

Open simas2024 opened 1 month ago

simas2024 commented 1 month ago

What happened?

In Z2M, Home Assistant, Mosquitto Rootless Docker Compose setup on Raspberry Pi 5, Debian GNU/Linux bookworm 12.7 aarch64,, Linux 6.6.51+rpt-rpi-2712, I encounter an error when trying to configure the Sonoff Zigbee 3.0 USB Dongle Plus V2, which is detected and displayed in Home Assistant.

img 2024-10-19 um 06 52 45 img 2024-10-19 um 06 52 53 img 2024-10-19 um 06 52 58 img 2024-10-19 um 06 53 05

What did you expect to happen?

No error

How to reproduce it (minimal and precise)

Rootless docker setup on Raspberry Pi 5

compose.yml:

services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: homeassistant
    restart: always
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ./homeassistant_config:/config
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    ports:
      - "8123:8123"
    environment:
      DISABLE_JEMALLOC: true
      PYTHON_VERSION: 3.12
    networks:
      - ha_network
    privileged: true
    depends_on:
      - mosquitto
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt
    container_name: zigbee2mqtt
    restart: always
    environment:
      - TZ=Europe/Berlin
    volumes:
      - ./zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    ports:
      - "8081:8081"
    networks:
      - ha_network
    depends_on:
      - mosquitto
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    restart: always
    ports:
      - "1883:1883"
      - "9001:9001"
    volumes:
      - ./mosquitto/config:/mosquitto/config
      - ./mosquitto/data:/mosquitto/data
      - ./mosquitto/log:/mosquitto/log
    networks:
      - ha_network
networks:
  ha_network:
    driver: bridge

Z2M configuration.yaml:

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://mosquitto:1883
serial:
  port: /dev/ttyUSB0
  baudrate: 115200
  adapter: ember
  rtscts: false
frontend:
  port: 8081
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false

Zigbee2MQTT version

1.40.2 (commit #e06848d)

Adapter firmware version

EmberZNet 7.4.3 [GA] (ncp-uart-hw-v7.4.3.0-zbdonglee-115200.gbl), EmberZNet 7.4.4 [GA] (ncp-uart-hw-v7.4.4.0-zbdonglee-115200.gbl), 7.4.1 (ncp-uart-sw_EZNet7.4.1_V1.0.0.gbl)

Adapter

Sonoff Zigbee 3.0 USB Dongle Plus V2

Setup

Rootless Docker compose on Pi 5

Debug log

docker compose up -d

Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog.
[2024-10-19 07:19:49] info:     z2m: Logging to console, file (filename: log.log)
[2024-10-19 07:19:49] info:     z2m: Starting Zigbee2MQTT version 1.40.2 (commit #e06848d)
[2024-10-19 07:19:49] info:     z2m: Starting zigbee-herdsman (2.1.3)
[2024-10-19 07:19:50] info:     zh:ember: Using default stack config.
[2024-10-19 07:19:50] info:     zh:ember: ======== Ember Adapter Starting ========
[2024-10-19 07:19:50] info:     zh:ember:ezsp: ======== EZSP starting ========
[2024-10-19 07:19:50] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:19:50] info:     zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2024-10-19 07:19:50] info:     zh:ember:uart:ash: Serial port opened
[2024-10-19 07:19:50] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:19:51] info:     zh:ember:uart:ash: ======== ASH connected ========
[2024-10-19 07:19:51] info:     zh:ember:uart:ash: ======== ASH started ========
[2024-10-19 07:19:51] info:     zh:ember:ezsp: ======== EZSP started ========
[2024-10-19 07:19:51] info:     zh:ember: Adapter EZSP protocol version (13) lower than Host. Switched.
[2024-10-19 07:19:51] info:     zh:ember: Adapter version info: {"ezsp":13,"revision":"7.4.4 [GA]","build":0,"major":7,"minor":4,"patch":4,"special":0,"type":170}
[2024-10-19 07:19:51] info:     zh:ember: [STACK STATUS] Network up.
[2024-10-19 07:19:51] info:     zh:ember: [INIT TC] Adapter network matches config.
[2024-10-19 07:19:51] info:     zh:ember: [CONCENTRATOR] Started source route discovery. 1248ms until next broadcast.
[2024-10-19 07:19:51] info:     z2m: zigbee-herdsman started (resumed)
[2024-10-19 07:19:51] info:     z2m: Coordinator firmware version: '{"meta":{"build":0,"ezsp":13,"major":7,"minor":4,"patch":4,"revision":"7.4.4 [GA]","special":0,"type":170},"type":"EmberZNet"}'
[2024-10-19 07:19:51] info:     z2m: Currently 0 devices are joined.
[2024-10-19 07:19:51] warning:  z2m: `permit_join` set to  `true` in configuration.yaml.
[2024-10-19 07:19:51] warning:  z2m: Allowing new devices to join.
[2024-10-19 07:19:51] warning:  z2m: Set `permit_join` to `false` once you joined all devices.
[2024-10-19 07:19:51] info:     z2m: Zigbee: allowing new devices to join.
[2024-10-19 07:19:51] info:     zh:ember: [STACK STATUS] Network opened.
[2024-10-19 07:19:52] info:     z2m: Connecting to MQTT server at mqtt://mosquitto:1883
[2024-10-19 07:19:52] info:     z2m: Connected to MQTT server
[2024-10-19 07:19:52] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2024-10-19 07:19:52] info:     z2m: Started frontend on port 8081
[2024-10-19 07:19:52] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2024-10-19 07:19:52] info:     z2m: Zigbee2MQTT started!
[2024-10-19 07:19:57] info:     z2m:mqtt: MQTT publish: topic 'homeassistant/binary_sensor/1221051039810110150109113116116_0x7cc6b6fffe8e161e/connection_state/config', payload '{"device":{"hw_version":"EmberZNet 7.4.4 [GA]","identifiers":["zigbee2mqtt_bridge_0x7cc6b6fffe8e161e"],"manufacturer":"Zigbee2MQTT","model":"Bridge","name":"Zigbee2MQTT Bridge","sw_version":"1.40.2"},"device_class":"connectivity","entity_category":"diagnostic","name":"Connection state","object_id":"zigbee2mqtt_bridge_connection_state","origin":{"name":"Zigbee2MQTT","sw":"1.40.2","url":"https://www.zigbee2mqtt.io"},"payload_off":"offline","payload_on":"online","state_topic":"zigbee2mqtt/bridge/state","unique_id":"bridge_0x7cc6b6fffe8e161e_connection_state_zigbee2mqtt","value_template":"{{ value_json.state }}"}'

Then click on “Configuration” in the Home Assistant and wait a while:

[2024-10-19 07:21:39] error:    zh:ember:uart:ash: Received ERROR from adapter, with code=ERROR_EXCEEDED_MAXIMUM_ACK_TIMEOUT_COUNT.
[2024-10-19 07:21:39] error:    zh:ember:uart:ash: ASH disconnected | Adapter status: ASH_NCP_FATAL_ERROR
[2024-10-19 07:21:39] error:    zh:ember:uart:ash: Error while parsing received frame, status=ASH_NCP_FATAL_ERROR.
[2024-10-19 07:21:39] error:    zh:ember: Adapter fatal error: HOST_FATAL_ERROR
[2024-10-19 07:21:39] info:     zh:ember:uart:ash: ASH COUNTERS since last clear:
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Total frames: RX=51, TX=84
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Cancelled   : RX=0, TX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   DATA frames : RX=45, TX=39
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   DATA bytes  : RX=413, TX=437
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Retry frames: RX=3, TX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   ACK frames  : RX=1, TX=43
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   NAK frames  : RX=0, TX=1
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   nRdy frames : RX=0, TX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   CRC errors      : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Comm errors     : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Length < minimum: RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Length > maximum: RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Bad controls    : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Bad lengths     : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Bad ACK numbers : RX=5
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Out of buffers  : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Retry dupes     : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   Out of sequence : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash:   ACK timeouts    : RX=0
[2024-10-19 07:21:39] info:     zh:ember:uart:ash: Port closed.
[2024-10-19 07:21:39] info:     zh:ember:uart:ash: ======== ASH stopped ========
[2024-10-19 07:21:39] info:     zh:ember:ezsp: ======== EZSP stopped ========
[2024-10-19 07:21:39] info:     zh:ember: ======== Ember Adapter Stopped ========
[2024-10-19 07:21:39] error:    z2m: Adapter disconnected, stopping
[2024-10-19 07:21:39] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
[2024-10-19 07:21:39] info:     z2m: Disconnecting from MQTT server
[2024-10-19 07:21:39] info:     z2m: Stopping zigbee-herdsman...
[2024-10-19 07:21:39] info:     z2m: Stopped zigbee-herdsman
[2024-10-19 07:21:39] info:     z2m: Stopped Zigbee2MQTT
Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog.
[2024-10-19 07:21:41] info:     z2m: Logging to console, file (filename: log.log)
[2024-10-19 07:21:41] info:     z2m: Starting Zigbee2MQTT version 1.40.2 (commit #e06848d)
[2024-10-19 07:21:41] info:     z2m: Starting zigbee-herdsman (2.1.3)
[2024-10-19 07:21:41] info:     zh:ember: Using default stack config.
[2024-10-19 07:21:41] info:     zh:ember: ======== Ember Adapter Starting ========
[2024-10-19 07:21:41] info:     zh:ember:ezsp: ======== EZSP starting ========
[2024-10-19 07:21:41] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:21:41] info:     zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2024-10-19 07:21:41] info:     zh:ember:uart:ash: Serial port opened
[2024-10-19 07:21:41] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:21:44] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:21:44] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:21:46] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:21:46] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:21:49] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:21:49] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:21:51] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:21:51] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:21:52] info:     zh:ember:uart:ash: ======== ASH connected ========
[2024-10-19 07:21:52] info:     zh:ember:uart:ash: ======== ASH started ========
[2024-10-19 07:21:52] info:     zh:ember:ezsp: ======== EZSP started ========
[2024-10-19 07:21:57] error:    zh:ember:ezsp: The adapter has run out of buffers, causing general malfunction. Remediate network congestion, if present. Last Frame: [FRAME: ID=0:"VERSION" Seq=0 Len=0].
[2024-10-19 07:22:07] error:    zh:ember:ezsp: ERROR Transaction failure; status=ASH_ERROR_TIMEOUTS. Last Frame: [FRAME: ID=0:"VERSION" Seq=0 Len=0].
[2024-10-19 07:22:07] error:    zh:ember: Adapter fatal error: ASH_ERROR_TIMEOUTS
[2024-10-19 07:22:07] error:    z2m: Error while starting zigbee-herdsman
[2024-10-19 07:22:07] error:    z2m: Failed to start zigbee
[2024-10-19 07:22:07] error:    z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-10-19 07:22:07] error:    z2m: Exiting...
[2024-10-19 07:22:07] error:    z2m: Error: ASH_ERROR_TIMEOUTS
    at Ezsp.ezspVersion (/app/node_modules/zigbee-herdsman/src/adapter/ember/ezsp/ezsp.ts:1361:19)
    at EmberAdapter.emberVersion (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1397:63)
    at EmberAdapter.initEzsp (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:688:9)
    at EmberAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1583:24)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
    at Zigbee.start (/app/lib/zigbee.ts:69:27)
    at Controller.start (/app/lib/controller.ts:161:27)
    at start (/app/index.js:154:5)
Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog.
[2024-10-19 07:22:09] info:     z2m: Logging to console, file (filename: log.log)
[2024-10-19 07:22:09] info:     z2m: Starting Zigbee2MQTT version 1.40.2 (commit #e06848d)
[2024-10-19 07:22:09] info:     z2m: Starting zigbee-herdsman (2.1.3)
[2024-10-19 07:22:09] info:     zh:ember: Using default stack config.
[2024-10-19 07:22:09] info:     zh:ember: ======== Ember Adapter Starting ========
[2024-10-19 07:22:09] info:     zh:ember:ezsp: ======== EZSP starting ========
[2024-10-19 07:22:09] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:22:09] info:     zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2024-10-19 07:22:09] info:     zh:ember:uart:ash: Serial port opened
[2024-10-19 07:22:09] info:     zh:ember:uart:ash: ======== ASH starting ========
[2024-10-19 07:22:12] info:     zh:ember:uart:ash: ======== ASH Adapter reset ========
[2024-10-19 07:22:12] info:     zh:ember:uart:ash: ======== ASH starting ========
simas2024 commented 1 month ago

BTW: Successfully connected in ioBroker (rootless Docker, Pi5) using the Zigbee Adapter

screen

++ Update ++

Only the manual update from v1.10.3 to v1.10.10 of the Zigbee adapter makes my little experimental Zigbee network stable and there are no more unsuccessful attempts to restart the adapter and dongle connection. I use three HG08673 here :

Screen 01

The adapter settings:

Screen 02