Hi Arnaud, hi all I wish you all the best for 2006. Enjoying of some less stressed time, I follow your advice, Arnaud, to switch our UPS management on the newhidups driver. ( Enfin ! ;) Our goal is to support (soon) the new MGE ASR ELLIPSE ( and of course also the old ELLIPSE and EXTREME models ). I rebuild the libusb-0.1.10a packages to conform to our installation process. I perform the same operation for the hotplug-2004_09_23-1 package. And finally also rebuild the nut and nut-server packages based on 2.0.3-pre2 version. Launching the driver manually output following messages : [root@xa000000 002]# /sbin/newhidups -a ups_on_usb -DDDDD Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.0) debug level is '5' Checking device (0000/0000) (002/001) - VendorID: 0000 - ProductID: 0000 - Manufacturer: unknown - Product: USB UHCI-alt Root Hub - Serial Number: 1420 - Bus: 002 Trying to match device Device does not match - skipping Checking device (0463/FFFF) (002/014) - VendorID: 0463usbdevfs: process 1111 (newhidups) did not claim interface 0 before use - ProductID: ffff - Manufacturer: MGE - Product: ELLIPSE - Serial Number: unknown - Bus: 002 Trying to match device Device matches failed to claim USB device... Unable to get HID descriptor (error sending control message: Device or resource busy) Checking device (0000/0000) (001/001) - VendorID: 0000 - ProductID: 0000 - Manufacturer: unknown - Product: USB UHCI-alt Root Hub - Serial Number: 1400 - Bus: 001 Trying to match device Device does not match - skipping No appropriate HID device found No matching USB/HID UPS found I read some of your interventions on the list concerning the start of the driver. I looked at the different points you point to and it seems to me that they are correct. I try to give here a list of them. kernel CONFIG flags : CONFIG_HOTPLUG=y CONFIG_INPUT=m CONFIG_USB_HID=m # CONFIG_USB_HIDDEV is not set ups.conf : [ups_on_usb] driver = newhidups port = auto desc = "USB-driven MGE UPS" hotplug status : [root@xa000000 root]# /etc/init.d/hotplug status INPUT status for kernel: Linux 2.4.17-ll-dhs3 i686 INPUT devices: /proc/bus/input/devices not available INPUT handlers: /proc/bus/input/handlers not available PCI Status for kernel: Linux 2.4.17-ll-dhs3 i686 PCI up; bus count is 3 USB Status for kernel: Linux 2.4.17-ll-dhs3 i686 USB up; bus count is 2 T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 P: Vendor=0000 ProdID=0000 Rev= 0.00 I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0 P: Vendor=0463 ProdID=ffff Rev= 0.01 I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=hid T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 P: Vendor=0000 ProdID=0000 Rev= 0.00 I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub USB Drivers Loaded: usbdevfs hub hid usb-storage khubd/hotplug thread: F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 040 S 0 55 1 0 69 0 - 0 end ? 00:00:00 khubd Module Size Used by <...> usb-storage 20304 0 (unused) scsi_mod 52736 0 [usb-storage] vfat 9168 0 (unused) fat 30368 0 [vfat] hid 10576 0 (unused) uhci 18912 0 (unused) usbcore 56800 1 [usb-storage hid uhci] Note : When I unplug the cable, /proc/bus/usb/xxx/yyy ( corresponding to the UPS ) disappear and reappear after replugging with following permissions : [root@xa000000 root]# ls -asl /proc/bus/usb/002/ <...> 0 -rw-rw---- 1 root nobody 18 Jan 11 18:51 002 I also slightly modify the nut.spec to copy the script libhidups and libhid.usermap to the /etc/hotplug/usb directory with the following permissions : 4 -rw-rw---- 1 root nobody 910 Jan 11 16:08 libhid.usermap 4 -rwxr-xr-x 1 root nobody 481 Jan 11 16:08 libhidups I read somewhere that the we unbind the UPS from HID driver at the beginning of the process. Could it be that this unbinding fail so that the next interface claiming also fails with " Device busy" status as shown on the previous traces ? Am I missing any important point to configure ( or to give out here ) ? Thanks in advance for your help. Regards, Patrick Agrain
Hi all, Enabling (again) debug mode on USB Kernel, following output araise on /var/log/messages at plug-in of the UPS. Jan 12 20:08:25 xa000000 kernel: hub.c: new USB device 00:1d.1-2, assigned address 2 Jan 12 20:08:30 xa000000 kernel: : USB HID v1.00 Device [0463:ffff] on usb2:2.0 Jan 12 20:08:30 xa000000 default.hotplug[675]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PAT H=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/002/ 002 INTERFACE=3/0/0 PRODUCT=463/ffff/1 TYPE=0/0/0 DEBUG=kernel _=/usr/bin/env) Jan 12 20:08:30 xa000000 default.hotplug[675]: invoke /etc/hotplug/usb.agent () Jan 12 20:08:33 xa000000 usb.agent[675]: Setup hid for USB product 463/ffff/1 Jan 12 20:08:33 xa000000 usb.agent[675]: Setup libhidups for USB product 463/ffff/1 Jan 12 20:08:33 xa000000 usb.agent[675]: Module setup libhidups for USB product 463/ffff/1 Jan 12 20:11:01 xa000000 kernel: usbdevfs: process 751 (newhidups) did not claim interface 0 before use [root@xa000000 root]# And at unplug : Jan 12 20:14:33 xa000000 kernel: usb.c: USB disconnect on device 00:1d.1-2 address 2 Jan 12 20:14:34 xa000000 default.hotplug[764]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PAT H=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/0 02/002 INTERFACE=3/0/0 PRODUCT=463/ffff/1 TYPE=0/0/0 DEBUG=kernel _=/usr/bin/env) Jan 12 20:14:34 xa000000 default.hotplug[764]: invoke /etc/hotplug/usb.agent () [root@xa000000 root]# Of course, claiming the interface still fails ;-) May it helps. Regards, Patrick Agrain
Dear Patrick,> [root@xa000000 002]# /sbin/newhidups -a ups_on_usb -DDDDD > ... > Unable to get HID descriptor (error sending control message: Device or > resource busy)you need to pass the "-u root" option to newhidups (for testing purposes, to prevent NUT from dropping root privileges). Once this works (and only if it works!), then you need to set up hotplugging, so that the device /proc/bus/usb/xxx/yyy is automatically assigned to the NUT user (not root). See scripts/hotplug/README. -- Peter Patrick Agrain wrote:> > Hi Arnaud, hi all > > I wish you all the best for 2006. > > Enjoying of some less stressed time, I follow your advice, Arnaud, to > switch our UPS management on the newhidups driver. ( Enfin ! ;) > Our goal is to support (soon) the new MGE ASR ELLIPSE ( and of course also > the old ELLIPSE and EXTREME models ). > > I rebuild the libusb-0.1.10a packages to conform to our installation process. > I perform the same operation for the hotplug-2004_09_23-1 package. > And finally also rebuild the nut and nut-server packages based on > 2.0.3-pre2 version. > > Launching the driver manually output following messages : > [root@xa000000 002]# /sbin/newhidups -a ups_on_usb -DDDDD > Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.0) > > debug level is '5' > Checking device (0000/0000) (002/001) > - VendorID: 0000 > - ProductID: 0000 > - Manufacturer: unknown > - Product: USB UHCI-alt Root Hub > - Serial Number: 1420 > - Bus: 002 > Trying to match device > Device does not match - skipping > Checking device (0463/FFFF) (002/014) > - VendorID: 0463usbdevfs: process 1111 (newhidups) did not claim interface > 0 before use > > - ProductID: ffff > - Manufacturer: MGE > - Product: ELLIPSE > - Serial Number: unknown > - Bus: 002 > Trying to match device > Device matches > failed to claim USB device... > Unable to get HID descriptor (error sending control message: Device or > resource busy) > Checking device (0000/0000) (001/001) > - VendorID: 0000 > - ProductID: 0000 > - Manufacturer: unknown > - Product: USB UHCI-alt Root Hub > - Serial Number: 1400 > - Bus: 001 > Trying to match device > Device does not match - skipping > No appropriate HID device found > No matching USB/HID UPS found > > I read some of your interventions on the list concerning the start of the > driver. > I looked at the different points you point to and it seems to me that they > are correct. > I try to give here a list of them. > > kernel CONFIG flags : > CONFIG_HOTPLUG=y > CONFIG_INPUT=m > CONFIG_USB_HID=m > # CONFIG_USB_HIDDEV is not set > > ups.conf : > [ups_on_usb] > driver = newhidups > port = auto > desc = "USB-driven MGE UPS" > > hotplug status : > [root@xa000000 root]# /etc/init.d/hotplug status > INPUT status for kernel: Linux 2.4.17-ll-dhs3 i686 > INPUT devices: > /proc/bus/input/devices not available > INPUT handlers: > /proc/bus/input/handlers not available > PCI Status for kernel: Linux 2.4.17-ll-dhs3 i686 > PCI up; bus count is 3 > USB Status for kernel: Linux 2.4.17-ll-dhs3 i686 > USB up; bus count is 2 > T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 > P: Vendor=0000 ProdID=0000 Rev= 0.00 > I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub > T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0 > P: Vendor=0463 ProdID=ffff Rev= 0.01 > I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=hid > T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 > P: Vendor=0000 ProdID=0000 Rev= 0.00 > I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub > > USB Drivers Loaded: > usbdevfs > hub > hid > usb-storage > > khubd/hotplug thread: > F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD > 040 S 0 55 1 0 69 0 - 0 end ? 00:00:00 khubd > > Module Size Used by > <...> > usb-storage 20304 0 (unused) > scsi_mod 52736 0 [usb-storage] > vfat 9168 0 (unused) > fat 30368 0 [vfat] > hid 10576 0 (unused) > uhci 18912 0 (unused) > usbcore 56800 1 [usb-storage hid uhci] > > Note : When I unplug the cable, /proc/bus/usb/xxx/yyy ( corresponding to > the UPS ) disappear and reappear after replugging with following permissions : > [root@xa000000 root]# ls -asl /proc/bus/usb/002/ > <...> > 0 -rw-rw---- 1 root nobody 18 Jan 11 18:51 002 > > I also slightly modify the nut.spec to copy the script libhidups and > libhid.usermap to the /etc/hotplug/usb directory with the following > permissions : > 4 -rw-rw---- 1 root nobody 910 Jan 11 16:08 libhid.usermap > 4 -rwxr-xr-x 1 root nobody 481 Jan 11 16:08 libhidups > > I read somewhere that the we unbind the UPS from HID driver at the > beginning of the process. > Could it be that this unbinding fail so that the next interface claiming > also fails with " Device busy" status as shown on the previous traces ? > Am I missing any important point to configure ( or to give out here ) ? > > Thanks in advance for your help. > Regards, > Patrick Agrain > > > _______________________________________________ > Nut-upsdev mailing list > Nut-upsdev@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev >
At 06:17 13/01/2006, Peter Selinger wrote: Dear Patrick, > [root@xa000000 002]# /sbin/newhidups -a ups_on_usb -DDDDD > ... > Unable to get HID descriptor (error sending control message: Device or > resource busy) you need to pass the "-u root" option to newhidups (for testing purposes, to prevent NUT from dropping root privileges). Once this works (and only if it works!), then you need to set up hotplugging, so that the device /proc/bus/usb/xxx/yyy is automatically assigned to the NUT user (not root). See scripts/hotplug/README. -- Peter Thanks Peter for your interest. Your webpage was a good entry point for knowledge about newhidups. I removed all concerning hotplug and reboot the system without any USB cable. The plug the UPS cable ( detection is OK, /proc/bus/usb/devices is OK. 002/002 is owned by root:root now ). Launch your command ... and unfortunately get the same ouput : <...> Checking device (0463/FFFF) (002/002) - VendorID: 0463usbdevfs: process 597 (newhidups) did not claim interface 0 before use - ProductID: ffff - Manufacturer: MGE - Product: ELLIPSE - Serial Number: unknown - Bus: 002 Trying to match device Device matches failed to claim USB device... Unable to get HID descriptor (error sending control message: Device or resource busy) <...> In the meantime, Arnaud told me about an unbind problem due to my kernel version (too old). To be followed. Regards, Patrick Agrain