Question

First time using PyUSB, trying to reverse engineer an eye-toy (Play Station) for OS X. Though I get the following error, when attempting to establish a testing collection.

Traceback (most recent call last):
File "eye.py", line 5, in <module>
dev = usb.core.find(0x054C,0x0155)
File "/Library/Python/2.7/site-packages/usb/core.py", line 824, in find
return [d for d in device_iter(k, v)]
File "/Library/Python/2.7/site-packages/usb/core.py", line 794, in device_iter
for dev in backend.enumerate_devices():
AttributeError: 'int' object has no attribute 'enumerate_devices'

Current code...

import usb.core, time, usb

dev = usb.core.find(0x054C,0x0155)

if dev is None:
  raise ValueError('Device not found')           # if device not found report an error
Was it helpful?

Solution

usb.core.find isn't used with positional arguments like that.

I'm guessing that you have a vendor ID and a product ID.

If so, you should be doing this:

usb.core.find(idVendor= 0x054C, idProduct= 0x0155)

If you try to provide positional parameters, you're settings the values of find_all and backend.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top