Userspace USBIP server (i.e., "shares a USB device") implementation based on python-libusb1
APACHE-2.0 License
pyusbip
is a userspace USBIP server implementation based on python-libusb1
. (In USBIP, the 'server' has the physical USB device attached, and the 'client' has only a network cable attached; i.e., you run this if you have a USB device attached to your local machine that you'd like to be able to use on a different computer.)
It has been tested (for small values of "tested") on Mac OS X; it is, at least, sufficient to forward a Lattice MachXO3 eval kit to the Lattice programmer software.
Following is a rough recipe for getting started with forwarding a USB device using pyusbip
.
python-libusb1
installed: pip install libusb1
.python3 pyusbip.py
ssh you@target_machine -C -R 3240:127.0.0.1:3240
sudo usbip list -r 127.0.0.1
sudo usbip attach -r 127.0.0.1 -b 20-4
pyusbip
has many limitations. Much of the protocol is unimplemented; pyusbip
simply disconnects a device and drops a connection if it trips on that. In some cases, protocol violations in USBIP can cause the Linux kernel's entire USB stack to crash (!); for instance, if pyusbip
gets stuck transmitting half of a response URB, you may need to reboot the remote end before it'll come back to life. Following is a list of known limitations in pyusbip
:
pyusbip
gives up on a device if it can't claim all interfaces, rather than failing URBs with -EPERM
or some such. (This is a problem when exporting, say, a ST-Link board that also has a mass storage device, from OS X.)pyusbip
's control traffic is synchronous.pyusbip
does not keep track of what type of endpoint it's talking to, and as such, always sends bulk requests, even to interrupt or isochronous endpoints.pyusbip
does not implement isochronous endpoints at all.UNLINK
requests may send a spurious URB reply, which could confuse some clients.pyusbip
is unsupported. Please use the GitHub repository to submit patches. If you need to, you can contact the author.