On Wed, Sep 28, 2005 at 01:49:00PM +0200, Samuele Giovanni Tonon wrote:
> hi,
> there seems to be a problem related to reporting voltage on 64 bit
> processor:
> 
> apcaccess status reports wrong line voltage for my UPS. An endianness
> issue perhaps? It says 'LINEV    : 59210.4 Volts'. Note that
> 59210.4 / 256 = 231.291 which is probably what it should report.

Interesting. It's definitely not an endianness issue since that would
not result in an 8 bit shift, but rather a complete reordering of the
bytes. I've just gone thru both the kernel and apcupsd code and I don't
see anything that could cause a shift. BUT, there it's possible that
your reading isn't shifted, but rather has an extra garbage byte:

592104 = 0x908E8
0x908E8 >> 8 == 0x908 == 2312 (as you pointed out)
0x908E8 & 0xFFFF == 0x8E8 == 2280

That last one is also in the right ballpark and could be explained by an
UPS firmware bug. So far I've only seen that particular bug on BackUPS 
Pro models, but perhaps it afflicts the European BR models as well.

To know for sure, you need to enable HID debugging in your kernel config
and rebuild your kernel. Fist, make sure CONFIG_USB_DEBUG is selected.
Then edit drivers/usb/input/hid-core.c and at the top of the file
replace...

        #undef DEBUG
        #undef DEBUG_DATA

...with...

        #define DEBUG
        #define DEBUG_DATA

Then build  the kernel and install it. Boot into the new kernel and 
launch apcupsd. Send your dmesg output which should contain a lot of
USB HID debug messages. Note that if you have a USB keyboard or mouse
it would be very helpful if you could disconnect them and do this 
remotely via ssh or something. Otherwise dmesg will be filled with
keyboard data.

--Adam



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to