2011/1/1 Sridev Nair <sksridevn...@gmail.com>: > Hi, > > I have been working with pyUSB (Python 2.6) for last couple of days on > Windows. It works great and I could access the auto-id reader within > no time. However, there is this read command timing out issue which I > am unable to resolve. In fact it is a bit weird since it seem to work > when I parallely run the demo application of the same reader provided > by the manufacturer. The device driver spec, code & error output are > below. > > Any help in solving the problem? > > Sridev > > ---------------------------device specs----------------------- > > Device: > Device class: 0 > Device sub class: 0 > Device protocol: 0 > Max packet size: 64 > idVendor: 4292 > idProduct: 33266 > Device Version: 256 > Configuration: 1 > Total length: 32 > selfPowered: 0 > remoteWakeup: 0 > maxPower: 200 > Interface: 0 > Alternate Setting: 0 > Interface class: 255 > Interface sub class: 0 > Interface protocol: 0 > Endpoint: 0x81 > Type: 2 > Max packet size: 64 > Interval: 0 > Endpoint: 0x1 > Type: 2 > Max packet size: 64 > Interval: 0 > > ----------------------------code-------------------------------- > import usb.core > import usb.util > > dev = usb.core.find(idVendor=0x10c4, idProduct=0x81f2) > > if dev is None: > raise ValueError('No Device') > > dev.set_configuration() > > msg = [0x03, 0x02, 0x00, 0x03, 0x07, 0xD0, 0x03] > > bytes = dev.write(0x01, msg, 0, 2000) > > received = dev.read(0x81, bytes, 0, 5000) > Try to read about 1024 bytes, instead of the same data read. If there is more data in the device buffer than you ask for, this may happen.
-- Best Regards, Wander Lairson Costa LCoN - Laboratório de Computação Natural - Natural Computing Laboratory (http://www.mackenzie.com.br/lcon.html) Programa de Pós-Graduação em Engenharia Elétrica (PPGEE) Faculdade de Computação e Informática (FCI) Universidade Presbiteriana Mackenzie - SP - Brazil ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users