<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:529270373;
        mso-list-template-ids:89674056;}
@list l0:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1
        {mso-list-id:2017227807;
        mso-list-template-ids:239140014;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">UPDATE:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think I know what I did wrong. In step 7, I plugged the mains too early causing a power race condition as described by point #51
<a href="https://networkupstools.org/docs/FAQ.html" target="_blank">here</a> . I thought that when APC BR1500GI's display went black (even with the fans still running) it is already in a shutdown state. This was not the case, it waited for a few more seconds
 until it totally went silent. At that time, I plugged the mains back and everything was working as expected :)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH">Thank you.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:EN-PH"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:EN-PH">Kevin Mychal M. Ong</span></b><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Sr Infrastructure Engineer, Microsoft Technology Services - Messaging</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Global Infrastructure Operations</span></i><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:2.25pt"><span style="color:black;mso-fareast-language:EN-PH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Ingram Micro Inc.</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">4F Three World Square, 22 Upper McKinley Hill, Fort Bonifacio</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Taguig City, Philippines 1634</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:2.25pt"><span style="color:black;mso-fareast-language:EN-PH"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Direct</span></b><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">     +1-716-633-3600 ext. 33996</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">Mobile
</span></b><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-PH">   +63-917-511-0251</span><span style="color:black;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:2.25pt"><span style="color:black;mso-fareast-language:EN-PH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Wingdings;color:#0070C0;mso-fareast-language:EN-PH">*</span><span lang="PT-BR" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:#0070C0;mso-fareast-language:EN-PH">: </span><span lang="EN-PH"><a href="mailto:kevin.ong@ingrammicro.com"><span lang="EN-US" style="font-size:10.0pt;color:blue;mso-fareast-language:EN-PH">kevin.ong@ingrammicro.com</span></a></span><span style="font-size:8.0pt;font-family:"Tahoma",sans-serif;color:#0070C0;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-PH" style="color:black;mso-fareast-language:EN-PH"><img border="0" width="205" height="64" style="width:2.1354in;height:.6666in" id="Picture_x0020_1" src="cid:image001.png@01D444B0.73D24540" alt="Ingram_Micro_Logo_ Small_Image"></span></b><span lang="EN-PH" style="mso-fareast-language:EN-PH"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Ong, Kevin <Kevin.Ong@ingrammicro.com> <br>
<b>Sent:</b> Tuesday, September 4, 2018 7:49 AM<br>
<b>To:</b> nut-upsuser@alioth-lists.debian.net<br>
<b>Cc:</b> kevindd992002@yahoo.com; Denny Page <denny@cococafe.com><br>
<b>Subject:</b> NUT messes up UPS after mains power is restored<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Charles,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Ok. I'm testing NUT now with only pfsense running as the master and no slaves. I'm noticing a very strange behavior that totally doesn't make sense to me. So here's what I did (in
 chronological order):<o:p></o:p></p>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
Set override.battery.charge.warning to 55 and override.battery.charge.low to 50.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
I started with a full charge battery and unplugged the UPS from the mains.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
The UPS status in the pfsense picked up the change and says Online, discharging.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
As soon as the battery charge hits 50, the state changed to FSD which is what is expected. So far so good.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
Since no slaves are present, the pfsense box turned off itself pretty quick.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
The UPS waited for a few more seconds before it finally cut off the load power to the rest of its ports. All good.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
Now I plug the mains back into the UPS. As soon as I do this, the UPS turns on BUT stays at battery mode (so discharging).<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
It supplies power back to all ports and pfsense and the other devices started booting.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
Then the UPS itself detects that the battery charge is still below 50% (of course, because it needs time to charge and it is even at a discharging state now) and then a few seconds later the unit turns off again. It seems that the killpower command given to
 it by the pfsense is still being enforced even though the mains is already connected and providing power.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo3">
Then it turns on by itself again. And this vicious cycle continues over and over until I disconnected the USB serial connection in the back of the UPS.<o:p></o:p></li></ol>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">What have I done wrong here? Why doesn't the UPS detect that the mains power is already back when the USB serial connection is plugged in. It seems to me that the command given
 by the pfsense NUT package is messing the behavior of the UPS.<o:p></o:p></p>
<p class="MsoNormal">Here’s my post on the pfsense forum about it: <a href="https://forum.netgate.com/topic/102959/nut-package/389">
https://forum.netgate.com/topic/102959/nut-package/389</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH">Thank you.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-PH" style="mso-fareast-language:EN-PH">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:EN-PH"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:EN-PH">Kevin</span></b><span style="font-size:8.0pt;font-family:"Tahoma",sans-serif;color:#0070C0;mso-fareast-language:EN-PH"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p><br>
<span style="font-size:12.0pt">This email may contain material that is confidential, and proprietary to Ingram Micro, for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly
 prohibited. If you are not the intended recipient, please contact the sender and delete all copies.<br>
<span style="color:white">[Ingram_2818e5de]</span></span><o:p></o:p></p>
</div>
</body>
</html>