[SOLVED]. Problem installing Sonoff Zigbee Dongle 3.0 with Mosquito+ Zigbee2MQTT - error wrong network key, unable to start zigbee-herdsman

Been having loads of issues trying to install a flashed Sonoff Zigbee Dongle 3.0 with Mosquito broker and Zigbee2MQTT
Followed Mark’s video, flashed the dongle with the latest firmware using Flash Installer from Texas Instruments.
Mark’s tutorial:

Koenkk z-stack firmware:
hex file: CC1352P2_CC2652P_launchpad_coordinator_20211217

Have reinstalled mosquito and z2m several times and rolled back to stable HA install several times. My HA is basic: I have nothing connected to it yet apart from a chromecast. I need this to connect my tasmota lighting controllers, which will be my first use of HA.

I Have now reflashed the dongle, reinstalled everything and now getting different (but similar) error codes. I have restarted everything individually and together a dozen or more times, changed and confirmed the USB extension to the dongle as fully functional, which is 3 metres from the server and router, used every USB port, including known functional ports
1.   SYSTEHEALTH

I have HA set up in Proxmox on HP Elitedesk800 G1 16gb/250SSD
I (think) I’ve created a USB pass thru in Proxmox:

My zigbee2mqtt config:


Typing
“ls -l /dev/serial/by-id”
into HA terminal to confirm the USB port I get:

Hence using port: /dev/ttyUSB0 in the config.

when I start z2m I get the following error logs : unable to start zigbee-herdsman

6 z2m log 1|690x394

When I try to open the z2m UI I get 502: bad gateway

The HA logs say that I’m using the wrong network key, I’ve checked the config in Mark’s tutorial and it’s the same as his (as screenshot above)!

8 HA log 1|690x468

This is the second error in the HA log, I don’t know if this is relevant:

I am at the limit of my knowledge in this area and really don’t know how to progress, any help will be gratefully appreciated.
Thank you all.

Not that this is the cause, but…

I would use the by-id path to avoid changing ports during reboots when you have more then 1 USB device connected.

Home Assistant installed MQTT broker?

I’ve tried the dongle, on an extension, in all the USB ports, refreshed the USB pass through setting in Proxmox each time I’ve moved it or rebooted.

I’ve got mosquito broker and zigbee2mqtt installed as add ons in supervisor

The last error says ‘zigpy_znp zigbee application’, the rest of your post is about zigbee2mqtt.

It seems both ZHA (zigpy_znp) and zigbee2mqtt try to access your stick. That can not work. Only one zigbee stack can access your stick at the same time.

Thanks, yeah, I thought it might be something to do with ZHA from that terminology, but I don’t understand a lot of what I’m looking at!
How could that be happening?
I’ve never tried to use ZHA, don’t have it installed, or ever have, my HA set up is basic, just these add ons plus HACS.

This is the firmware I used, it is the correct one isn’t it? I’ve not put ZHA on there by accident?

hex file: CC1352P2_CC2652P_launchpad_coordinator_20211217

[https://github.com/.../master/coordinator/Z-Stack_3.x.0/bin](https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin?fbclid=IwAR3PdLn8--NY6PLJxQ0y_pTVTZk_vQHGMZjbUHiANSv4hoZT109ztu5LIZ0)

Along the line with what Francis said -
Click the “Configuration” from the panel in the left, and click “Devices and Services”. What do you have in those integrations page? A screen dump would help.

Essentially, try http://<the.lan.ip.of.your.haos>:8123/config/integrations

Here you go:

So you do have ZHA (as in Zigbee Home Automation, the last one) and the zigbee2mqtt at the same time. Per Francis (and per the error log), they are in conflict, and you’d have to pick one.

BTW, ZHA is not some firmware you could install onto the USB dongle. It’s similar to zigbee2mqtt, a controller stack to, in a way, “drive” your USB dongle.

Edit:
If I were you, I would open the 3-dot menu and disable ZHA, and then restart, and then enable zigbee2mqtt. Here’s to hope that the error message would go away.

5 Likes

THAT"S IT MATE!!!
Nice one, thanks a million :slight_smile:

During my thousands of reboots, it’s popped us as an auto discovered integration. Because it’s got the name of my stick on it, I’ve clicked configure, not realising that will try to use the stick for the ZHA integration.

Have restarted zigbee2mqtt several times and rebooted HA twice - getting lovely green text in the logs and the UI is opened.

Thanks to everyone that’s helped :slight_smile: :smiling_face_with_three_hearts:

1 Like

I’ve been through this process and it seems to set up but then throws up 2 issues. Firstly it corrupts the Z wave JS to MQTT integration (get can’t load driver error). Secondly, I get a 502 bad gateway when I try and access the Zigbee integration

Help!

I don’t have z wave in my set up, so you might be getting additional errors I didn’t.
Have you seen the bottom of thus thread? My issue was because I’d activated (submitted) the dongle in the integration page instead of ignoring it.
This caused it to activate as a ZHA controller whilst Z2M was trying to use it.
Maybe check that, or try activating it with all your z wave stuff stopped?

No, the ZHA controller isn’t installed. I don’t understand why it corrupts the Zwave integration that works fine

I which case I wouldn’t know where to start mate. Hopefully one of the more knowledgeable on here will chime in!

Double check your port assignments. If you don’t use /dev/serial/by-id/ paths, your serial port assignments can be switched after a reboot.

How do I do that?