Comments (8)
Hello @tanyanghan , could you run your binary in an Administrator shell?
I think the OS might be protecting the USB access to an un-trusted executable.
If this works on a admin console, either you'd need to change the binary properties manually, or you might need to add some sort of trusted certificate (check pyinstaller docs).
from pywinusb.
Hi @rene-aguirre, thanks for your response. I have tried running it as under an admin console, but it didn't make a difference. I also tried right clicking on the exe in Explorer and running the exe from Explorer as admin but it still didn't work.
from pywinusb.
I've signed the exe with a self-signed certificate which I added to the Trusted Root Certification Authority on my PC, but the result is still the same with the vID and pID all returning as zeroes. The signing appears to have worked because the properties of the exe in Explorer now shows This digital signature is OK.
from pywinusb.
Further digging, winapi.CreateFile()
appears to be returning a valid h_hid
handle and calling ctypes.GetLastError()
returns 0 - ERROR_SUCCESS
.
BUT when it tries to read the attributes hid_dll.HidD_GetAttributes(h_hid, byref(hidd_attributes))
, it fails and ctypes.GetLastError()
returns 6 - ERROR_INVALID_HANDLE
.
from pywinusb.
@tanyanghan Could be an issue with your registry? Example: http://digital.ni.com/public.nsf/allkb/1D52B53149DD637686256CAA00565E47
from pywinusb.
I tried it, and it didn't seem to have made a difference.
from pywinusb.
Here's the problem. I was using Python x86-64 and it didn't work after pyinstaller packaged it up.
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
It works with Python x86 (32-bit) after pyinstaller packages it up!
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
from pywinusb.
Thanks for let us know @tanyanghan !
from pywinusb.
Related Issues (20)
- hid.core.show_hids() fails under Python 2 if there is a Unicode character in the device name HOT 1
- Freeze when closing handle from __del__ during python exit HOT 12
- Fail to run simple_feature.py example
- filtering devices by serial number HOT 1
- cx_Freeze can't find module pywinusb HOT 2
- Not reading mouse usb HOT 1
- get_usages() with usage ranges returns one less than what is in descriptor's range
- Running show_hids.py - A USB HID not showing in the list HOT 10
- Question about get input and send output from my custom USB device. HOT 5
- pywinusb vs pyusb HOT 2
- Options to get input reports
- InputReportProcessingThread is never closed
- Can't see all the HID devices connected to the PC HOT 1
- How do I send a simple feature report? HOT 2
- Set Feature Report data last byte corrupted HOT 4
- WinError 2 HOT 1
- Can I use this library to emulate HID mouse drivers without additional hardware? HOT 1
- PNP for tkinter HOT 4
- USB device isn't found
- HID RFID Tag Reading Issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywinusb.