Discussion:
[pyusb-users] Connection Timed Out
Johannes Roth
2015-08-11 14:35:40 UTC
Permalink
Hello,

As a pyusb beginner I'm making my first steps while trying to talk to a
CY7C68013A USB controller, which in turn should talk to my AD9959.

After some work and usb-sniffing the windows drivers, I'm stuck now, as
I'm getting time outs. The problem seems to be with with either reading
or writing (the error is the same). I can read the config, interfaces
and endpoints from the controller and when trying to read/write from the
wrong endpoint, it comes up with sensible errors, but not when I'm
trying to read/write to a proper endpoint. Here's a simple example:

import usb.core
dev = usb.core.find(idVendor = 0x0456, idProduct = 0xee24)
cfg = dev[0]
intf = cfg[(0,1)]
dev.set_configuration(cfg)
dev.set_interface_altsetting(interface = 0, alternate_setting = 1)
usb.util.claim_interface(dev, intf)
dev.write(0x01,'\x0F\x01')

results in

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 878,`
in write
self.__get_timeout(timeout)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 479, in bulk_write
data, timeout)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 550, in __write
timeout
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 379, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] Connection timed out

I'm struggeling to understand why I'm getting the time out and sadly
can't make any sense of the Google results I'm getting. Any help for a
beginner is much appreciated!

Cheers,
Johannes

------------------------------------------------------------------------------
Wander Lairson Costa
2015-08-16 16:45:44 UTC
Permalink
Post by Johannes Roth
Hello,
As a pyusb beginner I'm making my first steps while trying to talk to a
CY7C68013A USB controller, which in turn should talk to my AD9959.
After some work and usb-sniffing the windows drivers, I'm stuck now, as
I'm getting time outs. The problem seems to be with with either reading
or writing (the error is the same). I can read the config, interfaces
and endpoints from the controller and when trying to read/write from the
wrong endpoint, it comes up with sensible errors, but not when I'm
import usb.core
dev = usb.core.find(idVendor = 0x0456, idProduct = 0xee24)
cfg = dev[0]
intf = cfg[(0,1)]
dev.set_configuration(cfg)
dev.set_interface_altsetting(interface = 0, alternate_setting = 1)
usb.util.claim_interface(dev, intf)
dev.write(0x01,'\x0F\x01')
results in
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 878,`
in write
self.__get_timeout(timeout)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 479, in bulk_write
data, timeout)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 550, in __write
timeout
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
line 379, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] Connection timed out
This seems to be a device specific issue. However, your code can be simpler:

import usb.core
dev = usb.core.find(idVendor = 0x0456, idProduct = 0xee24)
dev.set_configuration()
dev.set_interface_altsetting(interface = 0, alternate_setting = 1)
dev.write(0x01,'\x0F\x01')
Post by Johannes Roth
I'm struggeling to understand why I'm getting the time out and sadly
can't make any sense of the Google results I'm getting. Any help for a
beginner is much appreciated!
Cheers,
Johannes
------------------------------------------------------------------------------
_______________________________________________
pyusb-users mailing list
https://lists.sourceforge.net/lists/listinfo/pyusb-users
--
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Loading...