I am running OS X 10.5 and am trying to connect to a USB device via PyUSB with the following code.
import usb.core, time, usb
dev = usb.core.find(idVendor=0x054c,idProduct=0x0155)
if dev is None:
raise ValueError('Device not found') # if device not found report an error
Though the value error 'device not found' is thrown. OS X System Profiler denotes the devices product and vendor id as..
EyeToy USB camera Namtai:
Product ID: 0x0155
Vendor ID: 0x054c (Sony Corporation)
Version: 1.00
Speed: Up to 12 Mb/sec
Manufacturer: Sony corporation
Location ID: 0x06200000 / 3
Current Available (mA): 500
Current Required (mA): 500
Solution: Had to manual install libusb-1.0.8. Mac-ports didn't install libusb correctly.
usb.core.find()
only works when running the python interpreter (or script) withsudo
. What worries me is that, if not ran withsudo
, the library is not found, which doesn't happen in last Snow Leopard, any tips? – Nico