USB Devices Disappearing

After a few hours the my SONOFF and FTDI USB devices no longer appear in the hardware list in the Settings-Hardware-All Hardware list and the sensors become Unavailable.

I am running HAOS on a dedicated PC.

I have the following USB devices directly connected to the USB ports on the PC:

  • PC Keyboard
  • Logitech Trackball
  • SONOFF Zigbee 3.0 USB Dongle Plus V2
  • USB FTDI FT232R USB UART (USB to RS485 adapter).

The USB to RS485 adapter is used to talk to a number of MODBUS sensors.

Restarting HA does NOT fix the problem, but rebooting the system DOES temporarily fix the problem.

After the ports disconnect, the dmesg | grep tty command gets the following response:

[ 3698.215335] ftdi_sio ttyUSB0: error from flowcontrol urb
[ 3698.216480] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0

Also in the dmesg log there are a lot of:

[ 3689.210218] usb 1-4: new full-speed USB device number 59 using xhci_hcd
[ 3689.337578] usb 1-4: New USB device found, idVendor=8087, idProduct=0a2a, bcdDevice= 0.03
[ 3689.337599] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 3691.071415] usb 1-4: USB disconnect, device number 59
[ 3691.071820] Bluetooth: hci0: sending initial HCI reset filed (-19)

Some Google results seemed to indicate that this could be BIOS settings problem, but I was unable to resolve it with any of the BIOS settings mentioned.

Using the information at https://web.archive.org/web/20120420112755/http://www.lesswatts.org/projects/devices-power-management/usb.php I found that the files:
/sys/bus/usb/devices/usb1/power/level
/sys/bus/usb/devices/usb2/power/level
contain “auto” which seems to mean they can automatically suspend operation.

Upon tyring to editing these files I get the message: read-only file system

So far I have been unable to find a way to edit these files.

Any help with this USB issue would be appreciated.

This is likely the issue to focus on. If this has been working fine until an HAOS upgrade, then its likely a kernel issue. If not, then it could be cable related (cable too long), or maybe its plugged into a USB Hub that barely has enough power to supply the device.

Another think to look for in dmesg is to see if the FTDI device automatically comes back after it disconnected. If it does, then its likely using a different /dev/ttyXX port, and this is somewhat common. The solution is generally to configure HA for /dev/serial/by-id/NAME-OF-FTDI-DEVICE as it will pick up the change in /dev/ttyXX

It has not worked right since I switched to HAOS – so I don’t think it is an HAOS upgrade issue. Previously I ran a virtual machine under Windows on the same hardware. It idid not have this issue, but it had other funky issues which is why I switched to HAOS.

The devices do NOT automatically come back when this happens. The only way to get them back is to reboot the PC.

I am using the /dev/serial/by-id/… way of referencing them.

Thank you for responding!