[Nut-upsdev] SMS and Megatec protocol Diffs

Carlos Rodrigues carlos.efr at mail.telepac.pt
Tue Feb 12 00:07:07 UTC 2008


On Feb 11, 2008 5:30 PM, Marcio Gomes <mpg at microlink.com.br> wrote:
> I change the if in [OFF] detect state to, in original way, if you send a
> reset.watchdog, the UPS goes
> to OFF state in clients, but it is not correct, because UPS is OL and
> Shutdown are in progress, but
> the power is not OFF

First of all, thanks for the patch. But I have a few comments:

Are you saying the UPS raises the "OFF" flag when a timed shutdown
command is sent to it, before actually shutting down? If so, that is a
violation of the megatec protocol. The megatec version in the
development trunk has an option "ignoreoff" to accomodate UPSes that
exibit this behavior.

> Know working SMS Models  :
>
> SINUS Single : Only versions
> Manager III : Only serial versions

I'll add this to the compatibility list.

>  /* Known battery types must be in ascending order by "nominal" first, and then by "max". */
> -static BatteryVolts_t batteries[] = {{ 12.0,  9.0, 16.0,  9.7, 13.7,  0.0 },   /* Mustek PowerMust 600VA Plus (LB unknown) */
> +static BatteryVolts_t batteries[] = {{ 12.0,  9.0, 16.0,  9.6 ,13.3 , 9.7 }, /* SMS Ltda confirmed to Sinus Single 2Kva , Manager III 600 and 1300 Va */
> +                                     { 12.0,  9.0, 16.0,  9.7, 13.7,  0.0 },   /* Mustek PowerMust 600VA Plus (LB unknown) */

With this change, the Mustek line will always be ignored, making the
charge calculation wrong for them (and other models). This is actually
an impossible situation, so the latest versions of megatec have a new
option "battvolts" to let the user specify these values if needed.
Anyway, I'm now adding the values for this option in the compatibility
list when I have them (i.e. for that model it will be
"battvolts=9.6:13.3").

> -static char watchdog_timeout = 1;  /* in minutes */
> +static char watchdog_timeout = 5;  /* in minutes */

The frequency at which the timer is reset is much higher than once per
minute, so it won't slip and accidentaly let the UPS shutdown.
However, I guess some UPSes may be innacurate with values <= 1 minute.
This may be a good idea.

> -       if (query.flags[FL_LOAD_OFF] == '1') {
> -               status_set("OFF");
> -       } else if (query.flags[FL_ON_BATT] == '1' || query.flags[FL_BATT_TEST] == '1') {
> +//     } else
> +       if (query.flags[FL_ON_BATT] == '1' || query.flags[FL_BATT_TEST] == '1') {
>                 status_set("OB");
>         } else {
>                 status_set("OL");
> @@ -579,6 +579,10 @@
>                         }
>                 }
>         }
> +
> +        if (query.flags[FL_LOAD_OFF] == '1') {
> +                status_set("SHUTDOWN");
> +        }

Please check the megatec version in the development trunk*. This
section has changed and I guess it works similarly to what you wanted
here.

* http://svn.debian.org/wsvn/nut/trunk/drivers/megatec.c?op=file&rev=0&sc=0

-- 
Carlos Rodrigues



More information about the Nut-upsdev mailing list