[Nut-upsdev] newhidups (2.03-pre2) not working with APC Back-UPS

Peter Selinger selinger at mathstat.dal.ca
Thu Jan 26 21:16:56 UTC 2006


I see. The Back-UPS 500 organizes its usage tree differently. Try the
attached patch. If it works, I will commit it to CVS. -- Peter

Charlie Brady wrote:
> 
> 
> On Thu, 26 Jan 2006, Peter Selinger wrote:
> 
> > The way to solve the puzzle is to post the USB's Usage Tree to the
> > list; you can generate it by running
> > 
> > ./drivers/newhidups -u root -DD -a UPS auto
> > 
> > and copy/pasting the debugging output, particularly the lines starting
> > with "Path".
> 
> Thanks Peter.
> 
> ...
> Detected a UPS: American Power Conversion/Back-UPS 500 FW: 6.5.D USB FW: c1
> Using subdriver: APC HID 0.8
> Path: UPS.PowerSummary.iProduct, Type: Feature, Value: 1.000000
> Path: UPS.PowerSummary.iSerialNumber, Type: Feature, Value: 2.000000
> Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, Value: 4.000000
> Path: UPS.PowerSummary.iOEMInformation, Type: Feature, Value: 3.000000
> Path: UPS.PowerSummary.Rechargeable, Type: Feature, Value: 1.000000
> Path: UPS.PowerSummary.Charging, Type: Input, Value: 0.000000
> Path: UPS.PowerSummary.Charging, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.Discharging, Type: Input, Value: 0.000000
> Path: UPS.PowerSummary.Discharging, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.APCStatusFlag, Type: Input, Value: 8.000000
> Path: UPS.PowerSummary.APCStatusFlag, Type: Feature, Value: 8.000000
> Path: UPS.PowerSummary.ManufacturerDate, Type: Feature, Value: 
> 11606.000000
> Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, Value: 12.000000
> Path: UPS.PowerSummary.Voltage, Type: Feature, Value: 13.000000
> Path: UPS.PowerSummary.iManufacturer, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.CapacityMode, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.RemainingCapacity, Type: Input, Value: 100.000000
> Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, Value: 100.000000
> Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, Value: 2580.000000
> Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, Value: 2580.000000
> Path: UPS.PowerSummary.DesignCapacity, Type: Feature, Value: 100.000000
> Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, Value: 
> 100.000000
> Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature, Value: 
> 50.000000
> Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature, Value: 
> 1.000000
> Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature, Value: 
> 10.000000
> Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, Value: 
> 1.000000
> Path: UPS.PowerSummary.ACPresent, Type: Input, Value: 1.000000
> Path: UPS.PowerSummary.ACPresent, Type: Feature, Value: 1.000000
> Path: UPS.PowerSummary.BelowRemainingCapacityLimit, Type: Input, Value: 
> 0.000000
> Path: UPS.PowerSummary.BelowRemainingCapacityLimit, Type: Feature, Value: 
> 0.000000
> Path: UPS.PowerSummary.ShutdownImminent, Type: Input, Value: 0.000000
> Path: UPS.PowerSummary.ShutdownImminent, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.APCPanelTest, Type: Feature, Value: 0.000000
> Path: UPS.PowerSummary.APCBattReplaceDate, Type: Feature, Value: 
> 1057282.000000
> Path: UPS.APCGeneralCollection.APCForceShutdown, Type: Feature, Value: 
> 0.000000
> entering identify_ups(0x051d, 0x0002)
> 
> Can't find object UPS.Battery.RemainingTimeLimit
> Can't find object UPS.Battery.ConfigVoltage
> Can't find object UPS.Battery.Temperature
> Can't find object UPS.Output.PercentLoad
> Can't find object UPS.PowerConverter.PercentLoad
> Can't find object UPS.PowerSummary.DelayBeforeShutdown
> Can't find object UPS.APCGeneralCollection.APCDelayBeforeShutdown
> Can't find object UPS.Battery.Test
> Can't find object UPS.Battery.Temperature
> Can't find object UPS.AudibleAlarmControl
> Can't find object UPS.ManufacturerDate
> Can't find object UPS.Battery.ManufacturerDate
> Can't find object UPS.Battery.APCBattReplaceDate
> Can't find object UPS.PowerSummary.PresentStatus.ACPresent
> Can't find object UPS.PowerSummary.PresentStatus.Discharging
> Can't find object UPS.PowerSummary.PresentStatus.Charging
> Can't find object UPS.PowerSummary.PresentStatus.ShutdownImminent
> Can't find object 
> UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit
> Can't find object UPS.PowerSummary.PresentStatus.OverLoad
> Can't find object UPS.PowerSummary.PresentStatus.NeedReplacement
> Can't find object UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired
> Can't find object UPS.PowerSummary.PresentStatus.BatteryPresent
> Can't find object UPS.Input.Voltage
> Can't find object UPS.Input.ConfigVoltage
> Can't find object UPS.Input.LowVoltageTransfer
> Can't find object UPS.Input.HighVoltageTransfer
> Can't find object UPS.Output.Voltage
> Can't find object UPS.Output.ConfigVoltage
> Can't find object UPS.BatterySystem.Battery.Test
> Can't find object UPS.BatterySystem.Battery.Test
> Can't find object UPS.BatterySystem.Battery.Test
> Can't find object UPS.APCPanelTest
> Can't find object UPS.APCPanelTest
> Can't find object UPS.PowerSummary.DelayBeforeShutdown
> Can't find object UPS.APCGeneralCollection.APCDelayBeforeShutdown
> Can't find object UPS.PowerSummary.DelayBeforeStartup
> Can't find object UPS.APCGeneralCollection.APCDelayBeforeShutdown
> Can't find object UPS.PowerSummary.DelayBeforeShutdown
> Can't find object UPS.AudibleAlarmControl
> Can't find object UPS.AudibleAlarmControl
> upsdrv_updateinfo...
> dstate_init: sock /var/run/nut/newhidups-auto open on fd 5
> upsdrv_updateinfo...
> Waiting for notifications...
> 
> --
> Charlie
> 

-------------- next part --------------
Index: drivers/apc-hid.c
===================================================================
RCS file: /cvsroot/nut/nut/drivers/Attic/apc-hid.c,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 apc-hid.c
--- drivers/apc-hid.c	7 Nov 2005 22:14:20 -0000	1.1.2.9
+++ drivers/apc-hid.c	26 Jan 2006 21:17:45 -0000
@@ -158,11 +158,12 @@
   { "battery.runtime.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.RemainingTimeLimit", NULL, "%.0f", HU_FLAG_OK, NULL },
   { "battery.voltage",  0, 0, "UPS.PowerSummary.Voltage", NULL, "%.1f", HU_FLAG_OK, NULL },
   { "battery.voltage.nominal", 0, 0, "UPS.Battery.ConfigVoltage", NULL, "%.1f", HU_FLAG_OK, NULL },
-  { "battery.voltage.nominal", 0, 0, "UPS.PowerSummary.ConfigVoltage", NULL, "%.1f", HU_FLAG_OK, NULL }, /* CyberPower */
+  { "battery.voltage.nominal", 0, 0, "UPS.PowerSummary.ConfigVoltage", NULL, "%.1f", HU_FLAG_OK, NULL }, /* CyberPower, Back-UPS 500 */
   { "battery.temperature", 0, 0, "UPS.Battery.Temperature", NULL, "%.1f", HU_FLAG_OK, NULL },
   { "battery.type", 0, 0, "UPS.PowerSummary.iDeviceChemistry", NULL, "%s", HU_FLAG_OK, stringid_conversion },
   { "battery.mfr.date", 0, 0, "UPS.Battery.ManufacturerDate", NULL, "%s", HU_FLAG_OK, &date_conversion[0] },
   { "battery.date", 0, 0, "UPS.Battery.APCBattReplaceDate", NULL, "%s", HU_FLAG_OK, &date_conversion[0] },
+  { "battery.date", 0, 0, "UPS.PowerSummary.APCBattReplaceDate", NULL, "%s", HU_FLAG_OK, &date_conversion[0] }, /* Back-UPS 500 */
 
   /* UPS page */
   { "ups.load", 0, 1, "UPS.Output.PercentLoad", NULL, "%.1f", HU_FLAG_OK, NULL },
@@ -175,6 +176,7 @@
   { "ups.temperature", 0, 0, "UPS.Battery.Temperature", NULL, "%.1f", HU_FLAG_OK, NULL },
   { "ups.beeper.status", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.AudibleAlarmControl", NULL, "%s", HU_FLAG_OK, &beeper_info[0] },
   { "ups.mfr.date", 0, 0, "UPS.ManufacturerDate", NULL, "%s", HU_FLAG_OK, &date_conversion[0] },
+  { "ups.mfr.date", 0, 0, "UPS.PowerSummary.ManufacturerDate", NULL, "%s", HU_FLAG_OK, &date_conversion[0] }, /* Back-UPS 500 */
   { "ups.power.nominal", 0, 0, "UPS.Output.ConfigActivePower", NULL, "%s", HU_FLAG_OK, watts_to_av_conversion }, /* CyberPower */
 
 
@@ -192,6 +194,13 @@
   { "ups.status", 0, 1, "UPS.PowerSummary.PresentStatus.NeedReplacement", NULL, "%.0f", HU_FLAG_OK, &replacebatt_info[0] },
   { "ups.status", 0, 1, "UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired", NULL, "%.0f", HU_FLAG_OK, &timelimitexpired_info[0] },
   { "ups.status", 0, 1, "UPS.PowerSummary.PresentStatus.BatteryPresent", NULL, "%.0f", HU_FLAG_OK, &batterypresent_info[0] },
+
+  { "ups.status", 0, 1, "UPS.PowerSummary.Charging", NULL, "%.0f", HU_FLAG_OK, &charging_info[0] }, /* Back-UPS 500 */
+  { "ups.status", 0, 1, "UPS.PowerSummary.Discharging", NULL, "%.0f", HU_FLAG_OK, &discharging_info[0] }, /* Back-UPS 500 */
+  { "ups.status", 0, 1, "UPS.PowerSummary.ACPresent", NULL, "%.0f", HU_FLAG_OK, &online_info[0] }, /* Back-UPS 500 */
+  { "ups.status", 0, 1, "UPS.PowerSummary.BelowRemainingCapacityLimit", NULL, "%.0f", HU_FLAG_OK, &lowbatt_info[0] }, /* Back-UPS 500 */
+  { "ups.status", 0, 1, "UPS.PowerSummary.ShutdownImminent", NULL, "%.0f", HU_FLAG_OK, &shutdownimm_info[0] },
+
   { "ups.status", 0, 1, "UPS.PowerSummary.PresentStatus.FullyCharged", NULL, "%.0f", HU_FLAG_OK, &fullycharged_info[0] }, /* CyberPower */
   { "ups.status", 0, 1, "UPS.Output.Overload", NULL, "%.0f", HU_FLAG_OK, &overload_info[0] }, /* CyberPower */
   { "ups.status", 0, 1, "UPS.Output.Boost", NULL, "%.0f", HU_FLAG_OK, &boost_info[0] }, /* CyberPower */
@@ -215,6 +224,8 @@
   { "test.battery.stop", 0, 0, "UPS.BatterySystem.Battery.Test", NULL, "3", HU_TYPE_CMD | HU_FLAG_OK, &test_write_info[0] },
   { "test.panel.start", 0, 0, "UPS.APCPanelTest", NULL, "1", HU_TYPE_CMD | HU_FLAG_OK, NULL },
   { "test.panel.stop", 0, 0, "UPS.APCPanelTest", NULL, "0", HU_TYPE_CMD | HU_FLAG_OK, NULL },
+  { "test.panel.start", 0, 0, "UPS.PowerSummary.APCPanelTest", NULL, "1", HU_TYPE_CMD | HU_FLAG_OK, NULL }, /* Back-UPS 500 */
+  { "test.panel.stop", 0, 0, "UPS.PowerSummary.APCPanelTest", NULL, "0", HU_TYPE_CMD | HU_FLAG_OK, NULL }, /* Back-UPS 500 */
 
   { "load.off", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, "0", HU_TYPE_CMD | HU_FLAG_OK, NULL },
   { "load.off", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeShutdown", NULL, "0", HU_TYPE_CMD | HU_FLAG_OK, NULL }, /* APC Backups ES */


More information about the Nut-upsdev mailing list