Differences

This shows you the differences between two versions of the page.

doc:howto:usb.iptunnel [2013/01/23 18:59]
claudyus example as server
doc:howto:usb.iptunnel [2014/01/07 17:01] (current)
danitool
Line 5: Line 5:
-===== Server on OpenWrt - example =====+===== Server on OpenWrt =====
First install the usb kernel module and usbip server package: First install the usb kernel module and usbip server package:
<code> <code>
Line 11: Line 11:
</code> </code>
-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:+Now using the //usbip list -l// list the local usb devices available that can be exported, in the following example a hub, usb printer, and an optical mouse are shown:
<code> <code>
-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 root@OpenWrt:~# usbip list -l
Local USB devices Local USB devices
Line 26: Line 22:
        2-1.4:1.0 -> unknown         2-1.4:1.0 -> unknown
        2-1.4:1.1 -> unknown         2-1.4:1.1 -> unknown
 +
 + - busid 2-2 (093a:2510)
 +        2-2:1.0 -> unknown
 +
</code> </code>
-The information that you are looking for is **2-1.4** that is the BUSID for the target device.\\+The information that you are looking for is **2-2** that is the BUSID for the target device (an optical mouse).\\
Edit the /etc/rc.local and before the 'exit 0' add the follow lines: Edit the /etc/rc.local and before the 'exit 0' add the follow lines:
<code> <code>
usbipd -D & usbipd -D &
-echo "add 2-1.4" >> /sys/bus/usb/drivers/usbip-host/match_busid+sleep 1 
 +usbip bind -b 2-2
</code> </code>
-Using //netstat// you can see if every thinks works.+Using //netstat// you can see if everything works.
<code> <code>
root@OpenWrt:~# netstat -alpt root@OpenWrt:~# netstat -alpt
Line 43: Line 44:
tcp        0      0 0.0.0.0:3240            0.0.0.0:*              LISTEN      927/usbipd tcp        0      0 0.0.0.0:3240            0.0.0.0:*              LISTEN      927/usbipd
</code> </code>
 +
 +===== Client side (Arch-linux PC) =====
 +Install **usbip** in your PC
 +<code>[root@tool dani]# pacman -S usbip</code>
 +
 +Load the module for the client
 +<code>[root@tool dani]# modprobe vhci_hcd</code>
 +
 +List the available remote devices at OpenWrt (server side).
 +<code>[root@tool dani]# usbip list -r 192.168.1.1
 +Exportable USB devices
 +======================
 + - 192.168.1.1
 +        2-2: Pixart Imaging, Inc. : Optical Mouse (093a:2510)
 +          : /sys/devices/platform/bcm63xx_ohci.0/usb2/2-2
 +          : (Defined at Interface level) (00/00/00)
 +          :  0 - Human Interface Device / Boot Interface Subclass / Mouse (03/01/02)
 +</code>
 +
 +Attach the remote device
 +<code>[root@tool dani]# usbip attach -r 192.168.1.1 -b 2-2</code>
 +
 +If all went fine now you can move the mouse on your pc, but attached to the router with OpenWrt.
 +
 +===== Notes =====
  * http://www.howtoforge.com/how-to-set-up-a-usb-over-ip-server-and-client-with-ubuntu-10.04   * http://www.howtoforge.com/how-to-set-up-a-usb-over-ip-server-and-client-with-ubuntu-10.04

Back to top

doc/howto/usb.iptunnel.1358963952.txt.bz2 · Last modified: 2013/01/23 18:59 by claudyus