On Wed, Jul 17, 2013 at 8:33 PM, Elizabeth Tolman <etol...@princeton.edu> wrote: > Hello, > > I'm new to pyusb and to working with usb devices in general. I'm trying to > read voltage data from a Tenma 72-7732 multimeter, but I'm having some > problems. This is my code so far: > > def main(): > import usb.core > import usb.util > import usb.backend > > #find device > > dev = usb.core.find(idVendor=0x1a86, idProduct=0xe008) > > # did you find it? > if dev is None: > raise ValueError('Device not found') > else: > print "Device found" > > > dev.set_configuration() > > > endpoint = dev[0][(0,0)][0] > > > data = dev.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize, 0, > 100000) > > print data > > > main() > > > This finds the device, but gives a timeout error when it tries to read data. > Do you have any idea what might have gone wrong? The multimeter has very > poor documentation, so I can't go there for advice. >
Most likely you do not know the communication protocol between the host and the multimeter. It may well be that you need to send some command to the multimeter and then start to read the data, i.e., you may need to do something before the read. Since it has poor documentation, then you have to carry out some reverse engineering. USBLyzer will be helpful. And you can try to replicate the communication by reading into the logs when using the original program with the original driver. -- Xiaofan ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users