0

I'm making a java GUI application (javafx) that calls a python script (python2.7) which detects connected devices. The reason for this is so I can automate my connections with multiple devices.

In my python script, I use pyusb. However to detect a device, I have to use inf_wizard.exe from libusb-win32 to communicate with the device. This is fine for my own development and debugging, but what happens if I wish to deploy this app and have other users use this?

Would this app, on another computer, be able to detect a device?

Thanks

Please let me know if there is a better way to doing this.

  • haha you seem to have quite a few languages covered in this. your design does seem very fragmented. what are these devices? usb drives? – Debosmit Ray May 09 '16 at 22:44
  • The devices are eval boards. haha ,ya, first time doing this so I believe my methods is the best way (aside from QT/C++ for the gui). Please let me know if you have any other suggestions! – user3773673 May 09 '16 at 22:57

1 Answers1

0

No, in most (Windows) scenarios this will not work. The problem is that libusb on Windows uses a special backend (libusb0.sys, libusbK.sys or winusb.sys). You have to install one of those backends (libusb-win32 is libusb0.sys) on every machine you want your software to run on. Under Linux this should work fine out of the box.

Essentially you have to ship the files you generate with inf_wizard.exe with your software and install the inf (needs elevated privileges) before you can use the device with your software.

dryman
  • 660
  • 6
  • 16
  • Thanks for the reply! Are there alternative methods that don't require the use of special backend (usb4java etc.)? – user3773673 May 10 '16 at 18:58
  • No not that I know of. The problem is you sadly need a kernelland driver to communicate with from userland and Windows afaik does not provide a way to silently switch kernel modules. In future this will become much easier because more and more Windows uses its own backend WinUSB for devices. From Windows 10 onwards many devices use it as default and therefore you don't have to switch kernel modules and can simply switch the userland software if it supports WinUSB. For cases with selfbuild hardware like it seems to be the case with your device this will still be no solution I'm afraid. – dryman May 11 '16 at 07:49