Ok. This is for the working example.
I can do some modifications to it where i get error like:
-9 LIBUSB_ERROR_PIPE
or
-7 LIBUSB_ERROR_TIMEOUT
or
-4 LIBUSB_ERROR_NO_DEVICE
but never
-1 LIBUSB_ERROR_IO
in the C example as i get always in the pyusb code which in teory send
the same transfers.


======================================================================
======================================================================
export PYUSB_DEBUG_LEVEL=debug
./mypyusb_example.py
======================================================================
======================================================================

2010-06-27 23:15:48,597 INFO:usb.core:find(): using backend
"usb.backend.libusb10"
2010-06-27 23:15:48,598 DEBUG:usb.backend.libusb10:_LibUSB.enumerate_devices()
2010-06-27 23:15:48,599
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c42c>)
2010-06-27 23:15:48,599
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>)
2010-06-27 23:15:48,599
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c46c>)
2010-06-27 23:15:48,600
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c4cc>)
2010-06-27 23:15:48,600
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c42c>)
2010-06-27 23:15:48,600
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>)
2010-06-27 23:15:48,601
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c46c>)
2010-06-27 23:15:48,601
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c4cc>)
2010-06-27 23:15:48,601
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c42c>)
2010-06-27 23:15:48,602
DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>)
2010-06-27 23:15:48,602
DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0)
2010-06-27 23:15:48,602
DEBUG:usb.backend.libusb10:_LibUSB.get_interface_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0, 0, 0)
2010-06-27 23:15:48,603
DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0)
2010-06-27 23:15:48,603
DEBUG:usb.backend.libusb10:_LibUSB.open_device(<usb.backend.libusb10._Device
object at 0x816c4ac>)
2010-06-27 23:15:48,603
DEBUG:usb.backend.libusb10:_LibUSB.is_kernel_driver_active(c_void_p(135619672),
0)
2010-06-27 23:15:48,603
DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0)
Configuration already set in  2
2010-06-27 23:15:48,604
DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0)
2010-06-27 23:15:48,604
DEBUG:usb.backend.libusb10:_LibUSB.get_interface_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0, 0, 0)
2010-06-27 23:15:48,604
DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device
object at 0x816c4ac>, 0)
2010-06-27 23:15:48,604
DEBUG:usb.backend.libusb10:_LibUSB.is_kernel_driver_active(c_void_p(135619672),
0)
Going for reading: REQUEST_LINE
0
2010-06-27 23:15:48,605
DEBUG:usb.backend.libusb10:_LibUSB.ctrl_transfer(c_void_p(135619672),
130, 0, 0, 0, 0, 1000)
_check ERROR:  -1 Input/output error
Traceback (most recent call last):
  File "./pyusb.py", line 209, in <module>
    timeout=1000)
  File "/usr/local/lib/python2.6/site-packages/usb/core.py", line 669,
in ctrl_transfer
    self.__get_timeout(timeout)
  File "/usr/local/lib/python2.6/site-packages/usb/_debug.py", line
53, in do_trace
    return f(*args, **named_args)
  File "/usr/local/lib/python2.6/site-packages/usb/backend/libusb10.py",
line 543, in ctrl_transfer
    timeout))
  File "/usr/local/lib/python2.6/site-packages/usb/backend/libusb10.py",
line 357, in _check
    raise USBError(_str_error[retval.value])
usb.core.USBError: Input/output error
2010-06-27 23:15:48,611
DEBUG:usb.backend.libusb10:_LibUSB.close_device(c_void_p(135619672))


======================================================================
======================================================================
./mylibusb_example
with   #define LIBUSB_DEBUG 3
which doesnt gives too much info
======================================================================
======================================================================
Buscando: VID=451, PID=3410
--> VID=451, PID=3410
--> vendor=UTICOM Diego
--> product=USB2Serial +4GPIO
Encontrado.
Kernel driver detached.
Lectura realizada REQUEST_LINE correctamente. Transferido 7 bytes:
0x60 0x00 0x83 0x20 0x00 0x60 0x40 0x00
Lectura realizada USB_REQ_GPIO correctamente. Transferido 1 bytes: 0x33
Escritura realizada USB_REQ_GPIO correctamente. Estado: 0xff







2010/6/27 Xiaofan Chen <xiaof...@gmail.com>:
> On Mon, Jun 28, 2010 at 1:58 AM, Diego Jacobi <jacobidi...@gmail.com> wrote:
>> I programmed on the device a couple of Vendor requests so i know for
>> sure what does it answers.
>>
>> I also programmed the comunication in C with libusb 1.0 and with pyusb.
>> PyUSB gives different error messages (always -1 Input/Output Error)
>> than the errors with libusb 1.0 in C.
>>
>> Also here is a working example in C but the same in python with pyusb
>> doesnt work.
>
> Now this is much better. Thanks.
>
>> Please check if it is correctly programmed for pyusb:
>
> I am not a Python expert. But maybe you can do the following
> to help debugging the problem.
> 1) set PYUSB_DEBUG_LEVEL=debug and post the output
> of your pyusb program.
> 2) post the output of your libusb-1.0 program.
>
>
>
> --
> Xiaofan http://sourceforge.net/projects/libusb-win32/
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to