USB over IP tunnel

USB/IP Project aims to develop a general USB device sharing system over IP network. To share USB devices between computers with their full functionality, USB/IP encapsulates "USB I/O messages" into TCP/IP payloads and transmits them between computers.

:!: This is reported to be working, but we lack a HowTo yet!

Server on OpenWrt - example

First install the usb kernel module and usbip server package:

opkg install kmod-usb-ohci usbip-server

Now using the usbip list -l list the local usb devices available that can be exported, in the following example an hub and usb printer is show:

root@OpenWrt:~# opkg install kmod-usb-ohci
Installing kmod-usb-ohci (3.6.11-1) to root...
Downloading http://test.ninux.org/~claudyus/brcm63xx/downloads.openwrt.org/snapshots/trunk/brcm63xx/packages//kmod-usb-ohci_3.6.11-1_brcm63xx.ipk.
Configuring kmod-usb-ohci.
root@OpenWrt:~# usbip list -l
Local USB devices
=================
 - busid 2-1 (05e3:0608)
         2-1:1.0 -> hub

 - busid 2-1.4 (04e8:344f)
         2-1.4:1.0 -> unknown
         2-1.4:1.1 -> unknown

The information that you are looking for is 2-1.4 that is the BUSID for the target device.
Edit the /etc/rc.local and before the 'exit 0' add the follow lines:

usbipd -D &
sleep 1
usbip bind -b 2-1.4 # bind the busid

Using netstat you can see if everything works.

root@OpenWrt:~# netstat -alpt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:3240            0.0.0.0:*               LISTEN      927/usbipd

Back to top

doc/howto/usb.iptunnel.txt · Last modified: 2013/02/13 06:54 by refack