Sonoff CC2531 Zigbee USB configuration with ZHA hanging

Hello,

I am new to the home automation world (don’t really have experience, until now I had only my vacuum connected to HA) and I bought a Sonoff CC2531 Zigbee USB dongle as I have seen it is compatible with ZHA from factory.
My setup is as follows : host server with a Debian VM on which I have a docker container with HA. I made the pass through for the USB dongle from the host to the VM and I added the necessary lines in my docker-compose in order to have the dongle visible in the container. On the VM the dongle is seen as :

[9257779.403887] usb 3-2: new full-speed USB device number 2 using uhci_hcd
[9257779.871033] usb 3-2: New USB device found, idVendor=0451, idProduct=16a8, bcdDevice= 0.09
[9257779.871039] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[9257779.871042] usb 3-2: Product: TI CC2531 USB CDC
[9257779.871044] usb 3-2: Manufacturer: Texas Instruments
[9257779.871047] usb 3-2: SerialNumber: __0X00123456789
[9257779.929204] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[9257779.935354] usbcore: registered new interface driver cdc_acm
[9257779.935357] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

In the container, if I check for usb and serial devices, the dongle is present :

bash-5.1# ls -lha /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00123456789
crw-rw----    1 root     dialout   166,   0 Aug 20 22:48 /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00123456789
bash-5.1#

So everything seems OK.
Now when I go in HA and try to add the ZHA integration, it asks for the radio type, I choose ZNP. Then it asks for the path, I insert the path found above and I let the port speed as it is (115200).
After submitting, it just hangs on the spinning circle.
After activating debug logs, all I get when doing the same steps again is below and nothing after :

2021-08-20 22:48:43 INFO (MainThread) [homeassistant.setup] Setting up zha
2021-08-20 22:48:43 INFO (MainThread) [homeassistant.setup] Setup of domain zha took 0.0 seconds
2021-08-20 22:48:43 DEBUG (MainThread) [zigpy.appdb] Current database version is v6
2021-08-20 22:48:43 DEBUG (MainThread) [zigpy.appdb] Loading application state
2021-08-20 22:48:46 INFO (MainThread) [zigpy_znp.zigbee.application] ZNP is not configured, forming a new network

It is just like it hangs at “forming a new network”.
I also tried to map the dongle in /dev/ttyACM0 instead of the path by-id and when doing all the steps the first screen lists only /dev/ttyACM0 (not the list of radio types) and after submitting, it also hangs.
After it hangs (several minutes with the spinning circle) I refresh the page and on the integrations page, the ZHA integration appears as “Not loaded”.
I then decided to let it spin for more time and the result was an “Unknown error” (and still nothing in the logs) :

0123

Has someone managed to get this to work in HA?
Am I missing something?
Am I doing something wrong?

For reference :

System Health

version: core-2021.8.0
installation_type: Home Assistant Container
dev: false
hassio: false
docker: true
user: root
virtualenv: false
python_version: 3.9.6
os_name: Linux
os_version: 4.19.0-17-amd64
arch: x86_64
timezone: Europe/Paris


logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok


dashboards: 3
resources: 0
views: 9
mode: storage

On your VM, do you have modemmanager running ?
It can be a problem to have it running…

What firmware is on the cc2530?

I don’t think it is installed :

root@home-assistant:~# dpkg -l | grep modem
root@home-assistant:~# 
root@home-assistant:~# apt-cache search modemmanager
gir1.2-modemmanager-1.0 - données d'introspection GObject pour modemmanager
libmm-glib0 - service D-Bus pour gérer les modems − bibliothèques partagées
libmm-glib-dev - service D-Bus pour gérer les modems – fichiers de développement de la bibliothèque
libmm-glib-doc - service D-Bus pour gérer les modems – documentation de la bibliothèque
modemmanager - service D-Bus pour la gestion des modems
modemmanager-dev - service D-Bus pour gérer les modems – fichiers de développement
modemmanager-doc - service D-Bus pour gérer les modems – fichiers de documentation
hdmi2usb-udev - udev rules for HDMI2USB devices
modem-manager-gui - GUI front-end for ModemManager / Wader / oFono
modem-manager-gui-help - GUI front-end for ModemManager / Wader / oFono - documentation
libkf5modemmanagerqt-doc - Qt wrapper library for ModemManager (documentation)
libkf5modemmanagerqt6 - Qt wrapper library for ModemManager
modemmanager-qt-dev - Qt wrapper for ModemManager - devel files
root@home-assistant:~#

How can I check the firmware version?
Is it possible from HA?

I just checked HA logs and I see :

2021-08-21 02:48:43 DEBUG (MainThread) [zigpy.topology] Starting scheduled neighbor scan
2021-08-21 02:48:43 DEBUG (MainThread) [zigpy.topology] Finished scanning neighbors for all devices
2021-08-21 06:48:43 DEBUG (MainThread) [zigpy.topology] Starting scheduled neighbor scan
2021-08-21 06:48:43 DEBUG (MainThread) [zigpy.topology] Finished scanning neighbors for all devices
2021-08-21 10:48:43 DEBUG (MainThread) [zigpy.topology] Starting scheduled neighbor scan
2021-08-21 10:48:43 DEBUG (MainThread) [zigpy.topology] Finished scanning neighbors for all devices

I tried to add again the ZHA integration but it still gives me the error from the screenshot in the first post (without any error in the logs).

Hello,

Just for information, I got it working.
I just inserted the usb dongle in another port and now it is working as expected (I don’t know why it didn’t work in the first usb port).
I even got to connect a temperature and humidity sensor :slight_smile:
I’m starting to link this Zigbee thing :slight_smile:

Thanks for your help.

1 Like