Citeren Kevin <bakd...@gmail.com>:

Have you tried the latest version (nut-2.6.0) that was released only a
couple of days ago? Chances are that it might just work, since we have
seen reports about people running the CS 500 in recent years.
Yes, I have now had a chance to try this version and can confirm that it does
not work on either the Smart-1000 or the CS 500. It shuts them both down, never
to start up again without operator intervention.

Please post the first 30 seconds worth of

    /path/to/usbhid-ups -DD -u root -a upsname > APC_CS500.txt 2>&1

here. Make sure to stop any running driver before doing so and be so kind to zip the resulting logfile.

(I should make it clear that I only use these in a server environment, so I am
only interested in the shutdown function for the PC and the sleep/hibernate
commands for the UPS.)

I have also done some experimenting with the working executables that I have,
running them in debug mode. The output of the hidups indicated
setvalue(0xff860077c,1) so I modified the code from nut-2.0.0 as follows:

void upsdrv_shutdown(void)
{
        /* XXX: replace with a proper shutdown function
        fatalx("shutdown not supported"); */

        /* 1) set DelayBeforeStartup */
        if (getval ("ondelay"))
                ondelay = atoi (getval ("ondelay"));

/* setvalue(UPS_WAKEDELAY, ondelay); */ /* commented out this line for
APC CS 500 */

        /* 2) set DelayBeforeShutdown */
        if (getval ("offdelay"))
                offdelay = atoi (getval ("offdelay"));

        /* setvalue(UPS_GRACEDELAY, offdelay); */
        setvalue(0xff86007c, 1);
}

This version is way too old to be of any use. We already know that 0xff86007c is APCDelayBeforeReboot and we already try that after the shutdown.return command fails. Only if that one fails too, we use load.off.delay.

I haven't finished testing the Smart-1000 yet. I have code that works, and
outputs the following:

Initiating UPS shutdown
upsdrv_shutdown...
instcmd(shutdown.return, [NULL])
find_nut_info: unknown info type: shutdown.return

instcmd(load.on.delay, [NULL])
find_nut_info: unknown info type: load.on.delay

instcmd: info element unavailable load.on.delay

instcmd(shutdown.reboot, [NULL])
Report[set]: (4 bytes) => 13 0a 00 00
upsdrv_cleanup...

This is what the nut-2.6.0 usbhid-ups driver will do by default, so I'm not surprised. Double check which version of the driver you're running in your tests (preferably by checking with 'upsc'). I will not answer further messages unless you make clear which version of the driver you're running and whether or not you modified it.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to