[Nut-upsdev] APC Smart-UPS 1000 RM USB problems with newhidups

Justin Maggard jmaggard10 at hotmail.com
Fri Feb 3 19:37:04 UTC 2006


I'm not sure what other headers I need to include with that get_descriptor.c 
program, but I couldn't get it compiled in my (Sparc) environment.  However, 
my true report descriptor size is 1040 like you saw, Dr. Ross.  I'm running 
a basically a 2.4.20 kernel (but the USB portion is backported from 2.4.30) 
with libusb-0.1.10a.

Similarly, on the APC Back-UPS ES 725 model, I see the expected size at 872, 
and the true size at 842.    Other APC Back-UPS ES models don't have this 
issue.


>From: selinger at mathstat.dal.ca (Peter Selinger)
>To: gdmr at inf.ed.ac.uk (George Ross)
>CC: jmaggard10 at hotmail.com (Justin Maggard), 
>nut-upsdev at lists.alioth.debian.org
>Subject: Re: [Nut-upsdev] APC Smart-UPS 1000 RM USB problems with newhidups
>Date: Fri, 3 Feb 2006 07:40:14 -0400 (AST)
>
>Yes, I have seen this problem before, and I am still not sure what
>causes it. A similar problem was reported by Joal Peshkin on the
>mailing list on Nov 6-9, 2005, for a different device (a
>TrippLite). In his case, NUT thought that his report descriptor was
>shorter than it actually was. Here, too, lsusb gave the correct value,
>but we were able to verify that the UPS announced an incorrect value
>via its HID Descriptor.
>
>I am attaching below a program that one can use (as root) to read
>descriptors from a USB device and dump them to stdout. It would be
>interesting to see the output of:
>
>get_descriptor 001 003 1 0 0 128 0x21 0
>get_descriptor 001 003 1 0 0 128 0x22 0
>
>(replace 001 003 by your UPS's bus and device number).
>
>-- Peter
>
>George Ross wrote:
> >
> >
> > > I'm trying to use a rackmount Smart-UPS from APC with the USB 
>connector, and
> > > I'm running into some issues.  They seem to stem from the fact that 
>the
> > > Report Descriptor is much larger than any other UPS I've seen (61939 
>bytes).
> >
> > You'll probably find that it's not really that big, and that lsusb gives 
>a
> > more realistic number (1040 is what it says here).
> >
> > >   Here is the quick fix that I put in libusb.c after getting the HID
> > > descriptor, and before getting the Report descriptor, which seems to 
>work
> > > okay:
> > >                         if (desc->wDescriptorLength > 4096) {
> > >                                 desc->wDescriptorLength = 4096;
> > >                         }
> > > I'm sure there is a better way to handle this.  I'm just wondering if 
>this
> > > is okay to do, and if anyone had a better way to fix it.  Thanks!
> >
> > That's pretty much what I did too.  Cf. my posting to the nut-upsdev 
>list
> > <200601061304.k06D4uWd011796 at eden.inf.ed.ac.uk> about a month ago.
> >
> > BTW, it might be useful to know what kernel you're running on your 
>machine.
> > Ours are basically Linux 2.6.12-1.1381_FC3 variants with libusb-0.1.10a.
> > --
> > Dr George D M Ross, School of Informatics, University of Edinburgh
> >     Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
> > Mail: gdmr at inf.ed.ac.uk   Voice: +44 131 650 5147   Fax: +44 131 667 
>7209
> >  PGP: 1024D/AD758CC5  B91E D430 1E0D 5883 EF6A  426C B676 5C2B AD75 8CC5


><< get_descriptor.c >>





More information about the Nut-upsdev mailing list