<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Ok, that’s what it was…I added a dummy report handler for those two report IDs, and now there’s no broken pipe, and both the .delay commands show up for upscmd.  Excellent!  I so far can’t actually set the command due to an ERR ACCESS-DENIED, but I’ll probably be able to figure that out (other than just going all-root).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Sincerely,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Rob Groner<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></b></p><p class=MsoNormal><i><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Software Engineer</span></i><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#A70C28'>RTD Embedded Technologies, Inc.</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>ISO9001 and AS9100 Certified</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Ph: 814-234-8087</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="http://www.rtd.com/"><span style='font-size:10.0pt'>www.rtd.com</span></a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> aquette.dev@gmail.com [mailto:aquette.dev@gmail.com] <b>On Behalf Of </b>Arnaud Quette<br><b>Sent:</b> Friday, March 20, 2015 2:15 PM<br><b>To:</b> Rob Groner<br><b>Cc:</b> nut-upsdev@lists.alioth.debian.org<br><b>Subject:</b> Re: [Nut-upsdev] UPS commands<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'>Hi Rob<o:p></o:p></p></div><p class=MsoNormal style='margin-left:.5in'>I still have an unset draft answer to your previous mail... but you seem to have progressed...<o:p></o:p></p><div><div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal style='margin-left:.5in'>2015-03-20 16:32 GMT+01:00 Rob Groner <<a href="mailto:rgroner@rtd.com" target="_blank">rgroner@rtd.com</a>>:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>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).<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>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.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>load.on<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>load.off<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>shutdown.return<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>shutdown.stayoff<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>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:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>/* Commands to control UPS */<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>{ "load.off.delay", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>{ "load.on.delay", 0, 0, "UPS.PowerSummary.DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>So there’s a few things I am trying to figure out:<o:p></o:p></p><p style='margin-left:.5in'>1)<span style='font-size:7.0pt'>      </span>Where are the commands that I said the UPS had (via HU_TYPE_CMD, I thought) when I use upscmd?<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>these should be there.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'>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...<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>practically, you may have identified an issue.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>Could you please check if "usbhid-ups -D ..." does list the above HID data (UPS.PowerSummary.DelayBeforeShutdown &DelayBeforeStartup)<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'>The only case I see is that the base data are missing, since we don't check if these HID path actually exists...<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>please report back so that we can fix the code if needed.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p style='margin-left:.5in'>2)<span style='font-size:7.0pt'>      </span>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?<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='margin-left:.5in'>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> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p style='margin-left:.5in'>3)<span style='font-size:7.0pt'>      </span>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?<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='margin-left:.5in'>that's a use case and an option.<br>Some users prefer the default "turn on when AC is back", some others prefer not.<o:p></o:p></p></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>cheers,<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>Arno<br clear=all><o:p></o:p></p></div><p class=MsoNormal style='margin-left:.5in'>-- <o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'>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><o:p></o:p></p></div></div></div></div></div></div></div></body></html>