<html>
<body>
<font size=3>Peter,<br>
&nbsp;&nbsp; I have been doing some more testing and I find that if I
modify the libusb.c file to set a report size in libusb_get_report to 16
the error messages go away. This is the code as it currently
stands:<br><br>
static int libusb_get_report(usb_dev_handle *udev, int ReportId, unsigned
char *raw_buf, int ReportSize )<br>
{<br>
&nbsp;&nbsp; int ReportSize_test = 16;<br>
&nbsp;&nbsp; unsigned char raw_buf_test[ReportSize_test + 1];<br>
&nbsp;&nbsp; int rc;<br>
&nbsp;&nbsp; unsigned char *p_raw_buf_test;<br>
&nbsp;&nbsp; upsdebugx(4, &quot;Entering libusb_get_report, ReportSize:
%i, ReportSize_test: %i&quot;,ReportSize, ReportSize_test);<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>if (udev
!= NULL)<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>rc =
usb_control_msg(udev,<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>USB_ENDPOINT_IN +
USB_TYPE_CLASS + USB_RECIP_INTERFACE,<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>0x01, /*
HID_REPORT_GET */<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
ReportId+(0x03<
<img src="http://messenger.msn.com/MMM2004-08-11_11.52/Resource/emoticons/75_75.gif" width=19 height=19 alt="Eye-rolling">, /* HID_REPORT_TYPE_FEATURE */<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>0, raw_buf_test,
ReportSize_test, USB_TIMEOUT);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>p_raw_buf_test =
raw_buf_test + (ReportSize_test - ReportSize);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>memcpy(raw_buf,
p_raw_buf_test, ReportSize);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>return rc;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>else<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>return 0;<br>
}<br><br>
 From this I now get<br><br>
Detected a UPS: UIS Ablerex/Ablerex USB Interface 049e<br>
Using subdriver: EXPLORE HID 0.1<br>
parsing 00860004<br>
parsing Flow<br>
hid_lookup_usage: found 84001e<br>
parsing FlowID<br>
hid_lookup_usage: found 84001f<br>
Path depth = 3, Path: 00860004.Flow.FlowID, Node1/2/3:, 860004, 84001e,
84001f <br>
0: Usage(00860004)<br>
1: Usage(0084001e)<br>
2: Usage(0084001f)<br>
Buffer is stale. refreshing<br>
Noting in the buffer for rbuf-&gt;data[0]<br>
Noting in the buffer for rbuf-&gt;data[1]<br>
Noting in the buffer for rbuf-&gt;data[2]<br>
Entering libusb_get_report, ReportSize: 13, ReportSize_test: 16<br>
Report[r]: (16 bytes) =&gt; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04
b0<br>
=> Before exponent: 0, 0/0)<br>
=> After conversion: 0.000000 (0), 0/0)<br>
Path: 00860004.Flow.FlowID, Type: Feature, ReportID: 0x01, Offset: 0,
Size: 4, Value: 0.000000<br><br>
when i use the usbhid-ups -DDDD -x explore command.<br><br>
It would appear that whatever is setting the length of the report is not
getting it quite right. I think this is in hidparse.c, but I am still
looking.<br><br>
Jon<br><br>
<br>
At 19:18 28/01/2007, Peter Selinger wrote:<br>
<blockquote type=cite class=cite cite="">OK, <br><br>
no, you wouldn't expect any error messages during compiling.
However,<br>
this doesn't mean usbhid-ups can talk to your device. You did get<br>
error mesages (Value too large for defined data type) when running
the<br>
driver.<br><br>
I think what you have to do is to experiment with the report buffer<br>
size, as I described in an earlier message:<br><br>
&gt; The error message &quot;(75): Value too large for defined data
type&quot; may<br>
&gt; indicate that the UPS is unhappy with the size of the buffer
provided<br>
&gt; by NUT (apparently 13). You can play with this by hacking a
larger<br>
&gt; buffer size. It should be easy to do this in the function<br>
&gt; libhid.c:refresh_report_buffer(), by setting len to something
bigger<br>
&gt; (or smaller).<br><br>
Sorry if that advice was drowned in a sea of other comments. This is<br>
what you should do. I don't know if it will work, since I don't have<br>
an Ablerex device to play with. <br><br>
-- Peter<br><br>
P.S. I am moving this discussion to the nut-upsdev mailing list
(from<br>
nut-upsuser).</font></blockquote>

<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): 000709-0, 30/01/2007<BR>Tested on: 31/01/2007 12:37:33 PM<BR><FONT color=gray>avast! is copyright (c) 2000-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR>

</body>
<br>
</html>