Sonoff USB Dongle-E doesn't work for ZHA or Zigbee2MQTT

Home Assistant OS: 9.5
Home Assistant Core: 2023.2.3
Zigbee2MQTT: 1.30.1

OK so when I got the dongle, I did the following:

  • Flashed ncp-uart-sw_6.10.3_115200.gbl
  • Flashed nvm3_initfile.gbl
  • Found device on system.
  • Pointed Z2M to it (tried /dev/ttyACM0 and /dev/by-id equivalent)
  • Added “adapter: ezsp”
  • Pointed it to the Mosquitto addon

The Zigbee-Herdsman fails:

[22:44:55] INFO: Preparing to start...
[22:44:56] INFO: Socat not enabled
[22:44:57] INFO: Zigbee Herdsman debug logging enabled
[22:45:00] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:debug 2023-02-12 22:45:11: Loaded state from file /config/zigbee2mqtt/state.json
Zigbee2MQTT:info  2023-02-12 22:45:11: Logging to console and directory: '/config/zigbee2mqtt/log/2023-02-12.22-45-11' filename: log.txt
Zigbee2MQTT:debug 2023-02-12 22:45:11: Removing old log directory '/config/zigbee2mqtt/log/2023-02-12.16-46-47'
Zigbee2MQTT:info  2023-02-12 22:45:11: Starting Zigbee2MQTT version 1.30.1 (commit #unknown)
Zigbee2MQTT:info  2023-02-12 22:45:11: Starting zigbee-herdsman (0.14.89)
Zigbee2MQTT:debug 2023-02-12 22:45:11: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","databasePath":"/config/zigbee2mqtt/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"ezsp","path":"/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20221029133821-if00"}}'
2023-02-13T03:45:12.465Z zigbee-herdsman:adapter Failed to validate path: 'Error: spawn udevadm ENOENT'
2023-02-13T03:45:12.474Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20221029133821-if00","adapter":"ezsp"},"databasePath":"/config/zigbee2mqtt/database.db","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","backupPath":"/config/zigbee2mqtt/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2023-02-13T03:45:12.484Z zigbee-herdsman:adapter:ezsp:uart Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20221029133821-if00","baudRate":115200,"rtscts":false,"autoOpen":false}
2023-02-13T03:45:12.526Z zigbee-herdsman:adapter:ezsp:uart Serialport opened
2023-02-13T03:45:12.528Z zigbee-herdsman:adapter:ezsp:uart Uart reseting
2023-02-13T03:45:12.529Z zigbee-herdsman:adapter:ezsp:uart --> Write reset
2023-02-13T03:45:12.534Z zigbee-herdsman:adapter:ezsp:uart --> [1ac038bc7e]
2023-02-13T03:45:12.662Z zigbee-herdsman:adapter:ezsp:uart <-- [11]

The error seems to vary. One that I commonly see is related to “unable to write frame”. Which makes me think the device lacks write access.

So I uninstall Z2M, reboot, and try ZHA. It detects the device, but simply gives “Unknown error”. So I found the log.

Error handling request
10:53:45 PM – (ERROR) runner.py
Attempted to use a closed event loop
10:53:44 PM – (WARNING) components/zha/radio_manager.py
Lost serial connection: SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')
10:53:39 PM – (ERROR) /usr/local/lib/python3.10/site-packages/bellows/uart.py
Error doing job: Task was destroyed but it is pending!
10:53:33 PM – (ERROR) runner.py - message first occurred at 10:53:33 PM and shows up 2 times

Looks like the device is being hogged, right?
So it’s time for “ls -l /proc/[0-9]/fd/ | grep /dev.ttyACM0” to see what process is using it.
Nothing.

So I figure maybe it’s a matter of not having write access.
I try doing chmod in the terminal. Apparently HA users aren’t linux users. But even when I try adding permissions to root, it tells me “The Operating System is read-only.”

So at this point I’m a little confused as to how this all just “works” for everyone else. Most people’s issue is with pairing or MQTT. I can’t even get started on these things with mine.

I’ll post some other logs as they appear.

Error handling request
11:10:33 PM – (ERROR) runner.py
Not a valid message: not enough values to unpack (expected 5, got 0)
11:10:28 PM – (WARNING) runner.py
Error decoding message from gateway, bad data received: �
11:10:28 PM – (WARNING) runner.py

EDIT: Nope. This wasn’t the issue. It worked once but after a reboot, everything is back to where it was.

OK I think I found the issue. Check out my power status. Last night, I switched the included 5v 3a power supply with a 5.1v 4A supply. Then I moved all my USB peripherals to an external USB hub powered by 12v 4A. You can see the exact point at which everything cleared up.