轉-usbip 試用記


 

https://download.csdn.net/download/jinpindi/9503667?utm_medium=distribute.pc_relevant_download.none-task-download-baidujs-2.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-download-baidujs-2.nonecase

http://usbip.sourceforge.net/

 https://github.com/wangyouqiang/usbip-server

 

usbip 試用記

 

由於老外的瓦力要用到網絡攝像頭,我們如果想借用他的程序,也得要一個網絡攝像頭。之前我搞定都是路由,重新買一個網絡攝像頭,價格不菲,好像有點浪費。於是想利用路由和攝像頭做類似的功能。

 

偶然在網上看到一篇文章,可以用Usb Over Network (也叫Usb Over IP)來將設備映射到windows系統,剛好可以實現我需要的功能。

http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=1777

 

按照文章的步驟,安裝usbip在我的RG100A (openWRT 10.03.1-rc6)上,看到類似如下的結果,就是openWRT服務端正確啟動了:

 

root@OpenWrt:/# usbip_bind_driver --usbip 1-1

** (process:903): DEBUG:  1-1:1.0       -> none

** (process:903): DEBUG: write "add 1-1" to /sys/bus/usb/drivers/usbip/match_busid

** Message: bind 1-1 to usbip, complete!

root@OpenWrt:/# usbipd -D

root@OpenWrt:/#

 

windows客戶端下載usbip_windows_v0.2.0.0_signed.zip(win7)或者usbip_windows_v0.1.0.0_signed(win XP),不知道是不是必須這樣搭配,反正我這樣試過是可以的。解壓了之后,這樣安裝一個虛擬USB設備(USB/IP Enumerator):

 

win XP:控制面板>添加硬件>下一步>是,我已經連接了硬件>添加新的硬件設備>安裝我手動從列表選擇的硬件(高級)>系統設備>從磁盤安裝>選擇USBIPEnum.inf

win7:設備管理器>操作>添加過時硬件>安裝我手動從列表選擇的硬件>系統設備>從磁盤安裝>選擇USBIPEnum.inf

 

然后打開命令窗口,去到解壓到目錄,首先查看可用設備,看到類似下面的結果,就是有可用設備。

 

D:\dev\OpenWRT\usbip_windows_v0.2.0.0_signed>usbip -l 192.168.1.155

- 192.168.1.155

     1-1: Z-Star Microelectronics Corp. : ZC0301 WebCam (0ac8:301b)

        : /sys/devices/platform/bcm63xx_ohci.0/usb1/1-1

        : Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)

 

        :  0 - Vendor Specific Class / Vendor Specific Subclass / Vendor Specifi

c Protocol (ff/ff/ff)

 

然后再運行 usbip -a 192.168.1.155 1-1,正常的話,windows就會提示找到USB設備,安裝驅動,就看到新的USB設備了。

 

比較神秘的是,如果你的電腦安裝了Daemon Tools,那是用不了usbip的,卸載了它才行。

 

安裝usbip已經依賴軟件,需要970k,如果要安裝在WR703N上,小標原來的固件是不夠空間的,不過我已經讓小標幫忙編譯了一個包含了usbip的固件了,測試過可用。

 

不過非常杯具的是,我的301攝像頭,掛載在win7下,驅動也安裝了,不過當使用的時候出現藍屏!win xp下,不藍屏但爆下面的錯誤:

 

usbip err: usbip_vbus_ui.c: 390 (write_to_dev) last error:87

usbip err: usbip_vbus_ui.c: 391 (write_to_dev) out:0 ret:0 len:56

usbip err: usbip_vbus_ui.c: 392 (write_to_dev) write dev failed

 

UVC 攝像頭同樣也可以掛載,不過在win7 和 win xp下,都提示無法安裝驅動!

 

看來傳聞沒錯,usbip還很不穩定,兼容性也差,看來我要放棄這個方案了。。

 

-------------------------------------

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.

Feb 21, 2011: Updated windows client driver to allow x64 operation. We have received signed versions from the ReactOS project. (This is needed to allow installation without workarounds on Win7/Vista x64.) ReactOS has the proper code signing certificate and offer its use to other open source projects React OS Driver Signing. Great initiative!

Jul 10, 2009: The preview release of usbip windows client is now available. See screenshots!

Jan 13, 2009: The latest drivers were recently included in the staging tree of Linux.

ABOUT

The 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. Original USB device drivers and applications can be also used for remote USB devices without any modification of them. A computer can use remote USB devices as if they were directly attached; for example, we can ...

  • USB storage devices: fdisk, mkfs, mount/umount, file operations, play a DVD movie and record a DVD-R media.
  • USB keyboards and USB mice: use with linux console and X Window System.
  • USB webcams and USB speakers: view webcam, capture image data and play some music.
  • USB printers, USB scanners, USB serial converters and USB Ethernet interfaces: ok, work fine.

It is currently implemented as Linux device drivers and available under the open source license GPL. Its I/O performance is enough practical in local area network for all types of devices, including isochronous devices, without any modification of Linux-original USB device drivers.

DOCUMENTATION

Overview

In a client host, the VHCI (Virtual Host Controller Interface) driver is implemented as a USB host controller driver. The VHCI driver emulates a real USB host controller interface for virtual attachment/detachment, enumeration and initialization of remote USB devices. It encapsulates USB request blocks and then transmits USB/IP requests to remote server hosts. In a server host, the Stub driver is implemented as a USB per-device driver. The Stub driver decapsulates USB/IP requests into USB requests and then submit them to real USB devices.

usbip-design

USB/IP Design Overview

  • USB/IP - a Peripheral Bus Extension for Device Sharing over IP Network. Takahiro Hirofuchi, Eiji Kawai, Kazutoshi Fujikawa, and Hideki Sunahara. In the Proceedings of the FREENIX Track: USENIX Annual Technical Conference, pp. 47-60, April 2005. (Awarded FREENIX Track Best Paper!)
  • USB/IP: A Transparent Device Sharing Technology over IP Network. Takahiro Hirofuchi, Eiji Kawai, Kazutoshi Fujikawa, and Hideki Sunahara. IPSJ Transactions on Advanced Computing Systems, Vol. 46, No. SIG11(ACS11), pp. 349-361, August 2005. (Also appeared in IPSJ Digital Courier.)

FAQ

  • "client" and "server" are confusing...
    A server host has physical USB devices which are exported to a client host. In the server host, load usbip_common_mod.ko and vhci-hcd.ko, and then use usbipd. The client host imports a USB device virtually; the client host may not have a real USB device. In the client host, load usbip_common_mod.ko and usbip.ko, and then use usbip.
  • USB/IP is stable?
    It basically works for most USB devices under LAN (Gb Ethernet is better). It has minimum features (e.g., attach/detach) and your contribution is welcome.
  • Is there a MS Windows client of USB/IP ?
    There is one now, it is in the early stage of development, you can try it. If it can't work for your USB devices, please report bug to us.
  • Does your USB/IP implementation have compatibility with other similar products?
    No, currently.

SCREENSHOTS

usbview

A remote USB webcam with an ov511 chip is virtually attached to a computer. We can see ov511 under USB VHCI Root Hub.

usbview screenshot

Desktop

xawtv is working for a remote USB webcam. A remote USB-HDD is also attached to the computer.

xawtv screenshot

DOWNLOAD

Linux

For Linux, the source code of usbip was merged into the staging tree, and finally has been moved to the mainline since Linux-3.17. Development is ongoing in the kernel community, not here. Linux distributions will provide binary packages of usbip. Just for historical records, the project page keeps old download files of the Linux version. Do not use them.

Windows

For Windows, the precompiled client-side program is available from the project page. You need a Linux machine for the server side.

See the git repository for the latest source code. Although, development has not been active lately. Feel free to fork the project.

Install and Usage

See README (possibly included in your binary package).

COMMUNITY

Mailing List

Public Forum

LINKS

CONTACT

Normally, please use the mailing list and forum (Recommended).

  • Takahiro Hirofuchi < hirofuchi (the character) users.sourceforge.net >


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。