Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the WinUSB API as a backend. #209

Open
Elemecca opened this issue Aug 15, 2018 · 9 comments
Open

Support the WinUSB API as a backend. #209

Elemecca opened this issue Aug 15, 2018 · 9 comments

Comments

@Elemecca
Copy link

Elemecca commented Aug 15, 2018

Is there any reason (other than that no one has written it yet) that the WinUSB API isn't supported directly as a backend? It should be possible to call it directly via ctypes like the other backends.

I'm happy to attempt the implementation myself, I just want to know before I get too far into the project if there's anything significant that's prevented it being done before now.

@mcuee
Copy link
Member

mcuee commented Aug 18, 2018

FYI there is this WinUSBPy. I have not tried it though.
https://github.com/felHR85/WinUsbPy.git

FYI also: pyusb already has the libusb-1.0 backend which supports device using WinUSB driver.

On the other hand, I think it is not a bad idea to add WinUSB backend for Windows, in that case, you do not need to have libusb-1.0.dll.

@Elemecca
Copy link
Author

Yeah, my goal in adding direct WinUSB support is to allow pyusb applications to work on Windows after just a pip install with no need to separately download and install libusb.

@altear
Copy link

altear commented Jan 12, 2019

Any luck on this?
I'm getting an Operation not supported or unimplemented on this platform when I try to use the libusb1 backend from Windows10

@Elemecca
Copy link
Author

@altear it's coming along slowly. It's not a high priority project, just something I'm working on in my free time.

That said, you shouldn't need my direct WinUSB support to use pyusb on Windows. The libusb1 backend should work, but it does need libusb-1.0.dll. Unfortunately this issue isn't the right venue for help with the libusb1 backend.

@mcuee
Copy link
Member

mcuee commented Aug 10, 2021

Main difference is that Zadig (or libusbk inf wizard) does not install libusb-1.0.dll, only libusb0.dll and libusbk.dll, so that libusb-0.1 backend will work out of the box, if you use Zadig. So you need to add libusb-1.0.dll to the right location, in order to use libusb-1.0 backend under Windows.

I do not think this is a big problem in reality.

@jonasmalacofilho
Copy link
Member

Main difference is that Zadig (or libusbk inf wizard) does not install libusb-1.0.dll [...]

It just occurred to be (while cleaning up old emails on my inbox and finding one referencing this issue) whether we know why Zadig doesn't ship libusb-1-0.dll, and whether that could be changed. @mcuee, do you know?


A related note, for those that might not know yet: pyocd/libusb-package has made the lives of developers using PyUSB a lot simpler, as it's now quite easy to ensure a suitable libusb-1.0 DLL will be available on the user's machine.1

Footnotes

  1. https://github.com/pyusb/pyusb#requirements-and-platform-support

@mcuee
Copy link
Member

mcuee commented Jul 11, 2022

Main difference is that Zadig (or libusbk inf wizard) does not install libusb-1.0.dll [...]

It just occurred to be (while cleaning up old emails on my inbox and finding one referencing this issue) whether we know why Zadig doesn't ship libusb-1-0.dll, and whether that could be changed. @mcuee, do you know?

I think it has to do with the fact that libusb-1.0.dll is not part of WinUSB/libusb-win32/libusbk. Zadig is supposed to be a Driver Installer.

libusb0.dll has always been part of libusb-win32 driver installer (now deprecated). Zadig and libusbk-inf-wizard also ship with libusb0.dll/libusbk.dll but not libusb-1.0.dll.

@mcuee
Copy link
Member

mcuee commented Jul 11, 2022

A related note, for those that might not know yet: pyocd/libusb-package has made the lives of developers using PyUSB a lot simpler, as it's now quite easy to ensure a suitable libusb-1.0 DLL will be available on the user's machine.

That is good to know.

BTW, python-libusb1 is also trying to ship the libusb-1.0.dll binary for Windows.
Ref: https://github.com/vpelletier/python-libusb1/blob/master/setup.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants