[Nut-upsdev] newhidups... at last.

Peter Selinger selinger at mathstat.dal.ca
Fri Jan 13 05:17:45 UTC 2006


Dear Patrick,

> [root at 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 at 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 at 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 at 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 at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
> 




More information about the Nut-upsdev mailing list