Add "usbip"/"ser2net" support to adapter/controller
usbipis a neat way to uncouple serial ports from the hardware. On one host serial devices are available and a usbip server offers them. When a remote system wants to use it it uses usbip client to "bind" the device.
All this indeed needs root rights and also to add some linux modules and I have no idea abount using this on windows (need to check). But the general idea would be:
- Yes the user needs to setup some stuff to have usbip server as needed and also that usbipclient can be used
- we add usbip command to the list of allowed actions for iobroker user
- When implementing #1018 we also could allow to provide an IP list of servers and fetch the available usbip ports too
- we add a method to bind a usbip device ... we need to find out how to get the info of the "resulting port"
With this we can add generic support for "remote usb ports"
Use case is unclear
I think the use case is to use USB or serial devices from another host in multi-host or later in ha mode, so very host with an adapter requiring a USB device can access it by IP instead of direct access (which is limited to one host only).
There is also a USBIP server and client for windows on https://github.com/cezanne/usbip-win
The use case is especially to unbind an iobroker host from "the USB stick needs to stick in that host". With usbip you can have the usb stick in "any host that runs usbip server" and can use it from "any other host that uses usbip client".
I use usbip to allow Proxmox (which is my "hosting" system) to offer all high-availability features that are not available when the usb stick is "forwarded to the VM/Container". In the meantime I use some small zeropi's to just act as "usbip hosts" and so I can much better place the iobroker machines.
If you need a usb, so you can install js-controller on it. And if the host is down, it is down with usbip server.... I don't understand the logic.
Or do you mean, that it could be situation, that js-controller is down, but usbip is running?
There are several reasons where you can not install iobroker on the host where the usb stick is on ... e.g if you use virtualized environments like proxmox or also docker or such. So you need to separate that and usbip is a way to separate the "hardware side" where USB stick is plugged in and "where do I use it". Maybe lets have a talk on that in person :-)
I think the main use case is that you don't need to have a full-blown iobroker installation on the satellite devices. E.g. You have a ioBroker host in the living room and a Pi Zero with just an RF module in the basement. The connection is over LAN. No need for updates or anything on the Pi Zero.
No need for updates or anything on the Pi Zero.
exactly ... or "update once a year" idea ;-)
The benefit to haveit in iobroker is the following: Currently I need to decide on system leven where iobrokeris installed which devices to bind so that they are available for use as a serial port (I did that as a custom systemd unit which runs on start. If iobroker would allow to automatically bind the device when the adapter is started and unbinds it when instance is ended it would be perfect :-)
RUDY wraps USB/IP in a Docker container, maybe interesting here.