Re: [Nut-upsuser] USB problems

2010-05-11 Thread James

 I used VirtualBox to run the Windows software and now nut works.
It might be a coincidence. :-(
I rebooted once and didn't run VirtualBox and nut works.
We'll see if it breaks.


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


Re: [Nut-upsuser] USB problems

2010-05-11 Thread James

 On 05/11/10 20:56, James wrote:

 I used VirtualBox to run the Windows software and now nut works.
It might be a coincidence. :-(
I rebooted once and didn't run VirtualBox and nut works.
We'll see if it breaks.

I was playing around with different options.

I did use these:

./configure --without-serial --without-neon --without-powerman 
--without-wrap --with
out-ipv6 --with-usb --with-drivers=usbhid-ups --with-hal --with-user=ups 
--with-group=nut


I may NOT have tried it before using VirtualBox though.


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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread James

 On 05/10/10 08:31, Charles Lepple wrote:

On Mon, May 10, 2010 at 1:49 AM, Jamesbjloc...@lockie.ca  wrote:

I was getting:
Can't claim USB device [0764:0501]: could not detach kernel driver from
interface 0: Operation not permitted
so I manually installed the udev rules the source (I installed the Gentoo
ebuild).

I am now getting:

#  upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: CyberPower HID 0.3
libusb_get_report: could not claim interface 0: Device or resource busy
Got disconnected by another driver: Device or resource busy
Can't initialize data from HID UPS
Driver failed to start (exit status=1)

which seems a bit better.

This seems to be a recent regression. What kernel version are you using?


$ lsusb
Bus 002 Device 005: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS

The udev rule is:
#  Dynex DX-800U?  - usbhid-ups
ATTR{idVendor}==0764, ATTR{idProduct}==0501, MODE=664, GROUP=nobody

Can you also post the output from 'lsusb -vvv -d0764:', preferably run as root?

The vendor name from lsusb (without -v) is usually a good guess, but
often it is the name of the OEM (lsusb looks that up in a static
number-to-name mapping file). The product and vendor strings returned
by 'lsusb' with one or more '-v' flags are usually customized to match
the name printed on the unit.


$ sudo lsusb -vvv -d0764:

Bus 002 Device 004: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x0764 Cyber Power System, Inc.
  idProduct  0x0501 CP1500 AVR UPS
  bcdDevice0.01
  iManufacturer   3 CPS
  iProduct1 CP550HG
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   34
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower   50mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 3 Human Interface Device
  bInterfaceSubClass  0 No Subclass
  bInterfaceProtocol  0 None
  iInterface  0
HID Device Descriptor:
  bLength 9
  bDescriptorType33
  bcdHID   1.10
  bCountryCode   33 US
  bNumDescriptors 1
  bDescriptorType34 Report
  wDescriptorLength 376
 Report Descriptors:
   ** UNAVAILABLE **
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval  10
Device Status: 0x
  (Bus Powered)


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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread James

 On 05/10/10 14:37, Jason Englander wrote:

On Mon, 10 May 2010, James wrote:


Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: CyberPower HID 0.3
libusb_get_report: could not claim interface 0: Device or resource busy
Got disconnected by another driver: Device or resource busy
Can't initialize data from HID UPS
Driver failed to start (exit status=1)


FYI, I got that error yesterday with NUT 2.4.3, kernel 2.6.33.3, and a 
CyberPower CP1500AVRLCD using usbhid-ups and it seems fine after 
applying this patch:


http://boxster.ghz.cc/projects/nut/changeset/2407?format=diffnew=2407

I applied the patch and it loaded the driver once. :-(
I had problems with starting upsd so I tried to fix it but I think the 
driver crashed.

Now I can't restart it even after rebooting.

nut-2.4.3/drivers $ sudo ./usbhid-ups -a CP550SLG -D -D
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
   0.00 debug level is '2'
   0.000408 upsdrv_initups...
   0.000583 Checking device (0764/0501) (002/007)
   0.000611 - VendorID: 0764
   0.000617 - ProductID: 0501
   0.000622 - Manufacturer: unknown
   0.000626 - Product: unknown
   0.000631 - Serial Number: unknown
   0.000636 - Bus: 002
   0.000640 Trying to match device
   0.000655 Device matches
   0.000663 failed to claim USB device: could not claim interface 
0: Operation not permitted
   0.000671 failed to detach kernel driver from USB device: could 
not detach kernel driver from interface 0: Operation not permitted
   0.000678 failed to claim USB device: could not claim interface 
0: Operation not permitted
   0.000684 failed to detach kernel driver from USB device: could 
not detach kernel driver from interface 0: Operation not permitted
   0.000691 failed to claim USB device: could not claim interface 
0: Operation not permitted
   0.000697 failed to detach kernel driver from USB device: could 
not detach kernel driver from interface 0: Operation not permitted
   0.000703 failed to claim USB device: could not claim interface 
0: Operation not permitted
   0.000710 failed to detach kernel driver from USB device: could 
not detach kernel driver from interface 0: Operation not permitted
   0.000716 Can't claim USB device [0764:0501]: could not detach 
kernel driver from interface 0: Operation not permitted



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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread Charles Lepple
On Mon, May 10, 2010 at 2:37 PM, Jason Englander jasone...@gmail.com wrote:
 On Mon, 10 May 2010, James wrote:

 Network UPS Tools - UPS driver controller 2.4.3
 Network UPS Tools - Generic HID driver 0.34 (2.4.3)
 USB communication driver 0.31
 Using subdriver: CyberPower HID 0.3
 libusb_get_report: could not claim interface 0: Device or resource busy
 Got disconnected by another driver: Device or resource busy
 Can't initialize data from HID UPS
 Driver failed to start (exit status=1)

 FYI, I got that error yesterday with NUT 2.4.3, kernel 2.6.33.3, and a
 CyberPower CP1500AVRLCD using usbhid-ups and it seems fine after applying
 this patch:

 http://boxster.ghz.cc/projects/nut/changeset/2407?format=diffnew=2407

OK, good to know. It's a misleading error, but we're just passing back
the return codes that libusb gives us.

 Also FYI, the hardware compatibility list lists cyberpower or powerpanel
 under the Cyber Power section, but the cyberpower driver appears to have
 been removed from the source at some point.  I had configure build
 usbhid-ups, powerpanel, and cyberpower in case I tried it via serial cable
 at some point in the future, cyberpower failed.

Usually we keep the compatibility list in sync with the releases (it's
derived from drivers.list in the source tarball), but 2.4.3 was rushed
out the door as an interim release, and it had some rough edges. This
version of the list has been fixed:

http://buildbot.networkupstools.org/~buildbot/docs/latest/website/stable-hcl.html

-- 
- Charles Lepple

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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread Charles Lepple
On Mon, May 10, 2010 at 8:35 PM, James bjloc...@lockie.ca wrote:
  On 05/10/10 14:37, Jason Englander wrote:

 On Mon, 10 May 2010, James wrote:

 Network UPS Tools - UPS driver controller 2.4.3
 Network UPS Tools - Generic HID driver 0.34 (2.4.3)
 USB communication driver 0.31
 Using subdriver: CyberPower HID 0.3
 libusb_get_report: could not claim interface 0: Device or resource busy
 Got disconnected by another driver: Device or resource busy
 Can't initialize data from HID UPS
 Driver failed to start (exit status=1)

 FYI, I got that error yesterday with NUT 2.4.3, kernel 2.6.33.3, and a
 CyberPower CP1500AVRLCD using usbhid-ups and it seems fine after applying
 this patch:

 http://boxster.ghz.cc/projects/nut/changeset/2407?format=diffnew=2407

 I applied the patch and it loaded the driver once. :-(
 I had problems with starting upsd so I tried to fix it but I think the
 driver crashed.
 Now I can't restart it even after rebooting.

 nut-2.4.3/drivers $ sudo ./usbhid-ups -a CP550SLG -D -D
 Network UPS Tools - Generic HID driver 0.34 (2.4.3)
 USB communication driver 0.31
   0.00     debug level is '2'
   0.000408     upsdrv_initups...
   0.000583     Checking device (0764/0501) (002/007)
   0.000611     - VendorID: 0764
   0.000617     - ProductID: 0501
   0.000622     - Manufacturer: unknown
   0.000626     - Product: unknown
   0.000631     - Serial Number: unknown
   0.000636     - Bus: 002
   0.000640     Trying to match device
   0.000655     Device matches
   0.000663     failed to claim USB device: could not claim interface 0:
 Operation not permitted
   0.000671     failed to detach kernel driver from USB device: could not
 detach kernel driver from interface 0: Operation not permitted

This error is different (operation not permitted versus Device or
resource busy). Is your source build using a different user than the
Gentoo build? (Some distributions have a specific NUT userid instead
of using nobody - not sure how they do it in Gentoo).

-- 
- Charles Lepple

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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread James

 On 05/10/10 22:09, Charles Lepple wrote:

On Mon, May 10, 2010 at 8:35 PM, Jamesbjloc...@lockie.ca  wrote:

  On 05/10/10 14:37, Jason Englander wrote:

On Mon, 10 May 2010, James wrote:


Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: CyberPower HID 0.3
libusb_get_report: could not claim interface 0: Device or resource busy
Got disconnected by another driver: Device or resource busy
Can't initialize data from HID UPS
Driver failed to start (exit status=1)

FYI, I got that error yesterday with NUT 2.4.3, kernel 2.6.33.3, and a
CyberPower CP1500AVRLCD using usbhid-ups and it seems fine after applying
this patch:

http://boxster.ghz.cc/projects/nut/changeset/2407?format=diffnew=2407

I applied the patch and it loaded the driver once. :-(
I had problems with starting upsd so I tried to fix it but I think the
driver crashed.
Now I can't restart it even after rebooting.

nut-2.4.3/drivers $ sudo ./usbhid-ups -a CP550SLG -D -D
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
   0.00 debug level is '2'
   0.000408 upsdrv_initups...
   0.000583 Checking device (0764/0501) (002/007)
   0.000611 - VendorID: 0764
   0.000617 - ProductID: 0501
   0.000622 - Manufacturer: unknown
   0.000626 - Product: unknown
   0.000631 - Serial Number: unknown
   0.000636 - Bus: 002
   0.000640 Trying to match device
   0.000655 Device matches
   0.000663 failed to claim USB device: could not claim interface 0:
Operation not permitted
   0.000671 failed to detach kernel driver from USB device: could not
detach kernel driver from interface 0: Operation not permitted

This error is different (operation not permitted versus Device or
resource busy). Is your source build using a different user than the
Gentoo build? (Some distributions have a specific NUT userid instead
of using nobody - not sure how they do it in Gentoo).



I'm compiling it with root but I followed the instructions (I think): 
./configure --with-user=ups --with-group=nut


What user should perform the #8 step, /usr/local/ups/bin/upsdrvctl start


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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread Charles Lepple
On Mon, May 10, 2010 at 11:02 PM, James bjloc...@lockie.ca wrote:
  On 05/10/10 22:09, Charles Lepple wrote:

 On Mon, May 10, 2010 at 8:35 PM, Jamesbjloc...@lockie.ca  wrote:
[...]
   0.000663     failed to claim USB device: could not claim interface 0:
 Operation not permitted
   0.000671     failed to detach kernel driver from USB device: could not
 detach kernel driver from interface 0: Operation not permitted

 This error is different (operation not permitted versus Device or
 resource busy). Is your source build using a different user than the
 Gentoo build? (Some distributions have a specific NUT userid instead
 of using nobody - not sure how they do it in Gentoo).


 I'm compiling it with root but I followed the instructions (I think):
 ./configure --with-user=ups --with-group=nut

 What user should perform the #8 step, /usr/local/ups/bin/upsdrvctl start

You can run upsdrvctl as root, and the driver will change to the user
you listed above. If you change the parameters to ./configure, you
will need to run make clean before make all and/or make install

The key is to make sure that the installed udev files match that
username as well. (At the beginning of this thread, you quoted a udev
rule which set the USB device node to user nobody, which probably
isn't in group nut.)

-- 
- Charles Lepple

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


Re: [Nut-upsuser] USB problems

2010-05-10 Thread James

 On 05/10/10 23:25, Charles Lepple wrote:

On Mon, May 10, 2010 at 11:02 PM, Jamesbjloc...@lockie.ca  wrote:

  On 05/10/10 22:09, Charles Lepple wrote:

On Mon, May 10, 2010 at 8:35 PM, Jamesbjloc...@lockie.cawrote:

[...]

   0.000663 failed to claim USB device: could not claim interface 0:
Operation not permitted
   0.000671 failed to detach kernel driver from USB device: could not
detach kernel driver from interface 0: Operation not permitted

This error is different (operation not permitted versus Device or
resource busy). Is your source build using a different user than the
Gentoo build? (Some distributions have a specific NUT userid instead
of using nobody - not sure how they do it in Gentoo).


I'm compiling it with root but I followed the instructions (I think):
./configure --with-user=ups --with-group=nut

What user should perform the #8 step, /usr/local/ups/bin/upsdrvctl start

You can run upsdrvctl as root, and the driver will change to the user
you listed above. If you change the parameters to ./configure, you
will need to run make clean before make all and/or make install

The key is to make sure that the installed udev files match that
username as well. (At the beginning of this thread, you quoted a udev
rule which set the USB device node to user nobody, which probably
isn't in group nut.)


I changed that.

Is there any way to see what these two devices are?
May the UPS one should be root:nut

$ ls -l /dev/usb
total 0
crw-rw 1 root root 180, 96 May 11 00:40 hiddev0
crw-rw 1 root root 180, 97 May 11 00:40 hiddev1


PS!
I changed code in drivers/libusb.c
It doesn't fix my problems but I think is nicer code.


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