<html>
<body>
<font size=3>Oooppss. Lets try with less data!<br><br>
Peter,<br>
&nbsp;&nbsp; Here is the line that I pruned out.<br><br>
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30
(2.1.0)<br><br>
When I start the driver with <br>
&nbsp;/usr/local/ups/bin/upsdrvctl -u nut start<br><br>
I get the following messages<br><br>
Network UPS Tools - UPS driver controller 2.1.0<br>
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30
(2.1.0)<br><br>
Detected a UPS: UIS Ablerex/Ablerex USB Interface 049e<br>
Using subdriver: Upsilon HID 0.1<br><br>
Then I issue<br>
&nbsp;/usr/local/ups/sbin/upsd -u nut<br><br>
and get <br><br>
Network UPS Tools upsd 2.1.0<br>
upsd: listening on 0.0.0.0:3493<br>
Connected to UPS [eclipse]: eclipse<br><br>
Then I try to see what is available from the driver with<br>
&nbsp;/usr/local/ups/bin/upsc eclipse<br><br>
and get <br><br>
Activepower: 0<br>
Apparentpower: 0<br>
driver.name: usbhid-ups<br>
driver.parameter.pollinterval: 2<br>
driver.parameter.port: auto<br>
driver.version: 2.1.0<br>
Shutdown.Delay: 0<br>
Startup.Delay: 0<br>
ups.mfr: UIS Ablerex<br>
ups.model: Ablerex USB Interface 049e<br>
ups.status: WAIT<br><br>
If I try<br>
&nbsp;/usr/local/ups/bin/upsc eclipse battery.voltage<br><br>
I get <br><br>
Error: Variable not supported by UPS<br><br>
&nbsp;&nbsp; Yet battery.voltage is defined in the hid_info_t
variable.<br><br>
&nbsp;&nbsp; It looks like only part of the output is being read. But at
this point I do not know what to do to get further information from the
system. I have modified the stub to have the correct (I hope) labels for
at least some of the values that should be returned, but they do not show
up when I call the command processor.<br><br>
&nbsp;&nbsp; I seem to be missing something in this process. Not sure
what, but I am getting confused about what I should have to do.<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; Using subdriver: EXPLORE HID 0.1<br>
&gt; parsing 00860004<br>
&gt; parsing Flow<br>
&gt; hid_lookup_usage: found 84001e<br>
&gt; parsing FlowID<br>
&gt; hid_lookup_usage: found 84001f<br>
&gt; Path depth = 3<br>
&gt; 0: Usage(00860004)<br>
&gt; 1: Usage(0084001e)<br>
&gt; 2: Usage(0084001f)<br>
&gt; Entering libusb_get_report. ReportSize: 13<br>
&gt; typesafe_control_msg: size: 13<br>
&gt; Can't retrieve Report 1 (75): Value too large for defined data
type<br>
&gt; Path: 00860004.Flow.FlowID, Type: Feature, ReportID: 0x01, Offset:
0, Size: 4<br>
&gt; parsing 00860004<br>
&gt; parsing Flow<br>
&gt; hid_lookup_usage: found 84001e<br>
&gt; parsing ConfigVoltage<br>
&gt; hid_lookup_usage: found 840040<br>
&gt; Path depth = 3<br>
&gt; 0: Usage(00860004)<br>
&gt; 1: Usage(0084001e)<br>
&gt; 2: Usage(00840040)<br>
&gt; Entering libusb_get_report. ReportSize: 13<br>
&gt; typesafe_control_msg: size: 13<br>
&gt; Can't retrieve Report 1 (75): Value too large for defined data
type<br>
&gt; Path: 00860004.Flow.ConfigVoltage, Type: Feature, ReportID: 0x01,
<br>
&gt; Offset: 8, Size: 16<br>
&gt; <br>
&gt; Is this correct, or is there something else that needs looking
at?<br>
&gt; <br>
&gt; Regards<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; Jon<br>
&gt; <br>
&gt; Data from lsusb<br>
&gt;&lt;snip&gt;</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): 000707-0, 27/01/2007<BR>Tested on: 28/01/2007 5:33:42 PM<BR><FONT color=gray>avast! is copyright (c) 2000-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR>

</body>
<br>
</html>