<br><div class="gmail_quote">2011/2/7 Kevin <span dir="ltr"><<a href="mailto:bakdong@gmail.com">bakdong@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><div class="im">
On 06/02/2011 21:42, Kevin wrote:
<blockquote type="cite">on
06/02/2011 21:06 Charles Lepple wrote:
<br>
<blockquote type="cite">
<br>
It looks like the only uncommented code which talks to the
device is
<br>
the last line. (The results from the getval() calls do not seem
to be
<br>
used.)
<br>
<br>
APCDelayBeforeReboot maps to 0xff86007c, so Arjen's suggestion
to
<br>
change the 10 to 1 should be equivalent to the setvalue() line
at the
<br>
end.
<br>
<br>
</blockquote>
<br>
Thanks for the input Charles. I will post back the results
tomorrow.
<br>
<br>
</blockquote>
<br></div>
Ok, I've tried that. The result of "clientcmd -u apcmon -p pass123
-a apc1500 shutdown.reboot" is nothing. Nothing that I can see
changes at all.<br>
<br>
I did this with the old working modified hidups driver:<br>
<br>
# ./hidups -DDD -k /dev/hiddev0<br>
Network UPS Tools: HID UPS driver 0.13 (2.0.0)<br>
<br>
Warning: This is an experimental driver.<br>
Some features may not function correctly.<br>
<br>
debug level is '3'<br>
Detected American Power Conversion Back-UPS CS 500 FW:808.q10 .I USB
FW:q10<br>
on port /dev/hiddev0<br>
Initiating UPS shutdown<br>
setvalue(ff86007c, 1): obtained 0 (report 40))<br>
setvalue(using type = feature): report sent successfully<br>
<br>
<br>
Something must be different! Is the "type = feature" relevant at
all?<br>
<br>
There are three lines in the apc-hid.c code that reference
shutdown.reboot:<br>
<br>
<ol>
<li>{ "shutdown.reboot", 0, 0,
"UPS.PowerSummary.DelayBeforeReboot", NULL, "10", HU_TYPE_CMD,
NULL },</li>
<li>{ "shutdown.reboot", 0, 0, "UPS.Output.DelayBeforeReboot",
NULL, "10", HU_TYPE_CMD, NULL },</li>
<li>{ "shutdown.reboot", 0, 0,
"UPS.APCGeneralCollection.APCDelayBeforeReboot", NULL, "1",
HU_TYPE_CMD, NULL },<br>
</li>
</ol>
<br>
I did "usbhid-ups -a apc1500 -k -DDD > CS500shutdown.txt
2>&1" and attached the output in case it holds any clues.<br></div></blockquote></div><br>according to your attached output, shutdown.reboot has been mapped onĀ UPS.PowerSummary.DelayBeforeReboot<br><br>You should try putting the above last line (UPS.APCGeneralCollection.APCDelayBeforeReboot) before all the other possible paths (ie 3 before 1 and 2 in apc-hid.c), recompile and try again your procedure.<br>
The rule for the generic USB/HID engine is that the first HID path that exist is used to map the NUT variable, in case multiple HID paths can satisfy it.<br><br>cheers,<br clear="all">Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://powerquality.eaton.com" target="_blank">http://powerquality.eaton.com</a><br>
Network UPS Tools (NUT) 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.free.fr/" target="_blank">http://arnaud.quette.free.fr/</a><br><br>