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.
On Tue, 27 Dec 2005, Doug Anderson wrote:> 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 bug seems to be related to some change recent kernel change in the 2.6 releases, though AFAIK nobody's tracked down exactly what. For a while, people were also seeing NUT wasting CPU, in RedHat bug https://bugzilla.redhat.com/160700. I didn't experience the CPU issue, but did get the 5-second syslogging with an APC Back-UPS ES 500 (as reported by upsc).> 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: >[snip]I figured that, while it would still be useful to note those events for development, most users probably don't care. I wrote a patch which just changes the upslogx(LOG_INFO... calls to upsdebugx(2... calls. The patch is online at http://bugs.gentoo.org/attachment.cgi?id=75508, part of Gentoo bug 85296, the generic put-Gentoo-NUT-problems-here bug. My patch also changes the Bogus event LOG_INFO messages to debug messages. I'm not sure if that's desirable.> 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.I haven't tried newhidups with my UPS. -Jonathan
On 12/28/05, Doug Anderson <daju@disordat.com> wrote:> 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.Hopefully it will work with newhidups in 2.0.3 - I tried it with the latest CVS version on a RS 800 (I think) and it worked well. The thing is, we are trying to phase out the 'hidups' driver, so the more feedback you can give us on how newhidups doesn't work, the better. regards, -- - Charles Lepple