[zigbee] Sonoff Zigbee 3.0 USB Dongle "ZBDongle-E" not working

openhab 4.0.3 on Raspberry Pi

Hi all. I’m completely new to Zigbee and I’m trying to get my newly acquired Sonoff “ZBDongle-E” working. During my testing in the past days, I had it identifying a couple of devices, but not delivering their data. It now fails to initialise properly itself, so I deleted the Zigbee devices and tried to interpret the logs. Unfortunately I couldn’t identify where the problem might be.

I guess the key information in the log is:
2023-11-13 11:22:22.207 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: Cannot invoke “com.zsmartsystems.zigbee.dongle.ember.internal.transaction.EzspTransaction.getResponse()” because “transaction” is null
at com.zsmartsystems.zigbee.dongle.ember.EmberNcp.getConfiguration(EmberNcp.java:488) ~[?:?]
at com.zsmartsystems.zigbee.dongle.ember.internal.EmberStackConfiguration.getConfiguration(EmberStackConfiguration.java:72) ~[?:?]
at com.zsmartsystems.zigbee.dongle.ember.ZigBeeDongleEzsp.initialize(ZigBeeDongleEzsp.java:439) ~[?:?]
at com.zsmartsystems.zigbee.ZigBeeNetworkManager.initialize(ZigBeeNetworkManager.java:418) ~[?:?]
at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.initialiseZigBee(ZigBeeCoordinatorHandler.java:431) ~[?:?]
at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.lambda$2(ZigBeeCoordinatorHandler.java:557) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

A full copy of the openhab.log can be downloaded here: We Transfer Gratuit. Envoi sécurisé de gros fichiers.

Well, This bit would be stopping it:
Failed to read: Serial port /dev/ttyUSB0 not found or port is busy… Closing connection and trying again in 2 seconds

Which means something else has taken that port or the user you are running the commands is not in the dialout group.

Thanks @ubeaut for looking into this. Sorry for my delayed reply, as I was away for a few days with work.

/dev/ttyUSB0 is in use by my IR SmartMeter reader and it regularly showed these messages before I connected the ZBDongle. As such, I mentally filtered out these messages. As far as I can tell, these devices aren’t fighting about which one gets to use ttyUSB0 (but I’m fairly new to this, so perhaps I’m wrong).

lsusb produces the following:

Bus 001 Device 005: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2
Bus 001 Device 004: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The following script also seems to show that they’re both happy:

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
devname=“$(udevadm info -q name -p $syspath)”
[[ “$devname” == “bus/”* ]] && exit
eval “$(udevadm info -q property --export -p $syspath)”
[[ -z “$ID_SERIAL” ]] && exit
echo “/dev/$devname - $ID_SERIAL”

Results in:

/dev/ttyUSB0 - Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001
/dev/ttyACM0 - ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230508192831

I’m wondering if the issue might be caused by compliancy problems with the Tuya devices?

I use Tuya devices and have no issues but I am using zigbee2mqtt.
My dongle is the Sonoff Zigbee 3.0-P and flashed with the latest firmware that is on the zigbee2mqtt site.

If you do a ls -l /dev/ttyUSB0 and ls -l /dev/ttyACM0 and see who owns them and what group.

It is strange that the port I am using /dev/zigbeeusb as I have renamed it to that so I know what it is.
Here is the udev rule:

SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0666", GROUP="dialout", SYMLINK+="zigbeeusb"

which is the same as your:

Bus 001 Device 004: ID 10c4:ea60 Silicon Labs CP210x UART Bridge

And this is what I am using in the zigbee2mqtt configuration:

  port: /dev/zigbeeusb

Does it work if you remove the other usb device?

Maybe if you set a udev rule:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE="0666", GROUP="dialout", SYMLINK+="zigbeeusb"

Create a rule for example /etc/udev/rules.d/40-zigbeeusb.rules

After restarting udev you should see /dev/zigbeeusb

Then use that as your port.

Worth a try.

@ubeaut, thanks for your answers.

Since I’m new to Zigbee, I had decided to upgrade from OH3 to OH4 before starting with it. That gave me another headache (Memory usage with Openhabian OH4, Raspberry Pi 3 Model B), which I’ve now resolved by installing the 32-bit OS.

Sometimes I get the message “No supported clusters found” as reported here: OH3: ZigBeeThingHandler] - No supported clusters found (70 down lights down the drain?!) - #12 by chris, so I tried OH 4.1.0-M3 and then the latest snapshot, hoping that Update ZSS library to 1.4.12 by cdjackson · Pull Request #809 · openhab/org.openhab.binding.zigbee · GitHub would solve my problem, but no luck.

I checked the ownership of /dev/tty*0 and they’re both with the group dialout. I also tried without the other USB device and get the same behaviour. Since I’m getting a lot of zigbee messages in the log (I changed the log level to debug) and they all seem okay (to my untrained zigbee eye), I don’t think there’s actually a problem with the Sonoff. This is further supported by the fact that some other zigbee devices correctly registered and return data. I just happened to start with one of the device types that doesn’t work.

I think I’m at the point where I try zigbee2mqtt and see if it works better, but that’ll have to wait now until I have a little more time.

Thanks again for your help :slight_smile:

Out of curiosity: Did you get it to work in the OH binding or in z2m? I did not get my new ZBDongle-E to work in the openHAB binding but on a test installation on z2m without problems.

No, I didn’t get it to work directly with the binding and I had to go down the z2m route. Obviously that involves some extra effort and results in a more complex configuration, but at this stage everything is working fine. For now, I only have read-only devices (temperature & humidity sensors), so I’m intrigued to see how things go when I get around to adding the first device that should be actively controlled.

To be fair: I got sold a P-Dongle as an E-Dongle, hence the inability to get it to work with the binding.