[Nut-upsdev] Re: apc-hid tests, ups_status updates

Alfred Ganz alfred-ganz+nut at agci.com
Sat Oct 8 17:43:47 UTC 2005


Peter,

On October 4 you wrote:
	> except for the cleaning up of ups.status: 
	> as presented by upsc that I reported earlier. I suspect that that cleanup 
	> is generic to newhidups, because a couple of month ago Arnaud made some 
	> changes for cleaning up LB with OL once the battery is adequately
	> charged, a problem that looks rather similar to me.
	
	I don't know. It is normal for some UPSs to show "OL CHRG" even when
	the battery is full. About "OL DISCHRG", I am not so sure. I know the
	status info usually comes directly from the UPS, so it might not be a
	driver issue at all, but I don't know.
I finally had a chance to look at the code and at some debug output from 
newhidups. Here is an extract from the debug output running with my 
APC/Back-UPS ES 650 for the processing of the PowerSummary.PresentStatus
variables Discharging and Charging:
    ...
    entering string_to_path()
    Looking up UPS
    Looking up PowerSummary
    Looking up PresentStatus
    Looking up Discharging
    Report : (5 bytes) => 16 0C 00 00 00
    hu_find_infoval: searching for value = 0
    
    hu_find_infoval: no matching INFO_* value for this HID value (0)
    
    entering string_to_path()
    Looking up UPS
    Looking up PowerSummary
    Looking up PresentStatus
    Looking up Charging
    Report : (5 bytes) => 16 0C 00 00 00
    hu_find_infoval: searching for value = 0
    
    hu_find_infoval: no matching INFO_* value for this HID value (0)

    entering string_to_path()
    ...
Whereas the output for BelowRemainingCapacityLimit, the code for which 
Arnaud fixed, shows like this:
    ...
    Looking up UPS
    Looking up PowerSummary
    Looking up PresentStatus
    Looking up ShutdownImminent
    Report : (5 bytes) => 16 0C 00 00 00
    hu_find_infoval: searching for value = 0
    
    hu_find_infoval: found !LB (value: 0)
    
    process_status_info: !LB
    ...
The fix that Arnaud added for !LB does two things:
* it adds an internal status for !LB in shutdownimm_info[], when the 
  variable PowerSummary.PresentStatus.BelowRemainingCapacityLimit is 
  returned as zero.
* the function process_status_info() clears the real status STATUS_LB
  if the internal status is set to !LB.
It seems to me that the reason for the persistance of either "OL DISCHRG"
or "OL CHRG" is due to the fact that the reports for zero values for the 
variables Discharging and Charging are in essence ignored.

Question, is there a reason why the PowerSummary.PresentStatus variables
Discharging and Charging are not handled in a similar fashion? If not,
could this be changed?

Thanks, AG

-- 
 ----------------------------------------------------------------------
   Alfred Ganz					alfred-ganz at agci.com
   AG Consulting, Inc.				(203) 624-9667
   440 Prospect Street # 11
   New Haven, CT 06511
 ----------------------------------------------------------------------



More information about the Nut-upsdev mailing list