<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 31, 2013, at 1:07 AM, Georgi Todorov wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I have a CyberPower CP1500PFCLCD and I'm trying to get nut to see it under OpenIndiana. All search online suggested that it basically can't happen, but I decided to ask again, maybe things have changed since then.</div><div><br></div><div>The UPS can be seen by the system:</div><div><div><font face="Courier New"># /usr/sbin/cfgadm -lv usb9/1.1</font></div><div><font face="Courier New">Ap_Id                          Receptacle   Occupant     Condition  Information</font></div><div><font face="Courier New">When         Type         Busy     Phys_Id</font></div><div><font face="Courier New">usb9/1.1                       connected    configured   ok         Mfg: CP1500PFCLCD  Product: CRCA102-3I1  NConfigs: 1  Config: 0  <no cfg str descr></font></div><div><font face="Courier New">unavailable  usb-input    n        /devices/pci@0,0/pci15d9,631@1d/hub@1:1.1</font></div></div><div><br></div><div>According to prtconf the device is mapped to /dev/usb/hid2, which points to:</div><div><font face="Courier New">crw------- 1 ups ups 228, 6 2013-01-30 22:20 /devices/pci@0,0/pci15d9,631@1d/hub@1/input@1:hid_-124_4</font></div></div></blockquote><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>NUT uses libusb-0.1 to access the UPS, and libusb needs something like a ugen node (instead of /dev/usb/hid*).</div><div><br></div><div>A quick search yields the following:</div><div><br></div><div><a href="http://barbz.com.au/blog/?p=407">http://barbz.com.au/blog/?p=407</a> ("Compile and Configure NUT on Openindiana")</div><div><br></div></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>My ups.conf has:</div><div><div><font face="Courier New">[cyberpower]</font></div><div><font face="Courier New">        driver = usbhid-ups</font></div><div><font face="Courier New">        port = /dev/usb/hid2</font></div><div><font face="Courier New">        desc = "CP1500PFCLCD RCA102-3I1 CPS"</font></div></div><div><br></div><div>However usbhid-ups doesn't seem to like it:</div><div><div><font face="Courier New"># usbhid-ups -DDDDDDD -a cyberpower</font></div><div><font face="Courier New">Network UPS Tools - Generic HID driver 0.37 (2.6.5)</font></div><div><font face="Courier New">USB communication driver 0.31</font></div><div><font face="Courier New">   0.000000     send_to_all: SETINFO driver.parameter.port "/dev/usb/hid2"</font></div><div><font face="Courier New">   0.000052     debug level is '7'</font></div><div><font face="Courier New">   0.000331     upsdrv_initups...</font></div><div><font face="Courier New">   0.001113     No appropriate HID device found</font></div><div><font face="Courier New">   0.001152     No matching HID UPS found</font></div></div><div><br></div><div>Strangely enough if I pass -u root, it ignores my port setting and just tries to open the first thing in /dev/usb and exists:</div><div><div><font face="Courier New"># ./usbhid-ups -a cyberpower -DDDDDDD -u root</font></div><div><font face="Courier New">Network UPS Tools - Generic HID driver 0.37 (2.6.5)</font></div><div><font face="Courier New">USB communication driver 0.31</font></div><div><font face="Courier New">   0.000000     debug level is '7'</font></div><div><font face="Courier New">   0.000427     upsdrv_initups...</font></div><div><font face="Courier New">  13.019758     Checking device (0000/0000) (/dev/usb/557.2221/0)</font></div><div><font face="Courier New">  26.039796     Failed to open device, skipping. (I/O error)</font></div><div><font face="Courier New">  26.039845     No appropriate HID device found</font></div><div><font face="Courier New">  26.039874     No matching HID UPS found</font></div></div><div><font face="Courier New"><br></font></div></div></blockquote><div><br></div><div>This is not entirely unexpected. libusb does not allow specifying a USB device by its path, hence usbhid-ups ignores "port". (There are other parameters to specify the UPS by its USB IDs.)</div><div><br></div><div><a href="http://www.networkupstools.org/docs/man/usbhid-ups.html#_implementation">http://www.networkupstools.org/docs/man/usbhid-ups.html#_implementation</a></div><div><br></div><div>The difference when you pass "-u root" is that the drivers ordinarily drop permissions (even when started from a root shell), and the unprivileged user doesn't even have permissions to scan the USB bus(es).</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>If anyone has an idea of how to try and fix this, please let me know.</div><div><br></div><div>Thanks,</div><div>Georgi</div></div>_______________________________________________<br>Nut-upsuser mailing list<br><a href="mailto:Nut-upsuser@lists.alioth.debian.org">Nut-upsuser@lists.alioth.debian.org</a><br>http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser</blockquote></div><br><div apple-content-edited="true">
<div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div><br class="Apple-interchange-newline">
</div>
<br></body></html>