Quantcast

What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Robert Heller
I am getting LIBUSB_ERROR_IO (-1) from libusb_interrupt_transfer on an
input endpoint.  What are the reasons for getting this error?

The code *used* to work with the libusb-0.1 API, but now fails with the
libusb-1.0 API and I am trying to figure out why.

--
Robert Heller             -- 978-544-6933 / [hidden email]
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                                                   

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Robert Heller                      -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller@deepsoft.com        -- http://www.deepsoft.com/ModelRailroadSystem/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Robert Heller
At Thu, 20 Oct 2011 16:16:29 -0400 Robert Heller <[hidden email]> wrote:

>
> I am getting LIBUSB_ERROR_IO (-1) from libusb_interrupt_transfer on an
> input endpoint.  What are the reasons for getting this error?
>
> The code *used* to work with the libusb-0.1 API, but now fails with the
> libusb-1.0 API and I am trying to figure out why.

BTW: I am using CentOS 5.6,  2.6.18-274.el5xen on a x86_64,
libusb-1.0.8, libstdc++-4.1.2-51.el5, and gcc-4.1.2-51.el5.

(libusb_interrupt_transfers to the the output endpoint just fine, no
problems at all there.)

This is with a PI Engineering Rail Driver Console.

>

--
Robert Heller             -- 978-544-6933 / [hidden email]
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                         

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Robert Heller                      -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller@deepsoft.com        -- http://www.deepsoft.com/ModelRailroadSystem/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Alan Ott
On 10/20/2011 04:53 PM, Robert Heller wrote:

> At Thu, 20 Oct 2011 16:16:29 -0400 Robert Heller <[hidden email]> wrote:
>
>> I am getting LIBUSB_ERROR_IO (-1) from libusb_interrupt_transfer on an
>> input endpoint.  What are the reasons for getting this error?
>>
>> The code *used* to work with the libusb-0.1 API, but now fails with the
>> libusb-1.0 API and I am trying to figure out why.
> BTW: I am using CentOS 5.6,  2.6.18-274.el5xen on a x86_64,
> libusb-1.0.8, libstdc++-4.1.2-51.el5, and gcc-4.1.2-51.el5.
>
> (libusb_interrupt_transfers to the the output endpoint just fine, no
> problems at all there.)
>
> This is with a PI Engineering Rail Driver Console.
>

I recently implemented the PIEHid API for PI Engineering on Linux.

Github code is here:
    https://github.com/piengineering/xkeys/

It provides the same API as PI's Windows DLL and works with the X-Keys
devices so that code written for their Windows libraries can easily port
over. I assume RailDriver is similar to X-Keys.

The X-Keys SDK actually provides a couple of extra features beyond what
HIDAPI normally does that you might be interested in, such as
callback-delivered reports, and the ability to look at the latest report
which has arrived (without clearing the buffer). It is of course based
on HIDAPI, and comes with a test GUI program. I think this is what you
want instead of using libusb directly.

If you try it, let me know how it works for you.

Alan.



------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Robert Heller
At Thu, 20 Oct 2011 17:41:46 -0400 Alan Ott <[hidden email]> wrote:

>
> On 10/20/2011 04:53 PM, Robert Heller wrote:
> > At Thu, 20 Oct 2011 16:16:29 -0400 Robert Heller <[hidden email]> wrote:
> >
> >> I am getting LIBUSB_ERROR_IO (-1) from libusb_interrupt_transfer on an
> >> input endpoint.  What are the reasons for getting this error?
> >>
> >> The code *used* to work with the libusb-0.1 API, but now fails with the
> >> libusb-1.0 API and I am trying to figure out why.
> > BTW: I am using CentOS 5.6,  2.6.18-274.el5xen on a x86_64,
> > libusb-1.0.8, libstdc++-4.1.2-51.el5, and gcc-4.1.2-51.el5.
> >
> > (libusb_interrupt_transfers to the the output endpoint just fine, no
> > problems at all there.)
> >
> > This is with a PI Engineering Rail Driver Console.
> >
>
> I recently implemented the PIEHid API for PI Engineering on Linux.
>
> Github code is here:
>     https://github.com/piengineering/xkeys/
>
> It provides the same API as PI's Windows DLL and works with the X-Keys
> devices so that code written for their Windows libraries can easily port
> over. I assume RailDriver is similar to X-Keys.
>
> The X-Keys SDK actually provides a couple of extra features beyond what
> HIDAPI normally does that you might be interested in, such as
> callback-delivered reports, and the ability to look at the latest report
> which has arrived (without clearing the buffer). It is of course based
> on HIDAPI, and comes with a test GUI program. I think this is what you
> want instead of using libusb directly.

I am not sure.  My RailDriver code is meant to run as a daemon, allowing
for several *different* processes access different parts of the
interface.  One oddness with the RailDriver is that it is also an output
device: it has a three digit 'speedometer' (three 7-segment LED digits)
and has a switch for a powered speaker.

The RailDriver driver has 4 levers (reverser, throttle/dynamic brake,
auto (trainline) brake , indepentent (loco only) brake, plus a switch
for the horn, switches for wipers and lights, lever switches for range
and e-stop, push buttons for Alert, Sand, Pantograph, and bell.  Plus a
whole pile of random buttons, an up/down control and a 4-way control.

The thing is, I had it all working with the libusb-0.1 library and don't
understand why it is not working with the libusb-1.0 library.  The
*output* endpoint is working just fine, but the input is just getting a
-1 status (LIBUSB_ERROR_IO) for no descernable reason.

I'll download your code and see if it prodvides enlightenment...

>
> If you try it, let me know how it works for you.
>
> Alan.
>
>
>
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn
> about Cisco certifications, training, and career opportunities.
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> Libusb-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
>
>                        

--
Robert Heller             -- 978-544-6933 / [hidden email]
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                                                             

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Robert Heller                      -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller@deepsoft.com        -- http://www.deepsoft.com/ModelRailroadSystem/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Peter Stuge
Robert Heller wrote:
> The thing is, I had it all working with the libusb-0.1 library and
> don't understand why it is not working with the libusb-1.0 library.

A good way to dig into this issue would be to compare usbmon output
from using 0.1 vs. 1.0. Recommend using:

http://people.redhat.com/zaitcev/linux/usbmon-6.tar.gz


//Peter

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Xiaofan Chen
In reply to this post by Robert Heller
On Fri, Oct 21, 2011 at 6:29 AM, Robert Heller <[hidden email]> wrote:

> The thing is, I had it all working with the libusb-0.1 library and don't
> understand why it is not working with the libusb-1.0 library.  The
> *output* endpoint is working just fine, but the input is just getting a
> -1 status (LIBUSB_ERROR_IO) for no descernable reason.
>

Can it be that you forget to specify the correct endpoint address?
EP 1 IN will be 0x81 for libusb-1.0.

For libusb-0.1 under Linux, there is a mask to "help" you. It was
considered to be a wrong approach and was corrected in libusb-1.0.


--
Xiaofan

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Robert Heller
At Fri, 21 Oct 2011 10:36:42 +0800 Xiaofan Chen <[hidden email]> wrote:

>
> On Fri, Oct 21, 2011 at 6:29 AM, Robert Heller <[hidden email]> wrote:
>
> > The thing is, I had it all working with the libusb-0.1 library and don't
> > understand why it is not working with the libusb-1.0 library.  The
> > *output* endpoint is working just fine, but the input is just getting a
> > -1 status (LIBUSB_ERROR_IO) for no descernable reason.
> >
>
> Can it be that you forget to specify the correct endpoint address?
> EP 1 IN will be 0x81 for libusb-1.0.
I think I tried it both ways.

>
> For libusb-0.1 under Linux, there is a mask to "help" you. It was
> considered to be a wrong approach and was corrected in libusb-1.0.
>
>

--
Robert Heller             -- 978-544-6933 / [hidden email]
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                         


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Robert Heller                      -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller@deepsoft.com        -- http://www.deepsoft.com/ModelRailroadSystem/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

infox
Hi Mr. Robert Heller,
Have you solved this problem? I also have this problem
> > *output* endpoint is working just fine, but the input is just getting a
> > -1 status (LIBUSB_ERROR_IO)

Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

Xiaofan Chen
On Thu, May 10, 2012 at 4:27 PM, infox <[hidden email]> wrote:
> Hi Mr. Robert Heller,
> Have you solved this problem? I also have this problem
>> > *output* endpoint is working just fine, but the input is just getting a
>> > -1 status (LIBUSB_ERROR_IO)
>

That is a very old thread. Please give more details
about your device (lsusb -vvv), libusb-1.0 version
(you should try 1.0.9 release) and OS version.

You should also post the code snippets which
causes the problem.


--
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What are the conditions for an LIBUSB_ERROR_IO status from libusb_interrupt_transfer?

infox
So sorry, the reason is that: our device has broken, we change another one and it works OK now.
Thank you.


2012/5/10 Xiaofan Chen <[hidden email]>
On Thu, May 10, 2012 at 4:27 PM, infox <[hidden email]> wrote:
> Hi Mr. Robert Heller,
> Have you solved this problem? I also have this problem
>> > *output* endpoint is working just fine, but the input is just getting a
>> > -1 status (LIBUSB_ERROR_IO)
>

That is a very old thread. Please give more details
about your device (lsusb -vvv), libusb-1.0 version
(you should try 1.0.9 release) and OS version.

You should also post the code snippets which
causes the problem.


--
Xiaofan


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusb-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Loading...