Hi On 10/06/2014 03:04 PM, Charles Lepple wrote:> I think I see what is going on. > > 0.368670 Report[buf]: (5 bytes) => 05 4e 00 48 00 > 0.368698 PhyMax = 0, PhyMin = 0, LogMax = 1, LogMin = 0 > 0.368723 Unit = 00000000, UnitExp = 0 > 0.368747 Exponent = 0 > 0.368776 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: >0x05, Offset: 0, Size: 16, Value: 0 > 0.368805 Input/OutputVoltage = 0 -> assuming correction factor = 1e+07 > > offset 0, size 16 in Report[buf] is '4e 00' (0x004e == 78) but LogMax is 1 > (and it should be 0xffff to match the size). > > This is annoying, because it means that we can't simply scale the values. I > don't know of an easy way to fix this, short of adding a way to override the > HID Report Descriptor. > > While we're here, does a battery voltage of 72V nominal sound reasonable for > your unit? >
Yes, that's it. >> OK, i suppose that this issue will be solved when all the liebert devices >> will be moved in the liebert-hid driver, in the future. > > I'm not sure I understand why we would want do this. We really have two > different "Liebert" cases: the rebranded Phoenixtec hardware (which basically > complies with the HID PDC spec, although does not provide much information), > and the buggy Liebert/Belkin hardware. Call it inertia or laziness, but > combining the two means lots of extra testing to make sure we do not break > existing device support. > Ok, i didn't understand the purpose of the liebert-hid driver. Moreover, I don't see any problem with the actual code organization, I'd just need to understand. >> Please find in attachment the hid report descriptor : there are several >> Charging/Discharging fields. >> I'm wondering if it gives the status of the different (additional) battery >> composing the system ? > > If so, they are not reporting the presence of such a battery: > > 0.428188 Report[buf]: (2 bytes) => 0c 05 > 0.428215 PhyMax = 0, PhyMin = 0, LogMax = 1, LogMin = 0 > 0.428240 Unit = 00000000, UnitExp = 0 > 0.428264 Exponent = 0 > 0.428290 hid_lookup_path: 00840004 -> UPS > 0.428316 hid_lookup_path: 00840024 -> PowerSummary > 0.428344 hid_lookup_path: 008500d1 -> BatteryPresent > 0.428373 Path: UPS.PowerSummary.BatteryPresent, Type: Input, ReportID: >0x0c, Offset: 4, Size: 1, Value: 0 > Yes the presence of the battery isn't reported as i expected. > >>>> (4) would it be useful to add missing items to the driver's hid to nu >>>> lookup table (even in the the unmapped part) ? >>> >>> Sure, although the unmapped entries are just for debugging - we will want >>> to eventually rename them to official NUT names, or comment them out again >>> before checking the driver in to version control. Please find attached the patches i have applied to the current master. >> >> Is there a list of all official NUT names (i haven't searched yet) ? >> > http://www.networkupstools.org/docs/developer-guide.chunked/apas01.html > Thank you. Paul.
From 022759bb5707d95ff2091a1924417761010ab422 Mon Sep 17 00:00:00 2001 From: Paul Chavent <paul.chav...@onera.fr> Date: Fri, 10 Oct 2014 13:45:56 +0200 Subject: [PATCH 1/3] drivers : fix possible memory leak. In arguments parsing, if user option is passed. --- drivers/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/main.c b/drivers/main.c index 7c2fc55..84ec0e5 100644 --- a/drivers/main.c +++ b/drivers/main.c @@ -519,6 +519,7 @@ int main(int argc, char **argv) chroot_path = xstrdup(optarg); break; case 'u': + free(user); user = xstrdup(optarg); break; case 'V': -- 1.7.10.4
From 1d7e7fd6591dbb5a986f9990941cd8ffe652aaa8 Mon Sep 17 00:00:00 2001 From: Paul Chavent <paul.chav...@onera.fr> Date: Fri, 10 Oct 2014 13:47:54 +0200 Subject: [PATCH 2/3] drivers : add Liebert GXT3 device. --- drivers/belkin-hid.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/belkin-hid.c b/drivers/belkin-hid.c index a4aed41..625e9a6 100644 --- a/drivers/belkin-hid.c +++ b/drivers/belkin-hid.c @@ -69,6 +69,8 @@ static usb_device_id_t belkin_usb_device_table[] = { { USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL }, /* Liebert PowerSure PSI 1440 */ { USB_DEVICE(LIEBERT_VENDORID, 0x0004), NULL }, + /* Liebert GXT3 */ + { USB_DEVICE(LIEBERT_VENDORID, 0x0008), NULL }, /* Terminating entry */ { -1, -1, NULL } @@ -523,6 +525,22 @@ static hid_info_t belkin_hid2nut[] = { yet implemented) workaround, see the belkinunv(8) man page. -PS 2005/08/28 */ +#if 0 + /* added for debugging Liebert GXT3 : */ + { "unmapped.ups.powersummary.iserialnumber", 0, 0, "UPS.PowerSummary.iSerialNumber", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.imanufacturer", 0, 0, "UPS.PowerSummary.iManufacturer", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.ioeminformation", 0, 0, "UPS.PowerSummary.iOEMInformation", NULL, "%s", 0, stringid_conversion }, + { "unmapped.ups.powersummary.designcapacity", 0, 0, "UPS.PowerSummary.DesignCapacity", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.remainingtimelimit", 0, 0, "UPS.PowerSummary.RemainingTimeLimit", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.capacitymode", 0, 0, "UPS.PowerSummary.CapacityMode", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.rechargeable", 0, 0, "UPS.PowerSummary.Rechargeable", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.batterypresent", 0, 0, "UPS.PowerSummary.BatteryPresent", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.fullchargecapacity", 0, 0, "UPS.PowerSummary.FullChargeCapacity", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.capacitygranularity1", 0, 0, "UPS.PowerSummary.CapacityGranularity1", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.capacitygranularity2", 0, 0, "UPS.PowerSummary.CapacityGranularity2", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.iproduct", 0, 0, "UPS.PowerSummary.iProduct", NULL, "%.0f", 0, NULL }, +#endif + /* end of structure. */ { NULL, 0, 0, NULL, NULL, NULL, 0, NULL } }; -- 1.7.10.4
From 38ca69940c25e4c74ef3fa71f95d5e2ac09e374d Mon Sep 17 00:00:00 2001 From: Paul Chavent <paul.chav...@onera.fr> Date: Fri, 10 Oct 2014 13:48:11 +0200 Subject: [PATCH 3/3] drivers : Liebert GXT3 workaround. --- drivers/libusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/libusb.c b/drivers/libusb.c index fd8f5b9..f901c05 100644 --- a/drivers/libusb.c +++ b/drivers/libusb.c @@ -220,8 +220,10 @@ static int libusb_open(usb_dev_handle **udevp, USBDevice_t *curDevice, USBDevice } #endif +#if 0 /* set default interface */ usb_set_altinterface(udev, 0); +#endif if (!callback) { return 1; -- 1.7.10.4
_______________________________________________ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser