0
votes

I found my device's VID and PID in the properties for the device on windows, which are 256 for the VID and 006 for the PID. I can't seem to get pyusb to find it. From what I've seen, most people put the VID and PID in hex, which I tried and it still doesn't work. Here's my code:

import usb.core
import usb.util

VID = 256
PID = 6

dev = usb.core.find(idVendor=VID, idProduct=PID)

dev is always None. Any clue what I did wrong?

EDIT:

I just tested with another device with a VID of 0x046D and a PID of 0xC21D and it still returns None.

EDIT 2:

I have libusb installed and I've tried running the script in both Python 3.4 and Python 2.7. It always returns None.

1
Is the ID 256 or 0x256 (hex)? - Klaus D.
@KlausD. Windows says the ID is 256 which is 100 in hex. - CMLSC
What does usb.core.find(find_all=True) return? Or try other arguments for find() as well! - Klaus D.
@KlausD. <generator object device_iter at 0x00000000063FE048> - CMLSC
So, it found something. Iterate the generator! - Klaus D.

1 Answers

0
votes

I ended up needing inf-wizard.exe from libusb to install drivers to my USB devices so it could work with PyUSB. I did not need to install libusb1 for Python.