<html>
<body>
<font size=3>Oooppss. Lets try with less data!<br><br>
Peter,<br>
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>
/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>
/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>
/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>
/usr/local/ups/bin/upsc eclipse battery.voltage<br><br>
I get <br><br>
Error: Variable not supported by UPS<br><br>
Yet battery.voltage is defined in the hid_info_t
variable.<br><br>
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>
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>
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 "data" from the UPS; it
is<br>
simply a detailed parsing of the report descriptor. For example,
when<br>
it says "Usage, data= [ 0x40 ] 64 Config Voltage", this simply
means<br>
that HID usage code 0040 corresponds to the "ConfigVoltage"
item (see<br>
e.g. libhid.c, line 1100). <br><br>
The error message "(75): Value too large for defined data type"
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>
> <br>
> Peter,<br>
> I have been trying with no luck to get the
drivers working. I <br>
> have done a "lsusb -v -d ffff:" to get the info from
the USB <br>
> regarding my UPS and it seems to be giving valid data. However, I am
<br>
> now confused with the "explore" option of the usbhid-ups
program as <br>
> the Report Descriptor is 632 byte long (which is confirmed by the
<br>
> lsusb program). But the lsusb program seems to be reading every
other <br>
> byte not each byte. What are the in between bytes for?<br>
> <br>
> I have included the output of the lsusb
command below (sorry for <br>
> the length) and it seems to read the output fine, but the NUT <br>
> software seems to call libusb and get invalid responses. I notice in
<br>
> the latest output that the length of the data and the length being
<br>
> requested seem different (I put a couple of extra debugging
statements in).<br>
> <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<br>
> 0: Usage(00860004)<br>
> 1: Usage(0084001e)<br>
> 2: Usage(0084001f)<br>
> Entering libusb_get_report. ReportSize: 13<br>
> typesafe_control_msg: size: 13<br>
> Can't retrieve Report 1 (75): Value too large for defined data
type<br>
> Path: 00860004.Flow.FlowID, Type: Feature, ReportID: 0x01, Offset:
0, Size: 4<br>
> parsing 00860004<br>
> parsing Flow<br>
> hid_lookup_usage: found 84001e<br>
> parsing ConfigVoltage<br>
> hid_lookup_usage: found 840040<br>
> Path depth = 3<br>
> 0: Usage(00860004)<br>
> 1: Usage(0084001e)<br>
> 2: Usage(00840040)<br>
> Entering libusb_get_report. ReportSize: 13<br>
> typesafe_control_msg: size: 13<br>
> Can't retrieve Report 1 (75): Value too large for defined data
type<br>
> Path: 00860004.Flow.ConfigVoltage, Type: Feature, ReportID: 0x01,
<br>
> Offset: 8, Size: 16<br>
> <br>
> Is this correct, or is there something else that needs looking
at?<br>
> <br>
> Regards<br>
> Jon<br>
> <br>
> Data from lsusb<br>
><snip></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>