[Nut-upsdev] HP R1500 G2

Tim Rice tim at multitalents.net
Sun Apr 11 22:54:47 UTC 2010


Thanks to all that replied to this thread.

On Thu, 8 Apr 2010, Charles Lepple wrote:

> On Wed, Apr 7, 2010 at 9:38 PM, Tim Rice <tim at multitalents.net> wrote:
> > And running it under truus I see thih line
> > 838:    open("/dev/usb/3f0.1fe0/0/cntrl0", O_RDWR)      Err#16 EBUSY
> >
> > So it looks like maybe it was opened in exclusive mode.
> > Any thoughts?
> 
> USB devices generally need to be opened exclusively. (Technically, the
> interfaces are opened exclusively, but most UPSes have only one HID
> interface, and that's what we use.)

OK, I think I have it all figured out now.

Background: Solaris 10 and later has transitioned away from System V style
start/stop scripts to SMF (service management facility). Currently
there is no way to specify that your ups shutdown routines should be the
last thing SMF should run. (Although I have seen some discussion at
opensolaris.org about this)

The way I chose to impliment the solution was to have SHUTDOWNCMD point
to a shell script that temporarly disables the manifest I created for NUT
(so it runs upsdrvctl stop), run upsdrvctl shutdown, then shutdown the OS.
The key is to make sure the offdelay is set high enough so the OS shuts
down before the UPS turns itself off.

In case Arnaud decides to commit his patch to drivers/tripplite-hid.c
here are the coresponding changes to scripts/udev/nut-usbups.rules.in,
scripts/hotplug/libhid.usermap, and scripts/hal/ups-nut-device.fdi.in

---------
#
#	scripts/udev/nut-usbups.rules.in scripts/hotplug/libhid.usermap
#	scripts/hal/ups-nut-device.fdi.in
#	add bits for r1500 G2
#
--- nut-svn/scripts/udev/nut-usbups.rules.in.old	2010-03-30 16:50:52.000000000 -0700
+++ nut-svn/scripts/udev/nut-usbups.rules.in	2010-03-31 13:46:34.220547002 -0700
@@ -18,6 +18,8 @@
 ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f06", MODE="664", GROUP="@RUN_AS_GROUP@"
 #  HP R/T 2200 INTL (like SMART2200RMXL2U)  - usbhid-ups
 ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f0a", MODE="664", GROUP="@RUN_AS_GROUP@"
+#  HP R1500 G2 INTL - usbhid-ups
+ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe0", MODE="664", GROUP="@RUN_AS_GROUP@"
 
 # Eaton
 #  various models  - usbhid-ups
--- nut-svn/scripts/hotplug/libhid.usermap.old	2009-12-15 09:31:02.000000000 -0800
+++ nut-svn/scripts/hotplug/libhid.usermap	2010-03-31 13:51:38.100547003 -0700
@@ -16,6 +16,8 @@
 libhidups      0x0003      0x03f0   0x1f06    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
 #  HP R/T 2200 INTL (like SMART2200RMXL2U) 
 libhidups      0x0003      0x03f0   0x1f0a    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+#  HP R1500 G2 INTL 
+libhidups      0x0003      0x03f0   0x1fe0    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
 
 # Eaton
 #  various models 
--- nut-svn/scripts/hal/ups-nut-device.fdi.in.old	2010-03-25 13:03:19.000000000 -0700
+++ nut-svn/scripts/hal/ups-nut-device.fdi.in	2010-03-31 13:56:13.065587003 -0700
@@ -42,6 +42,13 @@
           <merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
           <merge key="battery.type" type="string">ups</merge>
         </match>
+        <!--  HP R1500 G2 INTL  -->
+        <match key="usb_device.product_id" int="0x1fe0">
+          <append key="info.category" type="string">battery</append>
+          <merge key="info.capabilities" type="strlist">battery</merge>
+          <merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
+          <merge key="battery.type" type="string">ups</merge>
+        </match>
       </match>
 
       <!-- Eaton -->
---------

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net


More information about the Nut-upsdev mailing list