[Nut-upsdev] feature request -- talk to the router, not the UPS

Charles Lepple clepple at gmail.com
Wed Jun 4 01:43:55 UTC 2014


On Jun 3, 2014, at 9:10 PM, Ted Mittelstaedt wrote:

> On 6/2/2014 6:28 AM, Charles Lepple wrote:
>> There was also this discussion last summer (similar to Ted's printer idea, but lower power):
>> 
>> http://news.gmane.org/find-root.php?message_id=20130703045347.55D4172182%40mail.gishpuppy.com
>> 
> 
> That one does not monitor for low battery.

I'm not saying I would do that, but a lot of people seem to only want an on-battery notification, and a shutdown timer if it stays on battery too long.

>> I'm not a huge fan of polling when edge-triggered events are available. (That said, dummy-ups polls its state file once a second, and that could be improved upon with something like inotify.)

Forget I said that - it's masked by the inherent polling loop in drivers/main.c. All of the NUT drivers poll at some frequency, and upsd makes sure they update often enough to not be considered stale.

Re-reading the state file for dummy-ups each time probably isn't a big deal, but I will openly admit I haven't benchmarked this.

> Say what?  A lot of those setups connect DSR to the relay contact and when that line isn't raised high the serial port under UNIX is closed - why does the generic UPS driver still attempt to poll it?????  Sloppy
> coding?

Or maybe just the desire to interface with models which don't wire their ports that way?

(I should clarify what I mean by "poll": I'm referring to a select() loop with a timeout, so this is not buzz-looping.)

> The hardware design is so that the driver can go to open the com port then just block until DSR is asserted.  Then you can start the polling, looking for the CD line to go high (indicating a low battery)

Tell that to the designers of the 20 other UPS configurations that are listed in genericups.h ;-)

Note that some of those configurations don't even support a positive shutdown signal from the PC.

>> In most cases, you can add a devd (FreeBSD) or udev (Linux) rule that triggers when a device disappears, without affecting normal operation of that device while it is connected. Both devd and udev will simply run all of the matching rules when the specified action occurs.
>> 
> 
> the hack posted (inserting a relay in a spare mouse, really!?!?) that you linked to is really unbelievable.


We all have different standards for reliability. None of my machines have contact-closure UPSes, but someone else might come along and point out that I really should have dual power supplies.

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsdev mailing list