(I blurred some kind of device ID. I didn’t know if this was supposed to be private or not, but just to be sure )
I figured out that whenever this happens, one of these issues appears:
The Sonoff dongle’s name in VirtualBox changes from “SONOFF Dongle Max MG24” to “Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light” and becomes unusable.
OR
The dongle doesn’t change its name and just becomes unchecked in enabled devices. Trying to re-enable it causes this error:
The only way I found to fix this is to physically reconnect the dongle, and sometimes restarting the VM as well.
What could be the problem? Dongle? Mini PC? VirtualBox?
If you need any logs or other data, please let me know what you need and how to obtain them. I’m trying to learn HA .
First, if it’s not on a 1 oe 2 meter extension cord, put one on there. It may be getting interference from a nearby radio source like another dongle, a USB3 port, or something else.
Second, if it is primarily happening ar restart, you have have this problem. The TTY ports can sometimes change internally, so it is suggested to use the /serial/by-id/ URL that always talks to your dongle by serial so it is always right.
You can find out what that is by using: Link to Hardware – My Home Assistant
and looking for it under all hardware, something like this:
Once you have the long URL use that instead of the ttyxxx one.
If you are using a Container installation, this is how to see the /serial/by-id/ URL: ls -l /dev/serial/by-id
I set the dongle in HA using the /serial/by-id and my ZigBee network hasn’t failed in a few days! Restarting the OS or the VM also seems fine for now.
However, if I reboot the host machine, the problem is back. VirtualBox doesn’t see the “SONOFF Dongle Max MG24” device, but only “Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light”, which cannot be used anyways. I still have to physically reconnect the dongle for it to appear in VirtualBox.
Any power saving option that is active on the Windows side? If you don’t use this machine for anything other than running the HAOS vm I strongly suggest ditching Virtualbox and go for either HAOS bare metal or Proxmox.
Makes no sense to have to deal with the instability when you have a bunch of connection options on your dongle.
Skip the whole USB passthrough thing and connect your Sonoff Max via PoE (or use ethernet and use the USB simply for providing power).
If you go the above route, note 2 things:
You’ll have to nuke your ZHA install and redo the integration setup to use tcp.
Your dongle will lose power temporarily if you reboot the entire host machine if you keep using its USB port for power. Generally it’s not an issue because your entire HA instance (including ZHA) will also be rebooting. However, if you want to avoid this, use an old phone charger or some other USB device which doesn’t get rebooted as frequently as a power source.
I finally switched to Proxmox (been planning to do so for some time now), and the issue seems to no longer appear. I guess this was caused by Windows or VirtualBox…
Leaving this here for any potential future visitors.