Zigbee2mqtt installation ok, fail when I permit join

I believe I did the configuration right of my Zigbee2MQTT installation (Sonoff USB 3.0 plus dongle, RPI 4B), everything shows up just fine. Just when I click the "permit join(all) button I however get the message

Request 'zigbee2mqtt/bridge/request/permit_join' failed with error: 'SREQ '--> ZDO - mgmtPermitJoinReq - {"addrmode":15,"dstaddr":65532,"duration":254,"tcsignificance":0}' failed with status '(0xc2: NWK_INVALID_REQUEST)' (expected '(0x00: SUCCESS)')'

When I set the permit_join parameter to true in the configuration file, no devices can be added, but there is also no error message. However in that case I can not disable it and I get the message

Request 'zigbee2mqtt/bridge/request/permit_join' failed with error: 'SRSP - AF - dataRequestExt after 6000ms'

Also, after I restart the Zigbee2MQTT service when I did that, I have to restart HAS as well. Otherwise I get 502 bad gateway

I used instructions fromhere to set things up

And this is my configuration file on zigbee2mqtt

data_path: /config/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
serial:
  port: /dev/ttyUSB0
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: {}
availability: false
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

just found out that the Sonoff Zigbee integration gives an error “retrying setup”

Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:152
Integration: Zigbee Home Automation ([documentation](https://www.home-assistant.io/integrations/zha), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+zha%22))
First occurred: 1:15:01 PM (8 occurrences)
Last logged: 1:22:19 PM

Couldn't start ZNP = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator

Traceback (most recent call last): File “/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py”, line 826, in request response = await response_future asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py”, line 152, in async_initialize self.application_controller = await app_controller_cls.new( File “/usr/local/lib/python3.9/site-packages/zigpy/application.py”, line 69, in new await app.startup(auto_form) File “/usr/local/lib/python3.9/site-packages/zigpy_znp/zigbee/application.py”, line 175, in startup return await self._startup( File “/usr/local/lib/python3.9/site-packages/zigpy_znp/zigbee/application.py”, line 188, in _startup await znp.connect() File “/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py”, line 554, in connect await self.nvram.determine_alignment() File “/usr/local/lib/python3.9/site-packages/zigpy_znp/nvram.py”, line 35, in determine_alignment value = await self.osal_read(nvids.OsalNvIds.NWKKEY, item_type=t.Bytes) File “/usr/local/lib/python3.9/site-packages/zigpy_znp/nvram.py”, line 170, in osal_read length = (await self.znp.request(c.SYS.OSALNVLength.Req(Id=nv_id))).ItemLen File “/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py”, line 826, in request response = await response_future File “/usr/local/lib/python3.9/site-packages/async_timeout/init.py”, line 128, in aexit self._do_exit(exc_type) File “/usr/local/lib/python3.9/site-packages/async_timeout/init.py”, line 203, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError

I did an update of the dongle to the latest fw and still doesn’t work but I also get this message now that the application could not be started

Logger: zigpy.application
Source: /usr/local/lib/python3.9/site-packages/zigpy/application.py:73
First occurred: 5:48:59 PM (7 occurrences)
Last logged: 5:54:53 PM

Couldn’t start application

ah, found it…
For some reason also ZHA was installed, that conflicted with zigbee2mqtt

2 Likes

HI, how you solve this issue. I have the same challange.

Any further explanation on what could cause this, I’m having the same issue. I do not have ZHA installed. I updated the FW on the Sonoff dongle to this one: https://github.com/Koenkk/Z-Stack-firmware.

This is my config.yaml within the zigbee2mqtt folder:

devices:
  - devices.yaml
groups:
  - groups.yaml
homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  user: 
  password: 
  server: mqtt://core-mosquitto:1883
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_bcf4dc62093bec119cfa9c957a0af07f-if00-port0
advanced:
  log_level: warn
  pan_id: 6754
  channel: 26
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
device_options:
  legacy: false
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}

I’m not sure what this issue might be.

I thought I would update how I fixed this issue. It was the ZHA install as mentioned above, but, what I didn’t realize is that when I plugged in the Sonoff dongle, HA auto discovered the hardware and asked if I wanted to configure it. When I clicked yes, it installed ZHA. It was not mentioned that this is how ZHA was installed on other people’s systems, but this is how it got on mine. Once I deleted the integration that was installed, everything worked as it should. I hope this helps anyone having the same issue and are unaware that the discovered integration will break Zigbee2MQTT.

5 Likes

I’m having the same issue. Already removed ZHA and nothing…

I removed Zigbee2MQTT and installed it again and it worked!

1 Like

Works great!

1 Like