<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Carlos Rodrigues wrote:
<blockquote
 cite="mid:712170070712281104w120d4903iace97c36d0f494d2@mail.gmail.com"
 type="cite">
  <pre wrap="">On Dec 28, 2007 6:59 PM, Jason Pearce <a class="moz-txt-link-rfc2396E" href="mailto:jason@pearce.org.uk">&lt;jason@pearce.org.uk&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap=""> I have recompiled with the patched megatec.c and have added ignoreoff to my
ups.conf

 However, I now receive this error :

  /usr/local/ups/bin/megatec_usb -a plexus
 Network UPS Tools 2.2.1 - Megatec protocol driver 1.5.9 [megatec_usb]
 Carlos Rodrigues (c) 2003-2007

 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
 Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c)
2007


 Fatal error: 'ignoreoff' is not a valid flag for this driver.

 Look in the man page or call this driver with -h for a list of
 valid variable names and flags.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Did you replace only the megatec binary? megatec_usb is also rebuilt
when megatec.c changes and should also be replaced if you are copying
manually.

  </pre>
</blockquote>
Carlos Rodrigues wrote:
<blockquote
 cite="mid:712170070712281104w120d4903iace97c36d0f494d2@mail.gmail.com"
 type="cite">
  <pre wrap="">On Dec 28, 2007 6:59 PM, Jason Pearce <a class="moz-txt-link-rfc2396E" href="mailto:jason@pearce.org.uk">&lt;jason@pearce.org.uk&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap=""> I have recompiled with the patched megatec.c and have added ignoreoff to my
ups.conf

 However, I now receive this error :

  /usr/local/ups/bin/megatec_usb -a plexus
 Network UPS Tools 2.2.1 - Megatec protocol driver 1.5.9 [megatec_usb]
 Carlos Rodrigues (c) 2003-2007

 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
 Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c)
2007


 Fatal error: 'ignoreoff' is not a valid flag for this driver.

 Look in the man page or call this driver with -h for a list of
 valid variable names and flags.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Did you replace only the megatec binary? megatec_usb is also rebuilt
when megatec.c changes and should also be replaced if you are copying
manually.

  </pre>
</blockquote>
&nbsp;patch -p0 &lt; ../megatec-ignoreoff.diff<br>
patching file drivers/megatec.c<br>
Hunk #4 FAILED at 486.<br>
Hunk #5 FAILED at 799.<br>
2 out of 5 hunks FAILED -- saving rejects to file drivers/megatec.c.rej<br>
<br>
&nbsp;more drivers/megatec.c.rej<br>
***************<br>
*** 472,478 ****<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fatalx(EXIT_FAILURE, "Error in \"battvolts\"
parameter.");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; upslogx(LOG_NOTICE, "Overriding battery voltage interval
[%.1fV, %.1fV].", battvolt_empty, battvolt_full);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (battvolt_empty &lt; 0 || battvolt_full &lt; 0) {<br>
--- 486,492 ----<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fatalx(EXIT_FAILURE, "Error in \"battvolts\"
parameter.");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; upslogx(LOG_NOTICE, "Overriding battery voltage
interval [%.1fV, %.1fV].", battvolt_empty, battvolt_full);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (battvolt_empty &lt; 0 || battvolt_full &lt; 0) {<br>
***************<br>
*** 785,790 ****<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "ondelay", "Minimum delay before UPS startup
(minutes)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "offdelay", "Delay before UPS shutdown
(minutes)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "battvolts", "Battery voltages (empty:full)");<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; megatec_subdrv_makevartable();<br>
&nbsp; }<br>
--- 799,805 ----<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "ondelay", "Minimum delay before UPS startup
(minutes)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "offdelay", "Delay before UPS shutdown
(minutes)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_VALUE, "battvolts", "Battery voltages (empty:full)");<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addvar(VAR_FLAG, "ignoreoff", "Ignore the OFF status reported
by the UPS.");<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; megatec_subdrv_makevartable();<br>
&nbsp; }<br>
</body>
</html>