Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-20 Thread Daniel O'Connor
On Tue, 19 May 2009, forsite wrote:
 Have anybody tried Cyberpower Value 600E (USB) under FreeBSD?
 usbhid-ups from nut 2.4.1 does not recognize (find) the device on my
 machine.
 [r...@substance /usr/local/libexec/nut]# dmesg | grep uhid
 uhid0: CPS UPS VALUE, class 0/0, rev 1.10/0.01, addr 2 on uhub0

 [r...@substance /usr/local/libexec/nut]# ls -l /dev/uhid0
 crw-rw  1 uucp  wheel0,  79 18 May 20:51 /dev/uhid0
...
 Any ideas what could be wrong here?

As you found later, the problem is that the uhid driver grabs the UPS 
but NUT needs ugen to get it before it can talk (unlike Linux libusb 
can't kick the kernel driver off the device).

You can try not loading uhid as a work around and see if it works (it 
should do, make sure you chmod /dev/ugenX* as required).

The actual fix is to add an entry in the blacklist for uhid devices 
in /usr/src/sys/dev/usb/usb_quirks.c (around line 115) for the vendor/id 
of your UPS. I think you also need to add an entry 
to /usr/src/sys/dev/usb/usbdevs for the UPS itself. That requires a 
kernel rebuild BTW.

If you give me the output of 'usbdevs -v' I can whip up a quick patch.

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


signature.asc
Description: This is a digitally signed message part.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-20 Thread Daniel O'Connor
On Wed, 20 May 2009, Daniel O'Connor wrote:
 The actual fix is to add an entry in the blacklist for uhid devices
 in /usr/src/sys/dev/usb/usb_quirks.c (around line 115) for the
 vendor/id of your UPS. I think you also need to add an entry
 to /usr/src/sys/dev/usb/usbdevs for the UPS itself. That requires a
 kernel rebuild BTW.

 If you give me the output of 'usbdevs -v' I can whip up a quick
 patch.

I checked your original post, this should do it.

I've only tested it compiles though :)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Index: sys/dev/usb/usb_quirks.c
===
--- sys/dev/usb/usb_quirks.c(revision 192375)
+++ sys/dev/usb/usb_quirks.c(working copy)
@@ -120,6 +120,8 @@
ANY, { UQ_KBD_IGNORE }},
  { USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X,
ANY, { UQ_KBD_IGNORE }},
+ { USB_VENDOR_CYBERPOWER, USB_PRODUCT_CYBERPOWER_1500CAVRLCD,
+   ANY, { UQ_KBD_IGNORE }},
  { 0, 0, 0, { 0 } }
 };


signature.asc
Description: This is a digitally signed message part.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-20 Thread Daniel O'Connor
On Thu, 21 May 2009, forsite wrote:
 P.S. Apparently, this relates not only to CyberPower, but will likely
 be relevant for any UPS-USB device which under GENERIC kernel is
 claimed by uhidX (not ugenX) driver.

Yes, it is quite annoying..

I wonder if the uhid device could be modified to reject UPS class HID 
devices..

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


signature.asc
Description: This is a digitally signed message part.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-20 Thread Daniel O'Connor
On Thu, 21 May 2009, forsite wrote:
 Daniel, fantastic - your patch was exactly what was needed.

Great!

 2_developers: I believe this is a standard situation for CyberPower
 USB devices under FreeBSD.  So you may wish to add the solution
 provided by Daniel into the FAQ or at least to mention on the
 compatibility page
 (http://www.networkupstools.org/compat/stable.html) that using
 CyberPower with FreeBSD requires patching the kernel.

Better to get it committed to FreeBSD. I have sent a PR with the patch 
in it so it should be committed.

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


signature.asc
Description: This is a digitally signed message part.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-19 Thread forsite
Hmm... Interesting. I have looked through the mailing-list archives
and encountered that libusb-based
packages such as NUT do not work with uhid* device nodes (where my UPS
currently sits).

http://lists.alioth.debian.org/pipermail/nut-upsuser/2008-July/004260.html

I suppose I need to find a workaround.  I will keep you posting on the results.

Rgs,
forsite

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Cyberpower Value 600E UPS (USB) is not recognized by usbhid-ups under FreeBSD 7.2

2009-05-18 Thread forsite
Dear Arjen,

Many thanks for your prompt reply.

 This vendorid:productid combination is supported by nut-2.4.1 out of the
 box, so most likely, it is a permissions problem. Try running

    ./usbhid-ups -u root -DD -a CyberPower

Actually, I have tried this also (I should have mentioned this in my
previous posting).  Moreover, I have set permissions to USB devices to
make them accessible for the uucp user, so I hope the permissions
should be ok.

[r...@substance /usr/local/libexec/nut]# ./usbhid-ups -u root -DD -a CyberPower
Network UPS Tools - Generic HID driver 0.34 (2.4.1)
USB communication driver 0.31
debug level is '2'
upsdrv_initups...
No appropriate HID device found
No matching HID UPS found

Could it be that FreeBSD recognizes my CyberPower device a little bit
different than any Linux machine (say, the device signature as
recognized by USB driver is different) - so a small patch of the nut
source code may improve the situation?

Can I debug nut or libusb further to see what is going on inside?

Thanks a lot,
forsite

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser