I am writing software in python to detect cosmic muons using a USB-connected radiation detector.
I am trying to use the PyUSB module to interact with the device, but PyUSB is not finding my radiation detector in particular. The device itself has a serial port, but I am using FTDI USB/serial adapter, and I have cross-checked the VID/PID for the adapter with the company and in control panel.
The following code yields <generator object device-iter at 0x02AADA80>
. This is one of four USB devices on my PC (mouse, keyboard, WiFi adapter, and radiation detector).
import usb
import usb.core
import usb.util
dev = usb.core.find(find_all=True)
if dev is None:
raise ValueError("device not found")
else:
print(dev)
The code from the PyUSB tutorial I was using to locate the device also failed:
import usb
import usb.core
import usb.util
dev usb.core.find("idVendor="0x0403", idProduct="0x6001") # VID/PID verified by company
if dev is None:
raise ValueError("device not found")
else:
print(dev)
I am running Python 2.7.1 on Windows 7, and I have the latest editions of PyUSB and libusb. I can't seem to find a reason why my device can't be found, although I'm probably missing something very fundamental.