2011/2/7 Kevin <bakd...@gmail.com> > On 06/02/2011 21:42, Kevin wrote: > > on 06/02/2011 21:06 Charles Lepple wrote: > > > It looks like the only uncommented code which talks to the device is > the last line. (The results from the getval() calls do not seem to be > used.) > > APCDelayBeforeReboot maps to 0xff86007c, so Arjen's suggestion to > change the 10 to 1 should be equivalent to the setvalue() line at the > end. > > > Thanks for the input Charles. I will post back the results tomorrow. > > > 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. > > I did this with the old working modified hidups driver: > > # ./hidups -DDD -k /dev/hiddev0 > Network UPS Tools: HID UPS driver 0.13 (2.0.0) > > Warning: This is an experimental driver. > Some features may not function correctly. > > debug level is '3' > Detected American Power Conversion Back-UPS CS 500 FW:808.q10 .I USB FW:q10 > on port /dev/hiddev0 > Initiating UPS shutdown > setvalue(ff86007c, 1): obtained 0 (report 40)) > setvalue(using type = feature): report sent successfully > > > Something must be different! Is the "type = feature" relevant at all? > > There are three lines in the apc-hid.c code that reference shutdown.reboot: > > > 1. { "shutdown.reboot", 0, 0, "UPS.PowerSummary.DelayBeforeReboot", > NULL, "10", HU_TYPE_CMD, NULL }, > 2. { "shutdown.reboot", 0, 0, "UPS.Output.DelayBeforeReboot", NULL, > "10", HU_TYPE_CMD, NULL }, > 3. { "shutdown.reboot", 0, 0, > "UPS.APCGeneralCollection.APCDelayBeforeReboot", NULL, "1", HU_TYPE_CMD, > NULL }, > > > I did "usbhid-ups -a apc1500 -k -DDD > CS500shutdown.txt 2>&1" and attached > the output in case it holds any clues. >
according to your attached output, shutdown.reboot has been mapped on UPS.PowerSummary.DelayBeforeReboot 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. 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. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
_______________________________________________ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser