<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Jan 11, 2015, at 11:48 PM, Graham Menhennitt <<a href="mailto:graham@menhennitt.com.au">graham@menhennitt.com.au</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000"><blockquote cite="mid:4975C8CE-754A-48F6-9869-A6590331D264@gmail.com" type="cite" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>The file drivers/usbhid-ups.c is looking for any of the following conditions to declare LB:</div><div><br></div><div>• STATUS(LOWBATT)</div><div>• STATUS(TIMELIMITEXP)</div><div>• STATUS(SHUTDOWNIMM)</div><div><br></div><div>The mapping to HID Path names will depend on the model, but STATUS(LOWBATT) can come from ...BelowRemainingCapacityLimit, which is 0 in both instances in your log. STATUS(TIMELIMITEXP) maps to ...RemainingTimeLimitExpired, which I don't see, and STATUS(SHUTDOWNIMM) would cause an ups.alarm message to show up in upsc.<br></div><br></blockquote><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;">Thanks very much for replying, Charles.</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;">I've done a bit more investigating. I added a diagnostic printf("%x", ups_status) at the point where LB is set. It shows that it's RemainingTimeLimitExpired that's causing the LB condition. Below is a bit more of the driver log which shows RemainingTimeLimitExpired changing to 1 and then back to 0 again. What does that variable mean?</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></blockquote><br></div><div>Ah, when I said earlier that I didn't see "RemainingTimeLimitExpired", it seems that it is not being polled as frequently as the other values. (See "pollfreq" versus "pollinterval" in the <a href="http://www.networkupstools.org/docs/man/usbhid-ups.html">usbhid-ups man page</a>, which map to the "Full update..." and "Quick update..." sections in the debug output, respectively.)</div><div><br></div><div>RemainingTimeLimitExpired is supposed to indicate that the estimated battery time remaining is below the RemainingTimeLimit threshold (battery.runtime.low in the NUT variable namespace), but your UPS isn't publishing that time threshold, only the current remaining time estimate. (Per the previous email, the battery.runtime.low value in upsc seems to be coming from the override.battery.runtime.low setting in ups.conf.)</div><div><br></div><div>I still think the combination of override.battery.runtime.low and the ignorelb setting should get you the shutdown trigger you are looking for. You might also need to set pollfreq to a lower value than its default of 30 seconds, since the RemainingTimeLimit value is not requested during the Quick update every two seconds.</div><div><br></div><div>On the other hand, the whole reason for the two separate polling frequencies is that low-speed USB is only 1.5 Mbit signaling, and has even lower throughput, so it isn't possible to poll all of the variables every two seconds. You could try setting the HU_FLAG_QUICK_POLL bit in drivers/apc-hid.c on RemainingTimeLimit. At that point, you should be able to see how often the UPS updates the runtime estimate - it might be dropping below 90 (or whatever the internal threshold is for RemainingTimeLimit) for short intervals.</div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></body></html>