This is to use a USB port on a server PC on the LAN to connect any devices attached to that port over the LAN from a client PC.
As much as everything below in on an Ubuntu client and server PC, it could just as easy be on a Raspberry PI, etc. On both my Ubuntu PC’s usbip was already installed, otherwise just look up how to isntall it on your system using duckduckgo.com or get on of the AI search engines to look it up for you and just hold thumbs it works.
Firstly, on the server :
sudo modprobe usbip_host
sudo modprobe usbip_core
sudo modprobe usbip_common_mod
Then, to find the port on the server run this on the client :
usbip list -l
Then, also on the server, to bind the port and run the daemon run this :
sudo usbip bind -b 1-1
sudo usbipd -D
Lastly on the server, make sure ufw allows th traffic on the port :
sudo ufw allow 3240/tcp
Then, on the client, where the IP address is the server’s IP address run this :
sudo modprobe vhci_hcd
sudo usbip attach -r 192.168.101.35 -b 1-1.4.4
So view which port it’s on, you can use this :
ls -l /dev/ttyUSB*
So after that, when rebooting, etc, just run the following on server :
sudo modprobe usbip_core
sudo modprobe usbip_host
sudo usbipd -D
sudo ufw allow 3240/tcp # Only if UFW is enabled
… and on the client :
sudo modprobe vhci_hcd
sudo usbip attach -r 192.168.101.35 -b 1-1.4.4
If you have to restart the laser, without restartign the server just do this on the server to re-bind :
sudo usbip bind -b 1-1.4.4
..and this on the server:
sudo usbip attach -r 192.168.101.35 -b 1-1.4.4