[Nut-upsdev] (no subject)

Doug Anderson daju at disordat.com
Wed Dec 28 05:28:08 UTC 2005


I'd like to submit a patch to the 'hidups' driver.  I'm a bit new to 
open-source development model, so I hope I'm not committing a faux paus by 
just posting it here.  I did verify that the problem still exists (by 
source code inspection) in the latest dev snapshot, which is 
nut-2.0.3-pre2.  I'm using nut-2.0.2 myself.

The problem is when I'm connecting to my APC UPS using the hiddev driver. 
I get error messages every 5 seconds in my syslog that look like:

   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x8500d1 (1)
   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x850043 (0)
   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x840073 (0)
   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x85004b (0)
   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x840065 (0)
   Dec 27 19:18:39 localhost hidups[20886]: Unhandled event: 0x8500db (0)
   Dec 27 19:18:39 localhost hidups[20886]: Ignoring x86 page event
   0xff860060 (8)

The device seems to work just fine, even with those warnings.  However, 
they appear every 5 seconds, so it's pretty annoying.  My "fix" is to just 
comment out those messages.  Here's the patch, which is pretty simple:

--- hidups.c    2005-12-22 06:40:27.000000000 -0800
+++ new/hidups.c 2005-12-27 21:26:02.000000000 -0800
@@ -115,8 +115,12 @@ static void parse_event(struct hiddev_ev

         /* x86 page == ups-specific, ignore these for now */
         if ((ev->hid & 0x860000) == 0x860000) {
+               /* This warning repeats every 5 seconds, and things
+                  work fine without it, so I've commented it out...
+
                 upslogx(LOG_INFO, "Ignoring x86 page event 0x%x (%d)",
                  ev->hid, ev->value);
+               */
                 return;
         }

@@ -176,8 +180,13 @@ static void parse_event(struct hiddev_ev
                  break;

                 default:
+                /* This warning repeats every 5 seconds, and things
+                   work fine without it, so I've commented it out.
+
                  upslogx(LOG_INFO, "Unhandled event: 0x%x (%d)",
                         ev->hid, ev->value);
+                */
+                break;
         }

         /* deal with any status changes */


I don't have my UPS in front of me, but NUT detects it as:
   Detected American Power Conversion Back-UPS RS 1000 FW:7.g7 .D USB FW:g7

That UPS didn't work with the 'newhidups' driver (in 2.0.2, anyway).  A 
google search turned up several other people asking about the same 
problem, so it's probably worth a fix, but it's up to you of course.

Enjoy.




More information about the Nut-upsdev mailing list