Forum: Ruby (libusb) Fail to open USB device on Windows XP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F448197aa1306b8fc3db00c4255bfd61?d=identicon&s=25 Huang E. (ruby2012)
on 2012-03-30 09:53
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/<bus>/<dev>

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
F448197aa1306b8fc3db00c4255bfd61?d=identicon&s=25 Huang E. (ruby2012)
on 2012-04-09 02:47
Can anybody kindly help me on this issue?
Please. Please. Please.
Thanks. Thanks. Thanks.
6b30988765054d7a8f69741b684625bf?d=identicon&s=25 Heesob P. (phasis)
on 2012-04-09 03:28
(Received via mailing list)
Hi,

2012/3/30 Huang Emmanuel <lists@ruby-forum.com>

> *******************************
>
> 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
Zadig<http://sourceforge.net/apps/mediawiki/libwdi/index....
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...
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 Heesob
F448197aa1306b8fc3db00c4255bfd61?d=identicon&s=25 Huang E. (ruby2012)
on 2012-04-10 03:51
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
E4a2acaf3058cc9b321bcbcee859eb71?d=identicon&s=25 Lars K. (larskanis)
on 2012-04-17 21:57
OK, I've added a hint for Windows to Device#open in
https://github.com/larskanis/libusb/commit/aabc9c5...
.
This topic is locked and can not be replied to.