<div dir="ltr"><div>Hi Rob<br><br></div>I still have an unset draft answer to your previous mail... but you seem to have progressed...<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-20 16:32 GMT+01:00 Rob Groner <span dir="ltr"><<a href="mailto:rgroner@rtd.com" target="_blank">rgroner@rtd.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="EN-US"><div><p class="MsoNormal">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).<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">load.on<u></u><u></u></p><p class="MsoNormal">load.off<u></u><u></u></p><p class="MsoNormal">shutdown.return<u></u><u></u></p><p class="MsoNormal">shutdown.stayoff<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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 *<b>want</b>* to support. So I put them in my hid2nut table:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">/* Commands to control UPS */<u></u><u></u></p><p class="MsoNormal">{ "load.off.delay", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },<u></u><u></u></p><p class="MsoNormal">{ "load.on.delay", 0, 0, "UPS.PowerSummary.DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">So there’s a few things I am trying to figure out:<u></u><u></u></p><p><u></u><span>1)<span style="font:7pt "Times New Roman"">     </span></span><u></u>Where are the commands that I said the UPS had (via HU_TYPE_CMD, I thought) when I use upscmd?</p></div></div></blockquote><div><br></div><div>these should be there.<br></div><div>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...<br><br></div><div>practically, you may have identified an issue.<br></div><div>Could you please check if "usbhid-ups -D ..." does list the above HID data (UPS.PowerSummary.DelayBeforeShutdown &DelayBeforeStartup)<br></div><div>The only case I see is that the base data are missing, since we don't check if these HID path actually exists...<br><br></div><div>please report back so that we can fix the code if needed.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="EN-US"><div><p><u></u><u></u></p><p><u></u><span>2)<span style="font:7pt "Times New Roman"">     </span></span><u></u>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?<u></u><u></u></p><p><u></u><span></span></p></div></div></blockquote><div>answer here:<br><a href="https://github.com/networkupstools/nut/blob/master/drivers/usbhid-ups.c#L1002">https://github.com/networkupstools/nut/blob/master/drivers/usbhid-ups.c#L1002</a><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="EN-US"><div><p><span>3)<span style="font:7pt "Times New Roman"">     </span></span><u></u>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?<u></u><u></u></p><p class="MsoNormal"><u></u></p></div></div></blockquote><div>that's a use case and an option.<br>Some users prefer the default "turn on when AC is back", some others prefer not.<br></div><br></div><div class="gmail_quote">cheers,<br></div><div class="gmail_quote">Arno<br clear="all"></div>-- <br><div class="gmail_signature"><div dir="ltr">Eaton Data Center Automation - Opensource Leader<br>NUT (Network UPS Tools) Project Leader - <a href="http://www.networkupstools.org" target="_blank">http://www.networkupstools.org</a><br>Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.fr" target="_blank">http://arnaud.quette.fr</a><br><br></div></div>
</div></div></div></div>