felHR85 / WinUsbPy

A python wrapper over WinUsb library
MIT License
28 stars 21 forks source link

Extended version of package published under new name winusbcdc #6

Open andrewleech opened 4 years ago

andrewleech commented 4 years ago

Hi, Thanks for building this and sharing it (a few years back).

I've created a package based on it to communicate with USB Virtual Com Port devices instead of using pyserial / usbserial.sys to avoid data loss issues in Win10 with usbserial.sys driver.

To do so I've build a new even-higher layer driver to replicate the basic pyserial interface and included that on top of your high level interface. I've fixed python3 support as well as x86/x64 compatibility. I've also added set_timeout and flush functions as well as a number of other cleanups.

I've published the extended package to pypi under the name winusbcdc with the code all here: https://gitlab.com/alelec/winusbcdc

I hope you don't mind me including your work as such, I really appreciate the time and effort it clearly took to build. Assuming it's ok to keep the package listing up, would you mind me listing the licence as Python, or MIT / Apache ?

felHR85 commented 4 years ago

Hi! @andrewleech Great project!! I wasn't aware of those troubles with CDC devices in Win10 using Pyserial. Feel free to add and use WinUsbPy. I consider it MIT license

andrewleech commented 4 years ago

Yeah the serial issue is mostly on high data throughput usage and shows up as occasionally a serial read being 64 or 128 bytes short of the expected amount.

I thought I just wasn't reading/buffering it fast enough myself in pyserial and wrote an elaborate thread based reader using a socket pair as a fifo and still couldn't solve it, until I found the references linked in my readme about others having the same issue in any coding language on windows.

Thanks for getting back to me, MIT is generally my go-to as well. Cheers!

andrewleech commented 4 years ago

I've pulled out WinUsbPy specific patches into a PR, feel free to grab some/all/none of them if interested! https://github.com/felHR85/WinUsbPy/pull/7