Discussion:
[libhid-discuss] Unable to connect to USB device at the second run.
Johan Uiterwijk Winkel
2010-01-22 09:19:02 UTC
Permalink
Hello All.

currently we are trying to use an HD usb device. The problem is the following:

- The first time the (attached) slightly changed version of
test_libhid.c is run, there is no problem, the device is connecting
and the communication is possible. When the test programm is run for
the second time most of the time we are unable to connect to the
device. The only solution is unplugging / plugging the device.

Resetting the USB device using libusb also does not solve the problem.

Debug output of libhid and libusb does not give me any clue what is wrong.

When pressing control-c during the execution of the program we are
able to restart the programm without any problem multiple times.


Does anyone have a clue why the program is behaving this way ?
Currently I am clueless.

Kind regards,

Johan Uiterwijk Winkel.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_libhid.c
Type: text/x-csrc
Size: 11019 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20100122/abf887c9/attachment.c>
Kustaa Nyholm
2010-01-22 09:51:54 UTC
Permalink
Post by Johan Uiterwijk Winkel
Hello All.
- The first time the (attached) slightly changed version of
test_libhid.c is run, there is no problem, the device is connecting and
the communication is possible. When the test programm is run for the
second time most of the time we are unable to connect to the device. The
only solution is unplugging / plugging the device.
Resetting the USB device using libusb also does not solve the problem.
Debug output of libhid and libusb does not give me any clue what is wrong.
When pressing control-c during the execution of the program we are able
to restart the programm without any problem multiple times.
Does anyone have a clue why the program is behaving this way ? Currently
I am clueless.
Kind regards,
Johan Uiterwijk Winkel.
------------------------------------------------------------------------
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Hi,

don't know anything about this per se but you would get a better
response from libusb-devel list than from libhid list as I do not
think this can be a libhid problem. IIRC someone asked a about a similar
problem not long ago on that list, so searchin the archives might
be useful.

br Kusti
Peter Stuge
2010-01-22 14:35:40 UTC
Permalink
When the test programm is run for the second time most of the time
we are unable to connect to the device.
This is almost exclusively caused by a bug in device firmware.
Resetting the USB device using libusb also does not solve the
problem.
It is not possible to reset a USB device from software. The closest
you can come is to manipulate the hub which the device is connected
to and make it tepmorarily remove power from the right port, but
there is no API for doing this.


IIRC the thread on the libusb list ended with the discovery that the
device firmware could not handle a configuration request when it was
already configured, but please do check the archive. I believe it was
discussed in the last three or four months.


//Peter
Johan Uiterwijk Winkel
2010-01-23 10:50:10 UTC
Permalink
Hello Peter,

We where already afraid that it might be a bug in the firmware. The
device is working without problems with windows, but I suspect that
windows is initializing the device only once. Thanx for the pointer to
the libusb list. I will check the thread.

Kind regards,

Johan Uiterwijk Winkel.
Post by Peter Stuge
When the test programm is run for the second time most of the time
we are unable to connect to the device.
This is almost exclusively caused by a bug in device firmware.
Resetting the USB device using libusb also does not solve the
problem.
It is not possible to reset a USB device from software. The closest
you can come is to manipulate the hub which the device is connected
to and make it tepmorarily remove power from the right port, but
there is no API for doing this.
IIRC the thread on the libusb list ended with the discovery that the
device firmware could not handle a configuration request when it was
already configured, but please do check the archive. I believe it was
discussed in the last three or four months.
//Peter
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Loading...