Hello,

Got PowerCOM BNT-1000AP, usb id 0d9f:00a6, firmware FW4.A6

nut 2.4.3 on debian stable shows only two instant commands:

beeper.toggle - Toggle the UPS beeper             -- not working
test.battery.start.quick - Start a quick battery test  -- works ok.

No load and shutdown commands.

Trying svn trunk version, with the same results.

Debug output shows the problem:

   0.035558     hid_lookup_path: 00840004 -> UPS
   0.035569     hid_lookup_path: 00840024 -> PowerSummary
   0.035580     hid_lookup_path: 00ff0057 -> not found in lookup table

..skip..

   0.036073     hid_lookup_path: 00840004 -> UPS
   0.036084     hid_lookup_path: 00840024 -> PowerSummary
   0.036095     hid_lookup_path: 00ff0056 -> not found in lookup table

..skip..

   0.054472     hid_lookup_usage: UPS -> 00840004
   0.054476     hid_lookup_usage: PowerSummary -> 00840024
   0.054480     hid_lookup_usage: DelayBeforeStartup -> 00840056
   0.054488     string_to_path: depth = 3
   0.054494     hid_lookup_usage: UPS -> 00840004
   0.054499     hid_lookup_usage: PowerSummary -> 00840024
   0.054503     hid_lookup_usage: DelayBeforeShutdown -> 00840057
   0.054507     string_to_path: depth = 3
   0.054512     hid_lookup_usage: UPS -> 00840004
   0.054517     hid_lookup_usage: PowerSummary -> 00840024
   0.054521     hid_lookup_usage: DelayBeforeShutdown -> 00840057
   0.054525     string_to_path: depth = 3
   0.054531     find_nut_info: unknown info type: load.off.delay
   0.054535     find_nut_info: unknown info type: load.on.delay
   0.054539     find_nut_info: unknown info type: load.off.delay

Appears in firmware FW4.A6 PowerCOM changed DelayBeforeStartup/Shutdown
usage pages to Page 0x00ff.
It's non-standard,  "USB Usage Tables for HID Power Devices" says:
  "Usage pages xFF00 to xFFFF are reserved by HID for vendor-specific
implementation".
May change again..

  Anyway, patch against svn trunk attached.
Beeper.enable/disable also works, but only on battery.

Patched nut upscmd -l output:

Instant commands supported on UPS [pcm]:

beeper.disable - Disable the UPS beeper
beeper.enable - Enable the UPS beeper
beeper.toggle - Toggle the UPS beeper
load.off - Turn off the load immediately
load.on - Turn on the load immediately
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
test.battery.start.quick - Start a quick battery test
Index: drivers/powercom-hid.c
===================================================================
--- drivers/powercom-hid.c	(revision 3857)
+++ drivers/powercom-hid.c	(working copy)
@@ -94,6 +94,7 @@
 	uint16_t	val, command;
 
 	val = atoi(value ? value : s);
+	val = val ? val : 1;    /* 0 sets the maximum delay */
 	command = ((val % 60) << 8) + (val / 60);
 	command |= 0x4000;	/* AC RESTART NORMAL ENABLE */
 	upsdebugx(3, "%s: value = %s, command = %04X", __func__, value, command);
@@ -111,6 +112,7 @@
 	uint16_t	val, command;
 
 	val = atoi(value ? value : s);
+	val = val ? val : 1;    /* 0 sets the maximum delay */
 	command = ((val % 60) << 8) + (val / 60);
 	command |= 0x8000;	/* AC RESTART NORMAL DISABLE */
 	upsdebugx(3, "%s: value = %s, command = %04X", __func__, value, command);
@@ -137,6 +139,8 @@
 	{ "POWERCOM1",	0x0084002f },
 	{ "POWERCOM2",	0xff860060 },
 	{ "POWERCOM3",	0xff860080 },
+	{ "PCMDelayBeforeStartup",	0x00ff0056 },
+	{ "PCMDelayBeforeShutdown",	0x00ff0057 },
 	{  NULL, 0 }
 };
 
@@ -235,6 +239,8 @@
  */
 	{ "ups.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 8, "UPS.PowerSummary.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_FLAG_ABSENT, NULL },
 	{ "ups.timer.shutdown", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, "%.0f", HU_FLAG_QUICK_POLL, powercom_shutdown_info },
+	{ "ups.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 8, "UPS.PowerSummary.PCMDelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_FLAG_ABSENT, NULL },
+	{ "ups.timer.shutdown", 0, 0, "UPS.PowerSummary.PCMDelayBeforeShutdown", NULL, "%.0f", HU_FLAG_QUICK_POLL, powercom_shutdown_info },
 
 	{ "input.voltage", 0, 0, "UPS.Input.Voltage", NULL, "%.1f", 0, NULL },
 	{ "input.voltage.nominal", 0, 0, "UPS.Input.ConfigVoltage", NULL, "%.0f", HU_FLAG_STATIC, NULL },
@@ -251,10 +257,16 @@
 
 	/* instcmds */
 	{ "beeper.toggle", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL },
+	{ "beeper.enable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL },
+	{ "beeper.disable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "0", HU_TYPE_CMD, NULL },
 	{ "test.battery.start.quick", 0, 0, "UPS.Battery.Test", NULL, "1", HU_TYPE_CMD, NULL },
 	{ "load.on.delay", 0, 0, "UPS.PowerSummary.DelayBeforeStartup", NULL, NULL, HU_TYPE_CMD, powercom_startup_info },
 	{ "shutdown.return", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, NULL, HU_TYPE_CMD, powercom_shutdown_info },
 	{ "shutdown.stayoff", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, NULL, HU_TYPE_CMD, powercom_stayoff_info },
+	{ "load.on", 0, 0, "UPS.PowerSummary.PCMDelayBeforeStartup", NULL, "0", HU_TYPE_CMD, powercom_startup_info },
+	{ "load.off", 0, 0, "UPS.PowerSummary.PCMDelayBeforeShutdown", NULL, "0", HU_TYPE_CMD, powercom_stayoff_info },
+	{ "shutdown.return", 0, 0, "UPS.PowerSummary.PCMDelayBeforeShutdown", NULL, NULL, HU_TYPE_CMD, powercom_shutdown_info },
+	{ "shutdown.stayoff", 0, 0, "UPS.PowerSummary.PCMDelayBeforeShutdown", NULL, NULL, HU_TYPE_CMD, powercom_stayoff_info },
 
 	/* end of structure. */
 	{ NULL, 0, 0, NULL, NULL, NULL, 0, NULL }
_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Reply via email to