(libusb) Fail to open USB device on Windows XP


#1

Dear all,

While I use libusb-0.1.3-x86-mingw32 on Windows XP with the following
code


require “libusb”
usb = LIBUSB::Context.new
device = usb.devices(:idVendor => 0x058f, :idProduct => 0x6387).first
handle = device.open


I always get

‘raise_error’: LIBUSB::ERROR_NOT_SUPPORTED in libusb_open

In the code for ‘open’ (libusb.rb), it’s written

You need proper access permissions on:
Linux: /dev/bus/usb//

Here are my questions:

  1. Does my ‘fail to open’ comes from wrong access permission?
  2. How can I solve this problem on Windows XP?

BR
Emmanuel


#2

Can anybody kindly help me on this issue?
Please. Please. Please.
Thanks. Thanks. Thanks.


#3

Hi,

2012/3/30 Huang E. removed_email_address@domain.invalid


Here are my questions:

  1. Does my ‘fail to open’ comes from wrong access permission?
  2. How can I solve this problem on Windows XP?

BR
Emmanuel

According to the README.rdoc of libsub,
In contrast to Linux, any access to an USB device by LIBUSB on Windows
requires a proper driver installed in the system. Fortunately creating
such
a driver is quite easy with
Zadighttp://sourceforge.net/apps/mediawiki/libwdi/index.php?title=Main_Page.
Select the interesting USB device and press “Install Driver”. That’s it.
You may take the generated output directory with it’s INI-file and use
it
for driver installation on other 32 or 64 bit Windows systems

I installed Zadig at
http://sourceforge.net/apps/mediawiki/libwdi/index.php?title=Main_Page
After some trial and error, I could open usb device with device.open on
Windows XP.

I guess you can get more reliable answer if you submit an issue on the
libusb github (https://github.com/larskanis/libusb/issues)

Regards,

Park H.


#4

OK, I’ve added a hint for Windows to Device#open in
https://github.com/larskanis/libusb/commit/aabc9c57a4ab7958b9e828a67001c041c4d9cc25
.


#5

Dear Park,
After following you guidance, I can open usb device without error now.
Thank you very much.
Without your help, I can not make it.

BR
Emmanuel