Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-11 Thread Pier Paolo Glave
>>> I'm ready now to go on with NUT configuration: I think I'm able now to
>>> have a controlled PC shutdown.
>>> I'll let you know how it goes.
>>
>> That's also something I would be interested in.
>

Hi Arjen and all,

I succeeded in having a controlled shutdown, when the UPS went in
low-battery status.
I'm happy with the result.

However, I've just realized that I had also done another change in the
drivers' source code: I changed the belkin-hid.c and liebert-hid.c
drivers, in order to select the liebert driver, instead of the belkin
one, when my vendor ID was found.
Without this change, I'm not able to correctly see the online/on
battery status (I always see "on battery"), even with the suggested
change in libhid.c.

In detail, my change is the following:

--- belkin-hid.c.orig   2011-02-04 11:09:00.0 +0100
+++ belkin-hid.c2011-02-04 11:12:01.0 +0100
@@ -34,7 +34,7 @@
#define BELKIN_VENDORID0x050d

/* Liebert */
-#define LIEBERT_VENDORID   0x10af
+//#define LIEBERT_VENDORID 0x10af

/* USB IDs device table */
static usb_device_id_t belkin_usb_device_table[] = {
@@ -58,7 +58,7 @@
{ USB_DEVICE(BELKIN_VENDORID, 0x1100), NULL },

/* Liebert PowerSure PSA UPS */
-   { USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },
+   //{ USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },

/* Terminating entry */
{ -1, -1, NULL }
@@ -449,7 +449,7 @@
}
possibly_supported("Belkin", hd);
return 0;
-
+#if 0
case LIEBERT_VENDORID:
/* by default, reject, unless the productid
option is given */
if (getval("productid")) {
@@ -457,6 +457,7 @@
}
possibly_supported("Liebert", hd);
return 0;
+#endif
}


--- liebert-hid.c.orig  2011-02-04 11:09:11.0 +0100
+++ liebert-hid.c   2011-02-04 11:10:25.0 +0100
@@ -30,12 +30,15 @@
/* FIXME: experimental flag to be put in upsdrv_info */

/* Liebert */
-#define LIEBERT_VENDORID 0x06da
+//#define LIEBERT_VENDORID 0x06da
+#define LIEBERT_VENDORID   0x10af

/* USB IDs device table */
static usb_device_id_t liebert_usb_device_table[] = {
/* various models */
-   { USB_DEVICE(LIEBERT_VENDORID, 0x), NULL },
+   //{ USB_DEVICE(LIEBERT_VENDORID, 0x), NULL },
+   /* Liebert PowerSure PSA UPS */
+   { USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },

/* Terminating entry */
{ -1, -1, NULL }


Best regards,
Pier

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Pier Paolo Glave
On Mon, Feb 7, 2011 at 2:51 PM, Arjen de Korte  wrote:
> Citeren Pier Paolo Glave :
>
> Looking at the debug output you sent earlier, it looks like your UPS might
> support some other variables too. Could you please post some similar output
> as you did recently, now with these patches included?

Sure: you can find it attached here.

>> I'm ready now to go on with NUT configuration: I think I'm able now to
>> have a controlled PC shutdown.
>> I'll let you know how it goes.
>
> That's also something I would be interested in.

Ok: I think tomorrow I will go on and let you know about the progress.

Regards,
Pier


nut-usbhid-2.6-patched-20110207.log.gz
Description: GNU Zip compressed data
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Arjen de Korte

Citeren Pier Paolo Glave :


Yes!
The results are quite different now :)


That's good to know.


This is the result of "upsc" now, when AC power is plugged in:
battery.charge: 100
battery.type: PbAc
battery.voltage: 28
battery.voltage.nominal: 2
device.mfr: Emerson Network Power
device.model: LiebertPSA
device.serial:
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: Liebert HID 0.3
driver.version.internal: 0.35
ups.mfr: Emerson Network Power
ups.model: LiebertPSA
ups.productid: 0001
ups.serial:
ups.status: OL CHRG
ups.vendorid: 10af


Looking at the debug output you sent earlier, it looks like your UPS  
might support some other variables too. Could you please post some  
similar output as you did recently, now with these patches included?



And, if I unplug the AC power, the following parameter changes:
ups.status: OB DISCHRG


That looks promising.


Thank you Arjen: you gave me a good support, in a very short time.

I'm ready now to go on with NUT configuration: I think I'm able now to
have a controlled PC shutdown.
I'll let you know how it goes.


That's also something I would be interested in.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Pier Paolo Glave
On Mon, Feb 7, 2011 at 12:37 PM, Arjen de Korte  wrote:
>
> It looks like the firmware developers missed the fact that for some units,
> an exponent is used (V, VA and W) which causes a 7 decades offset. You
> either have to account for that in the units exponent or use a type that
> doesn't have this offset. I'm fairly certain that by commenting out the
> following lines in drivers/libhid.c
>
> 604             for (i = 0; i < NB_HID_UNITS; i++) {
> 605
> 606                     if (HIDUnits[i].Type == hiddata->Unit) {
> 607                             unit_expo -= HIDUnits[i].Expo;
> 608                             break;
> 609                     }
> 610             }
>
> you'll get better results. Please let us know if it does, so that we can
> include this fix in the belkin-hid subdriver.
>

Yes!
The results are quite different now :)

This is the result of "upsc" now, when AC power is plugged in:
battery.charge: 100
battery.type: PbAc
battery.voltage: 28
battery.voltage.nominal: 2
device.mfr: Emerson Network Power
device.model: LiebertPSA
device.serial:
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: Liebert HID 0.3
driver.version.internal: 0.35
ups.mfr: Emerson Network Power
ups.model: LiebertPSA
ups.productid: 0001
ups.serial:
ups.status: OL CHRG
ups.vendorid: 10af

And, if I unplug the AC power, the following parameter changes:
ups.status: OB DISCHRG

Thank you Arjen: you gave me a good support, in a very short time.

I'm ready now to go on with NUT configuration: I think I'm able now to
have a controlled PC shutdown.
I'll let you know how it goes.

Kind regards,
Pier

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Arjen de Korte

Citeren Pier Paolo Glave :


Please find attached the log of "/lib/nut/usbhid-ups -D -a liebert",
produced with the 2.6 driver.


From this it is quite clear what is happening. The UPS *is* reporting  
the values needed, but the people that wrote the firmware of this  
device apparently got some things horribly wrong in the report  
descriptor. For many variables, the exponents are incorrect. It is  
nonsense to report the status bits (like  
UPS.PowerSummary.PresentStatus.*) with the unit "V" (00f0d121). This  
means that instead of integer values (0 or 1), these values are  
reported as floating point (0 or 1e-07) due to the exponent that is  
embedded in the unit. Subsequent parsing of the values fails.


It looks like the firmware developers missed the fact that for some  
units, an exponent is used (V, VA and W) which causes a 7 decades  
offset. You either have to account for that in the units exponent or  
use a type that doesn't have this offset. I'm fairly certain that by  
commenting out the following lines in drivers/libhid.c


604 for (i = 0; i < NB_HID_UNITS; i++) {
605
606 if (HIDUnits[i].Type == hiddata->Unit) {
607 unit_expo -= HIDUnits[i].Expo;
608 break;
609 }
610 }

you'll get better results. Please let us know if it does, so that we  
can include this fix in the belkin-hid subdriver.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Pier Paolo Glave
(I'm posting again this message, because I've seen that the last lines
and the attachment are missing, in the version archived at
http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-February/006618.html.
Maybe it's because I was not using plain text. Sorry for the double
post, if you received it twice. Pier)

Hi Arjen,

Thanks for your answer.
If you have time to support me, I will for sure follow you, providing all
the information you need.
I'm a software designer too, so don't hesitate to ask for some particular
build or to make changes at source code level.

> Looking at the rejected earlier message, I'd say you have a Belkin OEM
> device that has a very broken report descriptor. You may want to
> checkout the recently released nut-2.6.0 version. But I'm almost
> certain that the fixes in the HID parser are not going to solve this
> problem and that instead the problem is in the UPS itself. We may or
> may not be able to work around this, but in that case we will need
> lots of support from you (and you must be willing/capable to run the
> development version too).

I have built the nut-2.6.0 version.
I did not want to completely uninstall my 2.4.3 version, which had been so
gracefully installed by the debian package system... So, I tried to install
only the 2.6.0 drivers, and forced nut to use them, by creating a new
directory called /lib/nut-2.6, and making a symbolic link:
/lib/nut -> /lib/nut-2.6.
Please tell me if this is a right approach, to use the 2.6 HID parser.

>From this test, it seems that you were right: the UPS is still reported as
"OB", and some information (like the serial number, e.g) are missing from
the upsc report.

> > I would like to paste also a complete tracing of "/lib/nut/usbhid-ups
> -D
> > -a liebert", but the message would become too big.
>
> Then use gzip to compress it before attaching. We really need the full
> listing as an attachment, not inline in a message.
>

Ok, I will do in this way.
Please find attached the log of "/lib/nut/usbhid-ups -D -a liebert",
produced with the 2.6 driver.

Thank you for your support.

Kind regards,
--
Pier


nut-usbhid-2.6-20110207.log.gz
Description: GNU Zip compressed data
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-07 Thread Pier Paolo Glave
Hi Arjen,

Thanks for your answer.
If you have time to support me, I will for sure follow you, providing all
the information you need.
I'm a software designer too, so don't hesitate to ask for some particular
build or to make changes at source code level.

Looking at the rejected earlier message, I'd say you have a Belkin OEM
> device that has a very broken report descriptor. You may want to
> checkout the recently released nut-2.6.0 version. But I'm almost
> certain that the fixes in the HID parser are not going to solve this
> problem and that instead the problem is in the UPS itself. We may or
> may not be able to work around this, but in that case we will need
> lots of support from you (and you must be willing/capable to run the
> development version too).
>

I have built the nut-2.6.0 version.
I did not want to completely uninstall my 2.4.3 version, which had been so
gracefully installed by the debian package system... So, I tried to install
only the 2.6.0 drivers, and forced nut to use them, by creating a new
directory called /lib/nut-2.6, and making a symbolic link:
/lib/nut -> /lib/nut-2.6.
Please tell me if this is a right approach, to use the 2.6 HID parser.

>From this test, it seems that you were right: the UPS is still reported as
"OB", and some information (like the serial number, e.g) are missing from
the upsc report.


>
> > I would like to paste also a complete tracing of "/lib/nut/usbhid-ups
> -D
> > -a liebert", but the message would become too big.
>
> Then use gzip to compress it before attaching. We really need the full
> listing as an attachment, not inline in a message.
>

Ok, I will do in this way.
Please find attached the log of "/lib/nut/usbhid-ups -D -a liebert",
produced with the 2.6 driver.

Thank you for your support.

Kind regards,
--
Pier


nut-usbhid-2.6-20110207.log.gz
Description: GNU Zip compressed data
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-06 Thread Arjen de Korte

Citeren Pier Paolo Glave :


Everything seems to be fine, except that, when I run "upsc
liebert@localhostups.status", it retuns "OB", even if the UPS is
currently online.


Looking at the rejected earlier message, I'd say you have a Belkin OEM  
device that has a very broken report descriptor. You may want to  
checkout the recently released nut-2.6.0 version. But I'm almost  
certain that the fixes in the HID parser are not going to solve this  
problem and that instead the problem is in the UPS itself. We may or  
may not be able to work around this, but in that case we will need  
lots of support from you (and you must be willing/capable to run the  
development version too).


[...]


I would like to paste also a complete tracing of "/lib/nut/usbhid-ups -D
-a liebert", but the message would become too big.


Then use gzip to compress it before attaching. We really need the full  
listing as an attachment, not inline in a message.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


[Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-03 Thread Pier Paolo Glave
Hi all,

This is my first experience with NUT.
I'm trying to test a Liebert PSA 1500 UPS, connected via USB to a single PC.
I have followed the instruction in the "Configuration" section of the online
user manual.

Everything seems to be fine, except that, when I run "upsc
liebert@localhostups.status", it retuns "OB", even if the UPS is
currently online.

Here are the information related to my system:

   - Debian 6.0 on Intel Pentium 4; kernel version 2.6.32-5-686;
   - NUT version 2.4.3-1.1squeeze1, installed with package system;
   - UPS: Liebert PSA1500MT3-230U

My ups.conf is the following:
[liebert]
driver = usbhid-ups
port = auto
desc = "Liebert PSA1500MT3 UPS"

The result of "upsdrvctl start" is:
Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12

The result of "upsd" is:
Network UPS Tools upsd 2.4.3
listening on 127.0.0.1 port 3493
listening on ::1 port 3493
Connected to UPS [liebert]: usbhid-ups-liebert

The complete list obtained with "upsc" is:
battery.charge.low: 38
battery.charge.warning: 38
battery.type: PbAc
device.mfr: Emerson Network Power
device.model: LiebertPSA
device.serial:
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.4.3
driver.version.data: Belkin HID 0.12
driver.version.internal: 0.34
ups.mfr: Emerson Network Power
ups.model: LiebertPSA
ups.productid: 0001
ups.serial:
ups.status: OB
ups.vendorid: 10af

What problem could be there?

I would like to paste also a complete tracing of "/lib/nut/usbhid-ups -D
-a liebert", but the message would become too big.
Please tell me if there is any relevant portion that I could paste here.
Thanks in advance for your help.
Pier
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser