Zigbee2MQTT Addon with Sonoff Dongle won't start

Hi, I have flashed the latest firmware into a new SONOFF Dongle and followed the instructions to install and configure Zigbee2MQTT but I got the following log when trying to start the Add-On:

Zigbee2MQTT
[21:46:54] INFO: Preparing to start...
[21:46:55] INFO: Socat not enabled
[21:46:55] INFO: Zigbee Herdsman debug logging enabled
[21:46:56] INFO: Starting Zigbee2MQTT...
/app/node_modules/zigbee-herdsman-converters/devices/icasa.js:1
<
^
SyntaxError: Unexpected token '<'
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1055:15)
    at Module._compile (node:internal/modules/cjs/loader:1090:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/node_modules/zigbee-herdsman-converters/index.js:118:30)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)

Below also my configuration:

data_path: /config/zigbee2mqtt
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
mqtt:
  server: mqtt://core.mosquitto
serial:
  port: /dev/ttyusb0
zigbee_herdsman_debug: true

I took of course the path from the Hardware information.
I tried also the simpler path: /dev/ttyUSB0, but the same appears.

Anyone able to help?
Thanks a lot!!

I do not own a Sonoff dongle.
Howerver, I’ve come across other similar post that the solution was to add " adapter: ezsp " In the serial settings.

adapter: ezsp
port: >-
  /dev/serial/by-id/My_dongle_serial_ID

Hope it works for you.

2 Likes

Yep there are two sonoff dongles the -E and the -P. See

from https://itead.cc/product/zigbee-3-0-usb-dongle/

It should be the P. The E would have a “v2” in the device string.

BUT…

I don’t think the device string is complete. It may vary by revision, but mine all start as “usb-ITead_Sonoff…”

The screenshot is missing the “ITead.”

*** !!! ***
EDIT:
*** !!! ***

I shouldn’t do drive by replies. I wasn’t looking closely enogh (ie: virtually blind). I don’t know what it is. Completely missed the Silicon Labs in the device string.

Still, the “E” adapter has had “v2” in the device strings I have seen.

The “P” has had a couple revisions, and the serial chip in the “P” is SI Labs to confuse things.

simple enough, type

ls -l /dev/serial/by-id/*

Hi Akriss, thanks a lot for the suggestion.
I tried this but it doesn’t work either unfortunately…

Hi Nickrout, when I purchased I wanted to make sure that I was buying the option with the TI Chip CC2652P. Knowing that TI is having issues to produce this chip, there were not really many options, but I found it.
I took I picture when I opened to flash to the newest firmware (which worked succesfully). So I think I have pretty much the ZBDongle-P with TI Chipset.
See the picture I took before closing the case:

The below is what I get in the “All Hardware” Information for the corresponding USB Port
Important to mention that I’m running HA from VirtualBox. I had to do the tricky to have the USB recognized in Home Assistant following instructions in a different forum, but I think I’m now through.

ttyUSB0
/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
Subsystem:
tty
Device path:
/dev/ttyUSB0
ID:
/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
Attributes:
DEVLINKS: >-
  /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
  /dev/serial/by-path/pci-0000:00:06.0-usb-0:2:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: /devices/pci0000:00/0000:00:06.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:06.0-usb-0:2:1.0
ID_PATH_TAG: pci-0000_00_06_0-usb-0_2_1_0
ID_REVISION: '0100'
ID_SERIAL: Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001
ID_SERIAL_SHORT: '0001'
ID_TYPE: generic
ID_USB_DRIVER: cp210x
ID_USB_INTERFACES: ':ff0000:'
ID_USB_INTERFACE_NUM: '00'
ID_VENDOR: Silicon_Labs
ID_VENDOR_ENC: Silicon\x20Labs
ID_VENDOR_ID: 10c4
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '1078944339'

Some tip’s for VirtualBox usb connected devices that might be of help.

https://forums.virtualbox.org/viewtopic.php?f=35&t=82639#p390398

Hope it’s of help.

Check ownership and permissions of the device.

Hi Nickrout, how do I do this?

Hi Akriss, I took a look on this document and tried to troubleshoot what possible was.
It looks like VirtualBox is detecting the Dongle. I created the filter as said in this document and I can see poping in and out as I plug/unplug the device.
When I place the mouse over I can see the following status in the running VM:

USB Status

Interesting is that I see the Dongle with State: Captured, while all others are showing State: Busy. Example below for the Mouse (same State for all others):
Mouse

The Dongle seems to be visible also in Home Assistant, since I can see it in and out in Hardware Information as long as I plun and unplug the dongle.

I noticed that I had not installed the driver of Sonoff before. I did it after creating this post, re-started my PC and VirtualBox but unfortunately the status and result is the same…

Any hints are still very welcome!

Just did in my Terminal, this is the result:

No expert on virtualbox sorry so I don’t think I can suggest anything else.

Thanks in any case!

It looks like that the interface through Virtual Box works fine as I can see the effect of plug/unplug.

Interesting to mention is that the dongle doesn’t show up in the Integrations as discovered. So not sure if there is any conflict with ZHA that I have setup.

I flashed the latest firmware from Github (thanks Koenkk (Koen Kanters)), but the result is the same.

Anyone else with some hint where to check?

Since you have exhausted everything else maybe try installing z2m standalone in its own VM and see if that works? If not then you should raise an issue on the z2m github.

So you have set up ZHA? You can’t use Z2M and ZHA on the same dongle. This would be a very good reason why it isn’t working.

Hi Nickrout, thanks. But this is not the case. I’ve just given a try to see if the Dongle would be recognized by ZHA, but it is not the intention to run both platforms together. My intention is to migrate from ZHA to Z2M.
But reading some threads, it was expected that the Dongle would appear as a discovered device in the integrations page, and this was not the case. So I tried to discover the device with the current ZHA, but no result.

Is ZHA showing in this page? Open your Home Assistant instance and show your integrations.

Yes, I can see it. I didn´t mention but I have the Zigbee devices configured with ZHA and I want to migrate them to Z2M when the platform is ready and configured.

image

ZHA is working fine, but I got convinced that Z2M is more stable and since I want to have my whole lighting and heating system integrated, I want to make sure I have the most stable solution.