Open kvaster opened 6 years ago
If the UPS was still seeing line power (ups.status: OL
) when you sent the -k
command (which expands to either shutdown.return
, or the combination of load.on.delay
and load.off.delay
), you may be seeing a variation of the FAQ 51: https://networkupstools.org/docs/FAQ.html
Some CPS units appear to round the ups.delay.shutdown
and ups.delay.start
values to minutes. There may be a similar issue with your brand of UPS. Try setting them to 60 and 120, respectively, and check the ups.timer.*
variables to see if they change.
If neither of those ideas work, you can try running the driver with -DD -k
to see if there are any USB errors that are not being logged to stderr. Please do not post the entire log inline - compressing it and attaching it is probably best, or you can excerpt the beginning and end.
There are no any usb errors. Also I've tried to launch power off without power on ups. Still nothing happens. Will try to discharge ups to 'low battery'...
ups.status: OB DISCHRG
ups.timer.shutdown: 0
ups.timer.start: 0
0.048921 Initiating UPS shutdown
0.048926 [D1] upsdrv_shutdown...
0.048930 [D1] instcmd(shutdown.return, [NULL])
0.048935 [D2] find_nut_info: unknown info type: shutdown.return
0.048939 [D1] setvar(ups.start.auto, yes)
0.049218 [D1] instcmd(load.on.delay, 120)
0.049357 [D1] instcmd(load.off.delay, 60)
0.049499 [D1] upsdrv_cleanup...
I've changed connection type from usb to rs232 and now ups is working as expected via blazer_ser driver. It shows much less info, but it works.
Hello again. Due to problems with rs232 (unreliable connection errors with my setup - connection lost messages) I decided to investigate problem with USB further.
Part of 'upsc' command output:
device.model: HID UPS INNRT3000VA
driver.version: 2.7.4-526-g2e6816be
driver.version.data: MGE HID 1.43
driver.version.internal: 0.42
outlet.1.delay.shutdown: 2147483647
outlet.1.delay.start: 5
outlet.1.desc: PowerShare Outlet 1
outlet.1.id: 1
outlet.1.status: on
outlet.1.switchable: yes
outlet.2.delay.shutdown: 2147483647
outlet.2.delay.start: 5
outlet.2.desc: PowerShare Outlet 2
outlet.2.id: 2
outlet.2.status: on
outlet.2.switchable: yes
outlet.desc: Main Outlet
outlet.id: 0
outlet.switchable: no
As you can see outlet.switchable is 'no' for 'main' outlet (global?), but it is yes for outlet 1 and 2.
Output of 'upscmd -l' cmd:
load.off - Turn off the load immediately
load.off.delay - Turn off the load with a delay (seconds)
load.on - Turn on the load immediately
load.on.delay - Turn on the load with a delay (seconds)
outlet.1.load.off - Turn off the load on outlet 1 immediately
outlet.1.load.on - Turn on the load on outlet 1 immediately
outlet.2.load.off - Turn off the load on outlet 2 immediately
outlet.2.load.on - Turn on the load on outlet 2 immediately
Global load.off/on and load.off/on.delay commands are available and they produce OK reault, but they do really nothing... Maybe it's cause of global switchable = off ?
Basically 'shutdown.return' issues 'load.on.delay' following by 'load.off.delay' command in usbhid-ups.c.
As a result I've tried patching mge-hid.c (mge_hid2nut[]):
{ "outlet.1.load.off.delay", 0, 0, "UPS.OutletSystem.Outlet.[2].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.1.load.on.delay", 0, 0, "UPS.OutletSystem.Outlet.[2].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
{ "outlet.2.load.off.delay", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.2.load.on.delay", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
And replaced shutdown.recover command with following code:
usleep(1000000);
instcmd("outlet.2.load.on.delay", dstate_getinfo("ups.delay.start"));
usleep(1000000);
instcmd("outlet.2.load.off.delay", dstate_getinfo("ups.delay.shutdown"));
usleep(1000000);
instcmd("outlet.1.load.on.delay", dstate_getinfo("ups.delay.start"));
usleep(1000000);
instcmd("outlet.1.load.off.delay", dstate_getinfo("ups.delay.shutdown"));
This patches makes my ups working correct with shutting down power and reenabling it after.
It seems that this ups need to control outlet 1 and 2 directly. Also we need some time befire issuing first command - driver is not initialized yet ? And also we need delays between commands. In my experiments commands reported OK but only shutdown was accepted (don't know why). And all commands are working now after adding delays between them.
Looks like the exact same problem I have. My UPS is named differently but vendorid/productid are the same. Did you experience any negative side-effects from your modifications ? Because I would need to apply the same hack ...
Thanks, -Markus
I have no negative impact. It's just working.
Hi, @kvaster I have exactly the same issue with PowerWalker VFI 2000 RT. Where I can find "shutdown.recover" command in order to change it as you suggested?
It's not command - it's an ugly patch for NUT, cause I don't know how to implement this properly...
@kvaster anyway, the ugly patch is better than nothing:) Thank you.
I have simpe setup - one PC and innova rt 3000 ups (ippon). I'm trying to set up server power up after power loss. Main problem is that shutdown.recover does not work - UPS does not respond to it.
Nothing happens after this command.
ups.conf:
I'm using latest git version:
upsc output: