Re: [Nut-upsuser] Belkin F6C1200-UNV on Ubuntu 11.04

2011-07-01 Thread Martin Ewing
Charles,

Sorry for delay.  Some answers follow

On Wed, Jun 29, 2011 at 9:36 PM, Charles Lepple clep...@gmail.com wrote:

 On Sat, Jun 25, 2011 at 7:15 PM, Martin Ewing martin.s.ew...@gmail.com
 wrote:
 
  On Sat, Jun 25, 2011 at 5:48 PM, Charles Lepple clep...@gmail.com
 wrote:
 
  On Jun 24, 2011, at 8:50 PM, Martin Ewing wrote:
 
  I had been using NUT's Ubuntu package (64 bit) with no problems until
  upgrading to Ubuntu 11.04.
 
  What was the previous NUT package version?

 ^^^ Previous question still stands. Is there an upgrade log
 (/var/log/dpkg.log or similar) which mentions the old .deb version?


Previous version from dpkg.log appears to have been nut  2.4.3-1ubuntu5
(Ubuntu 10.10 Maverick) ... now 2.6.0-1ubuntu3 (Ubuntu 11.04 Natty).


  If I have time later this weekend, I'll swap out that UPS for one which
  uses the usbhid-ups driver and see if I can reproduce the problem.

 I seem to have hardware problems with the UPS which is compatible with
 that driver, so I can't test with usbhid-ups.

  Device:
  $ ls -l /dev/bus/usb/006/001
  crw-rw-r-- 1 root root 189, 640 2011-06-24 18:29 /dev/bus/usb/006/001
 
  Not in group nut.

 I think that part might be a bug in Ubuntu's combination of NUT and
 udev (at some point, udev changed the way it matches USB devices). Are
 there any messages from udev in syslog?


I tend to agree.  Here is what is happening as I see it now.  Immediately
after boot, no UPS attached, I see
$ ls -l /dev/usb
total 0
crw--- 1 root root 180, 96 2011-07-01 13:30 hiddev0
crw-rw 1 root lp   180,  0 2011-07-01 13:30 lp0

I have a wireless connected USB keyboard/mouse and an HP printer attached,
along with a QuickCam:
~$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 03f0:0317 Hewlett-Packard LaserJet 1200
Bus 003 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 046d:09a1 Logitech, Inc. QuickCam Communicate
MP/S5500
Bus 002 Device 002: ID 058f:6364 Alcor Micro Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Now, I plug in the UPS:
Bus 006 Device 002: ID 050d:1100 Belkin Components

And in /dev/usb:
$ ls -l /dev/usb
total 0
crw--- 1 root root 180, 96 2011-07-01 13:30 hiddev0
crw--- 1 root root 180, 97 2011-07-01 13:35 hiddev1
crw-rw 1 root lp   180,  0 2011-07-01 13:30 lp0

Note hiddev1 is not in nut group.

Syslog has this:
Jul  1 13:35:57 gimli kernel: [  370.566651] usb 6-1: new low speed USB
device using uhci_hcd and address 2
Jul  1 13:35:57 gimli kernel: [  371.024582] generic-usb
0003:050D:1100.0004: hiddev0,hidraw2: USB HID v1.11 Device [Belkin  Belkin
UPS] on usb-:00:1d.0-1/input0

Note that hiddev0 is mentioned, but hiddev1 is created.  Is that right? (I
don't know much about udev or usb!) It does create hidraw2.

[At boot time, we had the following in syslog:
logitech 0003:046D:C517.0002: input,hiddev0,hidraw1: USB HID v1.10 Mouse
[Logitech USB Receiver] on usb-:00:1a.0-1/input1
So hiddev0 / hidraw1 is the Logitech mouse/keyboard.]

In /dev I see:
$ ls -l /dev/hid*
crw--- 1 root root 251, 0 2011-07-01 13:30 /dev/hidraw0
crw--- 1 root root 251, 1 2011-07-01 13:30 /dev/hidraw1
crw--- 1 root root 251, 2 2011-07-01 13:35 /dev/hidraw2




  But I tried one more thing.  I powered down the UPS completely and
 restarted
  everything.  (I wondered if the Belkin's USB was hung up.)  Now, I get
  something different:
 
  $ sudo /lib/nut/usbhid-ups -a mybelkin
  Network UPS Tools - Generic HID driver 0.35 (2.6.0)
  USB communication driver 0.31
  Using subdriver: Belkin HID 0.12
  libusb_get_report: error sending control message: Operation not permitted
  libusb_get_report: error sending control message: Operation not permitted
  Can't initialize data from HID UPS
 
  and
  $ ls -l /dev/usb
  total 0
  crw--- 1 root root 180, 96 2011-06-25 18:58 hiddev0
  crw-rw 1 root lp   180,  0 2011-06-25 18:58 lp0
  martin@gimli:~$ ls -l /dev/bus/usb/006/001
  crw-rw-r-- 1 root root 189, 640 2011-06-25 18:58 /dev/bus/usb/006/001
 
  If I try -u root
  $ sudo /lib/nut/usbhid-ups -a mybelkin -u root
  Network UPS Tools - Generic HID driver 0.35 (2.6.0)
  USB communication driver 0.31
  Using subdriver: Belkin HID 0.12
  libusb_get_report: No error
  libusb_get_report: No error
  libusb_get_report: No error
  libusb_get_report: No error
  libusb_get_report: No error
  libusb_get_report: No error
  libusb_get_report: No error
  ...

 This was fixed in v2.6.1, or more specifically, in r2893:

 http://trac.networkupstools.org/projects/nut/changeset/2893

 Can you file 

Re: [Nut-upsuser] Belkin F6C1200-UNV on Ubuntu 11.04

2011-07-01 Thread Charles Lepple

On Jul 1, 2011, at 2:15 PM, Martin Ewing wrote:

Note that hiddev0 is mentioned, but hiddev1 is created.  Is that  
right? (I don't know much about udev or usb!) It does create hidraw2.


hiddev* and hidraw* are red herrings - the NUT drivers use  
libusb-0.1.x, which uses /dev/bus/usb/*/* instead. Once the NUT driver  
tells the kernel that it wants exclusive access to the HID interface,  
those device nodes should go away.


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


Re: [Nut-upsuser] Belkin F6C1200-UNV on Ubuntu 11.04

2011-06-29 Thread Charles Lepple
On Sat, Jun 25, 2011 at 7:15 PM, Martin Ewing martin.s.ew...@gmail.com wrote:

 On Sat, Jun 25, 2011 at 5:48 PM, Charles Lepple clep...@gmail.com wrote:

 On Jun 24, 2011, at 8:50 PM, Martin Ewing wrote:

 I had been using NUT's Ubuntu package (64 bit) with no problems until
 upgrading to Ubuntu 11.04.

 What was the previous NUT package version?

^^^ Previous question still stands. Is there an upgrade log
(/var/log/dpkg.log or similar) which mentions the old .deb version?

 If I have time later this weekend, I'll swap out that UPS for one which
 uses the usbhid-ups driver and see if I can reproduce the problem.

I seem to have hardware problems with the UPS which is compatible with
that driver, so I can't test with usbhid-ups.

 Device:
 $ ls -l /dev/bus/usb/006/001
 crw-rw-r-- 1 root root 189, 640 2011-06-24 18:29 /dev/bus/usb/006/001

 Not in group nut.

I think that part might be a bug in Ubuntu's combination of NUT and
udev (at some point, udev changed the way it matches USB devices). Are
there any messages from udev in syslog?

 But I tried one more thing.  I powered down the UPS completely and restarted
 everything.  (I wondered if the Belkin's USB was hung up.)  Now, I get
 something different:

 $ sudo /lib/nut/usbhid-ups -a mybelkin
 Network UPS Tools - Generic HID driver 0.35 (2.6.0)
 USB communication driver 0.31
 Using subdriver: Belkin HID 0.12
 libusb_get_report: error sending control message: Operation not permitted
 libusb_get_report: error sending control message: Operation not permitted
 Can't initialize data from HID UPS

 and
 $ ls -l /dev/usb
 total 0
 crw--- 1 root root 180, 96 2011-06-25 18:58 hiddev0
 crw-rw 1 root lp   180,  0 2011-06-25 18:58 lp0
 martin@gimli:~$ ls -l /dev/bus/usb/006/001
 crw-rw-r-- 1 root root 189, 640 2011-06-25 18:58 /dev/bus/usb/006/001

 If I try -u root
 $ sudo /lib/nut/usbhid-ups -a mybelkin -u root
 Network UPS Tools - Generic HID driver 0.35 (2.6.0)
 USB communication driver 0.31
 Using subdriver: Belkin HID 0.12
 libusb_get_report: No error
 libusb_get_report: No error
 libusb_get_report: No error
 libusb_get_report: No error
 libusb_get_report: No error
 libusb_get_report: No error
 libusb_get_report: No error
 ...

This was fixed in v2.6.1, or more specifically, in r2893:

http://trac.networkupstools.org/projects/nut/changeset/2893

Can you file a bug? A similar problem was filed here:

https://bugs.launchpad.net/ubuntu/+source/nut/+bug/572262

and here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583371

-- 
- Charles Lepple

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


Re: [Nut-upsuser] Belkin F6C1200-UNV on Ubuntu 11.04

2011-06-25 Thread Martin Ewing
On Sat, Jun 25, 2011 at 5:48 PM, Charles Lepple clep...@gmail.com wrote:

 On Jun 24, 2011, at 8:50 PM, Martin Ewing wrote:

  I had been using NUT's Ubuntu package (64 bit) with no problems until
 upgrading to Ubuntu 11.04.


 What was the previous NUT package version?


  Now, I get the following message when I try usbhid-ups:

 $ sudo /lib/nut/usbhid-ups -a mybelkin
 Network UPS Tools - Generic HID driver 0.35 (2.6.0)
 USB communication driver 0.31
 Can't claim USB device [050d:1100]: could not detach kernel driver from
 interface 0: Operation not permitted


 Do you get the same error if you add -u root to the command line? If so,
 there might be something other than filesystem permissions causing this
 error.


  ups.conf:
 [mybelkin]
driver = usbhid-ups
port = auto
desc = Belkin 1200 VA UPS

 The udev rule seems OK:
 #  F6C1100-UNV, F6C1200-UNV  - usbhid-ups
 ATTR{idVendor}==050d, ATTR{idProduct}==1100, MODE=664, GROUP=nut

 Using udevadm monitor and plugging in the USB:
 KERNEL[1308961682.706704] add  
 /devices/pci:00/:00:**1d.0/usb6/6-1
 (usb)
 KERNEL[1308961682.709615] add  
 /devices/pci:00/:00:**1d.0/usb6/6-1/6-1:1.0
 (usb)
 KERNEL[1308961682.709674] add  /devices/pci:00/:00:**
 1d.0/usb6/6-1/6-1:1.0/0003:**050D:1100.0007 (hid)
 KERNEL[1308961682.979776] add  /devices/pci:00/:00:**
 1d.0/usb6/6-1/6-1:1.0/usb/**hiddev0 (usb)
 KERNEL[1308961682.979802] add  /devices/pci:00/:00:**
 1d.0/usb6/6-1/6-1:1.0/0003:**050D:1100.0007/hidraw/hidraw0 (hidraw)

 However, the usb devices are created in root group and without read access
 to nut group.
 $ ls -l /dev/usb
 crw--- 1 root root 180, 96 2011-06-24 20:43 hiddev0


 This device would disappear if the detach error hadn't occurred.

 Around the time of the first udev event listed above, udev should have
 created /dev/bus/usb/006/001, and that node should be owned by group nut.

 I just upgraded to 11.04, and the tripplite_usb driver did not have a
 problem attaching to it. (This driver uses the same method of detaching the
 kernel HID driver as usbhid-ups.)

 If I have time later this weekend, I'll swap out that UPS for one which
 uses the usbhid-ups driver and see if I can reproduce the problem.


Charles,


Tried -u root -- different response, but still not right:

$ sudo /lib/nut/usbhid-ups -a mybelkin -u root
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12
libusb_get_report: could not claim interface 0: Device or resource busy
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

Device:
$ ls -l /dev/bus/usb/006/001
crw-rw-r-- 1 root root 189, 640 2011-06-24 18:29 /dev/bus/usb/006/001

Not in group nut.

But I tried one more thing.  I powered down the UPS completely and restarted
everything.  (I wondered if the Belkin's USB was hung up.)  Now, I get
something different:

$ sudo /lib/nut/usbhid-ups -a mybelkin
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12
libusb_get_report: error sending control message: Operation not permitted
libusb_get_report: error sending control message: Operation not permitted
Can't initialize data from HID UPS

and
$ ls -l /dev/usb
total 0
crw--- 1 root root 180, 96 2011-06-25 18:58 hiddev0
crw-rw 1 root lp   180,  0 2011-06-25 18:58 lp0
martin@gimli:~$ ls -l /dev/bus/usb/006/001
crw-rw-r-- 1 root root 189, 640 2011-06-25 18:58 /dev/bus/usb/006/001

If I try -u root
$ sudo /lib/nut/usbhid-ups -a mybelkin -u root
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
...

and now there is a process
 3544 ?Ss 0:00 /lib/nut/usbhid-ups -a mybelkin -u root

I think I am understanding less and less!

Martin
-- 
Martin Ewing
Branford, Connecticut
martin.s.ew...@gmail.com
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser