Open Aaroneisele55 opened 2 months ago
@Aaroneisele55 The most recent update I made was adding a "shutdown" script https://github.com/irakhlin/hassio-usbip-mounter/blob/main/rootfs/usr/bin/unmount_devices
If you shutdown the addon it will correctly detach from the server and thus the device can be reconnected. Unfortunately if there is some kind of network error or power outage and the script does not run the detach will not happen. From playing around with usbip outside of home assistant I have noticed that this issue will occur regardless. If the client does not correctly detach from the server the server ends up in a weird state. I will have to look into this to see if its something that can easily be solved.
I just thought about it and I think I have found a possible solution:
If the add--on crashes due to not being cleanly detached at some point, couldn't we just run the detachment script (from #6 ) when usbipd crahes, and then reattach the devices so the problematic state is resolved
Hello, I use this add-on to connect a Warema Stick from a RPi 3 (USBip server) to my main RPI4 where HA runs. On the first start of the system (e.g after piwer outage) the add-on starts correctly and the connection stays active until some network error stops the connection. However, instead of detaching the device cleanly (so it can be reattached after a restart of the add-on), the add-on gets into some kind of error state where the device isn't available on the HA host, but is also not detached, leading to a fault that can only be fixed by restarting the USBip server.
The Log outputs the following message when attempting to reconnect while in this state:
The add-on should normally detach devices when stopped, but it doesn't do this in this case...
How could I fix this?
Best regards Aaron Eisele