Sonoff Zigbee USB setup question- zigbee2mqtt

It’s not finding your dongle. Check the port is correct and that you have the dongle plugged in using a USB extension cable - away from the server.

It’s not connecting to your adapter. You well need to find the adapter and change this setting.

Usually it’s an ttyACM0 or some form of a ttyACM(0-2)

I appreciate your assistance.

The dongle is at least 2-3 ft from any server, AP or Z-wave device.

Here is my hardware:

ttyUSB0
/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0
Subsystem:
tty
Device path:
/dev/ttyUSB0
ID:
/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0
Attributes:
DEVLINKS: >-
  /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0
  /dev/serial/by-path/pci-0000:00:14.0-usb-0:2:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/ttyUSB0/tty/ttyUSB0
ID_BUS: usb
ID_MODEL: Sonoff_Zigbee_3.0_USB_Dongle_Plus
ID_MODEL_ENC: Sonoff\x20Zigbee\x203.0\x20USB\x20Dongle\x20Plus
ID_MODEL_ID: ea60
ID_PATH: pci-0000:00:14.0-usb-0:2:1.0
ID_PATH_TAG: pci-0000_00_14_0-usb-0_2_1_0
ID_REVISION: '0100'
ID_SERIAL: ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c
ID_SERIAL_SHORT: 584b60cc2e86ec11935e641719c2d21c
ID_TYPE: generic
ID_USB_DRIVER: cp210x
ID_USB_INTERFACES: ':ff0000:'
ID_USB_INTERFACE_NUM: '00'
ID_VENDOR: ITead
ID_VENDOR_ENC: ITead
ID_VENDOR_ID: 10c4
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '1126248220536'

I ran a test to verify I have write access to the port:

[core-ssh ~]$ test -w /dev/ttyUSB0 && echo success || echo failure
success

Log file again:

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
[23:55:38] 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)
[23:55:39] INFO: Handing over control to Zigbee2mqtt Core ...
> [email protected] start
> node index.js
Zigbee2MQTT:info  2022-06-28 23:55:40: Logging to console and directory: '/config/zigbee2mqtt/log/2022-06-28.23-55-40' filename: log.txt
Zigbee2MQTT:info  2022-06-28 23:55:40: Starting Zigbee2MQTT version 1.25.2 (commit #unknown)
Zigbee2MQTT:info  2022-06-28 23:55:40: Starting zigbee-herdsman (0.14.34)
Zigbee2MQTT:error 2022-06-28 23:56:00: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-06-28 23:56:00: Failed to start zigbee
Zigbee2MQTT:error 2022-06-28 23:56:00: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-06-28 23:56:00: Exiting...
Zigbee2MQTT:error 2022-06-28 23:56:00: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
    at Zigbee.start (/app/lib/zigbee.ts:58:27)
    at Controller.start (/app/lib/controller.ts:101:27)
    at start (/app/index.js:109:5)
[23:56:01] INFO: Handing over control to Zigbee2mqtt Core ...
> [email protected] start
> node index.js
Zigbee2MQTT:info  2022-06-28 23:56:02: Logging to console and directory: '/config/zigbee2mqtt/log/2022-06-28.23-56-02' filename: log.txt
Zigbee2MQTT:info  2022-06-28 23:56:02: Starting Zigbee2MQTT version 1.25.2 (commit #unknown)
Zigbee2MQTT:info  2022-06-28 23:56:02: Starting zigbee-herdsman (0.14.34)

This caught my eye:

Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)

This is from the docs:

If Zigbee2MQTT fails to start with a Texas Instruments LAUNCHXL-CC1352P-2/CC26X2R1 with Error: SRSP - SYS - version after 6000ms, you most probably have connected your device to a system that requires pressing the reset button (the one next to the USB connector) momentarily/shortly after connecting the USB cable. This issue has primarily been observed on x86 architectures only ( e.g., Intel NUC, HPE Microserver, i7 laptop), see also #2162. The procedure has to be repeated every time the adapter is re-connected and it's not clear yet, whether this can be fixed at all. It does not seem to occur on ARM based boards (Raspberry Pi, ODROID XU4).

The chip is a CC2652 and I am running HASP on a NUC. I did try pressing the reset button, but no difference.

Any ideas?

I do have a ConBee that I bought last year, should I abandon the Sonoff dongle and use that?

This is right out of the box. Should I try to flash the Sonoff?

Absolutely!
That’s my goto second step when my adapter fails to connect.

Sonoff dongle works fine for me, running the latest firmware.

Yours looks ok too. There are plenty of forum topics for “bad gateway” but no single solution by the look. The only time I have had it was after a reboot where I had left an ESP plugged into another port and the port number changed. I have got around that issue by using /dev/serial/by-id/... for the port rather than /dev/ttyUSB0, but that’s not your issue.

Dare I say uninstall reinstall :). Seems to have worked for some.

Anything else configured to use ‘ttyUSB0’ ?

No. The only other USB device I have is my Z-Wave dongle on /dev/ttyACM0

Curiouser and Curiouser.

I did nothing for an hour and wanted to look at the logs again, and now it looks like Zigbee started. Even more curious, the UI was now live. (Meaning Zigbee started?)

So, I tried to pair a Zigbee light (Ikea). And I got these errors. (Sorry for the screen grab)

zig2

I guess this is progress?

I only have success pairing things if they are within a metre or less of the controller. For globes and plugs I use an extension cord and place them about 25cm away from the controller.

I do have 4 station meshed wifi and a lot of devices - so I figure the 2.4GHz spectrum is a bit busy?

I have no issues once paired.

Kris - I just want to point out that mine uses ttyUSB0 also, just like Steve. So this is worth a check, but not necessarily the problem.
image

And, Steve and Kris, I would agree to Daryl above, and use /dev/serial/by-id/... instead, in your z2m configuration.

But then, well, looks like Steve has got his z2m going. So at least the device path to the dongle is not the problem (any more).

I tried:

port: >-
  /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_584b60cc2e86ec11935e641719c2d21c-if00-port0

No difference.

The log files still have:

Zigbee2MQTT:error 2022-06-29 11:24:00: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)

Which the docs indicate is endemic to X86 architecture.

I’ll try pressing the reset button again.

UPDATE:
Pushed the reset button after plugging in the dongle. No difference.

What is the switch on the dongle for?

Are you running with the latest HA OS?

Having you tried rebooting?

Did you read Zigbee2MQTT fails to start | Zigbee2MQTT? Lots of good suggestions there.

Yes, latest HAOS
Rebooting- No I hadn’t tried, but on your suggestion I rebooted. No difference.
I have been looking at suggestions from the link you provided. Which is why I keep coming back to this:
Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
which the tips in the link provided say is endemic to X86.

I also updated the firmware on the dongle.

The Sonoff dongle is new, and I also have a Conbee dongle plus a naked dongle that has a CC2531 chip, but I don’t recall where it came from. I kind of doubt that changing dongles would make any difference.

I am contemplating deleting Zigbee2MQTT and trying ZHA. Thoughts?

Here’s an idea. My HA is on an Intel NUC which the Zigbee2MQTT notes say may be a problem (X86).
I am running Mosquitto on a Raspberry Pi3 as my MQTT broker. (I was using NodeRed and MQTT long before I dipped my toes into Home Assistant, so I just kept using the broker on the Pi). What if I were to run another instance of HA on the Pi3 just to host my broker and the Zigbee dongle? My HA on the Nuc doesn’t care where the MQTT messages come from as long as they are on my local net.

Do you see any issues with that combination?

Try adding:

advanced:
  rtscts: false

To the end of the the z2m config.

This I found that in this thread:

I don’t have much more to add. I’m running on an x86 (Mele Quieter 3 fanless). My Sonoff is new and flashed with latest firmware. I just plugged it in and it worked. I use the /dev/serial/by-id/... form for port number.

Another thought is trying ZHA but only to see if it can connect. For me I see that ZHA auto detects my stick and tells me the port its on (which is the same port I’m using for Z2M). BTW, both ZHA and z2m work for me.

You could try “reset configuration” then add the serial port info again.

Has the Sonoff worked ever? Could it be a bad stick?

EDIT: another thought is to try different USB ports. Sometimes the port makes a difference.

And if all of the above would not help, you might have to consider the possibility that your sonoff stick being faulty.

Yes. I rolled back to a snapshot before installing Zigbee2Mqtt, plugged in the dongle and paired with a light in just a few minutes. Dongle works just fine.

Can ZHA and Zigbee2Mqtt cohabitate in Home Assistant, or are they mutually exclusive?

I’ve never tried both integrations at the same time. What I’ve read is that it can be done but requires two coordinators, one for each integration.

I’m not clear. How did rolling back work for you? Was it on zha? I guess I’m really trying to understand what was working and what’s different now.

No. I think I said that before