[Nut-upsdev] [Nut-upsuser] Plexus UPS 1000V - megatec_usb

Arjen de Korte nut+devel at de-korte.org
Fri Dec 28 19:26:02 UTC 2007


Carlos Rodrigues wrote:

> In megatec I use a status that's not available in "new-drivers.txt":
> FAILED. Since I have no idea in what situations this flag is raised I
> can't just use "RB" (and I think FAILED is more general, like "there's
> something wrong with the UPS, but I have no idea what").

Do you mean 'UPS Failed' from the list of status bits in the megatec
protocol description?

UPS status :
Bit 	            Description                 	
 7  	1 : Utility Fail (Immediate)            	
 6  	1 : Battery Low                         	
 5  	1 : Bypass/Boost or Buck Active                 	
 4  	1 : UPS Failed                          	
 3  	1 : UPS Type is Standby (0 is On_line)  	
 2  	1 : Test in Progress                    	
 1  	1 : Shutdown Active                     	
 0  	1 : Beeper On                             	

> Since only megatec uses it (from a quick grep), what you suppose I
> shall do with it? I think there should be a catch-all status for
> failures in the acceptable status list.

We already have something for that, through the alarm_(init|set|commit)
functions. It works in pretty much the same way as setting the status.
Different from the status_set() function, the alarm_set() function has
an opaque string, so you can put anything you need in it. For instance,
in the usbhid-ups driver, we have

	alarm_set("Internal UPS fault!");

Only changes in UPS state that require immediate attention (and usually
are dealt with automatically) should be in 'ups.status'. Something like
a broken UPS needs human intervention anyway, so this can never be dealt
with automatically. The exception to this rule, is the RB (Replace
Battery) status, that already existed before we had the alarm_*
functions and needs to stay that way for backwards compatibility.

If you set an alarm, 'ALARM' will be prepended to 'ups.status' and in
'ups.alarm' you'll find a description of what went wrong.

Best regards, Arjen



More information about the Nut-upsdev mailing list