<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;"><div>[please keep the list CC'd. thanks!]</div><div><br></div>On Mar 13, 2015, at 10:53 AM, Philip Taylor <<a href="mailto:philip@kelsotowers.co.uk">philip@kelsotowers.co.uk</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I’ve set up UPSMON to simply execute ‘shutdown -h now’ and my system shuts down when I type ‘upsmon -c fsd’. The problem is that the OpenUPS doesn’t shut down as a result; and therefore when the power comes back on, unless the battery has totally run out, the system stays dead. Once the battery dies completely, the UPS will reboot itself and turn the server on - but this may never happen.</div><div class=""><br class=""></div><div class="">Do I have to modify the Centos ’shutdown’ script to add to it ‘upsdrvctl shutdown’ at it’s end point? Or should the fact that upsd is run as a service (nut-server.service on Centos 7) do this without my intervention?</div></div></blockquote><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Again, I don't know what CentOS does with its shutdown scripts. Other distributions have some sort of hook that calls 'upsdrvctl shutdown' near the end of the shutdown process.</div><div class=""><br></div></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I’ve looked at ‘ignorelb’. As far as I can tell the OpenUPS never sends LB; which may be a calibration issue; but there is no documentation to tell you how this should work. Their documentation talks about ‘coulomb counters’ and ‘fuel gauges’ but says nothing about how it’s implemented! And I’m waiting for a response from their support desk.</div><div class=""><br class=""></div><div class="">You say 'NUT takes a conservative approach to USB HID drivers’. I get a few errors and I don’t know if they matter. Like :</div></div></blockquote><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">What I meant is that usbhid-ups doesn't try to interpret <i>all</i> of the HID items, just the ones that are known to contain good values (for some version of the UPS firmware).</div><div class=""><br></div></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">when I plug in the OpenUPS I see this : </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.049586] usb 4-5: new full-speed USB device number 3 using ohci-pci</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.215825] usb 4-5: New USB device found, idVendor=04d8, idProduct=d004</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.222717] usb 4-5: New USB device strings: Mfr=1, Product=2, SerialNumber=4</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.229879] usb 4-5: Product: OPEN-UPS</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.233658] usb 4-5: Manufacturer: <a href="http://mini-box.com/" class="">Mini-Box.Com</a></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.238218] usb 4-5: SerialNumber: PBSO4-LiFePO</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.259143] hid-generic 0003:04D8:D004.0002: invalid report_size 248</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.265603] hid-generic 0003:04D8:D004.0002: item 0 1 1 7 parsing failed</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">[   49.272485] hid-generic: probe of 0003:04D8:D004.0002 failed with error -22</div></div></div></blockquote><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class="">You can ignore the hid-generic errors; NUT detaches that kernel driver and bypasses it with libusb.</div><div class=""><br></div><div class="">That said, it means the HID descriptor has some syntax issues.</div><div class=""><br></div></div></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">If I manually run 'upsdrvctl start’ I get this :</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;">USB communication driver 0.32</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Using subdriver: openUPS HID 0.4</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">libusb_get_string: Invalid argument</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">libusb_get_string: Invalid argument</div></div></div></blockquote><div><br></div><div>The driver should only call libusb_get_string() for informational purposes, so it should only affect ups.mfr and ups.model in upsc.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div></div><div class="">And if I run upsd with high level of debug, after working OK for a while, I see these ‘broken pipe’ messages :</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.419974<span class="Apple-tab-span" style="white-space:pre">    </span>Entering libusb_get_report</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.421967<span class="Apple-tab-span" style="white-space:pre">  </span>Report[get]: (4 bytes) => 60 c4 ff 3b</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422056<span class="Apple-tab-span" style="white-space:pre">    </span>PhyMax = 0, PhyMin = 0, LogMax = 16777215, LogMin = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422069<span class="Apple-tab-span" style="white-space:pre">       </span>Unit = 00001001, UnitExp = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422080<span class="Apple-tab-span" style="white-space:pre">        </span>Exponent = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422093<span class="Apple-tab-span" style="white-space:pre">        </span>hid_lookup_path: 00840004 -> UPS</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422107<span class="Apple-tab-span" style="white-space:pre"> </span>hid_lookup_path: 00840024 -> PowerSummary</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422121<span class="Apple-tab-span" style="white-space:pre">        </span>hid_lookup_path: 00850068 -> RunTimeToEmpty</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422146<span class="Apple-tab-span" style="white-space:pre">      </span>Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">0x60, Offset: 0, Size: 24, Value: 3.9321e+06</div></div></div></blockquote><div><br></div><div>That looks like a calibration problem: 3.9 million seconds of runtime is a while.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422163<span class="Apple-tab-span" style="white-space:pre">    </span>Report[buf]: (4 bytes) => 60 c4 ff 3b</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422177<span class="Apple-tab-span" style="white-space:pre">    </span>PhyMax = 0, PhyMin = 0, LogMax = 16777215, LogMin = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422188<span class="Apple-tab-span" style="white-space:pre">       </span>Unit = 00001001, UnitExp = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422198<span class="Apple-tab-span" style="white-space:pre">        </span>Exponent = 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422209<span class="Apple-tab-span" style="white-space:pre">        </span>hid_lookup_path: 00840004 -> UPS</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422221<span class="Apple-tab-span" style="white-space:pre"> </span>hid_lookup_path: 00840024 -> PowerSummary</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422234<span class="Apple-tab-span" style="white-space:pre">        </span>hid_lookup_path: 00850068 -> RunTimeToEmpty</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422253<span class="Apple-tab-span" style="white-space:pre">      </span>Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">60, Offset: 0, Size: 24, Value: 3.9321e+06</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.422264<span class="Apple-tab-span" style="white-space:pre">       </span>Entering libusb_get_report</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.423983<span class="Apple-tab-span" style="white-space:pre">  </span>Can't retrieve Report b1: Broken pipe</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.424034<span class="Apple-tab-span" style="white-space:pre">       </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.424060<span class="Apple-tab-span" style="white-space:pre">   </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.424076<span class="Apple-tab-span" style="white-space:pre">   </span>Path: ff000001.ff000001, Type: Output, ReportID: 0xb1, Offset: 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">, Size: 248</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.424089<span class="Apple-tab-span" style="white-space:pre">      </span>Entering libusb_get_report</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.425933<span class="Apple-tab-span" style="white-space:pre">  </span>Can't retrieve Report b2: Broken pipe</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.425953<span class="Apple-tab-span" style="white-space:pre">       </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.425966<span class="Apple-tab-span" style="white-space:pre">   </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.425980<span class="Apple-tab-span" style="white-space:pre">   </span>Path: ff000001.ff000001, Type: Input, ReportID: 0xb2, Offset: 0,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> Size: 248</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.425992<span class="Apple-tab-span" style="white-space:pre">  </span>Entering libusb_get_report</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.427956<span class="Apple-tab-span" style="white-space:pre">  </span>Can't retrieve Report 81: Broken pipe</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.428006<span class="Apple-tab-span" style="white-space:pre">       </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.428021<span class="Apple-tab-span" style="white-space:pre">   </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.428036<span class="Apple-tab-span" style="white-space:pre">   </span>Path: ff000001.ff000001, Type: Output, ReportID: 0x81, Offset: 0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">, Size: 248</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.428048<span class="Apple-tab-span" style="white-space:pre">      </span>Entering libusb_get_report</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.429891<span class="Apple-tab-span" style="white-space:pre">  </span>Can't retrieve Report 82: Broken pipe</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.429911<span class="Apple-tab-span" style="white-space:pre">       </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.429925<span class="Apple-tab-span" style="white-space:pre">   </span>hid_lookup_path: ff000001 -> not found in lookup table</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.429939<span class="Apple-tab-span" style="white-space:pre">   </span>Path: ff000001.ff000001, Type: Input, ReportID: 0x82, Offset: 0,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> Size: 248</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   0.429950<span class="Apple-tab-span" style="white-space:pre">  </span>Entering libusb_get_report</div></div></div></blockquote><br></div><div>Can you send a copy of the debug output (-DDD) from starting the driver for ~30 seconds, gzip'd and attached?</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>