[Nut-upsdev] Liebert ESP II driver

Robert Jobbagy jobbagy.robert at gmail.com
Fri Jul 30 13:53:32 UTC 2010


2010/7/30 Arjen de Korte <nut+devel at de-korte.org <nut%2Bdevel at de-korte.org>>

> Citeren Robert Jobbagy <jobbagy.robert at gmail.com>:
>
>  I use nut rev2462 and I put shutdown commands in end of upsdrv_updateinfo
>> before these calls
>>
>> status_commit();
>>
>>  dstate_dataok();
>>
>
> Well, in that case you've proven that the shutdown commands are working.
> The upsdrv_updateinfo() is called every pollinterval seconds (typically 2),
> so this will pretty much instantly kill the UPS when you start the driver.
> If you want to do something useful with this command, they should go into
> upsdrv_shutdown() and/or instcmd().
>

I tried these commands in  upsdrv_shutdown() but there didnt performed and I
dont know why?

>
>  I test manual shutdown commands , If I run upsc
>> liebert-esp2 at localhostcommand then call upsdrv_updateinfo if I think
>> it right ?
>>
>
> Not at all. Please do read the developer documentation (all of it) before
> making a fool of yourself. Most of this is documented in
> docs/new-drivers.txt, so I strongly suggest you start reading there (but
> please read *all* documentation before asking for help). It also helps
> looking at other drivers to see how they deal with shutdown commands. I'm
> really getting quite annoyed by your ignorance to try to figure out this
> yourself. I have much better things to do than explain what is already
> documented.
>
>
>  This is the all modify in this driver.
>>
>
> It helps attaching a diff.



This is my shutdown function:

void upsdrv_shutdown(void)
{
    int ret;

    fprintf(stderr,"SHUTDOWN 1");

    ret = ser_send_buf(upsfd, cmd_UPSShutdown0, SHUTDOWN_CMD_LEN);
    if (ret < 0) {
        upsdebug_with_errno(2, "send");
        return -1;
    }
    else if (ret < 6) {
        upsdebug_hex(2, "send: truncated", cmd_UPSShutdown0, ret);
        return -1;
    }

    upsdebug_hex(2, "send", cmd_UPSShutdown0, SHUTDOWN_CMD_LEN);

    fprintf(stderr,"SHUTDOWN 2");

    ret = ser_send_buf(upsfd, cmd_UPSShutdown1, SHUTDOWN_CMD_LEN);

    if (ret < 0) {
        upsdebug_with_errno(2, "send");
        return -1;
    }
    else if (ret < 6) {
        upsdebug_hex(2, "send: truncated", cmd_UPSShutdown1, ret);
        return -1;
    }

    upsdebug_hex(2, "send", cmd_UPSShutdown1, SHUTDOWN_CMD_LEN);

    fprintf(stderr,"SHUTDOWN 3");

    ret = ser_send_buf(upsfd, cmd_UPSShutdown2, SHUTDOWN_CMD_LEN);
    if (ret < 0) {
        upsdebug_with_errno(2, "send");
        return -1;
    }
    else if (ret < 8) {
        upsdebug_hex(2, "send: truncated", cmd_UPSShutdown2, ret);
        return -1;
    }

    upsdebug_hex(2, "send", cmd_UPSShutdown2, SHUTDOWN_CMD_LEN);

}

These commands works other way , but in this function didnt work

And I cant found the "SHUTDOWN 1,2,3" test texts in debug.log, so I think
dont sent these commands to UPS.

Do you have any idea what's wrong?

Thanks your help and your time.


>
> Best regards, Arjen
> --
> Please keep list traffic on the list
>
>
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
>



-- 
Best Regards,

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20100730/cd22101a/attachment.htm>


More information about the Nut-upsdev mailing list