Graeme Gill | 5 Oct 00:35 2007

usb_resetep() pixy dust


Once again I've come across a situation when using libusb under Linux,
where a device that works perfectly well under MSWindows and OS X,
fails to work properly under Linux.

The commercial device in question is based on the Cypress CY7C63001
chip, and while most communication is done via the control
path, some data is read using interrupt reads from an end point.

On MSWindows and OS X the device works without any problems, but
when trying the same code out on Linux, the interrupt reads
mysteriously fail to work, timing out. Sprinkling some
usb_resetep() pixy dust in front of each interrupt read on
Linux, and hey presto, it all works !

Now it wouldn't surprise me if the device it self is partially
at fault here, but if so, something about the Linux driver
or the Linux portion of libusb is being a whole lot less
forgiving than the other major operating system platforms.

Does anyone have any light to shed on this mystery ?

Graeme Gill.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
(Continue reading)

jamespev | 5 Oct 04:42 2007

unknown error code?

  Hello.  I am developing a USB device and attempting to talk to it with libusb.  I have EP1 bulk write and read working fine, but my two other endpoints (2 and 6) always timeout and return -110 when usb_bulk_write and read are called.(no matter what size transaction is attempted)  usb_strerror returns "No Error" so I am not sure what the -110 means.  I suspect my device firmware is at fault, but I am hoping the error code will shed some light on what is going on.

  Many thanks for any advice!

James

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Peter Stuge | 5 Oct 12:24 2007

Re: unknown error code?

On Fri, Oct 05, 2007 at 02:42:44AM +0000, jamespev wrote:
> I suspect my device firmware is at fault, but I am hoping the error
> code will shed some light on what is going on.

Please send output from at least lsusb -v and cat
/proc/bus/usb/devices (maybe /dev/bus/usb/devices on your system) for
your device, and relevant parts of output from dmesg could also help.

//Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
James Peverill | 5 Oct 14:40 2007

Re: unknown error code?


  I can post these when I get home tonight although I can tell you right off that the output is a bit messy since my device does not implement any EP0 responses (USB descriptors).  Is it a requirement to implement these?  This could be my show stopper issue at this point and it might be I should implement EP0 before doing any additional testing.  I had thought as long as I was using default endpoint settings (packet size, direction etc) it would work anyway.

James


Peter Stuge wrote:
On Fri, Oct 05, 2007 at 02:42:44AM +0000, jamespev wrote:
I suspect my device firmware is at fault, but I am hoping the error code will shed some light on what is going on.
Please send output from at least lsusb -v and cat /proc/bus/usb/devices (maybe /dev/bus/usb/devices on your system) for your device, and relevant parts of output from dmesg could also help. //Peter ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Libusb-devel mailing list Libusb-devel <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusb-devel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Tim Roberts | 5 Oct 18:56 2007

Re: unknown error code?

James Peverill wrote:
>
> I can post these when I get home tonight although I can tell you right
> off that the output is a bit messy since my device does not implement
> any EP0 responses (USB descriptors).  Is it a requirement to implement
> these?

Hell, yes, it's a requirement!  Your device won't enumerate unless you
can deliver the device descriptor and configuration descriptor.

> This could be my show stopper issue at this point and it might be I
> should implement EP0 before doing any additional testing.  I had
> thought as long as I was using default endpoint settings (packet size,
> direction etc) it would work anyway.

There is no such thing as "default endpoint settings."  The only way the
operating system knows which endpoints you support and what type they
are is by reading the configuration descriptor.

--

-- 
Tim Roberts, timr <at> probo.com
Providenza & Boekelheide, Inc.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
James Peverill | 5 Oct 20:57 2007

Re: unknown error code?


  Excellent, so this answers this question.  Many thanks!  I'll go write an EP0 and maybe I'll be back.

James



Tim Roberts wrote:
James Peverill wrote:
I can post these when I get home tonight although I can tell you right off that the output is a bit messy since my device does not implement any EP0 responses (USB descriptors). Is it a requirement to implement these?
Hell, yes, it's a requirement! Your device won't enumerate unless you can deliver the device descriptor and configuration descriptor.
This could be my show stopper issue at this point and it might be I should implement EP0 before doing any additional testing. I had thought as long as I was using default endpoint settings (packet size, direction etc) it would work anyway.
There is no such thing as "default endpoint settings." The only way the operating system knows which endpoints you support and what type they are is by reading the configuration descriptor.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
libusb.list | 6 Oct 12:05 2007
Picon

win32 usblib and snoopypro

hi,

To further test my Linux based usblib application I installed cygwin in 
windows and with no changes built my program. Installed the win32 usblib 
filter into windows and the app ran found the device and seemed to work in 
exactly the same was as in Linux.

Setup snoopypro, reinstalled all the services etc and restarted the device, 
immediately get the EP0 announcments captured in snoopypro.
Ran my program from the cygwin shell and no packets are captured even though 
the device was responding correctly.

I guess this is because the the win32 usblib filter and the snoopypro filter 
are not seeing each other due to windows architecture (i am using XP sp2).

Is there a fix to make the win32 usblib filter visible to snoopypro?

Would it help to install the win32 driver and set it up for the device 
overriding the standard windows driver?

Is there another capture program for windows that works with data travelling 
across the win32 usblib?

Thanks Rob

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Henning Thielemann | 7 Oct 17:34 2007
Picon

dump using libusb


Is there an example program, which show data that is sent by a particular 
USB device? I have a non USB-MIDI compliant MIDI interface but no 
developer kit, and I like to receive data from it.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Xiaofan Chen | 9 Oct 04:48 2007
Picon

Re: dump using libusb

On 10/7/07, Henning Thielemann <lemming <at> henning-thielemann.de> wrote:
>
> Is there an example program, which show data that is sent by a particular
> USB device? I have a non USB-MIDI compliant MIDI interface but no
> developer kit, and I like to receive data from it.
>

Are you looking for a USB Sniffer?

Under Linux, try usbmon (built in to later kernels).
/usr/src/linux/Documentation/usb/usbmon.txt  or similar location.

Under Windows, try SnoopyPro or SniffUSB.
http://usbsnoop.sourceforge.net/
http://benoit.papillault.free.fr/usbsnoop/doc.php.en
http://www.pcausa.com/Utilities/UsbSnoop/default.htm

Xiaofan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Henning Thielemann | 10 Oct 15:30 2007
Picon

Re: dump using libusb


On Wed, 10 Oct 2007, Xiaofan Chen wrote:

> I am not so sure if it is even possible to write a USB sniffer with libusb.
> Try usbmon. It is a bit hard to decipher the output (I can't) but apparently
> Alan Stern and the Linux USB developer  can read the data with one eye ;-)

As a start with libusb I'm satisfied with an example program that 
exchanges some data with an USB device. But unfortunately:

libusb-0.1.12/tests> grep write *.c
libusb-0.1.12/tests> grep read *.c

:-(

The example programs seem only to address the search for USB devices.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

Gmane