Zigbee USB only works if added after boot

Hi

I have been using a SLZB-06 via network connection for quite a while. Recently the slab-06 developed a fault and could no longer be used as a network coordinator. SMLight support have been great and are sending me a replacement. All good so far apart from the fact it will take some weeks to arrive.

So I have switched the coordinator into USB mode, that’s done using the little button on top if you wanted to know. Homeassistant finds the device and I have changed my config to match the device location ( I am using Z2MQTT and have tried this on a physical NUC and a Proxmox VM). Now here is where the fun begins. If I start from a powered down state with everything plugged in Homeassistant starts but Z2MQTT cannot connect to the adapter I get error

“Error: Error Resource temporarily unavailable Cannot lock port”

I, homeassistant and Z2MQTT can see the device is present and has the right address of ttyUSB0 as I have put in the config. First troubleshooting step I took was to set Z2MQTT to not start at boot so I could confirm the device was present. Unfortunately this results in the same error.

Second attempt at a resolution

  1. Switch off machine
  2. Unplug SLZB-06
  3. Start machine and wait for Homeassistant to fully start
  4. Plugin SLZB-06
  5. Start Z2MQTT add-on

Magic everything works. Zigbee network is up and all devices reporting in.

My assumption therefore is that something in the HASSOS is attaching to the adapter during boot. Unfortunately I have not been able to find a way of locating this.

Any ideas or suggestions would be greatly appreciated. My work around is great but requires me to be able to unplug/plug the adapter Just waiting for the power cut when I am away from home to cause me issues :frowning:

That’s what the error (“Cannot lock port”) indeed suggests.

I don’t know if HAOS comes with common Linux tools, but if so, open a Terminal and run the following: sudo lsof /dev/ttyUSB0

The command lsof (“list open files”) should show if there are any processes that are using the device.

Could it be that ZHA is enabled? Look here for more information, it sounds very similar to your situation.

Hi

Thank you for replying. I had tried to work out the issue using lsof but to no success. However your comment about ZHA lead me to look at my configured devices/intergrations. That is when the lighting bolt hit. I have been rather stupid. I have some old config in my config yaml to use the MODBUS integration and guess what I had it configured to use a serial device on ttyUSB01.

Once I had removed this config everything works from a cold boot as expected.

Thank you for helping me find my mistake.

1 Like

I know you marked your issue as solved, but here’s an extra tip. Don’t use the /dev/ttyUSB path when setting up the integration. Use the /dev/serial/by-id/ instead. This way you’re guaranteed the path won’t change even if you plug your device in a different port.

More info on how to do this can be found in the ZHA docs in the paragraph immediately above this shortcut

1 Like

Thanks for the advice switched over.

1 Like