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) ~[?:?]
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
(
syspath=“${sysdevpath%/dev}”
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”
)
done
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:
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.
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.