<br><br><div class="gmail_quote">2010/7/19 Arjen de Korte <span dir="ltr"><<a href="mailto:nut%2Bdevel@de-korte.org">nut+devel@de-korte.org</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 class="im">Citeren Robert Jobbagy <<a href="mailto:jobbagy.robert@gmail.com" target="_blank">jobbagy.robert@gmail.com</a>>:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
first:<br>
<br>
What's wrong with this:<br>
<br>
dstate_setinfo("battery.runtime.low","%d",3500);<br>
<br>
it doesnt work.<br>
</blockquote>
<br></div>
If you put this in the right location, this will work. But without context, I can't tell if you did. Also remember that the dstate_setinfo() function is only for setting variables in the driver that are read by the upsd server. It won't magically update these values in the UPS. That should be done in the setvar / instcmd functions (that are currently empty in this driver) and which implement a UPS specific method to change settings or initiate a command respectively. Please read *all* the developer documentation before asking for help or start hacking in the sources.</blockquote>
<div><br>I put dstate_setinfo("battery.runtime.low","%d",3500); in the upsdrv_initinfo function.<br>I tought battery.runtime.low tell to NUT when send LOW BATTERY EVENT and after <br>this will be happend<br>
<br> - generates a NOTIFY_SHUTDOWN event<br>
- waits FINALDELAY seconds - typically 5<br> - creates the
POWERDOWNFLAG file - usually /etc/killpower<br> - calls the
SHUTDOWNCMD<br><br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
second:<br>
<br>
If I figure out how can I shutdown PC and UPS that ups shutdown too and if I<br>
plug back the power PC start automatic.<br>
I put this command in upsdrv_shutdown, is it right?<br>
</blockquote>
<br></div>
Maybe.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Or I need put it in other function?<br>
</blockquote>
<br></div>
It depends on when you need to send this command. As far as I can tell the UPS will now shutdown automatically when the power fails. Since we don't have a functional upsdrv_shutdown() function, I guess that we should tell the UPS not to do this *before* a power failure hits us. In that case, the command should be in upsdrv_initinfo(). However, if you need to send it right before the UPS should be brought down, it should be in upsdrv_shutdown(). I can't tell, I have no idea how this works on your UPS.<div>
<div></div><div class="h5"><br>
<br>
Best regards, Arjen<br>
-- <br>
Please keep list traffic on the list<br>
<br>
<br>
_______________________________________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org" target="_blank">Nut-upsdev@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Robert <br>