0

I'm using PyUSB to access an Ocean Optics Spectroscopy Unit and collect data. Previously, I had thought the primary access was through an FTDI chip, but after using Wireshark to USB sniff the commands sent via the proprietary software on a different Windows Computer, it appeared to be through the 0x01 and 0x82 endpoints of the QE65000.

I have mimicked the send/receive of bulk data that I found in the Wireshark capture, but every time I try to read the endpoint 0x82 I get the following:

usb.core.USBError: [Errno 60] Operation timed out

Additionally, it looks as if when reading the endpoint on Wireshark, the packet length returned is 2588 bytes, whereas the maximum packet size listed for the 0x82 endpoint is 512 bytes. The following is the code I used to attempt to read the endpoint, passing in an array of the in and out endpoints, the device and a timeout as arguments.

def read_endpoint(dev, ep, timeout = 7520):
    endpoint = ep[1]
    data = dev.read(endpoint.bEndpointAddress,endpoint.wMaxPacketSize)
    return(data)
A. Hudson
  • 51
  • 1
  • 10

1 Answers1

0

Operation timed out means you have read nothing on the endpoint. Maybe you have to write a command to the device before. For example for a Mass storage device you first write the command on the out endpoint:

device.write(ep[0], unhexlify(b"555342430f3100006000000080000603000000600000000000000000000000"), timeout=timeout)

Then you read the answer.

The packet size defines the size of the packets exchanged, however, nothing present the device to sent or received commands over several packets.

sylvain
  • 711
  • 5
  • 9