[Nut-upsdev] UPS commands
Arnaud Quette
arnaud.quette at gmail.com
Fri Mar 20 18:14:51 UTC 2015
Hi Rob
I still have an unset draft answer to your previous mail... but you seem to
have progressed...
2015-03-20 16:32 GMT+01:00 Rob Groner <rgroner at rtd.com>:
> I’m doing testing of the UPS-side code, including being able to tell the
> UPS to shutdown and then come back up after a while (if power has returned).
>
>
>
> I’m trying to use upscmd so that I don’t have to do an actual shutdown,
> but when I have it list the commands for my UPS, I just see 4 commands, and
> they’re not the ones I thought I had specified.
>
>
>
> load.on
>
> load.off
>
> shutdown.return
>
> shutdown.stayoff
>
>
>
> I looked in the usbhid-ups file, and I see where, if it finds
> load.on.delay or load.off.delay, then it adds the 4 commands shown above.
> Now, load.on.delay and load.off.delay are the only two commands I **want**
> to support. So I put them in my hid2nut table:
>
>
>
> /* Commands to control UPS */
>
> { "load.off.delay", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL,
> DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
>
> { "load.on.delay", 0, 0, "UPS.PowerSummary.DelayBeforeStartup", NULL,
> DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
>
>
>
> So there’s a few things I am trying to figure out:
>
> 1) Where are the commands that I said the UPS had (via HU_TYPE_CMD,
> I thought) when I use upscmd?
>
these should be there.
as per the code pointed in (2) below, the above 4 commands are only created
if either "load.off.delay", "load.on.delay" or both exists...
practically, you may have identified an issue.
Could you please check if "usbhid-ups -D ..." does list the above HID data
(UPS.PowerSummary.DelayBeforeShutdown &DelayBeforeStartup)
The only case I see is that the base data are missing, since we don't check
if these HID path actually exists...
please report back so that we can fix the code if needed.
2) Why does the usbhid-ups automatically add those 4 commands to all
> usb subtype drivers….can it really know that those 4 commands are
> supported? Along those lines, am I supposed to support those 4 commands?
>
> answer here:
https://github.com/networkupstools/nut/blob/master/drivers/usbhid-ups.c#L1002
> 3) Finally…what is the usefulness of shutdown.stayoff? It tells the
> UPS to shut off its load and not to turn it back on when the power comes
> back. If so…how does the UPS ever know to turn that load back on? You
> would have to hook a different PC to the UPS and run nut just to send the
> “load.on” command?
>
> that's a use case and an option.
Some users prefer the default "turn on when AC is back", some others prefer
not.
cheers,
Arno
--
Eaton Data Center Automation - Opensource Leader
NUT (Network UPS Tools) Project Leader - http://www.networkupstools.org
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150320/9b01dfbe/attachment.html>
More information about the Nut-upsdev
mailing list