<html>
<body>
<font size=3>Peter,<br>
&nbsp;&nbsp; Looking at the data further down it has min and max values.
These would seem to make sense for voltage (0 &amp; 250), frequency (0
&amp; 60), so is this data coming from the UPS, or is it just something
in the system that expects these values?<br><br>
Regards<br>
&nbsp;&nbsp; Jon<br><br>
At 17:20 28/01/2007, Peter Selinger wrote:<br>
<blockquote type=cite class=cite cite="">Hi Jon,<br><br>
I can't figure out which version of NUT you are running, because you<br>
have pruned that information from your output. Also, which patches,
if<br>
any, have you applied? <br><br>
What you are seeing from lsusb is not &quot;data&quot; from the UPS; it
is<br>
simply a detailed parsing of the report descriptor. For example,
when<br>
it says &quot;Usage, data= [ 0x40 ] 64 Config Voltage&quot;, this simply
means<br>
that HID usage code 0040 corresponds to the &quot;ConfigVoltage&quot;
item (see<br>
e.g. libhid.c, line 1100). <br><br>
The error message &quot;(75): Value too large for defined data type&quot;
may<br>
indicate that the UPS is unhappy with the size of the buffer
provided<br>
by NUT (apparently 13). You can play with this by hacking a larger<br>
buffer size. It should be easy to do this in the function<br>
libhid.c:refresh_report_buffer(), by setting len to something bigger<br>
(or smaller).<br><br>
If the buffer is too small, the device is supposed to fill it with<br>
valid data up to the given size, instead of bailing out with an
error<br>
message. So it seems that the device is at least a little buggy.<br>
Similar behavior has been observed in other cheap devices. (In fact,<br>
one Belkin UPS that I own seems to have a dual bug: if you give a<br>
buffer that is too large, then it will attempt to write random<br>
contents from the firmware memory into the buffer, often crashing
the<br>
device).<br><br>
Alternatively, what would happen if you just ignored the error in<br>
libhid.c after the call to get_report? Perhaps the buffer has been<br>
filled with partial data in spite of the error message?<br><br>
Just some thoughts. -- Peter<br><br>
Jon Gough wrote:<br>
&gt; <br>
&gt; Peter,<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; I have been trying with no luck to get the
drivers working. I <br>
&gt; have done a&nbsp; &quot;lsusb -v -d ffff:&quot; to get the info from
the USB <br>
&gt; regarding my UPS and it seems to be giving valid data. However, I am
<br>
&gt; now confused with the &quot;explore&quot; option of the usbhid-ups
program as <br>
&gt; the Report Descriptor is 632 byte long (which is confirmed by the
<br>
&gt; lsusb program). But the lsusb program seems to be reading every
other <br>
&gt; byte not each byte. What are the in between bytes for?<br>
&gt; <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; I have included the output of the lsusb
command below (sorry for <br>
&gt; the length) and it seems to read the output fine, but the NUT <br>
&gt; software seems to call libusb and get invalid responses. I notice in
<br>
&gt; the latest output that the length of the data and the length being
<br>
&gt; requested seem different (I put a couple of extra debugging
statements in).<br>
&gt; <br>
&gt;&lt;snip&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Local ): Usage, data= [ 0x40 ] 64<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Config Voltage<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Report Size, data= [ 0x10 ] 16<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Report Count, data= [ 0x01 ] 1<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Unit, data= [ 0x21 0xd1 0xf0 0x00 ] 15782177<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Unit Exponent, data= [ 0x07 ] 7<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Logical Minimum, data= [ 0x00 ] 0<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Logical Maximum, data= [ 0xfa 0x00 ] 250<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Main&nbsp; ): Feature, data= [ 0x02 ] 2<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data Variable Absolute No_Wrap Linear<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Preferred_State No_Null_Position <br>
&gt; Non_Volatile Bitfield<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Local ): Usage, data= [ 0x42 ] 66<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Config Frequency<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Report Size, data= [ 0x10 ] 16<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Report Count, data= [ 0x01 ] 1<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Unit, data= [ 0x01 0xf0 ] 61441<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Unit Exponent, data= [ 0x00 ] 0<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Logical Minimum, data= [ 0x00 ] 0<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Global): Logical Maximum, data= [ 0x3c ] 60<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Item(Main&nbsp; ): Feature, data= [ 0x02 ] 2<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data Variable Absolute No_Wrap Linear<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Preferred_State No_Null_Position <br>
&gt; Non_Volatile Bitfield</font></blockquote><br>
&lt;snip&gt;<br><br>


<BR><BR>
<TABLE width=400><HR>
<P style="FONT: 9pt/11pt verdana"><a href="http://www.avast.com">avast! Antivirus</a>: Outbound message clean.
<P style="FONT: 8pt/11pt verdana">Virus Database (VPS): 000707-0, 27/01/2007<BR>Tested on: 28/01/2007 5:49:24 PM<BR><FONT color=gray>avast! is copyright (c) 2000-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR>

</body>
<br>
</html>