User Tools

Site Tools


doc:howto:usb.iptunnel

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:usb.iptunnel [2013/01/23 18:59]
claudyus example as server
doc:howto:usb.iptunnel [2015/01/24 01:18] (current)
tmomas [Server on OpenWrt] Spelling, grammar, syntax and formatting corrected
Line 5: Line 5:
  
  
-===== Server on OpenWrt ​- example ​===== +===== Server on OpenWrt ===== 
-First install the usb kernel module and usbip server ​package:+**Since Barrier Breaker release USBIP packets are missing - there'​s difference in installation procedure** 
 + 
 +First install the usb kernel module and usbip server ​and client packages: 
 + 
 +//Attitude Adjustment://
 <​code>​ <​code>​
-opkg install kmod-usb-ohci usbip-server+opkg install kmod-usb-ohci usbip-server ​usbip-client
 </​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:+//Barrier Breaker://​ 
 +<​code>​ 
 +opkg install kmod-usb-ohci 
 +opkg install http://​downloads.openwrt.org/​attitude_adjustment/​12.09/​ar71xx/​generic/​packages/​usbip_1.1.1-2_ar71xx.ipk 
 +opkg install http://​downloads.openwrt.org/​attitude_adjustment/​12.09/​ar71xx/​generic/​packages/usbip-client_1.1.1-2_ar71xx.ipk 
 +opkg install http://downloads.openwrt.org/​attitude_adjustment/​12.09/​ar71xx/​generic/​packages/​usbip-server_1.1.1-2_ar71xx.ipk 
 +</​code>​ 
 +(The packages are installed from AA, but kernel modules would be installed from BB automatically to match kernel ver) 
 + 
 +Now use ''​usbip list -l''​ to list the local usb devices available that can be exported. In the following example ​hubusb 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 35:
          ​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**, which 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 ''​/​etc/​rc.local'' ​and before the ''exit 0'' add the following ​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>​
  
- +Use ''​netstat''​ to see if everything ​works:
-Using //netstat// you can see if every thinks ​works.+
 <​code>​ <​code>​
 root@OpenWrt:​~#​ netstat -alpt root@OpenWrt:​~#​ netstat -alpt
Line 43: Line 55:
 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.
 +
 +
 +===== Client side (Windows PC (incl. W7 x64) =====
 +Solution consists of 2 parts:
 +
 +1. Install Driver
 +
 +2. Start usbip tool
 +
 +1. Installing a driver could be a challenge - there is a signed drivers, included in 0.200 version of tool. Unfortunately the don't work anymore. at least for Win7 x64. Look through USBIP forum to find the latest compiled driver and tool. Unfortunately the Driver is not signed and in order to install it, you have to switch off Windows drivers signature check.
 +a)Download the working Driver and usbip tool here: [[http://​sourceforge.net/​p/​usbip/​discussion/​418507/​thread/​86c5e473/​]]
 +
 +b)Disable Windows Drivers check:
 +<​code>​
 +    Open a command prompt as an admin and type:
 +    bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
 +    bcdedit -set TESTSIGNING ON
 +    NOTE: Turning off driver signing is a security risk.
 +    If it doesn'​t work, for whatever reason, you can just remove loadoptions with bcedit and >switch testsigning off, though this is not recommended:​
 +    bcdedit /​deletevalue loadoptions
 +    bcdedit -set TESTSIGNING OFF
 +    For Windows 8.1, use the details on this page:
 +    [[http://​www.howtogeek.com/​167723/​how-to-disable-driver-signature-verification-on-64-bit-windows-8.1-so-that-you-can-install-unsigned-drivers/​]]
 +    And then restart Windows.
 +</​code>​
 +2. Use the tool usbip.exe, downloaded with the working driver.
 +<​code>​
 +a) usbip -l <HOST IP address> ​               to show all USB devices binded on the HOST
 +b) usbip -a <HOST IP address> <​BUSID> ​       to connect to particular Device.
 +</​code>​
 +:-D Tested on BB release. Working at least with USB Drives and Kvaser Leaf Lite CAN gateway.
 +
 +===== 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
doc/howto/usb.iptunnel.1358963952.txt.bz2 · Last modified: 2013/01/23 18:59 by claudyus